mqtt 5.2.0 → 5.2.2
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/README.md +11 -25
- package/build/index.d.ts +3 -0
- package/build/index.js +32 -0
- package/build/index.js.map +1 -0
- package/build/tsconfig.build.tsbuildinfo +1 -1
- package/dist/mqtt.esm.js +7 -7
- package/dist/mqtt.js +52 -1
- package/dist/mqtt.min.js +7 -7
- package/package.json +14 -6
- package/src/index.ts +4 -0
package/dist/mqtt.min.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
"use strict";var mqtt=(()=>{var Lo=Object.defineProperty;var E_=Object.getOwnPropertyDescriptor;var S_=Object.getOwnPropertyNames;var A_=Object.prototype.hasOwnProperty;var we=(t,e)=>()=>(t&&(e=t(t=0)),e);var M=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Yt=(t,e)=>{for(var r in e)Lo(t,r,{get:e[r],enumerable:!0})},R_=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of S_(e))!A_.call(t,n)&&n!==r&&Lo(t,n,{get:()=>e[n],enumerable:!(i=E_(e,n))||i.enumerable});return t};var K=t=>R_(Lo({},"__esModule",{value:!0}),t);var w=we(()=>{});var R={};Yt(R,{_debugEnd:()=>yc,_debugProcess:()=>gc,_events:()=>xc,_eventsCount:()=>kc,_exiting:()=>Qf,_fatalExceptions:()=>cc,_getActiveHandles:()=>ec,_getActiveRequests:()=>Zf,_kill:()=>rc,_linkedBinding:()=>Kf,_maxListeners:()=>Oc,_preload_modules:()=>Cc,_rawDebug:()=>zf,_startProfilerIdleNotifier:()=>bc,_stopProfilerIdleNotifier:()=>wc,_tickCallback:()=>pc,abort:()=>Ec,addListener:()=>Mc,allowedNodeEnvironmentFlags:()=>lc,arch:()=>kf,argv:()=>Uf,argv0:()=>Ic,assert:()=>uc,binding:()=>Ff,chdir:()=>Hf,config:()=>Jf,cpuUsage:()=>kn,cwd:()=>$f,debugPort:()=>Tc,default:()=>$c,dlopen:()=>Xf,domain:()=>Yf,emit:()=>qc,emitWarning:()=>jf,env:()=>Lf,execArgv:()=>Nf,execPath:()=>Rc,exit:()=>oc,features:()=>fc,hasUncaughtExceptionCaptureCallback:()=>dc,hrtime:()=>xn,kill:()=>sc,listeners:()=>Wc,memoryUsage:()=>nc,moduleLoadList:()=>Gf,nextTick:()=>Bf,off:()=>Uc,on:()=>Bt,once:()=>Lc,openStdin:()=>ac,pid:()=>Sc,platform:()=>Mf,ppid:()=>Ac,prependListener:()=>jc,prependOnceListener:()=>Fc,reallyExit:()=>tc,release:()=>Vf,removeAllListeners:()=>Dc,removeListener:()=>Nc,resourceUsage:()=>ic,setSourceMapsEnabled:()=>Pc,setUncaughtExceptionCaptureCallback:()=>hc,stderr:()=>mc,stdin:()=>vc,stdout:()=>_c,title:()=>xf,umask:()=>Wf,uptime:()=>Bc,version:()=>Df,versions:()=>qf});function Do(t){throw new Error("Node.js process "+t+" is not supported by JSPM core outside of Node.js")}function T_(){!si||!gr||(si=!1,gr.length?Pt=gr.concat(Pt):On=-1,Pt.length&&Pf())}function Pf(){if(!si){var t=setTimeout(T_,0);si=!0;for(var e=Pt.length;e;){for(gr=Pt,Pt=[];++On<e;)gr&&gr[On].run();On=-1,e=Pt.length}gr=null,si=!1,clearTimeout(t)}}function Bf(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];Pt.push(new Of(t,e)),Pt.length===1&&!si&&setTimeout(Pf,0)}function Of(t,e){this.fun=t,this.array=e}function Ie(){}function Kf(t){Do("_linkedBinding")}function Xf(t){Do("dlopen")}function Zf(){return[]}function ec(){return[]}function uc(t,e){if(!t)throw new Error(e||"assertion error")}function dc(){return!1}function Bc(){return Qt.now()/1e3}function xn(t){var e=Math.floor((Date.now()-Qt.now())*.001),r=Qt.now()*.001,i=Math.floor(r)+e,n=Math.floor(r%1*1e9);return t&&(i=i-t[0],n=n-t[1],n<0&&(i--,n+=No)),[i,n]}function Bt(){return $c}function Wc(t){return[]}var Pt,si,gr,On,xf,kf,Mf,Lf,Uf,Nf,Df,qf,jf,Ff,Wf,$f,Hf,Vf,zf,Gf,Yf,Qf,Jf,tc,rc,kn,ic,nc,sc,oc,ac,lc,fc,cc,hc,pc,gc,yc,bc,wc,_c,mc,vc,Ec,Sc,Ac,Rc,Tc,Ic,Cc,Pc,Qt,Uo,No,Oc,xc,kc,Mc,Lc,Uc,Nc,Dc,qc,jc,Fc,$c,Hc=we(()=>{w();m();_();Pt=[],si=!1,On=-1;Of.prototype.run=function(){this.fun.apply(null,this.array)};xf="browser",kf="x64",Mf="browser",Lf={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},Uf=["/usr/bin/node"],Nf=[],Df="v16.8.0",qf={},jf=function(t,e){console.warn((e?e+": ":"")+t)},Ff=function(t){Do("binding")},Wf=function(t){return 0},$f=function(){return"/"},Hf=function(t){},Vf={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};zf=Ie,Gf=[];Yf={},Qf=!1,Jf={};tc=Ie,rc=Ie,kn=function(){return{}},ic=kn,nc=kn,sc=Ie,oc=Ie,ac=Ie,lc={};fc={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},cc=Ie,hc=Ie;pc=Ie,gc=Ie,yc=Ie,bc=Ie,wc=Ie,_c=void 0,mc=void 0,vc=void 0,Ec=Ie,Sc=2,Ac=1,Rc="/bin/usr/node",Tc=9229,Ic="node",Cc=[],Pc=Ie,Qt={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};Qt.now===void 0&&(Uo=Date.now(),Qt.timing&&Qt.timing.navigationStart&&(Uo=Qt.timing.navigationStart),Qt.now=()=>Date.now()-Uo);No=1e9;xn.bigint=function(t){var e=xn(t);return typeof BigInt>"u"?e[0]*No+e[1]:BigInt(e[0]*No)+BigInt(e[1])};Oc=10,xc={},kc=0;Mc=Bt,Lc=Bt,Uc=Bt,Nc=Bt,Dc=Bt,qc=Ie,jc=Bt,Fc=Bt;$c={version:Df,versions:qf,arch:kf,platform:Mf,release:Vf,_rawDebug:zf,moduleLoadList:Gf,binding:Ff,_linkedBinding:Kf,_events:xc,_eventsCount:kc,_maxListeners:Oc,on:Bt,addListener:Mc,once:Lc,off:Uc,removeListener:Nc,removeAllListeners:Dc,emit:qc,prependListener:jc,prependOnceListener:Fc,listeners:Wc,domain:Yf,_exiting:Qf,config:Jf,dlopen:Xf,uptime:Bc,_getActiveRequests:Zf,_getActiveHandles:ec,reallyExit:tc,_kill:rc,cpuUsage:kn,resourceUsage:ic,memoryUsage:nc,kill:sc,exit:oc,openStdin:ac,allowedNodeEnvironmentFlags:lc,assert:uc,features:fc,_fatalExceptions:cc,setUncaughtExceptionCaptureCallback:hc,hasUncaughtExceptionCaptureCallback:dc,emitWarning:jf,nextTick:Bf,_tickCallback:pc,_debugProcess:gc,_debugEnd:yc,_startProfilerIdleNotifier:bc,_stopProfilerIdleNotifier:wc,stdout:_c,stdin:vc,stderr:mc,abort:Ec,umask:Wf,chdir:Hf,cwd:$f,env:Lf,title:xf,argv:Uf,execArgv:Nf,pid:Sc,ppid:Ac,execPath:Rc,debugPort:Tc,hrtime:xn,argv0:Ic,_preload_modules:Cc,setSourceMapsEnabled:Pc}});var _=we(()=>{Hc()});var _e={};Yt(_e,{Buffer:()=>O,INSPECT_MAX_BYTES:()=>B_,default:()=>Jt,kMaxLength:()=>O_});function I_(){if(Vc)return qi;Vc=!0,qi.byteLength=a,qi.toByteArray=c,qi.fromByteArray=g;for(var t=[],e=[],r=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n<o;++n)t[n]=i[n],e[i.charCodeAt(n)]=n;e["-".charCodeAt(0)]=62,e["_".charCodeAt(0)]=63;function s(y){var v=y.length;if(v%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var E=y.indexOf("=");E===-1&&(E=v);var A=E===v?0:4-E%4;return[E,A]}function a(y){var v=s(y),E=v[0],A=v[1];return(E+A)*3/4-A}function l(y,v,E){return(v+E)*3/4-E}function c(y){var v,E=s(y),A=E[0],T=E[1],B=new r(l(y,A,T)),I=0,N=T>0?A-4:A,D;for(D=0;D<N;D+=4)v=e[y.charCodeAt(D)]<<18|e[y.charCodeAt(D+1)]<<12|e[y.charCodeAt(D+2)]<<6|e[y.charCodeAt(D+3)],B[I++]=v>>16&255,B[I++]=v>>8&255,B[I++]=v&255;return T===2&&(v=e[y.charCodeAt(D)]<<2|e[y.charCodeAt(D+1)]>>4,B[I++]=v&255),T===1&&(v=e[y.charCodeAt(D)]<<10|e[y.charCodeAt(D+1)]<<4|e[y.charCodeAt(D+2)]>>2,B[I++]=v>>8&255,B[I++]=v&255),B}function h(y){return t[y>>18&63]+t[y>>12&63]+t[y>>6&63]+t[y&63]}function d(y,v,E){for(var A,T=[],B=v;B<E;B+=3)A=(y[B]<<16&16711680)+(y[B+1]<<8&65280)+(y[B+2]&255),T.push(h(A));return T.join("")}function g(y){for(var v,E=y.length,A=E%3,T=[],B=16383,I=0,N=E-A;I<N;I+=B)T.push(d(y,I,I+B>N?N:I+B));return A===1?(v=y[E-1],T.push(t[v>>2]+t[v<<4&63]+"==")):A===2&&(v=(y[E-2]<<8)+y[E-1],T.push(t[v>>10]+t[v>>4&63]+t[v<<2&63]+"=")),T.join("")}return qi}function C_(){if(zc)return Mn;zc=!0;return Mn.read=function(t,e,r,i,n){var o,s,a=n*8-i-1,l=(1<<a)-1,c=l>>1,h=-7,d=r?n-1:0,g=r?-1:1,y=t[e+d];for(d+=g,o=y&(1<<-h)-1,y>>=-h,h+=a;h>0;o=o*256+t[e+d],d+=g,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=i;h>0;s=s*256+t[e+d],d+=g,h-=8);if(o===0)o=1-c;else{if(o===l)return s?NaN:(y?-1:1)*(1/0);s=s+Math.pow(2,i),o=o-c}return(y?-1:1)*s*Math.pow(2,o-i)},Mn.write=function(t,e,r,i,n,o){var s,a,l,c=o*8-n-1,h=(1<<c)-1,d=h>>1,g=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=i?0:o-1,v=i?1:-1,E=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+d>=1?e+=g/l:e+=g*Math.pow(2,1-d),e*l>=2&&(s++,l/=2),s+d>=h?(a=0,s=h):s+d>=1?(a=(e*l-1)*Math.pow(2,n),s=s+d):(a=e*Math.pow(2,d-1)*Math.pow(2,n),s=0));n>=8;t[r+y]=a&255,y+=v,a/=256,n-=8);for(s=s<<n|a,c+=n;c>0;t[r+y]=s&255,y+=v,s/=256,c-=8);t[r+y-v]|=E*128},Mn}function P_(){if(Gc)return yr;Gc=!0;let t=I_(),e=C_(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;yr.Buffer=s,yr.SlowBuffer=T,yr.INSPECT_MAX_BYTES=50;let i=2147483647;yr.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=n(),!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function n(){try{let p=new Uint8Array(1),u={foo:function(){return 42}};return Object.setPrototypeOf(u,Uint8Array.prototype),Object.setPrototypeOf(p,u),p.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(p){if(p>i)throw new RangeError('The value "'+p+'" is invalid for option "size"');let u=new Uint8Array(p);return Object.setPrototypeOf(u,s.prototype),u}function s(p,u,f){if(typeof p=="number"){if(typeof u=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return h(p)}return a(p,u,f)}s.poolSize=8192;function a(p,u,f){if(typeof p=="string")return d(p,u);if(ArrayBuffer.isView(p))return y(p);if(p==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof p);if(at(p,ArrayBuffer)||p&&at(p.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(at(p,SharedArrayBuffer)||p&&at(p.buffer,SharedArrayBuffer)))return v(p,u,f);if(typeof p=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let b=p.valueOf&&p.valueOf();if(b!=null&&b!==p)return s.from(b,u,f);let S=E(p);if(S)return S;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof p[Symbol.toPrimitive]=="function")return s.from(p[Symbol.toPrimitive]("string"),u,f);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof p)}s.from=function(p,u,f){return a(p,u,f)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function l(p){if(typeof p!="number")throw new TypeError('"size" argument must be of type number');if(p<0)throw new RangeError('The value "'+p+'" is invalid for option "size"')}function c(p,u,f){return l(p),p<=0?o(p):u!==void 0?typeof f=="string"?o(p).fill(u,f):o(p).fill(u):o(p)}s.alloc=function(p,u,f){return c(p,u,f)};function h(p){return l(p),o(p<0?0:A(p)|0)}s.allocUnsafe=function(p){return h(p)},s.allocUnsafeSlow=function(p){return h(p)};function d(p,u){if((typeof u!="string"||u==="")&&(u="utf8"),!s.isEncoding(u))throw new TypeError("Unknown encoding: "+u);let f=B(p,u)|0,b=o(f),S=b.write(p,u);return S!==f&&(b=b.slice(0,S)),b}function g(p){let u=p.length<0?0:A(p.length)|0,f=o(u);for(let b=0;b<u;b+=1)f[b]=p[b]&255;return f}function y(p){if(at(p,Uint8Array)){let u=new Uint8Array(p);return v(u.buffer,u.byteOffset,u.byteLength)}return g(p)}function v(p,u,f){if(u<0||p.byteLength<u)throw new RangeError('"offset" is outside of buffer bounds');if(p.byteLength<u+(f||0))throw new RangeError('"length" is outside of buffer bounds');let b;return u===void 0&&f===void 0?b=new Uint8Array(p):f===void 0?b=new Uint8Array(p,u):b=new Uint8Array(p,u,f),Object.setPrototypeOf(b,s.prototype),b}function E(p){if(s.isBuffer(p)){let u=A(p.length)|0,f=o(u);return f.length===0||p.copy(f,0,0,u),f}if(p.length!==void 0)return typeof p.length!="number"||Mo(p.length)?o(0):g(p);if(p.type==="Buffer"&&Array.isArray(p.data))return g(p.data)}function A(p){if(p>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return p|0}function T(p){return+p!=p&&(p=0),s.alloc(+p)}s.isBuffer=function(u){return u!=null&&u._isBuffer===!0&&u!==s.prototype},s.compare=function(u,f){if(at(u,Uint8Array)&&(u=s.from(u,u.offset,u.byteLength)),at(f,Uint8Array)&&(f=s.from(f,f.offset,f.byteLength)),!s.isBuffer(u)||!s.isBuffer(f))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(u===f)return 0;let b=u.length,S=f.length;for(let C=0,k=Math.min(b,S);C<k;++C)if(u[C]!==f[C]){b=u[C],S=f[C];break}return b<S?-1:S<b?1:0},s.isEncoding=function(u){switch(String(u).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}},s.concat=function(u,f){if(!Array.isArray(u))throw new TypeError('"list" argument must be an Array of Buffers');if(u.length===0)return s.alloc(0);let b;if(f===void 0)for(f=0,b=0;b<u.length;++b)f+=u[b].length;let S=s.allocUnsafe(f),C=0;for(b=0;b<u.length;++b){let k=u[b];if(at(k,Uint8Array))C+k.length>S.length?(s.isBuffer(k)||(k=s.from(k)),k.copy(S,C)):Uint8Array.prototype.set.call(S,k,C);else if(s.isBuffer(k))k.copy(S,C);else throw new TypeError('"list" argument must be an Array of Buffers');C+=k.length}return S};function B(p,u){if(s.isBuffer(p))return p.length;if(ArrayBuffer.isView(p)||at(p,ArrayBuffer))return p.byteLength;if(typeof p!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof p);let f=p.length,b=arguments.length>2&&arguments[2]===!0;if(!b&&f===0)return 0;let S=!1;for(;;)switch(u){case"ascii":case"latin1":case"binary":return f;case"utf8":case"utf-8":return ko(p).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f*2;case"hex":return f>>>1;case"base64":return Cf(p).length;default:if(S)return b?-1:ko(p).length;u=(""+u).toLowerCase(),S=!0}}s.byteLength=B;function I(p,u,f){let b=!1;if((u===void 0||u<0)&&(u=0),u>this.length||((f===void 0||f>this.length)&&(f=this.length),f<=0)||(f>>>=0,u>>>=0,f<=u))return"";for(p||(p="utf8");;)switch(p){case"hex":return d_(this,u,f);case"utf8":case"utf-8":return ei(this,u,f);case"ascii":return Oo(this,u,f);case"latin1":case"binary":return h_(this,u,f);case"base64":return Te(this,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return p_(this,u,f);default:if(b)throw new TypeError("Unknown encoding: "+p);p=(p+"").toLowerCase(),b=!0}}s.prototype._isBuffer=!0;function N(p,u,f){let b=p[u];p[u]=p[f],p[f]=b}s.prototype.swap16=function(){let u=this.length;if(u%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let f=0;f<u;f+=2)N(this,f,f+1);return this},s.prototype.swap32=function(){let u=this.length;if(u%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let f=0;f<u;f+=4)N(this,f,f+3),N(this,f+1,f+2);return this},s.prototype.swap64=function(){let u=this.length;if(u%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let f=0;f<u;f+=8)N(this,f,f+7),N(this,f+1,f+6),N(this,f+2,f+5),N(this,f+3,f+4);return this},s.prototype.toString=function(){let u=this.length;return u===0?"":arguments.length===0?ei(this,0,u):I.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(u){if(!s.isBuffer(u))throw new TypeError("Argument must be a Buffer");return this===u?!0:s.compare(this,u)===0},s.prototype.inspect=function(){let u="",f=yr.INSPECT_MAX_BYTES;return u=this.toString("hex",0,f).replace(/(.{2})/g,"$1 ").trim(),this.length>f&&(u+=" ... "),"<Buffer "+u+">"},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(u,f,b,S,C){if(at(u,Uint8Array)&&(u=s.from(u,u.offset,u.byteLength)),!s.isBuffer(u))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof u);if(f===void 0&&(f=0),b===void 0&&(b=u?u.length:0),S===void 0&&(S=0),C===void 0&&(C=this.length),f<0||b>u.length||S<0||C>this.length)throw new RangeError("out of range index");if(S>=C&&f>=b)return 0;if(S>=C)return-1;if(f>=b)return 1;if(f>>>=0,b>>>=0,S>>>=0,C>>>=0,this===u)return 0;let k=C-S,$=b-f,fe=Math.min(k,$),oe=this.slice(S,C),ce=u.slice(f,b);for(let re=0;re<fe;++re)if(oe[re]!==ce[re]){k=oe[re],$=ce[re];break}return k<$?-1:$<k?1:0};function D(p,u,f,b,S){if(p.length===0)return-1;if(typeof f=="string"?(b=f,f=0):f>2147483647?f=2147483647:f<-2147483648&&(f=-2147483648),f=+f,Mo(f)&&(f=S?0:p.length-1),f<0&&(f=p.length+f),f>=p.length){if(S)return-1;f=p.length-1}else if(f<0)if(S)f=0;else return-1;if(typeof u=="string"&&(u=s.from(u,b)),s.isBuffer(u))return u.length===0?-1:Y(p,u,f,b,S);if(typeof u=="number")return u=u&255,typeof Uint8Array.prototype.indexOf=="function"?S?Uint8Array.prototype.indexOf.call(p,u,f):Uint8Array.prototype.lastIndexOf.call(p,u,f):Y(p,[u],f,b,S);throw new TypeError("val must be string, number or Buffer")}function Y(p,u,f,b,S){let C=1,k=p.length,$=u.length;if(b!==void 0&&(b=String(b).toLowerCase(),b==="ucs2"||b==="ucs-2"||b==="utf16le"||b==="utf-16le")){if(p.length<2||u.length<2)return-1;C=2,k/=2,$/=2,f/=2}function fe(ce,re){return C===1?ce[re]:ce.readUInt16BE(re*C)}let oe;if(S){let ce=-1;for(oe=f;oe<k;oe++)if(fe(p,oe)===fe(u,ce===-1?0:oe-ce)){if(ce===-1&&(ce=oe),oe-ce+1===$)return ce*C}else ce!==-1&&(oe-=oe-ce),ce=-1}else for(f+$>k&&(f=k-$),oe=f;oe>=0;oe--){let ce=!0;for(let re=0;re<$;re++)if(fe(p,oe+re)!==fe(u,re)){ce=!1;break}if(ce)return oe}return-1}s.prototype.includes=function(u,f,b){return this.indexOf(u,f,b)!==-1},s.prototype.indexOf=function(u,f,b){return D(this,u,f,b,!0)},s.prototype.lastIndexOf=function(u,f,b){return D(this,u,f,b,!1)};function Z(p,u,f,b){f=Number(f)||0;let S=p.length-f;b?(b=Number(b),b>S&&(b=S)):b=S;let C=u.length;b>C/2&&(b=C/2);let k;for(k=0;k<b;++k){let $=parseInt(u.substr(k*2,2),16);if(Mo($))return k;p[f+k]=$}return k}function J(p,u,f,b){return Bn(ko(u,p.length-f),p,f,b)}function te(p,u,f,b){return Bn(w_(u),p,f,b)}function Pe(p,u,f,b){return Bn(Cf(u),p,f,b)}function Ni(p,u,f,b){return Bn(__(u,p.length-f),p,f,b)}s.prototype.write=function(u,f,b,S){if(f===void 0)S="utf8",b=this.length,f=0;else if(b===void 0&&typeof f=="string")S=f,b=this.length,f=0;else if(isFinite(f))f=f>>>0,isFinite(b)?(b=b>>>0,S===void 0&&(S="utf8")):(S=b,b=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let C=this.length-f;if((b===void 0||b>C)&&(b=C),u.length>0&&(b<0||f<0)||f>this.length)throw new RangeError("Attempt to write outside buffer bounds");S||(S="utf8");let k=!1;for(;;)switch(S){case"hex":return Z(this,u,f,b);case"utf8":case"utf-8":return J(this,u,f,b);case"ascii":case"latin1":case"binary":return te(this,u,f,b);case"base64":return Pe(this,u,f,b);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ni(this,u,f,b);default:if(k)throw new TypeError("Unknown encoding: "+S);S=(""+S).toLowerCase(),k=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Te(p,u,f){return u===0&&f===p.length?t.fromByteArray(p):t.fromByteArray(p.slice(u,f))}function ei(p,u,f){f=Math.min(p.length,f);let b=[],S=u;for(;S<f;){let C=p[S],k=null,$=C>239?4:C>223?3:C>191?2:1;if(S+$<=f){let fe,oe,ce,re;switch($){case 1:C<128&&(k=C);break;case 2:fe=p[S+1],(fe&192)===128&&(re=(C&31)<<6|fe&63,re>127&&(k=re));break;case 3:fe=p[S+1],oe=p[S+2],(fe&192)===128&&(oe&192)===128&&(re=(C&15)<<12|(fe&63)<<6|oe&63,re>2047&&(re<55296||re>57343)&&(k=re));break;case 4:fe=p[S+1],oe=p[S+2],ce=p[S+3],(fe&192)===128&&(oe&192)===128&&(ce&192)===128&&(re=(C&15)<<18|(fe&63)<<12|(oe&63)<<6|ce&63,re>65535&&re<1114112&&(k=re))}}k===null?(k=65533,$=1):k>65535&&(k-=65536,b.push(k>>>10&1023|55296),k=56320|k&1023),b.push(k),S+=$}return ri(b)}let ti=4096;function ri(p){let u=p.length;if(u<=ti)return String.fromCharCode.apply(String,p);let f="",b=0;for(;b<u;)f+=String.fromCharCode.apply(String,p.slice(b,b+=ti));return f}function Oo(p,u,f){let b="";f=Math.min(p.length,f);for(let S=u;S<f;++S)b+=String.fromCharCode(p[S]&127);return b}function h_(p,u,f){let b="";f=Math.min(p.length,f);for(let S=u;S<f;++S)b+=String.fromCharCode(p[S]);return b}function d_(p,u,f){let b=p.length;(!u||u<0)&&(u=0),(!f||f<0||f>b)&&(f=b);let S="";for(let C=u;C<f;++C)S+=m_[p[C]];return S}function p_(p,u,f){let b=p.slice(u,f),S="";for(let C=0;C<b.length-1;C+=2)S+=String.fromCharCode(b[C]+b[C+1]*256);return S}s.prototype.slice=function(u,f){let b=this.length;u=~~u,f=f===void 0?b:~~f,u<0?(u+=b,u<0&&(u=0)):u>b&&(u=b),f<0?(f+=b,f<0&&(f=0)):f>b&&(f=b),f<u&&(f=u);let S=this.subarray(u,f);return Object.setPrototypeOf(S,s.prototype),S};function Ee(p,u,f){if(p%1!==0||p<0)throw new RangeError("offset is not uint");if(p+u>f)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(u,f,b){u=u>>>0,f=f>>>0,b||Ee(u,f,this.length);let S=this[u],C=1,k=0;for(;++k<f&&(C*=256);)S+=this[u+k]*C;return S},s.prototype.readUintBE=s.prototype.readUIntBE=function(u,f,b){u=u>>>0,f=f>>>0,b||Ee(u,f,this.length);let S=this[u+--f],C=1;for(;f>0&&(C*=256);)S+=this[u+--f]*C;return S},s.prototype.readUint8=s.prototype.readUInt8=function(u,f){return u=u>>>0,f||Ee(u,1,this.length),this[u]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(u,f){return u=u>>>0,f||Ee(u,2,this.length),this[u]|this[u+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(u,f){return u=u>>>0,f||Ee(u,2,this.length),this[u]<<8|this[u+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(u,f){return u=u>>>0,f||Ee(u,4,this.length),(this[u]|this[u+1]<<8|this[u+2]<<16)+this[u+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(u,f){return u=u>>>0,f||Ee(u,4,this.length),this[u]*16777216+(this[u+1]<<16|this[u+2]<<8|this[u+3])},s.prototype.readBigUInt64LE=Kt(function(u){u=u>>>0,ni(u,"offset");let f=this[u],b=this[u+7];(f===void 0||b===void 0)&&Di(u,this.length-8);let S=f+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24,C=this[++u]+this[++u]*2**8+this[++u]*2**16+b*2**24;return BigInt(S)+(BigInt(C)<<BigInt(32))}),s.prototype.readBigUInt64BE=Kt(function(u){u=u>>>0,ni(u,"offset");let f=this[u],b=this[u+7];(f===void 0||b===void 0)&&Di(u,this.length-8);let S=f*2**24+this[++u]*2**16+this[++u]*2**8+this[++u],C=this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+b;return(BigInt(S)<<BigInt(32))+BigInt(C)}),s.prototype.readIntLE=function(u,f,b){u=u>>>0,f=f>>>0,b||Ee(u,f,this.length);let S=this[u],C=1,k=0;for(;++k<f&&(C*=256);)S+=this[u+k]*C;return C*=128,S>=C&&(S-=Math.pow(2,8*f)),S},s.prototype.readIntBE=function(u,f,b){u=u>>>0,f=f>>>0,b||Ee(u,f,this.length);let S=f,C=1,k=this[u+--S];for(;S>0&&(C*=256);)k+=this[u+--S]*C;return C*=128,k>=C&&(k-=Math.pow(2,8*f)),k},s.prototype.readInt8=function(u,f){return u=u>>>0,f||Ee(u,1,this.length),this[u]&128?(255-this[u]+1)*-1:this[u]},s.prototype.readInt16LE=function(u,f){u=u>>>0,f||Ee(u,2,this.length);let b=this[u]|this[u+1]<<8;return b&32768?b|4294901760:b},s.prototype.readInt16BE=function(u,f){u=u>>>0,f||Ee(u,2,this.length);let b=this[u+1]|this[u]<<8;return b&32768?b|4294901760:b},s.prototype.readInt32LE=function(u,f){return u=u>>>0,f||Ee(u,4,this.length),this[u]|this[u+1]<<8|this[u+2]<<16|this[u+3]<<24},s.prototype.readInt32BE=function(u,f){return u=u>>>0,f||Ee(u,4,this.length),this[u]<<24|this[u+1]<<16|this[u+2]<<8|this[u+3]},s.prototype.readBigInt64LE=Kt(function(u){u=u>>>0,ni(u,"offset");let f=this[u],b=this[u+7];(f===void 0||b===void 0)&&Di(u,this.length-8);let S=this[u+4]+this[u+5]*2**8+this[u+6]*2**16+(b<<24);return(BigInt(S)<<BigInt(32))+BigInt(f+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24)}),s.prototype.readBigInt64BE=Kt(function(u){u=u>>>0,ni(u,"offset");let f=this[u],b=this[u+7];(f===void 0||b===void 0)&&Di(u,this.length-8);let S=(f<<24)+this[++u]*2**16+this[++u]*2**8+this[++u];return(BigInt(S)<<BigInt(32))+BigInt(this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+b)}),s.prototype.readFloatLE=function(u,f){return u=u>>>0,f||Ee(u,4,this.length),e.read(this,u,!0,23,4)},s.prototype.readFloatBE=function(u,f){return u=u>>>0,f||Ee(u,4,this.length),e.read(this,u,!1,23,4)},s.prototype.readDoubleLE=function(u,f){return u=u>>>0,f||Ee(u,8,this.length),e.read(this,u,!0,52,8)},s.prototype.readDoubleBE=function(u,f){return u=u>>>0,f||Ee(u,8,this.length),e.read(this,u,!1,52,8)};function Le(p,u,f,b,S,C){if(!s.isBuffer(p))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>S||u<C)throw new RangeError('"value" argument is out of bounds');if(f+b>p.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(u,f,b,S){if(u=+u,f=f>>>0,b=b>>>0,!S){let $=Math.pow(2,8*b)-1;Le(this,u,f,b,$,0)}let C=1,k=0;for(this[f]=u&255;++k<b&&(C*=256);)this[f+k]=u/C&255;return f+b},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(u,f,b,S){if(u=+u,f=f>>>0,b=b>>>0,!S){let $=Math.pow(2,8*b)-1;Le(this,u,f,b,$,0)}let C=b-1,k=1;for(this[f+C]=u&255;--C>=0&&(k*=256);)this[f+C]=u/k&255;return f+b},s.prototype.writeUint8=s.prototype.writeUInt8=function(u,f,b){return u=+u,f=f>>>0,b||Le(this,u,f,1,255,0),this[f]=u&255,f+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(u,f,b){return u=+u,f=f>>>0,b||Le(this,u,f,2,65535,0),this[f]=u&255,this[f+1]=u>>>8,f+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(u,f,b){return u=+u,f=f>>>0,b||Le(this,u,f,2,65535,0),this[f]=u>>>8,this[f+1]=u&255,f+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(u,f,b){return u=+u,f=f>>>0,b||Le(this,u,f,4,4294967295,0),this[f+3]=u>>>24,this[f+2]=u>>>16,this[f+1]=u>>>8,this[f]=u&255,f+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(u,f,b){return u=+u,f=f>>>0,b||Le(this,u,f,4,4294967295,0),this[f]=u>>>24,this[f+1]=u>>>16,this[f+2]=u>>>8,this[f+3]=u&255,f+4};function vf(p,u,f,b,S){If(u,b,S,p,f,7);let C=Number(u&BigInt(4294967295));p[f++]=C,C=C>>8,p[f++]=C,C=C>>8,p[f++]=C,C=C>>8,p[f++]=C;let k=Number(u>>BigInt(32)&BigInt(4294967295));return p[f++]=k,k=k>>8,p[f++]=k,k=k>>8,p[f++]=k,k=k>>8,p[f++]=k,f}function Ef(p,u,f,b,S){If(u,b,S,p,f,7);let C=Number(u&BigInt(4294967295));p[f+7]=C,C=C>>8,p[f+6]=C,C=C>>8,p[f+5]=C,C=C>>8,p[f+4]=C;let k=Number(u>>BigInt(32)&BigInt(4294967295));return p[f+3]=k,k=k>>8,p[f+2]=k,k=k>>8,p[f+1]=k,k=k>>8,p[f]=k,f+8}s.prototype.writeBigUInt64LE=Kt(function(u,f=0){return vf(this,u,f,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=Kt(function(u,f=0){return Ef(this,u,f,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(u,f,b,S){if(u=+u,f=f>>>0,!S){let fe=Math.pow(2,8*b-1);Le(this,u,f,b,fe-1,-fe)}let C=0,k=1,$=0;for(this[f]=u&255;++C<b&&(k*=256);)u<0&&$===0&&this[f+C-1]!==0&&($=1),this[f+C]=(u/k>>0)-$&255;return f+b},s.prototype.writeIntBE=function(u,f,b,S){if(u=+u,f=f>>>0,!S){let fe=Math.pow(2,8*b-1);Le(this,u,f,b,fe-1,-fe)}let C=b-1,k=1,$=0;for(this[f+C]=u&255;--C>=0&&(k*=256);)u<0&&$===0&&this[f+C+1]!==0&&($=1),this[f+C]=(u/k>>0)-$&255;return f+b},s.prototype.writeInt8=function(u,f,b){return u=+u,f=f>>>0,b||Le(this,u,f,1,127,-128),u<0&&(u=255+u+1),this[f]=u&255,f+1},s.prototype.writeInt16LE=function(u,f,b){return u=+u,f=f>>>0,b||Le(this,u,f,2,32767,-32768),this[f]=u&255,this[f+1]=u>>>8,f+2},s.prototype.writeInt16BE=function(u,f,b){return u=+u,f=f>>>0,b||Le(this,u,f,2,32767,-32768),this[f]=u>>>8,this[f+1]=u&255,f+2},s.prototype.writeInt32LE=function(u,f,b){return u=+u,f=f>>>0,b||Le(this,u,f,4,2147483647,-2147483648),this[f]=u&255,this[f+1]=u>>>8,this[f+2]=u>>>16,this[f+3]=u>>>24,f+4},s.prototype.writeInt32BE=function(u,f,b){return u=+u,f=f>>>0,b||Le(this,u,f,4,2147483647,-2147483648),u<0&&(u=4294967295+u+1),this[f]=u>>>24,this[f+1]=u>>>16,this[f+2]=u>>>8,this[f+3]=u&255,f+4},s.prototype.writeBigInt64LE=Kt(function(u,f=0){return vf(this,u,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=Kt(function(u,f=0){return Ef(this,u,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Sf(p,u,f,b,S,C){if(f+b>p.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("Index out of range")}function Af(p,u,f,b,S){return u=+u,f=f>>>0,S||Sf(p,u,f,4),e.write(p,u,f,b,23,4),f+4}s.prototype.writeFloatLE=function(u,f,b){return Af(this,u,f,!0,b)},s.prototype.writeFloatBE=function(u,f,b){return Af(this,u,f,!1,b)};function Rf(p,u,f,b,S){return u=+u,f=f>>>0,S||Sf(p,u,f,8),e.write(p,u,f,b,52,8),f+8}s.prototype.writeDoubleLE=function(u,f,b){return Rf(this,u,f,!0,b)},s.prototype.writeDoubleBE=function(u,f,b){return Rf(this,u,f,!1,b)},s.prototype.copy=function(u,f,b,S){if(!s.isBuffer(u))throw new TypeError("argument should be a Buffer");if(b||(b=0),!S&&S!==0&&(S=this.length),f>=u.length&&(f=u.length),f||(f=0),S>0&&S<b&&(S=b),S===b||u.length===0||this.length===0)return 0;if(f<0)throw new RangeError("targetStart out of bounds");if(b<0||b>=this.length)throw new RangeError("Index out of range");if(S<0)throw new RangeError("sourceEnd out of bounds");S>this.length&&(S=this.length),u.length-f<S-b&&(S=u.length-f+b);let C=S-b;return this===u&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(f,b,S):Uint8Array.prototype.set.call(u,this.subarray(b,S),f),C},s.prototype.fill=function(u,f,b,S){if(typeof u=="string"){if(typeof f=="string"?(S=f,f=0,b=this.length):typeof b=="string"&&(S=b,b=this.length),S!==void 0&&typeof S!="string")throw new TypeError("encoding must be a string");if(typeof S=="string"&&!s.isEncoding(S))throw new TypeError("Unknown encoding: "+S);if(u.length===1){let k=u.charCodeAt(0);(S==="utf8"&&k<128||S==="latin1")&&(u=k)}}else typeof u=="number"?u=u&255:typeof u=="boolean"&&(u=Number(u));if(f<0||this.length<f||this.length<b)throw new RangeError("Out of range index");if(b<=f)return this;f=f>>>0,b=b===void 0?this.length:b>>>0,u||(u=0);let C;if(typeof u=="number")for(C=f;C<b;++C)this[C]=u;else{let k=s.isBuffer(u)?u:s.from(u,S),$=k.length;if($===0)throw new TypeError('The value "'+u+'" is invalid for argument "value"');for(C=0;C<b-f;++C)this[C+f]=k[C%$]}return this};let ii={};function xo(p,u,f){ii[p]=class extends f{constructor(){super(),Object.defineProperty(this,"message",{value:u.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${p}]`,this.stack,delete this.name}get code(){return p}set code(S){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:S,writable:!0})}toString(){return`${this.name} [${p}]: ${this.message}`}}}xo("ERR_BUFFER_OUT_OF_BOUNDS",function(p){return p?`${p} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),xo("ERR_INVALID_ARG_TYPE",function(p,u){return`The "${p}" argument must be of type number. Received type ${typeof u}`},TypeError),xo("ERR_OUT_OF_RANGE",function(p,u,f){let b=`The value of "${p}" is out of range.`,S=f;return Number.isInteger(f)&&Math.abs(f)>2**32?S=Tf(String(f)):typeof f=="bigint"&&(S=String(f),(f>BigInt(2)**BigInt(32)||f<-(BigInt(2)**BigInt(32)))&&(S=Tf(S)),S+="n"),b+=` It must be ${u}. Received ${S}`,b},RangeError);function Tf(p){let u="",f=p.length,b=p[0]==="-"?1:0;for(;f>=b+4;f-=3)u=`_${p.slice(f-3,f)}${u}`;return`${p.slice(0,f)}${u}`}function g_(p,u,f){ni(u,"offset"),(p[u]===void 0||p[u+f]===void 0)&&Di(u,p.length-(f+1))}function If(p,u,f,b,S,C){if(p>f||p<u){let k=typeof u=="bigint"?"n":"",$;throw C>3?u===0||u===BigInt(0)?$=`>= 0${k} and < 2${k} ** ${(C+1)*8}${k}`:$=`>= -(2${k} ** ${(C+1)*8-1}${k}) and < 2 ** ${(C+1)*8-1}${k}`:$=`>= ${u}${k} and <= ${f}${k}`,new ii.ERR_OUT_OF_RANGE("value",$,p)}g_(b,S,C)}function ni(p,u){if(typeof p!="number")throw new ii.ERR_INVALID_ARG_TYPE(u,"number",p)}function Di(p,u,f){throw Math.floor(p)!==p?(ni(p,f),new ii.ERR_OUT_OF_RANGE(f||"offset","an integer",p)):u<0?new ii.ERR_BUFFER_OUT_OF_BOUNDS:new ii.ERR_OUT_OF_RANGE(f||"offset",`>= ${f?1:0} and <= ${u}`,p)}let y_=/[^+/0-9A-Za-z-_]/g;function b_(p){if(p=p.split("=")[0],p=p.trim().replace(y_,""),p.length<2)return"";for(;p.length%4!==0;)p=p+"=";return p}function ko(p,u){u=u||1/0;let f,b=p.length,S=null,C=[];for(let k=0;k<b;++k){if(f=p.charCodeAt(k),f>55295&&f<57344){if(!S){if(f>56319){(u-=3)>-1&&C.push(239,191,189);continue}else if(k+1===b){(u-=3)>-1&&C.push(239,191,189);continue}S=f;continue}if(f<56320){(u-=3)>-1&&C.push(239,191,189),S=f;continue}f=(S-55296<<10|f-56320)+65536}else S&&(u-=3)>-1&&C.push(239,191,189);if(S=null,f<128){if((u-=1)<0)break;C.push(f)}else if(f<2048){if((u-=2)<0)break;C.push(f>>6|192,f&63|128)}else if(f<65536){if((u-=3)<0)break;C.push(f>>12|224,f>>6&63|128,f&63|128)}else if(f<1114112){if((u-=4)<0)break;C.push(f>>18|240,f>>12&63|128,f>>6&63|128,f&63|128)}else throw new Error("Invalid code point")}return C}function w_(p){let u=[];for(let f=0;f<p.length;++f)u.push(p.charCodeAt(f)&255);return u}function __(p,u){let f,b,S,C=[];for(let k=0;k<p.length&&!((u-=2)<0);++k)f=p.charCodeAt(k),b=f>>8,S=f%256,C.push(S),C.push(b);return C}function Cf(p){return t.toByteArray(b_(p))}function Bn(p,u,f,b){let S;for(S=0;S<b&&!(S+f>=u.length||S>=p.length);++S)u[S+f]=p[S];return S}function at(p,u){return p instanceof u||p!=null&&p.constructor!=null&&p.constructor.name!=null&&p.constructor.name===u.name}function Mo(p){return p!==p}let m_=function(){let p="0123456789abcdef",u=new Array(256);for(let f=0;f<16;++f){let b=f*16;for(let S=0;S<16;++S)u[b+S]=p[f]+p[S]}return u}();function Kt(p){return typeof BigInt>"u"?v_:p}function v_(){throw new Error("BigInt not supported")}return yr}var qi,Vc,Mn,zc,yr,Gc,Jt,O,B_,O_,de=we(()=>{w();m();_();qi={},Vc=!1;Mn={},zc=!1;yr={},Gc=!1;Jt=P_();Jt.Buffer;Jt.SlowBuffer;Jt.INSPECT_MAX_BYTES;Jt.kMaxLength;O=Jt.Buffer,B_=Jt.INSPECT_MAX_BYTES,O_=Jt.kMaxLength});var m=we(()=>{de()});var Kc=M(jo=>{"use strict";w();m();_();Object.defineProperty(jo,"__esModule",{value:!0});var qo=class{constructor(e){this.aliasToTopic={},this.max=e}put(e,r){return r===0||r>this.max?!1:(this.aliasToTopic[r]=e,this.length=Object.keys(this.aliasToTopic).length,!0)}getTopicByAlias(e){return this.aliasToTopic[e]}clear(){this.aliasToTopic={}}};jo.default=qo});var me=M((ZP,Yc)=>{"use strict";w();m();_();Yc.exports={ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,e){return t.includes(e)},ArrayPrototypeIndexOf(t,e){return t.indexOf(e)},ArrayPrototypeJoin(t,e){return t.join(e)},ArrayPrototypeMap(t,e){return t.map(e)},ArrayPrototypePop(t,e){return t.pop(e)},ArrayPrototypePush(t,e){return t.push(e)},ArrayPrototypeSlice(t,e,r){return t.slice(e,r)},Error,FunctionPrototypeCall(t,e,...r){return t.call(e,...r)},FunctionPrototypeSymbolHasInstance(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},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(t,e){return Object.defineProperties(t,e)},ObjectDefineProperty(t,e,r){return Object.defineProperty(t,e,r)},ObjectGetOwnPropertyDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,e){return Object.setPrototypeOf(t,e)},Promise,PromisePrototypeCatch(t,e){return t.catch(e)},PromisePrototypeThen(t,e,r){return t.then(e,r)},PromiseReject(t){return Promise.reject(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,e){return t.test(e)},SafeSet:Set,String,StringPrototypeSlice(t,e,r){return t.slice(e,r)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,TypedArrayPrototypeSet(t,e,r){return t.set(e,r)},Uint8Array}});var lt=M((oB,Wo)=>{"use strict";w();m();_();var x_=(de(),K(_e)),k_=Object.getPrototypeOf(async function(){}).constructor,Qc=globalThis.Blob||x_.Blob,M_=typeof Qc<"u"?function(e){return e instanceof Qc}:function(e){return!1},Fo=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let r="";for(let i=0;i<e.length;i++)r+=` ${e[i].stack}
|
|
2
|
-
`;super(r),this.name="AggregateError",this.errors=e}};Wo.exports={AggregateError:Fo,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...r){e||(e=!0,t.apply(this,r))}},createDeferredPromise:function(){let t,e;return{promise:new Promise((i,n)=>{t=i,e=n}),resolve:t,reject:e}},promisify(t){return new Promise((e,r)=>{t((i,...n)=>i?r(i):e(...n))})},debuglog(){return function(){}},format(t,...e){return t.replace(/%([sdifj])/g,function(...[r,i]){let n=e.shift();return i==="f"?n.toFixed(6):i==="j"?JSON.stringify(n):i==="s"&&typeof n=="object"?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()})},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}},types:{isAsyncFunction(t){return t instanceof k_},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:M_};Wo.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var Un=M((dB,Ln)=>{"use strict";w();m();_();var{AbortController:Jc,AbortSignal:L_}=typeof self<"u"?self:typeof window<"u"?window:void 0;Ln.exports=Jc;Ln.exports.AbortSignal=L_;Ln.exports.default=Jc});var Be=M((mB,eh)=>{"use strict";w();m();_();var{format:U_,inspect:Nn,AggregateError:N_}=lt(),D_=globalThis.AggregateError||N_,q_=Symbol("kIsNodeError"),j_=["string","function","number","object","Function","Object","boolean","bigint","symbol"],F_=/^([A-Z][a-z0-9]*)+$/,W_="__node_internal_",Dn={};function br(t,e){if(!t)throw new Dn.ERR_INTERNAL_ASSERTION(e)}function Xc(t){let e="",r=t.length,i=t[0]==="-"?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function $_(t,e,r){if(typeof e=="function")return br(e.length<=r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${e.length}).`),e(...r);let i=(e.match(/%[dfijoOs]/g)||[]).length;return br(i===r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${i}).`),r.length===0?e:U_(e,...r)}function Ae(t,e,r){r||(r=Error);class i extends r{constructor(...o){super($_(t,e,o))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(i.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=t,i.prototype[q_]=!0,Dn[t]=i}function Zc(t){let e=W_+t.name;return Object.defineProperty(t,"name",{value:e}),t}function H_(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let r=new D_([e,t],e.message);return r.code=e.code,r}return t||e}var $o=class extends Error{constructor(e="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new Dn.ERR_INVALID_ARG_TYPE("options","Object",r);super(e,r),this.code="ABORT_ERR",this.name="AbortError"}};Ae("ERR_ASSERTION","%s",Error);Ae("ERR_INVALID_ARG_TYPE",(t,e,r)=>{br(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let i="The ";t.endsWith(" argument")?i+=`${t} `:i+=`"${t}" ${t.includes(".")?"property":"argument"} `,i+="must be ";let n=[],o=[],s=[];for(let l of e)br(typeof l=="string","All expected entries have to be of type string"),j_.includes(l)?n.push(l.toLowerCase()):F_.test(l)?o.push(l):(br(l!=="object",'The value "object" should be written as "Object"'),s.push(l));if(o.length>0){let l=n.indexOf("object");l!==-1&&(n.splice(n,l,1),o.push("Object"))}if(n.length>0){switch(n.length){case 1:i+=`of type ${n[0]}`;break;case 2:i+=`one of type ${n[0]} or ${n[1]}`;break;default:{let l=n.pop();i+=`one of type ${n.join(", ")}, or ${l}`}}(o.length>0||s.length>0)&&(i+=" or ")}if(o.length>0){switch(o.length){case 1:i+=`an instance of ${o[0]}`;break;case 2:i+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let l=o.pop();i+=`an instance of ${o.join(", ")}, or ${l}`}}s.length>0&&(i+=" or ")}switch(s.length){case 0:break;case 1:s[0].toLowerCase()!==s[0]&&(i+="an "),i+=`${s[0]}`;break;case 2:i+=`one of ${s[0]} or ${s[1]}`;break;default:{let l=s.pop();i+=`one of ${s.join(", ")}, or ${l}`}}if(r==null)i+=`. Received ${r}`;else if(typeof r=="function"&&r.name)i+=`. Received function ${r.name}`;else if(typeof r=="object"){var a;if((a=r.constructor)!==null&&a!==void 0&&a.name)i+=`. Received an instance of ${r.constructor.name}`;else{let l=Nn(r,{depth:-1});i+=`. Received ${l}`}}else{let l=Nn(r,{colors:!1});l.length>25&&(l=`${l.slice(0,25)}...`),i+=`. Received type ${typeof r} (${l})`}return i},TypeError);Ae("ERR_INVALID_ARG_VALUE",(t,e,r="is invalid")=>{let i=Nn(e);return i.length>128&&(i=i.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${r}. Received ${i}`},TypeError);Ae("ERR_INVALID_RETURN_VALUE",(t,e,r)=>{var i;let n=r!=null&&(i=r.constructor)!==null&&i!==void 0&&i.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${t} to be returned from the "${e}" function but got ${n}.`},TypeError);Ae("ERR_MISSING_ARGS",(...t)=>{br(t.length>0,"At least one arg needs to be specified");let e,r=t.length;switch(t=(Array.isArray(t)?t:[t]).map(i=>`"${i}"`).join(" or "),r){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let i=t.pop();e+=`The ${t.join(", ")}, and ${i} arguments`}break}return`${e} must be specified`},TypeError);Ae("ERR_OUT_OF_RANGE",(t,e,r)=>{br(e,'Missing "range" argument');let i;return Number.isInteger(r)&&Math.abs(r)>2**32?i=Xc(String(r)):typeof r=="bigint"?(i=String(r),(r>2n**32n||r<-(2n**32n))&&(i=Xc(i)),i+="n"):i=Nn(r),`The value of "${t}" is out of range. It must be ${e}. Received ${i}`},RangeError);Ae("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);Ae("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);Ae("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);Ae("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);Ae("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);Ae("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Ae("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);Ae("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);Ae("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);Ae("ERR_STREAM_WRITE_AFTER_END","write after end",Error);Ae("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);eh.exports={AbortError:$o,aggregateTwoErrors:Zc(H_),hideStackFrames:Zc,codes:Dn}});var ji=M((IB,uh)=>{"use strict";w();m();_();var{ArrayIsArray:Vo,ArrayPrototypeIncludes:nh,ArrayPrototypeJoin:sh,ArrayPrototypeMap:V_,NumberIsInteger:zo,NumberIsNaN:z_,NumberMAX_SAFE_INTEGER:G_,NumberMIN_SAFE_INTEGER:K_,NumberParseInt:Y_,ObjectPrototypeHasOwnProperty:Q_,RegExpPrototypeExec:oh,String:J_,StringPrototypeToUpperCase:X_,StringPrototypeTrim:Z_}=me(),{hideStackFrames:Ve,codes:{ERR_SOCKET_BAD_PORT:e0,ERR_INVALID_ARG_TYPE:Oe,ERR_INVALID_ARG_VALUE:oi,ERR_OUT_OF_RANGE:wr,ERR_UNKNOWN_SIGNAL:th}}=Be(),{normalizeEncoding:t0}=lt(),{isAsyncFunction:r0,isArrayBufferView:i0}=lt().types,rh={};function n0(t){return t===(t|0)}function s0(t){return t===t>>>0}var o0=/^[0-7]+$/,a0="must be a 32-bit unsigned integer or an octal string";function l0(t,e,r){if(typeof t>"u"&&(t=r),typeof t=="string"){if(oh(o0,t)===null)throw new oi(e,t,a0);t=Y_(t,8)}return ah(t,e),t}var u0=Ve((t,e,r=K_,i=G_)=>{if(typeof t!="number")throw new Oe(e,"number",t);if(!zo(t))throw new wr(e,"an integer",t);if(t<r||t>i)throw new wr(e,`>= ${r} && <= ${i}`,t)}),f0=Ve((t,e,r=-2147483648,i=2147483647)=>{if(typeof t!="number")throw new Oe(e,"number",t);if(!zo(t))throw new wr(e,"an integer",t);if(t<r||t>i)throw new wr(e,`>= ${r} && <= ${i}`,t)}),ah=Ve((t,e,r=!1)=>{if(typeof t!="number")throw new Oe(e,"number",t);if(!zo(t))throw new wr(e,"an integer",t);let i=r?1:0,n=4294967295;if(t<i||t>n)throw new wr(e,`>= ${i} && <= ${n}`,t)});function Go(t,e){if(typeof t!="string")throw new Oe(e,"string",t)}function c0(t,e,r=void 0,i){if(typeof t!="number")throw new Oe(e,"number",t);if(r!=null&&t<r||i!=null&&t>i||(r!=null||i!=null)&&z_(t))throw new wr(e,`${r!=null?`>= ${r}`:""}${r!=null&&i!=null?" && ":""}${i!=null?`<= ${i}`:""}`,t)}var h0=Ve((t,e,r)=>{if(!nh(r,t)){let n="must be one of: "+sh(V_(r,o=>typeof o=="string"?`'${o}'`:J_(o)),", ");throw new oi(e,t,n)}});function lh(t,e){if(typeof t!="boolean")throw new Oe(e,"boolean",t)}function Ho(t,e,r){return t==null||!Q_(t,e)?r:t[e]}var d0=Ve((t,e,r=null)=>{let i=Ho(r,"allowArray",!1),n=Ho(r,"allowFunction",!1);if(!Ho(r,"nullable",!1)&&t===null||!i&&Vo(t)||typeof t!="object"&&(!n||typeof t!="function"))throw new Oe(e,"Object",t)}),p0=Ve((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new Oe(e,"a dictionary",t)}),Ko=Ve((t,e,r=0)=>{if(!Vo(t))throw new Oe(e,"Array",t);if(t.length<r){let i=`must be longer than ${r}`;throw new oi(e,t,i)}});function g0(t,e){Ko(t,e);for(let r=0;r<t.length;r++)Go(t[r],`${e}[${r}]`)}function y0(t,e){Ko(t,e);for(let r=0;r<t.length;r++)lh(t[r],`${e}[${r}]`)}function b0(t,e="signal"){if(Go(t,e),rh[t]===void 0)throw rh[X_(t)]!==void 0?new th(t+" (signals must use all capital letters)"):new th(t)}var w0=Ve((t,e="buffer")=>{if(!i0(t))throw new Oe(e,["Buffer","TypedArray","DataView"],t)});function _0(t,e){let r=t0(e),i=t.length;if(r==="hex"&&i%2!==0)throw new oi("encoding",e,`is invalid for data of length ${i}`)}function m0(t,e="Port",r=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&Z_(t).length===0||+t!==+t>>>0||t>65535||t===0&&!r)throw new e0(e,t,r);return t|0}var v0=Ve((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new Oe(e,"AbortSignal",t)}),E0=Ve((t,e)=>{if(typeof t!="function")throw new Oe(e,"Function",t)}),S0=Ve((t,e)=>{if(typeof t!="function"||r0(t))throw new Oe(e,"Function",t)}),A0=Ve((t,e)=>{if(t!==void 0)throw new Oe(e,"undefined",t)});function R0(t,e,r){if(!nh(r,t))throw new Oe(e,`('${sh(r,"|")}')`,t)}var T0=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function ih(t,e){if(typeof t>"u"||!oh(T0,t))throw new oi(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function I0(t){if(typeof t=="string")return ih(t,"hints"),t;if(Vo(t)){let e=t.length,r="";if(e===0)return r;for(let i=0;i<e;i++){let n=t[i];ih(n,"hints"),r+=n,i!==e-1&&(r+=", ")}return r}throw new oi("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}uh.exports={isInt32:n0,isUint32:s0,parseFileMode:l0,validateArray:Ko,validateStringArray:g0,validateBooleanArray:y0,validateBoolean:lh,validateBuffer:w0,validateDictionary:p0,validateEncoding:_0,validateFunction:E0,validateInt32:f0,validateInteger:u0,validateNumber:c0,validateObject:d0,validateOneOf:h0,validatePlainFunction:S0,validatePort:m0,validateSignalName:b0,validateString:Go,validateUint32:ah,validateUndefined:A0,validateUnion:R0,validateAbortSignal:v0,validateLinkHeaderValue:I0}});var Xt=M((MB,dh)=>{w();m();_();var pe=dh.exports={},ut,ft;function Yo(){throw new Error("setTimeout has not been defined")}function Qo(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?ut=setTimeout:ut=Yo}catch{ut=Yo}try{typeof clearTimeout=="function"?ft=clearTimeout:ft=Qo}catch{ft=Qo}})();function fh(t){if(ut===setTimeout)return setTimeout(t,0);if((ut===Yo||!ut)&&setTimeout)return ut=setTimeout,setTimeout(t,0);try{return ut(t,0)}catch{try{return ut.call(null,t,0)}catch{return ut.call(this,t,0)}}}function C0(t){if(ft===clearTimeout)return clearTimeout(t);if((ft===Qo||!ft)&&clearTimeout)return ft=clearTimeout,clearTimeout(t);try{return ft(t)}catch{try{return ft.call(null,t)}catch{return ft.call(this,t)}}}var Ot=[],ai=!1,_r,qn=-1;function P0(){!ai||!_r||(ai=!1,_r.length?Ot=_r.concat(Ot):qn=-1,Ot.length&&ch())}function ch(){if(!ai){var t=fh(P0);ai=!0;for(var e=Ot.length;e;){for(_r=Ot,Ot=[];++qn<e;)_r&&_r[qn].run();qn=-1,e=Ot.length}_r=null,ai=!1,C0(t)}}pe.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];Ot.push(new hh(t,e)),Ot.length===1&&!ai&&fh(ch)};function hh(t,e){this.fun=t,this.array=e}hh.prototype.run=function(){this.fun.apply(null,this.array)};pe.title="browser";pe.browser=!0;pe.env={};pe.argv=[];pe.version="";pe.versions={};function xt(){}pe.on=xt;pe.addListener=xt;pe.once=xt;pe.off=xt;pe.removeListener=xt;pe.removeAllListeners=xt;pe.emit=xt;pe.prependListener=xt;pe.prependOnceListener=xt;pe.listeners=function(t){return[]};pe.binding=function(t){throw new Error("process.binding is not supported")};pe.cwd=function(){return"/"};pe.chdir=function(t){throw new Error("process.chdir is not supported")};pe.umask=function(){return 0}});var ht=M((FB,Ph)=>{"use strict";w();m();_();var{Symbol:jn,SymbolAsyncIterator:ph,SymbolIterator:gh,SymbolFor:yh}=me(),bh=jn("kDestroyed"),wh=jn("kIsErrored"),Jo=jn("kIsReadable"),_h=jn("kIsDisturbed"),B0=yh("nodejs.webstream.isClosedPromise"),O0=yh("nodejs.webstream.controllerErrorFunction");function Fn(t,e=!1){var r;return!!(t&&typeof t.pipe=="function"&&typeof t.on=="function"&&(!e||typeof t.pause=="function"&&typeof t.resume=="function")&&(!t._writableState||((r=t._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!t._writableState||t._readableState))}function Wn(t){var e;return!!(t&&typeof t.write=="function"&&typeof t.on=="function"&&(!t._readableState||((e=t._writableState)===null||e===void 0?void 0:e.writable)!==!1))}function x0(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}function ct(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}function mh(t){return!!(t&&!ct(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}function vh(t){return!!(t&&!ct(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}function Eh(t){return!!(t&&!ct(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}function k0(t){return mh(t)||vh(t)||Eh(t)}function M0(t,e){return t==null?!1:e===!0?typeof t[ph]=="function":e===!1?typeof t[gh]=="function":typeof t[ph]=="function"||typeof t[gh]=="function"}function $n(t){if(!ct(t))return null;let e=t._writableState,r=t._readableState,i=e||r;return!!(t.destroyed||t[bh]||i!=null&&i.destroyed)}function Sh(t){if(!Wn(t))return null;if(t.writableEnded===!0)return!0;let e=t._writableState;return e!=null&&e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}function L0(t,e){if(!Wn(t))return null;if(t.writableFinished===!0)return!0;let r=t._writableState;return r!=null&&r.errored?!1:typeof r?.finished!="boolean"?null:!!(r.finished||e===!1&&r.ended===!0&&r.length===0)}function U0(t){if(!Fn(t))return null;if(t.readableEnded===!0)return!0;let e=t._readableState;return!e||e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}function Ah(t,e){if(!Fn(t))return null;let r=t._readableState;return r!=null&&r.errored?!1:typeof r?.endEmitted!="boolean"?null:!!(r.endEmitted||e===!1&&r.ended===!0&&r.length===0)}function Rh(t){return t&&t[Jo]!=null?t[Jo]:typeof t?.readable!="boolean"?null:$n(t)?!1:Fn(t)&&t.readable&&!Ah(t)}function Th(t){return typeof t?.writable!="boolean"?null:$n(t)?!1:Wn(t)&&t.writable&&!Sh(t)}function N0(t,e){return ct(t)?$n(t)?!0:!(e?.readable!==!1&&Rh(t)||e?.writable!==!1&&Th(t)):null}function D0(t){var e,r;return ct(t)?t.writableErrored?t.writableErrored:(e=(r=t._writableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function q0(t){var e,r;return ct(t)?t.readableErrored?t.readableErrored:(e=(r=t._readableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function j0(t){if(!ct(t))return null;if(typeof t.closed=="boolean")return t.closed;let e=t._writableState,r=t._readableState;return typeof e?.closed=="boolean"||typeof r?.closed=="boolean"?e?.closed||r?.closed:typeof t._closed=="boolean"&&Ih(t)?t._closed:null}function Ih(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}function Ch(t){return typeof t._sent100=="boolean"&&Ih(t)}function F0(t){var e;return typeof t._consuming=="boolean"&&typeof t._dumped=="boolean"&&((e=t.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}function W0(t){if(!ct(t))return null;let e=t._writableState,r=t._readableState,i=e||r;return!i&&Ch(t)||!!(i&&i.autoDestroy&&i.emitClose&&i.closed===!1)}function $0(t){var e;return!!(t&&((e=t[_h])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}function H0(t){var e,r,i,n,o,s,a,l,c,h;return!!(t&&((e=(r=(i=(n=(o=(s=t[wh])!==null&&s!==void 0?s:t.readableErrored)!==null&&o!==void 0?o:t.writableErrored)!==null&&n!==void 0?n:(a=t._readableState)===null||a===void 0?void 0:a.errorEmitted)!==null&&i!==void 0?i:(l=t._writableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&r!==void 0?r:(c=t._readableState)===null||c===void 0?void 0:c.errored)!==null&&e!==void 0?e:!((h=t._writableState)===null||h===void 0)&&h.errored))}Ph.exports={kDestroyed:bh,isDisturbed:$0,kIsDisturbed:_h,isErrored:H0,kIsErrored:wh,isReadable:Rh,kIsReadable:Jo,kIsClosedPromise:B0,kControllerErrorFunction:O0,isClosed:j0,isDestroyed:$n,isDuplexNodeStream:x0,isFinished:N0,isIterable:M0,isReadableNodeStream:Fn,isReadableStream:mh,isReadableEnded:U0,isReadableFinished:Ah,isReadableErrored:q0,isNodeStream:ct,isWebStream:k0,isWritable:Th,isWritableNodeStream:Wn,isWritableStream:vh,isWritableEnded:Sh,isWritableFinished:L0,isWritableErrored:D0,isServerRequest:F0,isServerResponse:Ch,willEmitClose:W0,isTransformStream:Eh}});var kt=M((KB,ra)=>{w();m();_();var Zt=Xt(),{AbortError:Dh,codes:V0}=Be(),{ERR_INVALID_ARG_TYPE:z0,ERR_STREAM_PREMATURE_CLOSE:Bh}=V0,{kEmptyObject:Zo,once:ea}=lt(),{validateAbortSignal:G0,validateFunction:K0,validateObject:Y0,validateBoolean:Q0}=ji(),{Promise:J0,PromisePrototypeThen:X0}=me(),{isClosed:Z0,isReadable:Oh,isReadableNodeStream:Xo,isReadableStream:em,isReadableFinished:xh,isReadableErrored:kh,isWritable:Mh,isWritableNodeStream:Lh,isWritableStream:tm,isWritableFinished:Uh,isWritableErrored:Nh,isNodeStream:rm,willEmitClose:im,kIsClosedPromise:nm}=ht();function sm(t){return t.setHeader&&typeof t.abort=="function"}var ta=()=>{};function qh(t,e,r){var i,n;if(arguments.length===2?(r=e,e=Zo):e==null?e=Zo:Y0(e,"options"),K0(r,"callback"),G0(e.signal,"options.signal"),r=ea(r),em(t)||tm(t))return om(t,e,r);if(!rm(t))throw new z0("stream",["ReadableStream","WritableStream","Stream"],t);let o=(i=e.readable)!==null&&i!==void 0?i:Xo(t),s=(n=e.writable)!==null&&n!==void 0?n:Lh(t),a=t._writableState,l=t._readableState,c=()=>{t.writable||g()},h=im(t)&&Xo(t)===o&&Lh(t)===s,d=Uh(t,!1),g=()=>{d=!0,t.destroyed&&(h=!1),!(h&&(!t.readable||o))&&(!o||y)&&r.call(t)},y=xh(t,!1),v=()=>{y=!0,t.destroyed&&(h=!1),!(h&&(!t.writable||s))&&(!s||d)&&r.call(t)},E=D=>{r.call(t,D)},A=Z0(t),T=()=>{A=!0;let D=Nh(t)||kh(t);if(D&&typeof D!="boolean")return r.call(t,D);if(o&&!y&&Xo(t,!0)&&!xh(t,!1))return r.call(t,new Bh);if(s&&!d&&!Uh(t,!1))return r.call(t,new Bh);r.call(t)},B=()=>{A=!0;let D=Nh(t)||kh(t);if(D&&typeof D!="boolean")return r.call(t,D);r.call(t)},I=()=>{t.req.on("finish",g)};sm(t)?(t.on("complete",g),h||t.on("abort",T),t.req?I():t.on("request",I)):s&&!a&&(t.on("end",c),t.on("close",c)),!h&&typeof t.aborted=="boolean"&&t.on("aborted",T),t.on("end",v),t.on("finish",g),e.error!==!1&&t.on("error",E),t.on("close",T),A?Zt.nextTick(T):a!=null&&a.errorEmitted||l!=null&&l.errorEmitted?h||Zt.nextTick(B):(!o&&(!h||Oh(t))&&(d||Mh(t)===!1)||!s&&(!h||Mh(t))&&(y||Oh(t)===!1)||l&&t.req&&t.aborted)&&Zt.nextTick(B);let N=()=>{r=ta,t.removeListener("aborted",T),t.removeListener("complete",g),t.removeListener("abort",T),t.removeListener("request",I),t.req&&t.req.removeListener("finish",g),t.removeListener("end",c),t.removeListener("close",c),t.removeListener("finish",g),t.removeListener("end",v),t.removeListener("error",E),t.removeListener("close",T)};if(e.signal&&!A){let D=()=>{let Y=r;N(),Y.call(t,new Dh(void 0,{cause:e.signal.reason}))};if(e.signal.aborted)Zt.nextTick(D);else{let Y=r;r=ea((...Z)=>{e.signal.removeEventListener("abort",D),Y.apply(t,Z)}),e.signal.addEventListener("abort",D)}}return N}function om(t,e,r){let i=!1,n=ta;if(e.signal)if(n=()=>{i=!0,r.call(t,new Dh(void 0,{cause:e.signal.reason}))},e.signal.aborted)Zt.nextTick(n);else{let s=r;r=ea((...a)=>{e.signal.removeEventListener("abort",n),s.apply(t,a)}),e.signal.addEventListener("abort",n)}let o=(...s)=>{i||Zt.nextTick(()=>r.apply(t,s))};return X0(t[nm].promise,o,o),ta}function am(t,e){var r;let i=!1;return e===null&&(e=Zo),(r=e)!==null&&r!==void 0&&r.cleanup&&(Q0(e.cleanup,"cleanup"),i=e.cleanup),new J0((n,o)=>{let s=qh(t,e,a=>{i&&s(),a?o(a):n()})})}ra.exports=qh;ra.exports.finished=am});var mr=M((tO,Gh)=>{"use strict";w();m();_();var dt=Xt(),{aggregateTwoErrors:lm,codes:{ERR_MULTIPLE_CALLBACK:um},AbortError:fm}=Be(),{Symbol:Wh}=me(),{kDestroyed:cm,isDestroyed:hm,isFinished:dm,isServerRequest:pm}=ht(),$h=Wh("kDestroy"),ia=Wh("kConstruct");function Hh(t,e,r){t&&(t.stack,e&&!e.errored&&(e.errored=t),r&&!r.errored&&(r.errored=t))}function gm(t,e){let r=this._readableState,i=this._writableState,n=i||r;return i!=null&&i.destroyed||r!=null&&r.destroyed?(typeof e=="function"&&e(),this):(Hh(t,i,r),i&&(i.destroyed=!0),r&&(r.destroyed=!0),n.constructed?jh(this,t,e):this.once($h,function(o){jh(this,lm(o,t),e)}),this)}function jh(t,e,r){let i=!1;function n(o){if(i)return;i=!0;let s=t._readableState,a=t._writableState;Hh(o,a,s),a&&(a.closed=!0),s&&(s.closed=!0),typeof r=="function"&&r(o),o?dt.nextTick(ym,t,o):dt.nextTick(Vh,t)}try{t._destroy(e||null,n)}catch(o){n(o)}}function ym(t,e){na(t,e),Vh(t)}function Vh(t){let e=t._readableState,r=t._writableState;r&&(r.closeEmitted=!0),e&&(e.closeEmitted=!0),(r!=null&&r.emitClose||e!=null&&e.emitClose)&&t.emit("close")}function na(t,e){let r=t._readableState,i=t._writableState;i!=null&&i.errorEmitted||r!=null&&r.errorEmitted||(i&&(i.errorEmitted=!0),r&&(r.errorEmitted=!0),t.emit("error",e))}function bm(){let t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=t.readable===!1,t.endEmitted=t.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1)}function sa(t,e,r){let i=t._readableState,n=t._writableState;if(n!=null&&n.destroyed||i!=null&&i.destroyed)return this;i!=null&&i.autoDestroy||n!=null&&n.autoDestroy?t.destroy(e):e&&(e.stack,n&&!n.errored&&(n.errored=e),i&&!i.errored&&(i.errored=e),r?dt.nextTick(na,t,e):na(t,e))}function wm(t,e){if(typeof t._construct!="function")return;let r=t._readableState,i=t._writableState;r&&(r.constructed=!1),i&&(i.constructed=!1),t.once(ia,e),!(t.listenerCount(ia)>1)&&dt.nextTick(_m,t)}function _m(t){let e=!1;function r(i){if(e){sa(t,i??new um);return}e=!0;let n=t._readableState,o=t._writableState,s=o||n;n&&(n.constructed=!0),o&&(o.constructed=!0),s.destroyed?t.emit($h,i):i?sa(t,i,!0):dt.nextTick(mm,t)}try{t._construct(i=>{dt.nextTick(r,i)})}catch(i){dt.nextTick(r,i)}}function mm(t){t.emit(ia)}function Fh(t){return t?.setHeader&&typeof t.abort=="function"}function zh(t){t.emit("close")}function vm(t,e){t.emit("error",e),dt.nextTick(zh,t)}function Em(t,e){!t||hm(t)||(!e&&!dm(t)&&(e=new fm),pm(t)?(t.socket=null,t.destroy(e)):Fh(t)?t.abort():Fh(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?dt.nextTick(vm,t,e):dt.nextTick(zh,t),t.destroyed||(t[cm]=!0))}Gh.exports={construct:wm,destroyer:Em,destroy:gm,undestroy:bm,errorOrDestroy:sa}});function ee(){ee.init.call(this)}function Hn(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function id(t){return t._maxListeners===void 0?ee.defaultMaxListeners:t._maxListeners}function Jh(t,e,r,i){var n,o,s,a;if(Hn(r),(o=t._events)===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),s===void 0)s=o[e]=r,++t._eventsCount;else if(typeof s=="function"?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),(n=id(t))>0&&s.length>n&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,a=l,console&&console.warn&&console.warn(a)}return t}function Sm(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Xh(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=Sm.bind(i);return n.listener=r,i.wrapFn=n,n}function Zh(t,e,r){var i=t._events;if(i===void 0)return[];var n=i[e];return n===void 0?[]:typeof n=="function"?r?[n.listener||n]:[n]:r?function(o){for(var s=new Array(o.length),a=0;a<s.length;++a)s[a]=o[a].listener||o[a];return s}(n):nd(n,n.length)}function ed(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}function nd(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}var td,rd,li,Kh,Yh,Qh,Ue,oa=we(()=>{w();m();_();li=typeof Reflect=="object"?Reflect:null,Kh=li&&typeof li.apply=="function"?li.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};rd=li&&typeof li.ownKeys=="function"?li.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};Yh=Number.isNaN||function(t){return t!=t};td=ee,ee.EventEmitter=ee,ee.prototype._events=void 0,ee.prototype._eventsCount=0,ee.prototype._maxListeners=void 0;Qh=10;Object.defineProperty(ee,"defaultMaxListeners",{enumerable:!0,get:function(){return Qh},set:function(t){if(typeof t!="number"||t<0||Yh(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Qh=t}}),ee.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},ee.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||Yh(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},ee.prototype.getMaxListeners=function(){return id(this)},ee.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var i=t==="error",n=this._events;if(n!==void 0)i=i&&n.error===void 0;else if(!i)return!1;if(i){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var a=n[t];if(a===void 0)return!1;if(typeof a=="function")Kh(a,this,e);else{var l=a.length,c=nd(a,l);for(r=0;r<l;++r)Kh(c[r],this,e)}return!0},ee.prototype.addListener=function(t,e){return Jh(this,t,e,!1)},ee.prototype.on=ee.prototype.addListener,ee.prototype.prependListener=function(t,e){return Jh(this,t,e,!0)},ee.prototype.once=function(t,e){return Hn(e),this.on(t,Xh(this,t,e)),this},ee.prototype.prependOnceListener=function(t,e){return Hn(e),this.prependListener(t,Xh(this,t,e)),this},ee.prototype.removeListener=function(t,e){var r,i,n,o,s;if(Hn(e),(i=this._events)===void 0)return this;if((r=i[t])===void 0)return this;if(r===e||r.listener===e)--this._eventsCount==0?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||e));else if(typeof r!="function"){for(n=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,n=o;break}if(n<0)return this;n===0?r.shift():function(a,l){for(;l+1<a.length;l++)a[l]=a[l+1];a.pop()}(r,n),r.length===1&&(i[t]=r[0]),i.removeListener!==void 0&&this.emit("removeListener",t,s||e)}return this},ee.prototype.off=ee.prototype.removeListener,ee.prototype.removeAllListeners=function(t){var e,r,i;if((r=this._events)===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete r[t]),this;if(arguments.length===0){var n,o=Object.keys(r);for(i=0;i<o.length;++i)(n=o[i])!=="removeListener"&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(e=r[t])=="function")this.removeListener(t,e);else if(e!==void 0)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this},ee.prototype.listeners=function(t){return Zh(this,t,!0)},ee.prototype.rawListeners=function(t){return Zh(this,t,!1)},ee.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):ed.call(t,e)},ee.prototype.listenerCount=ed,ee.prototype.eventNames=function(){return this._eventsCount>0?rd(this._events):[]};Ue=td;Ue.EventEmitter;Ue.defaultMaxListeners;Ue.init;Ue.listenerCount;Ue.EventEmitter;Ue.defaultMaxListeners;Ue.init;Ue.listenerCount});var Mt={};Yt(Mt,{EventEmitter:()=>Am,default:()=>Ue,defaultMaxListeners:()=>Rm,init:()=>Tm,listenerCount:()=>Im,on:()=>Cm,once:()=>Pm});var Am,Rm,Tm,Im,Cm,Pm,Lt=we(()=>{w();m();_();oa();oa();Ue.once=function(t,e){return new Promise((r,i)=>{function n(...s){o!==void 0&&t.removeListener("error",o),r(s)}let o;e!=="error"&&(o=s=>{t.removeListener(name,n),i(s)},t.once("error",o)),t.once(e,n)})};Ue.on=function(t,e){let r=[],i=[],n=null,o=!1,s={async next(){let c=r.shift();if(c)return createIterResult(c,!1);if(n){let h=Promise.reject(n);return n=null,h}return o?createIterResult(void 0,!0):new Promise((h,d)=>i.push({resolve:h,reject:d}))},async return(){t.removeListener(e,a),t.removeListener("error",l),o=!0;for(let c of i)c.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(c){n=c,t.removeListener(e,a),t.removeListener("error",l)},[Symbol.asyncIterator](){return this}};return t.on(e,a),t.on("error",l),s;function a(...c){let h=i.shift();h?h.resolve(createIterResult(c,!1)):r.push(c)}function l(c){o=!0;let h=i.shift();h?h.reject(c):n=c,s.return()}};({EventEmitter:Am,defaultMaxListeners:Rm,init:Tm,listenerCount:Im,on:Cm,once:Pm}=Ue)});var Gn=M((SO,od)=>{"use strict";w();m();_();var{ArrayIsArray:Bm,ObjectSetPrototypeOf:sd}=me(),{EventEmitter:Vn}=(Lt(),K(Mt));function zn(t){Vn.call(this,t)}sd(zn.prototype,Vn.prototype);sd(zn,Vn);zn.prototype.pipe=function(t,e){let r=this;function i(h){t.writable&&t.write(h)===!1&&r.pause&&r.pause()}r.on("data",i);function n(){r.readable&&r.resume&&r.resume()}t.on("drain",n),!t._isStdio&&(!e||e.end!==!1)&&(r.on("end",s),r.on("close",a));let o=!1;function s(){o||(o=!0,t.end())}function a(){o||(o=!0,typeof t.destroy=="function"&&t.destroy())}function l(h){c(),Vn.listenerCount(this,"error")===0&&this.emit("error",h)}aa(r,"error",l),aa(t,"error",l);function c(){r.removeListener("data",i),t.removeListener("drain",n),r.removeListener("end",s),r.removeListener("close",a),r.removeListener("error",l),t.removeListener("error",l),r.removeListener("end",c),r.removeListener("close",c),t.removeListener("close",c)}return r.on("end",c),r.on("close",c),t.on("close",c),t.emit("pipe",r),t};function aa(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Bm(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}od.exports={Stream:zn,prependListener:aa}});var Fi=M((BO,Kn)=>{"use strict";w();m();_();var{AbortError:ad,codes:Om}=Be(),{isNodeStream:ld,isWebStream:xm,kControllerErrorFunction:km}=ht(),Mm=kt(),{ERR_INVALID_ARG_TYPE:ud}=Om,Lm=(t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new ud(e,"AbortSignal",t)};Kn.exports.addAbortSignal=function(e,r){if(Lm(e,"signal"),!ld(r)&&!xm(r))throw new ud("stream",["ReadableStream","WritableStream","Stream"],r);return Kn.exports.addAbortSignalNoValidate(e,r)};Kn.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let r=ld(e)?()=>{e.destroy(new ad(void 0,{cause:t.reason}))}:()=>{e[km](new ad(void 0,{cause:t.reason}))};return t.aborted?r():(t.addEventListener("abort",r),Mm(e,()=>t.removeEventListener("abort",r))),e}});var hd=M((DO,cd)=>{"use strict";w();m();_();var{StringPrototypeSlice:fd,SymbolIterator:Um,TypedArrayPrototypeSet:Yn,Uint8Array:Nm}=me(),{Buffer:la}=(de(),K(_e)),{inspect:Dm}=lt();cd.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let r={data:e,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(e){let r={data:e,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?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(this.length===0)return"";let r=this.head,i=""+r.data;for(;(r=r.next)!==null;)i+=e+r.data;return i}concat(e){if(this.length===0)return la.alloc(0);let r=la.allocUnsafe(e>>>0),i=this.head,n=0;for(;i;)Yn(r,i.data,n),n+=i.data.length,i=i.next;return r}consume(e,r){let i=this.head.data;if(e<i.length){let n=i.slice(0,e);return this.head.data=i.slice(e),n}return e===i.length?this.shift():r?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[Um](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let r="",i=this.head,n=0;do{let o=i.data;if(e>o.length)r+=o,e-=o.length;else{e===o.length?(r+=o,++n,i.next?this.head=i.next:this.head=this.tail=null):(r+=fd(o,0,e),this.head=i,i.data=fd(o,e));break}++n}while((i=i.next)!==null);return this.length-=n,r}_getBuffer(e){let r=la.allocUnsafe(e),i=e,n=this.head,o=0;do{let s=n.data;if(e>s.length)Yn(r,s,i-e),e-=s.length;else{e===s.length?(Yn(r,s,i-e),++o,n.next?this.head=n.next:this.head=this.tail=null):(Yn(r,new Nm(s.buffer,s.byteOffset,e),i-e),this.head=n,n.data=s.slice(e));break}++o}while((n=n.next)!==null);return this.length-=o,r}[Symbol.for("nodejs.util.inspect.custom")](e,r){return Dm(this,{...r,depth:0,customInspect:!1})}}});var Qn=M((VO,pd)=>{"use strict";w();m();_();var{MathFloor:qm,NumberIsInteger:jm}=me(),{ERR_INVALID_ARG_VALUE:Fm}=Be().codes;function Wm(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function dd(t){return t?16:16*1024}function $m(t,e,r,i){let n=Wm(e,i,r);if(n!=null){if(!jm(n)||n<0){let o=i?`options.${r}`:"options.highWaterMark";throw new Fm(o,n)}return qm(n)}return dd(t.objectMode)}pd.exports={getHighWaterMark:$m,getDefaultHighWaterMark:dd}});function bd(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return r===-1&&(r=e),[r,r===e?0:4-r%4]}function Hm(t,e,r){for(var i,n,o=[],s=e;s<r;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),o.push(et[(n=i)>>18&63]+et[n>>12&63]+et[n>>6&63]+et[63&n]);return o.join("")}function Ut(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,L.prototype),e}function L(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return ha(t)}return Id(t,e,r)}function Id(t,e,r){if(typeof t=="string")return function(o,s){if(typeof s=="string"&&s!==""||(s="utf8"),!L.isEncoding(s))throw new TypeError("Unknown encoding: "+s);var a=0|Pd(o,s),l=Ut(a),c=l.write(o,s);return c!==a&&(l=l.slice(0,c)),l}(t,e);if(ArrayBuffer.isView(t))return ua(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Nt(t,ArrayBuffer)||t&&Nt(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Nt(t,SharedArrayBuffer)||t&&Nt(t.buffer,SharedArrayBuffer)))return _d(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var i=t.valueOf&&t.valueOf();if(i!=null&&i!==t)return L.from(i,e,r);var n=function(o){if(L.isBuffer(o)){var s=0|ga(o.length),a=Ut(s);return a.length===0||o.copy(a,0,0,s),a}if(o.length!==void 0)return typeof o.length!="number"||ya(o.length)?Ut(0):ua(o);if(o.type==="Buffer"&&Array.isArray(o.data))return ua(o.data)}(t);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return L.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function Cd(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function ha(t){return Cd(t),Ut(t<0?0:0|ga(t))}function ua(t){for(var e=t.length<0?0:0|ga(t.length),r=Ut(e),i=0;i<e;i+=1)r[i]=255&t[i];return r}function _d(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var i;return i=e===void 0&&r===void 0?new Uint8Array(t):r===void 0?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(i,L.prototype),i}function ga(t){if(t>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647 .toString(16)+" bytes");return 0|t}function Pd(t,e){if(L.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Nt(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&r===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return da(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return kd(t).length;default:if(n)return i?-1:da(t).length;e=(""+e).toLowerCase(),n=!0}}function zm(t,e,r){var i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return tv(this,e,r);case"utf8":case"utf-8":return Od(this,e,r);case"ascii":return Zm(this,e,r);case"latin1":case"binary":return ev(this,e,r);case"base64":return Xm(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return rv(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function Er(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function md(t,e,r,i,n){if(t.length===0)return-1;if(typeof r=="string"?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),ya(r=+r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if(typeof e=="string"&&(e=L.from(e,i)),L.isBuffer(e))return e.length===0?-1:vd(t,e,r,i,n);if(typeof e=="number")return e&=255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):vd(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function vd(t,e,r,i,n){var o,s=1,a=t.length,l=e.length;if(i!==void 0&&((i=String(i).toLowerCase())==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||e.length<2)return-1;s=2,a/=2,l/=2,r/=2}function c(y,v){return s===1?y[v]:y.readUInt16BE(v*s)}if(n){var h=-1;for(o=r;o<a;o++)if(c(t,o)===c(e,h===-1?0:o-h)){if(h===-1&&(h=o),o-h+1===l)return h*s}else h!==-1&&(o-=o-h),h=-1}else for(r+l>a&&(r=a-l),o=r;o>=0;o--){for(var d=!0,g=0;g<l;g++)if(c(t,o+g)!==c(e,g)){d=!1;break}if(d)return o}return-1}function Gm(t,e,r,i){r=Number(r)||0;var n=t.length-r;i?(i=Number(i))>n&&(i=n):i=n;var o=e.length;i>o/2&&(i=o/2);for(var s=0;s<i;++s){var a=parseInt(e.substr(2*s,2),16);if(ya(a))return s;t[r+s]=a}return s}function Km(t,e,r,i){return es(da(e,t.length-r),t,r,i)}function Bd(t,e,r,i){return es(function(n){for(var o=[],s=0;s<n.length;++s)o.push(255&n.charCodeAt(s));return o}(e),t,r,i)}function Ym(t,e,r,i){return Bd(t,e,r,i)}function Qm(t,e,r,i){return es(kd(e),t,r,i)}function Jm(t,e,r,i){return es(function(n,o){for(var s,a,l,c=[],h=0;h<n.length&&!((o-=2)<0);++h)s=n.charCodeAt(h),a=s>>8,l=s%256,c.push(l),c.push(a);return c}(e,t.length-r),t,r,i)}function Xm(t,e,r){return e===0&&r===t.length?ca.fromByteArray(t):ca.fromByteArray(t.slice(e,r))}function Od(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;n<r;){var o,s,a,l,c=t[n],h=null,d=c>239?4:c>223?3:c>191?2:1;if(n+d<=r)switch(d){case 1:c<128&&(h=c);break;case 2:(192&(o=t[n+1]))==128&&(l=(31&c)<<6|63&o)>127&&(h=l);break;case 3:o=t[n+1],s=t[n+2],(192&o)==128&&(192&s)==128&&(l=(15&c)<<12|(63&o)<<6|63&s)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:o=t[n+1],s=t[n+2],a=t[n+3],(192&o)==128&&(192&s)==128&&(192&a)==128&&(l=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&l<1114112&&(h=l)}h===null?(h=65533,d=1):h>65535&&(h-=65536,i.push(h>>>10&1023|55296),h=56320|1023&h),i.push(h),n+=d}return function(g){var y=g.length;if(y<=4096)return String.fromCharCode.apply(String,g);for(var v="",E=0;E<y;)v+=String.fromCharCode.apply(String,g.slice(E,E+=4096));return v}(i)}function Zm(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;++n)i+=String.fromCharCode(127&t[n]);return i}function ev(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}function tv(t,e,r){var i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);for(var n="",o=e;o<r;++o)n+=nv[t[o]];return n}function rv(t,e,r){for(var i=t.slice(e,r),n="",o=0;o<i.length;o+=2)n+=String.fromCharCode(i[o]+256*i[o+1]);return n}function Se(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function Ne(t,e,r,i,n,o){if(!L.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}function xd(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Ed(t,e,r,i,n){return e=+e,r>>>=0,n||xd(t,0,r,4),ui.write(t,e,r,i,23,4),r+4}function Sd(t,e,r,i,n){return e=+e,r>>>=0,n||xd(t,0,r,8),ui.write(t,e,r,i,52,8),r+8}function da(t,e){var r;e=e||1/0;for(var i=t.length,n=null,o=[],s=0;s<i;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function kd(t){return ca.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(iv,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(t))}function es(t,e,r,i){for(var n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function Nt(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function ya(t){return t!=t}function Ad(t,e){for(var r in t)e[r]=t[r]}function Sr(t,e,r){return pt(t,e,r)}function Wi(t){var e;switch(this.encoding=function(r){var i=function(n){if(!n)return"utf8";for(var o;;)switch(n){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 n;default:if(o)return;n=(""+n).toLowerCase(),o=!0}}(r);if(typeof i!="string"&&(pa.isEncoding===Rd||!Rd(r)))throw new Error("Unknown encoding: "+r);return i||r}(t),this.encoding){case"utf16le":this.text=av,this.end=lv,e=4;break;case"utf8":this.fillLast=ov,e=4;break;case"base64":this.text=uv,this.end=fv,e=3;break;default:return this.write=cv,this.end=hv,void 0}this.lastNeed=0,this.lastTotal=0,this.lastChar=pa.allocUnsafe(e)}function fa(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function ov(t){var e=this.lastTotal-this.lastNeed,r=function(i,n,o){if((192&n[0])!=128)return i.lastNeed=0,"\uFFFD";if(i.lastNeed>1&&n.length>1){if((192&n[1])!=128)return i.lastNeed=1,"\uFFFD";if(i.lastNeed>2&&n.length>2&&(192&n[2])!=128)return i.lastNeed=2,"\uFFFD"}}(this,t);return r!==void 0?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length,void 0)}function av(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function lv(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function uv(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function fv(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function cv(t){return t.toString(this.encoding)}function hv(t){return t&&t.length?this.write(t):""}var Td,et,Fe,gd,Jn,vr,yd,Vm,Dt,ca,ui,wd,iv,nv,Xn,Zn,pt,sv,Ar,pa,Rd,ba=we(()=>{w();m();_();for(Td={byteLength:function(t){var e=bd(t),r=e[0],i=e[1];return 3*(r+i)/4-i},toByteArray:function(t){var e,r,i=bd(t),n=i[0],o=i[1],s=new gd(function(c,h,d){return 3*(h+d)/4-d}(0,n,o)),a=0,l=o>0?n-4:n;for(r=0;r<l;r+=4)e=Fe[t.charCodeAt(r)]<<18|Fe[t.charCodeAt(r+1)]<<12|Fe[t.charCodeAt(r+2)]<<6|Fe[t.charCodeAt(r+3)],s[a++]=e>>16&255,s[a++]=e>>8&255,s[a++]=255&e;return o===2&&(e=Fe[t.charCodeAt(r)]<<2|Fe[t.charCodeAt(r+1)]>>4,s[a++]=255&e),o===1&&(e=Fe[t.charCodeAt(r)]<<10|Fe[t.charCodeAt(r+1)]<<4|Fe[t.charCodeAt(r+2)]>>2,s[a++]=e>>8&255,s[a++]=255&e),s},fromByteArray:function(t){for(var e,r=t.length,i=r%3,n=[],o=0,s=r-i;o<s;o+=16383)n.push(Hm(t,o,o+16383>s?s:o+16383));return i===1?(e=t[r-1],n.push(et[e>>2]+et[e<<4&63]+"==")):i===2&&(e=(t[r-2]<<8)+t[r-1],n.push(et[e>>10]+et[e>>4&63]+et[e<<2&63]+"=")),n.join("")}},et=[],Fe=[],gd=typeof Uint8Array<"u"?Uint8Array:Array,Jn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",vr=0,yd=Jn.length;vr<yd;++vr)et[vr]=Jn[vr],Fe[Jn.charCodeAt(vr)]=vr;Fe["-".charCodeAt(0)]=62,Fe["_".charCodeAt(0)]=63;Vm={read:function(t,e,r,i,n){var o,s,a=8*n-i-1,l=(1<<a)-1,c=l>>1,h=-7,d=r?n-1:0,g=r?-1:1,y=t[e+d];for(d+=g,o=y&(1<<-h)-1,y>>=-h,h+=a;h>0;o=256*o+t[e+d],d+=g,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=i;h>0;s=256*s+t[e+d],d+=g,h-=8);if(o===0)o=1-c;else{if(o===l)return s?NaN:1/0*(y?-1:1);s+=Math.pow(2,i),o-=c}return(y?-1:1)*s*Math.pow(2,o-i)},write:function(t,e,r,i,n,o){var s,a,l,c=8*o-n-1,h=(1<<c)-1,d=h>>1,g=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=i?0:o-1,v=i?1:-1,E=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+d>=1?g/l:g*Math.pow(2,1-d))*l>=2&&(s++,l/=2),s+d>=h?(a=0,s=h):s+d>=1?(a=(e*l-1)*Math.pow(2,n),s+=d):(a=e*Math.pow(2,d-1)*Math.pow(2,n),s=0));n>=8;t[r+y]=255&a,y+=v,a/=256,n-=8);for(s=s<<n|a,c+=n;c>0;t[r+y]=255&s,y+=v,s/=256,c-=8);t[r+y-v]|=128*E}},Dt={},ca=Td,ui=Vm,wd=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Dt.Buffer=L,Dt.SlowBuffer=function(t){return+t!=t&&(t=0),L.alloc(+t)},Dt.INSPECT_MAX_BYTES=50;Dt.kMaxLength=2147483647,L.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}(),L.TYPED_ARRAY_SUPPORT||typeof console>"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),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(t,e,r){return Id(t,e,r)},Object.setPrototypeOf(L.prototype,Uint8Array.prototype),Object.setPrototypeOf(L,Uint8Array),L.alloc=function(t,e,r){return function(i,n,o){return Cd(i),i<=0?Ut(i):n!==void 0?typeof o=="string"?Ut(i).fill(n,o):Ut(i).fill(n):Ut(i)}(t,e,r)},L.allocUnsafe=function(t){return ha(t)},L.allocUnsafeSlow=function(t){return ha(t)},L.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==L.prototype},L.compare=function(t,e){if(Nt(t,Uint8Array)&&(t=L.from(t,t.offset,t.byteLength)),Nt(e,Uint8Array)&&(e=L.from(e,e.offset,e.byteLength)),!L.isBuffer(t)||!L.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,i=e.length,n=0,o=Math.min(r,i);n<o;++n)if(t[n]!==e[n]){r=t[n],i=e[n];break}return r<i?-1:i<r?1:0},L.isEncoding=function(t){switch(String(t).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(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return L.alloc(0);var r;if(e===void 0)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var i=L.allocUnsafe(e),n=0;for(r=0;r<t.length;++r){var o=t[r];if(Nt(o,Uint8Array)&&(o=L.from(o)),!L.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,n),n+=o.length}return i},L.byteLength=Pd,L.prototype._isBuffer=!0,L.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)Er(this,e,e+1);return this},L.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)Er(this,e,e+3),Er(this,e+1,e+2);return this},L.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)Er(this,e,e+7),Er(this,e+1,e+6),Er(this,e+2,e+5),Er(this,e+3,e+4);return this},L.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?Od(this,0,t):zm.apply(this,arguments)},L.prototype.toLocaleString=L.prototype.toString,L.prototype.equals=function(t){if(!L.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||L.compare(this,t)===0},L.prototype.inspect=function(){var t="",e=Dt.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},wd&&(L.prototype[wd]=L.prototype.inspect),L.prototype.compare=function(t,e,r,i,n){if(Nt(t,Uint8Array)&&(t=L.from(t,t.offset,t.byteLength)),!L.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(e===void 0&&(e=0),r===void 0&&(r=t?t.length:0),i===void 0&&(i=0),n===void 0&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(n>>>=0)-(i>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),l=this.slice(i,n),c=t.slice(e,r),h=0;h<a;++h)if(l[h]!==c[h]){o=l[h],s=c[h];break}return o<s?-1:s<o?1:0},L.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1},L.prototype.indexOf=function(t,e,r){return md(this,t,e,r,!0)},L.prototype.lastIndexOf=function(t,e,r){return md(this,t,e,r,!1)},L.prototype.write=function(t,e,r,i){if(e===void 0)i="utf8",r=this.length,e=0;else if(r===void 0&&typeof e=="string")i=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,i===void 0&&(i="utf8")):(i=r,r=void 0)}var n=this.length-e;if((r===void 0||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return Gm(this,t,e,r);case"utf8":case"utf-8":return Km(this,t,e,r);case"ascii":return Bd(this,t,e,r);case"latin1":case"binary":return Ym(this,t,e,r);case"base64":return Qm(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Jm(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},L.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};L.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=e===void 0?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var i=this.subarray(t,e);return Object.setPrototypeOf(i,L.prototype),i},L.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||Se(t,e,this.length);for(var i=this[t],n=1,o=0;++o<e&&(n*=256);)i+=this[t+o]*n;return i},L.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||Se(t,e,this.length);for(var i=this[t+--e],n=1;e>0&&(n*=256);)i+=this[t+--e]*n;return i},L.prototype.readUInt8=function(t,e){return t>>>=0,e||Se(t,1,this.length),this[t]},L.prototype.readUInt16LE=function(t,e){return t>>>=0,e||Se(t,2,this.length),this[t]|this[t+1]<<8},L.prototype.readUInt16BE=function(t,e){return t>>>=0,e||Se(t,2,this.length),this[t]<<8|this[t+1]},L.prototype.readUInt32LE=function(t,e){return t>>>=0,e||Se(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},L.prototype.readUInt32BE=function(t,e){return t>>>=0,e||Se(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},L.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||Se(t,e,this.length);for(var i=this[t],n=1,o=0;++o<e&&(n*=256);)i+=this[t+o]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*e)),i},L.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||Se(t,e,this.length);for(var i=e,n=1,o=this[t+--i];i>0&&(n*=256);)o+=this[t+--i]*n;return o>=(n*=128)&&(o-=Math.pow(2,8*e)),o},L.prototype.readInt8=function(t,e){return t>>>=0,e||Se(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},L.prototype.readInt16LE=function(t,e){t>>>=0,e||Se(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},L.prototype.readInt16BE=function(t,e){t>>>=0,e||Se(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},L.prototype.readInt32LE=function(t,e){return t>>>=0,e||Se(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},L.prototype.readInt32BE=function(t,e){return t>>>=0,e||Se(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},L.prototype.readFloatLE=function(t,e){return t>>>=0,e||Se(t,4,this.length),ui.read(this,t,!0,23,4)},L.prototype.readFloatBE=function(t,e){return t>>>=0,e||Se(t,4,this.length),ui.read(this,t,!1,23,4)},L.prototype.readDoubleLE=function(t,e){return t>>>=0,e||Se(t,8,this.length),ui.read(this,t,!0,52,8)},L.prototype.readDoubleBE=function(t,e){return t>>>=0,e||Se(t,8,this.length),ui.read(this,t,!1,52,8)},L.prototype.writeUIntLE=function(t,e,r,i){t=+t,e>>>=0,r>>>=0,i||Ne(this,t,e,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[e]=255&t;++o<r&&(n*=256);)this[e+o]=t/n&255;return e+r},L.prototype.writeUIntBE=function(t,e,r,i){t=+t,e>>>=0,r>>>=0,i||Ne(this,t,e,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[e+n]=255&t;--n>=0&&(o*=256);)this[e+n]=t/o&255;return e+r},L.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||Ne(this,t,e,1,255,0),this[e]=255&t,e+1},L.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||Ne(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},L.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||Ne(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},L.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||Ne(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},L.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||Ne(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},L.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e>>>=0,!i){var n=Math.pow(2,8*r-1);Ne(this,t,e,r,n-1,-n)}var o=0,s=1,a=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&a===0&&this[e+o-1]!==0&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},L.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e>>>=0,!i){var n=Math.pow(2,8*r-1);Ne(this,t,e,r,n-1,-n)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&a===0&&this[e+o+1]!==0&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},L.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||Ne(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},L.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||Ne(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},L.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||Ne(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},L.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||Ne(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},L.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||Ne(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},L.prototype.writeFloatLE=function(t,e,r){return Ed(this,t,e,!0,r)},L.prototype.writeFloatBE=function(t,e,r){return Ed(this,t,e,!1,r)},L.prototype.writeDoubleLE=function(t,e,r){return Sd(this,t,e,!0,r)},L.prototype.writeDoubleBE=function(t,e,r){return Sd(this,t,e,!1,r)},L.prototype.copy=function(t,e,r,i){if(!L.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||i===0||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===r||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);var n=i-r;if(this===t&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin(e,r,i);else if(this===t&&r<e&&e<i)for(var o=n-1;o>=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,i),e);return n},L.prototype.fill=function(t,e,r,i){if(typeof t=="string"){if(typeof e=="string"?(i=e,e=0,r=this.length):typeof r=="string"&&(i=r,r=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!L.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){var n=t.charCodeAt(0);(i==="utf8"&&n<128||i==="latin1")&&(t=n)}}else typeof t=="number"?t&=255:typeof t=="boolean"&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=r===void 0?this.length:r>>>0,t||(t=0),typeof t=="number")for(o=e;o<r;++o)this[o]=t;else{var s=L.isBuffer(t)?t:L.from(t,i),a=s.length;if(a===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=s[o%a]}return this};iv=/[^+/0-9A-Za-z-_]/g;nv=function(){for(var t=new Array(256),e=0;e<16;++e)for(var r=16*e,i=0;i<16;++i)t[r+i]="0123456789abcdef"[e]+"0123456789abcdef"[i];return t}();Dt.Buffer;Dt.INSPECT_MAX_BYTES;Dt.kMaxLength;Xn={},Zn=Dt,pt=Zn.Buffer;pt.from&&pt.alloc&&pt.allocUnsafe&&pt.allocUnsafeSlow?Xn=Zn:(Ad(Zn,Xn),Xn.Buffer=Sr),Sr.prototype=Object.create(pt.prototype),Ad(pt,Sr),Sr.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return pt(t,e,r)},Sr.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=pt(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i},Sr.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return pt(t)},Sr.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Zn.SlowBuffer(t)};sv=Xn,Ar={},pa=sv.Buffer,Rd=pa.isEncoding||function(t){switch((t=""+t)&&t.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}};Ar.StringDecoder=Wi,Wi.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if((e=this.fillLast(t))===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},Wi.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e},Wi.prototype.text=function(t,e){var r=function(n,o,s){var a=o.length-1;if(a<s)return 0;var l=fa(o[a]);return l>=0?(l>0&&(n.lastNeed=l-1),l):--a<s||l===-2?0:(l=fa(o[a]))>=0?(l>0&&(n.lastNeed=l-2),l):--a<s||l===-2?0:(l=fa(o[a]))>=0?(l>0&&(l===2?l=0:n.lastNeed=l-3),l):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},Wi.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};Ar.StringDecoder;Ar.StringDecoder});var Md={};Yt(Md,{StringDecoder:()=>dv,default:()=>Ar});var dv,Ld=we(()=>{w();m();_();ba();ba();dv=Ar.StringDecoder});var wa=M((dx,qd)=>{"use strict";w();m();_();var Ud=Xt(),{PromisePrototypeThen:pv,SymbolAsyncIterator:Nd,SymbolIterator:Dd}=me(),{Buffer:gv}=(de(),K(_e)),{ERR_INVALID_ARG_TYPE:yv,ERR_STREAM_NULL_VALUES:bv}=Be().codes;function wv(t,e,r){let i;if(typeof e=="string"||e instanceof gv)return new t({objectMode:!0,...r,read(){this.push(e),this.push(null)}});let n;if(e&&e[Nd])n=!0,i=e[Nd]();else if(e&&e[Dd])n=!1,i=e[Dd]();else throw new yv("iterable",["Iterable"],e);let o=new t({objectMode:!0,highWaterMark:1,...r}),s=!1;o._read=function(){s||(s=!0,l())},o._destroy=function(c,h){pv(a(c),()=>Ud.nextTick(h,c),d=>Ud.nextTick(h,d||c))};async function a(c){let h=c!=null,d=typeof i.throw=="function";if(h&&d){let{value:g,done:y}=await i.throw(c);if(await g,y)return}if(typeof i.return=="function"){let{value:g}=await i.return();await g}}async function l(){for(;;){try{let{value:c,done:h}=n?await i.next():i.next();if(h)o.push(null);else{let d=c&&typeof c.then=="function"?await c:c;if(d===null)throw s=!1,new bv;if(o.push(d))continue;s=!1}}catch(c){o.destroy(c)}break}}return o}qd.exports=wv});var $i=M((vx,Xd)=>{w();m();_();var tt=Xt(),{ArrayPrototypeIndexOf:_v,NumberIsInteger:mv,NumberIsNaN:vv,NumberParseInt:Ev,ObjectDefineProperties:Wd,ObjectKeys:Sv,ObjectSetPrototypeOf:$d,Promise:Av,SafeSet:Rv,SymbolAsyncIterator:Tv,Symbol:Iv}=me();Xd.exports=W;W.ReadableState=Aa;var{EventEmitter:Cv}=(Lt(),K(Mt)),{Stream:er,prependListener:Pv}=Gn(),{Buffer:_a}=(de(),K(_e)),{addAbortSignal:Bv}=Fi(),Ov=kt(),z=lt().debuglog("stream",t=>{z=t}),xv=hd(),ci=mr(),{getHighWaterMark:kv,getDefaultHighWaterMark:Mv}=Qn(),{aggregateTwoErrors:jd,codes:{ERR_INVALID_ARG_TYPE:Lv,ERR_METHOD_NOT_IMPLEMENTED:Uv,ERR_OUT_OF_RANGE:Nv,ERR_STREAM_PUSH_AFTER_EOF:Dv,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:qv}}=Be(),{validateObject:jv}=ji(),Rr=Iv("kPaused"),{StringDecoder:Hd}=(Ld(),K(Md)),Fv=wa();$d(W.prototype,er.prototype);$d(W,er);var ma=()=>{},{errorOrDestroy:fi}=ci;function Aa(t,e,r){typeof r!="boolean"&&(r=e instanceof gt()),this.objectMode=!!(t&&t.objectMode),r&&(this.objectMode=this.objectMode||!!(t&&t.readableObjectMode)),this.highWaterMark=t?kv(this,t,"readableHighWaterMark",r):Mv(!1),this.buffer=new xv,this.length=0,this.pipes=[],this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.constructed=!0,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this[Rr]=null,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.destroyed=!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.multiAwaitDrain=!1,this.readingMore=!1,this.dataEmitted=!1,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new Hd(t.encoding),this.encoding=t.encoding)}function W(t){if(!(this instanceof W))return new W(t);let e=this instanceof gt();this._readableState=new Aa(t,this,e),t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&!e&&Bv(t.signal,this)),er.call(this,t),ci.construct(this,()=>{this._readableState.needReadable&&ts(this,this._readableState)})}W.prototype.destroy=ci.destroy;W.prototype._undestroy=ci.undestroy;W.prototype._destroy=function(t,e){e(t)};W.prototype[Cv.captureRejectionSymbol]=function(t){this.destroy(t)};W.prototype.push=function(t,e){return Vd(this,t,e,!1)};W.prototype.unshift=function(t,e){return Vd(this,t,e,!0)};function Vd(t,e,r,i){z("readableAddChunk",e);let n=t._readableState,o;if(n.objectMode||(typeof e=="string"?(r=r||n.defaultEncoding,n.encoding!==r&&(i&&n.encoding?e=_a.from(e,r).toString(n.encoding):(e=_a.from(e,r),r=""))):e instanceof _a?r="":er._isUint8Array(e)?(e=er._uint8ArrayToBuffer(e),r=""):e!=null&&(o=new Lv("chunk",["string","Buffer","Uint8Array"],e))),o)fi(t,o);else if(e===null)n.reading=!1,Hv(t,n);else if(n.objectMode||e&&e.length>0)if(i)if(n.endEmitted)fi(t,new qv);else{if(n.destroyed||n.errored)return!1;va(t,n,e,!0)}else if(n.ended)fi(t,new Dv);else{if(n.destroyed||n.errored)return!1;n.reading=!1,n.decoder&&!r?(e=n.decoder.write(e),n.objectMode||e.length!==0?va(t,n,e,!1):ts(t,n)):va(t,n,e,!1)}else i||(n.reading=!1,ts(t,n));return!n.ended&&(n.length<n.highWaterMark||n.length===0)}function va(t,e,r,i){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?(e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&rs(t)),ts(t,e)}W.prototype.isPaused=function(){let t=this._readableState;return t[Rr]===!0||t.flowing===!1};W.prototype.setEncoding=function(t){let e=new Hd(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,i="";for(let n of r)i+=e.write(n);return r.clear(),i!==""&&r.push(i),this._readableState.length=i.length,this};var Wv=1073741824;function $v(t){if(t>Wv)throw new Nv("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}function Fd(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:vv(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}W.prototype.read=function(t){z("read",t),t===void 0?t=NaN:mv(t)||(t=Ev(t,10));let e=this._readableState,r=t;if(t>e.highWaterMark&&(e.highWaterMark=$v(t)),t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return z("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Ea(this):rs(this),null;if(t=Fd(t,e),t===0&&e.ended)return e.length===0&&Ea(this),null;let i=e.needReadable;if(z("need readable",i),(e.length===0||e.length-t<e.highWaterMark)&&(i=!0,z("length less than watermark",i)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)i=!1,z("reading, ended or constructing",i);else if(i){z("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0);try{this._read(e.highWaterMark)}catch(o){fi(this,o)}e.sync=!1,e.reading||(t=Fd(r,e))}let n;return t>0?n=Qd(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&Ea(this)),n!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",n)),n};function Hv(t,e){if(z("onEofChunk"),!e.ended){if(e.decoder){let r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?rs(t):(e.needReadable=!1,e.emittedReadable=!0,zd(t))}}function rs(t){let e=t._readableState;z("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(z("emitReadable",e.flowing),e.emittedReadable=!0,tt.nextTick(zd,t))}function zd(t){let e=t._readableState;z("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&!e.errored&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Kd(t)}function ts(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,tt.nextTick(Vv,t,e))}function Vv(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let r=e.length;if(z("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}W.prototype._read=function(t){throw new Uv("_read()")};W.prototype.pipe=function(t,e){let r=this,i=this._readableState;i.pipes.length===1&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new Rv(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(t),z("pipe count=%d opts=%j",i.pipes.length,e);let o=(!e||e.end!==!1)&&t!==tt.stdout&&t!==tt.stderr?a:A;i.endEmitted?tt.nextTick(o):r.once("end",o),t.on("unpipe",s);function s(T,B){z("onunpipe"),T===r&&B&&B.hasUnpiped===!1&&(B.hasUnpiped=!0,h())}function a(){z("onend"),t.end()}let l,c=!1;function h(){z("cleanup"),t.removeListener("close",v),t.removeListener("finish",E),l&&t.removeListener("drain",l),t.removeListener("error",y),t.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",A),r.removeListener("data",g),c=!0,l&&i.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&l()}function d(){c||(i.pipes.length===1&&i.pipes[0]===t?(z("false write response, pause",0),i.awaitDrainWriters=t,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(t)&&(z("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(t)),r.pause()),l||(l=zv(r,t),t.on("drain",l))}r.on("data",g);function g(T){z("ondata");let B=t.write(T);z("dest.write",B),B===!1&&d()}function y(T){if(z("onerror",T),A(),t.removeListener("error",y),t.listenerCount("error")===0){let B=t._writableState||t._readableState;B&&!B.errorEmitted?fi(t,T):t.emit("error",T)}}Pv(t,"error",y);function v(){t.removeListener("finish",E),A()}t.once("close",v);function E(){z("onfinish"),t.removeListener("close",v),A()}t.once("finish",E);function A(){z("unpipe"),r.unpipe(t)}return t.emit("pipe",r),t.writableNeedDrain===!0?i.flowing&&d():i.flowing||(z("pipe resume"),r.resume()),t};function zv(t,e){return function(){let i=t._readableState;i.awaitDrainWriters===e?(z("pipeOnDrain",1),i.awaitDrainWriters=null):i.multiAwaitDrain&&(z("pipeOnDrain",i.awaitDrainWriters.size),i.awaitDrainWriters.delete(e)),(!i.awaitDrainWriters||i.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()}}W.prototype.unpipe=function(t){let e=this._readableState,r={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let n=e.pipes;e.pipes=[],this.pause();for(let o=0;o<n.length;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}let i=_v(e.pipes,t);return i===-1?this:(e.pipes.splice(i,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,r),this)};W.prototype.on=function(t,e){let r=er.prototype.on.call(this,t,e),i=this._readableState;return t==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):t==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,z("on readable",i.length,i.reading),i.length?rs(this):i.reading||tt.nextTick(Gv,this)),r};W.prototype.addListener=W.prototype.on;W.prototype.removeListener=function(t,e){let r=er.prototype.removeListener.call(this,t,e);return t==="readable"&&tt.nextTick(Gd,this),r};W.prototype.off=W.prototype.removeListener;W.prototype.removeAllListeners=function(t){let e=er.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&tt.nextTick(Gd,this),e};function Gd(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[Rr]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}function Gv(t){z("readable nexttick read 0"),t.read(0)}W.prototype.resume=function(){let t=this._readableState;return t.flowing||(z("resume"),t.flowing=!t.readableListening,Kv(this,t)),t[Rr]=!1,this};function Kv(t,e){e.resumeScheduled||(e.resumeScheduled=!0,tt.nextTick(Yv,t,e))}function Yv(t,e){z("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Kd(t),e.flowing&&!e.reading&&t.read(0)}W.prototype.pause=function(){return z("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(z("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Rr]=!0,this};function Kd(t){let e=t._readableState;for(z("flow",e.flowing);e.flowing&&t.read()!==null;);}W.prototype.wrap=function(t){let e=!1;t.on("data",i=>{!this.push(i)&&t.pause&&(e=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",i=>{fi(this,i)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let r=Sv(t);for(let i=1;i<r.length;i++){let n=r[i];this[n]===void 0&&typeof t[n]=="function"&&(this[n]=t[n].bind(t))}return this};W.prototype[Tv]=function(){return Yd(this)};W.prototype.iterator=function(t){return t!==void 0&&jv(t,"options"),Yd(this,t)};function Yd(t,e){typeof t.read!="function"&&(t=W.wrap(t,{objectMode:!0}));let r=Qv(t,e);return r.stream=t,r}async function*Qv(t,e){let r=ma;function i(s){this===t?(r(),r=ma):r=s}t.on("readable",i);let n,o=Ov(t,{writable:!1},s=>{n=s?jd(n,s):null,r(),r=ma});try{for(;;){let s=t.destroyed?null:t.read();if(s!==null)yield s;else{if(n)throw n;if(n===null)return;await new Av(i)}}}catch(s){throw n=jd(n,s),n}finally{(n||e?.destroyOnReturn!==!1)&&(n===void 0||t._readableState.autoDestroy)?ci.destroyer(t,null):(t.off("readable",i),o())}}Wd(W.prototype,{readable:{__proto__:null,get(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},set(t){this._readableState&&(this._readableState.readable=!!t)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(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(t){this._readableState&&(this._readableState.flowing=t)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},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:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});Wd(Aa.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[Rr]!==!1},set(t){this[Rr]=!!t}}});W._fromList=Qd;function Qd(t,e){if(e.length===0)return null;let r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function Ea(t){let e=t._readableState;z("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,tt.nextTick(Jv,e,t))}function Jv(t,e){if(z("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&t.length===0){if(t.endEmitted=!0,e.emit("end"),e.writable&&e.allowHalfOpen===!1)tt.nextTick(Xv,e);else if(t.autoDestroy){let r=e._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&e.destroy()}}}function Xv(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}W.from=function(t,e){return Fv(W,t,e)};var Sa;function Jd(){return Sa===void 0&&(Sa={}),Sa}W.fromWeb=function(t,e){return Jd().newStreamReadableFromReadableStream(t,e)};W.toWeb=function(t,e){return Jd().newReadableStreamFromStreamReadable(t,e)};W.wrap=function(t,e){var r,i;return new W({objectMode:(r=(i=t.readableObjectMode)!==null&&i!==void 0?i:t.objectMode)!==null&&r!==void 0?r:!0,...e,destroy(n,o){ci.destroyer(t,n),o(n)}}).wrap(t)}});var Oa=M((Cx,fp)=>{w();m();_();var Tr=Xt(),{ArrayPrototypeSlice:tp,Error:Zv,FunctionPrototypeSymbolHasInstance:rp,ObjectDefineProperty:ip,ObjectDefineProperties:e1,ObjectSetPrototypeOf:np,StringPrototypeToLowerCase:t1,Symbol:r1,SymbolHasInstance:i1}=me();fp.exports=le;le.WritableState=zi;var{EventEmitter:n1}=(Lt(),K(Mt)),Hi=Gn().Stream,{Buffer:is}=(de(),K(_e)),os=mr(),{addAbortSignal:s1}=Fi(),{getHighWaterMark:o1,getDefaultHighWaterMark:a1}=Qn(),{ERR_INVALID_ARG_TYPE:l1,ERR_METHOD_NOT_IMPLEMENTED:u1,ERR_MULTIPLE_CALLBACK:sp,ERR_STREAM_CANNOT_PIPE:f1,ERR_STREAM_DESTROYED:Vi,ERR_STREAM_ALREADY_FINISHED:c1,ERR_STREAM_NULL_VALUES:h1,ERR_STREAM_WRITE_AFTER_END:d1,ERR_UNKNOWN_ENCODING:op}=Be().codes,{errorOrDestroy:hi}=os;np(le.prototype,Hi.prototype);np(le,Hi);function Ia(){}var di=r1("kOnFinished");function zi(t,e,r){typeof r!="boolean"&&(r=e instanceof gt()),this.objectMode=!!(t&&t.objectMode),r&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?o1(this,t,"writableHighWaterMark",r):a1(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let i=!!(t&&t.decodeStrings===!1);this.decodeStrings=!i,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=g1.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,ss(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[di]=[]}function ss(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}zi.prototype.getBuffer=function(){return tp(this.buffered,this.bufferedIndex)};ip(zi.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function le(t){let e=this instanceof gt();if(!e&&!rp(le,this))return new le(t);this._writableState=new zi(t,this,e),t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&s1(t.signal,this)),Hi.call(this,t),os.construct(this,()=>{let r=this._writableState;r.writing||Pa(this,r),Ba(this,r)})}ip(le,i1,{__proto__:null,value:function(t){return rp(this,t)?!0:this!==le?!1:t&&t._writableState instanceof zi}});le.prototype.pipe=function(){hi(this,new f1)};function ap(t,e,r,i){let n=t._writableState;if(typeof r=="function")i=r,r=n.defaultEncoding;else{if(!r)r=n.defaultEncoding;else if(r!=="buffer"&&!is.isEncoding(r))throw new op(r);typeof i!="function"&&(i=Ia)}if(e===null)throw new h1;if(!n.objectMode)if(typeof e=="string")n.decodeStrings!==!1&&(e=is.from(e,r),r="buffer");else if(e instanceof is)r="buffer";else if(Hi._isUint8Array(e))e=Hi._uint8ArrayToBuffer(e),r="buffer";else throw new l1("chunk",["string","Buffer","Uint8Array"],e);let o;return n.ending?o=new d1:n.destroyed&&(o=new Vi("write")),o?(Tr.nextTick(i,o),hi(t,o,!0),o):(n.pendingcb++,p1(t,n,e,r,i))}le.prototype.write=function(t,e,r){return ap(this,t,e,r)===!0};le.prototype.cork=function(){this._writableState.corked++};le.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||Pa(this,t))};le.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=t1(e)),!is.isEncoding(e))throw new op(e);return this._writableState.defaultEncoding=e,this};function p1(t,e,r,i,n){let o=e.objectMode?1:r.length;e.length+=o;let s=e.length<e.highWaterMark;return s||(e.needDrain=!0),e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:r,encoding:i,callback:n}),e.allBuffers&&i!=="buffer"&&(e.allBuffers=!1),e.allNoop&&n!==Ia&&(e.allNoop=!1)):(e.writelen=o,e.writecb=n,e.writing=!0,e.sync=!0,t._write(r,i,e.onwrite),e.sync=!1),s&&!e.errored&&!e.destroyed}function Zd(t,e,r,i,n,o,s){e.writelen=i,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new Vi("write")):r?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}function ep(t,e,r,i){--e.pendingcb,i(r),Ca(e),hi(t,r)}function g1(t,e){let r=t._writableState,i=r.sync,n=r.writecb;if(typeof n!="function"){hi(t,new sp);return}r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,e?(e.stack,r.errored||(r.errored=e),t._readableState&&!t._readableState.errored&&(t._readableState.errored=e),i?Tr.nextTick(ep,t,r,e,n):ep(t,r,e,n)):(r.buffered.length>r.bufferedIndex&&Pa(t,r),i?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===n?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:n,stream:t,state:r},Tr.nextTick(y1,r.afterWriteTickInfo)):lp(t,r,1,n))}function y1({stream:t,state:e,count:r,cb:i}){return e.afterWriteTickInfo=null,lp(t,e,r,i)}function lp(t,e,r,i){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));r-- >0;)e.pendingcb--,i();e.destroyed&&Ca(e),Ba(t,e)}function Ca(t){if(t.writing)return;for(let n=t.bufferedIndex;n<t.buffered.length;++n){var e;let{chunk:o,callback:s}=t.buffered[n],a=t.objectMode?1:o.length;t.length-=a,s((e=t.errored)!==null&&e!==void 0?e:new Vi("write"))}let r=t[di].splice(0);for(let n=0;n<r.length;n++){var i;r[n]((i=t.errored)!==null&&i!==void 0?i:new Vi("end"))}ss(t)}function Pa(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:r,bufferedIndex:i,objectMode:n}=e,o=r.length-i;if(!o)return;let s=i;if(e.bufferProcessing=!0,o>1&&t._writev){e.pendingcb-=o-1;let a=e.allNoop?Ia:c=>{for(let h=s;h<r.length;++h)r[h].callback(c)},l=e.allNoop&&s===0?r:tp(r,s);l.allBuffers=e.allBuffers,Zd(t,e,!0,e.length,l,"",a),ss(e)}else{do{let{chunk:a,encoding:l,callback:c}=r[s];r[s++]=null;let h=n?1:a.length;Zd(t,e,!1,h,a,l,c)}while(s<r.length&&!e.writing);s===r.length?ss(e):s>256?(r.splice(0,s),e.bufferedIndex=0):e.bufferedIndex=s}e.bufferProcessing=!1}le.prototype._write=function(t,e,r){if(this._writev)this._writev([{chunk:t,encoding:e}],r);else throw new u1("_write()")};le.prototype._writev=null;le.prototype.end=function(t,e,r){let i=this._writableState;typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null);let n;if(t!=null){let o=ap(this,t,e);o instanceof Zv&&(n=o)}return i.corked&&(i.corked=1,this.uncork()),n||(!i.errored&&!i.ending?(i.ending=!0,Ba(this,i,!0),i.ended=!0):i.finished?n=new c1("end"):i.destroyed&&(n=new Vi("end"))),typeof r=="function"&&(n||i.finished?Tr.nextTick(r,n):i[di].push(r)),this};function ns(t){return t.ending&&!t.destroyed&&t.constructed&&t.length===0&&!t.errored&&t.buffered.length===0&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}function b1(t,e){let r=!1;function i(n){if(r){hi(t,n??sp());return}if(r=!0,e.pendingcb--,n){let o=e[di].splice(0);for(let s=0;s<o.length;s++)o[s](n);hi(t,n,e.sync)}else ns(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,Tr.nextTick(Ta,t,e))}e.sync=!0,e.pendingcb++;try{t._final(i)}catch(n){i(n)}e.sync=!1}function w1(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,b1(t,e)):(e.prefinished=!0,t.emit("prefinish")))}function Ba(t,e,r){ns(e)&&(w1(t,e),e.pendingcb===0&&(r?(e.pendingcb++,Tr.nextTick((i,n)=>{ns(n)?Ta(i,n):n.pendingcb--},t,e)):ns(e)&&(e.pendingcb++,Ta(t,e))))}function Ta(t,e){e.pendingcb--,e.finished=!0;let r=e[di].splice(0);for(let i=0;i<r.length;i++)r[i]();if(t.emit("finish"),e.autoDestroy){let i=t._readableState;(!i||i.autoDestroy&&(i.endEmitted||i.readable===!1))&&t.destroy()}}e1(le.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(t){this._writableState&&(this._writableState.destroyed=t)}},writable:{__proto__:null,get(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},set(t){this._writableState&&(this._writableState.writable=!!t)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1}},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!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var _1=os.destroy;le.prototype.destroy=function(t,e){let r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[di].length)&&Tr.nextTick(Ca,r),_1.call(this,t,e),this};le.prototype._undestroy=os.undestroy;le.prototype._destroy=function(t,e){e(t)};le.prototype[n1.captureRejectionSymbol]=function(t){this.destroy(t)};var Ra;function up(){return Ra===void 0&&(Ra={}),Ra}le.fromWeb=function(t,e){return up().newStreamWritableFromWritableStream(t,e)};le.toWeb=function(t){return up().newWritableStreamFromStreamWritable(t)}});var Ep=M((Lx,vp)=>{w();m();_();var xa=Xt(),m1=(de(),K(_e)),{isReadable:v1,isWritable:E1,isIterable:cp,isNodeStream:S1,isReadableNodeStream:hp,isWritableNodeStream:dp,isDuplexNodeStream:A1}=ht(),pp=kt(),{AbortError:mp,codes:{ERR_INVALID_ARG_TYPE:R1,ERR_INVALID_RETURN_VALUE:gp}}=Be(),{destroyer:pi}=mr(),T1=gt(),I1=$i(),{createDeferredPromise:yp}=lt(),bp=wa(),wp=globalThis.Blob||m1.Blob,C1=typeof wp<"u"?function(e){return e instanceof wp}:function(e){return!1},P1=globalThis.AbortController||Un().AbortController,{FunctionPrototypeCall:_p}=me(),Ir=class extends T1{constructor(e){super(e),e?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};vp.exports=function t(e,r){if(A1(e))return e;if(hp(e))return as({readable:e});if(dp(e))return as({writable:e});if(S1(e))return as({writable:!1,readable:!1});if(typeof e=="function"){let{value:n,write:o,final:s,destroy:a}=B1(e);if(cp(n))return bp(Ir,n,{objectMode:!0,write:o,final:s,destroy:a});let l=n?.then;if(typeof l=="function"){let c,h=_p(l,n,d=>{if(d!=null)throw new gp("nully","body",d)},d=>{pi(c,d)});return c=new Ir({objectMode:!0,readable:!1,write:o,final(d){s(async()=>{try{await h,xa.nextTick(d,null)}catch(g){xa.nextTick(d,g)}})},destroy:a})}throw new gp("Iterable, AsyncIterable or AsyncFunction",r,n)}if(C1(e))return t(e.arrayBuffer());if(cp(e))return bp(Ir,e,{objectMode:!0,writable:!1});if(typeof e?.writable=="object"||typeof e?.readable=="object"){let n=e!=null&&e.readable?hp(e?.readable)?e?.readable:t(e.readable):void 0,o=e!=null&&e.writable?dp(e?.writable)?e?.writable:t(e.writable):void 0;return as({readable:n,writable:o})}let i=e?.then;if(typeof i=="function"){let n;return _p(i,e,o=>{o!=null&&n.push(o),n.push(null)},o=>{pi(n,o)}),n=new Ir({objectMode:!0,writable:!1,read(){}})}throw new R1(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)};function B1(t){let{promise:e,resolve:r}=yp(),i=new P1,n=i.signal;return{value:t(async function*(){for(;;){let s=e;e=null;let{chunk:a,done:l,cb:c}=await s;if(xa.nextTick(c),l)return;if(n.aborted)throw new mp(void 0,{cause:n.reason});({promise:e,resolve:r}=yp()),yield a}}(),{signal:n}),write(s,a,l){let c=r;r=null,c({chunk:s,done:!1,cb:l})},final(s){let a=r;r=null,a({done:!0,cb:s})},destroy(s,a){i.abort(),a(s)}}}function as(t){let e=t.readable&&typeof t.readable.read!="function"?I1.wrap(t.readable):t.readable,r=t.writable,i=!!v1(e),n=!!E1(r),o,s,a,l,c;function h(d){let g=l;l=null,g?g(d):d&&c.destroy(d)}return c=new Ir({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:i,writable:n}),n&&(pp(r,d=>{n=!1,d&&pi(e,d),h(d)}),c._write=function(d,g,y){r.write(d,g)?y():o=y},c._final=function(d){r.end(),s=d},r.on("drain",function(){if(o){let d=o;o=null,d()}}),r.on("finish",function(){if(s){let d=s;s=null,d()}})),i&&(pp(e,d=>{i=!1,d&&pi(e,d),h(d)}),e.on("readable",function(){if(a){let d=a;a=null,d()}}),e.on("end",function(){c.push(null)}),c._read=function(){for(;;){let d=e.read();if(d===null){a=c._read;return}if(!c.push(d))return}}),c._destroy=function(d,g){!d&&l!==null&&(d=new mp),a=null,o=null,s=null,l===null?g(d):(l=g,pi(r,d),pi(e,d))},c}});var gt=M((Wx,Rp)=>{"use strict";w();m();_();var{ObjectDefineProperties:O1,ObjectGetOwnPropertyDescriptor:qt,ObjectKeys:x1,ObjectSetPrototypeOf:Sp}=me();Rp.exports=rt;var La=$i(),ze=Oa();Sp(rt.prototype,La.prototype);Sp(rt,La);{let t=x1(ze.prototype);for(let e=0;e<t.length;e++){let r=t[e];rt.prototype[r]||(rt.prototype[r]=ze.prototype[r])}}function rt(t){if(!(this instanceof rt))return new rt(t);La.call(this,t),ze.call(this,t),t?(this.allowHalfOpen=t.allowHalfOpen!==!1,t.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}O1(rt.prototype,{writable:{__proto__:null,...qt(ze.prototype,"writable")},writableHighWaterMark:{__proto__:null,...qt(ze.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...qt(ze.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...qt(ze.prototype,"writableBuffer")},writableLength:{__proto__:null,...qt(ze.prototype,"writableLength")},writableFinished:{__proto__:null,...qt(ze.prototype,"writableFinished")},writableCorked:{__proto__:null,...qt(ze.prototype,"writableCorked")},writableEnded:{__proto__:null,...qt(ze.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...qt(ze.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}});var ka;function Ap(){return ka===void 0&&(ka={}),ka}rt.fromWeb=function(t,e){return Ap().newStreamDuplexFromReadableWritablePair(t,e)};rt.toWeb=function(t){return Ap().newReadableWritablePairFromDuplex(t)};var Ma;rt.from=function(t){return Ma||(Ma=Ep()),Ma(t,"body")}});var Da=M((Yx,Ip)=>{"use strict";w();m();_();var{ObjectSetPrototypeOf:Tp,Symbol:k1}=me();Ip.exports=jt;var{ERR_METHOD_NOT_IMPLEMENTED:M1}=Be().codes,Na=gt(),{getHighWaterMark:L1}=Qn();Tp(jt.prototype,Na.prototype);Tp(jt,Na);var Gi=k1("kCallback");function jt(t){if(!(this instanceof jt))return new jt(t);let e=t?L1(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),Na.call(this,t),this._readableState.sync=!1,this[Gi]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",U1)}function Ua(t){typeof this._flush=="function"&&!this.destroyed?this._flush((e,r)=>{if(e){t?t(e):this.destroy(e);return}r!=null&&this.push(r),this.push(null),t&&t()}):(this.push(null),t&&t())}function U1(){this._final!==Ua&&Ua.call(this)}jt.prototype._final=Ua;jt.prototype._transform=function(t,e,r){throw new M1("_transform()")};jt.prototype._write=function(t,e,r){let i=this._readableState,n=this._writableState,o=i.length;this._transform(t,e,(s,a)=>{if(s){r(s);return}a!=null&&this.push(a),n.ended||o===i.length||i.length<i.highWaterMark?r():this[Gi]=r})};jt.prototype._read=function(){if(this[Gi]){let t=this[Gi];this[Gi]=null,t()}}});var ja=M((rk,Pp)=>{"use strict";w();m();_();var{ObjectSetPrototypeOf:Cp}=me();Pp.exports=gi;var qa=Da();Cp(gi.prototype,qa.prototype);Cp(gi,qa);function gi(t){if(!(this instanceof gi))return new gi(t);qa.call(this,t)}gi.prototype._transform=function(t,e,r){r(null,t)}});var cs=M((uk,Mp)=>{w();m();_();var Ki=Xt(),{ArrayIsArray:N1,Promise:D1,SymbolAsyncIterator:q1}=me(),fs=kt(),{once:j1}=lt(),F1=mr(),Bp=gt(),{aggregateTwoErrors:W1,codes:{ERR_INVALID_ARG_TYPE:Ka,ERR_INVALID_RETURN_VALUE:Fa,ERR_MISSING_ARGS:$1,ERR_STREAM_DESTROYED:H1,ERR_STREAM_PREMATURE_CLOSE:V1},AbortError:z1}=Be(),{validateFunction:G1,validateAbortSignal:K1}=ji(),{isIterable:Cr,isReadable:Wa,isReadableNodeStream:us,isNodeStream:Op,isTransformStream:yi,isWebStream:Y1,isReadableStream:$a,isReadableEnded:Q1}=ht(),J1=globalThis.AbortController||Un().AbortController,Ha,Va;function xp(t,e,r){let i=!1;t.on("close",()=>{i=!0});let n=fs(t,{readable:e,writable:r},o=>{i=!o});return{destroy:o=>{i||(i=!0,F1.destroyer(t,o||new H1("pipe")))},cleanup:n}}function X1(t){return G1(t[t.length-1],"streams[stream.length - 1]"),t.pop()}function za(t){if(Cr(t))return t;if(us(t))return Z1(t);throw new Ka("val",["Readable","Iterable","AsyncIterable"],t)}async function*Z1(t){Va||(Va=$i()),yield*Va.prototype[q1].call(t)}async function ls(t,e,r,{end:i}){let n,o=null,s=c=>{if(c&&(n=c),o){let h=o;o=null,h()}},a=()=>new D1((c,h)=>{n?h(n):o=()=>{n?h(n):c()}});e.on("drain",s);let l=fs(e,{readable:!1},s);try{e.writableNeedDrain&&await a();for await(let c of t)e.write(c)||await a();i&&e.end(),await a(),r()}catch(c){r(n!==c?W1(n,c):c)}finally{l(),e.off("drain",s)}}async function Ga(t,e,r,{end:i}){yi(e)&&(e=e.writable);let n=e.getWriter();try{for await(let o of t)await n.ready,n.write(o).catch(()=>{});await n.ready,i&&await n.close(),r()}catch(o){try{await n.abort(o),r(o)}catch(s){r(s)}}}function eE(...t){return kp(t,j1(X1(t)))}function kp(t,e,r){if(t.length===1&&N1(t[0])&&(t=t[0]),t.length<2)throw new $1("streams");let i=new J1,n=i.signal,o=r?.signal,s=[];K1(o,"options.signal");function a(){y(new z1)}o?.addEventListener("abort",a);let l,c,h=[],d=0;function g(B){y(B,--d===0)}function y(B,I){if(B&&(!l||l.code==="ERR_STREAM_PREMATURE_CLOSE")&&(l=B),!(!l&&!I)){for(;h.length;)h.shift()(l);o?.removeEventListener("abort",a),i.abort(),I&&(l||s.forEach(N=>N()),Ki.nextTick(e,l,c))}}let v;for(let B=0;B<t.length;B++){let I=t[B],N=B<t.length-1,D=B>0,Y=N||r?.end!==!1,Z=B===t.length-1;if(Op(I)){let J=function(te){te&&te.name!=="AbortError"&&te.code!=="ERR_STREAM_PREMATURE_CLOSE"&&g(te)};var T=J;if(Y){let{destroy:te,cleanup:Pe}=xp(I,N,D);h.push(te),Wa(I)&&Z&&s.push(Pe)}I.on("error",J),Wa(I)&&Z&&s.push(()=>{I.removeListener("error",J)})}if(B===0)if(typeof I=="function"){if(v=I({signal:n}),!Cr(v))throw new Fa("Iterable, AsyncIterable or Stream","source",v)}else Cr(I)||us(I)||yi(I)?v=I:v=Bp.from(I);else if(typeof I=="function"){if(yi(v)){var E;v=za((E=v)===null||E===void 0?void 0:E.readable)}else v=za(v);if(v=I(v,{signal:n}),N){if(!Cr(v,!0))throw new Fa("AsyncIterable",`transform[${B-1}]`,v)}else{var A;Ha||(Ha=ja());let J=new Ha({objectMode:!0}),te=(A=v)===null||A===void 0?void 0:A.then;if(typeof te=="function")d++,te.call(v,Te=>{c=Te,Te!=null&&J.write(Te),Y&&J.end(),Ki.nextTick(g)},Te=>{J.destroy(Te),Ki.nextTick(g,Te)});else if(Cr(v,!0))d++,ls(v,J,g,{end:Y});else if($a(v)||yi(v)){let Te=v.readable||v;d++,ls(Te,J,g,{end:Y})}else throw new Fa("AsyncIterable or Promise","destination",v);v=J;let{destroy:Pe,cleanup:Ni}=xp(v,!1,!0);h.push(Pe),Z&&s.push(Ni)}}else if(Op(I)){if(us(v)){d+=2;let J=tE(v,I,g,{end:Y});Wa(I)&&Z&&s.push(J)}else if(yi(v)||$a(v)){let J=v.readable||v;d++,ls(J,I,g,{end:Y})}else if(Cr(v))d++,ls(v,I,g,{end:Y});else throw new Ka("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],v);v=I}else if(Y1(I)){if(us(v))d++,Ga(za(v),I,g,{end:Y});else if($a(v)||Cr(v))d++,Ga(v,I,g,{end:Y});else if(yi(v))d++,Ga(v.readable,I,g,{end:Y});else throw new Ka("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],v);v=I}else v=Bp.from(I)}return(n!=null&&n.aborted||o!=null&&o.aborted)&&Ki.nextTick(a),v}function tE(t,e,r,{end:i}){let n=!1;if(e.on("close",()=>{n||r(new V1)}),t.pipe(e,{end:!1}),i){let s=function(){n=!0,e.end()};var o=s;Q1(t)?Ki.nextTick(s):t.once("end",s)}else r();return fs(t,{readable:!0,writable:!1},s=>{let a=t._readableState;s&&s.code==="ERR_STREAM_PREMATURE_CLOSE"&&a&&a.ended&&!a.errored&&!a.errorEmitted?t.once("end",r).once("error",r):r(s)}),fs(e,{readable:!1,writable:!0},r)}Mp.exports={pipelineImpl:kp,pipeline:eE}});var Qa=M((yk,jp)=>{"use strict";w();m();_();var{pipeline:rE}=cs(),hs=gt(),{destroyer:iE}=mr(),{isNodeStream:ds,isReadable:Lp,isWritable:Up,isWebStream:Ya,isTransformStream:Pr,isWritableStream:Np,isReadableStream:Dp}=ht(),{AbortError:nE,codes:{ERR_INVALID_ARG_VALUE:qp,ERR_MISSING_ARGS:sE}}=Be(),oE=kt();jp.exports=function(...e){if(e.length===0)throw new sE("streams");if(e.length===1)return hs.from(e[0]);let r=[...e];if(typeof e[0]=="function"&&(e[0]=hs.from(e[0])),typeof e[e.length-1]=="function"){let y=e.length-1;e[y]=hs.from(e[y])}for(let y=0;y<e.length;++y)if(!(!ds(e[y])&&!Ya(e[y]))){if(y<e.length-1&&!(Lp(e[y])||Dp(e[y])||Pr(e[y])))throw new qp(`streams[${y}]`,r[y],"must be readable");if(y>0&&!(Up(e[y])||Np(e[y])||Pr(e[y])))throw new qp(`streams[${y}]`,r[y],"must be writable")}let i,n,o,s,a;function l(y){let v=s;s=null,v?v(y):y?a.destroy(y):!g&&!d&&a.destroy()}let c=e[0],h=rE(e,l),d=!!(Up(c)||Np(c)||Pr(c)),g=!!(Lp(h)||Dp(h)||Pr(h));if(a=new hs({writableObjectMode:!!(c!=null&&c.writableObjectMode),readableObjectMode:!!(h!=null&&h.writableObjectMode),writable:d,readable:g}),d){if(ds(c))a._write=function(v,E,A){c.write(v,E)?A():i=A},a._final=function(v){c.end(),n=v},c.on("drain",function(){if(i){let v=i;i=null,v()}});else if(Ya(c)){let E=(Pr(c)?c.writable:c).getWriter();a._write=async function(A,T,B){try{await E.ready,E.write(A).catch(()=>{}),B()}catch(I){B(I)}},a._final=async function(A){try{await E.ready,E.close().catch(()=>{}),n=A}catch(T){A(T)}}}let y=Pr(h)?h.readable:h;oE(y,()=>{if(n){let v=n;n=null,v()}})}if(g){if(ds(h))h.on("readable",function(){if(o){let y=o;o=null,y()}}),h.on("end",function(){a.push(null)}),a._read=function(){for(;;){let y=h.read();if(y===null){o=a._read;return}if(!a.push(y))return}};else if(Ya(h)){let v=(Pr(h)?h.readable:h).getReader();a._read=async function(){for(;;)try{let{value:E,done:A}=await v.read();if(!a.push(E))return;if(A){a.push(null);return}}catch{return}}}}return a._destroy=function(y,v){!y&&s!==null&&(y=new nE),o=null,i=null,n=null,s===null?v(y):(s=v,ds(h)&&iE(h,y))},a}});var Kp=M((Sk,Za)=>{"use strict";w();m();_();var Hp=globalThis.AbortController||Un().AbortController,{codes:{ERR_INVALID_ARG_VALUE:aE,ERR_INVALID_ARG_TYPE:Yi,ERR_MISSING_ARGS:lE,ERR_OUT_OF_RANGE:uE},AbortError:yt}=Be(),{validateAbortSignal:Br,validateInteger:fE,validateObject:Or}=ji(),cE=me().Symbol("kWeak"),{finished:hE}=kt(),dE=Qa(),{addAbortSignalNoValidate:pE}=Fi(),{isWritable:gE,isNodeStream:yE}=ht(),{ArrayPrototypePush:bE,MathFloor:wE,Number:_E,NumberIsNaN:mE,Promise:Fp,PromiseReject:Wp,PromisePrototypeThen:vE,Symbol:Vp}=me(),ps=Vp("kEmpty"),$p=Vp("kEof");function EE(t,e){if(e!=null&&Or(e,"options"),e?.signal!=null&&Br(e.signal,"options.signal"),yE(t)&&!gE(t))throw new aE("stream",t,"must be writable");let r=dE(this,t);return e!=null&&e.signal&&pE(e.signal,r),r}function gs(t,e){if(typeof t!="function")throw new Yi("fn",["Function","AsyncFunction"],t);e!=null&&Or(e,"options"),e?.signal!=null&&Br(e.signal,"options.signal");let r=1;return e?.concurrency!=null&&(r=wE(e.concurrency)),fE(r,"concurrency",1),async function*(){var n,o;let s=new Hp,a=this,l=[],c=s.signal,h={signal:c},d=()=>s.abort();e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted&&d(),e==null||(o=e.signal)===null||o===void 0||o.addEventListener("abort",d);let g,y,v=!1;function E(){v=!0}async function A(){try{for await(let I of a){var T;if(v)return;if(c.aborted)throw new yt;try{I=t(I,h)}catch(N){I=Wp(N)}I!==ps&&(typeof((T=I)===null||T===void 0?void 0:T.catch)=="function"&&I.catch(E),l.push(I),g&&(g(),g=null),!v&&l.length&&l.length>=r&&await new Fp(N=>{y=N}))}l.push($p)}catch(I){let N=Wp(I);vE(N,void 0,E),l.push(N)}finally{var B;v=!0,g&&(g(),g=null),e==null||(B=e.signal)===null||B===void 0||B.removeEventListener("abort",d)}}A();try{for(;;){for(;l.length>0;){let T=await l[0];if(T===$p)return;if(c.aborted)throw new yt;T!==ps&&(yield T),l.shift(),y&&(y(),y=null)}await new Fp(T=>{g=T})}}finally{s.abort(),v=!0,y&&(y(),y=null)}}.call(this)}function SE(t=void 0){return t!=null&&Or(t,"options"),t?.signal!=null&&Br(t.signal,"options.signal"),async function*(){let r=0;for await(let n of this){var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new yt({cause:t.signal.reason});yield[r++,n]}}.call(this)}async function zp(t,e=void 0){for await(let r of Xa.call(this,t,e))return!0;return!1}async function AE(t,e=void 0){if(typeof t!="function")throw new Yi("fn",["Function","AsyncFunction"],t);return!await zp.call(this,async(...r)=>!await t(...r),e)}async function RE(t,e){for await(let r of Xa.call(this,t,e))return r}async function TE(t,e){if(typeof t!="function")throw new Yi("fn",["Function","AsyncFunction"],t);async function r(i,n){return await t(i,n),ps}for await(let i of gs.call(this,r,e));}function Xa(t,e){if(typeof t!="function")throw new Yi("fn",["Function","AsyncFunction"],t);async function r(i,n){return await t(i,n)?i:ps}return gs.call(this,r,e)}var Ja=class extends lE{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function IE(t,e,r){var i;if(typeof t!="function")throw new Yi("reducer",["Function","AsyncFunction"],t);r!=null&&Or(r,"options"),r?.signal!=null&&Br(r.signal,"options.signal");let n=arguments.length>1;if(r!=null&&(i=r.signal)!==null&&i!==void 0&&i.aborted){let c=new yt(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await hE(this.destroy(c)),c}let o=new Hp,s=o.signal;if(r!=null&&r.signal){let c={once:!0,[cE]:this};r.signal.addEventListener("abort",()=>o.abort(),c)}let a=!1;try{for await(let c of this){var l;if(a=!0,r!=null&&(l=r.signal)!==null&&l!==void 0&&l.aborted)throw new yt;n?e=await t(e,c,{signal:s}):(e=c,n=!0)}if(!a&&!n)throw new Ja}finally{o.abort()}return e}async function CE(t){t!=null&&Or(t,"options"),t?.signal!=null&&Br(t.signal,"options.signal");let e=[];for await(let i of this){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new yt(void 0,{cause:t.signal.reason});bE(e,i)}return e}function PE(t,e){let r=gs.call(this,t,e);return async function*(){for await(let n of r)yield*n}.call(this)}function Gp(t){if(t=_E(t),mE(t))return 0;if(t<0)throw new uE("number",">= 0",t);return t}function BE(t,e=void 0){return e!=null&&Or(e,"options"),e?.signal!=null&&Br(e.signal,"options.signal"),t=Gp(t),async function*(){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new yt;for await(let o of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new yt;t--<=0&&(yield o)}}.call(this)}function OE(t,e=void 0){return e!=null&&Or(e,"options"),e?.signal!=null&&Br(e.signal,"options.signal"),t=Gp(t),async function*(){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new yt;for await(let o of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new yt;if(t-- >0)yield o;else return}}.call(this)}Za.exports.streamReturningOperators={asIndexedPairs:SE,drop:BE,filter:Xa,flatMap:PE,map:gs,take:OE,compose:EE};Za.exports.promiseReturningOperators={every:AE,forEach:TE,reduce:IE,toArray:CE,some:zp,find:RE}});var el=M((Bk,Yp)=>{"use strict";w();m();_();var{ArrayPrototypePop:xE,Promise:kE}=me(),{isIterable:ME,isNodeStream:LE,isWebStream:UE}=ht(),{pipelineImpl:NE}=cs(),{finished:DE}=kt();tl();function qE(...t){return new kE((e,r)=>{let i,n,o=t[t.length-1];if(o&&typeof o=="object"&&!LE(o)&&!ME(o)&&!UE(o)){let s=xE(t);i=s.signal,n=s.end}NE(t,(s,a)=>{s?r(s):e(a)},{signal:i,end:n})})}Yp.exports={finished:DE,pipeline:qE}});var tl=M((Nk,ng)=>{w();m();_();var{Buffer:jE}=(de(),K(_e)),{ObjectDefineProperty:Ft,ObjectKeys:Xp,ReflectApply:Zp}=me(),{promisify:{custom:eg}}=lt(),{streamReturningOperators:Qp,promiseReturningOperators:Jp}=Kp(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:tg}}=Be(),FE=Qa(),{pipeline:rg}=cs(),{destroyer:WE}=mr(),ig=kt(),rl=el(),il=ht(),ge=ng.exports=Gn().Stream;ge.isDisturbed=il.isDisturbed;ge.isErrored=il.isErrored;ge.isReadable=il.isReadable;ge.Readable=$i();for(let t of Xp(Qp)){let r=function(...i){if(new.target)throw tg();return ge.Readable.from(Zp(e,this,i))};nl=r;let e=Qp[t];Ft(r,"name",{__proto__:null,value:e.name}),Ft(r,"length",{__proto__:null,value:e.length}),Ft(ge.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}var nl;for(let t of Xp(Jp)){let r=function(...n){if(new.target)throw tg();return Zp(e,this,n)};nl=r;let e=Jp[t];Ft(r,"name",{__proto__:null,value:e.name}),Ft(r,"length",{__proto__:null,value:e.length}),Ft(ge.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}var nl;ge.Writable=Oa();ge.Duplex=gt();ge.Transform=Da();ge.PassThrough=ja();ge.pipeline=rg;var{addAbortSignal:$E}=Fi();ge.addAbortSignal=$E;ge.finished=ig;ge.destroy=WE;ge.compose=FE;Ft(ge,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return rl}});Ft(rg,eg,{__proto__:null,enumerable:!0,get(){return rl.pipeline}});Ft(ig,eg,{__proto__:null,enumerable:!0,get(){return rl.finished}});ge.Stream=ge;ge._isUint8Array=function(e){return e instanceof Uint8Array};ge._uint8ArrayToBuffer=function(e){return jE.from(e.buffer,e.byteOffset,e.byteLength)}});var xr=M((Hk,ye)=>{"use strict";w();m();_();var ve=tl(),HE=el(),VE=ve.Readable.destroy;ye.exports=ve.Readable;ye.exports._uint8ArrayToBuffer=ve._uint8ArrayToBuffer;ye.exports._isUint8Array=ve._isUint8Array;ye.exports.isDisturbed=ve.isDisturbed;ye.exports.isErrored=ve.isErrored;ye.exports.isReadable=ve.isReadable;ye.exports.Readable=ve.Readable;ye.exports.Writable=ve.Writable;ye.exports.Duplex=ve.Duplex;ye.exports.Transform=ve.Transform;ye.exports.PassThrough=ve.PassThrough;ye.exports.addAbortSignal=ve.addAbortSignal;ye.exports.finished=ve.finished;ye.exports.destroy=ve.destroy;ye.exports.destroy=VE;ye.exports.pipeline=ve.pipeline;ye.exports.compose=ve.compose;Object.defineProperty(ve,"promises",{configurable:!0,enumerable:!0,get(){return HE}});ye.exports.Stream=ve.Stream;ye.exports.default=ye.exports});var tr=M((Jk,sl)=>{w();m();_();typeof Object.create=="function"?sl.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:sl.exports=function(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}}});var ag=M((nM,og)=>{"use strict";w();m();_();var{Buffer:it}=(de(),K(_e)),sg=Symbol.for("BufferList");function ne(t){if(!(this instanceof ne))return new ne(t);ne._init.call(this,t)}ne._init=function(e){Object.defineProperty(this,sg,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)};ne.prototype._new=function(e){return new ne(e)};ne.prototype._offset=function(e){if(e===0)return[0,0];let r=0;for(let i=0;i<this._bufs.length;i++){let n=r+this._bufs[i].length;if(e<n||i===this._bufs.length-1)return[i,e-r];r=n}};ne.prototype._reverseOffset=function(t){let e=t[0],r=t[1];for(let i=0;i<e;i++)r+=this._bufs[i].length;return r};ne.prototype.get=function(e){if(e>this.length||e<0)return;let r=this._offset(e);return this._bufs[r[0]][r[1]]};ne.prototype.slice=function(e,r){return typeof e=="number"&&e<0&&(e+=this.length),typeof r=="number"&&r<0&&(r+=this.length),this.copy(null,0,e,r)};ne.prototype.copy=function(e,r,i,n){if((typeof i!="number"||i<0)&&(i=0),(typeof n!="number"||n>this.length)&&(n=this.length),i>=this.length||n<=0)return e||it.alloc(0);let o=!!e,s=this._offset(i),a=n-i,l=a,c=o&&r||0,h=s[1];if(i===0&&n===this.length){if(!o)return this._bufs.length===1?this._bufs[0]:it.concat(this._bufs,this.length);for(let d=0;d<this._bufs.length;d++)this._bufs[d].copy(e,c),c+=this._bufs[d].length;return e}if(l<=this._bufs[s[0]].length-h)return o?this._bufs[s[0]].copy(e,r,h,h+l):this._bufs[s[0]].slice(h,h+l);o||(e=it.allocUnsafe(a));for(let d=s[0];d<this._bufs.length;d++){let g=this._bufs[d].length-h;if(l>g)this._bufs[d].copy(e,c,h),c+=g;else{this._bufs[d].copy(e,c,h,h+l),c+=g;break}l-=g,h&&(h=0)}return e.length>c?e.slice(0,c):e};ne.prototype.shallowSlice=function(e,r){if(e=e||0,r=typeof r!="number"?this.length:r,e<0&&(e+=this.length),r<0&&(r+=this.length),e===r)return this._new();let i=this._offset(e),n=this._offset(r),o=this._bufs.slice(i[0],n[0]+1);return n[1]===0?o.pop():o[o.length-1]=o[o.length-1].slice(0,n[1]),i[1]!==0&&(o[0]=o[0].slice(i[1])),this._new(o)};ne.prototype.toString=function(e,r,i){return this.slice(r,i).toString(e)};ne.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)e-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(e),this.length-=e;break}return this};ne.prototype.duplicate=function(){let e=this._new();for(let r=0;r<this._bufs.length;r++)e.append(this._bufs[r]);return e};ne.prototype.append=function(e){if(e==null)return this;if(e.buffer)this._appendBuffer(it.from(e.buffer,e.byteOffset,e.byteLength));else if(Array.isArray(e))for(let r=0;r<e.length;r++)this.append(e[r]);else if(this._isBufferList(e))for(let r=0;r<e._bufs.length;r++)this.append(e._bufs[r]);else typeof e=="number"&&(e=e.toString()),this._appendBuffer(it.from(e));return this};ne.prototype._appendBuffer=function(e){this._bufs.push(e),this.length+=e.length};ne.prototype.indexOf=function(t,e,r){if(r===void 0&&typeof e=="string"&&(r=e,e=void 0),typeof t=="function"||Array.isArray(t))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof t=="number"?t=it.from([t]):typeof t=="string"?t=it.from(t,r):this._isBufferList(t)?t=t.slice():Array.isArray(t.buffer)?t=it.from(t.buffer,t.byteOffset,t.byteLength):it.isBuffer(t)||(t=it.from(t)),e=Number(e||0),isNaN(e)&&(e=0),e<0&&(e=this.length+e),e<0&&(e=0),t.length===0)return e>this.length?this.length:e;let i=this._offset(e),n=i[0],o=i[1];for(;n<this._bufs.length;n++){let s=this._bufs[n];for(;o<s.length;)if(s.length-o>=t.length){let l=s.indexOf(t,o);if(l!==-1)return this._reverseOffset([n,l]);o=s.length-t.length+1}else{let l=this._reverseOffset([n,o]);if(this._match(l,t))return l;o++}o=0}return-1};ne.prototype._match=function(t,e){if(this.length-t<e.length)return!1;for(let r=0;r<e.length;r++)if(this.get(t+r)!==e[r])return!1;return!0};(function(){let t={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(let e in t)(function(r){t[r]===null?ne.prototype[r]=function(i,n){return this.slice(i,i+n)[r](0,n)}:ne.prototype[r]=function(i=0){return this.slice(i,i+t[r])[r](0)}})(e)})();ne.prototype._isBufferList=function(e){return e instanceof ne||ne.isBufferList(e)};ne.isBufferList=function(e){return e!=null&&e[sg]};og.exports=ne});var lg=M((cM,ys)=>{"use strict";w();m();_();var ol=xr().Duplex,zE=tr(),Qi=ag();function Ce(t){if(!(this instanceof Ce))return new Ce(t);if(typeof t=="function"){this._callback=t;let e=function(i){this._callback&&(this._callback(i),this._callback=null)}.bind(this);this.on("pipe",function(i){i.on("error",e)}),this.on("unpipe",function(i){i.removeListener("error",e)}),t=null}Qi._init.call(this,t),ol.call(this)}zE(Ce,ol);Object.assign(Ce.prototype,Qi.prototype);Ce.prototype._new=function(e){return new Ce(e)};Ce.prototype._write=function(e,r,i){this._appendBuffer(e),typeof i=="function"&&i()};Ce.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)};Ce.prototype.end=function(e){ol.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)};Ce.prototype._destroy=function(e,r){this._bufs.length=0,this.length=0,r(e)};Ce.prototype._isBufferList=function(e){return e instanceof Ce||e instanceof Qi||Ce.isBufferList(e)};Ce.isBufferList=Qi.isBufferList;ys.exports=Ce;ys.exports.BufferListStream=Ce;ys.exports.BufferList=Qi});var fg=M((wM,ug)=>{w();m();_();var al=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}};ug.exports=al});var ll=M((RM,cg)=>{w();m();_();var U=cg.exports,{Buffer:De}=(de(),K(_e));U.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"};U.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};U.requiredHeaderFlagsErrors={};for(let t in U.requiredHeaderFlags){let e=U.requiredHeaderFlags[t];U.requiredHeaderFlagsErrors[t]="Invalid header flag bits, must be 0x"+e.toString(16)+" for "+U.types[t]+" packet"}U.codes={};for(let t in U.types){let e=U.types[t];U.codes[e]=t}U.CMD_SHIFT=4;U.CMD_MASK=240;U.DUP_MASK=8;U.QOS_MASK=3;U.QOS_SHIFT=1;U.RETAIN_MASK=1;U.VARBYTEINT_MASK=127;U.VARBYTEINT_FIN_MASK=128;U.VARBYTEINT_MAX=268435455;U.SESSIONPRESENT_MASK=1;U.SESSIONPRESENT_HEADER=De.from([U.SESSIONPRESENT_MASK]);U.CONNACK_HEADER=De.from([U.codes.connack<<U.CMD_SHIFT]);U.USERNAME_MASK=128;U.PASSWORD_MASK=64;U.WILL_RETAIN_MASK=32;U.WILL_QOS_MASK=24;U.WILL_QOS_SHIFT=3;U.WILL_FLAG_MASK=4;U.CLEAN_SESSION_MASK=2;U.CONNECT_HEADER=De.from([U.codes.connect<<U.CMD_SHIFT]);U.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};U.propertiesCodes={};for(let t in U.properties){let e=U.properties[t];U.propertiesCodes[e]=t}U.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"};function rr(t){return[0,1,2].map(e=>[0,1].map(r=>[0,1].map(i=>{let n=De.alloc(1);return n.writeUInt8(U.codes[t]<<U.CMD_SHIFT|(r?U.DUP_MASK:0)|e<<U.QOS_SHIFT|i,0,!0),n})))}U.PUBLISH_HEADER=rr("publish");U.SUBSCRIBE_HEADER=rr("subscribe");U.SUBSCRIBE_OPTIONS_QOS_MASK=3;U.SUBSCRIBE_OPTIONS_NL_MASK=1;U.SUBSCRIBE_OPTIONS_NL_SHIFT=2;U.SUBSCRIBE_OPTIONS_RAP_MASK=1;U.SUBSCRIBE_OPTIONS_RAP_SHIFT=3;U.SUBSCRIBE_OPTIONS_RH_MASK=3;U.SUBSCRIBE_OPTIONS_RH_SHIFT=4;U.SUBSCRIBE_OPTIONS_RH=[0,16,32];U.SUBSCRIBE_OPTIONS_NL=4;U.SUBSCRIBE_OPTIONS_RAP=8;U.SUBSCRIBE_OPTIONS_QOS=[0,1,2];U.UNSUBSCRIBE_HEADER=rr("unsubscribe");U.ACKS={unsuback:rr("unsuback"),puback:rr("puback"),pubcomp:rr("pubcomp"),pubrel:rr("pubrel"),pubrec:rr("pubrec")};U.SUBACK_HEADER=De.from([U.codes.suback<<U.CMD_SHIFT]);U.VERSION3=De.from([3]);U.VERSION4=De.from([4]);U.VERSION5=De.from([5]);U.VERSION131=De.from([131]);U.VERSION132=De.from([132]);U.QOS=[0,1,2].map(t=>De.from([t]));U.EMPTY={pingreq:De.from([U.codes.pingreq<<4,0]),pingresp:De.from([U.codes.pingresp<<4,0]),disconnect:De.from([U.codes.disconnect<<4,0])};U.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"};U.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"};U.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"};U.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"};U.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"};U.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}});var dg=M((xM,hg)=>{w();m();_();var bi=1e3,wi=bi*60,_i=wi*60,kr=_i*24,GE=kr*7,KE=kr*365.25;hg.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return YE(t);if(r==="number"&&isFinite(t))return e.long?JE(t):QE(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function YE(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),i=(e[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return r*KE;case"weeks":case"week":case"w":return r*GE;case"days":case"day":case"d":return r*kr;case"hours":case"hour":case"hrs":case"hr":case"h":return r*_i;case"minutes":case"minute":case"mins":case"min":case"m":return r*wi;case"seconds":case"second":case"secs":case"sec":case"s":return r*bi;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function QE(t){var e=Math.abs(t);return e>=kr?Math.round(t/kr)+"d":e>=_i?Math.round(t/_i)+"h":e>=wi?Math.round(t/wi)+"m":e>=bi?Math.round(t/bi)+"s":t+"ms"}function JE(t){var e=Math.abs(t);return e>=kr?bs(t,e,kr,"day"):e>=_i?bs(t,e,_i,"hour"):e>=wi?bs(t,e,wi,"minute"):e>=bi?bs(t,e,bi,"second"):t+" ms"}function bs(t,e,r,i){var n=e>=r*1.5;return Math.round(t/r)+" "+i+(n?"s":"")}});var gg=M((qM,pg)=>{w();m();_();function XE(t){r.debug=r,r.default=r,r.coerce=l,r.disable=o,r.enable=n,r.enabled=s,r.humanize=dg(),r.destroy=c,Object.keys(t).forEach(h=>{r[h]=t[h]}),r.names=[],r.skips=[],r.formatters={};function e(h){let d=0;for(let g=0;g<h.length;g++)d=(d<<5)-d+h.charCodeAt(g),d|=0;return r.colors[Math.abs(d)%r.colors.length]}r.selectColor=e;function r(h){let d,g=null,y,v;function E(...A){if(!E.enabled)return;let T=E,B=Number(new Date),I=B-(d||B);T.diff=I,T.prev=d,T.curr=B,d=B,A[0]=r.coerce(A[0]),typeof A[0]!="string"&&A.unshift("%O");let N=0;A[0]=A[0].replace(/%([a-zA-Z%])/g,(Y,Z)=>{if(Y==="%%")return"%";N++;let J=r.formatters[Z];if(typeof J=="function"){let te=A[N];Y=J.call(T,te),A.splice(N,1),N--}return Y}),r.formatArgs.call(T,A),(T.log||r.log).apply(T,A)}return E.namespace=h,E.useColors=r.useColors(),E.color=r.selectColor(h),E.extend=i,E.destroy=r.destroy,Object.defineProperty(E,"enabled",{enumerable:!0,configurable:!1,get:()=>g!==null?g:(y!==r.namespaces&&(y=r.namespaces,v=r.enabled(h)),v),set:A=>{g=A}}),typeof r.init=="function"&&r.init(E),E}function i(h,d){let g=r(this.namespace+(typeof d>"u"?":":d)+h);return g.log=this.log,g}function n(h){r.save(h),r.namespaces=h,r.names=[],r.skips=[];let d,g=(typeof h=="string"?h:"").split(/[\s,]+/),y=g.length;for(d=0;d<y;d++)g[d]&&(h=g[d].replace(/\*/g,".*?"),h[0]==="-"?r.skips.push(new RegExp("^"+h.slice(1)+"$")):r.names.push(new RegExp("^"+h+"$")))}function o(){let h=[...r.names.map(a),...r.skips.map(a).map(d=>"-"+d)].join(",");return r.enable(""),h}function s(h){if(h[h.length-1]==="*")return!0;let d,g;for(d=0,g=r.skips.length;d<g;d++)if(r.skips[d].test(h))return!1;for(d=0,g=r.names.length;d<g;d++)if(r.names[d].test(h))return!0;return!1}function a(h){return h.toString().substring(2,h.toString().length-2).replace(/\.\*\?$/,"*")}function l(h){return h instanceof Error?h.stack||h.message:h}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}pg.exports=XE});var bt=M((We,ws)=>{w();m();_();We.formatArgs=eS;We.save=tS;We.load=rS;We.useColors=ZE;We.storage=iS();We.destroy=(()=>{let t=!1;return()=>{t||(t=!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`."))}})();We.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function ZE(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function eS(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+ws.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,n=>{n!=="%%"&&(r++,n==="%c"&&(i=r))}),t.splice(i,0,e)}We.log=console.debug||console.log||(()=>{});function tS(t){try{t?We.storage.setItem("debug",t):We.storage.removeItem("debug")}catch{}}function rS(){let t;try{t=We.storage.getItem("debug")}catch{}return!t&&typeof R<"u"&&"env"in R&&(t=R.env.DEBUG),t}function iS(){try{return localStorage}catch{}}ws.exports=gg()(We);var{formatters:nS}=ws.exports;nS.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var wg=M((XM,bg)=>{w();m();_();var sS=lg(),{EventEmitter:oS}=(Lt(),K(Mt)),yg=fg(),G=ll(),j=bt()("mqtt-packet:parser"),ul=class t extends oS{constructor(){super(),this.parser=this.constructor.parser}static parser(e){return this instanceof t?(this.settings=e||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new t().parser(e)}_resetState(){j("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new yg,this.error=null,this._list=sS(),this._stateCounter=0}parse(e){for(this.error&&this._resetState(),this._list.append(e),j("parse: current state: %s",this._states[this._stateCounter]);(this.packet.length!==-1||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,j("parse: state complete. _stateCounter is now: %d",this._stateCounter),j("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return j("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){let e=this._list.readUInt8(0),r=e>>G.CMD_SHIFT;this.packet.cmd=G.types[r];let i=e&15,n=G.requiredHeaderFlags[r];return n!=null&&i!==n?this._emitError(new Error(G.requiredHeaderFlagsErrors[r])):(this.packet.retain=(e&G.RETAIN_MASK)!==0,this.packet.qos=e>>G.QOS_SHIFT&G.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=(e&G.DUP_MASK)!==0,j("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){let e=this._parseVarByteNum(!0);return e&&(this.packet.length=e.value,this._list.consume(e.bytes)),j("_parseLength %d",e.value),!!e}_parsePayload(){j("_parsePayload: payload %O",this._list);let e=!1;if(this.packet.length===0||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}e=!0}return j("_parsePayload complete result: %s",e),e}_parseConnect(){j("_parseConnect");let e,r,i,n,o={},s=this.packet,a=this._parseString();if(a===null)return this._emitError(new Error("Cannot parse protocolId"));if(a!=="MQTT"&&a!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(s.protocolId=a,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(s.protocolVersion=this._list.readUInt8(this._pos),s.protocolVersion>=128&&(s.bridgeMode=!0,s.protocolVersion=s.protocolVersion-128),s.protocolVersion!==3&&s.protocolVersion!==4&&s.protocolVersion!==5)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(this._list.readUInt8(this._pos)&1)return this._emitError(new Error("Connect flag bit 0 must be 0, but got 1"));o.username=this._list.readUInt8(this._pos)&G.USERNAME_MASK,o.password=this._list.readUInt8(this._pos)&G.PASSWORD_MASK,o.will=this._list.readUInt8(this._pos)&G.WILL_FLAG_MASK;let l=!!(this._list.readUInt8(this._pos)&G.WILL_RETAIN_MASK),c=(this._list.readUInt8(this._pos)&G.WILL_QOS_MASK)>>G.WILL_QOS_SHIFT;if(o.will)s.will={},s.will.retain=l,s.will.qos=c;else{if(l)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(c)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(s.clean=(this._list.readUInt8(this._pos)&G.CLEAN_SESSION_MASK)!==0,this._pos++,s.keepalive=this._parseNum(),s.keepalive===-1)return this._emitError(new Error("Packet too short"));if(s.protocolVersion===5){let d=this._parseProperties();Object.getOwnPropertyNames(d).length&&(s.properties=d)}let h=this._parseString();if(h===null)return this._emitError(new Error("Packet too short"));if(s.clientId=h,j("_parseConnect: packet.clientId: %s",s.clientId),o.will){if(s.protocolVersion===5){let d=this._parseProperties();Object.getOwnPropertyNames(d).length&&(s.will.properties=d)}if(e=this._parseString(),e===null)return this._emitError(new Error("Cannot parse will topic"));if(s.will.topic=e,j("_parseConnect: packet.will.topic: %s",s.will.topic),r=this._parseBuffer(),r===null)return this._emitError(new Error("Cannot parse will payload"));s.will.payload=r,j("_parseConnect: packet.will.paylaod: %s",s.will.payload)}if(o.username){if(n=this._parseString(),n===null)return this._emitError(new Error("Cannot parse username"));s.username=n,j("_parseConnect: packet.username: %s",s.username)}if(o.password){if(i=this._parseBuffer(),i===null)return this._emitError(new Error("Cannot parse password"));s.password=i}return this.settings=s,j("_parseConnect: complete"),s}_parseConnack(){j("_parseConnack");let e=this.packet;if(this._list.length<1)return null;let r=this._list.readUInt8(this._pos++);if(r>1)return this._emitError(new Error("Invalid connack flags, bits 7-1 must be set to 0"));if(e.sessionPresent=!!(r&G.SESSIONPRESENT_MASK),this.settings.protocolVersion===5)this._list.length>=2?e.reasonCode=this._list.readUInt8(this._pos++):e.reasonCode=0;else{if(this._list.length<2)return null;e.returnCode=this._list.readUInt8(this._pos++)}if(e.returnCode===-1||e.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){let i=this._parseProperties();Object.getOwnPropertyNames(i).length&&(e.properties=i)}j("_parseConnack: complete")}_parsePublish(){j("_parsePublish");let e=this.packet;if(e.topic=this._parseString(),e.topic===null)return this._emitError(new Error("Cannot parse topic"));if(!(e.qos>0&&!this._parseMessageId())){if(this.settings.protocolVersion===5){let r=this._parseProperties();Object.getOwnPropertyNames(r).length&&(e.properties=r)}e.payload=this._list.slice(this._pos,e.length),j("_parsePublish: payload from buffer list: %o",e.payload)}}_parseSubscribe(){j("_parseSubscribe");let e=this.packet,r,i,n,o,s,a,l;if(e.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(e.properties=c)}if(e.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<e.length;){if(r=this._parseString(),r===null)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=e.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(i=this._parseByte(),this.settings.protocolVersion===5){if(i&192)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(i&252)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(n=i&G.SUBSCRIBE_OPTIONS_QOS_MASK,n>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(a=(i>>G.SUBSCRIBE_OPTIONS_NL_SHIFT&G.SUBSCRIBE_OPTIONS_NL_MASK)!==0,s=(i>>G.SUBSCRIBE_OPTIONS_RAP_SHIFT&G.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,o=i>>G.SUBSCRIBE_OPTIONS_RH_SHIFT&G.SUBSCRIBE_OPTIONS_RH_MASK,o>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));l={topic:r,qos:n},this.settings.protocolVersion===5?(l.nl=a,l.rap=s,l.rh=o):this.settings.bridgeMode&&(l.rh=0,l.rap=!0,l.nl=!0),j("_parseSubscribe: push subscription `%s` to subscription",l),e.subscriptions.push(l)}}}_parseSuback(){j("_parseSuback");let e=this.packet;if(this.packet.granted=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let r=this._parseProperties();Object.getOwnPropertyNames(r).length&&(e.properties=r)}if(e.length<=0)return this._emitError(new Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){let r=this._list.readUInt8(this._pos++);if(this.settings.protocolVersion===5){if(!G.MQTT5_SUBACK_CODES[r])return this._emitError(new Error("Invalid suback code"))}else if(r>2&&r!==128)return this._emitError(new Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(r)}}}_parseUnsubscribe(){j("_parseUnsubscribe");let e=this.packet;if(e.unsubscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let r=this._parseProperties();Object.getOwnPropertyNames(r).length&&(e.properties=r)}if(e.length<=0)return this._emitError(new Error("Malformed unsubscribe, no payload specified"));for(;this._pos<e.length;){let r=this._parseString();if(r===null)return this._emitError(new Error("Cannot parse topic"));j("_parseUnsubscribe: push topic `%s` to unsubscriptions",r),e.unsubscriptions.push(r)}}}_parseUnsuback(){j("_parseUnsuback");let e=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if((this.settings.protocolVersion===3||this.settings.protocolVersion===4)&&e.length!==2)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(this.settings.protocolVersion===5){let r=this._parseProperties();for(Object.getOwnPropertyNames(r).length&&(e.properties=r),e.granted=[];this._pos<this.packet.length;){let i=this._list.readUInt8(this._pos++);if(!G.MQTT5_UNSUBACK_CODES[i])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(i)}}}_parseConfirmation(){j("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);let e=this.packet;if(this._parseMessageId(),this.settings.protocolVersion===5){if(e.length>2){switch(e.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!G.MQTT5_PUBACK_PUBREC_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!G.MQTT5_PUBREL_PUBCOMP_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break}j("_parseConfirmation: packet.reasonCode `%d`",e.reasonCode)}else e.reasonCode=0;if(e.length>3){let r=this._parseProperties();Object.getOwnPropertyNames(r).length&&(e.properties=r)}}return!0}_parseDisconnect(){let e=this.packet;if(j("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?(e.reasonCode=this._parseByte(),G.MQTT5_DISCONNECT_CODES[e.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):e.reasonCode=0;let r=this._parseProperties();Object.getOwnPropertyNames(r).length&&(e.properties=r)}return j("_parseDisconnect result: true"),!0}_parseAuth(){j("_parseAuth");let e=this.packet;if(this.settings.protocolVersion!==5)return this._emitError(new Error("Not supported auth packet for this version MQTT"));if(e.reasonCode=this._parseByte(),!G.MQTT5_AUTH_CODES[e.reasonCode])return this._emitError(new Error("Invalid auth reason code"));let r=this._parseProperties();return Object.getOwnPropertyNames(r).length&&(e.properties=r),j("_parseAuth: result: true"),!0}_parseMessageId(){let e=this.packet;return e.messageId=this._parseNum(),e.messageId===null?(this._emitError(new Error("Cannot parse messageId")),!1):(j("_parseMessageId: packet.messageId %d",e.messageId),!0)}_parseString(e){let r=this._parseNum(),i=r+this._pos;if(r===-1||i>this._list.length||i>this.packet.length)return null;let n=this._list.toString("utf8",this._pos,i);return this._pos+=r,j("_parseString: result: %s",n),n}_parseStringPair(){return j("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){let e=this._parseNum(),r=e+this._pos;if(e===-1||r>this._list.length||r>this.packet.length)return null;let i=this._list.slice(this._pos,r);return this._pos+=e,j("_parseBuffer: result: %o",i),i}_parseNum(){if(this._list.length-this._pos<2)return-1;let e=this._list.readUInt16BE(this._pos);return this._pos+=2,j("_parseNum: result: %s",e),e}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;let e=this._list.readUInt32BE(this._pos);return this._pos+=4,j("_parse4ByteNum: result: %s",e),e}_parseVarByteNum(e){j("_parseVarByteNum");let r=4,i=0,n=1,o=0,s=!1,a,l=this._pos?this._pos:0;for(;i<r&&l+i<this._list.length;){if(a=this._list.readUInt8(l+i++),o+=n*(a&G.VARBYTEINT_MASK),n*=128,!(a&G.VARBYTEINT_FIN_MASK)){s=!0;break}if(this._list.length<=i)break}return!s&&i===r&&this._list.length>=i&&this._emitError(new Error("Invalid variable byte integer")),l&&(this._pos+=i),s?e?s={bytes:i,value:o}:s=o:s=!1,j("_parseVarByteNum: result: %o",s),s}_parseByte(){let e;return this._pos<this._list.length&&(e=this._list.readUInt8(this._pos),this._pos++),j("_parseByte: result: %o",e),e}_parseByType(e){switch(j("_parseByType: type: %s",e),e){case"byte":return this._parseByte()!==0;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(){j("_parseProperties");let e=this._parseVarByteNum(),i=this._pos+e,n={};for(;this._pos<i;){let o=this._parseByte();if(!o)return this._emitError(new Error("Cannot parse property code type")),!1;let s=G.propertiesCodes[o];if(!s)return this._emitError(new Error("Unknown property")),!1;if(s==="userProperties"){n[s]||(n[s]=Object.create(null));let a=this._parseByType(G.propertiesTypes[s]);if(n[s][a.name])if(Array.isArray(n[s][a.name]))n[s][a.name].push(a.value);else{let l=n[s][a.name];n[s][a.name]=[l],n[s][a.name].push(a.value)}else n[s][a.name]=a.value;continue}n[s]?Array.isArray(n[s])?n[s].push(this._parseByType(G.propertiesTypes[s])):(n[s]=[n[s]],n[s].push(this._parseByType(G.propertiesTypes[s]))):n[s]=this._parseByType(G.propertiesTypes[s])}return n}_newPacket(){return j("_newPacket"),this.packet&&(this._list.consume(this.packet.length),j("_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)),j("_newPacket: new packet"),this.packet=new yg,this._pos=0,!0}_emitError(e){j("_emitError",e),this.error=e,this.emit("error",e)}};bg.exports=ul});var Eg=M((sL,vg)=>{w();m();_();var{Buffer:Ji}=(de(),K(_e)),aS=65536,_g={},lS=Ji.isBuffer(Ji.from([1,2]).subarray(0,1));function mg(t){let e=Ji.allocUnsafe(2);return e.writeUInt8(t>>8,0),e.writeUInt8(t&255,0+1),e}function uS(){for(let t=0;t<aS;t++)_g[t]=mg(t)}function fS(t){let r=0,i=0,n=Ji.allocUnsafe(4);do r=t%128|0,t=t/128|0,t>0&&(r=r|128),n.writeUInt8(r,i++);while(t>0&&i<4);return t>0&&(i=0),lS?n.subarray(0,i):n.slice(0,i)}function cS(t){let e=Ji.allocUnsafe(4);return e.writeUInt32BE(t,0),e}vg.exports={cache:_g,generateCache:uS,generateNumber:mg,genBufVariableByteInt:fS,generate4ByteBuffer:cS}});var Sg=M((hL,fl)=>{"use strict";w();m();_();typeof R>"u"||!R.version||R.version.indexOf("v0.")===0||R.version.indexOf("v1.")===0&&R.version.indexOf("v1.8.")!==0?fl.exports={nextTick:hS}:fl.exports=R;function hS(t,e,r,i){if(typeof t!="function")throw new TypeError('"callback" argument must be a function');var n=arguments.length,o,s;switch(n){case 0:case 1:return R.nextTick(t);case 2:return R.nextTick(function(){t.call(null,e)});case 3:return R.nextTick(function(){t.call(null,e,r)});case 4:return R.nextTick(function(){t.call(null,e,r,i)});default:for(o=new Array(n-1),s=0;s<o.length;)o[s++]=arguments[s];return R.nextTick(function(){t.apply(null,o)})}}});var dl=M((_L,Og)=>{w();m();_();var F=ll(),{Buffer:q}=(de(),K(_e)),dS=q.allocUnsafe(0),pS=q.from([0]),Xi=Eg(),gS=Sg().nextTick,Ge=bt()("mqtt-packet:writeToStream"),_s=Xi.cache,yS=Xi.generateNumber,bS=Xi.generateCache,cl=Xi.genBufVariableByteInt,wS=Xi.generate4ByteBuffer,xe=hl,ms=!0;function Pg(t,e,r){switch(Ge("generate called"),e.cork&&(e.cork(),gS(_S,e)),ms&&(ms=!1,bS()),Ge("generate: packet.cmd: %s",t.cmd),t.cmd){case"connect":return mS(t,e,r);case"connack":return vS(t,e,r);case"publish":return ES(t,e,r);case"puback":case"pubrec":case"pubrel":case"pubcomp":return SS(t,e,r);case"subscribe":return AS(t,e,r);case"suback":return RS(t,e,r);case"unsubscribe":return TS(t,e,r);case"unsuback":return IS(t,e,r);case"pingreq":case"pingresp":return CS(t,e,r);case"disconnect":return PS(t,e,r);case"auth":return BS(t,e,r);default:return e.destroy(new Error("Unknown command")),!1}}Object.defineProperty(Pg,"cacheNumbers",{get(){return xe===hl},set(t){t?((!_s||Object.keys(_s).length===0)&&(ms=!0),xe=hl):(ms=!1,xe=OS)}});function _S(t){t.uncork()}function mS(t,e,r){let i=t||{},n=i.protocolId||"MQTT",o=i.protocolVersion||4,s=i.will,a=i.clean,l=i.keepalive||0,c=i.clientId||"",h=i.username,d=i.password,g=i.properties;a===void 0&&(a=!0);let y=0;if(!n||typeof n!="string"&&!q.isBuffer(n))return e.destroy(new Error("Invalid protocolId")),!1;if(y+=n.length+2,o!==3&&o!==4&&o!==5)return e.destroy(new Error("Invalid protocol version")),!1;if(y+=1,(typeof c=="string"||q.isBuffer(c))&&(c||o>=4)&&(c||a))y+=q.byteLength(c)+2;else{if(o<4)return e.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(a*1===0)return e.destroy(new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof l!="number"||l<0||l>65535||l%1!==0)return e.destroy(new Error("Invalid keepalive")),!1;y+=2,y+=1;let v,E;if(o===5){if(v=ir(e,g),!v)return!1;y+=v.length}if(s){if(typeof s!="object")return e.destroy(new Error("Invalid will")),!1;if(!s.topic||typeof s.topic!="string")return e.destroy(new Error("Invalid will topic")),!1;if(y+=q.byteLength(s.topic)+2,y+=2,s.payload)if(s.payload.length>=0)typeof s.payload=="string"?y+=q.byteLength(s.payload):y+=s.payload.length;else return e.destroy(new Error("Invalid will payload")),!1;if(E={},o===5){if(E=ir(e,s.properties),!E)return!1;y+=E.length}}let A=!1;if(h!=null)if(Cg(h))A=!0,y+=q.byteLength(h)+2;else return e.destroy(new Error("Invalid username")),!1;if(d!=null){if(!A)return e.destroy(new Error("Username is required to use password")),!1;if(Cg(d))y+=Bg(d)+2;else return e.destroy(new Error("Invalid password")),!1}e.write(F.CONNECT_HEADER),Ke(e,y),mi(e,n),i.bridgeMode&&(o+=128),e.write(o===131?F.VERSION131:o===132?F.VERSION132:o===4?F.VERSION4:o===5?F.VERSION5:F.VERSION3);let T=0;return T|=h!=null?F.USERNAME_MASK:0,T|=d!=null?F.PASSWORD_MASK:0,T|=s&&s.retain?F.WILL_RETAIN_MASK:0,T|=s&&s.qos?s.qos<<F.WILL_QOS_SHIFT:0,T|=s?F.WILL_FLAG_MASK:0,T|=a?F.CLEAN_SESSION_MASK:0,e.write(q.from([T])),xe(e,l),o===5&&v.write(),mi(e,c),s&&(o===5&&E.write(),Mr(e,s.topic),mi(e,s.payload)),h!=null&&mi(e,h),d!=null&&mi(e,d),!0}function vS(t,e,r){let i=r?r.protocolVersion:4,n=t||{},o=i===5?n.reasonCode:n.returnCode,s=n.properties,a=2;if(typeof o!="number")return e.destroy(new Error("Invalid return code")),!1;let l=null;if(i===5){if(l=ir(e,s),!l)return!1;a+=l.length}return e.write(F.CONNACK_HEADER),Ke(e,a),e.write(n.sessionPresent?F.SESSIONPRESENT_HEADER:pS),e.write(q.from([o])),l?.write(),!0}function ES(t,e,r){Ge("publish: packet: %o",t);let i=r?r.protocolVersion:4,n=t||{},o=n.qos||0,s=n.retain?F.RETAIN_MASK:0,a=n.topic,l=n.payload||dS,c=n.messageId,h=n.properties,d=0;if(typeof a=="string")d+=q.byteLength(a)+2;else if(q.isBuffer(a))d+=a.length+2;else return e.destroy(new Error("Invalid topic")),!1;if(q.isBuffer(l)?d+=l.length:d+=q.byteLength(l),o&&typeof c!="number")return e.destroy(new Error("Invalid messageId")),!1;o&&(d+=2);let g=null;if(i===5){if(g=ir(e,h),!g)return!1;d+=g.length}return e.write(F.PUBLISH_HEADER[o][n.dup?1:0][s?1:0]),Ke(e,d),xe(e,Bg(a)),e.write(a),o>0&&xe(e,c),g?.write(),Ge("publish: payload: %o",l),e.write(l)}function SS(t,e,r){let i=r?r.protocolVersion:4,n=t||{},o=n.cmd||"puback",s=n.messageId,a=n.dup&&o==="pubrel"?F.DUP_MASK:0,l=0,c=n.reasonCode,h=n.properties,d=i===5?3:2;if(o==="pubrel"&&(l=1),typeof s!="number")return e.destroy(new Error("Invalid messageId")),!1;let g=null;if(i===5&&typeof h=="object"){if(g=Zi(e,h,r,d),!g)return!1;d+=g.length}return e.write(F.ACKS[o][l][a][0]),d===3&&(d+=c!==0?1:-1),Ke(e,d),xe(e,s),i===5&&d!==2&&e.write(q.from([c])),g!==null?g.write():d===4&&e.write(q.from([0])),!0}function AS(t,e,r){Ge("subscribe: packet: ");let i=r?r.protocolVersion:4,n=t||{},o=n.dup?F.DUP_MASK:0,s=n.messageId,a=n.subscriptions,l=n.properties,c=0;if(typeof s!="number")return e.destroy(new Error("Invalid messageId")),!1;c+=2;let h=null;if(i===5){if(h=ir(e,l),!h)return!1;c+=h.length}if(typeof a=="object"&&a.length)for(let g=0;g<a.length;g+=1){let y=a[g].topic,v=a[g].qos;if(typeof y!="string")return e.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if(typeof v!="number")return e.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(i===5){if(typeof(a[g].nl||!1)!="boolean")return e.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(a[g].rap||!1)!="boolean")return e.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;let T=a[g].rh||0;if(typeof T!="number"||T>2)return e.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}c+=q.byteLength(y)+2+1}else return e.destroy(new Error("Invalid subscriptions")),!1;Ge("subscribe: writing to stream: %o",F.SUBSCRIBE_HEADER),e.write(F.SUBSCRIBE_HEADER[1][o?1:0][0]),Ke(e,c),xe(e,s),h!==null&&h.write();let d=!0;for(let g of a){let y=g.topic,v=g.qos,E=+g.nl,A=+g.rap,T=g.rh,B;Mr(e,y),B=F.SUBSCRIBE_OPTIONS_QOS[v],i===5&&(B|=E?F.SUBSCRIBE_OPTIONS_NL:0,B|=A?F.SUBSCRIBE_OPTIONS_RAP:0,B|=T?F.SUBSCRIBE_OPTIONS_RH[T]:0),d=e.write(q.from([B]))}return d}function RS(t,e,r){let i=r?r.protocolVersion:4,n=t||{},o=n.messageId,s=n.granted,a=n.properties,l=0;if(typeof o!="number")return e.destroy(new Error("Invalid messageId")),!1;if(l+=2,typeof s=="object"&&s.length)for(let h=0;h<s.length;h+=1){if(typeof s[h]!="number")return e.destroy(new Error("Invalid qos vector")),!1;l+=1}else return e.destroy(new Error("Invalid qos vector")),!1;let c=null;if(i===5){if(c=Zi(e,a,r,l),!c)return!1;l+=c.length}return e.write(F.SUBACK_HEADER),Ke(e,l),xe(e,o),c!==null&&c.write(),e.write(q.from(s))}function TS(t,e,r){let i=r?r.protocolVersion:4,n=t||{},o=n.messageId,s=n.dup?F.DUP_MASK:0,a=n.unsubscriptions,l=n.properties,c=0;if(typeof o!="number")return e.destroy(new Error("Invalid messageId")),!1;if(c+=2,typeof a=="object"&&a.length)for(let g=0;g<a.length;g+=1){if(typeof a[g]!="string")return e.destroy(new Error("Invalid unsubscriptions")),!1;c+=q.byteLength(a[g])+2}else return e.destroy(new Error("Invalid unsubscriptions")),!1;let h=null;if(i===5){if(h=ir(e,l),!h)return!1;c+=h.length}e.write(F.UNSUBSCRIBE_HEADER[1][s?1:0][0]),Ke(e,c),xe(e,o),h!==null&&h.write();let d=!0;for(let g=0;g<a.length;g++)d=Mr(e,a[g]);return d}function IS(t,e,r){let i=r?r.protocolVersion:4,n=t||{},o=n.messageId,s=n.dup?F.DUP_MASK:0,a=n.granted,l=n.properties,c=n.cmd,h=0,d=2;if(typeof o!="number")return e.destroy(new Error("Invalid messageId")),!1;if(i===5)if(typeof a=="object"&&a.length)for(let y=0;y<a.length;y+=1){if(typeof a[y]!="number")return e.destroy(new Error("Invalid qos vector")),!1;d+=1}else return e.destroy(new Error("Invalid qos vector")),!1;let g=null;if(i===5){if(g=Zi(e,l,r,d),!g)return!1;d+=g.length}return e.write(F.ACKS[c][h][s][0]),Ke(e,d),xe(e,o),g!==null&&g.write(),i===5&&e.write(q.from(a)),!0}function CS(t,e,r){return e.write(F.EMPTY[t.cmd])}function PS(t,e,r){let i=r?r.protocolVersion:4,n=t||{},o=n.reasonCode,s=n.properties,a=i===5?1:0,l=null;if(i===5){if(l=Zi(e,s,r,a),!l)return!1;a+=l.length}return e.write(q.from([F.codes.disconnect<<4])),Ke(e,a),i===5&&e.write(q.from([o])),l!==null&&l.write(),!0}function BS(t,e,r){let i=r?r.protocolVersion:4,n=t||{},o=n.reasonCode,s=n.properties,a=i===5?1:0;i!==5&&e.destroy(new Error("Invalid mqtt version for auth packet"));let l=Zi(e,s,r,a);return l?(a+=l.length,e.write(q.from([F.codes.auth<<4])),Ke(e,a),e.write(q.from([o])),l!==null&&l.write(),!0):!1}var Ag={};function Ke(t,e){if(e>F.VARBYTEINT_MAX)return t.destroy(new Error(`Invalid variable byte integer: ${e}`)),!1;let r=Ag[e];return r||(r=cl(e),e<16384&&(Ag[e]=r)),Ge("writeVarByteInt: writing to stream: %o",r),t.write(r)}function Mr(t,e){let r=q.byteLength(e);return xe(t,r),Ge("writeString: %s",e),t.write(e,"utf8")}function Rg(t,e,r){Mr(t,e),Mr(t,r)}function hl(t,e){return Ge("writeNumberCached: number: %d",e),Ge("writeNumberCached: %o",_s[e]),t.write(_s[e])}function OS(t,e){let r=yS(e);return Ge("writeNumberGenerated: %o",r),t.write(r)}function xS(t,e){let r=wS(e);return Ge("write4ByteNumber: %o",r),t.write(r)}function mi(t,e){typeof e=="string"?Mr(t,e):e?(xe(t,e.length),t.write(e)):xe(t,0)}function ir(t,e){if(typeof e!="object"||e.length!=null)return{length:1,write(){Ig(t,{},0)}};let r=0;function i(o,s){let a=F.propertiesTypes[o],l=0;switch(a){case"byte":{if(typeof s!="boolean")return t.destroy(new Error(`Invalid ${o}: ${s}`)),!1;l+=1+1;break}case"int8":{if(typeof s!="number"||s<0||s>255)return t.destroy(new Error(`Invalid ${o}: ${s}`)),!1;l+=1+1;break}case"binary":{if(s&&s===null)return t.destroy(new Error(`Invalid ${o}: ${s}`)),!1;l+=1+q.byteLength(s)+2;break}case"int16":{if(typeof s!="number"||s<0||s>65535)return t.destroy(new Error(`Invalid ${o}: ${s}`)),!1;l+=1+2;break}case"int32":{if(typeof s!="number"||s<0||s>4294967295)return t.destroy(new Error(`Invalid ${o}: ${s}`)),!1;l+=1+4;break}case"var":{if(typeof s!="number"||s<0||s>268435455)return t.destroy(new Error(`Invalid ${o}: ${s}`)),!1;l+=1+q.byteLength(cl(s));break}case"string":{if(typeof s!="string")return t.destroy(new Error(`Invalid ${o}: ${s}`)),!1;l+=1+2+q.byteLength(s.toString());break}case"pair":{if(typeof s!="object")return t.destroy(new Error(`Invalid ${o}: ${s}`)),!1;l+=Object.getOwnPropertyNames(s).reduce((c,h)=>{let d=s[h];return Array.isArray(d)?c+=d.reduce((g,y)=>(g+=1+2+q.byteLength(h.toString())+2+q.byteLength(y.toString()),g),0):c+=1+2+q.byteLength(h.toString())+2+q.byteLength(s[h].toString()),c},0);break}default:return t.destroy(new Error(`Invalid property ${o}: ${s}`)),!1}return l}if(e)for(let o in e){let s=0,a=0,l=e[o];if(Array.isArray(l))for(let c=0;c<l.length;c++){if(a=i(o,l[c]),!a)return!1;s+=a}else{if(a=i(o,l),!a)return!1;s=a}if(!s)return!1;r+=s}return{length:q.byteLength(cl(r))+r,write(){Ig(t,e,r)}}}function Zi(t,e,r,i){let n=["reasonString","userProperties"],o=r&&r.properties&&r.properties.maximumPacketSize?r.properties.maximumPacketSize:0,s=ir(t,e);if(o)for(;i+s.length>o;){let a=n.shift();if(a&&e[a])delete e[a],s=ir(t,e);else return!1}return s}function Tg(t,e,r){switch(F.propertiesTypes[e]){case"byte":{t.write(q.from([F.properties[e]])),t.write(q.from([+r]));break}case"int8":{t.write(q.from([F.properties[e]])),t.write(q.from([r]));break}case"binary":{t.write(q.from([F.properties[e]])),mi(t,r);break}case"int16":{t.write(q.from([F.properties[e]])),xe(t,r);break}case"int32":{t.write(q.from([F.properties[e]])),xS(t,r);break}case"var":{t.write(q.from([F.properties[e]])),Ke(t,r);break}case"string":{t.write(q.from([F.properties[e]])),Mr(t,r);break}case"pair":{Object.getOwnPropertyNames(r).forEach(n=>{let o=r[n];Array.isArray(o)?o.forEach(s=>{t.write(q.from([F.properties[e]])),Rg(t,n.toString(),s.toString())}):(t.write(q.from([F.properties[e]])),Rg(t,n.toString(),o.toString()))});break}default:return t.destroy(new Error(`Invalid property ${e} value: ${r}`)),!1}}function Ig(t,e,r){Ke(t,r);for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&e[i]!==null){let n=e[i];if(Array.isArray(n))for(let o=0;o<n.length;o++)Tg(t,i,n[o]);else Tg(t,i,n)}}function Bg(t){return t?t instanceof q?t.length:q.byteLength(t):0}function Cg(t){return typeof t=="string"||t instanceof q}Og.exports=Pg});var Mg=M((TL,kg)=>{w();m();_();var kS=dl(),{EventEmitter:MS}=(Lt(),K(Mt)),{Buffer:xg}=(de(),K(_e));function LS(t,e){let r=new pl;return kS(t,r,e),r.concat()}var pl=class extends MS{constructor(){super(),this._array=new Array(20),this._i=0}write(e){return this._array[this._i++]=e,!0}concat(){let e=0,r=new Array(this._array.length),i=this._array,n=0,o;for(o=0;o<i.length&&i[o]!==void 0;o++)typeof i[o]!="string"?r[o]=i[o].length:r[o]=xg.byteLength(i[o]),e+=r[o];let s=xg.allocUnsafe(e);for(o=0;o<i.length&&i[o]!==void 0;o++)typeof i[o]!="string"?(i[o].copy(s,n),n+=r[o]):(s.write(i[o],n),n+=r[o]);return s}destroy(e){e&&this.emit("error",e)}};kg.exports=LS});var Lg=M(vs=>{w();m();_();vs.parser=wg().parser;vs.generate=Mg();vs.writeToStream=dl()});var bl=M(yl=>{"use strict";w();m();_();Object.defineProperty(yl,"__esModule",{value:!0});var gl=class{constructor(){this.nextId=Math.max(1,Math.floor(Math.random()*65535))}allocate(){let e=this.nextId++;return this.nextId===65536&&(this.nextId=1),e}getLastAllocated(){return this.nextId===1?65535:this.nextId-1}register(e){return!0}deallocate(e){}clear(){}};yl.default=gl});var Ng=M((GL,Ug)=>{"use strict";w();m();_();function US(t,e,r){var i=this;this._callback=t,this._args=r,this._interval=setInterval(t,e,this._args),this.reschedule=function(n){n||(n=i._interval),i._interval&&clearInterval(i._interval),i._interval=setInterval(i._callback,n,i._args)},this.clear=function(){i._interval&&(clearInterval(i._interval),i._interval=void 0)},this.destroy=function(){i._interval&&clearInterval(i._interval),i._callback=void 0,i._interval=void 0,i._args=void 0}}function NS(){if(typeof arguments[0]!="function")throw new Error("callback needed");if(typeof arguments[1]!="number")throw new Error("interval needed");var t;if(arguments.length>0){t=new Array(arguments.length-2);for(var e=0;e<t.length;e++)t[e]=arguments[e+2]}return new US(arguments[0],arguments[1],t)}Ug.exports=NS});var qg=M((eU,Dg)=>{"use strict";w();m();_();Dg.exports=DS;function vi(t){return t instanceof O?O.from(t):new t.constructor(t.buffer.slice(),t.byteOffset,t.length)}function DS(t){if(t=t||{},t.circles)return qS(t);return t.proto?i:r;function e(n,o){for(var s=Object.keys(n),a=new Array(s.length),l=0;l<s.length;l++){var c=s[l],h=n[c];typeof h!="object"||h===null?a[c]=h:h instanceof Date?a[c]=new Date(h):ArrayBuffer.isView(h)?a[c]=vi(h):a[c]=o(h)}return a}function r(n){if(typeof n!="object"||n===null)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return e(n,r);if(n instanceof Map)return new Map(e(Array.from(n),r));if(n instanceof Set)return new Set(e(Array.from(n),r));var o={};for(var s in n)if(Object.hasOwnProperty.call(n,s)!==!1){var a=n[s];typeof a!="object"||a===null?o[s]=a:a instanceof Date?o[s]=new Date(a):a instanceof Map?o[s]=new Map(e(Array.from(a),r)):a instanceof Set?o[s]=new Set(e(Array.from(a),r)):ArrayBuffer.isView(a)?o[s]=vi(a):o[s]=r(a)}return o}function i(n){if(typeof n!="object"||n===null)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return e(n,i);if(n instanceof Map)return new Map(e(Array.from(n),i));if(n instanceof Set)return new Set(e(Array.from(n),i));var o={};for(var s in n){var a=n[s];typeof a!="object"||a===null?o[s]=a:a instanceof Date?o[s]=new Date(a):a instanceof Map?o[s]=new Map(e(Array.from(a),i)):a instanceof Set?o[s]=new Set(e(Array.from(a),i)):ArrayBuffer.isView(a)?o[s]=vi(a):o[s]=i(a)}return o}}function qS(t){var e=[],r=[];return t.proto?o:n;function i(s,a){for(var l=Object.keys(s),c=new Array(l.length),h=0;h<l.length;h++){var d=l[h],g=s[d];if(typeof g!="object"||g===null)c[d]=g;else if(g instanceof Date)c[d]=new Date(g);else if(ArrayBuffer.isView(g))c[d]=vi(g);else{var y=e.indexOf(g);y!==-1?c[d]=r[y]:c[d]=a(g)}}return c}function n(s){if(typeof s!="object"||s===null)return s;if(s instanceof Date)return new Date(s);if(Array.isArray(s))return i(s,n);if(s instanceof Map)return new Map(i(Array.from(s),n));if(s instanceof Set)return new Set(i(Array.from(s),n));var a={};e.push(s),r.push(a);for(var l in s)if(Object.hasOwnProperty.call(s,l)!==!1){var c=s[l];if(typeof c!="object"||c===null)a[l]=c;else if(c instanceof Date)a[l]=new Date(c);else if(c instanceof Map)a[l]=new Map(i(Array.from(c),n));else if(c instanceof Set)a[l]=new Set(i(Array.from(c),n));else if(ArrayBuffer.isView(c))a[l]=vi(c);else{var h=e.indexOf(c);h!==-1?a[l]=r[h]:a[l]=n(c)}}return e.pop(),r.pop(),a}function o(s){if(typeof s!="object"||s===null)return s;if(s instanceof Date)return new Date(s);if(Array.isArray(s))return i(s,o);if(s instanceof Map)return new Map(i(Array.from(s),o));if(s instanceof Set)return new Set(i(Array.from(s),o));var a={};e.push(s),r.push(a);for(var l in s){var c=s[l];if(typeof c!="object"||c===null)a[l]=c;else if(c instanceof Date)a[l]=new Date(c);else if(c instanceof Map)a[l]=new Map(i(Array.from(c),o));else if(c instanceof Set)a[l]=new Set(i(Array.from(c),o));else if(ArrayBuffer.isView(c))a[l]=vi(c);else{var h=e.indexOf(c);h!==-1?a[l]=r[h]:a[l]=o(c)}}return e.pop(),r.pop(),a}}});var Fg=M((aU,jg)=>{"use strict";w();m();_();jg.exports=qg()()});var $g=M(Ei=>{"use strict";w();m();_();Object.defineProperty(Ei,"__esModule",{value:!0});Ei.validateTopics=Ei.validateTopic=void 0;function Wg(t){let e=t.split("/");for(let r=0;r<e.length;r++)if(e[r]!=="+"){if(e[r]==="#")return r===e.length-1;if(e[r].indexOf("+")!==-1||e[r].indexOf("#")!==-1)return!1}return!0}Ei.validateTopic=Wg;function jS(t){if(t.length===0)return"empty_topic_list";for(let e=0;e<t.length;e++)if(!Wg(t[e]))return t[e];return null}Ei.validateTopics=jS});var ml=M(_l=>{"use strict";w();m();_();Object.defineProperty(_l,"__esModule",{value:!0});var FS=xr(),WS={objectMode:!0},$S={clean:!0},wl=class{constructor(e){this.options=e||{},this.options=Object.assign(Object.assign({},$S),e),this._inflights=new Map}put(e,r){return this._inflights.set(e.messageId,e),r&&r(),this}createStream(){let e=new FS.Readable(WS),r=[],i=!1,n=0;return this._inflights.forEach((o,s)=>{r.push(o)}),e._read=()=>{!i&&n<r.length?e.push(r[n++]):e.push(null)},e.destroy=o=>{if(!i)return i=!0,setTimeout(()=>{e.emit("close")},0),e},e}del(e,r){let i=this._inflights.get(e.messageId);return i?(this._inflights.delete(e.messageId),r(null,i)):r&&r(new Error("missing packet")),this}get(e,r){let i=this._inflights.get(e.messageId);return i?r(null,i):r&&r(new Error("missing packet")),this}close(e){this.options.clean&&(this._inflights=null),e&&e()}};_l.default=wl});var Vg=M(vl=>{"use strict";w();m();_();Object.defineProperty(vl,"__esModule",{value:!0});var Hg=[0,16,128,131,135,144,145,151,153],HS=(t,e,r)=>{t.log("handlePublish: packet %o",e),r=typeof r<"u"?r:t.noop;let i=e.topic.toString(),n=e.payload,{qos:o}=e,{messageId:s}=e,{options:a}=t;if(t.options.protocolVersion===5){let l;if(e.properties&&(l=e.properties.topicAlias),typeof l<"u")if(i.length===0)if(l>0&&l<=65535){let c=t.topicAliasRecv.getTopicByAlias(l);if(c)i=c,t.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",i,l);else{t.log("handlePublish :: unregistered topic alias. alias: %d",l),t.emit("error",new Error("Received unregistered Topic Alias"));return}}else{t.log("handlePublish :: topic alias out of range. alias: %d",l),t.emit("error",new Error("Received Topic Alias is out of range"));return}else if(t.topicAliasRecv.put(i,l))t.log("handlePublish :: registered topic: %s - alias: %d",i,l);else{t.log("handlePublish :: topic alias out of range. alias: %d",l),t.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(t.log("handlePublish: qos %d",o),o){case 2:{a.customHandleAcks(i,n,e,(l,c)=>{if(typeof l=="number"&&(c=l,l=null),l)return t.emit("error",l);if(Hg.indexOf(c)===-1)return t.emit("error",new Error("Wrong reason code for pubrec"));c?t._sendPacket({cmd:"pubrec",messageId:s,reasonCode:c},r):t.incomingStore.put(e,()=>{t._sendPacket({cmd:"pubrec",messageId:s},r)})});break}case 1:{a.customHandleAcks(i,n,e,(l,c)=>{if(typeof l=="number"&&(c=l,l=null),l)return t.emit("error",l);if(Hg.indexOf(c)===-1)return t.emit("error",new Error("Wrong reason code for puback"));c||t.emit("message",i,n,e),t.handleMessage(e,h=>{if(h)return r&&r(h);t._sendPacket({cmd:"puback",messageId:s,reasonCode:c},r)})});break}case 0:t.emit("message",i,n,e),t.handleMessage(e,r);break;default:t.log("handlePublish: unknown QoS. Doing nothing.");break}};vl.default=HS});var en=M(Si=>{"use strict";w();m();_();Object.defineProperty(Si,"__esModule",{value:!0});Si.applyMixin=Si.ErrorWithReasonCode=void 0;var El=class t extends Error{constructor(e,r){super(e),this.code=r,Object.setPrototypeOf(this,t.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}};Si.ErrorWithReasonCode=El;function VS(t,e,r=!1){var i;let n=[e];for(;;){let o=n[0],s=Object.getPrototypeOf(o);if(s?.prototype)n.unshift(s);else break}for(let o of n)for(let s of Object.getOwnPropertyNames(o.prototype))(r||s!=="constructor")&&Object.defineProperty(t.prototype,s,(i=Object.getOwnPropertyDescriptor(o.prototype,s))!==null&&i!==void 0?i:Object.create(null))}Si.applyMixin=VS});var tn=M(Lr=>{"use strict";w();m();_();Object.defineProperty(Lr,"__esModule",{value:!0});Lr.ReasonCodes=void 0;Lr.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"};var zS=(t,e)=>{let{messageId:r}=e,i=e.cmd,n=null,o=t.outgoing[r]?t.outgoing[r].cb:null,s;if(!o){t.log("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(t.log("_handleAck :: packet type",i),i){case"pubcomp":case"puback":{let a=e.reasonCode;a&&a>0&&a!==16?(s=new Error(`Publish error: ${Lr.ReasonCodes[a]}`),s.code=a,t._removeOutgoingAndStoreMessage(r,()=>{o(s,e)})):t._removeOutgoingAndStoreMessage(r,o);break}case"pubrec":{n={cmd:"pubrel",qos:2,messageId:r};let a=e.reasonCode;a&&a>0&&a!==16?(s=new Error(`Publish error: ${Lr.ReasonCodes[a]}`),s.code=a,t._removeOutgoingAndStoreMessage(r,()=>{o(s,e)})):t._sendPacket(n);break}case"suback":{delete t.outgoing[r],t.messageIdProvider.deallocate(r);let a=e.granted;for(let l=0;l<a.length;l++)if(a[l]&128){let c=t.messageIdToTopic[r];c&&c.forEach(h=>{delete t._resubscribeTopics[h]})}delete t.messageIdToTopic[r],t._invokeStoreProcessingQueue(),o(null,e);break}case"unsuback":{delete t.outgoing[r],t.messageIdProvider.deallocate(r),t._invokeStoreProcessingQueue(),o(null);break}default:t.emit("error",new Error("unrecognized packet type"))}t.disconnecting&&Object.keys(t.outgoing).length===0&&t.emit("outgoingEmpty")};Lr.default=zS});var Gg=M(Sl=>{"use strict";w();m();_();Object.defineProperty(Sl,"__esModule",{value:!0});var zg=en(),GS=tn(),KS=(t,e)=>{let{options:r}=t,i=r.protocolVersion,n=i===5?e.reasonCode:e.returnCode;if(i!==5){let o=new zg.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${i}`,n);t.emit("error",o);return}t.handleAuth(e,(o,s)=>{if(o){t.emit("error",o);return}if(n===24)t.reconnecting=!1,t._sendPacket(s);else{let a=new zg.ErrorWithReasonCode(`Connection refused: ${GS.ReasonCodes[n]}`,n);t.emit("error",a)}})};Sl.default=KS});var Xg=M(Ss=>{"use strict";w();m();_();Object.defineProperty(Ss,"__esModule",{value:!0});Ss.LRUCache=void 0;var rn=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Yg=new Set,Al=typeof R=="object"&&R?R:{},Qg=(t,e,r,i)=>{typeof Al.emitWarning=="function"?Al.emitWarning(t,e,r,i):console.error(`[${r}] ${e}: ${t}`)},Es=globalThis.AbortController,Kg=globalThis.AbortSignal;if(typeof Es>"u"){Kg=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,n){this._onabort.push(n)}},Es=class{constructor(){e()}signal=new Kg;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let n of this.signal._onabort)n(i);this.signal.onabort?.(i)}}};let t=Al.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,Qg("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",e))}}var YS=t=>!Yg.has(t),nN=Symbol("type"),nr=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),Jg=t=>nr(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Ai:null:null,Ai=class extends Array{constructor(e){super(e),this.fill(0)}},Rl=class t{heap;length;static#l=!1;static create(e){let r=Jg(e);if(!r)return[];t.#l=!0;let i=new t(e,r);return t.#l=!1,i}constructor(e,r){if(!t.#l)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Tl=class t{#l;#c;#p;#g;#P;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#i;#y;#n;#r;#e;#u;#h;#a;#s;#b;#o;#E;#S;#w;#_;#R;#f;static unsafeExposeInternals(e){return{starts:e.#S,ttls:e.#w,sizes:e.#E,keyMap:e.#n,keyList:e.#r,valList:e.#e,next:e.#u,prev:e.#h,get head(){return e.#a},get tail(){return e.#s},free:e.#b,isBackgroundFetch:r=>e.#t(r),backgroundFetch:(r,i,n,o)=>e.#x(r,i,n,o),moveToTail:r=>e.#C(r),indexes:r=>e.#m(r),rindexes:r=>e.#v(r),isStale:r=>e.#d(r)}}get max(){return this.#l}get maxSize(){return this.#c}get calculatedSize(){return this.#y}get size(){return this.#i}get fetchMethod(){return this.#P}get dispose(){return this.#p}get disposeAfter(){return this.#g}constructor(e){let{max:r=0,ttl:i,ttlResolution:n=1,ttlAutopurge:o,updateAgeOnGet:s,updateAgeOnHas:a,allowStale:l,dispose:c,disposeAfter:h,noDisposeOnSet:d,noUpdateTTL:g,maxSize:y=0,maxEntrySize:v=0,sizeCalculation:E,fetchMethod:A,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:B,allowStaleOnFetchRejection:I,allowStaleOnFetchAbort:N,ignoreFetchAbort:D}=e;if(r!==0&&!nr(r))throw new TypeError("max option must be a nonnegative integer");let Y=r?Jg(r):Array;if(!Y)throw new Error("invalid max value: "+r);if(this.#l=r,this.#c=y,this.maxEntrySize=v||this.#c,this.sizeCalculation=E,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(A!==void 0&&typeof A!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#P=A,this.#R=!!A,this.#n=new Map,this.#r=new Array(r).fill(void 0),this.#e=new Array(r).fill(void 0),this.#u=new Y(r),this.#h=new Y(r),this.#a=0,this.#s=0,this.#b=Rl.create(r),this.#i=0,this.#y=0,typeof c=="function"&&(this.#p=c),typeof h=="function"?(this.#g=h,this.#o=[]):(this.#g=void 0,this.#o=void 0),this.#_=!!this.#p,this.#f=!!this.#g,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!g,this.noDeleteOnFetchRejection=!!T,this.allowStaleOnFetchRejection=!!I,this.allowStaleOnFetchAbort=!!N,this.ignoreFetchAbort=!!D,this.maxEntrySize!==0){if(this.#c!==0&&!nr(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!nr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#D()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!B,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!a,this.ttlResolution=nr(n)||n===0?n:1,this.ttlAutopurge=!!o,this.ttl=i||0,this.ttl){if(!nr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#l===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#l&&!this.#c){let Z="LRU_CACHE_UNBOUNDED";YS(Z)&&(Yg.add(Z),Qg("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Z,t))}}getRemainingTTL(e){return this.#n.has(e)?1/0:0}#k(){let e=new Ai(this.#l),r=new Ai(this.#l);this.#w=e,this.#S=r,this.#M=(o,s,a=rn.now())=>{if(r[o]=s!==0?a:0,e[o]=s,s!==0&&this.ttlAutopurge){let l=setTimeout(()=>{this.#d(o)&&this.delete(this.#r[o])},s+1);l.unref&&l.unref()}},this.#T=o=>{r[o]=e[o]!==0?rn.now():0},this.#A=(o,s)=>{if(e[s]){let a=e[s],l=r[s];o.ttl=a,o.start=l,o.now=i||n();let c=o.now-l;o.remainingTTL=a-c}};let i=0,n=()=>{let o=rn.now();if(this.ttlResolution>0){i=o;let s=setTimeout(()=>i=0,this.ttlResolution);s.unref&&s.unref()}return o};this.getRemainingTTL=o=>{let s=this.#n.get(o);if(s===void 0)return 0;let a=e[s],l=r[s];if(a===0||l===0)return 1/0;let c=(i||n())-l;return a-c},this.#d=o=>e[o]!==0&&r[o]!==0&&(i||n())-r[o]>e[o]}#T=()=>{};#A=()=>{};#M=()=>{};#d=()=>!1;#D(){let e=new Ai(this.#l);this.#y=0,this.#E=e,this.#I=r=>{this.#y-=e[r],e[r]=0},this.#L=(r,i,n,o)=>{if(this.#t(i))return 0;if(!nr(n))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(n=o(i,r),!nr(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return n},this.#B=(r,i,n)=>{if(e[r]=i,this.#c){let o=this.#c-e[r];for(;this.#y>o;)this.#O(!0)}this.#y+=e[r],n&&(n.entrySize=i,n.totalCalculatedSize=this.#y)}}#I=e=>{};#B=(e,r,i)=>{};#L=(e,r,i,n)=>{if(i||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#m({allowStale:e=this.allowStale}={}){if(this.#i)for(let r=this.#s;!(!this.#U(r)||((e||!this.#d(r))&&(yield r),r===this.#a));)r=this.#h[r]}*#v({allowStale:e=this.allowStale}={}){if(this.#i)for(let r=this.#a;!(!this.#U(r)||((e||!this.#d(r))&&(yield r),r===this.#s));)r=this.#u[r]}#U(e){return e!==void 0&&this.#n.get(this.#r[e])===e}*entries(){for(let e of this.#m())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e])&&(yield[this.#r[e],this.#e[e]])}*rentries(){for(let e of this.#v())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e])&&(yield[this.#r[e],this.#e[e]])}*keys(){for(let e of this.#m()){let r=this.#r[e];r!==void 0&&!this.#t(this.#e[e])&&(yield r)}}*rkeys(){for(let e of this.#v()){let r=this.#r[e];r!==void 0&&!this.#t(this.#e[e])&&(yield r)}}*values(){for(let e of this.#m())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e])}*rvalues(){for(let e of this.#v())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e])}[Symbol.iterator](){return this.entries()}find(e,r={}){for(let i of this.#m()){let n=this.#e[i],o=this.#t(n)?n.__staleWhileFetching:n;if(o!==void 0&&e(o,this.#r[i],this))return this.get(this.#r[i],r)}}forEach(e,r=this){for(let i of this.#m()){let n=this.#e[i],o=this.#t(n)?n.__staleWhileFetching:n;o!==void 0&&e.call(r,o,this.#r[i],this)}}rforEach(e,r=this){for(let i of this.#v()){let n=this.#e[i],o=this.#t(n)?n.__staleWhileFetching:n;o!==void 0&&e.call(r,o,this.#r[i],this)}}purgeStale(){let e=!1;for(let r of this.#v({allowStale:!0}))this.#d(r)&&(this.delete(this.#r[r]),e=!0);return e}dump(){let e=[];for(let r of this.#m({allowStale:!0})){let i=this.#r[r],n=this.#e[r],o=this.#t(n)?n.__staleWhileFetching:n;if(o===void 0||i===void 0)continue;let s={value:o};if(this.#w&&this.#S){s.ttl=this.#w[r];let a=rn.now()-this.#S[r];s.start=Math.floor(Date.now()-a)}this.#E&&(s.size=this.#E[r]),e.unshift([i,s])}return e}load(e){this.clear();for(let[r,i]of e){if(i.start){let n=Date.now()-i.start;i.start=rn.now()-n}this.set(r,i.value,i)}}set(e,r,i={}){if(r===void 0)return this.delete(e),this;let{ttl:n=this.ttl,start:o,noDisposeOnSet:s=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:l}=i,{noUpdateTTL:c=this.noUpdateTTL}=i,h=this.#L(e,r,i.size||0,a);if(this.maxEntrySize&&h>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.delete(e),this;let d=this.#i===0?void 0:this.#n.get(e);if(d===void 0)d=this.#i===0?this.#s:this.#b.length!==0?this.#b.pop():this.#i===this.#l?this.#O(!1):this.#i,this.#r[d]=e,this.#e[d]=r,this.#n.set(e,d),this.#u[this.#s]=d,this.#h[d]=this.#s,this.#s=d,this.#i++,this.#B(d,h,l),l&&(l.set="add"),c=!1;else{this.#C(d);let g=this.#e[d];if(r!==g){if(this.#R&&this.#t(g)){g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:y}=g;y!==void 0&&!s&&(this.#_&&this.#p?.(y,e,"set"),this.#f&&this.#o?.push([y,e,"set"]))}else s||(this.#_&&this.#p?.(g,e,"set"),this.#f&&this.#o?.push([g,e,"set"]));if(this.#I(d),this.#B(d,h,l),this.#e[d]=r,l){l.set="replace";let y=g&&this.#t(g)?g.__staleWhileFetching:g;y!==void 0&&(l.oldValue=y)}}else l&&(l.set="update")}if(n!==0&&!this.#w&&this.#k(),this.#w&&(c||this.#M(d,n,o),l&&this.#A(l,d)),!s&&this.#f&&this.#o){let g=this.#o,y;for(;y=g?.shift();)this.#g?.(...y)}return this}pop(){try{for(;this.#i;){let e=this.#e[this.#a];if(this.#O(!0),this.#t(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#f&&this.#o){let e=this.#o,r;for(;r=e?.shift();)this.#g?.(...r)}}}#O(e){let r=this.#a,i=this.#r[r],n=this.#e[r];return this.#R&&this.#t(n)?n.__abortController.abort(new Error("evicted")):(this.#_||this.#f)&&(this.#_&&this.#p?.(n,i,"evict"),this.#f&&this.#o?.push([n,i,"evict"])),this.#I(r),e&&(this.#r[r]=void 0,this.#e[r]=void 0,this.#b.push(r)),this.#i===1?(this.#a=this.#s=0,this.#b.length=0):this.#a=this.#u[r],this.#n.delete(i),this.#i--,r}has(e,r={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:n}=r,o=this.#n.get(e);if(o!==void 0){let s=this.#e[o];if(this.#t(s)&&s.__staleWhileFetching===void 0)return!1;if(this.#d(o))n&&(n.has="stale",this.#A(n,o));else return i&&this.#T(o),n&&(n.has="hit",this.#A(n,o)),!0}else n&&(n.has="miss");return!1}peek(e,r={}){let{allowStale:i=this.allowStale}=r,n=this.#n.get(e);if(n!==void 0&&(i||!this.#d(n))){let o=this.#e[n];return this.#t(o)?o.__staleWhileFetching:o}}#x(e,r,i,n){let o=r===void 0?void 0:this.#e[r];if(this.#t(o))return o;let s=new Es,{signal:a}=i;a?.addEventListener("abort",()=>s.abort(a.reason),{signal:s.signal});let l={signal:s.signal,options:i,context:n},c=(E,A=!1)=>{let{aborted:T}=s.signal,B=i.ignoreFetchAbort&&E!==void 0;if(i.status&&(T&&!A?(i.status.fetchAborted=!0,i.status.fetchError=s.signal.reason,B&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),T&&!B&&!A)return d(s.signal.reason);let I=y;return this.#e[r]===y&&(E===void 0?I.__staleWhileFetching?this.#e[r]=I.__staleWhileFetching:this.delete(e):(i.status&&(i.status.fetchUpdated=!0),this.set(e,E,l.options))),E},h=E=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=E),d(E)),d=E=>{let{aborted:A}=s.signal,T=A&&i.allowStaleOnFetchAbort,B=T||i.allowStaleOnFetchRejection,I=B||i.noDeleteOnFetchRejection,N=y;if(this.#e[r]===y&&(!I||N.__staleWhileFetching===void 0?this.delete(e):T||(this.#e[r]=N.__staleWhileFetching)),B)return i.status&&N.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),N.__staleWhileFetching;if(N.__returned===N)throw E},g=(E,A)=>{let T=this.#P?.(e,o,l);T&&T instanceof Promise&&T.then(B=>E(B===void 0?void 0:B),A),s.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(E(void 0),i.allowStaleOnFetchAbort&&(E=B=>c(B,!0)))})};i.status&&(i.status.fetchDispatched=!0);let y=new Promise(g).then(c,h),v=Object.assign(y,{__abortController:s,__staleWhileFetching:o,__returned:void 0});return r===void 0?(this.set(e,v,{...l.options,status:void 0}),r=this.#n.get(e)):this.#e[r]=v,v}#t(e){if(!this.#R)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof Es}async fetch(e,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:l=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:h=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:g=this.allowStaleOnFetchRejection,ignoreFetchAbort:y=this.ignoreFetchAbort,allowStaleOnFetchAbort:v=this.allowStaleOnFetchAbort,context:E,forceRefresh:A=!1,status:T,signal:B}=r;if(!this.#R)return T&&(T.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:o,status:T});let I={allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:o,ttl:s,noDisposeOnSet:a,size:l,sizeCalculation:c,noUpdateTTL:h,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:g,allowStaleOnFetchAbort:v,ignoreFetchAbort:y,status:T,signal:B},N=this.#n.get(e);if(N===void 0){T&&(T.fetch="miss");let D=this.#x(e,N,I,E);return D.__returned=D}else{let D=this.#e[N];if(this.#t(D)){let Pe=i&&D.__staleWhileFetching!==void 0;return T&&(T.fetch="inflight",Pe&&(T.returnedStale=!0)),Pe?D.__staleWhileFetching:D.__returned=D}let Y=this.#d(N);if(!A&&!Y)return T&&(T.fetch="hit"),this.#C(N),n&&this.#T(N),T&&this.#A(T,N),D;let Z=this.#x(e,N,I,E),te=Z.__staleWhileFetching!==void 0&&i;return T&&(T.fetch=Y?"stale":"refresh",te&&Y&&(T.returnedStale=!0)),te?Z.__staleWhileFetching:Z.__returned=Z}}get(e,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:s}=r,a=this.#n.get(e);if(a!==void 0){let l=this.#e[a],c=this.#t(l);return s&&this.#A(s,a),this.#d(a)?(s&&(s.get="stale"),c?(s&&i&&l.__staleWhileFetching!==void 0&&(s.returnedStale=!0),i?l.__staleWhileFetching:void 0):(o||this.delete(e),s&&i&&(s.returnedStale=!0),i?l:void 0)):(s&&(s.get="hit"),c?l.__staleWhileFetching:(this.#C(a),n&&this.#T(a),l))}else s&&(s.get="miss")}#N(e,r){this.#h[r]=e,this.#u[e]=r}#C(e){e!==this.#s&&(e===this.#a?this.#a=this.#u[e]:this.#N(this.#h[e],this.#u[e]),this.#N(this.#s,e),this.#s=e)}delete(e){let r=!1;if(this.#i!==0){let i=this.#n.get(e);if(i!==void 0)if(r=!0,this.#i===1)this.clear();else{this.#I(i);let n=this.#e[i];this.#t(n)?n.__abortController.abort(new Error("deleted")):(this.#_||this.#f)&&(this.#_&&this.#p?.(n,e,"delete"),this.#f&&this.#o?.push([n,e,"delete"])),this.#n.delete(e),this.#r[i]=void 0,this.#e[i]=void 0,i===this.#s?this.#s=this.#h[i]:i===this.#a?this.#a=this.#u[i]:(this.#u[this.#h[i]]=this.#u[i],this.#h[this.#u[i]]=this.#h[i]),this.#i--,this.#b.push(i)}}if(this.#f&&this.#o?.length){let i=this.#o,n;for(;n=i?.shift();)this.#g?.(...n)}return r}clear(){for(let e of this.#v({allowStale:!0})){let r=this.#e[e];if(this.#t(r))r.__abortController.abort(new Error("deleted"));else{let i=this.#r[e];this.#_&&this.#p?.(r,i,"delete"),this.#f&&this.#o?.push([r,i,"delete"])}}if(this.#n.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#w&&this.#S&&(this.#w.fill(0),this.#S.fill(0)),this.#E&&this.#E.fill(0),this.#a=0,this.#s=0,this.#b.length=0,this.#y=0,this.#i=0,this.#f&&this.#o){let e=this.#o,r;for(;r=e?.shift();)this.#g?.(...r)}}};Ss.LRUCache=Tl});var wt=M(sr=>{"use strict";w();m();_();Object.defineProperty(sr,"t",{value:!0});sr.ContainerIterator=sr.Container=sr.Base=void 0;var Il=class{constructor(e=0){this.iteratorType=e}equals(e){return this.o===e.o}};sr.ContainerIterator=Il;var As=class{constructor(){this.i=0}get length(){return this.i}size(){return this.i}empty(){return this.i===0}};sr.Base=As;var Cl=class extends As{};sr.Container=Cl});var Zg=M(Rs=>{"use strict";w();m();_();Object.defineProperty(Rs,"t",{value:!0});Rs.default=void 0;var QS=wt(),Pl=class extends QS.Base{constructor(e=[]){super(),this.S=[];let r=this;e.forEach(function(i){r.push(i)})}clear(){this.i=0,this.S=[]}push(e){return this.S.push(e),this.i+=1,this.i}pop(){if(this.i!==0)return this.i-=1,this.S.pop()}top(){return this.S[this.i-1]}},JS=Pl;Rs.default=JS});var ey=M(Ts=>{"use strict";w();m();_();Object.defineProperty(Ts,"t",{value:!0});Ts.default=void 0;var XS=wt(),Bl=class extends XS.Base{constructor(e=[]){super(),this.j=0,this.q=[];let r=this;e.forEach(function(i){r.push(i)})}clear(){this.q=[],this.i=this.j=0}push(e){let r=this.q.length;if(this.j/r>.5&&this.j+this.i>=r&&r>4096){let i=this.i;for(let n=0;n<i;++n)this.q[n]=this.q[this.j+n];this.j=0,this.q[this.i]=e}else this.q[this.j+this.i]=e;return++this.i}pop(){if(this.i===0)return;let e=this.q[this.j++];return this.i-=1,e}front(){if(this.i!==0)return this.q[this.j]}},ZS=Bl;Ts.default=ZS});var ty=M(Is=>{"use strict";w();m();_();Object.defineProperty(Is,"t",{value:!0});Is.default=void 0;var eA=wt(),Ol=class extends eA.Base{constructor(e=[],r=function(n,o){return n>o?-1:n<o?1:0},i=!0){if(super(),this.v=r,Array.isArray(e))this.C=i?[...e]:e;else{this.C=[];let o=this;e.forEach(function(s){o.C.push(s)})}this.i=this.C.length;let n=this.i>>1;for(let o=this.i-1>>1;o>=0;--o)this.k(o,n)}m(e){let r=this.C[e];for(;e>0;){let i=e-1>>1,n=this.C[i];if(this.v(n,r)<=0)break;this.C[e]=n,e=i}this.C[e]=r}k(e,r){let i=this.C[e];for(;e<r;){let n=e<<1|1,o=n+1,s=this.C[n];if(o<this.i&&this.v(s,this.C[o])>0&&(n=o,s=this.C[o]),this.v(s,i)>=0)break;this.C[e]=s,e=n}this.C[e]=i}clear(){this.i=0,this.C.length=0}push(e){this.C.push(e),this.m(this.i),this.i+=1}pop(){if(this.i===0)return;let e=this.C[0],r=this.C.pop();return this.i-=1,this.i&&(this.C[0]=r,this.k(0,this.i>>1)),e}top(){return this.C[0]}find(e){return this.C.indexOf(e)>=0}remove(e){let r=this.C.indexOf(e);return r<0?!1:(r===0?this.pop():r===this.i-1?(this.C.pop(),this.i-=1):(this.C.splice(r,1,this.C.pop()),this.i-=1,this.m(r),this.k(r,this.i>>1)),!0)}updateItem(e){let r=this.C.indexOf(e);return r<0?!1:(this.m(r),this.k(r,this.i>>1),!0)}toArray(){return[...this.C]}},tA=Ol;Is.default=tA});var Ps=M(Cs=>{"use strict";w();m();_();Object.defineProperty(Cs,"t",{value:!0});Cs.default=void 0;var rA=wt(),xl=class extends rA.Container{},iA=xl;Cs.default=iA});var _t=M(kl=>{"use strict";w();m();_();Object.defineProperty(kl,"t",{value:!0});kl.throwIteratorAccessError=nA;function nA(){throw new RangeError("Iterator access denied!")}});var Ll=M(Os=>{"use strict";w();m();_();Object.defineProperty(Os,"t",{value:!0});Os.RandomIterator=void 0;var sA=wt(),Bs=_t(),Ml=class extends sA.ContainerIterator{constructor(e,r){super(r),this.o=e,this.iteratorType===0?(this.pre=function(){return this.o===0&&(0,Bs.throwIteratorAccessError)(),this.o-=1,this},this.next=function(){return this.o===this.container.size()&&(0,Bs.throwIteratorAccessError)(),this.o+=1,this}):(this.pre=function(){return this.o===this.container.size()-1&&(0,Bs.throwIteratorAccessError)(),this.o+=1,this},this.next=function(){return this.o===-1&&(0,Bs.throwIteratorAccessError)(),this.o-=1,this})}get pointer(){return this.container.getElementByPos(this.o)}set pointer(e){this.container.setElementByPos(this.o,e)}};Os.RandomIterator=Ml});var ry=M(xs=>{"use strict";w();m();_();Object.defineProperty(xs,"t",{value:!0});xs.default=void 0;var oA=lA(Ps()),aA=Ll();function lA(t){return t&&t.t?t:{default:t}}var Ur=class t extends aA.RandomIterator{constructor(e,r,i){super(e,i),this.container=r}copy(){return new t(this.o,this.container,this.iteratorType)}},Ul=class extends oA.default{constructor(e=[],r=!0){if(super(),Array.isArray(e))this.J=r?[...e]:e,this.i=e.length;else{this.J=[];let i=this;e.forEach(function(n){i.pushBack(n)})}}clear(){this.i=0,this.J.length=0}begin(){return new Ur(0,this)}end(){return new Ur(this.i,this)}rBegin(){return new Ur(this.i-1,this,1)}rEnd(){return new Ur(-1,this,1)}front(){return this.J[0]}back(){return this.J[this.i-1]}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;return this.J[e]}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;return this.J.splice(e,1),this.i-=1,this.i}eraseElementByValue(e){let r=0;for(let i=0;i<this.i;++i)this.J[i]!==e&&(this.J[r++]=this.J[i]);return this.i=this.J.length=r,this.i}eraseElementByIterator(e){let r=e.o;return e=e.next(),this.eraseElementByPos(r),e}pushBack(e){return this.J.push(e),this.i+=1,this.i}popBack(){if(this.i!==0)return this.i-=1,this.J.pop()}setElementByPos(e,r){if(e<0||e>this.i-1)throw new RangeError;this.J[e]=r}insert(e,r,i=1){if(e<0||e>this.i)throw new RangeError;return this.J.splice(e,0,...new Array(i).fill(r)),this.i+=i,this.i}find(e){for(let r=0;r<this.i;++r)if(this.J[r]===e)return new Ur(r,this);return this.end()}reverse(){this.J.reverse()}unique(){let e=1;for(let r=1;r<this.i;++r)this.J[r]!==this.J[r-1]&&(this.J[e++]=this.J[r]);return this.i=this.J.length=e,this.i}sort(e){this.J.sort(e)}forEach(e){for(let r=0;r<this.i;++r)e(this.J[r],r,this)}[Symbol.iterator](){return function*(){yield*this.J}.bind(this)()}},uA=Ul;xs.default=uA});var iy=M(ks=>{"use strict";w();m();_();Object.defineProperty(ks,"t",{value:!0});ks.default=void 0;var fA=hA(Ps()),cA=wt(),Nr=_t();function hA(t){return t&&t.t?t:{default:t}}var Dr=class t extends cA.ContainerIterator{constructor(e,r,i,n){super(n),this.o=e,this.h=r,this.container=i,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,Nr.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,Nr.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,Nr.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,Nr.throwIteratorAccessError)(),this.o=this.o.L,this})}get pointer(){return this.o===this.h&&(0,Nr.throwIteratorAccessError)(),this.o.l}set pointer(e){this.o===this.h&&(0,Nr.throwIteratorAccessError)(),this.o.l=e}copy(){return new t(this.o,this.h,this.container,this.iteratorType)}},Nl=class extends fA.default{constructor(e=[]){super(),this.h={},this.p=this._=this.h.L=this.h.B=this.h;let r=this;e.forEach(function(i){r.pushBack(i)})}V(e){let{L:r,B:i}=e;r.B=i,i.L=r,e===this.p&&(this.p=i),e===this._&&(this._=r),this.i-=1}G(e,r){let i=r.B,n={l:e,L:r,B:i};r.B=n,i.L=n,r===this.h&&(this.p=n),i===this.h&&(this._=n),this.i+=1}clear(){this.i=0,this.p=this._=this.h.L=this.h.B=this.h}begin(){return new Dr(this.p,this.h,this)}end(){return new Dr(this.h,this.h,this)}rBegin(){return new Dr(this._,this.h,this,1)}rEnd(){return new Dr(this.h,this.h,this,1)}front(){return this.p.l}back(){return this._.l}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let r=this.p;for(;e--;)r=r.B;return r.l}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let r=this.p;for(;e--;)r=r.B;return this.V(r),this.i}eraseElementByValue(e){let r=this.p;for(;r!==this.h;)r.l===e&&this.V(r),r=r.B;return this.i}eraseElementByIterator(e){let r=e.o;return r===this.h&&(0,Nr.throwIteratorAccessError)(),e=e.next(),this.V(r),e}pushBack(e){return this.G(e,this._),this.i}popBack(){if(this.i===0)return;let e=this._.l;return this.V(this._),e}pushFront(e){return this.G(e,this.h),this.i}popFront(){if(this.i===0)return;let e=this.p.l;return this.V(this.p),e}setElementByPos(e,r){if(e<0||e>this.i-1)throw new RangeError;let i=this.p;for(;e--;)i=i.B;i.l=r}insert(e,r,i=1){if(e<0||e>this.i)throw new RangeError;if(i<=0)return this.i;if(e===0)for(;i--;)this.pushFront(r);else if(e===this.i)for(;i--;)this.pushBack(r);else{let n=this.p;for(let s=1;s<e;++s)n=n.B;let o=n.B;for(this.i+=i;i--;)n.B={l:r,L:n},n.B.L=n,n=n.B;n.B=o,o.L=n}return this.i}find(e){let r=this.p;for(;r!==this.h;){if(r.l===e)return new Dr(r,this.h,this);r=r.B}return this.end()}reverse(){if(this.i<=1)return;let e=this.p,r=this._,i=0;for(;i<<1<this.i;){let n=e.l;e.l=r.l,r.l=n,e=e.B,r=r.L,i+=1}}unique(){if(this.i<=1)return this.i;let e=this.p;for(;e!==this.h;){let r=e;for(;r.B!==this.h&&r.l===r.B.l;)r=r.B,this.i-=1;e.B=r.B,e.B.L=e,e=e.B}return this.i}sort(e){if(this.i<=1)return;let r=[];this.forEach(function(n){r.push(n)}),r.sort(e);let i=this.p;r.forEach(function(n){i.l=n,i=i.B})}merge(e){let r=this;if(this.i===0)e.forEach(function(i){r.pushBack(i)});else{let i=this.p;e.forEach(function(n){for(;i!==r.h&&i.l<=n;)i=i.B;r.G(n,i.L)})}return this.i}forEach(e){let r=this.p,i=0;for(;r!==this.h;)e(r.l,i++,this),r=r.B}[Symbol.iterator](){return function*(){if(this.i===0)return;let e=this.p;for(;e!==this.h;)yield e.l,e=e.B}.bind(this)()}},dA=Nl;ks.default=dA});var ny=M(Ms=>{"use strict";w();m();_();Object.defineProperty(Ms,"t",{value:!0});Ms.default=void 0;var pA=yA(Ps()),gA=Ll();function yA(t){return t&&t.t?t:{default:t}}var qr=class t extends gA.RandomIterator{constructor(e,r,i){super(e,i),this.container=r}copy(){return new t(this.o,this.container,this.iteratorType)}},Dl=class extends pA.default{constructor(e=[],r=4096){super(),this.j=0,this.D=0,this.R=0,this.N=0,this.P=0,this.A=[];let i=(()=>{if(typeof e.length=="number")return e.length;if(typeof e.size=="number")return e.size;if(typeof e.size=="function")return e.size();throw new TypeError("Cannot get the length or size of the container")})();this.F=r,this.P=Math.max(Math.ceil(i/this.F),1);for(let s=0;s<this.P;++s)this.A.push(new Array(this.F));let n=Math.ceil(i/this.F);this.j=this.R=(this.P>>1)-(n>>1),this.D=this.N=this.F-i%this.F>>1;let o=this;e.forEach(function(s){o.pushBack(s)})}T(){let e=[],r=Math.max(this.P>>1,1);for(let i=0;i<r;++i)e[i]=new Array(this.F);for(let i=this.j;i<this.P;++i)e[e.length]=this.A[i];for(let i=0;i<this.R;++i)e[e.length]=this.A[i];e[e.length]=[...this.A[this.R]],this.j=r,this.R=e.length-1;for(let i=0;i<r;++i)e[e.length]=new Array(this.F);this.A=e,this.P=e.length}O(e){let r=this.D+e+1,i=r%this.F,n=i-1,o=this.j+(r-i)/this.F;return i===0&&(o-=1),o%=this.P,n<0&&(n+=this.F),{curNodeBucketIndex:o,curNodePointerIndex:n}}clear(){this.A=[new Array(this.F)],this.P=1,this.j=this.R=this.i=0,this.D=this.N=this.F>>1}begin(){return new qr(0,this)}end(){return new qr(this.i,this)}rBegin(){return new qr(this.i-1,this,1)}rEnd(){return new qr(-1,this,1)}front(){if(this.i!==0)return this.A[this.j][this.D]}back(){if(this.i!==0)return this.A[this.R][this.N]}pushBack(e){return this.i&&(this.N<this.F-1?this.N+=1:this.R<this.P-1?(this.R+=1,this.N=0):(this.R=0,this.N=0),this.R===this.j&&this.N===this.D&&this.T()),this.i+=1,this.A[this.R][this.N]=e,this.i}popBack(){if(this.i===0)return;let e=this.A[this.R][this.N];return this.i!==1&&(this.N>0?this.N-=1:this.R>0?(this.R-=1,this.N=this.F-1):(this.R=this.P-1,this.N=this.F-1)),this.i-=1,e}pushFront(e){return this.i&&(this.D>0?this.D-=1:this.j>0?(this.j-=1,this.D=this.F-1):(this.j=this.P-1,this.D=this.F-1),this.j===this.R&&this.D===this.N&&this.T()),this.i+=1,this.A[this.j][this.D]=e,this.i}popFront(){if(this.i===0)return;let e=this.A[this.j][this.D];return this.i!==1&&(this.D<this.F-1?this.D+=1:this.j<this.P-1?(this.j+=1,this.D=0):(this.j=0,this.D=0)),this.i-=1,e}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let{curNodeBucketIndex:r,curNodePointerIndex:i}=this.O(e);return this.A[r][i]}setElementByPos(e,r){if(e<0||e>this.i-1)throw new RangeError;let{curNodeBucketIndex:i,curNodePointerIndex:n}=this.O(e);this.A[i][n]=r}insert(e,r,i=1){if(e<0||e>this.i)throw new RangeError;if(e===0)for(;i--;)this.pushFront(r);else if(e===this.i)for(;i--;)this.pushBack(r);else{let n=[];for(let o=e;o<this.i;++o)n.push(this.getElementByPos(o));this.cut(e-1);for(let o=0;o<i;++o)this.pushBack(r);for(let o=0;o<n.length;++o)this.pushBack(n[o])}return this.i}cut(e){if(e<0)return this.clear(),0;let{curNodeBucketIndex:r,curNodePointerIndex:i}=this.O(e);return this.R=r,this.N=i,this.i=e+1,this.i}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;if(e===0)this.popFront();else if(e===this.i-1)this.popBack();else{let r=[];for(let n=e+1;n<this.i;++n)r.push(this.getElementByPos(n));this.cut(e),this.popBack();let i=this;r.forEach(function(n){i.pushBack(n)})}return this.i}eraseElementByValue(e){if(this.i===0)return 0;let r=[];for(let n=0;n<this.i;++n){let o=this.getElementByPos(n);o!==e&&r.push(o)}let i=r.length;for(let n=0;n<i;++n)this.setElementByPos(n,r[n]);return this.cut(i-1)}eraseElementByIterator(e){let r=e.o;return this.eraseElementByPos(r),e=e.next(),e}find(e){for(let r=0;r<this.i;++r)if(this.getElementByPos(r)===e)return new qr(r,this);return this.end()}reverse(){let e=0,r=this.i-1;for(;e<r;){let i=this.getElementByPos(e);this.setElementByPos(e,this.getElementByPos(r)),this.setElementByPos(r,i),e+=1,r-=1}}unique(){if(this.i<=1)return this.i;let e=1,r=this.getElementByPos(0);for(let i=1;i<this.i;++i){let n=this.getElementByPos(i);n!==r&&(r=n,this.setElementByPos(e++,n))}for(;this.i>e;)this.popBack();return this.i}sort(e){let r=[];for(let i=0;i<this.i;++i)r.push(this.getElementByPos(i));r.sort(e);for(let i=0;i<this.i;++i)this.setElementByPos(i,r[i])}shrinkToFit(){if(this.i===0)return;let e=[];this.forEach(function(r){e.push(r)}),this.P=Math.max(Math.ceil(this.i/this.F),1),this.i=this.j=this.R=this.D=this.N=0,this.A=[];for(let r=0;r<this.P;++r)this.A.push(new Array(this.F));for(let r=0;r<e.length;++r)this.pushBack(e[r])}forEach(e){for(let r=0;r<this.i;++r)e(this.getElementByPos(r),r,this)}[Symbol.iterator](){return function*(){for(let e=0;e<this.i;++e)yield this.getElementByPos(e)}.bind(this)()}},bA=Dl;Ms.default=bA});var sy=M(Ri=>{"use strict";w();m();_();Object.defineProperty(Ri,"t",{value:!0});Ri.TreeNodeEnableIndex=Ri.TreeNode=void 0;var Ls=class{constructor(e,r){this.ee=1,this.u=void 0,this.l=void 0,this.U=void 0,this.W=void 0,this.tt=void 0,this.u=e,this.l=r}L(){let e=this;if(e.ee===1&&e.tt.tt===e)e=e.W;else if(e.U)for(e=e.U;e.W;)e=e.W;else{let r=e.tt;for(;r.U===e;)e=r,r=e.tt;e=r}return e}B(){let e=this;if(e.W){for(e=e.W;e.U;)e=e.U;return e}else{let r=e.tt;for(;r.W===e;)e=r,r=e.tt;return e.W!==r?r:e}}te(){let e=this.tt,r=this.W,i=r.U;return e.tt===this?e.tt=r:e.U===this?e.U=r:e.W=r,r.tt=e,r.U=this,this.tt=r,this.W=i,i&&(i.tt=this),r}se(){let e=this.tt,r=this.U,i=r.W;return e.tt===this?e.tt=r:e.U===this?e.U=r:e.W=r,r.tt=e,r.W=this,this.tt=r,this.U=i,i&&(i.tt=this),r}};Ri.TreeNode=Ls;var ql=class extends Ls{constructor(){super(...arguments),this.rt=1}te(){let e=super.te();return this.ie(),e.ie(),e}se(){let e=super.se();return this.ie(),e.ie(),e}ie(){this.rt=1,this.U&&(this.rt+=this.U.rt),this.W&&(this.rt+=this.W.rt)}};Ri.TreeNodeEnableIndex=ql});var Fl=M(Us=>{"use strict";w();m();_();Object.defineProperty(Us,"t",{value:!0});Us.default=void 0;var oy=sy(),wA=wt(),ay=_t(),jl=class extends wA.Container{constructor(e=function(i,n){return i<n?-1:i>n?1:0},r=!1){super(),this.Y=void 0,this.v=e,r?(this.re=oy.TreeNodeEnableIndex,this.M=function(i,n,o){let s=this.ne(i,n,o);if(s){let a=s.tt;for(;a!==this.h;)a.rt+=1,a=a.tt;let l=this.he(s);if(l){let{parentNode:c,grandParent:h,curNode:d}=l;c.ie(),h.ie(),d.ie()}}return this.i},this.V=function(i){let n=this.fe(i);for(;n!==this.h;)n.rt-=1,n=n.tt}):(this.re=oy.TreeNode,this.M=function(i,n,o){let s=this.ne(i,n,o);return s&&this.he(s),this.i},this.V=this.fe),this.h=new this.re}X(e,r){let i=this.h;for(;e;){let n=this.v(e.u,r);if(n<0)e=e.W;else if(n>0)i=e,e=e.U;else return e}return i}Z(e,r){let i=this.h;for(;e;)this.v(e.u,r)<=0?e=e.W:(i=e,e=e.U);return i}$(e,r){let i=this.h;for(;e;){let n=this.v(e.u,r);if(n<0)i=e,e=e.W;else if(n>0)e=e.U;else return e}return i}rr(e,r){let i=this.h;for(;e;)this.v(e.u,r)<0?(i=e,e=e.W):e=e.U;return i}ue(e){for(;;){let r=e.tt;if(r===this.h)return;if(e.ee===1){e.ee=0;return}if(e===r.U){let i=r.W;if(i.ee===1)i.ee=0,r.ee=1,r===this.Y?this.Y=r.te():r.te();else if(i.W&&i.W.ee===1){i.ee=r.ee,r.ee=0,i.W.ee=0,r===this.Y?this.Y=r.te():r.te();return}else i.U&&i.U.ee===1?(i.ee=1,i.U.ee=0,i.se()):(i.ee=1,e=r)}else{let i=r.U;if(i.ee===1)i.ee=0,r.ee=1,r===this.Y?this.Y=r.se():r.se();else if(i.U&&i.U.ee===1){i.ee=r.ee,r.ee=0,i.U.ee=0,r===this.Y?this.Y=r.se():r.se();return}else i.W&&i.W.ee===1?(i.ee=1,i.W.ee=0,i.te()):(i.ee=1,e=r)}}}fe(e){if(this.i===1)return this.clear(),this.h;let r=e;for(;r.U||r.W;){if(r.W)for(r=r.W;r.U;)r=r.U;else r=r.U;[e.u,r.u]=[r.u,e.u],[e.l,r.l]=[r.l,e.l],e=r}this.h.U===r?this.h.U=r.tt:this.h.W===r&&(this.h.W=r.tt),this.ue(r);let i=r.tt;return r===i.U?i.U=void 0:i.W=void 0,this.i-=1,this.Y.ee=0,i}oe(e,r){return e===void 0?!1:this.oe(e.U,r)||r(e)?!0:this.oe(e.W,r)}he(e){for(;;){let r=e.tt;if(r.ee===0)return;let i=r.tt;if(r===i.U){let n=i.W;if(n&&n.ee===1){if(n.ee=r.ee=0,i===this.Y)return;i.ee=1,e=i;continue}else if(e===r.W){if(e.ee=0,e.U&&(e.U.tt=r),e.W&&(e.W.tt=i),r.W=e.U,i.U=e.W,e.U=r,e.W=i,i===this.Y)this.Y=e,this.h.tt=e;else{let o=i.tt;o.U===i?o.U=e:o.W=e}return e.tt=i.tt,r.tt=e,i.tt=e,i.ee=1,{parentNode:r,grandParent:i,curNode:e}}else r.ee=0,i===this.Y?this.Y=i.se():i.se(),i.ee=1}else{let n=i.U;if(n&&n.ee===1){if(n.ee=r.ee=0,i===this.Y)return;i.ee=1,e=i;continue}else if(e===r.U){if(e.ee=0,e.U&&(e.U.tt=i),e.W&&(e.W.tt=r),i.W=e.U,r.U=e.W,e.U=i,e.W=r,i===this.Y)this.Y=e,this.h.tt=e;else{let o=i.tt;o.U===i?o.U=e:o.W=e}return e.tt=i.tt,r.tt=e,i.tt=e,i.ee=1,{parentNode:r,grandParent:i,curNode:e}}else r.ee=0,i===this.Y?this.Y=i.te():i.te(),i.ee=1}return}}ne(e,r,i){if(this.Y===void 0){this.i+=1,this.Y=new this.re(e,r),this.Y.ee=0,this.Y.tt=this.h,this.h.tt=this.Y,this.h.U=this.Y,this.h.W=this.Y;return}let n,o=this.h.U,s=this.v(o.u,e);if(s===0){o.l=r;return}else if(s>0)o.U=new this.re(e,r),o.U.tt=o,n=o.U,this.h.U=n;else{let a=this.h.W,l=this.v(a.u,e);if(l===0){a.l=r;return}else if(l<0)a.W=new this.re(e,r),a.W.tt=a,n=a.W,this.h.W=n;else{if(i!==void 0){let c=i.o;if(c!==this.h){let h=this.v(c.u,e);if(h===0){c.l=r;return}else if(h>0){let d=c.L(),g=this.v(d.u,e);if(g===0){d.l=r;return}else g<0&&(n=new this.re(e,r),d.W===void 0?(d.W=n,n.tt=d):(c.U=n,n.tt=c))}}}if(n===void 0)for(n=this.Y;;){let c=this.v(n.u,e);if(c>0){if(n.U===void 0){n.U=new this.re(e,r),n.U.tt=n,n=n.U;break}n=n.U}else if(c<0){if(n.W===void 0){n.W=new this.re(e,r),n.W.tt=n,n=n.W;break}n=n.W}else{n.l=r;return}}}}return this.i+=1,n}I(e,r){for(;e;){let i=this.v(e.u,r);if(i<0)e=e.W;else if(i>0)e=e.U;else return e}return e||this.h}clear(){this.i=0,this.Y=void 0,this.h.tt=void 0,this.h.U=this.h.W=void 0}updateKeyByIterator(e,r){let i=e.o;if(i===this.h&&(0,ay.throwIteratorAccessError)(),this.i===1)return i.u=r,!0;if(i===this.h.U)return this.v(i.B().u,r)>0?(i.u=r,!0):!1;if(i===this.h.W)return this.v(i.L().u,r)<0?(i.u=r,!0):!1;let n=i.L().u;if(this.v(n,r)>=0)return!1;let o=i.B().u;return this.v(o,r)<=0?!1:(i.u=r,!0)}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let r=0,i=this;return this.oe(this.Y,function(n){return e===r?(i.V(n),!0):(r+=1,!1)}),this.i}eraseElementByKey(e){if(this.i===0)return!1;let r=this.I(this.Y,e);return r===this.h?!1:(this.V(r),!0)}eraseElementByIterator(e){let r=e.o;r===this.h&&(0,ay.throwIteratorAccessError)();let i=r.W===void 0;return e.iteratorType===0?i&&e.next():(!i||r.U===void 0)&&e.next(),this.V(r),e}forEach(e){let r=0;for(let i of this)e(i,r++,this)}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let r,i=0;for(let n of this){if(i===e){r=n;break}i+=1}return r}getHeight(){if(this.i===0)return 0;let e=function(r){return r?Math.max(e(r.U),e(r.W))+1:0};return e(this.Y)}},_A=jl;Us.default=_A});var $l=M(Ds=>{"use strict";w();m();_();Object.defineProperty(Ds,"t",{value:!0});Ds.default=void 0;var mA=wt(),Ns=_t(),Wl=class extends mA.ContainerIterator{constructor(e,r,i){super(i),this.o=e,this.h=r,this.iteratorType===0?(this.pre=function(){return this.o===this.h.U&&(0,Ns.throwIteratorAccessError)(),this.o=this.o.L(),this},this.next=function(){return this.o===this.h&&(0,Ns.throwIteratorAccessError)(),this.o=this.o.B(),this}):(this.pre=function(){return this.o===this.h.W&&(0,Ns.throwIteratorAccessError)(),this.o=this.o.B(),this},this.next=function(){return this.o===this.h&&(0,Ns.throwIteratorAccessError)(),this.o=this.o.L(),this})}get index(){let e=this.o,r=this.h.tt;if(e===this.h)return r?r.rt-1:0;let i=0;for(e.U&&(i+=e.U.rt);e!==r;){let n=e.tt;e===n.W&&(i+=1,n.U&&(i+=n.U.rt)),e=n}return i}},vA=Wl;Ds.default=vA});var uy=M(qs=>{"use strict";w();m();_();Object.defineProperty(qs,"t",{value:!0});qs.default=void 0;var EA=ly(Fl()),SA=ly($l()),AA=_t();function ly(t){return t&&t.t?t:{default:t}}var nt=class t extends SA.default{constructor(e,r,i,n){super(e,r,n),this.container=i}get pointer(){return this.o===this.h&&(0,AA.throwIteratorAccessError)(),this.o.u}copy(){return new t(this.o,this.h,this.container,this.iteratorType)}},Hl=class extends EA.default{constructor(e=[],r,i){super(r,i);let n=this;e.forEach(function(o){n.insert(o)})}*K(e){e!==void 0&&(yield*this.K(e.U),yield e.u,yield*this.K(e.W))}begin(){return new nt(this.h.U||this.h,this.h,this)}end(){return new nt(this.h,this.h,this)}rBegin(){return new nt(this.h.W||this.h,this.h,this,1)}rEnd(){return new nt(this.h,this.h,this,1)}front(){return this.h.U?this.h.U.u:void 0}back(){return this.h.W?this.h.W.u:void 0}insert(e,r){return this.M(e,void 0,r)}find(e){let r=this.I(this.Y,e);return new nt(r,this.h,this)}lowerBound(e){let r=this.X(this.Y,e);return new nt(r,this.h,this)}upperBound(e){let r=this.Z(this.Y,e);return new nt(r,this.h,this)}reverseLowerBound(e){let r=this.$(this.Y,e);return new nt(r,this.h,this)}reverseUpperBound(e){let r=this.rr(this.Y,e);return new nt(r,this.h,this)}union(e){let r=this;return e.forEach(function(i){r.insert(i)}),this.i}[Symbol.iterator](){return this.K(this.Y)}},RA=Hl;qs.default=RA});var cy=M(js=>{"use strict";w();m();_();Object.defineProperty(js,"t",{value:!0});js.default=void 0;var TA=fy(Fl()),IA=fy($l()),CA=_t();function fy(t){return t&&t.t?t:{default:t}}var st=class t extends IA.default{constructor(e,r,i,n){super(e,r,n),this.container=i}get pointer(){this.o===this.h&&(0,CA.throwIteratorAccessError)();let e=this;return new Proxy([],{get(r,i){if(i==="0")return e.o.u;if(i==="1")return e.o.l},set(r,i,n){if(i!=="1")throw new TypeError("props must be 1");return e.o.l=n,!0}})}copy(){return new t(this.o,this.h,this.container,this.iteratorType)}},Vl=class extends TA.default{constructor(e=[],r,i){super(r,i);let n=this;e.forEach(function(o){n.setElement(o[0],o[1])})}*K(e){e!==void 0&&(yield*this.K(e.U),yield[e.u,e.l],yield*this.K(e.W))}begin(){return new st(this.h.U||this.h,this.h,this)}end(){return new st(this.h,this.h,this)}rBegin(){return new st(this.h.W||this.h,this.h,this,1)}rEnd(){return new st(this.h,this.h,this,1)}front(){if(this.i===0)return;let e=this.h.U;return[e.u,e.l]}back(){if(this.i===0)return;let e=this.h.W;return[e.u,e.l]}lowerBound(e){let r=this.X(this.Y,e);return new st(r,this.h,this)}upperBound(e){let r=this.Z(this.Y,e);return new st(r,this.h,this)}reverseLowerBound(e){let r=this.$(this.Y,e);return new st(r,this.h,this)}reverseUpperBound(e){let r=this.rr(this.Y,e);return new st(r,this.h,this)}setElement(e,r,i){return this.M(e,r,i)}find(e){let r=this.I(this.Y,e);return new st(r,this.h,this)}getElementByKey(e){return this.I(this.Y,e).l}union(e){let r=this;return e.forEach(function(i){r.setElement(i[0],i[1])}),this.i}[Symbol.iterator](){return this.K(this.Y)}},PA=Vl;js.default=PA});var Gl=M(zl=>{"use strict";w();m();_();Object.defineProperty(zl,"t",{value:!0});zl.default=BA;function BA(t){let e=typeof t;return e==="object"&&t!==null||e==="function"}});var Jl=M(Ti=>{"use strict";w();m();_();Object.defineProperty(Ti,"t",{value:!0});Ti.HashContainerIterator=Ti.HashContainer=void 0;var hy=wt(),Kl=OA(Gl()),nn=_t();function OA(t){return t&&t.t?t:{default:t}}var Yl=class extends hy.ContainerIterator{constructor(e,r,i){super(i),this.o=e,this.h=r,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,nn.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,nn.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,nn.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,nn.throwIteratorAccessError)(),this.o=this.o.L,this})}};Ti.HashContainerIterator=Yl;var Ql=class extends hy.Container{constructor(){super(),this.H=[],this.g={},this.HASH_TAG=Symbol("@@HASH_TAG"),Object.setPrototypeOf(this.g,null),this.h={},this.h.L=this.h.B=this.p=this._=this.h}V(e){let{L:r,B:i}=e;r.B=i,i.L=r,e===this.p&&(this.p=i),e===this._&&(this._=r),this.i-=1}M(e,r,i){i===void 0&&(i=(0,Kl.default)(e));let n;if(i){let o=e[this.HASH_TAG];if(o!==void 0)return this.H[o].l=r,this.i;Object.defineProperty(e,this.HASH_TAG,{value:this.H.length,configurable:!0}),n={u:e,l:r,L:this._,B:this.h},this.H.push(n)}else{let o=this.g[e];if(o)return o.l=r,this.i;n={u:e,l:r,L:this._,B:this.h},this.g[e]=n}return this.i===0?(this.p=n,this.h.B=n):this._.B=n,this._=n,this.h.L=n,++this.i}I(e,r){if(r===void 0&&(r=(0,Kl.default)(e)),r){let i=e[this.HASH_TAG];return i===void 0?this.h:this.H[i]}else return this.g[e]||this.h}clear(){let e=this.HASH_TAG;this.H.forEach(function(r){delete r.u[e]}),this.H=[],this.g={},Object.setPrototypeOf(this.g,null),this.i=0,this.p=this._=this.h.L=this.h.B=this.h}eraseElementByKey(e,r){let i;if(r===void 0&&(r=(0,Kl.default)(e)),r){let n=e[this.HASH_TAG];if(n===void 0)return!1;delete e[this.HASH_TAG],i=this.H[n],delete this.H[n]}else{if(i=this.g[e],i===void 0)return!1;delete this.g[e]}return this.V(i),!0}eraseElementByIterator(e){let r=e.o;return r===this.h&&(0,nn.throwIteratorAccessError)(),this.V(r),e.next()}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let r=this.p;for(;e--;)r=r.B;return this.V(r),this.i}};Ti.HashContainer=Ql});var py=M(Fs=>{"use strict";w();m();_();Object.defineProperty(Fs,"t",{value:!0});Fs.default=void 0;var dy=Jl(),xA=_t(),jr=class t extends dy.HashContainerIterator{constructor(e,r,i,n){super(e,r,n),this.container=i}get pointer(){return this.o===this.h&&(0,xA.throwIteratorAccessError)(),this.o.u}copy(){return new t(this.o,this.h,this.container,this.iteratorType)}},Xl=class extends dy.HashContainer{constructor(e=[]){super();let r=this;e.forEach(function(i){r.insert(i)})}begin(){return new jr(this.p,this.h,this)}end(){return new jr(this.h,this.h,this)}rBegin(){return new jr(this._,this.h,this,1)}rEnd(){return new jr(this.h,this.h,this,1)}front(){return this.p.u}back(){return this._.u}insert(e,r){return this.M(e,void 0,r)}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let r=this.p;for(;e--;)r=r.B;return r.u}find(e,r){let i=this.I(e,r);return new jr(i,this.h,this)}forEach(e){let r=0,i=this.p;for(;i!==this.h;)e(i.u,r++,this),i=i.B}[Symbol.iterator](){return function*(){let e=this.p;for(;e!==this.h;)yield e.u,e=e.B}.bind(this)()}},kA=Xl;Fs.default=kA});var yy=M(Ws=>{"use strict";w();m();_();Object.defineProperty(Ws,"t",{value:!0});Ws.default=void 0;var gy=Jl(),MA=UA(Gl()),LA=_t();function UA(t){return t&&t.t?t:{default:t}}var Fr=class t extends gy.HashContainerIterator{constructor(e,r,i,n){super(e,r,n),this.container=i}get pointer(){this.o===this.h&&(0,LA.throwIteratorAccessError)();let e=this;return new Proxy([],{get(r,i){if(i==="0")return e.o.u;if(i==="1")return e.o.l},set(r,i,n){if(i!=="1")throw new TypeError("props must be 1");return e.o.l=n,!0}})}copy(){return new t(this.o,this.h,this.container,this.iteratorType)}},Zl=class extends gy.HashContainer{constructor(e=[]){super();let r=this;e.forEach(function(i){r.setElement(i[0],i[1])})}begin(){return new Fr(this.p,this.h,this)}end(){return new Fr(this.h,this.h,this)}rBegin(){return new Fr(this._,this.h,this,1)}rEnd(){return new Fr(this.h,this.h,this,1)}front(){if(this.i!==0)return[this.p.u,this.p.l]}back(){if(this.i!==0)return[this._.u,this._.l]}setElement(e,r,i){return this.M(e,r,i)}getElementByKey(e,r){if(r===void 0&&(r=(0,MA.default)(e)),r){let n=e[this.HASH_TAG];return n!==void 0?this.H[n].l:void 0}let i=this.g[e];return i?i.l:void 0}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let r=this.p;for(;e--;)r=r.B;return[r.u,r.l]}find(e,r){let i=this.I(e,r);return new Fr(i,this.h,this)}forEach(e){let r=0,i=this.p;for(;i!==this.h;)e([i.u,i.l],r++,this),i=i.B}[Symbol.iterator](){return function*(){let e=this.p;for(;e!==this.h;)yield[e.u,e.l],e=e.B}.bind(this)()}},NA=Zl;Ws.default=NA});var by=M(Ye=>{"use strict";w();m();_();Object.defineProperty(Ye,"t",{value:!0});Object.defineProperty(Ye,"Deque",{enumerable:!0,get:function(){return $A.default}});Object.defineProperty(Ye,"HashMap",{enumerable:!0,get:function(){return GA.default}});Object.defineProperty(Ye,"HashSet",{enumerable:!0,get:function(){return zA.default}});Object.defineProperty(Ye,"LinkList",{enumerable:!0,get:function(){return WA.default}});Object.defineProperty(Ye,"OrderedMap",{enumerable:!0,get:function(){return VA.default}});Object.defineProperty(Ye,"OrderedSet",{enumerable:!0,get:function(){return HA.default}});Object.defineProperty(Ye,"PriorityQueue",{enumerable:!0,get:function(){return jA.default}});Object.defineProperty(Ye,"Queue",{enumerable:!0,get:function(){return qA.default}});Object.defineProperty(Ye,"Stack",{enumerable:!0,get:function(){return DA.default}});Object.defineProperty(Ye,"Vector",{enumerable:!0,get:function(){return FA.default}});var DA=mt(Zg()),qA=mt(ey()),jA=mt(ty()),FA=mt(ry()),WA=mt(iy()),$A=mt(ny()),HA=mt(uy()),VA=mt(cy()),zA=mt(py()),GA=mt(yy());function mt(t){return t&&t.t?t:{default:t}}});var _y=M((Hq,wy)=>{"use strict";w();m();_();var KA=by().OrderedSet,vt=bt()("number-allocator:trace"),YA=bt()("number-allocator:error");function ke(t,e){this.low=t,this.high=e}ke.prototype.equals=function(t){return this.low===t.low&&this.high===t.high};ke.prototype.compare=function(t){return this.low<t.low&&this.high<t.low?-1:t.low<this.low&&t.high<this.low?1:0};function Et(t,e){if(!(this instanceof Et))return new Et(t,e);this.min=t,this.max=e,this.ss=new KA([],(r,i)=>r.compare(i)),vt("Create"),this.clear()}Et.prototype.firstVacant=function(){return this.ss.size()===0?null:this.ss.front().low};Et.prototype.alloc=function(){if(this.ss.size()===0)return vt("alloc():empty"),null;let t=this.ss.begin(),e=t.pointer.low,r=t.pointer.high,i=e;return i+1<=r?this.ss.updateKeyByIterator(t,new ke(e+1,r)):this.ss.eraseElementByPos(0),vt("alloc():"+i),i};Et.prototype.use=function(t){let e=new ke(t,t),r=this.ss.lowerBound(e);if(!r.equals(this.ss.end())){let i=r.pointer.low,n=r.pointer.high;return r.pointer.equals(e)?(this.ss.eraseElementByIterator(r),vt("use():"+t),!0):i>t?!1:i===t?(this.ss.updateKeyByIterator(r,new ke(i+1,n)),vt("use():"+t),!0):n===t?(this.ss.updateKeyByIterator(r,new ke(i,n-1)),vt("use():"+t),!0):(this.ss.updateKeyByIterator(r,new ke(t+1,n)),this.ss.insert(new ke(i,t-1)),vt("use():"+t),!0)}return vt("use():failed"),!1};Et.prototype.free=function(t){if(t<this.min||t>this.max){YA("free():"+t+" is out of range");return}let e=new ke(t,t),r=this.ss.upperBound(e);if(r.equals(this.ss.end())){if(r.equals(this.ss.begin())){this.ss.insert(e);return}r.pre();let i=r.pointer.high;r.pointer.high+1===t?this.ss.updateKeyByIterator(r,new ke(i,t)):this.ss.insert(e)}else if(r.equals(this.ss.begin()))if(t+1===r.pointer.low){let i=r.pointer.high;this.ss.updateKeyByIterator(r,new ke(t,i))}else this.ss.insert(e);else{let i=r.pointer.low,n=r.pointer.high;r.pre();let o=r.pointer.low;r.pointer.high+1===t?t+1===i?(this.ss.eraseElementByIterator(r),this.ss.updateKeyByIterator(r,new ke(o,n))):this.ss.updateKeyByIterator(r,new ke(o,t)):t+1===i?(this.ss.eraseElementByIterator(r.next()),this.ss.insert(new ke(t,n))):this.ss.insert(e)}vt("free():"+t)};Et.prototype.clear=function(){vt("clear()"),this.ss.clear(),this.ss.insert(new ke(this.min,this.max))};Et.prototype.intervalCount=function(){return this.ss.size()};Et.prototype.dump=function(){console.log("length:"+this.ss.size());for(let t of this.ss)console.log(t)};wy.exports=Et});var eu=M((Jq,my)=>{w();m();_();var QA=_y();my.exports.NumberAllocator=QA});var vy=M(ru=>{"use strict";w();m();_();Object.defineProperty(ru,"__esModule",{value:!0});var JA=Xg(),XA=eu(),tu=class{constructor(e){e>0&&(this.aliasToTopic=new JA.LRUCache({max:e}),this.topicToAlias={},this.numberAllocator=new XA.NumberAllocator(1,e),this.max=e,this.length=0)}put(e,r){if(r===0||r>this.max)return!1;let i=this.aliasToTopic.get(r);return i&&delete this.topicToAlias[i],this.aliasToTopic.set(r,e),this.topicToAlias[e]=r,this.numberAllocator.use(r),this.length=this.aliasToTopic.size,!0}getTopicByAlias(e){return this.aliasToTopic.get(e)}getAliasByTopic(e){let r=this.topicToAlias[e];return typeof r<"u"&&this.aliasToTopic.get(r),r}clear(){this.aliasToTopic.clear(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0}getLruAlias(){let e=this.numberAllocator.firstVacant();return e||[...this.aliasToTopic.keys()][this.aliasToTopic.size-1]}};ru.default=tu});var Ey=M(sn=>{"use strict";w();m();_();var ZA=sn&&sn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(sn,"__esModule",{value:!0});var eR=tn(),tR=ZA(vy()),rR=en(),iR=(t,e)=>{t.log("_handleConnack");let{options:r}=t,n=r.protocolVersion===5?e.reasonCode:e.returnCode;if(clearTimeout(t.connackTimer),delete t.topicAliasSend,e.properties){if(e.properties.topicAliasMaximum){if(e.properties.topicAliasMaximum>65535){t.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}e.properties.topicAliasMaximum>0&&(t.topicAliasSend=new tR.default(e.properties.topicAliasMaximum))}e.properties.serverKeepAlive&&r.keepalive&&(r.keepalive=e.properties.serverKeepAlive,t._shiftPingInterval()),e.properties.maximumPacketSize&&(r.properties||(r.properties={}),r.properties.maximumPacketSize=e.properties.maximumPacketSize)}if(n===0)t.reconnecting=!1,t._onConnect(e);else if(n>0){let o=new rR.ErrorWithReasonCode(`Connection refused: ${eR.ReasonCodes[n]}`,n);t.emit("error",o)}};sn.default=iR});var Sy=M(iu=>{"use strict";w();m();_();Object.defineProperty(iu,"__esModule",{value:!0});var nR=(t,e,r)=>{t.log("handling pubrel packet");let i=typeof r<"u"?r:t.noop,{messageId:n}=e,o={cmd:"pubcomp",messageId:n};t.incomingStore.get(e,(s,a)=>{s?t._sendPacket(o,i):(t.emit("message",a.topic,a.payload,a),t.handleMessage(a,l=>{if(l)return i(l);t.incomingStore.del(a,t.noop),t._sendPacket(o,i)}))})};iu.default=nR});var Ay=M(on=>{"use strict";w();m();_();var an=on&&on.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(on,"__esModule",{value:!0});var sR=an(Vg()),oR=an(Gg()),aR=an(Ey()),lR=an(tn()),uR=an(Sy()),fR=(t,e,r)=>{let{options:i}=t;if(i.protocolVersion===5&&i.properties&&i.properties.maximumPacketSize&&i.properties.maximumPacketSize<e.length)return t.emit("error",new Error(`exceeding packets size ${e.cmd}`)),t.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),t;switch(t.log("_handlePacket :: emitting packetreceive"),t.emit("packetreceive",e),e.cmd){case"publish":(0,sR.default)(t,e,r);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":(0,lR.default)(t,e),r();break;case"pubrel":(0,uR.default)(t,e,r);break;case"connack":(0,aR.default)(t,e),r();break;case"auth":(0,oR.default)(t,e),r();break;case"pingresp":t.pingResp=!0,r();break;case"disconnect":t.emit("disconnect",e),r();break;default:t.log("_handlePacket :: unknown command"),r();break}};on.default=fR});var Ry=M(Ii=>{"use strict";w();m();_();var cR=Ii&&Ii.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ii,"__esModule",{value:!0});Ii.TypedEventEmitter=void 0;var hR=cR((Lt(),K(Mt))),dR=en(),$s=class{};Ii.TypedEventEmitter=$s;(0,dR.applyMixin)($s,hR.default)});var Vs=M(ot=>{"use strict";w();m();_();var pR=ot&&ot.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),gR=ot&&ot.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),yR=ot&&ot.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&pR(e,t,r);return gR(e,t),e},or=ot&&ot.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ot,"__esModule",{value:!0});var bR=or(Kc()),nu=or(Lg()),wR=or(bl()),_R=xr(),mR=or(Ng()),Ty=or(Fg()),Iy=yR($g()),vR=or(bt()),Hs=or(ml()),ER=or(Ay()),SR=Ry(),ou=R?R.nextTick:t=>{setTimeout(t,0)},su=window.setImmediate||((...t)=>{let e=t.shift();ou(()=>{e(...t)})}),Cy={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0,writeCache:!0},AR=["ECONNREFUSED","EADDRINUSE","ECONNRESET","ENOTFOUND","ETIMEDOUT"],au=class t extends SR.TypedEventEmitter{static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}constructor(e,r){super(),this.options=r||{};for(let i in Cy)typeof this.options[i]>"u"?this.options[i]=Cy[i]:this.options[i]=r[i];this.log=this.options.log||(0,vR.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: options.protocol",r.protocol),this.log("MqttClient :: options.protocolVersion",r.protocolVersion),this.log("MqttClient :: options.username",r.username),this.log("MqttClient :: options.keepalive",r.keepalive),this.log("MqttClient :: options.reconnectPeriod",r.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",r.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",r.properties?r.properties.topicAliasMaximum:void 0),this.options.clientId=typeof r.clientId=="string"?r.clientId:t.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=r.protocolVersion===5&&r.customHandleAcks?r.customHandleAcks:(...i)=>{i[3](null,0)},this.options.writeCache||(nu.default.writeToStream.cacheNumbers=!1),this.streamBuilder=e,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new wR.default:this.options.messageIdProvider,this.outgoingStore=r.outgoingStore||new Hs.default,this.incomingStore=r.incomingStore||new Hs.default,this.queueQoSZero=r.queueQoSZero===void 0?!0:r.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.pingTimer=null,this.connected=!1,this.disconnecting=!1,this.reconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,r.properties&&r.properties.topicAliasMaximum>0&&(r.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new bR.default(r.properties.topicAliasMaximum)),this.on("connect",()=>{let{queue:i}=this,n=()=>{let o=i.shift();this.log("deliver :: entry %o",o);let s=null;if(!o){this._resubscribe();return}s=o.packet,this.log("deliver :: call _sendPacket for %o",s);let a=!0;s.messageId&&s.messageId!==0&&(this.messageIdProvider.register(s.messageId)||(a=!1)),a?this._sendPacket(s,l=>{o.cb&&o.cb(l),n()}):(this.log("messageId: %d has already used. The message is skipped and removed.",s.messageId),n())};this.log("connect :: sending queued packets"),n()}),this.on("close",()=>{this.log("close :: connected set to `false`"),this.connected=!1,this.log("close :: clearing connackTimer"),clearTimeout(this.connackTimer),this.log("close :: clearing ping timer"),this.pingTimer!==null&&(this.pingTimer.clear(),this.pingTimer=null),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,r){r()}handleMessage(e,r){r()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}connect(){var e;let r=new _R.Writable,i=nu.default.parser(this.options),n=null,o=[];this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),i.on("packet",h=>{this.log("parser :: on packet push to packets array."),o.push(h)});let s=()=>{this.log("work :: getting next packet in queue");let h=o.shift();if(h)this.log("work :: packet pulled from queue"),(0,ER.default)(this,h,a);else{this.log("work :: no packets in queue");let d=n;n=null,this.log("work :: done flag is %s",!!d),d&&d()}},a=()=>{if(o.length)ou(s);else{let h=n;n=null,h()}};r._write=(h,d,g)=>{n=g,this.log("writable stream :: parsing buffer"),i.parse(h),s()};let l=h=>{this.log("streamErrorHandler :: error",h.message),AR.includes(h.code)?(this.log("streamErrorHandler :: emitting error"),this.emit("error",h)):this.noop(h)};this.log("connect :: pipe stream to writable stream"),this.stream.pipe(r),this.stream.on("error",l),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`");let c={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};if(this.options.will&&(c.will=Object.assign(Object.assign({},this.options.will),{payload:(e=this.options.will)===null||e===void 0?void 0:e.payload})),this.topicAliasRecv&&(c.properties||(c.properties={}),this.topicAliasRecv&&(c.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket(c),i.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&&typeof this.options.authPacket=="object"){let h=Object.assign({cmd:"auth",reasonCode:0},this.options.authPacket);this._writePacket(h)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(()=>{this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this._cleanUp(!0)},this.options.connectTimeout),this}publish(e,r,i,n){this.log("publish :: message `%s` to topic `%s`",r,e);let{options:o}=this;typeof i=="function"&&(n=i,i=null),i=i||{},i=Object.assign(Object.assign({},{qos:0,retain:!1,dup:!1}),i);let{qos:a,retain:l,dup:c,properties:h,cbStorePut:d}=i;if(this._checkDisconnecting(n))return this;let g=()=>{let y=0;if((a===1||a===2)&&(y=this._nextId(),y===null))return this.log("No messageId left"),!1;let v={cmd:"publish",topic:e,payload:r,qos:a,retain:l,messageId:y,dup:c};switch(o.protocolVersion===5&&(v.properties=h),this.log("publish :: qos",a),a){case 1:case 2:this.outgoing[v.messageId]={volatile:!1,cb:n||this.noop},this.log("MqttClient:publish: packet cmd: %s",v.cmd),this._sendPacket(v,void 0,d);break;default:this.log("MqttClient:publish: packet cmd: %s",v.cmd),this._sendPacket(v,n,d);break}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!g())&&this._storeProcessingQueue.push({invoke:g,cbStorePut:i.cbStorePut,callback:n}),this}publishAsync(e,r,i){return new Promise((n,o)=>{this.publish(e,r,i,(s,a)=>{s?o(s):n(a)})})}subscribe(e,r,i){let n=this.options.protocolVersion;typeof r=="function"&&(i=r),i=i||this.noop;let o=!1,s=[];typeof e=="string"?(e=[e],s=e):Array.isArray(e)?s=e:typeof e=="object"&&(o=e.resubscribe,delete e.resubscribe,s=Object.keys(e));let a=Iy.validateTopics(s);if(a!==null)return su(i,new Error(`Invalid topic ${a}`)),this;if(this._checkDisconnecting(i))return this.log("subscribe: discconecting true"),this;let l={qos:0};n===5&&(l.nl=!1,l.rap=!1,l.rh=0),r=Object.assign(Object.assign({},l),r);let c=r.properties,h=[],d=(y,v)=>{if(v=v||r,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,y)||this._resubscribeTopics[y].qos<v.qos||o){let E={topic:y,qos:v.qos};n===5&&(E.nl=v.nl,E.rap=v.rap,E.rh=v.rh,E.properties=c),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",E.topic,E.qos),h.push(E)}};if(Array.isArray(e)?e.forEach(y=>{this.log("subscribe: array topic %s",y),d(y)}):Object.keys(e).forEach(y=>{this.log("subscribe: object topic %s, %o",y,e[y]),d(y,e[y])}),!h.length)return i(null,[]),this;let g=()=>{let y=this._nextId();if(y===null)return this.log("No messageId left"),!1;let v={cmd:"subscribe",subscriptions:h,messageId:y};if(c&&(v.properties=c),this.options.resubscribe){this.log("subscribe :: resubscribe true");let E=[];h.forEach(A=>{if(this.options.reconnectPeriod>0){let T={qos:A.qos};n===5&&(T.nl=A.nl||!1,T.rap=A.rap||!1,T.rh=A.rh||0,T.properties=A.properties),this._resubscribeTopics[A.topic]=T,E.push(A.topic)}}),this.messageIdToTopic[v.messageId]=E}return this.outgoing[v.messageId]={volatile:!0,cb(E,A){if(!E){let{granted:T}=A;for(let B=0;B<T.length;B+=1)h[B].qos=T[B]}i(E,h)}},this.log("subscribe :: call _sendPacket"),this._sendPacket(v),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!g())&&this._storeProcessingQueue.push({invoke:g,callback:i}),this}subscribeAsync(e,r){return new Promise((i,n)=>{this.subscribe(e,r,(o,s)=>{o?n(o):i(s)})})}unsubscribe(e,r,i){typeof e=="string"&&(e=[e]),typeof r=="function"&&(i=r),i=i||this.noop;let n=Iy.validateTopics(e);if(n!==null)return su(i,new Error(`Invalid topic ${n}`)),this;if(this._checkDisconnecting(i))return this;let o=()=>{let s=this._nextId();if(s===null)return this.log("No messageId left"),!1;let a={cmd:"unsubscribe",messageId:s,unsubscriptions:[]};return typeof e=="string"?a.unsubscriptions=[e]:Array.isArray(e)&&(a.unsubscriptions=e),this.options.resubscribe&&a.unsubscriptions.forEach(l=>{delete this._resubscribeTopics[l]}),typeof r=="object"&&r.properties&&(a.properties=r.properties),this.outgoing[a.messageId]={volatile:!0,cb:i},this.log("unsubscribe: call _sendPacket"),this._sendPacket(a),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!o())&&this._storeProcessingQueue.push({invoke:o,callback:i}),this}unsubscribeAsync(e,r){return new Promise((i,n)=>{this.unsubscribe(e,r,(o,s)=>{o?n(o):i(s)})})}end(e,r,i){this.log("end :: (%s)",this.options.clientId),(e==null||typeof e!="boolean")&&(i=i||r,r=e,e=!1),typeof r!="object"&&(i=i||r,r=null),this.log("end :: cb? %s",!!i),(!i||typeof i!="function")&&(i=this.noop);let n=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this.incomingStore.close(s=>{this.outgoingStore.close(a=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),i){let l=s||a;this.log("end :: closeStores: invoking callback with args"),i(l)}})}),this._deferredReconnect&&this._deferredReconnect()},o=()=>{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"),ou(n)},r)};return this.disconnecting?(i(),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,o,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),o()),this)}endAsync(e,r){return new Promise((i,n)=>{this.end(e,r,o=>{o?n(o):i()})})}removeOutgoingMessage(e){if(this.outgoing[e]){let{cb:r}=this.outgoing[e];this._removeOutgoingAndStoreMessage(e,()=>{r(new Error("Message removed"))})}return this}reconnect(e){this.log("client reconnect");let r=()=>{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 Hs.default,this.outgoingStore=this.options.outgoingStore||new Hs.default,this.disconnecting=!1,this.disconnected=!1,this._deferredReconnect=null,this._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=r:r(),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&&typeof this.outgoing[e].cb=="function"&&(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=>{typeof this.outgoing[e].cb=="function"&&(this.outgoing[e].cb(new Error("Connection closed")),delete this.outgoing[e])}))}_removeTopicAliasAndRecoverTopicName(e){let r;e.properties&&(r=e.properties.topicAlias);let i=e.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",r,i),i.length===0){if(typeof r>"u")return new Error("Unregistered Topic Alias");if(i=this.topicAliasSend.getTopicByAlias(r),typeof i>"u")return new Error("Unregistered Topic Alias");e.topic=i}r&&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.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,r,i={}){if(r&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",r)),this.log("_cleanUp :: forced? %s",e),e)this.options.reconnectPeriod===0&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{let n=Object.assign({cmd:"disconnect"},i);this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(n,()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),su(()=>{this.stream.end(()=>{this.log("_cleanUp :: (%s) :: stream destroyed",this.options.clientId)})})})}this.disconnecting||(this.log("_cleanUp :: client not disconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this.pingTimer!==null&&(this.log("_cleanUp :: clearing pingTimer"),this.pingTimer.clear(),this.pingTimer=null),r&&!this.connected&&(this.log("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",r),r())}_storeAndSend(e,r,i){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",e.cmd);let n=e,o;if(n.cmd==="publish"&&(n=(0,Ty.default)(e),o=this._removeTopicAliasAndRecoverTopicName(n),o))return r&&r(o);this.outgoingStore.put(n,s=>{if(s)return r&&r(s);i(),this._writePacket(e,r)})}_applyTopicAlias(e){if(this.options.protocolVersion===5&&e.cmd==="publish"){let r;e.properties&&(r=e.properties.topicAlias);let i=e.topic.toString();if(this.topicAliasSend)if(r){if(i.length!==0&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",i,r),!this.topicAliasSend.put(i,r)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",i,r),new Error("Sending Topic Alias out of range")}else i.length!==0&&(this.options.autoAssignTopicAlias?(r=this.topicAliasSend.getAliasByTopic(i),r?(e.topic="",e.properties=Object.assign(Object.assign({},e.properties),{topicAlias:r}),this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",i,r)):(r=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(i,r),e.properties=Object.assign(Object.assign({},e.properties),{topicAlias:r}),this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",i,r))):this.options.autoUseTopicAlias&&(r=this.topicAliasSend.getAliasByTopic(i),r&&(e.topic="",e.properties=Object.assign(Object.assign({},e.properties),{topicAlias:r}),this.log("applyTopicAlias :: auto use topic: %s - alias: %d",i,r))));else if(r)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",i,r),new Error("Sending Topic Alias out of range")}}_noop(e){this.log("noop ::",e)}_writePacket(e,r){this.log("_writePacket :: packet: %O",e),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",e),this._shiftPingInterval(),this.log("_writePacket :: writing to stream");let i=nu.default.writeToStream(e,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",i),!i&&r&&r!==this.noop?(this.log("_writePacket :: handle events on `drain` once through callback."),this.stream.once("drain",r)):r&&(this.log("_writePacket :: invoking cb"),r())}_sendPacket(e,r,i,n){this.log("_sendPacket :: (%s) :: start",this.options.clientId),i=i||this.noop,r=r||this.noop;let o=this._applyTopicAlias(e);if(o){r(o);return}if(!this.connected){if(e.cmd==="auth"){this._writePacket(e,r);return}this.log("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(e,r,i);return}if(n){this._writePacket(e,r);return}switch(e.cmd){case"publish":break;case"pubrel":this._storeAndSend(e,r,i);return;default:this._writePacket(e,r);return}switch(e.qos){case 2:case 1:this._storeAndSend(e,r,i);break;case 0:default:this._writePacket(e,r);break}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}_storePacket(e,r,i){this.log("_storePacket :: packet: %o",e),this.log("_storePacket :: cb? %s",!!r),i=i||this.noop;let n=e;if(n.cmd==="publish"){n=(0,Ty.default)(e);let s=this._removeTopicAliasAndRecoverTopicName(n);if(s)return r&&r(s)}let o=n.qos||0;o===0&&this.queueQoSZero||n.cmd!=="publish"?this.queue.push({packet:n,cb:r}):o>0?(r=this.outgoing[n.messageId]?this.outgoing[n.messageId].cb:null,this.outgoingStore.put(n,s=>{if(s)return r&&r(s);i()})):r&&r(new Error("No connection to broker"))}_setupPingTimer(){this.log("_setupPingTimer :: keepalive %d (seconds)",this.options.keepalive),!this.pingTimer&&this.options.keepalive&&(this.pingResp=!0,this.pingTimer=(0,mR.default)(()=>{this._checkPing()},this.options.keepalive*1e3))}_shiftPingInterval(){this.pingTimer&&this.options.keepalive&&this.options.reschedulePings&&this.pingTimer.reschedule(this.options.keepalive*1e3)}_checkPing(){this.log("_checkPing :: checking ping..."),this.pingResp?(this.log("_checkPing :: ping response received. Clearing flag and sending `pingreq`"),this.pingResp=!1,this._sendPacket({cmd:"pingreq"})):(this.log("_checkPing :: calling _cleanUp with force true"),this._cleanUp(!0))}_resubscribe(){this.log("_resubscribe");let 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(this.options.protocolVersion===5){this.log("_resubscribe: protocolVersion 5");for(let r=0;r<e.length;r++){let i={};i[e[r]]=this._resubscribeTopics[e[r]],i.resubscribe=!0,this.subscribe(i,{properties:i[e[r]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1}_onConnect(e){if(this.disconnected){this.emit("connect",e);return}this.connackPacket=e,this.messageIdProvider.clear(),this._setupPingTimer(),this.connected=!0;let r=()=>{let i=this.outgoingStore.createStream(),n=()=>{i.destroy(),i=null,this._flushStoreProcessingQueue(),o()},o=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",n),i.on("error",a=>{o(),this._flushStoreProcessingQueue(),this.removeListener("close",n),this.emit("error",a)});let s=()=>{if(!i)return;let a=i.read(1),l;if(!a){i.once("readable",s);return}if(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[a.messageId]){s();return}!this.disconnecting&&!this.reconnectTimer?(l=this.outgoing[a.messageId]?this.outgoing[a.messageId].cb:null,this.outgoing[a.messageId]={volatile:!1,cb(c,h){l&&l(c,h),s()}},this._packetIdsDuringStoreProcessing[a.messageId]=!0,this.messageIdProvider.register(a.messageId)?this._sendPacket(a,void 0,void 0,!0):this.log("messageId: %d has already used.",a.messageId)):i.destroy&&i.destroy()};i.on("end",()=>{let a=!0;for(let l in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[l]){a=!1;break}a?(o(),this.removeListener("close",n),this._invokeAllStoreProcessingQueue(),this.emit("connect",e)):r()}),s()};r()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){let e=this._storeProcessingQueue[0];if(e&&e.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(let 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,r){delete this.outgoing[e],this.outgoingStore.del({messageId:e},(i,n)=>{r(i,n),this.messageIdProvider.deallocate(e),this._invokeStoreProcessingQueue()})}};ot.default=au});var Py=M(uu=>{"use strict";w();m();_();Object.defineProperty(uu,"__esModule",{value:!0});var RR=eu(),lu=class{constructor(){this.numberAllocator=new RR.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()}};uu.default=lu});function Wr(t){throw new RangeError(PR[t])}function By(t,e){let r=t.split("@"),i="";r.length>1&&(i=r[0]+"@",t=r[1]);let n=function(o,s){let a=[],l=o.length;for(;l--;)a[l]=s(o[l]);return a}((t=t.replace(CR,".")).split("."),e).join(".");return i+n}function My(t){let e=[],r=0,i=t.length;for(;r<i;){let n=t.charCodeAt(r++);if(n>=55296&&n<=56319&&r<i){let o=t.charCodeAt(r++);(64512&o)==56320?e.push(((1023&n)<<10)+(1023&o)+65536):(e.push(n),r--)}else e.push(n)}return e}var TR,IR,CR,PR,St,fu,Oy,Ly,xy,ky,ar,Uy=we(()=>{w();m();_();TR=/^xn--/,IR=/[^\0-\x7E]/,CR=/[\x2E\u3002\uFF0E\uFF61]/g,PR={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},St=Math.floor,fu=String.fromCharCode;Oy=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},Ly=function(t,e,r){let i=0;for(t=r?St(t/700):t>>1,t+=St(t/e);t>455;i+=36)t=St(t/35);return St(i+36*t/(t+38))},xy=function(t){let e=[],r=t.length,i=0,n=128,o=72,s=t.lastIndexOf("-");s<0&&(s=0);for(let l=0;l<s;++l)t.charCodeAt(l)>=128&&Wr("not-basic"),e.push(t.charCodeAt(l));for(let l=s>0?s+1:0;l<r;){let c=i;for(let d=1,g=36;;g+=36){l>=r&&Wr("invalid-input");let y=(a=t.charCodeAt(l++))-48<10?a-22:a-65<26?a-65:a-97<26?a-97:36;(y>=36||y>St((2147483647-i)/d))&&Wr("overflow"),i+=y*d;let v=g<=o?1:g>=o+26?26:g-o;if(y<v)break;let E=36-v;d>St(2147483647/E)&&Wr("overflow"),d*=E}let h=e.length+1;o=Ly(i-c,h,c==0),St(i/h)>2147483647-n&&Wr("overflow"),n+=St(i/h),i%=h,e.splice(i++,0,n)}var a;return String.fromCodePoint(...e)},ky=function(t){let e=[],r=(t=My(t)).length,i=128,n=0,o=72;for(let l of t)l<128&&e.push(fu(l));let s=e.length,a=s;for(s&&e.push("-");a<r;){let l=2147483647;for(let h of t)h>=i&&h<l&&(l=h);let c=a+1;l-i>St((2147483647-n)/c)&&Wr("overflow"),n+=(l-i)*c,i=l;for(let h of t)if(h<i&&++n>2147483647&&Wr("overflow"),h==i){let d=n;for(let g=36;;g+=36){let y=g<=o?1:g>=o+26?26:g-o;if(d<y)break;let v=d-y,E=36-y;e.push(fu(Oy(y+v%E,0))),d=St(v/E)}e.push(fu(Oy(d,0))),o=Ly(n,c,a==s),n=0,++a}++n,++i}return e.join("")},ar={version:"2.1.0",ucs2:{decode:My,encode:t=>String.fromCodePoint(...t)},decode:xy,encode:ky,toASCII:function(t){return By(t,function(e){return IR.test(e)?"xn--"+ky(e):e})},toUnicode:function(t){return By(t,function(e){return TR.test(e)?xy(e.slice(4).toLowerCase()):e})}};ar.decode;ar.encode;ar.toASCII;ar.toUnicode;ar.ucs2;ar.version});function BR(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var OR,ln,xR,At,Ny=we(()=>{w();m();_();OR=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if(typeof t!="string"||t.length===0)return n;var o=/\+/g;t=t.split(e);var s=1e3;i&&typeof i.maxKeys=="number"&&(s=i.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var l=0;l<a;++l){var c,h,d,g,y=t[l].replace(o,"%20"),v=y.indexOf(r);v>=0?(c=y.substr(0,v),h=y.substr(v+1)):(c=y,h=""),d=decodeURIComponent(c),g=decodeURIComponent(h),BR(n,d)?Array.isArray(n[d])?n[d].push(g):n[d]=[n[d],g]:n[d]=g}return n},ln=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},xR=function(t,e,r,i){return e=e||"&",r=r||"=",t===null&&(t=void 0),typeof t=="object"?Object.keys(t).map(function(n){var o=encodeURIComponent(ln(n))+r;return Array.isArray(t[n])?t[n].map(function(s){return o+encodeURIComponent(ln(s))}).join(e):o+encodeURIComponent(ln(t[n]))}).join(e):i?encodeURIComponent(ln(i))+r+encodeURIComponent(ln(t)):""},At={};At.decode=At.parse=OR,At.encode=At.stringify=xR;At.decode;At.encode;At.parse;At.stringify});function cu(){throw new Error("setTimeout has not been defined")}function hu(){throw new Error("clearTimeout has not been defined")}function jy(t){if($t===setTimeout)return setTimeout(t,0);if(($t===cu||!$t)&&setTimeout)return $t=setTimeout,setTimeout(t,0);try{return $t(t,0)}catch{try{return $t.call(null,t,0)}catch{return $t.call(this||Pi,t,0)}}}function kR(){Ci&&$r&&(Ci=!1,$r.length?Vt=$r.concat(Vt):zs=-1,Vt.length&&Fy())}function Fy(){if(!Ci){var t=jy(kR);Ci=!0;for(var e=Vt.length;e;){for($r=Vt,Vt=[];++zs<e;)$r&&$r[zs].run();zs=-1,e=Vt.length}$r=null,Ci=!1,function(r){if(Ht===clearTimeout)return clearTimeout(r);if((Ht===hu||!Ht)&&clearTimeout)return Ht=clearTimeout,clearTimeout(r);try{Ht(r)}catch{try{return Ht.call(null,r)}catch{return Ht.call(this||Pi,r)}}}(t)}}function Dy(t,e){(this||Pi).fun=t,(this||Pi).array=e}function Wt(){}var qy,$t,Ht,Pi,be,$r,Vt,Ci,zs,se,un=we(()=>{w();m();_();Pi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window,be=qy={};(function(){try{$t=typeof setTimeout=="function"?setTimeout:cu}catch{$t=cu}try{Ht=typeof clearTimeout=="function"?clearTimeout:hu}catch{Ht=hu}})();Vt=[],Ci=!1,zs=-1;be.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];Vt.push(new Dy(t,e)),Vt.length!==1||Ci||jy(Fy)},Dy.prototype.run=function(){(this||Pi).fun.apply(null,(this||Pi).array)},be.title="browser",be.browser=!0,be.env={},be.argv=[],be.version="",be.versions={},be.on=Wt,be.addListener=Wt,be.once=Wt,be.off=Wt,be.removeListener=Wt,be.removeAllListeners=Wt,be.emit=Wt,be.prependListener=Wt,be.prependOnceListener=Wt,be.listeners=function(t){return[]},be.binding=function(t){throw new Error("process.binding is not supported")},be.cwd=function(){return"/"},be.chdir=function(t){throw new Error("process.chdir is not supported")},be.umask=function(){return 0};se=qy;se.addListener;se.argv;se.binding;se.browser;se.chdir;se.cwd;se.emit;se.env;se.listeners;se.nextTick;se.off;se.on;se.once;se.prependListener;se.prependOnceListener;se.removeAllListeners;se.removeListener;se.title;se.umask;se.version;se.versions});function MR(){if(Wy)return du;Wy=!0;var t=du={},e,r;function i(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=i}catch{e=i}try{typeof clearTimeout=="function"?r=clearTimeout:r=n}catch{r=n}})();function o(E){if(e===setTimeout)return setTimeout(E,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(E,0);try{return e(E,0)}catch{try{return e.call(null,E,0)}catch{return e.call(this||Bi,E,0)}}}function s(E){if(r===clearTimeout)return clearTimeout(E);if((r===n||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(E);try{return r(E)}catch{try{return r.call(null,E)}catch{return r.call(this||Bi,E)}}}var a=[],l=!1,c,h=-1;function d(){!l||!c||(l=!1,c.length?a=c.concat(a):h=-1,a.length&&g())}function g(){if(!l){var E=o(d);l=!0;for(var A=a.length;A;){for(c=a,a=[];++h<A;)c&&c[h].run();h=-1,A=a.length}c=null,l=!1,s(E)}}t.nextTick=function(E){var A=new Array(arguments.length-1);if(arguments.length>1)for(var T=1;T<arguments.length;T++)A[T-1]=arguments[T];a.push(new y(E,A)),a.length===1&&!l&&o(g)};function y(E,A){(this||Bi).fun=E,(this||Bi).array=A}y.prototype.run=function(){(this||Bi).fun.apply(null,(this||Bi).array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function v(){}return t.on=v,t.addListener=v,t.once=v,t.off=v,t.removeListener=v,t.removeAllListeners=v,t.emit=v,t.prependListener=v,t.prependOnceListener=v,t.listeners=function(E){return[]},t.binding=function(E){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(E){throw new Error("process.chdir is not supported")},t.umask=function(){return 0},du}var du,Wy,Bi,ae,pu=we(()=>{w();m();_();du={},Wy=!1,Bi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;ae=MR();ae.platform="browser";ae.addListener;ae.argv;ae.binding;ae.browser;ae.chdir;ae.cwd;ae.emit;ae.env;ae.listeners;ae.nextTick;ae.off;ae.on;ae.once;ae.prependListener;ae.prependOnceListener;ae.removeAllListeners;ae.removeListener;ae.title;ae.umask;ae.version;ae.versions});function LR(){if($y)return gu;$y=!0;var t=ae;function e(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function r(o,s){for(var a="",l=0,c=-1,h=0,d,g=0;g<=o.length;++g){if(g<o.length)d=o.charCodeAt(g);else{if(d===47)break;d=47}if(d===47){if(!(c===g-1||h===1))if(c!==g-1&&h===2){if(a.length<2||l!==2||a.charCodeAt(a.length-1)!==46||a.charCodeAt(a.length-2)!==46){if(a.length>2){var y=a.lastIndexOf("/");if(y!==a.length-1){y===-1?(a="",l=0):(a=a.slice(0,y),l=a.length-1-a.lastIndexOf("/")),c=g,h=0;continue}}else if(a.length===2||a.length===1){a="",l=0,c=g,h=0;continue}}s&&(a.length>0?a+="/..":a="..",l=2)}else a.length>0?a+="/"+o.slice(c+1,g):a=o.slice(c+1,g),l=g-c-1;c=g,h=0}else d===46&&h!==-1?++h:h=-1}return a}function i(o,s){var a=s.dir||s.root,l=s.base||(s.name||"")+(s.ext||"");return a?a===s.root?a+l:a+o+l:l}var n={resolve:function(){for(var s="",a=!1,l,c=arguments.length-1;c>=-1&&!a;c--){var h;c>=0?h=arguments[c]:(l===void 0&&(l=t.cwd()),h=l),e(h),h.length!==0&&(s=h+"/"+s,a=h.charCodeAt(0)===47)}return s=r(s,!a),a?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(s){if(e(s),s.length===0)return".";var a=s.charCodeAt(0)===47,l=s.charCodeAt(s.length-1)===47;return s=r(s,!a),s.length===0&&!a&&(s="."),s.length>0&&l&&(s+="/"),a?"/"+s:s},isAbsolute:function(s){return e(s),s.length>0&&s.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var s,a=0;a<arguments.length;++a){var l=arguments[a];e(l),l.length>0&&(s===void 0?s=l:s+="/"+l)}return s===void 0?".":n.normalize(s)},relative:function(s,a){if(e(s),e(a),s===a||(s=n.resolve(s),a=n.resolve(a),s===a))return"";for(var l=1;l<s.length&&s.charCodeAt(l)===47;++l);for(var c=s.length,h=c-l,d=1;d<a.length&&a.charCodeAt(d)===47;++d);for(var g=a.length,y=g-d,v=h<y?h:y,E=-1,A=0;A<=v;++A){if(A===v){if(y>v){if(a.charCodeAt(d+A)===47)return a.slice(d+A+1);if(A===0)return a.slice(d+A)}else h>v&&(s.charCodeAt(l+A)===47?E=A:A===0&&(E=0));break}var T=s.charCodeAt(l+A),B=a.charCodeAt(d+A);if(T!==B)break;T===47&&(E=A)}var I="";for(A=l+E+1;A<=c;++A)(A===c||s.charCodeAt(A)===47)&&(I.length===0?I+="..":I+="/..");return I.length>0?I+a.slice(d+E):(d+=E,a.charCodeAt(d)===47&&++d,a.slice(d))},_makeLong:function(s){return s},dirname:function(s){if(e(s),s.length===0)return".";for(var a=s.charCodeAt(0),l=a===47,c=-1,h=!0,d=s.length-1;d>=1;--d)if(a=s.charCodeAt(d),a===47){if(!h){c=d;break}}else h=!1;return c===-1?l?"/":".":l&&c===1?"//":s.slice(0,c)},basename:function(s,a){if(a!==void 0&&typeof a!="string")throw new TypeError('"ext" argument must be a string');e(s);var l=0,c=-1,h=!0,d;if(a!==void 0&&a.length>0&&a.length<=s.length){if(a.length===s.length&&a===s)return"";var g=a.length-1,y=-1;for(d=s.length-1;d>=0;--d){var v=s.charCodeAt(d);if(v===47){if(!h){l=d+1;break}}else y===-1&&(h=!1,y=d+1),g>=0&&(v===a.charCodeAt(g)?--g===-1&&(c=d):(g=-1,c=y))}return l===c?c=y:c===-1&&(c=s.length),s.slice(l,c)}else{for(d=s.length-1;d>=0;--d)if(s.charCodeAt(d)===47){if(!h){l=d+1;break}}else c===-1&&(h=!1,c=d+1);return c===-1?"":s.slice(l,c)}},extname:function(s){e(s);for(var a=-1,l=0,c=-1,h=!0,d=0,g=s.length-1;g>=0;--g){var y=s.charCodeAt(g);if(y===47){if(!h){l=g+1;break}continue}c===-1&&(h=!1,c=g+1),y===46?a===-1?a=g:d!==1&&(d=1):a!==-1&&(d=-1)}return a===-1||c===-1||d===0||d===1&&a===c-1&&a===l+1?"":s.slice(a,c)},format:function(s){if(s===null||typeof s!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof s);return i("/",s)},parse:function(s){e(s);var a={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return a;var l=s.charCodeAt(0),c=l===47,h;c?(a.root="/",h=1):h=0;for(var d=-1,g=0,y=-1,v=!0,E=s.length-1,A=0;E>=h;--E){if(l=s.charCodeAt(E),l===47){if(!v){g=E+1;break}continue}y===-1&&(v=!1,y=E+1),l===46?d===-1?d=E:A!==1&&(A=1):d!==-1&&(A=-1)}return d===-1||y===-1||A===0||A===1&&d===y-1&&d===g+1?y!==-1&&(g===0&&c?a.base=a.name=s.slice(1,y):a.base=a.name=s.slice(g,y)):(g===0&&c?(a.name=s.slice(1,d),a.base=s.slice(1,y)):(a.name=s.slice(g,d),a.base=s.slice(g,y)),a.ext=s.slice(d,y)),g>0?a.dir=s.slice(0,g-1):c&&(a.dir="/"),a},sep:"/",delimiter:":",win32:null,posix:null};return n.posix=n,gu=n,gu}var gu,$y,yu,Hy=we(()=>{w();m();_();pu();gu={},$y=!1;yu=LR()});var Xy={};Yt(Xy,{URL:()=>cT,Url:()=>oT,default:()=>ie,fileURLToPath:()=>Qy,format:()=>aT,parse:()=>fT,pathToFileURL:()=>Jy,resolve:()=>lT,resolveObject:()=>uT});function Qe(){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}function fn(t,e,r){if(t&&Rt.isObject(t)&&t instanceof Qe)return t;var i=new Qe;return i.parse(t,e,r),i}function $R(){if(Ky)return _u;Ky=!0;var t=se;function e(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function r(o,s){for(var a="",l=0,c=-1,h=0,d,g=0;g<=o.length;++g){if(g<o.length)d=o.charCodeAt(g);else{if(d===47)break;d=47}if(d===47){if(!(c===g-1||h===1))if(c!==g-1&&h===2){if(a.length<2||l!==2||a.charCodeAt(a.length-1)!==46||a.charCodeAt(a.length-2)!==46){if(a.length>2){var y=a.lastIndexOf("/");if(y!==a.length-1){y===-1?(a="",l=0):(a=a.slice(0,y),l=a.length-1-a.lastIndexOf("/")),c=g,h=0;continue}}else if(a.length===2||a.length===1){a="",l=0,c=g,h=0;continue}}s&&(a.length>0?a+="/..":a="..",l=2)}else a.length>0?a+="/"+o.slice(c+1,g):a=o.slice(c+1,g),l=g-c-1;c=g,h=0}else d===46&&h!==-1?++h:h=-1}return a}function i(o,s){var a=s.dir||s.root,l=s.base||(s.name||"")+(s.ext||"");return a?a===s.root?a+l:a+o+l:l}var n={resolve:function(){for(var s="",a=!1,l,c=arguments.length-1;c>=-1&&!a;c--){var h;c>=0?h=arguments[c]:(l===void 0&&(l=t.cwd()),h=l),e(h),h.length!==0&&(s=h+"/"+s,a=h.charCodeAt(0)===47)}return s=r(s,!a),a?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(s){if(e(s),s.length===0)return".";var a=s.charCodeAt(0)===47,l=s.charCodeAt(s.length-1)===47;return s=r(s,!a),s.length===0&&!a&&(s="."),s.length>0&&l&&(s+="/"),a?"/"+s:s},isAbsolute:function(s){return e(s),s.length>0&&s.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var s,a=0;a<arguments.length;++a){var l=arguments[a];e(l),l.length>0&&(s===void 0?s=l:s+="/"+l)}return s===void 0?".":n.normalize(s)},relative:function(s,a){if(e(s),e(a),s===a||(s=n.resolve(s),a=n.resolve(a),s===a))return"";for(var l=1;l<s.length&&s.charCodeAt(l)===47;++l);for(var c=s.length,h=c-l,d=1;d<a.length&&a.charCodeAt(d)===47;++d);for(var g=a.length,y=g-d,v=h<y?h:y,E=-1,A=0;A<=v;++A){if(A===v){if(y>v){if(a.charCodeAt(d+A)===47)return a.slice(d+A+1);if(A===0)return a.slice(d+A)}else h>v&&(s.charCodeAt(l+A)===47?E=A:A===0&&(E=0));break}var T=s.charCodeAt(l+A),B=a.charCodeAt(d+A);if(T!==B)break;T===47&&(E=A)}var I="";for(A=l+E+1;A<=c;++A)(A===c||s.charCodeAt(A)===47)&&(I.length===0?I+="..":I+="/..");return I.length>0?I+a.slice(d+E):(d+=E,a.charCodeAt(d)===47&&++d,a.slice(d))},_makeLong:function(s){return s},dirname:function(s){if(e(s),s.length===0)return".";for(var a=s.charCodeAt(0),l=a===47,c=-1,h=!0,d=s.length-1;d>=1;--d)if(a=s.charCodeAt(d),a===47){if(!h){c=d;break}}else h=!1;return c===-1?l?"/":".":l&&c===1?"//":s.slice(0,c)},basename:function(s,a){if(a!==void 0&&typeof a!="string")throw new TypeError('"ext" argument must be a string');e(s);var l=0,c=-1,h=!0,d;if(a!==void 0&&a.length>0&&a.length<=s.length){if(a.length===s.length&&a===s)return"";var g=a.length-1,y=-1;for(d=s.length-1;d>=0;--d){var v=s.charCodeAt(d);if(v===47){if(!h){l=d+1;break}}else y===-1&&(h=!1,y=d+1),g>=0&&(v===a.charCodeAt(g)?--g===-1&&(c=d):(g=-1,c=y))}return l===c?c=y:c===-1&&(c=s.length),s.slice(l,c)}else{for(d=s.length-1;d>=0;--d)if(s.charCodeAt(d)===47){if(!h){l=d+1;break}}else c===-1&&(h=!1,c=d+1);return c===-1?"":s.slice(l,c)}},extname:function(s){e(s);for(var a=-1,l=0,c=-1,h=!0,d=0,g=s.length-1;g>=0;--g){var y=s.charCodeAt(g);if(y===47){if(!h){l=g+1;break}continue}c===-1&&(h=!1,c=g+1),y===46?a===-1?a=g:d!==1&&(d=1):a!==-1&&(d=-1)}return a===-1||c===-1||d===0||d===1&&a===c-1&&a===l+1?"":s.slice(a,c)},format:function(s){if(s===null||typeof s!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof s);return i("/",s)},parse:function(s){e(s);var a={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return a;var l=s.charCodeAt(0),c=l===47,h;c?(a.root="/",h=1):h=0;for(var d=-1,g=0,y=-1,v=!0,E=s.length-1,A=0;E>=h;--E){if(l=s.charCodeAt(E),l===47){if(!v){g=E+1;break}continue}y===-1&&(v=!1,y=E+1),l===46?d===-1?d=E:A!==1&&(A=1):d!==-1&&(A=-1)}return d===-1||y===-1||A===0||A===1&&d===y-1&&d===g+1?y!==-1&&(g===0&&c?a.base=a.name=s.slice(1,y):a.base=a.name=s.slice(g,y)):(g===0&&c?(a.name=s.slice(1,d),a.base=s.slice(1,y)):(a.name=s.slice(g,d),a.base=s.slice(g,y)),a.ext=s.slice(d,y)),g>0?a.dir=s.slice(0,g-1):c&&(a.dir="/"),a},sep:"/",delimiter:":",win32:null,posix:null};return n.posix=n,_u=n,_u}function tT(t){if(typeof t=="string")t=new URL(t);else if(!(t instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(t.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return vu?rT(t):iT(t)}function rT(t){let e=t.hostname,r=t.pathname;for(let i=0;i<r.length;i++)if(r[i]==="%"){let n=r.codePointAt(i+2)||32;if(r[i+1]==="2"&&n===102||r[i+1]==="5"&&n===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(r=r.replace(YR,"\\"),r=decodeURIComponent(r),e!=="")return`\\\\${e}${r}`;{let i=r.codePointAt(1)|32,n=r[2];if(i<GR||i>KR||n!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return r.slice(1)}}function iT(t){if(t.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let e=t.pathname;for(let r=0;r<e.length;r++)if(e[r]==="%"){let i=e.codePointAt(r+2)||32;if(e[r+1]==="2"&&i===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(e)}function nT(t){let e=Yy.resolve(t),r=t.charCodeAt(t.length-1);(r===zR||vu&&r===VR)&&e[e.length-1]!==Yy.sep&&(e+="/");let i=new URL("file://");return e.includes("%")&&(e=e.replace(QR,"%25")),!vu&&e.includes("\\")&&(e=e.replace(JR,"%5C")),e.includes(`
|
|
3
|
-
`)&&(e=e.replace(
|
|
4
|
-
`)&&(e=e.replace(
|
|
5
|
-
`," "]),mu=["'"].concat(jR),Vy=["%","/","?",";","#"].concat(mu),zy=["/","?","#"],Gy=/^[+a-z0-9A-Z_-]{0,63}$/,FR=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,WR={javascript:!0,"javascript:":!0},bu={javascript:!0,"javascript:":!0},Oi={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},wu=At;Qe.prototype.parse=function(t,e,r){if(!Rt.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=i!==-1&&i<t.indexOf("#")?"?":"#",o=t.split(n);o[0]=o[0].replace(/\\/g,"/");var s=t=o.join(n);if(s=s.trim(),!r&&t.split("#").length===1){var a=qR.exec(s);if(a)return this.path=s,this.href=s,this.pathname=a[1],a[2]?(this.search=a[2],this.query=e?wu.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var l=NR.exec(s);if(l){var c=(l=l[0]).toLowerCase();this.protocol=c,s=s.substr(l.length)}if(r||l||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var h=s.substr(0,2)==="//";!h||l&&bu[l]||(s=s.substr(2),this.slashes=!0)}if(!bu[l]&&(h||l&&!Oi[l])){for(var d,g,y=-1,v=0;v<zy.length;v++)(E=s.indexOf(zy[v]))!==-1&&(y===-1||E<y)&&(y=E);for((g=y===-1?s.lastIndexOf("@"):s.lastIndexOf("@",y))!==-1&&(d=s.slice(0,g),s=s.slice(g+1),this.auth=decodeURIComponent(d)),y=-1,v=0;v<Vy.length;v++){var E;(E=s.indexOf(Vy[v]))!==-1&&(y===-1||E<y)&&(y=E)}y===-1&&(y=s.length),this.host=s.slice(0,y),s=s.slice(y),this.parseHost(),this.hostname=this.hostname||"";var A=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!A)for(var T=this.hostname.split(/\./),B=(v=0,T.length);v<B;v++){var I=T[v];if(I&&!I.match(Gy)){for(var N="",D=0,Y=I.length;D<Y;D++)I.charCodeAt(D)>127?N+="x":N+=I[D];if(!N.match(Gy)){var Z=T.slice(0,v),J=T.slice(v+1),te=I.match(FR);te&&(Z.push(te[1]),J.unshift(te[2])),J.length&&(s="/"+J.join(".")+s),this.hostname=Z.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),A||(this.hostname=UR.toASCII(this.hostname));var Pe=this.port?":"+this.port:"",Ni=this.hostname||"";this.host=Ni+Pe,this.href+=this.host,A&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),s[0]!=="/"&&(s="/"+s))}if(!WR[c])for(v=0,B=mu.length;v<B;v++){var Te=mu[v];if(s.indexOf(Te)!==-1){var ei=encodeURIComponent(Te);ei===Te&&(ei=escape(Te)),s=s.split(Te).join(ei)}}var ti=s.indexOf("#");ti!==-1&&(this.hash=s.substr(ti),s=s.slice(0,ti));var ri=s.indexOf("?");if(ri!==-1?(this.search=s.substr(ri),this.query=s.substr(ri+1),e&&(this.query=wu.parse(this.query)),s=s.slice(0,ri)):e&&(this.search="",this.query={}),s&&(this.pathname=s),Oi[c]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){Pe=this.pathname||"";var Oo=this.search||"";this.path=Pe+Oo}return this.href=this.format(),this},Qe.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",i=this.hash||"",n=!1,o="";this.host?n=t+this.host:this.hostname&&(n=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&Rt.isObject(this.query)&&Object.keys(this.query).length&&(o=wu.stringify(this.query));var s=this.search||o&&"?"+o||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||Oi[e])&&n!==!1?(n="//"+(n||""),r&&r.charAt(0)!=="/"&&(r="/"+r)):n||(n=""),i&&i.charAt(0)!=="#"&&(i="#"+i),s&&s.charAt(0)!=="?"&&(s="?"+s),e+n+(r=r.replace(/[?#]/g,function(a){return encodeURIComponent(a)}))+(s=s.replace("#","%23"))+i},Qe.prototype.resolve=function(t){return this.resolveObject(fn(t,!1,!0)).format()},Qe.prototype.resolveObject=function(t){if(Rt.isString(t)){var e=new Qe;e.parse(t,!1,!0),t=e}for(var r=new Qe,i=Object.keys(this),n=0;n<i.length;n++){var o=i[n];r[o]=this[o]}if(r.hash=t.hash,t.href==="")return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var s=Object.keys(t),a=0;a<s.length;a++){var l=s[a];l!=="protocol"&&(r[l]=t[l])}return Oi[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!Oi[t.protocol]){for(var c=Object.keys(t),h=0;h<c.length;h++){var d=c[h];r[d]=t[d]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||bu[t.protocol])r.pathname=t.pathname;else{for(var g=(t.pathname||"").split("/");g.length&&!(t.host=g.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),g[0]!==""&&g.unshift(""),g.length<2&&g.unshift(""),r.pathname=g.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var y=r.pathname||"",v=r.search||"";r.path=y+v}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var E=r.pathname&&r.pathname.charAt(0)==="/",A=t.host||t.pathname&&t.pathname.charAt(0)==="/",T=A||E||r.host&&t.pathname,B=T,I=r.pathname&&r.pathname.split("/")||[],N=(g=t.pathname&&t.pathname.split("/")||[],r.protocol&&!Oi[r.protocol]);if(N&&(r.hostname="",r.port=null,r.host&&(I[0]===""?I[0]=r.host:I.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(g[0]===""?g[0]=t.host:g.unshift(t.host)),t.host=null),T=T&&(g[0]===""||I[0]==="")),A)r.host=t.host||t.host===""?t.host:r.host,r.hostname=t.hostname||t.hostname===""?t.hostname:r.hostname,r.search=t.search,r.query=t.query,I=g;else if(g.length)I||(I=[]),I.pop(),I=I.concat(g),r.search=t.search,r.query=t.query;else if(!Rt.isNullOrUndefined(t.search))return N&&(r.hostname=r.host=I.shift(),(te=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=te.shift(),r.host=r.hostname=te.shift())),r.search=t.search,r.query=t.query,Rt.isNull(r.pathname)&&Rt.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!I.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var D=I.slice(-1)[0],Y=(r.host||t.host||I.length>1)&&(D==="."||D==="..")||D==="",Z=0,J=I.length;J>=0;J--)(D=I[J])==="."?I.splice(J,1):D===".."?(I.splice(J,1),Z++):Z&&(I.splice(J,1),Z--);if(!T&&!B)for(;Z--;Z)I.unshift("..");!T||I[0]===""||I[0]&&I[0].charAt(0)==="/"||I.unshift(""),Y&&I.join("/").substr(-1)!=="/"&&I.push("");var te,Pe=I[0]===""||I[0]&&I[0].charAt(0)==="/";return N&&(r.hostname=r.host=Pe?"":I.length?I.shift():"",(te=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=te.shift(),r.host=r.hostname=te.shift())),(T=T||r.host&&I.length)&&!Pe&&I.unshift(""),I.length?r.pathname=I.join("/"):(r.pathname=null,r.path=null),Rt.isNull(r.pathname)&&Rt.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},Qe.prototype.parseHost=function(){var t=this.host,e=DR.exec(t);e&&((e=e[0])!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};ie.Url;ie.format;ie.resolve;ie.resolveObject;_u={},Ky=!1;Yy=$R(),HR=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;ie.URL=typeof URL<"u"?URL:null;ie.pathToFileURL=nT;ie.fileURLToPath=tT;ie.Url;ie.format;ie.resolve;ie.resolveObject;ie.URL;VR=92,zR=47,GR=97,KR=122,vu=HR==="win32",YR=/\//g,QR=/%/g,JR=/\\/g,XR=/\n/g,ZR=/\r/g,eT=/\t/g;sT=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;ie.URL=typeof URL<"u"?URL:null;ie.pathToFileURL=Jy;ie.fileURLToPath=Qy;oT=ie.Url,aT=ie.format,lT=ie.resolve,uT=ie.resolveObject,fT=ie.parse,cT=ie.URL,hT=92,dT=47,pT=97,gT=122,Eu=sT==="win32",yT=/\//g,bT=/%/g,wT=/\\/g,_T=/\n/g,mT=/\r/g,vT=/\t/g});var Au=M(Su=>{"use strict";w();m();_();Object.defineProperty(Su,"__esModule",{value:!0});var AT=typeof window<"u"&&typeof window.document<"u"||typeof self=="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope"||typeof navigator<"u"&&navigator.product==="ReactNative";Su.default=AT});var Ru={};Yt(Ru,{Server:()=>$e,Socket:()=>$e,Stream:()=>$e,_createServerHandle:()=>$e,_normalizeArgs:()=>$e,_setSimultaneousAccepts:()=>$e,connect:()=>$e,createConnection:()=>$e,createServer:()=>$e,default:()=>RT,isIP:()=>$e,isIPv4:()=>$e,isIPv6:()=>$e});function $e(){throw new Error("Node.js net module is not supported by JSPM core outside of Node.js")}var RT,Tu=we(()=>{w();m();_();RT={_createServerHandle:$e,_normalizeArgs:$e,_setSimultaneousAccepts:$e,connect:$e,createConnection:$e,createServer:$e,isIP:$e,isIPv4:$e,isIPv6:$e,Server:$e,Socket:$e,Stream:$e}});var Iu=M(cn=>{"use strict";w();m();_();var eb=cn&&cn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(cn,"__esModule",{value:!0});var TT=eb((Tu(),K(Ru))),IT=eb(bt()),CT=(0,IT.default)("mqttjs:tcp"),PT=(t,e)=>{e.port=e.port||1883,e.hostname=e.hostname||e.host||"localhost";let{port:r}=e,i=e.hostname;return CT("port %d and host %s",r,i),TT.default.createConnection(r,i)};cn.default=PT});var tb={};Yt(tb,{default:()=>BT});var BT,rb=we(()=>{w();m();_();BT={}});var Pu=M(hn=>{"use strict";w();m();_();var Cu=hn&&hn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(hn,"__esModule",{value:!0});var OT=Cu((rb(),K(tb))),xT=Cu((Tu(),K(Ru))),kT=Cu(bt()),MT=(0,kT.default)("mqttjs:tls"),LT=(t,e)=>{e.port=e.port||8883,e.host=e.hostname||e.host||"localhost",xT.default.isIP(e.host)===0&&(e.servername=e.host),e.rejectUnauthorized=e.rejectUnauthorized!==!1,delete e.path,MT("port %d host %s rejectUnauthorized %b",e.port,e.host,e.rejectUnauthorized);let r=OT.default.connect(e);r.on("secureConnect",()=>{e.rejectUnauthorized&&!r.authorized?r.emit("error",new Error("TLS not authorized")):r.removeListener("error",i)});function i(n){e.rejectUnauthorized&&t.emit("error",n),r.end()}return r.on("error",i),r};hn.default=LT});var Bu=M((R3,ib)=>{w();m();_();ib.exports=(Lt(),K(Mt)).EventEmitter});function zr(t){return t.call.bind(t)}function yn(t,e){if(typeof t!="object")return!1;try{return e(t),!0}catch{return!1}}function sb(t){return qe&&He?Je(t)!==void 0:mb(t)||vb(t)||Eb(t)||Sb(t)||Ab(t)||Rb(t)||Tb(t)||Ib(t)||Cb(t)||Pb(t)||Bb(t)}function mb(t){return qe&&He?Je(t)==="Uint8Array":ue(t)==="[object Uint8Array]"||VT(t)&&t.buffer!==void 0}function vb(t){return qe&&He?Je(t)==="Uint8ClampedArray":ue(t)==="[object Uint8ClampedArray]"}function Eb(t){return qe&&He?Je(t)==="Uint16Array":ue(t)==="[object Uint16Array]"}function Sb(t){return qe&&He?Je(t)==="Uint32Array":ue(t)==="[object Uint32Array]"}function Ab(t){return qe&&He?Je(t)==="Int8Array":ue(t)==="[object Int8Array]"}function Rb(t){return qe&&He?Je(t)==="Int16Array":ue(t)==="[object Int16Array]"}function Tb(t){return qe&&He?Je(t)==="Int32Array":ue(t)==="[object Int32Array]"}function Ib(t){return qe&&He?Je(t)==="Float32Array":ue(t)==="[object Float32Array]"}function Cb(t){return qe&&He?Je(t)==="Float64Array":ue(t)==="[object Float64Array]"}function Pb(t){return qe&&He?Je(t)==="BigInt64Array":ue(t)==="[object BigInt64Array]"}function Bb(t){return qe&&He?Je(t)==="BigUint64Array":ue(t)==="[object BigUint64Array]"}function Gs(t){return ue(t)==="[object Map]"}function Ks(t){return ue(t)==="[object Set]"}function Ys(t){return ue(t)==="[object WeakMap]"}function Ou(t){return ue(t)==="[object WeakSet]"}function Zs(t){return ue(t)==="[object ArrayBuffer]"}function ob(t){return typeof ArrayBuffer<"u"&&(Zs.working?Zs(t):t instanceof ArrayBuffer)}function eo(t){return ue(t)==="[object DataView]"}function ab(t){return typeof DataView<"u"&&(eo.working?eo(t):t instanceof DataView)}function to(t){return ue(t)==="[object SharedArrayBuffer]"}function lb(t){return typeof SharedArrayBuffer<"u"&&(to.working?to(t):t instanceof SharedArrayBuffer)}function ub(t){return yn(t,QT)}function fb(t){return yn(t,JT)}function cb(t){return yn(t,XT)}function hb(t){return _b&&yn(t,ZT)}function db(t){return Uu&&yn(t,eI)}function lr(t,e){var r={seen:[],stylize:iI};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),Nu(e)?r.showHidden=e:e&&x._extend(r,e),Vr(r.showHidden)&&(r.showHidden=!1),Vr(r.depth)&&(r.depth=2),Vr(r.colors)&&(r.colors=!1),Vr(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=rI),ro(r,t,r.depth)}function rI(t,e){var r=lr.styles[e];return r?"\x1B["+lr.colors[r][0]+"m"+t+"\x1B["+lr.colors[r][1]+"m":t}function iI(t,e){return t}function ro(t,e,r){if(t.customInspect&&e&&Xs(e.inspect)&&e.inspect!==x.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(r,t);return io(i)||(i=ro(t,i,r)),i}var n=function(g,y){if(Vr(y))return g.stylize("undefined","undefined");if(io(y)){var v="'"+JSON.stringify(y).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return g.stylize(v,"string")}if(kb(y))return g.stylize(""+y,"number");if(Nu(y))return g.stylize(""+y,"boolean");if(oo(y))return g.stylize("null","null")}(t,e);if(n)return n;var o=Object.keys(e),s=function(g){var y={};return g.forEach(function(v,E){y[v]=!0}),y}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),gn(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return xu(e);if(o.length===0){if(Xs(e)){var a=e.name?": "+e.name:"";return t.stylize("[Function"+a+"]","special")}if(pn(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(no(e))return t.stylize(Date.prototype.toString.call(e),"date");if(gn(e))return xu(e)}var l,c="",h=!1,d=["{","}"];return xb(e)&&(h=!0,d=["[","]"]),Xs(e)&&(c=" [Function"+(e.name?": "+e.name:"")+"]"),pn(e)&&(c=" "+RegExp.prototype.toString.call(e)),no(e)&&(c=" "+Date.prototype.toUTCString.call(e)),gn(e)&&(c=" "+xu(e)),o.length!==0||h&&e.length!=0?r<0?pn(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),l=h?function(g,y,v,E,A){for(var T=[],B=0,I=y.length;B<I;++B)Mb(y,String(B))?T.push(ku(g,y,v,E,String(B),!0)):T.push("");return A.forEach(function(N){N.match(/^\d+$/)||T.push(ku(g,y,v,E,N,!0))}),T}(t,e,r,s,o):o.map(function(g){return ku(t,e,r,s,g,h)}),t.seen.pop(),function(g,y,v){var E=0;return g.reduce(function(A,T){return E++,T.indexOf(`
|
|
1
|
+
"use strict";var mqtt=(()=>{var Uo=Object.defineProperty;var R_=Object.getOwnPropertyDescriptor;var T_=Object.getOwnPropertyNames;var I_=Object.prototype.hasOwnProperty;var we=(t,e)=>()=>(t&&(e=t(t=0)),e);var M=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Qt=(t,e)=>{for(var r in e)Uo(t,r,{get:e[r],enumerable:!0})},C_=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of T_(e))!I_.call(t,n)&&n!==r&&Uo(t,n,{get:()=>e[n],enumerable:!(i=R_(e,n))||i.enumerable});return t};var K=t=>C_(Uo({},"__esModule",{value:!0}),t);var w=we(()=>{});var R={};Qt(R,{_debugEnd:()=>wc,_debugProcess:()=>bc,_events:()=>Mc,_eventsCount:()=>Lc,_exiting:()=>Xf,_fatalExceptions:()=>dc,_getActiveHandles:()=>rc,_getActiveRequests:()=>tc,_kill:()=>nc,_linkedBinding:()=>Qf,_maxListeners:()=>kc,_preload_modules:()=>Bc,_rawDebug:()=>Kf,_startProfilerIdleNotifier:()=>_c,_stopProfilerIdleNotifier:()=>mc,_tickCallback:()=>yc,abort:()=>Ac,addListener:()=>Uc,allowedNodeEnvironmentFlags:()=>fc,arch:()=>Lf,argv:()=>Df,argv0:()=>Pc,assert:()=>cc,binding:()=>$f,chdir:()=>zf,config:()=>Zf,cpuUsage:()=>Mn,cwd:()=>Vf,debugPort:()=>Cc,default:()=>Vc,dlopen:()=>ec,domain:()=>Jf,emit:()=>Fc,emitWarning:()=>Wf,env:()=>Nf,execArgv:()=>qf,execPath:()=>Ic,exit:()=>lc,features:()=>hc,hasUncaughtExceptionCaptureCallback:()=>gc,hrtime:()=>kn,kill:()=>ac,listeners:()=>Hc,memoryUsage:()=>oc,moduleLoadList:()=>Yf,nextTick:()=>xf,off:()=>Dc,on:()=>Ot,once:()=>Nc,openStdin:()=>uc,pid:()=>Rc,platform:()=>Uf,ppid:()=>Tc,prependListener:()=>Wc,prependOnceListener:()=>$c,reallyExit:()=>ic,release:()=>Gf,removeAllListeners:()=>jc,removeListener:()=>qc,resourceUsage:()=>sc,setSourceMapsEnabled:()=>Oc,setUncaughtExceptionCaptureCallback:()=>pc,stderr:()=>Ec,stdin:()=>Sc,stdout:()=>vc,title:()=>Mf,umask:()=>Hf,uptime:()=>xc,version:()=>jf,versions:()=>Ff});function qo(t){throw new Error("Node.js process "+t+" is not supported by JSPM core outside of Node.js")}function P_(){!oi||!yr||(oi=!1,yr.length?Bt=yr.concat(Bt):xn=-1,Bt.length&&Of())}function Of(){if(!oi){var t=setTimeout(P_,0);oi=!0;for(var e=Bt.length;e;){for(yr=Bt,Bt=[];++xn<e;)yr&&yr[xn].run();xn=-1,e=Bt.length}yr=null,oi=!1,clearTimeout(t)}}function xf(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];Bt.push(new kf(t,e)),Bt.length===1&&!oi&&setTimeout(Of,0)}function kf(t,e){this.fun=t,this.array=e}function Ie(){}function Qf(t){qo("_linkedBinding")}function ec(t){qo("dlopen")}function tc(){return[]}function rc(){return[]}function cc(t,e){if(!t)throw new Error(e||"assertion error")}function gc(){return!1}function xc(){return Jt.now()/1e3}function kn(t){var e=Math.floor((Date.now()-Jt.now())*.001),r=Jt.now()*.001,i=Math.floor(r)+e,n=Math.floor(r%1*1e9);return t&&(i=i-t[0],n=n-t[1],n<0&&(i--,n+=Do)),[i,n]}function Ot(){return Vc}function Hc(t){return[]}var Bt,oi,yr,xn,Mf,Lf,Uf,Nf,Df,qf,jf,Ff,Wf,$f,Hf,Vf,zf,Gf,Kf,Yf,Jf,Xf,Zf,ic,nc,Mn,sc,oc,ac,lc,uc,fc,hc,dc,pc,yc,bc,wc,_c,mc,vc,Ec,Sc,Ac,Rc,Tc,Ic,Cc,Pc,Bc,Oc,Jt,No,Do,kc,Mc,Lc,Uc,Nc,Dc,qc,jc,Fc,Wc,$c,Vc,zc=we(()=>{w();m();_();Bt=[],oi=!1,xn=-1;kf.prototype.run=function(){this.fun.apply(null,this.array)};Mf="browser",Lf="x64",Uf="browser",Nf={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},Df=["/usr/bin/node"],qf=[],jf="v16.8.0",Ff={},Wf=function(t,e){console.warn((e?e+": ":"")+t)},$f=function(t){qo("binding")},Hf=function(t){return 0},Vf=function(){return"/"},zf=function(t){},Gf={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};Kf=Ie,Yf=[];Jf={},Xf=!1,Zf={};ic=Ie,nc=Ie,Mn=function(){return{}},sc=Mn,oc=Mn,ac=Ie,lc=Ie,uc=Ie,fc={};hc={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},dc=Ie,pc=Ie;yc=Ie,bc=Ie,wc=Ie,_c=Ie,mc=Ie,vc=void 0,Ec=void 0,Sc=void 0,Ac=Ie,Rc=2,Tc=1,Ic="/bin/usr/node",Cc=9229,Pc="node",Bc=[],Oc=Ie,Jt={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};Jt.now===void 0&&(No=Date.now(),Jt.timing&&Jt.timing.navigationStart&&(No=Jt.timing.navigationStart),Jt.now=()=>Date.now()-No);Do=1e9;kn.bigint=function(t){var e=kn(t);return typeof BigInt>"u"?e[0]*Do+e[1]:BigInt(e[0]*Do)+BigInt(e[1])};kc=10,Mc={},Lc=0;Uc=Ot,Nc=Ot,Dc=Ot,qc=Ot,jc=Ot,Fc=Ie,Wc=Ot,$c=Ot;Vc={version:jf,versions:Ff,arch:Lf,platform:Uf,release:Gf,_rawDebug:Kf,moduleLoadList:Yf,binding:$f,_linkedBinding:Qf,_events:Mc,_eventsCount:Lc,_maxListeners:kc,on:Ot,addListener:Uc,once:Nc,off:Dc,removeListener:qc,removeAllListeners:jc,emit:Fc,prependListener:Wc,prependOnceListener:$c,listeners:Hc,domain:Jf,_exiting:Xf,config:Zf,dlopen:ec,uptime:xc,_getActiveRequests:tc,_getActiveHandles:rc,reallyExit:ic,_kill:nc,cpuUsage:Mn,resourceUsage:sc,memoryUsage:oc,kill:ac,exit:lc,openStdin:uc,allowedNodeEnvironmentFlags:fc,assert:cc,features:hc,_fatalExceptions:dc,setUncaughtExceptionCaptureCallback:pc,hasUncaughtExceptionCaptureCallback:gc,emitWarning:Wf,nextTick:xf,_tickCallback:yc,_debugProcess:bc,_debugEnd:wc,_startProfilerIdleNotifier:_c,_stopProfilerIdleNotifier:mc,stdout:vc,stdin:Sc,stderr:Ec,abort:Ac,umask:Hf,chdir:zf,cwd:Vf,env:Nf,title:Mf,argv:Df,execArgv:qf,pid:Rc,ppid:Tc,execPath:Ic,debugPort:Cc,hrtime:kn,argv0:Pc,_preload_modules:Bc,setSourceMapsEnabled:Oc}});var _=we(()=>{zc()});var _e={};Qt(_e,{Buffer:()=>B,INSPECT_MAX_BYTES:()=>k_,default:()=>Xt,kMaxLength:()=>M_});function B_(){if(Gc)return ji;Gc=!0,ji.byteLength=a,ji.toByteArray=c,ji.fromByteArray=g;for(var t=[],e=[],r=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n<o;++n)t[n]=i[n],e[i.charCodeAt(n)]=n;e["-".charCodeAt(0)]=62,e["_".charCodeAt(0)]=63;function s(y){var v=y.length;if(v%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var E=y.indexOf("=");E===-1&&(E=v);var A=E===v?0:4-E%4;return[E,A]}function a(y){var v=s(y),E=v[0],A=v[1];return(E+A)*3/4-A}function l(y,v,E){return(v+E)*3/4-E}function c(y){var v,E=s(y),A=E[0],T=E[1],O=new r(l(y,A,T)),I=0,N=T>0?A-4:A,D;for(D=0;D<N;D+=4)v=e[y.charCodeAt(D)]<<18|e[y.charCodeAt(D+1)]<<12|e[y.charCodeAt(D+2)]<<6|e[y.charCodeAt(D+3)],O[I++]=v>>16&255,O[I++]=v>>8&255,O[I++]=v&255;return T===2&&(v=e[y.charCodeAt(D)]<<2|e[y.charCodeAt(D+1)]>>4,O[I++]=v&255),T===1&&(v=e[y.charCodeAt(D)]<<10|e[y.charCodeAt(D+1)]<<4|e[y.charCodeAt(D+2)]>>2,O[I++]=v>>8&255,O[I++]=v&255),O}function h(y){return t[y>>18&63]+t[y>>12&63]+t[y>>6&63]+t[y&63]}function d(y,v,E){for(var A,T=[],O=v;O<E;O+=3)A=(y[O]<<16&16711680)+(y[O+1]<<8&65280)+(y[O+2]&255),T.push(h(A));return T.join("")}function g(y){for(var v,E=y.length,A=E%3,T=[],O=16383,I=0,N=E-A;I<N;I+=O)T.push(d(y,I,I+O>N?N:I+O));return A===1?(v=y[E-1],T.push(t[v>>2]+t[v<<4&63]+"==")):A===2&&(v=(y[E-2]<<8)+y[E-1],T.push(t[v>>10]+t[v>>4&63]+t[v<<2&63]+"=")),T.join("")}return ji}function O_(){if(Kc)return Ln;Kc=!0;return Ln.read=function(t,e,r,i,n){var o,s,a=n*8-i-1,l=(1<<a)-1,c=l>>1,h=-7,d=r?n-1:0,g=r?-1:1,y=t[e+d];for(d+=g,o=y&(1<<-h)-1,y>>=-h,h+=a;h>0;o=o*256+t[e+d],d+=g,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=i;h>0;s=s*256+t[e+d],d+=g,h-=8);if(o===0)o=1-c;else{if(o===l)return s?NaN:(y?-1:1)*(1/0);s=s+Math.pow(2,i),o=o-c}return(y?-1:1)*s*Math.pow(2,o-i)},Ln.write=function(t,e,r,i,n,o){var s,a,l,c=o*8-n-1,h=(1<<c)-1,d=h>>1,g=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=i?0:o-1,v=i?1:-1,E=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+d>=1?e+=g/l:e+=g*Math.pow(2,1-d),e*l>=2&&(s++,l/=2),s+d>=h?(a=0,s=h):s+d>=1?(a=(e*l-1)*Math.pow(2,n),s=s+d):(a=e*Math.pow(2,d-1)*Math.pow(2,n),s=0));n>=8;t[r+y]=a&255,y+=v,a/=256,n-=8);for(s=s<<n|a,c+=n;c>0;t[r+y]=s&255,y+=v,s/=256,c-=8);t[r+y-v]|=E*128},Ln}function x_(){if(Yc)return br;Yc=!0;let t=B_(),e=O_(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;br.Buffer=s,br.SlowBuffer=T,br.INSPECT_MAX_BYTES=50;let i=2147483647;br.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=n(),!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function n(){try{let p=new Uint8Array(1),u={foo:function(){return 42}};return Object.setPrototypeOf(u,Uint8Array.prototype),Object.setPrototypeOf(p,u),p.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(p){if(p>i)throw new RangeError('The value "'+p+'" is invalid for option "size"');let u=new Uint8Array(p);return Object.setPrototypeOf(u,s.prototype),u}function s(p,u,f){if(typeof p=="number"){if(typeof u=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return h(p)}return a(p,u,f)}s.poolSize=8192;function a(p,u,f){if(typeof p=="string")return d(p,u);if(ArrayBuffer.isView(p))return y(p);if(p==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof p);if(lt(p,ArrayBuffer)||p&<(p.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(lt(p,SharedArrayBuffer)||p&<(p.buffer,SharedArrayBuffer)))return v(p,u,f);if(typeof p=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let b=p.valueOf&&p.valueOf();if(b!=null&&b!==p)return s.from(b,u,f);let S=E(p);if(S)return S;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof p[Symbol.toPrimitive]=="function")return s.from(p[Symbol.toPrimitive]("string"),u,f);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof p)}s.from=function(p,u,f){return a(p,u,f)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function l(p){if(typeof p!="number")throw new TypeError('"size" argument must be of type number');if(p<0)throw new RangeError('The value "'+p+'" is invalid for option "size"')}function c(p,u,f){return l(p),p<=0?o(p):u!==void 0?typeof f=="string"?o(p).fill(u,f):o(p).fill(u):o(p)}s.alloc=function(p,u,f){return c(p,u,f)};function h(p){return l(p),o(p<0?0:A(p)|0)}s.allocUnsafe=function(p){return h(p)},s.allocUnsafeSlow=function(p){return h(p)};function d(p,u){if((typeof u!="string"||u==="")&&(u="utf8"),!s.isEncoding(u))throw new TypeError("Unknown encoding: "+u);let f=O(p,u)|0,b=o(f),S=b.write(p,u);return S!==f&&(b=b.slice(0,S)),b}function g(p){let u=p.length<0?0:A(p.length)|0,f=o(u);for(let b=0;b<u;b+=1)f[b]=p[b]&255;return f}function y(p){if(lt(p,Uint8Array)){let u=new Uint8Array(p);return v(u.buffer,u.byteOffset,u.byteLength)}return g(p)}function v(p,u,f){if(u<0||p.byteLength<u)throw new RangeError('"offset" is outside of buffer bounds');if(p.byteLength<u+(f||0))throw new RangeError('"length" is outside of buffer bounds');let b;return u===void 0&&f===void 0?b=new Uint8Array(p):f===void 0?b=new Uint8Array(p,u):b=new Uint8Array(p,u,f),Object.setPrototypeOf(b,s.prototype),b}function E(p){if(s.isBuffer(p)){let u=A(p.length)|0,f=o(u);return f.length===0||p.copy(f,0,0,u),f}if(p.length!==void 0)return typeof p.length!="number"||Lo(p.length)?o(0):g(p);if(p.type==="Buffer"&&Array.isArray(p.data))return g(p.data)}function A(p){if(p>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return p|0}function T(p){return+p!=p&&(p=0),s.alloc(+p)}s.isBuffer=function(u){return u!=null&&u._isBuffer===!0&&u!==s.prototype},s.compare=function(u,f){if(lt(u,Uint8Array)&&(u=s.from(u,u.offset,u.byteLength)),lt(f,Uint8Array)&&(f=s.from(f,f.offset,f.byteLength)),!s.isBuffer(u)||!s.isBuffer(f))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(u===f)return 0;let b=u.length,S=f.length;for(let C=0,k=Math.min(b,S);C<k;++C)if(u[C]!==f[C]){b=u[C],S=f[C];break}return b<S?-1:S<b?1:0},s.isEncoding=function(u){switch(String(u).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}},s.concat=function(u,f){if(!Array.isArray(u))throw new TypeError('"list" argument must be an Array of Buffers');if(u.length===0)return s.alloc(0);let b;if(f===void 0)for(f=0,b=0;b<u.length;++b)f+=u[b].length;let S=s.allocUnsafe(f),C=0;for(b=0;b<u.length;++b){let k=u[b];if(lt(k,Uint8Array))C+k.length>S.length?(s.isBuffer(k)||(k=s.from(k)),k.copy(S,C)):Uint8Array.prototype.set.call(S,k,C);else if(s.isBuffer(k))k.copy(S,C);else throw new TypeError('"list" argument must be an Array of Buffers');C+=k.length}return S};function O(p,u){if(s.isBuffer(p))return p.length;if(ArrayBuffer.isView(p)||lt(p,ArrayBuffer))return p.byteLength;if(typeof p!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof p);let f=p.length,b=arguments.length>2&&arguments[2]===!0;if(!b&&f===0)return 0;let S=!1;for(;;)switch(u){case"ascii":case"latin1":case"binary":return f;case"utf8":case"utf-8":return Mo(p).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f*2;case"hex":return f>>>1;case"base64":return Bf(p).length;default:if(S)return b?-1:Mo(p).length;u=(""+u).toLowerCase(),S=!0}}s.byteLength=O;function I(p,u,f){let b=!1;if((u===void 0||u<0)&&(u=0),u>this.length||((f===void 0||f>this.length)&&(f=this.length),f<=0)||(f>>>=0,u>>>=0,f<=u))return"";for(p||(p="utf8");;)switch(p){case"hex":return y_(this,u,f);case"utf8":case"utf-8":return ti(this,u,f);case"ascii":return xo(this,u,f);case"latin1":case"binary":return g_(this,u,f);case"base64":return Te(this,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b_(this,u,f);default:if(b)throw new TypeError("Unknown encoding: "+p);p=(p+"").toLowerCase(),b=!0}}s.prototype._isBuffer=!0;function N(p,u,f){let b=p[u];p[u]=p[f],p[f]=b}s.prototype.swap16=function(){let u=this.length;if(u%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let f=0;f<u;f+=2)N(this,f,f+1);return this},s.prototype.swap32=function(){let u=this.length;if(u%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let f=0;f<u;f+=4)N(this,f,f+3),N(this,f+1,f+2);return this},s.prototype.swap64=function(){let u=this.length;if(u%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let f=0;f<u;f+=8)N(this,f,f+7),N(this,f+1,f+6),N(this,f+2,f+5),N(this,f+3,f+4);return this},s.prototype.toString=function(){let u=this.length;return u===0?"":arguments.length===0?ti(this,0,u):I.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(u){if(!s.isBuffer(u))throw new TypeError("Argument must be a Buffer");return this===u?!0:s.compare(this,u)===0},s.prototype.inspect=function(){let u="",f=br.INSPECT_MAX_BYTES;return u=this.toString("hex",0,f).replace(/(.{2})/g,"$1 ").trim(),this.length>f&&(u+=" ... "),"<Buffer "+u+">"},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(u,f,b,S,C){if(lt(u,Uint8Array)&&(u=s.from(u,u.offset,u.byteLength)),!s.isBuffer(u))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof u);if(f===void 0&&(f=0),b===void 0&&(b=u?u.length:0),S===void 0&&(S=0),C===void 0&&(C=this.length),f<0||b>u.length||S<0||C>this.length)throw new RangeError("out of range index");if(S>=C&&f>=b)return 0;if(S>=C)return-1;if(f>=b)return 1;if(f>>>=0,b>>>=0,S>>>=0,C>>>=0,this===u)return 0;let k=C-S,$=b-f,fe=Math.min(k,$),oe=this.slice(S,C),ce=u.slice(f,b);for(let re=0;re<fe;++re)if(oe[re]!==ce[re]){k=oe[re],$=ce[re];break}return k<$?-1:$<k?1:0};function D(p,u,f,b,S){if(p.length===0)return-1;if(typeof f=="string"?(b=f,f=0):f>2147483647?f=2147483647:f<-2147483648&&(f=-2147483648),f=+f,Lo(f)&&(f=S?0:p.length-1),f<0&&(f=p.length+f),f>=p.length){if(S)return-1;f=p.length-1}else if(f<0)if(S)f=0;else return-1;if(typeof u=="string"&&(u=s.from(u,b)),s.isBuffer(u))return u.length===0?-1:Y(p,u,f,b,S);if(typeof u=="number")return u=u&255,typeof Uint8Array.prototype.indexOf=="function"?S?Uint8Array.prototype.indexOf.call(p,u,f):Uint8Array.prototype.lastIndexOf.call(p,u,f):Y(p,[u],f,b,S);throw new TypeError("val must be string, number or Buffer")}function Y(p,u,f,b,S){let C=1,k=p.length,$=u.length;if(b!==void 0&&(b=String(b).toLowerCase(),b==="ucs2"||b==="ucs-2"||b==="utf16le"||b==="utf-16le")){if(p.length<2||u.length<2)return-1;C=2,k/=2,$/=2,f/=2}function fe(ce,re){return C===1?ce[re]:ce.readUInt16BE(re*C)}let oe;if(S){let ce=-1;for(oe=f;oe<k;oe++)if(fe(p,oe)===fe(u,ce===-1?0:oe-ce)){if(ce===-1&&(ce=oe),oe-ce+1===$)return ce*C}else ce!==-1&&(oe-=oe-ce),ce=-1}else for(f+$>k&&(f=k-$),oe=f;oe>=0;oe--){let ce=!0;for(let re=0;re<$;re++)if(fe(p,oe+re)!==fe(u,re)){ce=!1;break}if(ce)return oe}return-1}s.prototype.includes=function(u,f,b){return this.indexOf(u,f,b)!==-1},s.prototype.indexOf=function(u,f,b){return D(this,u,f,b,!0)},s.prototype.lastIndexOf=function(u,f,b){return D(this,u,f,b,!1)};function Z(p,u,f,b){f=Number(f)||0;let S=p.length-f;b?(b=Number(b),b>S&&(b=S)):b=S;let C=u.length;b>C/2&&(b=C/2);let k;for(k=0;k<b;++k){let $=parseInt(u.substr(k*2,2),16);if(Lo($))return k;p[f+k]=$}return k}function J(p,u,f,b){return On(Mo(u,p.length-f),p,f,b)}function te(p,u,f,b){return On(v_(u),p,f,b)}function Pe(p,u,f,b){return On(Bf(u),p,f,b)}function Di(p,u,f,b){return On(E_(u,p.length-f),p,f,b)}s.prototype.write=function(u,f,b,S){if(f===void 0)S="utf8",b=this.length,f=0;else if(b===void 0&&typeof f=="string")S=f,b=this.length,f=0;else if(isFinite(f))f=f>>>0,isFinite(b)?(b=b>>>0,S===void 0&&(S="utf8")):(S=b,b=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let C=this.length-f;if((b===void 0||b>C)&&(b=C),u.length>0&&(b<0||f<0)||f>this.length)throw new RangeError("Attempt to write outside buffer bounds");S||(S="utf8");let k=!1;for(;;)switch(S){case"hex":return Z(this,u,f,b);case"utf8":case"utf-8":return J(this,u,f,b);case"ascii":case"latin1":case"binary":return te(this,u,f,b);case"base64":return Pe(this,u,f,b);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Di(this,u,f,b);default:if(k)throw new TypeError("Unknown encoding: "+S);S=(""+S).toLowerCase(),k=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Te(p,u,f){return u===0&&f===p.length?t.fromByteArray(p):t.fromByteArray(p.slice(u,f))}function ti(p,u,f){f=Math.min(p.length,f);let b=[],S=u;for(;S<f;){let C=p[S],k=null,$=C>239?4:C>223?3:C>191?2:1;if(S+$<=f){let fe,oe,ce,re;switch($){case 1:C<128&&(k=C);break;case 2:fe=p[S+1],(fe&192)===128&&(re=(C&31)<<6|fe&63,re>127&&(k=re));break;case 3:fe=p[S+1],oe=p[S+2],(fe&192)===128&&(oe&192)===128&&(re=(C&15)<<12|(fe&63)<<6|oe&63,re>2047&&(re<55296||re>57343)&&(k=re));break;case 4:fe=p[S+1],oe=p[S+2],ce=p[S+3],(fe&192)===128&&(oe&192)===128&&(ce&192)===128&&(re=(C&15)<<18|(fe&63)<<12|(oe&63)<<6|ce&63,re>65535&&re<1114112&&(k=re))}}k===null?(k=65533,$=1):k>65535&&(k-=65536,b.push(k>>>10&1023|55296),k=56320|k&1023),b.push(k),S+=$}return ii(b)}let ri=4096;function ii(p){let u=p.length;if(u<=ri)return String.fromCharCode.apply(String,p);let f="",b=0;for(;b<u;)f+=String.fromCharCode.apply(String,p.slice(b,b+=ri));return f}function xo(p,u,f){let b="";f=Math.min(p.length,f);for(let S=u;S<f;++S)b+=String.fromCharCode(p[S]&127);return b}function g_(p,u,f){let b="";f=Math.min(p.length,f);for(let S=u;S<f;++S)b+=String.fromCharCode(p[S]);return b}function y_(p,u,f){let b=p.length;(!u||u<0)&&(u=0),(!f||f<0||f>b)&&(f=b);let S="";for(let C=u;C<f;++C)S+=S_[p[C]];return S}function b_(p,u,f){let b=p.slice(u,f),S="";for(let C=0;C<b.length-1;C+=2)S+=String.fromCharCode(b[C]+b[C+1]*256);return S}s.prototype.slice=function(u,f){let b=this.length;u=~~u,f=f===void 0?b:~~f,u<0?(u+=b,u<0&&(u=0)):u>b&&(u=b),f<0?(f+=b,f<0&&(f=0)):f>b&&(f=b),f<u&&(f=u);let S=this.subarray(u,f);return Object.setPrototypeOf(S,s.prototype),S};function Ee(p,u,f){if(p%1!==0||p<0)throw new RangeError("offset is not uint");if(p+u>f)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(u,f,b){u=u>>>0,f=f>>>0,b||Ee(u,f,this.length);let S=this[u],C=1,k=0;for(;++k<f&&(C*=256);)S+=this[u+k]*C;return S},s.prototype.readUintBE=s.prototype.readUIntBE=function(u,f,b){u=u>>>0,f=f>>>0,b||Ee(u,f,this.length);let S=this[u+--f],C=1;for(;f>0&&(C*=256);)S+=this[u+--f]*C;return S},s.prototype.readUint8=s.prototype.readUInt8=function(u,f){return u=u>>>0,f||Ee(u,1,this.length),this[u]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(u,f){return u=u>>>0,f||Ee(u,2,this.length),this[u]|this[u+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(u,f){return u=u>>>0,f||Ee(u,2,this.length),this[u]<<8|this[u+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(u,f){return u=u>>>0,f||Ee(u,4,this.length),(this[u]|this[u+1]<<8|this[u+2]<<16)+this[u+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(u,f){return u=u>>>0,f||Ee(u,4,this.length),this[u]*16777216+(this[u+1]<<16|this[u+2]<<8|this[u+3])},s.prototype.readBigUInt64LE=Yt(function(u){u=u>>>0,si(u,"offset");let f=this[u],b=this[u+7];(f===void 0||b===void 0)&&qi(u,this.length-8);let S=f+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24,C=this[++u]+this[++u]*2**8+this[++u]*2**16+b*2**24;return BigInt(S)+(BigInt(C)<<BigInt(32))}),s.prototype.readBigUInt64BE=Yt(function(u){u=u>>>0,si(u,"offset");let f=this[u],b=this[u+7];(f===void 0||b===void 0)&&qi(u,this.length-8);let S=f*2**24+this[++u]*2**16+this[++u]*2**8+this[++u],C=this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+b;return(BigInt(S)<<BigInt(32))+BigInt(C)}),s.prototype.readIntLE=function(u,f,b){u=u>>>0,f=f>>>0,b||Ee(u,f,this.length);let S=this[u],C=1,k=0;for(;++k<f&&(C*=256);)S+=this[u+k]*C;return C*=128,S>=C&&(S-=Math.pow(2,8*f)),S},s.prototype.readIntBE=function(u,f,b){u=u>>>0,f=f>>>0,b||Ee(u,f,this.length);let S=f,C=1,k=this[u+--S];for(;S>0&&(C*=256);)k+=this[u+--S]*C;return C*=128,k>=C&&(k-=Math.pow(2,8*f)),k},s.prototype.readInt8=function(u,f){return u=u>>>0,f||Ee(u,1,this.length),this[u]&128?(255-this[u]+1)*-1:this[u]},s.prototype.readInt16LE=function(u,f){u=u>>>0,f||Ee(u,2,this.length);let b=this[u]|this[u+1]<<8;return b&32768?b|4294901760:b},s.prototype.readInt16BE=function(u,f){u=u>>>0,f||Ee(u,2,this.length);let b=this[u+1]|this[u]<<8;return b&32768?b|4294901760:b},s.prototype.readInt32LE=function(u,f){return u=u>>>0,f||Ee(u,4,this.length),this[u]|this[u+1]<<8|this[u+2]<<16|this[u+3]<<24},s.prototype.readInt32BE=function(u,f){return u=u>>>0,f||Ee(u,4,this.length),this[u]<<24|this[u+1]<<16|this[u+2]<<8|this[u+3]},s.prototype.readBigInt64LE=Yt(function(u){u=u>>>0,si(u,"offset");let f=this[u],b=this[u+7];(f===void 0||b===void 0)&&qi(u,this.length-8);let S=this[u+4]+this[u+5]*2**8+this[u+6]*2**16+(b<<24);return(BigInt(S)<<BigInt(32))+BigInt(f+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24)}),s.prototype.readBigInt64BE=Yt(function(u){u=u>>>0,si(u,"offset");let f=this[u],b=this[u+7];(f===void 0||b===void 0)&&qi(u,this.length-8);let S=(f<<24)+this[++u]*2**16+this[++u]*2**8+this[++u];return(BigInt(S)<<BigInt(32))+BigInt(this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+b)}),s.prototype.readFloatLE=function(u,f){return u=u>>>0,f||Ee(u,4,this.length),e.read(this,u,!0,23,4)},s.prototype.readFloatBE=function(u,f){return u=u>>>0,f||Ee(u,4,this.length),e.read(this,u,!1,23,4)},s.prototype.readDoubleLE=function(u,f){return u=u>>>0,f||Ee(u,8,this.length),e.read(this,u,!0,52,8)},s.prototype.readDoubleBE=function(u,f){return u=u>>>0,f||Ee(u,8,this.length),e.read(this,u,!1,52,8)};function Le(p,u,f,b,S,C){if(!s.isBuffer(p))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>S||u<C)throw new RangeError('"value" argument is out of bounds');if(f+b>p.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(u,f,b,S){if(u=+u,f=f>>>0,b=b>>>0,!S){let $=Math.pow(2,8*b)-1;Le(this,u,f,b,$,0)}let C=1,k=0;for(this[f]=u&255;++k<b&&(C*=256);)this[f+k]=u/C&255;return f+b},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(u,f,b,S){if(u=+u,f=f>>>0,b=b>>>0,!S){let $=Math.pow(2,8*b)-1;Le(this,u,f,b,$,0)}let C=b-1,k=1;for(this[f+C]=u&255;--C>=0&&(k*=256);)this[f+C]=u/k&255;return f+b},s.prototype.writeUint8=s.prototype.writeUInt8=function(u,f,b){return u=+u,f=f>>>0,b||Le(this,u,f,1,255,0),this[f]=u&255,f+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(u,f,b){return u=+u,f=f>>>0,b||Le(this,u,f,2,65535,0),this[f]=u&255,this[f+1]=u>>>8,f+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(u,f,b){return u=+u,f=f>>>0,b||Le(this,u,f,2,65535,0),this[f]=u>>>8,this[f+1]=u&255,f+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(u,f,b){return u=+u,f=f>>>0,b||Le(this,u,f,4,4294967295,0),this[f+3]=u>>>24,this[f+2]=u>>>16,this[f+1]=u>>>8,this[f]=u&255,f+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(u,f,b){return u=+u,f=f>>>0,b||Le(this,u,f,4,4294967295,0),this[f]=u>>>24,this[f+1]=u>>>16,this[f+2]=u>>>8,this[f+3]=u&255,f+4};function Sf(p,u,f,b,S){Pf(u,b,S,p,f,7);let C=Number(u&BigInt(4294967295));p[f++]=C,C=C>>8,p[f++]=C,C=C>>8,p[f++]=C,C=C>>8,p[f++]=C;let k=Number(u>>BigInt(32)&BigInt(4294967295));return p[f++]=k,k=k>>8,p[f++]=k,k=k>>8,p[f++]=k,k=k>>8,p[f++]=k,f}function Af(p,u,f,b,S){Pf(u,b,S,p,f,7);let C=Number(u&BigInt(4294967295));p[f+7]=C,C=C>>8,p[f+6]=C,C=C>>8,p[f+5]=C,C=C>>8,p[f+4]=C;let k=Number(u>>BigInt(32)&BigInt(4294967295));return p[f+3]=k,k=k>>8,p[f+2]=k,k=k>>8,p[f+1]=k,k=k>>8,p[f]=k,f+8}s.prototype.writeBigUInt64LE=Yt(function(u,f=0){return Sf(this,u,f,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=Yt(function(u,f=0){return Af(this,u,f,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(u,f,b,S){if(u=+u,f=f>>>0,!S){let fe=Math.pow(2,8*b-1);Le(this,u,f,b,fe-1,-fe)}let C=0,k=1,$=0;for(this[f]=u&255;++C<b&&(k*=256);)u<0&&$===0&&this[f+C-1]!==0&&($=1),this[f+C]=(u/k>>0)-$&255;return f+b},s.prototype.writeIntBE=function(u,f,b,S){if(u=+u,f=f>>>0,!S){let fe=Math.pow(2,8*b-1);Le(this,u,f,b,fe-1,-fe)}let C=b-1,k=1,$=0;for(this[f+C]=u&255;--C>=0&&(k*=256);)u<0&&$===0&&this[f+C+1]!==0&&($=1),this[f+C]=(u/k>>0)-$&255;return f+b},s.prototype.writeInt8=function(u,f,b){return u=+u,f=f>>>0,b||Le(this,u,f,1,127,-128),u<0&&(u=255+u+1),this[f]=u&255,f+1},s.prototype.writeInt16LE=function(u,f,b){return u=+u,f=f>>>0,b||Le(this,u,f,2,32767,-32768),this[f]=u&255,this[f+1]=u>>>8,f+2},s.prototype.writeInt16BE=function(u,f,b){return u=+u,f=f>>>0,b||Le(this,u,f,2,32767,-32768),this[f]=u>>>8,this[f+1]=u&255,f+2},s.prototype.writeInt32LE=function(u,f,b){return u=+u,f=f>>>0,b||Le(this,u,f,4,2147483647,-2147483648),this[f]=u&255,this[f+1]=u>>>8,this[f+2]=u>>>16,this[f+3]=u>>>24,f+4},s.prototype.writeInt32BE=function(u,f,b){return u=+u,f=f>>>0,b||Le(this,u,f,4,2147483647,-2147483648),u<0&&(u=4294967295+u+1),this[f]=u>>>24,this[f+1]=u>>>16,this[f+2]=u>>>8,this[f+3]=u&255,f+4},s.prototype.writeBigInt64LE=Yt(function(u,f=0){return Sf(this,u,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=Yt(function(u,f=0){return Af(this,u,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Rf(p,u,f,b,S,C){if(f+b>p.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("Index out of range")}function Tf(p,u,f,b,S){return u=+u,f=f>>>0,S||Rf(p,u,f,4),e.write(p,u,f,b,23,4),f+4}s.prototype.writeFloatLE=function(u,f,b){return Tf(this,u,f,!0,b)},s.prototype.writeFloatBE=function(u,f,b){return Tf(this,u,f,!1,b)};function If(p,u,f,b,S){return u=+u,f=f>>>0,S||Rf(p,u,f,8),e.write(p,u,f,b,52,8),f+8}s.prototype.writeDoubleLE=function(u,f,b){return If(this,u,f,!0,b)},s.prototype.writeDoubleBE=function(u,f,b){return If(this,u,f,!1,b)},s.prototype.copy=function(u,f,b,S){if(!s.isBuffer(u))throw new TypeError("argument should be a Buffer");if(b||(b=0),!S&&S!==0&&(S=this.length),f>=u.length&&(f=u.length),f||(f=0),S>0&&S<b&&(S=b),S===b||u.length===0||this.length===0)return 0;if(f<0)throw new RangeError("targetStart out of bounds");if(b<0||b>=this.length)throw new RangeError("Index out of range");if(S<0)throw new RangeError("sourceEnd out of bounds");S>this.length&&(S=this.length),u.length-f<S-b&&(S=u.length-f+b);let C=S-b;return this===u&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(f,b,S):Uint8Array.prototype.set.call(u,this.subarray(b,S),f),C},s.prototype.fill=function(u,f,b,S){if(typeof u=="string"){if(typeof f=="string"?(S=f,f=0,b=this.length):typeof b=="string"&&(S=b,b=this.length),S!==void 0&&typeof S!="string")throw new TypeError("encoding must be a string");if(typeof S=="string"&&!s.isEncoding(S))throw new TypeError("Unknown encoding: "+S);if(u.length===1){let k=u.charCodeAt(0);(S==="utf8"&&k<128||S==="latin1")&&(u=k)}}else typeof u=="number"?u=u&255:typeof u=="boolean"&&(u=Number(u));if(f<0||this.length<f||this.length<b)throw new RangeError("Out of range index");if(b<=f)return this;f=f>>>0,b=b===void 0?this.length:b>>>0,u||(u=0);let C;if(typeof u=="number")for(C=f;C<b;++C)this[C]=u;else{let k=s.isBuffer(u)?u:s.from(u,S),$=k.length;if($===0)throw new TypeError('The value "'+u+'" is invalid for argument "value"');for(C=0;C<b-f;++C)this[C+f]=k[C%$]}return this};let ni={};function ko(p,u,f){ni[p]=class extends f{constructor(){super(),Object.defineProperty(this,"message",{value:u.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${p}]`,this.stack,delete this.name}get code(){return p}set code(S){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:S,writable:!0})}toString(){return`${this.name} [${p}]: ${this.message}`}}}ko("ERR_BUFFER_OUT_OF_BOUNDS",function(p){return p?`${p} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ko("ERR_INVALID_ARG_TYPE",function(p,u){return`The "${p}" argument must be of type number. Received type ${typeof u}`},TypeError),ko("ERR_OUT_OF_RANGE",function(p,u,f){let b=`The value of "${p}" is out of range.`,S=f;return Number.isInteger(f)&&Math.abs(f)>2**32?S=Cf(String(f)):typeof f=="bigint"&&(S=String(f),(f>BigInt(2)**BigInt(32)||f<-(BigInt(2)**BigInt(32)))&&(S=Cf(S)),S+="n"),b+=` It must be ${u}. Received ${S}`,b},RangeError);function Cf(p){let u="",f=p.length,b=p[0]==="-"?1:0;for(;f>=b+4;f-=3)u=`_${p.slice(f-3,f)}${u}`;return`${p.slice(0,f)}${u}`}function w_(p,u,f){si(u,"offset"),(p[u]===void 0||p[u+f]===void 0)&&qi(u,p.length-(f+1))}function Pf(p,u,f,b,S,C){if(p>f||p<u){let k=typeof u=="bigint"?"n":"",$;throw C>3?u===0||u===BigInt(0)?$=`>= 0${k} and < 2${k} ** ${(C+1)*8}${k}`:$=`>= -(2${k} ** ${(C+1)*8-1}${k}) and < 2 ** ${(C+1)*8-1}${k}`:$=`>= ${u}${k} and <= ${f}${k}`,new ni.ERR_OUT_OF_RANGE("value",$,p)}w_(b,S,C)}function si(p,u){if(typeof p!="number")throw new ni.ERR_INVALID_ARG_TYPE(u,"number",p)}function qi(p,u,f){throw Math.floor(p)!==p?(si(p,f),new ni.ERR_OUT_OF_RANGE(f||"offset","an integer",p)):u<0?new ni.ERR_BUFFER_OUT_OF_BOUNDS:new ni.ERR_OUT_OF_RANGE(f||"offset",`>= ${f?1:0} and <= ${u}`,p)}let __=/[^+/0-9A-Za-z-_]/g;function m_(p){if(p=p.split("=")[0],p=p.trim().replace(__,""),p.length<2)return"";for(;p.length%4!==0;)p=p+"=";return p}function Mo(p,u){u=u||1/0;let f,b=p.length,S=null,C=[];for(let k=0;k<b;++k){if(f=p.charCodeAt(k),f>55295&&f<57344){if(!S){if(f>56319){(u-=3)>-1&&C.push(239,191,189);continue}else if(k+1===b){(u-=3)>-1&&C.push(239,191,189);continue}S=f;continue}if(f<56320){(u-=3)>-1&&C.push(239,191,189),S=f;continue}f=(S-55296<<10|f-56320)+65536}else S&&(u-=3)>-1&&C.push(239,191,189);if(S=null,f<128){if((u-=1)<0)break;C.push(f)}else if(f<2048){if((u-=2)<0)break;C.push(f>>6|192,f&63|128)}else if(f<65536){if((u-=3)<0)break;C.push(f>>12|224,f>>6&63|128,f&63|128)}else if(f<1114112){if((u-=4)<0)break;C.push(f>>18|240,f>>12&63|128,f>>6&63|128,f&63|128)}else throw new Error("Invalid code point")}return C}function v_(p){let u=[];for(let f=0;f<p.length;++f)u.push(p.charCodeAt(f)&255);return u}function E_(p,u){let f,b,S,C=[];for(let k=0;k<p.length&&!((u-=2)<0);++k)f=p.charCodeAt(k),b=f>>8,S=f%256,C.push(S),C.push(b);return C}function Bf(p){return t.toByteArray(m_(p))}function On(p,u,f,b){let S;for(S=0;S<b&&!(S+f>=u.length||S>=p.length);++S)u[S+f]=p[S];return S}function lt(p,u){return p instanceof u||p!=null&&p.constructor!=null&&p.constructor.name!=null&&p.constructor.name===u.name}function Lo(p){return p!==p}let S_=function(){let p="0123456789abcdef",u=new Array(256);for(let f=0;f<16;++f){let b=f*16;for(let S=0;S<16;++S)u[b+S]=p[f]+p[S]}return u}();function Yt(p){return typeof BigInt>"u"?A_:p}function A_(){throw new Error("BigInt not supported")}return br}var ji,Gc,Ln,Kc,br,Yc,Xt,B,k_,M_,de=we(()=>{w();m();_();ji={},Gc=!1;Ln={},Kc=!1;br={},Yc=!1;Xt=x_();Xt.Buffer;Xt.SlowBuffer;Xt.INSPECT_MAX_BYTES;Xt.kMaxLength;B=Xt.Buffer,k_=Xt.INSPECT_MAX_BYTES,M_=Xt.kMaxLength});var m=we(()=>{de()});var Qc=M(Fo=>{"use strict";w();m();_();Object.defineProperty(Fo,"__esModule",{value:!0});var jo=class{constructor(e){this.aliasToTopic={},this.max=e}put(e,r){return r===0||r>this.max?!1:(this.aliasToTopic[r]=e,this.length=Object.keys(this.aliasToTopic).length,!0)}getTopicByAlias(e){return this.aliasToTopic[e]}clear(){this.aliasToTopic={}}};Fo.default=jo});var me=M((oB,Jc)=>{"use strict";w();m();_();Jc.exports={ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,e){return t.includes(e)},ArrayPrototypeIndexOf(t,e){return t.indexOf(e)},ArrayPrototypeJoin(t,e){return t.join(e)},ArrayPrototypeMap(t,e){return t.map(e)},ArrayPrototypePop(t,e){return t.pop(e)},ArrayPrototypePush(t,e){return t.push(e)},ArrayPrototypeSlice(t,e,r){return t.slice(e,r)},Error,FunctionPrototypeCall(t,e,...r){return t.call(e,...r)},FunctionPrototypeSymbolHasInstance(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},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(t,e){return Object.defineProperties(t,e)},ObjectDefineProperty(t,e,r){return Object.defineProperty(t,e,r)},ObjectGetOwnPropertyDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,e){return Object.setPrototypeOf(t,e)},Promise,PromisePrototypeCatch(t,e){return t.catch(e)},PromisePrototypeThen(t,e,r){return t.then(e,r)},PromiseReject(t){return Promise.reject(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,e){return t.test(e)},SafeSet:Set,String,StringPrototypeSlice(t,e,r){return t.slice(e,r)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,TypedArrayPrototypeSet(t,e,r){return t.set(e,r)},Uint8Array}});var ut=M((dB,$o)=>{"use strict";w();m();_();var L_=(de(),K(_e)),U_=Object.getPrototypeOf(async function(){}).constructor,Xc=globalThis.Blob||L_.Blob,N_=typeof Xc<"u"?function(e){return e instanceof Xc}:function(e){return!1},Wo=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let r="";for(let i=0;i<e.length;i++)r+=` ${e[i].stack}
|
|
2
|
+
`;super(r),this.name="AggregateError",this.errors=e}};$o.exports={AggregateError:Wo,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...r){e||(e=!0,t.apply(this,r))}},createDeferredPromise:function(){let t,e;return{promise:new Promise((i,n)=>{t=i,e=n}),resolve:t,reject:e}},promisify(t){return new Promise((e,r)=>{t((i,...n)=>i?r(i):e(...n))})},debuglog(){return function(){}},format(t,...e){return t.replace(/%([sdifj])/g,function(...[r,i]){let n=e.shift();return i==="f"?n.toFixed(6):i==="j"?JSON.stringify(n):i==="s"&&typeof n=="object"?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()})},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}},types:{isAsyncFunction(t){return t instanceof U_},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:N_};$o.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var Nn=M((mB,Un)=>{"use strict";w();m();_();var{AbortController:Zc,AbortSignal:D_}=typeof self<"u"?self:typeof window<"u"?window:void 0;Un.exports=Zc;Un.exports.AbortSignal=D_;Un.exports.default=Zc});var Be=M((IB,rh)=>{"use strict";w();m();_();var{format:q_,inspect:Dn,AggregateError:j_}=ut(),F_=globalThis.AggregateError||j_,W_=Symbol("kIsNodeError"),$_=["string","function","number","object","Function","Object","boolean","bigint","symbol"],H_=/^([A-Z][a-z0-9]*)+$/,V_="__node_internal_",qn={};function wr(t,e){if(!t)throw new qn.ERR_INTERNAL_ASSERTION(e)}function eh(t){let e="",r=t.length,i=t[0]==="-"?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function z_(t,e,r){if(typeof e=="function")return wr(e.length<=r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${e.length}).`),e(...r);let i=(e.match(/%[dfijoOs]/g)||[]).length;return wr(i===r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${i}).`),r.length===0?e:q_(e,...r)}function Ae(t,e,r){r||(r=Error);class i extends r{constructor(...o){super(z_(t,e,o))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(i.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=t,i.prototype[W_]=!0,qn[t]=i}function th(t){let e=V_+t.name;return Object.defineProperty(t,"name",{value:e}),t}function G_(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let r=new F_([e,t],e.message);return r.code=e.code,r}return t||e}var Ho=class extends Error{constructor(e="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new qn.ERR_INVALID_ARG_TYPE("options","Object",r);super(e,r),this.code="ABORT_ERR",this.name="AbortError"}};Ae("ERR_ASSERTION","%s",Error);Ae("ERR_INVALID_ARG_TYPE",(t,e,r)=>{wr(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let i="The ";t.endsWith(" argument")?i+=`${t} `:i+=`"${t}" ${t.includes(".")?"property":"argument"} `,i+="must be ";let n=[],o=[],s=[];for(let l of e)wr(typeof l=="string","All expected entries have to be of type string"),$_.includes(l)?n.push(l.toLowerCase()):H_.test(l)?o.push(l):(wr(l!=="object",'The value "object" should be written as "Object"'),s.push(l));if(o.length>0){let l=n.indexOf("object");l!==-1&&(n.splice(n,l,1),o.push("Object"))}if(n.length>0){switch(n.length){case 1:i+=`of type ${n[0]}`;break;case 2:i+=`one of type ${n[0]} or ${n[1]}`;break;default:{let l=n.pop();i+=`one of type ${n.join(", ")}, or ${l}`}}(o.length>0||s.length>0)&&(i+=" or ")}if(o.length>0){switch(o.length){case 1:i+=`an instance of ${o[0]}`;break;case 2:i+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let l=o.pop();i+=`an instance of ${o.join(", ")}, or ${l}`}}s.length>0&&(i+=" or ")}switch(s.length){case 0:break;case 1:s[0].toLowerCase()!==s[0]&&(i+="an "),i+=`${s[0]}`;break;case 2:i+=`one of ${s[0]} or ${s[1]}`;break;default:{let l=s.pop();i+=`one of ${s.join(", ")}, or ${l}`}}if(r==null)i+=`. Received ${r}`;else if(typeof r=="function"&&r.name)i+=`. Received function ${r.name}`;else if(typeof r=="object"){var a;if((a=r.constructor)!==null&&a!==void 0&&a.name)i+=`. Received an instance of ${r.constructor.name}`;else{let l=Dn(r,{depth:-1});i+=`. Received ${l}`}}else{let l=Dn(r,{colors:!1});l.length>25&&(l=`${l.slice(0,25)}...`),i+=`. Received type ${typeof r} (${l})`}return i},TypeError);Ae("ERR_INVALID_ARG_VALUE",(t,e,r="is invalid")=>{let i=Dn(e);return i.length>128&&(i=i.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${r}. Received ${i}`},TypeError);Ae("ERR_INVALID_RETURN_VALUE",(t,e,r)=>{var i;let n=r!=null&&(i=r.constructor)!==null&&i!==void 0&&i.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${t} to be returned from the "${e}" function but got ${n}.`},TypeError);Ae("ERR_MISSING_ARGS",(...t)=>{wr(t.length>0,"At least one arg needs to be specified");let e,r=t.length;switch(t=(Array.isArray(t)?t:[t]).map(i=>`"${i}"`).join(" or "),r){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let i=t.pop();e+=`The ${t.join(", ")}, and ${i} arguments`}break}return`${e} must be specified`},TypeError);Ae("ERR_OUT_OF_RANGE",(t,e,r)=>{wr(e,'Missing "range" argument');let i;return Number.isInteger(r)&&Math.abs(r)>2**32?i=eh(String(r)):typeof r=="bigint"?(i=String(r),(r>2n**32n||r<-(2n**32n))&&(i=eh(i)),i+="n"):i=Dn(r),`The value of "${t}" is out of range. It must be ${e}. Received ${i}`},RangeError);Ae("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);Ae("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);Ae("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);Ae("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);Ae("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);Ae("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Ae("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);Ae("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);Ae("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);Ae("ERR_STREAM_WRITE_AFTER_END","write after end",Error);Ae("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);rh.exports={AbortError:Ho,aggregateTwoErrors:th(G_),hideStackFrames:th,codes:qn}});var Fi=M((MB,ch)=>{"use strict";w();m();_();var{ArrayIsArray:zo,ArrayPrototypeIncludes:oh,ArrayPrototypeJoin:ah,ArrayPrototypeMap:K_,NumberIsInteger:Go,NumberIsNaN:Y_,NumberMAX_SAFE_INTEGER:Q_,NumberMIN_SAFE_INTEGER:J_,NumberParseInt:X_,ObjectPrototypeHasOwnProperty:Z_,RegExpPrototypeExec:lh,String:e0,StringPrototypeToUpperCase:t0,StringPrototypeTrim:r0}=me(),{hideStackFrames:Ve,codes:{ERR_SOCKET_BAD_PORT:i0,ERR_INVALID_ARG_TYPE:Oe,ERR_INVALID_ARG_VALUE:ai,ERR_OUT_OF_RANGE:_r,ERR_UNKNOWN_SIGNAL:ih}}=Be(),{normalizeEncoding:n0}=ut(),{isAsyncFunction:s0,isArrayBufferView:o0}=ut().types,nh={};function a0(t){return t===(t|0)}function l0(t){return t===t>>>0}var u0=/^[0-7]+$/,f0="must be a 32-bit unsigned integer or an octal string";function c0(t,e,r){if(typeof t>"u"&&(t=r),typeof t=="string"){if(lh(u0,t)===null)throw new ai(e,t,f0);t=X_(t,8)}return uh(t,e),t}var h0=Ve((t,e,r=J_,i=Q_)=>{if(typeof t!="number")throw new Oe(e,"number",t);if(!Go(t))throw new _r(e,"an integer",t);if(t<r||t>i)throw new _r(e,`>= ${r} && <= ${i}`,t)}),d0=Ve((t,e,r=-2147483648,i=2147483647)=>{if(typeof t!="number")throw new Oe(e,"number",t);if(!Go(t))throw new _r(e,"an integer",t);if(t<r||t>i)throw new _r(e,`>= ${r} && <= ${i}`,t)}),uh=Ve((t,e,r=!1)=>{if(typeof t!="number")throw new Oe(e,"number",t);if(!Go(t))throw new _r(e,"an integer",t);let i=r?1:0,n=4294967295;if(t<i||t>n)throw new _r(e,`>= ${i} && <= ${n}`,t)});function Ko(t,e){if(typeof t!="string")throw new Oe(e,"string",t)}function p0(t,e,r=void 0,i){if(typeof t!="number")throw new Oe(e,"number",t);if(r!=null&&t<r||i!=null&&t>i||(r!=null||i!=null)&&Y_(t))throw new _r(e,`${r!=null?`>= ${r}`:""}${r!=null&&i!=null?" && ":""}${i!=null?`<= ${i}`:""}`,t)}var g0=Ve((t,e,r)=>{if(!oh(r,t)){let n="must be one of: "+ah(K_(r,o=>typeof o=="string"?`'${o}'`:e0(o)),", ");throw new ai(e,t,n)}});function fh(t,e){if(typeof t!="boolean")throw new Oe(e,"boolean",t)}function Vo(t,e,r){return t==null||!Z_(t,e)?r:t[e]}var y0=Ve((t,e,r=null)=>{let i=Vo(r,"allowArray",!1),n=Vo(r,"allowFunction",!1);if(!Vo(r,"nullable",!1)&&t===null||!i&&zo(t)||typeof t!="object"&&(!n||typeof t!="function"))throw new Oe(e,"Object",t)}),b0=Ve((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new Oe(e,"a dictionary",t)}),Yo=Ve((t,e,r=0)=>{if(!zo(t))throw new Oe(e,"Array",t);if(t.length<r){let i=`must be longer than ${r}`;throw new ai(e,t,i)}});function w0(t,e){Yo(t,e);for(let r=0;r<t.length;r++)Ko(t[r],`${e}[${r}]`)}function _0(t,e){Yo(t,e);for(let r=0;r<t.length;r++)fh(t[r],`${e}[${r}]`)}function m0(t,e="signal"){if(Ko(t,e),nh[t]===void 0)throw nh[t0(t)]!==void 0?new ih(t+" (signals must use all capital letters)"):new ih(t)}var v0=Ve((t,e="buffer")=>{if(!o0(t))throw new Oe(e,["Buffer","TypedArray","DataView"],t)});function E0(t,e){let r=n0(e),i=t.length;if(r==="hex"&&i%2!==0)throw new ai("encoding",e,`is invalid for data of length ${i}`)}function S0(t,e="Port",r=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&r0(t).length===0||+t!==+t>>>0||t>65535||t===0&&!r)throw new i0(e,t,r);return t|0}var A0=Ve((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new Oe(e,"AbortSignal",t)}),R0=Ve((t,e)=>{if(typeof t!="function")throw new Oe(e,"Function",t)}),T0=Ve((t,e)=>{if(typeof t!="function"||s0(t))throw new Oe(e,"Function",t)}),I0=Ve((t,e)=>{if(t!==void 0)throw new Oe(e,"undefined",t)});function C0(t,e,r){if(!oh(r,t))throw new Oe(e,`('${ah(r,"|")}')`,t)}var P0=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function sh(t,e){if(typeof t>"u"||!lh(P0,t))throw new ai(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function B0(t){if(typeof t=="string")return sh(t,"hints"),t;if(zo(t)){let e=t.length,r="";if(e===0)return r;for(let i=0;i<e;i++){let n=t[i];sh(n,"hints"),r+=n,i!==e-1&&(r+=", ")}return r}throw new ai("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}ch.exports={isInt32:a0,isUint32:l0,parseFileMode:c0,validateArray:Yo,validateStringArray:w0,validateBooleanArray:_0,validateBoolean:fh,validateBuffer:v0,validateDictionary:b0,validateEncoding:E0,validateFunction:R0,validateInt32:d0,validateInteger:h0,validateNumber:p0,validateObject:y0,validateOneOf:g0,validatePlainFunction:T0,validatePort:S0,validateSignalName:m0,validateString:Ko,validateUint32:uh,validateUndefined:I0,validateUnion:C0,validateAbortSignal:A0,validateLinkHeaderValue:B0}});var Zt=M((FB,gh)=>{w();m();_();var pe=gh.exports={},ft,ct;function Qo(){throw new Error("setTimeout has not been defined")}function Jo(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?ft=setTimeout:ft=Qo}catch{ft=Qo}try{typeof clearTimeout=="function"?ct=clearTimeout:ct=Jo}catch{ct=Jo}})();function hh(t){if(ft===setTimeout)return setTimeout(t,0);if((ft===Qo||!ft)&&setTimeout)return ft=setTimeout,setTimeout(t,0);try{return ft(t,0)}catch{try{return ft.call(null,t,0)}catch{return ft.call(this,t,0)}}}function O0(t){if(ct===clearTimeout)return clearTimeout(t);if((ct===Jo||!ct)&&clearTimeout)return ct=clearTimeout,clearTimeout(t);try{return ct(t)}catch{try{return ct.call(null,t)}catch{return ct.call(this,t)}}}var xt=[],li=!1,mr,jn=-1;function x0(){!li||!mr||(li=!1,mr.length?xt=mr.concat(xt):jn=-1,xt.length&&dh())}function dh(){if(!li){var t=hh(x0);li=!0;for(var e=xt.length;e;){for(mr=xt,xt=[];++jn<e;)mr&&mr[jn].run();jn=-1,e=xt.length}mr=null,li=!1,O0(t)}}pe.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];xt.push(new ph(t,e)),xt.length===1&&!li&&hh(dh)};function ph(t,e){this.fun=t,this.array=e}ph.prototype.run=function(){this.fun.apply(null,this.array)};pe.title="browser";pe.browser=!0;pe.env={};pe.argv=[];pe.version="";pe.versions={};function kt(){}pe.on=kt;pe.addListener=kt;pe.once=kt;pe.off=kt;pe.removeListener=kt;pe.removeAllListeners=kt;pe.emit=kt;pe.prependListener=kt;pe.prependOnceListener=kt;pe.listeners=function(t){return[]};pe.binding=function(t){throw new Error("process.binding is not supported")};pe.cwd=function(){return"/"};pe.chdir=function(t){throw new Error("process.chdir is not supported")};pe.umask=function(){return 0}});var dt=M((KB,Oh)=>{"use strict";w();m();_();var{Symbol:Fn,SymbolAsyncIterator:yh,SymbolIterator:bh,SymbolFor:wh}=me(),_h=Fn("kDestroyed"),mh=Fn("kIsErrored"),Xo=Fn("kIsReadable"),vh=Fn("kIsDisturbed"),k0=wh("nodejs.webstream.isClosedPromise"),M0=wh("nodejs.webstream.controllerErrorFunction");function Wn(t,e=!1){var r;return!!(t&&typeof t.pipe=="function"&&typeof t.on=="function"&&(!e||typeof t.pause=="function"&&typeof t.resume=="function")&&(!t._writableState||((r=t._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!t._writableState||t._readableState))}function $n(t){var e;return!!(t&&typeof t.write=="function"&&typeof t.on=="function"&&(!t._readableState||((e=t._writableState)===null||e===void 0?void 0:e.writable)!==!1))}function L0(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}function ht(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}function Eh(t){return!!(t&&!ht(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}function Sh(t){return!!(t&&!ht(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}function Ah(t){return!!(t&&!ht(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}function U0(t){return Eh(t)||Sh(t)||Ah(t)}function N0(t,e){return t==null?!1:e===!0?typeof t[yh]=="function":e===!1?typeof t[bh]=="function":typeof t[yh]=="function"||typeof t[bh]=="function"}function Hn(t){if(!ht(t))return null;let e=t._writableState,r=t._readableState,i=e||r;return!!(t.destroyed||t[_h]||i!=null&&i.destroyed)}function Rh(t){if(!$n(t))return null;if(t.writableEnded===!0)return!0;let e=t._writableState;return e!=null&&e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}function D0(t,e){if(!$n(t))return null;if(t.writableFinished===!0)return!0;let r=t._writableState;return r!=null&&r.errored?!1:typeof r?.finished!="boolean"?null:!!(r.finished||e===!1&&r.ended===!0&&r.length===0)}function q0(t){if(!Wn(t))return null;if(t.readableEnded===!0)return!0;let e=t._readableState;return!e||e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}function Th(t,e){if(!Wn(t))return null;let r=t._readableState;return r!=null&&r.errored?!1:typeof r?.endEmitted!="boolean"?null:!!(r.endEmitted||e===!1&&r.ended===!0&&r.length===0)}function Ih(t){return t&&t[Xo]!=null?t[Xo]:typeof t?.readable!="boolean"?null:Hn(t)?!1:Wn(t)&&t.readable&&!Th(t)}function Ch(t){return typeof t?.writable!="boolean"?null:Hn(t)?!1:$n(t)&&t.writable&&!Rh(t)}function j0(t,e){return ht(t)?Hn(t)?!0:!(e?.readable!==!1&&Ih(t)||e?.writable!==!1&&Ch(t)):null}function F0(t){var e,r;return ht(t)?t.writableErrored?t.writableErrored:(e=(r=t._writableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function W0(t){var e,r;return ht(t)?t.readableErrored?t.readableErrored:(e=(r=t._readableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function $0(t){if(!ht(t))return null;if(typeof t.closed=="boolean")return t.closed;let e=t._writableState,r=t._readableState;return typeof e?.closed=="boolean"||typeof r?.closed=="boolean"?e?.closed||r?.closed:typeof t._closed=="boolean"&&Ph(t)?t._closed:null}function Ph(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}function Bh(t){return typeof t._sent100=="boolean"&&Ph(t)}function H0(t){var e;return typeof t._consuming=="boolean"&&typeof t._dumped=="boolean"&&((e=t.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}function V0(t){if(!ht(t))return null;let e=t._writableState,r=t._readableState,i=e||r;return!i&&Bh(t)||!!(i&&i.autoDestroy&&i.emitClose&&i.closed===!1)}function z0(t){var e;return!!(t&&((e=t[vh])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}function G0(t){var e,r,i,n,o,s,a,l,c,h;return!!(t&&((e=(r=(i=(n=(o=(s=t[mh])!==null&&s!==void 0?s:t.readableErrored)!==null&&o!==void 0?o:t.writableErrored)!==null&&n!==void 0?n:(a=t._readableState)===null||a===void 0?void 0:a.errorEmitted)!==null&&i!==void 0?i:(l=t._writableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&r!==void 0?r:(c=t._readableState)===null||c===void 0?void 0:c.errored)!==null&&e!==void 0?e:!((h=t._writableState)===null||h===void 0)&&h.errored))}Oh.exports={kDestroyed:_h,isDisturbed:z0,kIsDisturbed:vh,isErrored:G0,kIsErrored:mh,isReadable:Ih,kIsReadable:Xo,kIsClosedPromise:k0,kControllerErrorFunction:M0,isClosed:$0,isDestroyed:Hn,isDuplexNodeStream:L0,isFinished:j0,isIterable:N0,isReadableNodeStream:Wn,isReadableStream:Eh,isReadableEnded:q0,isReadableFinished:Th,isReadableErrored:W0,isNodeStream:ht,isWebStream:U0,isWritable:Ch,isWritableNodeStream:$n,isWritableStream:Sh,isWritableEnded:Rh,isWritableFinished:D0,isWritableErrored:F0,isServerRequest:H0,isServerResponse:Bh,willEmitClose:V0,isTransformStream:Ah}});var Mt=M((tO,ia)=>{w();m();_();var er=Zt(),{AbortError:jh,codes:K0}=Be(),{ERR_INVALID_ARG_TYPE:Y0,ERR_STREAM_PREMATURE_CLOSE:xh}=K0,{kEmptyObject:ea,once:ta}=ut(),{validateAbortSignal:Q0,validateFunction:J0,validateObject:X0,validateBoolean:Z0}=Fi(),{Promise:em,PromisePrototypeThen:tm}=me(),{isClosed:rm,isReadable:kh,isReadableNodeStream:Zo,isReadableStream:im,isReadableFinished:Mh,isReadableErrored:Lh,isWritable:Uh,isWritableNodeStream:Nh,isWritableStream:nm,isWritableFinished:Dh,isWritableErrored:qh,isNodeStream:sm,willEmitClose:om,kIsClosedPromise:am}=dt();function lm(t){return t.setHeader&&typeof t.abort=="function"}var ra=()=>{};function Fh(t,e,r){var i,n;if(arguments.length===2?(r=e,e=ea):e==null?e=ea:X0(e,"options"),J0(r,"callback"),Q0(e.signal,"options.signal"),r=ta(r),im(t)||nm(t))return um(t,e,r);if(!sm(t))throw new Y0("stream",["ReadableStream","WritableStream","Stream"],t);let o=(i=e.readable)!==null&&i!==void 0?i:Zo(t),s=(n=e.writable)!==null&&n!==void 0?n:Nh(t),a=t._writableState,l=t._readableState,c=()=>{t.writable||g()},h=om(t)&&Zo(t)===o&&Nh(t)===s,d=Dh(t,!1),g=()=>{d=!0,t.destroyed&&(h=!1),!(h&&(!t.readable||o))&&(!o||y)&&r.call(t)},y=Mh(t,!1),v=()=>{y=!0,t.destroyed&&(h=!1),!(h&&(!t.writable||s))&&(!s||d)&&r.call(t)},E=D=>{r.call(t,D)},A=rm(t),T=()=>{A=!0;let D=qh(t)||Lh(t);if(D&&typeof D!="boolean")return r.call(t,D);if(o&&!y&&Zo(t,!0)&&!Mh(t,!1))return r.call(t,new xh);if(s&&!d&&!Dh(t,!1))return r.call(t,new xh);r.call(t)},O=()=>{A=!0;let D=qh(t)||Lh(t);if(D&&typeof D!="boolean")return r.call(t,D);r.call(t)},I=()=>{t.req.on("finish",g)};lm(t)?(t.on("complete",g),h||t.on("abort",T),t.req?I():t.on("request",I)):s&&!a&&(t.on("end",c),t.on("close",c)),!h&&typeof t.aborted=="boolean"&&t.on("aborted",T),t.on("end",v),t.on("finish",g),e.error!==!1&&t.on("error",E),t.on("close",T),A?er.nextTick(T):a!=null&&a.errorEmitted||l!=null&&l.errorEmitted?h||er.nextTick(O):(!o&&(!h||kh(t))&&(d||Uh(t)===!1)||!s&&(!h||Uh(t))&&(y||kh(t)===!1)||l&&t.req&&t.aborted)&&er.nextTick(O);let N=()=>{r=ra,t.removeListener("aborted",T),t.removeListener("complete",g),t.removeListener("abort",T),t.removeListener("request",I),t.req&&t.req.removeListener("finish",g),t.removeListener("end",c),t.removeListener("close",c),t.removeListener("finish",g),t.removeListener("end",v),t.removeListener("error",E),t.removeListener("close",T)};if(e.signal&&!A){let D=()=>{let Y=r;N(),Y.call(t,new jh(void 0,{cause:e.signal.reason}))};if(e.signal.aborted)er.nextTick(D);else{let Y=r;r=ta((...Z)=>{e.signal.removeEventListener("abort",D),Y.apply(t,Z)}),e.signal.addEventListener("abort",D)}}return N}function um(t,e,r){let i=!1,n=ra;if(e.signal)if(n=()=>{i=!0,r.call(t,new jh(void 0,{cause:e.signal.reason}))},e.signal.aborted)er.nextTick(n);else{let s=r;r=ta((...a)=>{e.signal.removeEventListener("abort",n),s.apply(t,a)}),e.signal.addEventListener("abort",n)}let o=(...s)=>{i||er.nextTick(()=>r.apply(t,s))};return tm(t[am].promise,o,o),ra}function fm(t,e){var r;let i=!1;return e===null&&(e=ea),(r=e)!==null&&r!==void 0&&r.cleanup&&(Z0(e.cleanup,"cleanup"),i=e.cleanup),new em((n,o)=>{let s=Fh(t,e,a=>{i&&s(),a?o(a):n()})})}ia.exports=Fh;ia.exports.finished=fm});var vr=M((lO,Yh)=>{"use strict";w();m();_();var pt=Zt(),{aggregateTwoErrors:cm,codes:{ERR_MULTIPLE_CALLBACK:hm},AbortError:dm}=Be(),{Symbol:Hh}=me(),{kDestroyed:pm,isDestroyed:gm,isFinished:ym,isServerRequest:bm}=dt(),Vh=Hh("kDestroy"),na=Hh("kConstruct");function zh(t,e,r){t&&(t.stack,e&&!e.errored&&(e.errored=t),r&&!r.errored&&(r.errored=t))}function wm(t,e){let r=this._readableState,i=this._writableState,n=i||r;return i!=null&&i.destroyed||r!=null&&r.destroyed?(typeof e=="function"&&e(),this):(zh(t,i,r),i&&(i.destroyed=!0),r&&(r.destroyed=!0),n.constructed?Wh(this,t,e):this.once(Vh,function(o){Wh(this,cm(o,t),e)}),this)}function Wh(t,e,r){let i=!1;function n(o){if(i)return;i=!0;let s=t._readableState,a=t._writableState;zh(o,a,s),a&&(a.closed=!0),s&&(s.closed=!0),typeof r=="function"&&r(o),o?pt.nextTick(_m,t,o):pt.nextTick(Gh,t)}try{t._destroy(e||null,n)}catch(o){n(o)}}function _m(t,e){sa(t,e),Gh(t)}function Gh(t){let e=t._readableState,r=t._writableState;r&&(r.closeEmitted=!0),e&&(e.closeEmitted=!0),(r!=null&&r.emitClose||e!=null&&e.emitClose)&&t.emit("close")}function sa(t,e){let r=t._readableState,i=t._writableState;i!=null&&i.errorEmitted||r!=null&&r.errorEmitted||(i&&(i.errorEmitted=!0),r&&(r.errorEmitted=!0),t.emit("error",e))}function mm(){let t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=t.readable===!1,t.endEmitted=t.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1)}function oa(t,e,r){let i=t._readableState,n=t._writableState;if(n!=null&&n.destroyed||i!=null&&i.destroyed)return this;i!=null&&i.autoDestroy||n!=null&&n.autoDestroy?t.destroy(e):e&&(e.stack,n&&!n.errored&&(n.errored=e),i&&!i.errored&&(i.errored=e),r?pt.nextTick(sa,t,e):sa(t,e))}function vm(t,e){if(typeof t._construct!="function")return;let r=t._readableState,i=t._writableState;r&&(r.constructed=!1),i&&(i.constructed=!1),t.once(na,e),!(t.listenerCount(na)>1)&&pt.nextTick(Em,t)}function Em(t){let e=!1;function r(i){if(e){oa(t,i??new hm);return}e=!0;let n=t._readableState,o=t._writableState,s=o||n;n&&(n.constructed=!0),o&&(o.constructed=!0),s.destroyed?t.emit(Vh,i):i?oa(t,i,!0):pt.nextTick(Sm,t)}try{t._construct(i=>{pt.nextTick(r,i)})}catch(i){pt.nextTick(r,i)}}function Sm(t){t.emit(na)}function $h(t){return t?.setHeader&&typeof t.abort=="function"}function Kh(t){t.emit("close")}function Am(t,e){t.emit("error",e),pt.nextTick(Kh,t)}function Rm(t,e){!t||gm(t)||(!e&&!ym(t)&&(e=new dm),bm(t)?(t.socket=null,t.destroy(e)):$h(t)?t.abort():$h(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?pt.nextTick(Am,t,e):pt.nextTick(Kh,t),t.destroyed||(t[pm]=!0))}Yh.exports={construct:vm,destroyer:Rm,destroy:wm,undestroy:mm,errorOrDestroy:oa}});function ee(){ee.init.call(this)}function Vn(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function sd(t){return t._maxListeners===void 0?ee.defaultMaxListeners:t._maxListeners}function Zh(t,e,r,i){var n,o,s,a;if(Vn(r),(o=t._events)===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),s===void 0)s=o[e]=r,++t._eventsCount;else if(typeof s=="function"?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),(n=sd(t))>0&&s.length>n&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,a=l,console&&console.warn&&console.warn(a)}return t}function Tm(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function ed(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=Tm.bind(i);return n.listener=r,i.wrapFn=n,n}function td(t,e,r){var i=t._events;if(i===void 0)return[];var n=i[e];return n===void 0?[]:typeof n=="function"?r?[n.listener||n]:[n]:r?function(o){for(var s=new Array(o.length),a=0;a<s.length;++a)s[a]=o[a].listener||o[a];return s}(n):od(n,n.length)}function rd(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}function od(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}var id,nd,ui,Qh,Jh,Xh,Ue,aa=we(()=>{w();m();_();ui=typeof Reflect=="object"?Reflect:null,Qh=ui&&typeof ui.apply=="function"?ui.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};nd=ui&&typeof ui.ownKeys=="function"?ui.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};Jh=Number.isNaN||function(t){return t!=t};id=ee,ee.EventEmitter=ee,ee.prototype._events=void 0,ee.prototype._eventsCount=0,ee.prototype._maxListeners=void 0;Xh=10;Object.defineProperty(ee,"defaultMaxListeners",{enumerable:!0,get:function(){return Xh},set:function(t){if(typeof t!="number"||t<0||Jh(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Xh=t}}),ee.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},ee.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||Jh(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},ee.prototype.getMaxListeners=function(){return sd(this)},ee.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var i=t==="error",n=this._events;if(n!==void 0)i=i&&n.error===void 0;else if(!i)return!1;if(i){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var a=n[t];if(a===void 0)return!1;if(typeof a=="function")Qh(a,this,e);else{var l=a.length,c=od(a,l);for(r=0;r<l;++r)Qh(c[r],this,e)}return!0},ee.prototype.addListener=function(t,e){return Zh(this,t,e,!1)},ee.prototype.on=ee.prototype.addListener,ee.prototype.prependListener=function(t,e){return Zh(this,t,e,!0)},ee.prototype.once=function(t,e){return Vn(e),this.on(t,ed(this,t,e)),this},ee.prototype.prependOnceListener=function(t,e){return Vn(e),this.prependListener(t,ed(this,t,e)),this},ee.prototype.removeListener=function(t,e){var r,i,n,o,s;if(Vn(e),(i=this._events)===void 0)return this;if((r=i[t])===void 0)return this;if(r===e||r.listener===e)--this._eventsCount==0?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||e));else if(typeof r!="function"){for(n=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,n=o;break}if(n<0)return this;n===0?r.shift():function(a,l){for(;l+1<a.length;l++)a[l]=a[l+1];a.pop()}(r,n),r.length===1&&(i[t]=r[0]),i.removeListener!==void 0&&this.emit("removeListener",t,s||e)}return this},ee.prototype.off=ee.prototype.removeListener,ee.prototype.removeAllListeners=function(t){var e,r,i;if((r=this._events)===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete r[t]),this;if(arguments.length===0){var n,o=Object.keys(r);for(i=0;i<o.length;++i)(n=o[i])!=="removeListener"&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(e=r[t])=="function")this.removeListener(t,e);else if(e!==void 0)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this},ee.prototype.listeners=function(t){return td(this,t,!0)},ee.prototype.rawListeners=function(t){return td(this,t,!1)},ee.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):rd.call(t,e)},ee.prototype.listenerCount=rd,ee.prototype.eventNames=function(){return this._eventsCount>0?nd(this._events):[]};Ue=id;Ue.EventEmitter;Ue.defaultMaxListeners;Ue.init;Ue.listenerCount;Ue.EventEmitter;Ue.defaultMaxListeners;Ue.init;Ue.listenerCount});var Lt={};Qt(Lt,{EventEmitter:()=>Im,default:()=>Ue,defaultMaxListeners:()=>Cm,init:()=>Pm,listenerCount:()=>Bm,on:()=>Om,once:()=>xm});var Im,Cm,Pm,Bm,Om,xm,Ut=we(()=>{w();m();_();aa();aa();Ue.once=function(t,e){return new Promise((r,i)=>{function n(...s){o!==void 0&&t.removeListener("error",o),r(s)}let o;e!=="error"&&(o=s=>{t.removeListener(name,n),i(s)},t.once("error",o)),t.once(e,n)})};Ue.on=function(t,e){let r=[],i=[],n=null,o=!1,s={async next(){let c=r.shift();if(c)return createIterResult(c,!1);if(n){let h=Promise.reject(n);return n=null,h}return o?createIterResult(void 0,!0):new Promise((h,d)=>i.push({resolve:h,reject:d}))},async return(){t.removeListener(e,a),t.removeListener("error",l),o=!0;for(let c of i)c.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(c){n=c,t.removeListener(e,a),t.removeListener("error",l)},[Symbol.asyncIterator](){return this}};return t.on(e,a),t.on("error",l),s;function a(...c){let h=i.shift();h?h.resolve(createIterResult(c,!1)):r.push(c)}function l(c){o=!0;let h=i.shift();h?h.reject(c):n=c,s.return()}};({EventEmitter:Im,defaultMaxListeners:Cm,init:Pm,listenerCount:Bm,on:Om,once:xm}=Ue)});var Kn=M((BO,ld)=>{"use strict";w();m();_();var{ArrayIsArray:km,ObjectSetPrototypeOf:ad}=me(),{EventEmitter:zn}=(Ut(),K(Lt));function Gn(t){zn.call(this,t)}ad(Gn.prototype,zn.prototype);ad(Gn,zn);Gn.prototype.pipe=function(t,e){let r=this;function i(h){t.writable&&t.write(h)===!1&&r.pause&&r.pause()}r.on("data",i);function n(){r.readable&&r.resume&&r.resume()}t.on("drain",n),!t._isStdio&&(!e||e.end!==!1)&&(r.on("end",s),r.on("close",a));let o=!1;function s(){o||(o=!0,t.end())}function a(){o||(o=!0,typeof t.destroy=="function"&&t.destroy())}function l(h){c(),zn.listenerCount(this,"error")===0&&this.emit("error",h)}la(r,"error",l),la(t,"error",l);function c(){r.removeListener("data",i),t.removeListener("drain",n),r.removeListener("end",s),r.removeListener("close",a),r.removeListener("error",l),t.removeListener("error",l),r.removeListener("end",c),r.removeListener("close",c),t.removeListener("close",c)}return r.on("end",c),r.on("close",c),t.on("close",c),t.emit("pipe",r),t};function la(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):km(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}ld.exports={Stream:Gn,prependListener:la}});var Wi=M((NO,Yn)=>{"use strict";w();m();_();var{AbortError:ud,codes:Mm}=Be(),{isNodeStream:fd,isWebStream:Lm,kControllerErrorFunction:Um}=dt(),Nm=Mt(),{ERR_INVALID_ARG_TYPE:cd}=Mm,Dm=(t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new cd(e,"AbortSignal",t)};Yn.exports.addAbortSignal=function(e,r){if(Dm(e,"signal"),!fd(r)&&!Lm(r))throw new cd("stream",["ReadableStream","WritableStream","Stream"],r);return Yn.exports.addAbortSignalNoValidate(e,r)};Yn.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let r=fd(e)?()=>{e.destroy(new ud(void 0,{cause:t.reason}))}:()=>{e[Um](new ud(void 0,{cause:t.reason}))};return t.aborted?r():(t.addEventListener("abort",r),Nm(e,()=>t.removeEventListener("abort",r))),e}});var pd=M((VO,dd)=>{"use strict";w();m();_();var{StringPrototypeSlice:hd,SymbolIterator:qm,TypedArrayPrototypeSet:Qn,Uint8Array:jm}=me(),{Buffer:ua}=(de(),K(_e)),{inspect:Fm}=ut();dd.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let r={data:e,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(e){let r={data:e,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?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(this.length===0)return"";let r=this.head,i=""+r.data;for(;(r=r.next)!==null;)i+=e+r.data;return i}concat(e){if(this.length===0)return ua.alloc(0);let r=ua.allocUnsafe(e>>>0),i=this.head,n=0;for(;i;)Qn(r,i.data,n),n+=i.data.length,i=i.next;return r}consume(e,r){let i=this.head.data;if(e<i.length){let n=i.slice(0,e);return this.head.data=i.slice(e),n}return e===i.length?this.shift():r?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[qm](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let r="",i=this.head,n=0;do{let o=i.data;if(e>o.length)r+=o,e-=o.length;else{e===o.length?(r+=o,++n,i.next?this.head=i.next:this.head=this.tail=null):(r+=hd(o,0,e),this.head=i,i.data=hd(o,e));break}++n}while((i=i.next)!==null);return this.length-=n,r}_getBuffer(e){let r=ua.allocUnsafe(e),i=e,n=this.head,o=0;do{let s=n.data;if(e>s.length)Qn(r,s,i-e),e-=s.length;else{e===s.length?(Qn(r,s,i-e),++o,n.next?this.head=n.next:this.head=this.tail=null):(Qn(r,new jm(s.buffer,s.byteOffset,e),i-e),this.head=n,n.data=s.slice(e));break}++o}while((n=n.next)!==null);return this.length-=o,r}[Symbol.for("nodejs.util.inspect.custom")](e,r){return Fm(this,{...r,depth:0,customInspect:!1})}}});var Jn=M((XO,yd)=>{"use strict";w();m();_();var{MathFloor:Wm,NumberIsInteger:$m}=me(),{ERR_INVALID_ARG_VALUE:Hm}=Be().codes;function Vm(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function gd(t){return t?16:16*1024}function zm(t,e,r,i){let n=Vm(e,i,r);if(n!=null){if(!$m(n)||n<0){let o=i?`options.${r}`:"options.highWaterMark";throw new Hm(o,n)}return Wm(n)}return gd(t.objectMode)}yd.exports={getHighWaterMark:zm,getDefaultHighWaterMark:gd}});function _d(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return r===-1&&(r=e),[r,r===e?0:4-r%4]}function Gm(t,e,r){for(var i,n,o=[],s=e;s<r;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),o.push(tt[(n=i)>>18&63]+tt[n>>12&63]+tt[n>>6&63]+tt[63&n]);return o.join("")}function Nt(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,L.prototype),e}function L(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return da(t)}return Pd(t,e,r)}function Pd(t,e,r){if(typeof t=="string")return function(o,s){if(typeof s=="string"&&s!==""||(s="utf8"),!L.isEncoding(s))throw new TypeError("Unknown encoding: "+s);var a=0|Od(o,s),l=Nt(a),c=l.write(o,s);return c!==a&&(l=l.slice(0,c)),l}(t,e);if(ArrayBuffer.isView(t))return fa(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Dt(t,ArrayBuffer)||t&&Dt(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Dt(t,SharedArrayBuffer)||t&&Dt(t.buffer,SharedArrayBuffer)))return vd(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var i=t.valueOf&&t.valueOf();if(i!=null&&i!==t)return L.from(i,e,r);var n=function(o){if(L.isBuffer(o)){var s=0|ya(o.length),a=Nt(s);return a.length===0||o.copy(a,0,0,s),a}if(o.length!==void 0)return typeof o.length!="number"||ba(o.length)?Nt(0):fa(o);if(o.type==="Buffer"&&Array.isArray(o.data))return fa(o.data)}(t);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return L.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function Bd(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function da(t){return Bd(t),Nt(t<0?0:0|ya(t))}function fa(t){for(var e=t.length<0?0:0|ya(t.length),r=Nt(e),i=0;i<e;i+=1)r[i]=255&t[i];return r}function vd(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var i;return i=e===void 0&&r===void 0?new Uint8Array(t):r===void 0?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(i,L.prototype),i}function ya(t){if(t>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647 .toString(16)+" bytes");return 0|t}function Od(t,e){if(L.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Dt(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&r===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return pa(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Ld(t).length;default:if(n)return i?-1:pa(t).length;e=(""+e).toLowerCase(),n=!0}}function Ym(t,e,r){var i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return nv(this,e,r);case"utf8":case"utf-8":return kd(this,e,r);case"ascii":return rv(this,e,r);case"latin1":case"binary":return iv(this,e,r);case"base64":return tv(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return sv(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function Sr(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function Ed(t,e,r,i,n){if(t.length===0)return-1;if(typeof r=="string"?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),ba(r=+r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if(typeof e=="string"&&(e=L.from(e,i)),L.isBuffer(e))return e.length===0?-1:Sd(t,e,r,i,n);if(typeof e=="number")return e&=255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Sd(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function Sd(t,e,r,i,n){var o,s=1,a=t.length,l=e.length;if(i!==void 0&&((i=String(i).toLowerCase())==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||e.length<2)return-1;s=2,a/=2,l/=2,r/=2}function c(y,v){return s===1?y[v]:y.readUInt16BE(v*s)}if(n){var h=-1;for(o=r;o<a;o++)if(c(t,o)===c(e,h===-1?0:o-h)){if(h===-1&&(h=o),o-h+1===l)return h*s}else h!==-1&&(o-=o-h),h=-1}else for(r+l>a&&(r=a-l),o=r;o>=0;o--){for(var d=!0,g=0;g<l;g++)if(c(t,o+g)!==c(e,g)){d=!1;break}if(d)return o}return-1}function Qm(t,e,r,i){r=Number(r)||0;var n=t.length-r;i?(i=Number(i))>n&&(i=n):i=n;var o=e.length;i>o/2&&(i=o/2);for(var s=0;s<i;++s){var a=parseInt(e.substr(2*s,2),16);if(ba(a))return s;t[r+s]=a}return s}function Jm(t,e,r,i){return ts(pa(e,t.length-r),t,r,i)}function xd(t,e,r,i){return ts(function(n){for(var o=[],s=0;s<n.length;++s)o.push(255&n.charCodeAt(s));return o}(e),t,r,i)}function Xm(t,e,r,i){return xd(t,e,r,i)}function Zm(t,e,r,i){return ts(Ld(e),t,r,i)}function ev(t,e,r,i){return ts(function(n,o){for(var s,a,l,c=[],h=0;h<n.length&&!((o-=2)<0);++h)s=n.charCodeAt(h),a=s>>8,l=s%256,c.push(l),c.push(a);return c}(e,t.length-r),t,r,i)}function tv(t,e,r){return e===0&&r===t.length?ha.fromByteArray(t):ha.fromByteArray(t.slice(e,r))}function kd(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;n<r;){var o,s,a,l,c=t[n],h=null,d=c>239?4:c>223?3:c>191?2:1;if(n+d<=r)switch(d){case 1:c<128&&(h=c);break;case 2:(192&(o=t[n+1]))==128&&(l=(31&c)<<6|63&o)>127&&(h=l);break;case 3:o=t[n+1],s=t[n+2],(192&o)==128&&(192&s)==128&&(l=(15&c)<<12|(63&o)<<6|63&s)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:o=t[n+1],s=t[n+2],a=t[n+3],(192&o)==128&&(192&s)==128&&(192&a)==128&&(l=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&l<1114112&&(h=l)}h===null?(h=65533,d=1):h>65535&&(h-=65536,i.push(h>>>10&1023|55296),h=56320|1023&h),i.push(h),n+=d}return function(g){var y=g.length;if(y<=4096)return String.fromCharCode.apply(String,g);for(var v="",E=0;E<y;)v+=String.fromCharCode.apply(String,g.slice(E,E+=4096));return v}(i)}function rv(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;++n)i+=String.fromCharCode(127&t[n]);return i}function iv(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}function nv(t,e,r){var i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);for(var n="",o=e;o<r;++o)n+=av[t[o]];return n}function sv(t,e,r){for(var i=t.slice(e,r),n="",o=0;o<i.length;o+=2)n+=String.fromCharCode(i[o]+256*i[o+1]);return n}function Se(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function Ne(t,e,r,i,n,o){if(!L.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}function Md(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Ad(t,e,r,i,n){return e=+e,r>>>=0,n||Md(t,0,r,4),fi.write(t,e,r,i,23,4),r+4}function Rd(t,e,r,i,n){return e=+e,r>>>=0,n||Md(t,0,r,8),fi.write(t,e,r,i,52,8),r+8}function pa(t,e){var r;e=e||1/0;for(var i=t.length,n=null,o=[],s=0;s<i;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Ld(t){return ha.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(ov,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(t))}function ts(t,e,r,i){for(var n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function Dt(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function ba(t){return t!=t}function Td(t,e){for(var r in t)e[r]=t[r]}function Ar(t,e,r){return gt(t,e,r)}function $i(t){var e;switch(this.encoding=function(r){var i=function(n){if(!n)return"utf8";for(var o;;)switch(n){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 n;default:if(o)return;n=(""+n).toLowerCase(),o=!0}}(r);if(typeof i!="string"&&(ga.isEncoding===Id||!Id(r)))throw new Error("Unknown encoding: "+r);return i||r}(t),this.encoding){case"utf16le":this.text=fv,this.end=cv,e=4;break;case"utf8":this.fillLast=uv,e=4;break;case"base64":this.text=hv,this.end=dv,e=3;break;default:return this.write=pv,this.end=gv,void 0}this.lastNeed=0,this.lastTotal=0,this.lastChar=ga.allocUnsafe(e)}function ca(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function uv(t){var e=this.lastTotal-this.lastNeed,r=function(i,n,o){if((192&n[0])!=128)return i.lastNeed=0,"\uFFFD";if(i.lastNeed>1&&n.length>1){if((192&n[1])!=128)return i.lastNeed=1,"\uFFFD";if(i.lastNeed>2&&n.length>2&&(192&n[2])!=128)return i.lastNeed=2,"\uFFFD"}}(this,t);return r!==void 0?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length,void 0)}function fv(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function cv(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function hv(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function dv(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function pv(t){return t.toString(this.encoding)}function gv(t){return t&&t.length?this.write(t):""}var Cd,tt,Fe,bd,Xn,Er,wd,Km,qt,ha,fi,md,ov,av,Zn,es,gt,lv,Rr,ga,Id,wa=we(()=>{w();m();_();for(Cd={byteLength:function(t){var e=_d(t),r=e[0],i=e[1];return 3*(r+i)/4-i},toByteArray:function(t){var e,r,i=_d(t),n=i[0],o=i[1],s=new bd(function(c,h,d){return 3*(h+d)/4-d}(0,n,o)),a=0,l=o>0?n-4:n;for(r=0;r<l;r+=4)e=Fe[t.charCodeAt(r)]<<18|Fe[t.charCodeAt(r+1)]<<12|Fe[t.charCodeAt(r+2)]<<6|Fe[t.charCodeAt(r+3)],s[a++]=e>>16&255,s[a++]=e>>8&255,s[a++]=255&e;return o===2&&(e=Fe[t.charCodeAt(r)]<<2|Fe[t.charCodeAt(r+1)]>>4,s[a++]=255&e),o===1&&(e=Fe[t.charCodeAt(r)]<<10|Fe[t.charCodeAt(r+1)]<<4|Fe[t.charCodeAt(r+2)]>>2,s[a++]=e>>8&255,s[a++]=255&e),s},fromByteArray:function(t){for(var e,r=t.length,i=r%3,n=[],o=0,s=r-i;o<s;o+=16383)n.push(Gm(t,o,o+16383>s?s:o+16383));return i===1?(e=t[r-1],n.push(tt[e>>2]+tt[e<<4&63]+"==")):i===2&&(e=(t[r-2]<<8)+t[r-1],n.push(tt[e>>10]+tt[e>>4&63]+tt[e<<2&63]+"=")),n.join("")}},tt=[],Fe=[],bd=typeof Uint8Array<"u"?Uint8Array:Array,Xn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Er=0,wd=Xn.length;Er<wd;++Er)tt[Er]=Xn[Er],Fe[Xn.charCodeAt(Er)]=Er;Fe["-".charCodeAt(0)]=62,Fe["_".charCodeAt(0)]=63;Km={read:function(t,e,r,i,n){var o,s,a=8*n-i-1,l=(1<<a)-1,c=l>>1,h=-7,d=r?n-1:0,g=r?-1:1,y=t[e+d];for(d+=g,o=y&(1<<-h)-1,y>>=-h,h+=a;h>0;o=256*o+t[e+d],d+=g,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=i;h>0;s=256*s+t[e+d],d+=g,h-=8);if(o===0)o=1-c;else{if(o===l)return s?NaN:1/0*(y?-1:1);s+=Math.pow(2,i),o-=c}return(y?-1:1)*s*Math.pow(2,o-i)},write:function(t,e,r,i,n,o){var s,a,l,c=8*o-n-1,h=(1<<c)-1,d=h>>1,g=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=i?0:o-1,v=i?1:-1,E=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+d>=1?g/l:g*Math.pow(2,1-d))*l>=2&&(s++,l/=2),s+d>=h?(a=0,s=h):s+d>=1?(a=(e*l-1)*Math.pow(2,n),s+=d):(a=e*Math.pow(2,d-1)*Math.pow(2,n),s=0));n>=8;t[r+y]=255&a,y+=v,a/=256,n-=8);for(s=s<<n|a,c+=n;c>0;t[r+y]=255&s,y+=v,s/=256,c-=8);t[r+y-v]|=128*E}},qt={},ha=Cd,fi=Km,md=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;qt.Buffer=L,qt.SlowBuffer=function(t){return+t!=t&&(t=0),L.alloc(+t)},qt.INSPECT_MAX_BYTES=50;qt.kMaxLength=2147483647,L.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}(),L.TYPED_ARRAY_SUPPORT||typeof console>"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),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(t,e,r){return Pd(t,e,r)},Object.setPrototypeOf(L.prototype,Uint8Array.prototype),Object.setPrototypeOf(L,Uint8Array),L.alloc=function(t,e,r){return function(i,n,o){return Bd(i),i<=0?Nt(i):n!==void 0?typeof o=="string"?Nt(i).fill(n,o):Nt(i).fill(n):Nt(i)}(t,e,r)},L.allocUnsafe=function(t){return da(t)},L.allocUnsafeSlow=function(t){return da(t)},L.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==L.prototype},L.compare=function(t,e){if(Dt(t,Uint8Array)&&(t=L.from(t,t.offset,t.byteLength)),Dt(e,Uint8Array)&&(e=L.from(e,e.offset,e.byteLength)),!L.isBuffer(t)||!L.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,i=e.length,n=0,o=Math.min(r,i);n<o;++n)if(t[n]!==e[n]){r=t[n],i=e[n];break}return r<i?-1:i<r?1:0},L.isEncoding=function(t){switch(String(t).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(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return L.alloc(0);var r;if(e===void 0)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var i=L.allocUnsafe(e),n=0;for(r=0;r<t.length;++r){var o=t[r];if(Dt(o,Uint8Array)&&(o=L.from(o)),!L.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,n),n+=o.length}return i},L.byteLength=Od,L.prototype._isBuffer=!0,L.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)Sr(this,e,e+1);return this},L.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)Sr(this,e,e+3),Sr(this,e+1,e+2);return this},L.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)Sr(this,e,e+7),Sr(this,e+1,e+6),Sr(this,e+2,e+5),Sr(this,e+3,e+4);return this},L.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?kd(this,0,t):Ym.apply(this,arguments)},L.prototype.toLocaleString=L.prototype.toString,L.prototype.equals=function(t){if(!L.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||L.compare(this,t)===0},L.prototype.inspect=function(){var t="",e=qt.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},md&&(L.prototype[md]=L.prototype.inspect),L.prototype.compare=function(t,e,r,i,n){if(Dt(t,Uint8Array)&&(t=L.from(t,t.offset,t.byteLength)),!L.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(e===void 0&&(e=0),r===void 0&&(r=t?t.length:0),i===void 0&&(i=0),n===void 0&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(n>>>=0)-(i>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),l=this.slice(i,n),c=t.slice(e,r),h=0;h<a;++h)if(l[h]!==c[h]){o=l[h],s=c[h];break}return o<s?-1:s<o?1:0},L.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1},L.prototype.indexOf=function(t,e,r){return Ed(this,t,e,r,!0)},L.prototype.lastIndexOf=function(t,e,r){return Ed(this,t,e,r,!1)},L.prototype.write=function(t,e,r,i){if(e===void 0)i="utf8",r=this.length,e=0;else if(r===void 0&&typeof e=="string")i=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,i===void 0&&(i="utf8")):(i=r,r=void 0)}var n=this.length-e;if((r===void 0||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return Qm(this,t,e,r);case"utf8":case"utf-8":return Jm(this,t,e,r);case"ascii":return xd(this,t,e,r);case"latin1":case"binary":return Xm(this,t,e,r);case"base64":return Zm(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ev(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},L.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};L.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=e===void 0?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var i=this.subarray(t,e);return Object.setPrototypeOf(i,L.prototype),i},L.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||Se(t,e,this.length);for(var i=this[t],n=1,o=0;++o<e&&(n*=256);)i+=this[t+o]*n;return i},L.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||Se(t,e,this.length);for(var i=this[t+--e],n=1;e>0&&(n*=256);)i+=this[t+--e]*n;return i},L.prototype.readUInt8=function(t,e){return t>>>=0,e||Se(t,1,this.length),this[t]},L.prototype.readUInt16LE=function(t,e){return t>>>=0,e||Se(t,2,this.length),this[t]|this[t+1]<<8},L.prototype.readUInt16BE=function(t,e){return t>>>=0,e||Se(t,2,this.length),this[t]<<8|this[t+1]},L.prototype.readUInt32LE=function(t,e){return t>>>=0,e||Se(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},L.prototype.readUInt32BE=function(t,e){return t>>>=0,e||Se(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},L.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||Se(t,e,this.length);for(var i=this[t],n=1,o=0;++o<e&&(n*=256);)i+=this[t+o]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*e)),i},L.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||Se(t,e,this.length);for(var i=e,n=1,o=this[t+--i];i>0&&(n*=256);)o+=this[t+--i]*n;return o>=(n*=128)&&(o-=Math.pow(2,8*e)),o},L.prototype.readInt8=function(t,e){return t>>>=0,e||Se(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},L.prototype.readInt16LE=function(t,e){t>>>=0,e||Se(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},L.prototype.readInt16BE=function(t,e){t>>>=0,e||Se(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},L.prototype.readInt32LE=function(t,e){return t>>>=0,e||Se(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},L.prototype.readInt32BE=function(t,e){return t>>>=0,e||Se(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},L.prototype.readFloatLE=function(t,e){return t>>>=0,e||Se(t,4,this.length),fi.read(this,t,!0,23,4)},L.prototype.readFloatBE=function(t,e){return t>>>=0,e||Se(t,4,this.length),fi.read(this,t,!1,23,4)},L.prototype.readDoubleLE=function(t,e){return t>>>=0,e||Se(t,8,this.length),fi.read(this,t,!0,52,8)},L.prototype.readDoubleBE=function(t,e){return t>>>=0,e||Se(t,8,this.length),fi.read(this,t,!1,52,8)},L.prototype.writeUIntLE=function(t,e,r,i){t=+t,e>>>=0,r>>>=0,i||Ne(this,t,e,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[e]=255&t;++o<r&&(n*=256);)this[e+o]=t/n&255;return e+r},L.prototype.writeUIntBE=function(t,e,r,i){t=+t,e>>>=0,r>>>=0,i||Ne(this,t,e,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[e+n]=255&t;--n>=0&&(o*=256);)this[e+n]=t/o&255;return e+r},L.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||Ne(this,t,e,1,255,0),this[e]=255&t,e+1},L.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||Ne(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},L.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||Ne(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},L.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||Ne(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},L.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||Ne(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},L.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e>>>=0,!i){var n=Math.pow(2,8*r-1);Ne(this,t,e,r,n-1,-n)}var o=0,s=1,a=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&a===0&&this[e+o-1]!==0&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},L.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e>>>=0,!i){var n=Math.pow(2,8*r-1);Ne(this,t,e,r,n-1,-n)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&a===0&&this[e+o+1]!==0&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},L.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||Ne(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},L.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||Ne(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},L.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||Ne(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},L.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||Ne(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},L.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||Ne(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},L.prototype.writeFloatLE=function(t,e,r){return Ad(this,t,e,!0,r)},L.prototype.writeFloatBE=function(t,e,r){return Ad(this,t,e,!1,r)},L.prototype.writeDoubleLE=function(t,e,r){return Rd(this,t,e,!0,r)},L.prototype.writeDoubleBE=function(t,e,r){return Rd(this,t,e,!1,r)},L.prototype.copy=function(t,e,r,i){if(!L.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||i===0||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===r||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);var n=i-r;if(this===t&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin(e,r,i);else if(this===t&&r<e&&e<i)for(var o=n-1;o>=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,i),e);return n},L.prototype.fill=function(t,e,r,i){if(typeof t=="string"){if(typeof e=="string"?(i=e,e=0,r=this.length):typeof r=="string"&&(i=r,r=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!L.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){var n=t.charCodeAt(0);(i==="utf8"&&n<128||i==="latin1")&&(t=n)}}else typeof t=="number"?t&=255:typeof t=="boolean"&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=r===void 0?this.length:r>>>0,t||(t=0),typeof t=="number")for(o=e;o<r;++o)this[o]=t;else{var s=L.isBuffer(t)?t:L.from(t,i),a=s.length;if(a===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=s[o%a]}return this};ov=/[^+/0-9A-Za-z-_]/g;av=function(){for(var t=new Array(256),e=0;e<16;++e)for(var r=16*e,i=0;i<16;++i)t[r+i]="0123456789abcdef"[e]+"0123456789abcdef"[i];return t}();qt.Buffer;qt.INSPECT_MAX_BYTES;qt.kMaxLength;Zn={},es=qt,gt=es.Buffer;gt.from&>.alloc&>.allocUnsafe&>.allocUnsafeSlow?Zn=es:(Td(es,Zn),Zn.Buffer=Ar),Ar.prototype=Object.create(gt.prototype),Td(gt,Ar),Ar.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return gt(t,e,r)},Ar.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=gt(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i},Ar.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return gt(t)},Ar.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return es.SlowBuffer(t)};lv=Zn,Rr={},ga=lv.Buffer,Id=ga.isEncoding||function(t){switch((t=""+t)&&t.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}};Rr.StringDecoder=$i,$i.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if((e=this.fillLast(t))===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},$i.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e},$i.prototype.text=function(t,e){var r=function(n,o,s){var a=o.length-1;if(a<s)return 0;var l=ca(o[a]);return l>=0?(l>0&&(n.lastNeed=l-1),l):--a<s||l===-2?0:(l=ca(o[a]))>=0?(l>0&&(n.lastNeed=l-2),l):--a<s||l===-2?0:(l=ca(o[a]))>=0?(l>0&&(l===2?l=0:n.lastNeed=l-3),l):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},$i.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};Rr.StringDecoder;Rr.StringDecoder});var Ud={};Qt(Ud,{StringDecoder:()=>yv,default:()=>Rr});var yv,Nd=we(()=>{w();m();_();wa();wa();yv=Rr.StringDecoder});var _a=M((vx,Fd)=>{"use strict";w();m();_();var Dd=Zt(),{PromisePrototypeThen:bv,SymbolAsyncIterator:qd,SymbolIterator:jd}=me(),{Buffer:wv}=(de(),K(_e)),{ERR_INVALID_ARG_TYPE:_v,ERR_STREAM_NULL_VALUES:mv}=Be().codes;function vv(t,e,r){let i;if(typeof e=="string"||e instanceof wv)return new t({objectMode:!0,...r,read(){this.push(e),this.push(null)}});let n;if(e&&e[qd])n=!0,i=e[qd]();else if(e&&e[jd])n=!1,i=e[jd]();else throw new _v("iterable",["Iterable"],e);let o=new t({objectMode:!0,highWaterMark:1,...r}),s=!1;o._read=function(){s||(s=!0,l())},o._destroy=function(c,h){bv(a(c),()=>Dd.nextTick(h,c),d=>Dd.nextTick(h,d||c))};async function a(c){let h=c!=null,d=typeof i.throw=="function";if(h&&d){let{value:g,done:y}=await i.throw(c);if(await g,y)return}if(typeof i.return=="function"){let{value:g}=await i.return();await g}}async function l(){for(;;){try{let{value:c,done:h}=n?await i.next():i.next();if(h)o.push(null);else{let d=c&&typeof c.then=="function"?await c:c;if(d===null)throw s=!1,new mv;if(o.push(d))continue;s=!1}}catch(c){o.destroy(c)}break}}return o}Fd.exports=vv});var Hi=M((Cx,ep)=>{w();m();_();var rt=Zt(),{ArrayPrototypeIndexOf:Ev,NumberIsInteger:Sv,NumberIsNaN:Av,NumberParseInt:Rv,ObjectDefineProperties:Hd,ObjectKeys:Tv,ObjectSetPrototypeOf:Vd,Promise:Iv,SafeSet:Cv,SymbolAsyncIterator:Pv,Symbol:Bv}=me();ep.exports=W;W.ReadableState=Ra;var{EventEmitter:Ov}=(Ut(),K(Lt)),{Stream:tr,prependListener:xv}=Kn(),{Buffer:ma}=(de(),K(_e)),{addAbortSignal:kv}=Wi(),Mv=Mt(),z=ut().debuglog("stream",t=>{z=t}),Lv=pd(),hi=vr(),{getHighWaterMark:Uv,getDefaultHighWaterMark:Nv}=Jn(),{aggregateTwoErrors:Wd,codes:{ERR_INVALID_ARG_TYPE:Dv,ERR_METHOD_NOT_IMPLEMENTED:qv,ERR_OUT_OF_RANGE:jv,ERR_STREAM_PUSH_AFTER_EOF:Fv,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:Wv}}=Be(),{validateObject:$v}=Fi(),Tr=Bv("kPaused"),{StringDecoder:zd}=(Nd(),K(Ud)),Hv=_a();Vd(W.prototype,tr.prototype);Vd(W,tr);var va=()=>{},{errorOrDestroy:ci}=hi;function Ra(t,e,r){typeof r!="boolean"&&(r=e instanceof yt()),this.objectMode=!!(t&&t.objectMode),r&&(this.objectMode=this.objectMode||!!(t&&t.readableObjectMode)),this.highWaterMark=t?Uv(this,t,"readableHighWaterMark",r):Nv(!1),this.buffer=new Lv,this.length=0,this.pipes=[],this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.constructed=!0,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this[Tr]=null,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.destroyed=!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.multiAwaitDrain=!1,this.readingMore=!1,this.dataEmitted=!1,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new zd(t.encoding),this.encoding=t.encoding)}function W(t){if(!(this instanceof W))return new W(t);let e=this instanceof yt();this._readableState=new Ra(t,this,e),t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&!e&&kv(t.signal,this)),tr.call(this,t),hi.construct(this,()=>{this._readableState.needReadable&&rs(this,this._readableState)})}W.prototype.destroy=hi.destroy;W.prototype._undestroy=hi.undestroy;W.prototype._destroy=function(t,e){e(t)};W.prototype[Ov.captureRejectionSymbol]=function(t){this.destroy(t)};W.prototype.push=function(t,e){return Gd(this,t,e,!1)};W.prototype.unshift=function(t,e){return Gd(this,t,e,!0)};function Gd(t,e,r,i){z("readableAddChunk",e);let n=t._readableState,o;if(n.objectMode||(typeof e=="string"?(r=r||n.defaultEncoding,n.encoding!==r&&(i&&n.encoding?e=ma.from(e,r).toString(n.encoding):(e=ma.from(e,r),r=""))):e instanceof ma?r="":tr._isUint8Array(e)?(e=tr._uint8ArrayToBuffer(e),r=""):e!=null&&(o=new Dv("chunk",["string","Buffer","Uint8Array"],e))),o)ci(t,o);else if(e===null)n.reading=!1,Gv(t,n);else if(n.objectMode||e&&e.length>0)if(i)if(n.endEmitted)ci(t,new Wv);else{if(n.destroyed||n.errored)return!1;Ea(t,n,e,!0)}else if(n.ended)ci(t,new Fv);else{if(n.destroyed||n.errored)return!1;n.reading=!1,n.decoder&&!r?(e=n.decoder.write(e),n.objectMode||e.length!==0?Ea(t,n,e,!1):rs(t,n)):Ea(t,n,e,!1)}else i||(n.reading=!1,rs(t,n));return!n.ended&&(n.length<n.highWaterMark||n.length===0)}function Ea(t,e,r,i){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?(e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&is(t)),rs(t,e)}W.prototype.isPaused=function(){let t=this._readableState;return t[Tr]===!0||t.flowing===!1};W.prototype.setEncoding=function(t){let e=new zd(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,i="";for(let n of r)i+=e.write(n);return r.clear(),i!==""&&r.push(i),this._readableState.length=i.length,this};var Vv=1073741824;function zv(t){if(t>Vv)throw new jv("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}function $d(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:Av(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}W.prototype.read=function(t){z("read",t),t===void 0?t=NaN:Sv(t)||(t=Rv(t,10));let e=this._readableState,r=t;if(t>e.highWaterMark&&(e.highWaterMark=zv(t)),t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return z("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Sa(this):is(this),null;if(t=$d(t,e),t===0&&e.ended)return e.length===0&&Sa(this),null;let i=e.needReadable;if(z("need readable",i),(e.length===0||e.length-t<e.highWaterMark)&&(i=!0,z("length less than watermark",i)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)i=!1,z("reading, ended or constructing",i);else if(i){z("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0);try{this._read(e.highWaterMark)}catch(o){ci(this,o)}e.sync=!1,e.reading||(t=$d(r,e))}let n;return t>0?n=Xd(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&Sa(this)),n!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",n)),n};function Gv(t,e){if(z("onEofChunk"),!e.ended){if(e.decoder){let r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?is(t):(e.needReadable=!1,e.emittedReadable=!0,Kd(t))}}function is(t){let e=t._readableState;z("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(z("emitReadable",e.flowing),e.emittedReadable=!0,rt.nextTick(Kd,t))}function Kd(t){let e=t._readableState;z("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&!e.errored&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Qd(t)}function rs(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,rt.nextTick(Kv,t,e))}function Kv(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let r=e.length;if(z("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}W.prototype._read=function(t){throw new qv("_read()")};W.prototype.pipe=function(t,e){let r=this,i=this._readableState;i.pipes.length===1&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new Cv(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(t),z("pipe count=%d opts=%j",i.pipes.length,e);let o=(!e||e.end!==!1)&&t!==rt.stdout&&t!==rt.stderr?a:A;i.endEmitted?rt.nextTick(o):r.once("end",o),t.on("unpipe",s);function s(T,O){z("onunpipe"),T===r&&O&&O.hasUnpiped===!1&&(O.hasUnpiped=!0,h())}function a(){z("onend"),t.end()}let l,c=!1;function h(){z("cleanup"),t.removeListener("close",v),t.removeListener("finish",E),l&&t.removeListener("drain",l),t.removeListener("error",y),t.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",A),r.removeListener("data",g),c=!0,l&&i.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&l()}function d(){c||(i.pipes.length===1&&i.pipes[0]===t?(z("false write response, pause",0),i.awaitDrainWriters=t,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(t)&&(z("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(t)),r.pause()),l||(l=Yv(r,t),t.on("drain",l))}r.on("data",g);function g(T){z("ondata");let O=t.write(T);z("dest.write",O),O===!1&&d()}function y(T){if(z("onerror",T),A(),t.removeListener("error",y),t.listenerCount("error")===0){let O=t._writableState||t._readableState;O&&!O.errorEmitted?ci(t,T):t.emit("error",T)}}xv(t,"error",y);function v(){t.removeListener("finish",E),A()}t.once("close",v);function E(){z("onfinish"),t.removeListener("close",v),A()}t.once("finish",E);function A(){z("unpipe"),r.unpipe(t)}return t.emit("pipe",r),t.writableNeedDrain===!0?i.flowing&&d():i.flowing||(z("pipe resume"),r.resume()),t};function Yv(t,e){return function(){let i=t._readableState;i.awaitDrainWriters===e?(z("pipeOnDrain",1),i.awaitDrainWriters=null):i.multiAwaitDrain&&(z("pipeOnDrain",i.awaitDrainWriters.size),i.awaitDrainWriters.delete(e)),(!i.awaitDrainWriters||i.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()}}W.prototype.unpipe=function(t){let e=this._readableState,r={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let n=e.pipes;e.pipes=[],this.pause();for(let o=0;o<n.length;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}let i=Ev(e.pipes,t);return i===-1?this:(e.pipes.splice(i,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,r),this)};W.prototype.on=function(t,e){let r=tr.prototype.on.call(this,t,e),i=this._readableState;return t==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):t==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,z("on readable",i.length,i.reading),i.length?is(this):i.reading||rt.nextTick(Qv,this)),r};W.prototype.addListener=W.prototype.on;W.prototype.removeListener=function(t,e){let r=tr.prototype.removeListener.call(this,t,e);return t==="readable"&&rt.nextTick(Yd,this),r};W.prototype.off=W.prototype.removeListener;W.prototype.removeAllListeners=function(t){let e=tr.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&rt.nextTick(Yd,this),e};function Yd(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[Tr]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}function Qv(t){z("readable nexttick read 0"),t.read(0)}W.prototype.resume=function(){let t=this._readableState;return t.flowing||(z("resume"),t.flowing=!t.readableListening,Jv(this,t)),t[Tr]=!1,this};function Jv(t,e){e.resumeScheduled||(e.resumeScheduled=!0,rt.nextTick(Xv,t,e))}function Xv(t,e){z("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Qd(t),e.flowing&&!e.reading&&t.read(0)}W.prototype.pause=function(){return z("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(z("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Tr]=!0,this};function Qd(t){let e=t._readableState;for(z("flow",e.flowing);e.flowing&&t.read()!==null;);}W.prototype.wrap=function(t){let e=!1;t.on("data",i=>{!this.push(i)&&t.pause&&(e=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",i=>{ci(this,i)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let r=Tv(t);for(let i=1;i<r.length;i++){let n=r[i];this[n]===void 0&&typeof t[n]=="function"&&(this[n]=t[n].bind(t))}return this};W.prototype[Pv]=function(){return Jd(this)};W.prototype.iterator=function(t){return t!==void 0&&$v(t,"options"),Jd(this,t)};function Jd(t,e){typeof t.read!="function"&&(t=W.wrap(t,{objectMode:!0}));let r=Zv(t,e);return r.stream=t,r}async function*Zv(t,e){let r=va;function i(s){this===t?(r(),r=va):r=s}t.on("readable",i);let n,o=Mv(t,{writable:!1},s=>{n=s?Wd(n,s):null,r(),r=va});try{for(;;){let s=t.destroyed?null:t.read();if(s!==null)yield s;else{if(n)throw n;if(n===null)return;await new Iv(i)}}}catch(s){throw n=Wd(n,s),n}finally{(n||e?.destroyOnReturn!==!1)&&(n===void 0||t._readableState.autoDestroy)?hi.destroyer(t,null):(t.off("readable",i),o())}}Hd(W.prototype,{readable:{__proto__:null,get(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},set(t){this._readableState&&(this._readableState.readable=!!t)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(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(t){this._readableState&&(this._readableState.flowing=t)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},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:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});Hd(Ra.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[Tr]!==!1},set(t){this[Tr]=!!t}}});W._fromList=Xd;function Xd(t,e){if(e.length===0)return null;let r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function Sa(t){let e=t._readableState;z("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,rt.nextTick(e1,e,t))}function e1(t,e){if(z("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&t.length===0){if(t.endEmitted=!0,e.emit("end"),e.writable&&e.allowHalfOpen===!1)rt.nextTick(t1,e);else if(t.autoDestroy){let r=e._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&e.destroy()}}}function t1(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}W.from=function(t,e){return Hv(W,t,e)};var Aa;function Zd(){return Aa===void 0&&(Aa={}),Aa}W.fromWeb=function(t,e){return Zd().newStreamReadableFromReadableStream(t,e)};W.toWeb=function(t,e){return Zd().newReadableStreamFromStreamReadable(t,e)};W.wrap=function(t,e){var r,i;return new W({objectMode:(r=(i=t.readableObjectMode)!==null&&i!==void 0?i:t.objectMode)!==null&&r!==void 0?r:!0,...e,destroy(n,o){hi.destroyer(t,n),o(n)}}).wrap(t)}});var xa=M((Lx,hp)=>{w();m();_();var Ir=Zt(),{ArrayPrototypeSlice:ip,Error:r1,FunctionPrototypeSymbolHasInstance:np,ObjectDefineProperty:sp,ObjectDefineProperties:i1,ObjectSetPrototypeOf:op,StringPrototypeToLowerCase:n1,Symbol:s1,SymbolHasInstance:o1}=me();hp.exports=le;le.WritableState=Gi;var{EventEmitter:a1}=(Ut(),K(Lt)),Vi=Kn().Stream,{Buffer:ns}=(de(),K(_e)),as=vr(),{addAbortSignal:l1}=Wi(),{getHighWaterMark:u1,getDefaultHighWaterMark:f1}=Jn(),{ERR_INVALID_ARG_TYPE:c1,ERR_METHOD_NOT_IMPLEMENTED:h1,ERR_MULTIPLE_CALLBACK:ap,ERR_STREAM_CANNOT_PIPE:d1,ERR_STREAM_DESTROYED:zi,ERR_STREAM_ALREADY_FINISHED:p1,ERR_STREAM_NULL_VALUES:g1,ERR_STREAM_WRITE_AFTER_END:y1,ERR_UNKNOWN_ENCODING:lp}=Be().codes,{errorOrDestroy:di}=as;op(le.prototype,Vi.prototype);op(le,Vi);function Ca(){}var pi=s1("kOnFinished");function Gi(t,e,r){typeof r!="boolean"&&(r=e instanceof yt()),this.objectMode=!!(t&&t.objectMode),r&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?u1(this,t,"writableHighWaterMark",r):f1(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let i=!!(t&&t.decodeStrings===!1);this.decodeStrings=!i,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=w1.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,os(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[pi]=[]}function os(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}Gi.prototype.getBuffer=function(){return ip(this.buffered,this.bufferedIndex)};sp(Gi.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function le(t){let e=this instanceof yt();if(!e&&!np(le,this))return new le(t);this._writableState=new Gi(t,this,e),t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&l1(t.signal,this)),Vi.call(this,t),as.construct(this,()=>{let r=this._writableState;r.writing||Ba(this,r),Oa(this,r)})}sp(le,o1,{__proto__:null,value:function(t){return np(this,t)?!0:this!==le?!1:t&&t._writableState instanceof Gi}});le.prototype.pipe=function(){di(this,new d1)};function up(t,e,r,i){let n=t._writableState;if(typeof r=="function")i=r,r=n.defaultEncoding;else{if(!r)r=n.defaultEncoding;else if(r!=="buffer"&&!ns.isEncoding(r))throw new lp(r);typeof i!="function"&&(i=Ca)}if(e===null)throw new g1;if(!n.objectMode)if(typeof e=="string")n.decodeStrings!==!1&&(e=ns.from(e,r),r="buffer");else if(e instanceof ns)r="buffer";else if(Vi._isUint8Array(e))e=Vi._uint8ArrayToBuffer(e),r="buffer";else throw new c1("chunk",["string","Buffer","Uint8Array"],e);let o;return n.ending?o=new y1:n.destroyed&&(o=new zi("write")),o?(Ir.nextTick(i,o),di(t,o,!0),o):(n.pendingcb++,b1(t,n,e,r,i))}le.prototype.write=function(t,e,r){return up(this,t,e,r)===!0};le.prototype.cork=function(){this._writableState.corked++};le.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||Ba(this,t))};le.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=n1(e)),!ns.isEncoding(e))throw new lp(e);return this._writableState.defaultEncoding=e,this};function b1(t,e,r,i,n){let o=e.objectMode?1:r.length;e.length+=o;let s=e.length<e.highWaterMark;return s||(e.needDrain=!0),e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:r,encoding:i,callback:n}),e.allBuffers&&i!=="buffer"&&(e.allBuffers=!1),e.allNoop&&n!==Ca&&(e.allNoop=!1)):(e.writelen=o,e.writecb=n,e.writing=!0,e.sync=!0,t._write(r,i,e.onwrite),e.sync=!1),s&&!e.errored&&!e.destroyed}function tp(t,e,r,i,n,o,s){e.writelen=i,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new zi("write")):r?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}function rp(t,e,r,i){--e.pendingcb,i(r),Pa(e),di(t,r)}function w1(t,e){let r=t._writableState,i=r.sync,n=r.writecb;if(typeof n!="function"){di(t,new ap);return}r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,e?(e.stack,r.errored||(r.errored=e),t._readableState&&!t._readableState.errored&&(t._readableState.errored=e),i?Ir.nextTick(rp,t,r,e,n):rp(t,r,e,n)):(r.buffered.length>r.bufferedIndex&&Ba(t,r),i?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===n?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:n,stream:t,state:r},Ir.nextTick(_1,r.afterWriteTickInfo)):fp(t,r,1,n))}function _1({stream:t,state:e,count:r,cb:i}){return e.afterWriteTickInfo=null,fp(t,e,r,i)}function fp(t,e,r,i){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));r-- >0;)e.pendingcb--,i();e.destroyed&&Pa(e),Oa(t,e)}function Pa(t){if(t.writing)return;for(let n=t.bufferedIndex;n<t.buffered.length;++n){var e;let{chunk:o,callback:s}=t.buffered[n],a=t.objectMode?1:o.length;t.length-=a,s((e=t.errored)!==null&&e!==void 0?e:new zi("write"))}let r=t[pi].splice(0);for(let n=0;n<r.length;n++){var i;r[n]((i=t.errored)!==null&&i!==void 0?i:new zi("end"))}os(t)}function Ba(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:r,bufferedIndex:i,objectMode:n}=e,o=r.length-i;if(!o)return;let s=i;if(e.bufferProcessing=!0,o>1&&t._writev){e.pendingcb-=o-1;let a=e.allNoop?Ca:c=>{for(let h=s;h<r.length;++h)r[h].callback(c)},l=e.allNoop&&s===0?r:ip(r,s);l.allBuffers=e.allBuffers,tp(t,e,!0,e.length,l,"",a),os(e)}else{do{let{chunk:a,encoding:l,callback:c}=r[s];r[s++]=null;let h=n?1:a.length;tp(t,e,!1,h,a,l,c)}while(s<r.length&&!e.writing);s===r.length?os(e):s>256?(r.splice(0,s),e.bufferedIndex=0):e.bufferedIndex=s}e.bufferProcessing=!1}le.prototype._write=function(t,e,r){if(this._writev)this._writev([{chunk:t,encoding:e}],r);else throw new h1("_write()")};le.prototype._writev=null;le.prototype.end=function(t,e,r){let i=this._writableState;typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null);let n;if(t!=null){let o=up(this,t,e);o instanceof r1&&(n=o)}return i.corked&&(i.corked=1,this.uncork()),n||(!i.errored&&!i.ending?(i.ending=!0,Oa(this,i,!0),i.ended=!0):i.finished?n=new p1("end"):i.destroyed&&(n=new zi("end"))),typeof r=="function"&&(n||i.finished?Ir.nextTick(r,n):i[pi].push(r)),this};function ss(t){return t.ending&&!t.destroyed&&t.constructed&&t.length===0&&!t.errored&&t.buffered.length===0&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}function m1(t,e){let r=!1;function i(n){if(r){di(t,n??ap());return}if(r=!0,e.pendingcb--,n){let o=e[pi].splice(0);for(let s=0;s<o.length;s++)o[s](n);di(t,n,e.sync)}else ss(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,Ir.nextTick(Ia,t,e))}e.sync=!0,e.pendingcb++;try{t._final(i)}catch(n){i(n)}e.sync=!1}function v1(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,m1(t,e)):(e.prefinished=!0,t.emit("prefinish")))}function Oa(t,e,r){ss(e)&&(v1(t,e),e.pendingcb===0&&(r?(e.pendingcb++,Ir.nextTick((i,n)=>{ss(n)?Ia(i,n):n.pendingcb--},t,e)):ss(e)&&(e.pendingcb++,Ia(t,e))))}function Ia(t,e){e.pendingcb--,e.finished=!0;let r=e[pi].splice(0);for(let i=0;i<r.length;i++)r[i]();if(t.emit("finish"),e.autoDestroy){let i=t._readableState;(!i||i.autoDestroy&&(i.endEmitted||i.readable===!1))&&t.destroy()}}i1(le.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(t){this._writableState&&(this._writableState.destroyed=t)}},writable:{__proto__:null,get(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},set(t){this._writableState&&(this._writableState.writable=!!t)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1}},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!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var E1=as.destroy;le.prototype.destroy=function(t,e){let r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[pi].length)&&Ir.nextTick(Pa,r),E1.call(this,t,e),this};le.prototype._undestroy=as.undestroy;le.prototype._destroy=function(t,e){e(t)};le.prototype[a1.captureRejectionSymbol]=function(t){this.destroy(t)};var Ta;function cp(){return Ta===void 0&&(Ta={}),Ta}le.fromWeb=function(t,e){return cp().newStreamWritableFromWritableStream(t,e)};le.toWeb=function(t){return cp().newWritableStreamFromStreamWritable(t)}});var Ap=M((Wx,Sp)=>{w();m();_();var ka=Zt(),S1=(de(),K(_e)),{isReadable:A1,isWritable:R1,isIterable:dp,isNodeStream:T1,isReadableNodeStream:pp,isWritableNodeStream:gp,isDuplexNodeStream:I1}=dt(),yp=Mt(),{AbortError:Ep,codes:{ERR_INVALID_ARG_TYPE:C1,ERR_INVALID_RETURN_VALUE:bp}}=Be(),{destroyer:gi}=vr(),P1=yt(),B1=Hi(),{createDeferredPromise:wp}=ut(),_p=_a(),mp=globalThis.Blob||S1.Blob,O1=typeof mp<"u"?function(e){return e instanceof mp}:function(e){return!1},x1=globalThis.AbortController||Nn().AbortController,{FunctionPrototypeCall:vp}=me(),Cr=class extends P1{constructor(e){super(e),e?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};Sp.exports=function t(e,r){if(I1(e))return e;if(pp(e))return ls({readable:e});if(gp(e))return ls({writable:e});if(T1(e))return ls({writable:!1,readable:!1});if(typeof e=="function"){let{value:n,write:o,final:s,destroy:a}=k1(e);if(dp(n))return _p(Cr,n,{objectMode:!0,write:o,final:s,destroy:a});let l=n?.then;if(typeof l=="function"){let c,h=vp(l,n,d=>{if(d!=null)throw new bp("nully","body",d)},d=>{gi(c,d)});return c=new Cr({objectMode:!0,readable:!1,write:o,final(d){s(async()=>{try{await h,ka.nextTick(d,null)}catch(g){ka.nextTick(d,g)}})},destroy:a})}throw new bp("Iterable, AsyncIterable or AsyncFunction",r,n)}if(O1(e))return t(e.arrayBuffer());if(dp(e))return _p(Cr,e,{objectMode:!0,writable:!1});if(typeof e?.writable=="object"||typeof e?.readable=="object"){let n=e!=null&&e.readable?pp(e?.readable)?e?.readable:t(e.readable):void 0,o=e!=null&&e.writable?gp(e?.writable)?e?.writable:t(e.writable):void 0;return ls({readable:n,writable:o})}let i=e?.then;if(typeof i=="function"){let n;return vp(i,e,o=>{o!=null&&n.push(o),n.push(null)},o=>{gi(n,o)}),n=new Cr({objectMode:!0,writable:!1,read(){}})}throw new C1(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)};function k1(t){let{promise:e,resolve:r}=wp(),i=new x1,n=i.signal;return{value:t(async function*(){for(;;){let s=e;e=null;let{chunk:a,done:l,cb:c}=await s;if(ka.nextTick(c),l)return;if(n.aborted)throw new Ep(void 0,{cause:n.reason});({promise:e,resolve:r}=wp()),yield a}}(),{signal:n}),write(s,a,l){let c=r;r=null,c({chunk:s,done:!1,cb:l})},final(s){let a=r;r=null,a({done:!0,cb:s})},destroy(s,a){i.abort(),a(s)}}}function ls(t){let e=t.readable&&typeof t.readable.read!="function"?B1.wrap(t.readable):t.readable,r=t.writable,i=!!A1(e),n=!!R1(r),o,s,a,l,c;function h(d){let g=l;l=null,g?g(d):d&&c.destroy(d)}return c=new Cr({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:i,writable:n}),n&&(yp(r,d=>{n=!1,d&&gi(e,d),h(d)}),c._write=function(d,g,y){r.write(d,g)?y():o=y},c._final=function(d){r.end(),s=d},r.on("drain",function(){if(o){let d=o;o=null,d()}}),r.on("finish",function(){if(s){let d=s;s=null,d()}})),i&&(yp(e,d=>{i=!1,d&&gi(e,d),h(d)}),e.on("readable",function(){if(a){let d=a;a=null,d()}}),e.on("end",function(){c.push(null)}),c._read=function(){for(;;){let d=e.read();if(d===null){a=c._read;return}if(!c.push(d))return}}),c._destroy=function(d,g){!d&&l!==null&&(d=new Ep),a=null,o=null,s=null,l===null?g(d):(l=g,gi(r,d),gi(e,d))},c}});var yt=M((Yx,Ip)=>{"use strict";w();m();_();var{ObjectDefineProperties:M1,ObjectGetOwnPropertyDescriptor:jt,ObjectKeys:L1,ObjectSetPrototypeOf:Rp}=me();Ip.exports=it;var Ua=Hi(),ze=xa();Rp(it.prototype,Ua.prototype);Rp(it,Ua);{let t=L1(ze.prototype);for(let e=0;e<t.length;e++){let r=t[e];it.prototype[r]||(it.prototype[r]=ze.prototype[r])}}function it(t){if(!(this instanceof it))return new it(t);Ua.call(this,t),ze.call(this,t),t?(this.allowHalfOpen=t.allowHalfOpen!==!1,t.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}M1(it.prototype,{writable:{__proto__:null,...jt(ze.prototype,"writable")},writableHighWaterMark:{__proto__:null,...jt(ze.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...jt(ze.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...jt(ze.prototype,"writableBuffer")},writableLength:{__proto__:null,...jt(ze.prototype,"writableLength")},writableFinished:{__proto__:null,...jt(ze.prototype,"writableFinished")},writableCorked:{__proto__:null,...jt(ze.prototype,"writableCorked")},writableEnded:{__proto__:null,...jt(ze.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...jt(ze.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}});var Ma;function Tp(){return Ma===void 0&&(Ma={}),Ma}it.fromWeb=function(t,e){return Tp().newStreamDuplexFromReadableWritablePair(t,e)};it.toWeb=function(t){return Tp().newReadableWritablePairFromDuplex(t)};var La;it.from=function(t){return La||(La=Ap()),La(t,"body")}});var qa=M((rk,Pp)=>{"use strict";w();m();_();var{ObjectSetPrototypeOf:Cp,Symbol:U1}=me();Pp.exports=Ft;var{ERR_METHOD_NOT_IMPLEMENTED:N1}=Be().codes,Da=yt(),{getHighWaterMark:D1}=Jn();Cp(Ft.prototype,Da.prototype);Cp(Ft,Da);var Ki=U1("kCallback");function Ft(t){if(!(this instanceof Ft))return new Ft(t);let e=t?D1(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),Da.call(this,t),this._readableState.sync=!1,this[Ki]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",q1)}function Na(t){typeof this._flush=="function"&&!this.destroyed?this._flush((e,r)=>{if(e){t?t(e):this.destroy(e);return}r!=null&&this.push(r),this.push(null),t&&t()}):(this.push(null),t&&t())}function q1(){this._final!==Na&&Na.call(this)}Ft.prototype._final=Na;Ft.prototype._transform=function(t,e,r){throw new N1("_transform()")};Ft.prototype._write=function(t,e,r){let i=this._readableState,n=this._writableState,o=i.length;this._transform(t,e,(s,a)=>{if(s){r(s);return}a!=null&&this.push(a),n.ended||o===i.length||i.length<i.highWaterMark?r():this[Ki]=r})};Ft.prototype._read=function(){if(this[Ki]){let t=this[Ki];this[Ki]=null,t()}}});var Fa=M((uk,Op)=>{"use strict";w();m();_();var{ObjectSetPrototypeOf:Bp}=me();Op.exports=yi;var ja=qa();Bp(yi.prototype,ja.prototype);Bp(yi,ja);function yi(t){if(!(this instanceof yi))return new yi(t);ja.call(this,t)}yi.prototype._transform=function(t,e,r){r(null,t)}});var hs=M((yk,Up)=>{w();m();_();var Yi=Zt(),{ArrayIsArray:j1,Promise:F1,SymbolAsyncIterator:W1}=me(),cs=Mt(),{once:$1}=ut(),H1=vr(),xp=yt(),{aggregateTwoErrors:V1,codes:{ERR_INVALID_ARG_TYPE:Ya,ERR_INVALID_RETURN_VALUE:Wa,ERR_MISSING_ARGS:z1,ERR_STREAM_DESTROYED:G1,ERR_STREAM_PREMATURE_CLOSE:K1},AbortError:Y1}=Be(),{validateFunction:Q1,validateAbortSignal:J1}=Fi(),{isIterable:Pr,isReadable:$a,isReadableNodeStream:fs,isNodeStream:kp,isTransformStream:bi,isWebStream:X1,isReadableStream:Ha,isReadableEnded:Z1}=dt(),eE=globalThis.AbortController||Nn().AbortController,Va,za;function Mp(t,e,r){let i=!1;t.on("close",()=>{i=!0});let n=cs(t,{readable:e,writable:r},o=>{i=!o});return{destroy:o=>{i||(i=!0,H1.destroyer(t,o||new G1("pipe")))},cleanup:n}}function tE(t){return Q1(t[t.length-1],"streams[stream.length - 1]"),t.pop()}function Ga(t){if(Pr(t))return t;if(fs(t))return rE(t);throw new Ya("val",["Readable","Iterable","AsyncIterable"],t)}async function*rE(t){za||(za=Hi()),yield*za.prototype[W1].call(t)}async function us(t,e,r,{end:i}){let n,o=null,s=c=>{if(c&&(n=c),o){let h=o;o=null,h()}},a=()=>new F1((c,h)=>{n?h(n):o=()=>{n?h(n):c()}});e.on("drain",s);let l=cs(e,{readable:!1},s);try{e.writableNeedDrain&&await a();for await(let c of t)e.write(c)||await a();i&&e.end(),await a(),r()}catch(c){r(n!==c?V1(n,c):c)}finally{l(),e.off("drain",s)}}async function Ka(t,e,r,{end:i}){bi(e)&&(e=e.writable);let n=e.getWriter();try{for await(let o of t)await n.ready,n.write(o).catch(()=>{});await n.ready,i&&await n.close(),r()}catch(o){try{await n.abort(o),r(o)}catch(s){r(s)}}}function iE(...t){return Lp(t,$1(tE(t)))}function Lp(t,e,r){if(t.length===1&&j1(t[0])&&(t=t[0]),t.length<2)throw new z1("streams");let i=new eE,n=i.signal,o=r?.signal,s=[];J1(o,"options.signal");function a(){y(new Y1)}o?.addEventListener("abort",a);let l,c,h=[],d=0;function g(O){y(O,--d===0)}function y(O,I){if(O&&(!l||l.code==="ERR_STREAM_PREMATURE_CLOSE")&&(l=O),!(!l&&!I)){for(;h.length;)h.shift()(l);o?.removeEventListener("abort",a),i.abort(),I&&(l||s.forEach(N=>N()),Yi.nextTick(e,l,c))}}let v;for(let O=0;O<t.length;O++){let I=t[O],N=O<t.length-1,D=O>0,Y=N||r?.end!==!1,Z=O===t.length-1;if(kp(I)){let J=function(te){te&&te.name!=="AbortError"&&te.code!=="ERR_STREAM_PREMATURE_CLOSE"&&g(te)};var T=J;if(Y){let{destroy:te,cleanup:Pe}=Mp(I,N,D);h.push(te),$a(I)&&Z&&s.push(Pe)}I.on("error",J),$a(I)&&Z&&s.push(()=>{I.removeListener("error",J)})}if(O===0)if(typeof I=="function"){if(v=I({signal:n}),!Pr(v))throw new Wa("Iterable, AsyncIterable or Stream","source",v)}else Pr(I)||fs(I)||bi(I)?v=I:v=xp.from(I);else if(typeof I=="function"){if(bi(v)){var E;v=Ga((E=v)===null||E===void 0?void 0:E.readable)}else v=Ga(v);if(v=I(v,{signal:n}),N){if(!Pr(v,!0))throw new Wa("AsyncIterable",`transform[${O-1}]`,v)}else{var A;Va||(Va=Fa());let J=new Va({objectMode:!0}),te=(A=v)===null||A===void 0?void 0:A.then;if(typeof te=="function")d++,te.call(v,Te=>{c=Te,Te!=null&&J.write(Te),Y&&J.end(),Yi.nextTick(g)},Te=>{J.destroy(Te),Yi.nextTick(g,Te)});else if(Pr(v,!0))d++,us(v,J,g,{end:Y});else if(Ha(v)||bi(v)){let Te=v.readable||v;d++,us(Te,J,g,{end:Y})}else throw new Wa("AsyncIterable or Promise","destination",v);v=J;let{destroy:Pe,cleanup:Di}=Mp(v,!1,!0);h.push(Pe),Z&&s.push(Di)}}else if(kp(I)){if(fs(v)){d+=2;let J=nE(v,I,g,{end:Y});$a(I)&&Z&&s.push(J)}else if(bi(v)||Ha(v)){let J=v.readable||v;d++,us(J,I,g,{end:Y})}else if(Pr(v))d++,us(v,I,g,{end:Y});else throw new Ya("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],v);v=I}else if(X1(I)){if(fs(v))d++,Ka(Ga(v),I,g,{end:Y});else if(Ha(v)||Pr(v))d++,Ka(v,I,g,{end:Y});else if(bi(v))d++,Ka(v.readable,I,g,{end:Y});else throw new Ya("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],v);v=I}else v=xp.from(I)}return(n!=null&&n.aborted||o!=null&&o.aborted)&&Yi.nextTick(a),v}function nE(t,e,r,{end:i}){let n=!1;if(e.on("close",()=>{n||r(new K1)}),t.pipe(e,{end:!1}),i){let s=function(){n=!0,e.end()};var o=s;Z1(t)?Yi.nextTick(s):t.once("end",s)}else r();return cs(t,{readable:!0,writable:!1},s=>{let a=t._readableState;s&&s.code==="ERR_STREAM_PREMATURE_CLOSE"&&a&&a.ended&&!a.errored&&!a.errorEmitted?t.once("end",r).once("error",r):r(s)}),cs(e,{readable:!1,writable:!0},r)}Up.exports={pipelineImpl:Lp,pipeline:iE}});var Ja=M((Sk,Wp)=>{"use strict";w();m();_();var{pipeline:sE}=hs(),ds=yt(),{destroyer:oE}=vr(),{isNodeStream:ps,isReadable:Np,isWritable:Dp,isWebStream:Qa,isTransformStream:Br,isWritableStream:qp,isReadableStream:jp}=dt(),{AbortError:aE,codes:{ERR_INVALID_ARG_VALUE:Fp,ERR_MISSING_ARGS:lE}}=Be(),uE=Mt();Wp.exports=function(...e){if(e.length===0)throw new lE("streams");if(e.length===1)return ds.from(e[0]);let r=[...e];if(typeof e[0]=="function"&&(e[0]=ds.from(e[0])),typeof e[e.length-1]=="function"){let y=e.length-1;e[y]=ds.from(e[y])}for(let y=0;y<e.length;++y)if(!(!ps(e[y])&&!Qa(e[y]))){if(y<e.length-1&&!(Np(e[y])||jp(e[y])||Br(e[y])))throw new Fp(`streams[${y}]`,r[y],"must be readable");if(y>0&&!(Dp(e[y])||qp(e[y])||Br(e[y])))throw new Fp(`streams[${y}]`,r[y],"must be writable")}let i,n,o,s,a;function l(y){let v=s;s=null,v?v(y):y?a.destroy(y):!g&&!d&&a.destroy()}let c=e[0],h=sE(e,l),d=!!(Dp(c)||qp(c)||Br(c)),g=!!(Np(h)||jp(h)||Br(h));if(a=new ds({writableObjectMode:!!(c!=null&&c.writableObjectMode),readableObjectMode:!!(h!=null&&h.writableObjectMode),writable:d,readable:g}),d){if(ps(c))a._write=function(v,E,A){c.write(v,E)?A():i=A},a._final=function(v){c.end(),n=v},c.on("drain",function(){if(i){let v=i;i=null,v()}});else if(Qa(c)){let E=(Br(c)?c.writable:c).getWriter();a._write=async function(A,T,O){try{await E.ready,E.write(A).catch(()=>{}),O()}catch(I){O(I)}},a._final=async function(A){try{await E.ready,E.close().catch(()=>{}),n=A}catch(T){A(T)}}}let y=Br(h)?h.readable:h;uE(y,()=>{if(n){let v=n;n=null,v()}})}if(g){if(ps(h))h.on("readable",function(){if(o){let y=o;o=null,y()}}),h.on("end",function(){a.push(null)}),a._read=function(){for(;;){let y=h.read();if(y===null){o=a._read;return}if(!a.push(y))return}};else if(Qa(h)){let v=(Br(h)?h.readable:h).getReader();a._read=async function(){for(;;)try{let{value:E,done:A}=await v.read();if(!a.push(E))return;if(A){a.push(null);return}}catch{return}}}}return a._destroy=function(y,v){!y&&s!==null&&(y=new aE),o=null,i=null,n=null,s===null?v(y):(s=v,ps(h)&&oE(h,y))},a}});var Qp=M((Bk,el)=>{"use strict";w();m();_();var zp=globalThis.AbortController||Nn().AbortController,{codes:{ERR_INVALID_ARG_VALUE:fE,ERR_INVALID_ARG_TYPE:Qi,ERR_MISSING_ARGS:cE,ERR_OUT_OF_RANGE:hE},AbortError:bt}=Be(),{validateAbortSignal:Or,validateInteger:dE,validateObject:xr}=Fi(),pE=me().Symbol("kWeak"),{finished:gE}=Mt(),yE=Ja(),{addAbortSignalNoValidate:bE}=Wi(),{isWritable:wE,isNodeStream:_E}=dt(),{ArrayPrototypePush:mE,MathFloor:vE,Number:EE,NumberIsNaN:SE,Promise:$p,PromiseReject:Hp,PromisePrototypeThen:AE,Symbol:Gp}=me(),gs=Gp("kEmpty"),Vp=Gp("kEof");function RE(t,e){if(e!=null&&xr(e,"options"),e?.signal!=null&&Or(e.signal,"options.signal"),_E(t)&&!wE(t))throw new fE("stream",t,"must be writable");let r=yE(this,t);return e!=null&&e.signal&&bE(e.signal,r),r}function ys(t,e){if(typeof t!="function")throw new Qi("fn",["Function","AsyncFunction"],t);e!=null&&xr(e,"options"),e?.signal!=null&&Or(e.signal,"options.signal");let r=1;return e?.concurrency!=null&&(r=vE(e.concurrency)),dE(r,"concurrency",1),async function*(){var n,o;let s=new zp,a=this,l=[],c=s.signal,h={signal:c},d=()=>s.abort();e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted&&d(),e==null||(o=e.signal)===null||o===void 0||o.addEventListener("abort",d);let g,y,v=!1;function E(){v=!0}async function A(){try{for await(let I of a){var T;if(v)return;if(c.aborted)throw new bt;try{I=t(I,h)}catch(N){I=Hp(N)}I!==gs&&(typeof((T=I)===null||T===void 0?void 0:T.catch)=="function"&&I.catch(E),l.push(I),g&&(g(),g=null),!v&&l.length&&l.length>=r&&await new $p(N=>{y=N}))}l.push(Vp)}catch(I){let N=Hp(I);AE(N,void 0,E),l.push(N)}finally{var O;v=!0,g&&(g(),g=null),e==null||(O=e.signal)===null||O===void 0||O.removeEventListener("abort",d)}}A();try{for(;;){for(;l.length>0;){let T=await l[0];if(T===Vp)return;if(c.aborted)throw new bt;T!==gs&&(yield T),l.shift(),y&&(y(),y=null)}await new $p(T=>{g=T})}}finally{s.abort(),v=!0,y&&(y(),y=null)}}.call(this)}function TE(t=void 0){return t!=null&&xr(t,"options"),t?.signal!=null&&Or(t.signal,"options.signal"),async function*(){let r=0;for await(let n of this){var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new bt({cause:t.signal.reason});yield[r++,n]}}.call(this)}async function Kp(t,e=void 0){for await(let r of Za.call(this,t,e))return!0;return!1}async function IE(t,e=void 0){if(typeof t!="function")throw new Qi("fn",["Function","AsyncFunction"],t);return!await Kp.call(this,async(...r)=>!await t(...r),e)}async function CE(t,e){for await(let r of Za.call(this,t,e))return r}async function PE(t,e){if(typeof t!="function")throw new Qi("fn",["Function","AsyncFunction"],t);async function r(i,n){return await t(i,n),gs}for await(let i of ys.call(this,r,e));}function Za(t,e){if(typeof t!="function")throw new Qi("fn",["Function","AsyncFunction"],t);async function r(i,n){return await t(i,n)?i:gs}return ys.call(this,r,e)}var Xa=class extends cE{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function BE(t,e,r){var i;if(typeof t!="function")throw new Qi("reducer",["Function","AsyncFunction"],t);r!=null&&xr(r,"options"),r?.signal!=null&&Or(r.signal,"options.signal");let n=arguments.length>1;if(r!=null&&(i=r.signal)!==null&&i!==void 0&&i.aborted){let c=new bt(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await gE(this.destroy(c)),c}let o=new zp,s=o.signal;if(r!=null&&r.signal){let c={once:!0,[pE]:this};r.signal.addEventListener("abort",()=>o.abort(),c)}let a=!1;try{for await(let c of this){var l;if(a=!0,r!=null&&(l=r.signal)!==null&&l!==void 0&&l.aborted)throw new bt;n?e=await t(e,c,{signal:s}):(e=c,n=!0)}if(!a&&!n)throw new Xa}finally{o.abort()}return e}async function OE(t){t!=null&&xr(t,"options"),t?.signal!=null&&Or(t.signal,"options.signal");let e=[];for await(let i of this){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new bt(void 0,{cause:t.signal.reason});mE(e,i)}return e}function xE(t,e){let r=ys.call(this,t,e);return async function*(){for await(let n of r)yield*n}.call(this)}function Yp(t){if(t=EE(t),SE(t))return 0;if(t<0)throw new hE("number",">= 0",t);return t}function kE(t,e=void 0){return e!=null&&xr(e,"options"),e?.signal!=null&&Or(e.signal,"options.signal"),t=Yp(t),async function*(){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new bt;for await(let o of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new bt;t--<=0&&(yield o)}}.call(this)}function ME(t,e=void 0){return e!=null&&xr(e,"options"),e?.signal!=null&&Or(e.signal,"options.signal"),t=Yp(t),async function*(){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new bt;for await(let o of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new bt;if(t-- >0)yield o;else return}}.call(this)}el.exports.streamReturningOperators={asIndexedPairs:TE,drop:kE,filter:Za,flatMap:xE,map:ys,take:ME,compose:RE};el.exports.promiseReturningOperators={every:IE,forEach:PE,reduce:BE,toArray:OE,some:Kp,find:CE}});var tl=M((Nk,Jp)=>{"use strict";w();m();_();var{ArrayPrototypePop:LE,Promise:UE}=me(),{isIterable:NE,isNodeStream:DE,isWebStream:qE}=dt(),{pipelineImpl:jE}=hs(),{finished:FE}=Mt();rl();function WE(...t){return new UE((e,r)=>{let i,n,o=t[t.length-1];if(o&&typeof o=="object"&&!DE(o)&&!NE(o)&&!qE(o)){let s=LE(t);i=s.signal,n=s.end}jE(t,(s,a)=>{s?r(s):e(a)},{signal:i,end:n})})}Jp.exports={finished:FE,pipeline:WE}});var rl=M((Hk,og)=>{w();m();_();var{Buffer:$E}=(de(),K(_e)),{ObjectDefineProperty:Wt,ObjectKeys:eg,ReflectApply:tg}=me(),{promisify:{custom:rg}}=ut(),{streamReturningOperators:Xp,promiseReturningOperators:Zp}=Qp(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:ig}}=Be(),HE=Ja(),{pipeline:ng}=hs(),{destroyer:VE}=vr(),sg=Mt(),il=tl(),nl=dt(),ge=og.exports=Kn().Stream;ge.isDisturbed=nl.isDisturbed;ge.isErrored=nl.isErrored;ge.isReadable=nl.isReadable;ge.Readable=Hi();for(let t of eg(Xp)){let r=function(...i){if(new.target)throw ig();return ge.Readable.from(tg(e,this,i))};sl=r;let e=Xp[t];Wt(r,"name",{__proto__:null,value:e.name}),Wt(r,"length",{__proto__:null,value:e.length}),Wt(ge.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}var sl;for(let t of eg(Zp)){let r=function(...n){if(new.target)throw ig();return tg(e,this,n)};sl=r;let e=Zp[t];Wt(r,"name",{__proto__:null,value:e.name}),Wt(r,"length",{__proto__:null,value:e.length}),Wt(ge.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}var sl;ge.Writable=xa();ge.Duplex=yt();ge.Transform=qa();ge.PassThrough=Fa();ge.pipeline=ng;var{addAbortSignal:zE}=Wi();ge.addAbortSignal=zE;ge.finished=sg;ge.destroy=VE;ge.compose=HE;Wt(ge,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return il}});Wt(ng,rg,{__proto__:null,enumerable:!0,get(){return il.pipeline}});Wt(sg,rg,{__proto__:null,enumerable:!0,get(){return il.finished}});ge.Stream=ge;ge._isUint8Array=function(e){return e instanceof Uint8Array};ge._uint8ArrayToBuffer=function(e){return $E.from(e.buffer,e.byteOffset,e.byteLength)}});var kr=M((Jk,ye)=>{"use strict";w();m();_();var ve=rl(),GE=tl(),KE=ve.Readable.destroy;ye.exports=ve.Readable;ye.exports._uint8ArrayToBuffer=ve._uint8ArrayToBuffer;ye.exports._isUint8Array=ve._isUint8Array;ye.exports.isDisturbed=ve.isDisturbed;ye.exports.isErrored=ve.isErrored;ye.exports.isReadable=ve.isReadable;ye.exports.Readable=ve.Readable;ye.exports.Writable=ve.Writable;ye.exports.Duplex=ve.Duplex;ye.exports.Transform=ve.Transform;ye.exports.PassThrough=ve.PassThrough;ye.exports.addAbortSignal=ve.addAbortSignal;ye.exports.finished=ve.finished;ye.exports.destroy=ve.destroy;ye.exports.destroy=KE;ye.exports.pipeline=ve.pipeline;ye.exports.compose=ve.compose;Object.defineProperty(ve,"promises",{configurable:!0,enumerable:!0,get(){return GE}});ye.exports.Stream=ve.Stream;ye.exports.default=ye.exports});var rr=M((nM,ol)=>{w();m();_();typeof Object.create=="function"?ol.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:ol.exports=function(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}}});var ug=M((cM,lg)=>{"use strict";w();m();_();var{Buffer:nt}=(de(),K(_e)),ag=Symbol.for("BufferList");function ne(t){if(!(this instanceof ne))return new ne(t);ne._init.call(this,t)}ne._init=function(e){Object.defineProperty(this,ag,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)};ne.prototype._new=function(e){return new ne(e)};ne.prototype._offset=function(e){if(e===0)return[0,0];let r=0;for(let i=0;i<this._bufs.length;i++){let n=r+this._bufs[i].length;if(e<n||i===this._bufs.length-1)return[i,e-r];r=n}};ne.prototype._reverseOffset=function(t){let e=t[0],r=t[1];for(let i=0;i<e;i++)r+=this._bufs[i].length;return r};ne.prototype.get=function(e){if(e>this.length||e<0)return;let r=this._offset(e);return this._bufs[r[0]][r[1]]};ne.prototype.slice=function(e,r){return typeof e=="number"&&e<0&&(e+=this.length),typeof r=="number"&&r<0&&(r+=this.length),this.copy(null,0,e,r)};ne.prototype.copy=function(e,r,i,n){if((typeof i!="number"||i<0)&&(i=0),(typeof n!="number"||n>this.length)&&(n=this.length),i>=this.length||n<=0)return e||nt.alloc(0);let o=!!e,s=this._offset(i),a=n-i,l=a,c=o&&r||0,h=s[1];if(i===0&&n===this.length){if(!o)return this._bufs.length===1?this._bufs[0]:nt.concat(this._bufs,this.length);for(let d=0;d<this._bufs.length;d++)this._bufs[d].copy(e,c),c+=this._bufs[d].length;return e}if(l<=this._bufs[s[0]].length-h)return o?this._bufs[s[0]].copy(e,r,h,h+l):this._bufs[s[0]].slice(h,h+l);o||(e=nt.allocUnsafe(a));for(let d=s[0];d<this._bufs.length;d++){let g=this._bufs[d].length-h;if(l>g)this._bufs[d].copy(e,c,h),c+=g;else{this._bufs[d].copy(e,c,h,h+l),c+=g;break}l-=g,h&&(h=0)}return e.length>c?e.slice(0,c):e};ne.prototype.shallowSlice=function(e,r){if(e=e||0,r=typeof r!="number"?this.length:r,e<0&&(e+=this.length),r<0&&(r+=this.length),e===r)return this._new();let i=this._offset(e),n=this._offset(r),o=this._bufs.slice(i[0],n[0]+1);return n[1]===0?o.pop():o[o.length-1]=o[o.length-1].slice(0,n[1]),i[1]!==0&&(o[0]=o[0].slice(i[1])),this._new(o)};ne.prototype.toString=function(e,r,i){return this.slice(r,i).toString(e)};ne.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)e-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(e),this.length-=e;break}return this};ne.prototype.duplicate=function(){let e=this._new();for(let r=0;r<this._bufs.length;r++)e.append(this._bufs[r]);return e};ne.prototype.append=function(e){if(e==null)return this;if(e.buffer)this._appendBuffer(nt.from(e.buffer,e.byteOffset,e.byteLength));else if(Array.isArray(e))for(let r=0;r<e.length;r++)this.append(e[r]);else if(this._isBufferList(e))for(let r=0;r<e._bufs.length;r++)this.append(e._bufs[r]);else typeof e=="number"&&(e=e.toString()),this._appendBuffer(nt.from(e));return this};ne.prototype._appendBuffer=function(e){this._bufs.push(e),this.length+=e.length};ne.prototype.indexOf=function(t,e,r){if(r===void 0&&typeof e=="string"&&(r=e,e=void 0),typeof t=="function"||Array.isArray(t))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof t=="number"?t=nt.from([t]):typeof t=="string"?t=nt.from(t,r):this._isBufferList(t)?t=t.slice():Array.isArray(t.buffer)?t=nt.from(t.buffer,t.byteOffset,t.byteLength):nt.isBuffer(t)||(t=nt.from(t)),e=Number(e||0),isNaN(e)&&(e=0),e<0&&(e=this.length+e),e<0&&(e=0),t.length===0)return e>this.length?this.length:e;let i=this._offset(e),n=i[0],o=i[1];for(;n<this._bufs.length;n++){let s=this._bufs[n];for(;o<s.length;)if(s.length-o>=t.length){let l=s.indexOf(t,o);if(l!==-1)return this._reverseOffset([n,l]);o=s.length-t.length+1}else{let l=this._reverseOffset([n,o]);if(this._match(l,t))return l;o++}o=0}return-1};ne.prototype._match=function(t,e){if(this.length-t<e.length)return!1;for(let r=0;r<e.length;r++)if(this.get(t+r)!==e[r])return!1;return!0};(function(){let t={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(let e in t)(function(r){t[r]===null?ne.prototype[r]=function(i,n){return this.slice(i,i+n)[r](0,n)}:ne.prototype[r]=function(i=0){return this.slice(i,i+t[r])[r](0)}})(e)})();ne.prototype._isBufferList=function(e){return e instanceof ne||ne.isBufferList(e)};ne.isBufferList=function(e){return e!=null&&e[ag]};lg.exports=ne});var fg=M((wM,bs)=>{"use strict";w();m();_();var al=kr().Duplex,YE=rr(),Ji=ug();function Ce(t){if(!(this instanceof Ce))return new Ce(t);if(typeof t=="function"){this._callback=t;let e=function(i){this._callback&&(this._callback(i),this._callback=null)}.bind(this);this.on("pipe",function(i){i.on("error",e)}),this.on("unpipe",function(i){i.removeListener("error",e)}),t=null}Ji._init.call(this,t),al.call(this)}YE(Ce,al);Object.assign(Ce.prototype,Ji.prototype);Ce.prototype._new=function(e){return new Ce(e)};Ce.prototype._write=function(e,r,i){this._appendBuffer(e),typeof i=="function"&&i()};Ce.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)};Ce.prototype.end=function(e){al.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)};Ce.prototype._destroy=function(e,r){this._bufs.length=0,this.length=0,r(e)};Ce.prototype._isBufferList=function(e){return e instanceof Ce||e instanceof Ji||Ce.isBufferList(e)};Ce.isBufferList=Ji.isBufferList;bs.exports=Ce;bs.exports.BufferListStream=Ce;bs.exports.BufferList=Ji});var hg=M((RM,cg)=>{w();m();_();var ll=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}};cg.exports=ll});var ul=M((xM,dg)=>{w();m();_();var U=dg.exports,{Buffer:De}=(de(),K(_e));U.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"};U.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};U.requiredHeaderFlagsErrors={};for(let t in U.requiredHeaderFlags){let e=U.requiredHeaderFlags[t];U.requiredHeaderFlagsErrors[t]="Invalid header flag bits, must be 0x"+e.toString(16)+" for "+U.types[t]+" packet"}U.codes={};for(let t in U.types){let e=U.types[t];U.codes[e]=t}U.CMD_SHIFT=4;U.CMD_MASK=240;U.DUP_MASK=8;U.QOS_MASK=3;U.QOS_SHIFT=1;U.RETAIN_MASK=1;U.VARBYTEINT_MASK=127;U.VARBYTEINT_FIN_MASK=128;U.VARBYTEINT_MAX=268435455;U.SESSIONPRESENT_MASK=1;U.SESSIONPRESENT_HEADER=De.from([U.SESSIONPRESENT_MASK]);U.CONNACK_HEADER=De.from([U.codes.connack<<U.CMD_SHIFT]);U.USERNAME_MASK=128;U.PASSWORD_MASK=64;U.WILL_RETAIN_MASK=32;U.WILL_QOS_MASK=24;U.WILL_QOS_SHIFT=3;U.WILL_FLAG_MASK=4;U.CLEAN_SESSION_MASK=2;U.CONNECT_HEADER=De.from([U.codes.connect<<U.CMD_SHIFT]);U.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};U.propertiesCodes={};for(let t in U.properties){let e=U.properties[t];U.propertiesCodes[e]=t}U.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"};function ir(t){return[0,1,2].map(e=>[0,1].map(r=>[0,1].map(i=>{let n=De.alloc(1);return n.writeUInt8(U.codes[t]<<U.CMD_SHIFT|(r?U.DUP_MASK:0)|e<<U.QOS_SHIFT|i,0,!0),n})))}U.PUBLISH_HEADER=ir("publish");U.SUBSCRIBE_HEADER=ir("subscribe");U.SUBSCRIBE_OPTIONS_QOS_MASK=3;U.SUBSCRIBE_OPTIONS_NL_MASK=1;U.SUBSCRIBE_OPTIONS_NL_SHIFT=2;U.SUBSCRIBE_OPTIONS_RAP_MASK=1;U.SUBSCRIBE_OPTIONS_RAP_SHIFT=3;U.SUBSCRIBE_OPTIONS_RH_MASK=3;U.SUBSCRIBE_OPTIONS_RH_SHIFT=4;U.SUBSCRIBE_OPTIONS_RH=[0,16,32];U.SUBSCRIBE_OPTIONS_NL=4;U.SUBSCRIBE_OPTIONS_RAP=8;U.SUBSCRIBE_OPTIONS_QOS=[0,1,2];U.UNSUBSCRIBE_HEADER=ir("unsubscribe");U.ACKS={unsuback:ir("unsuback"),puback:ir("puback"),pubcomp:ir("pubcomp"),pubrel:ir("pubrel"),pubrec:ir("pubrec")};U.SUBACK_HEADER=De.from([U.codes.suback<<U.CMD_SHIFT]);U.VERSION3=De.from([3]);U.VERSION4=De.from([4]);U.VERSION5=De.from([5]);U.VERSION131=De.from([131]);U.VERSION132=De.from([132]);U.QOS=[0,1,2].map(t=>De.from([t]));U.EMPTY={pingreq:De.from([U.codes.pingreq<<4,0]),pingresp:De.from([U.codes.pingresp<<4,0]),disconnect:De.from([U.codes.disconnect<<4,0])};U.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"};U.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"};U.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"};U.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"};U.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"};U.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}});var gg=M((qM,pg)=>{w();m();_();var wi=1e3,_i=wi*60,mi=_i*60,Mr=mi*24,QE=Mr*7,JE=Mr*365.25;pg.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return XE(t);if(r==="number"&&isFinite(t))return e.long?eS(t):ZE(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function XE(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),i=(e[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return r*JE;case"weeks":case"week":case"w":return r*QE;case"days":case"day":case"d":return r*Mr;case"hours":case"hour":case"hrs":case"hr":case"h":return r*mi;case"minutes":case"minute":case"mins":case"min":case"m":return r*_i;case"seconds":case"second":case"secs":case"sec":case"s":return r*wi;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function ZE(t){var e=Math.abs(t);return e>=Mr?Math.round(t/Mr)+"d":e>=mi?Math.round(t/mi)+"h":e>=_i?Math.round(t/_i)+"m":e>=wi?Math.round(t/wi)+"s":t+"ms"}function eS(t){var e=Math.abs(t);return e>=Mr?ws(t,e,Mr,"day"):e>=mi?ws(t,e,mi,"hour"):e>=_i?ws(t,e,_i,"minute"):e>=wi?ws(t,e,wi,"second"):t+" ms"}function ws(t,e,r,i){var n=e>=r*1.5;return Math.round(t/r)+" "+i+(n?"s":"")}});var bg=M((zM,yg)=>{w();m();_();function tS(t){r.debug=r,r.default=r,r.coerce=l,r.disable=o,r.enable=n,r.enabled=s,r.humanize=gg(),r.destroy=c,Object.keys(t).forEach(h=>{r[h]=t[h]}),r.names=[],r.skips=[],r.formatters={};function e(h){let d=0;for(let g=0;g<h.length;g++)d=(d<<5)-d+h.charCodeAt(g),d|=0;return r.colors[Math.abs(d)%r.colors.length]}r.selectColor=e;function r(h){let d,g=null,y,v;function E(...A){if(!E.enabled)return;let T=E,O=Number(new Date),I=O-(d||O);T.diff=I,T.prev=d,T.curr=O,d=O,A[0]=r.coerce(A[0]),typeof A[0]!="string"&&A.unshift("%O");let N=0;A[0]=A[0].replace(/%([a-zA-Z%])/g,(Y,Z)=>{if(Y==="%%")return"%";N++;let J=r.formatters[Z];if(typeof J=="function"){let te=A[N];Y=J.call(T,te),A.splice(N,1),N--}return Y}),r.formatArgs.call(T,A),(T.log||r.log).apply(T,A)}return E.namespace=h,E.useColors=r.useColors(),E.color=r.selectColor(h),E.extend=i,E.destroy=r.destroy,Object.defineProperty(E,"enabled",{enumerable:!0,configurable:!1,get:()=>g!==null?g:(y!==r.namespaces&&(y=r.namespaces,v=r.enabled(h)),v),set:A=>{g=A}}),typeof r.init=="function"&&r.init(E),E}function i(h,d){let g=r(this.namespace+(typeof d>"u"?":":d)+h);return g.log=this.log,g}function n(h){r.save(h),r.namespaces=h,r.names=[],r.skips=[];let d,g=(typeof h=="string"?h:"").split(/[\s,]+/),y=g.length;for(d=0;d<y;d++)g[d]&&(h=g[d].replace(/\*/g,".*?"),h[0]==="-"?r.skips.push(new RegExp("^"+h.slice(1)+"$")):r.names.push(new RegExp("^"+h+"$")))}function o(){let h=[...r.names.map(a),...r.skips.map(a).map(d=>"-"+d)].join(",");return r.enable(""),h}function s(h){if(h[h.length-1]==="*")return!0;let d,g;for(d=0,g=r.skips.length;d<g;d++)if(r.skips[d].test(h))return!1;for(d=0,g=r.names.length;d<g;d++)if(r.names[d].test(h))return!0;return!1}function a(h){return h.toString().substring(2,h.toString().length-2).replace(/\.\*\?$/,"*")}function l(h){return h instanceof Error?h.stack||h.message:h}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}yg.exports=tS});var wt=M((We,_s)=>{w();m();_();We.formatArgs=iS;We.save=nS;We.load=sS;We.useColors=rS;We.storage=oS();We.destroy=(()=>{let t=!1;return()=>{t||(t=!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`."))}})();We.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function rS(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function iS(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+_s.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,n=>{n!=="%%"&&(r++,n==="%c"&&(i=r))}),t.splice(i,0,e)}We.log=console.debug||console.log||(()=>{});function nS(t){try{t?We.storage.setItem("debug",t):We.storage.removeItem("debug")}catch{}}function sS(){let t;try{t=We.storage.getItem("debug")}catch{}return!t&&typeof R<"u"&&"env"in R&&(t=R.env.DEBUG),t}function oS(){try{return localStorage}catch{}}_s.exports=bg()(We);var{formatters:aS}=_s.exports;aS.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var mg=M((sL,_g)=>{w();m();_();var lS=fg(),{EventEmitter:uS}=(Ut(),K(Lt)),wg=hg(),G=ul(),j=wt()("mqtt-packet:parser"),fl=class t extends uS{constructor(){super(),this.parser=this.constructor.parser}static parser(e){return this instanceof t?(this.settings=e||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new t().parser(e)}_resetState(){j("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new wg,this.error=null,this._list=lS(),this._stateCounter=0}parse(e){for(this.error&&this._resetState(),this._list.append(e),j("parse: current state: %s",this._states[this._stateCounter]);(this.packet.length!==-1||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,j("parse: state complete. _stateCounter is now: %d",this._stateCounter),j("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return j("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){let e=this._list.readUInt8(0),r=e>>G.CMD_SHIFT;this.packet.cmd=G.types[r];let i=e&15,n=G.requiredHeaderFlags[r];return n!=null&&i!==n?this._emitError(new Error(G.requiredHeaderFlagsErrors[r])):(this.packet.retain=(e&G.RETAIN_MASK)!==0,this.packet.qos=e>>G.QOS_SHIFT&G.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=(e&G.DUP_MASK)!==0,j("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){let e=this._parseVarByteNum(!0);return e&&(this.packet.length=e.value,this._list.consume(e.bytes)),j("_parseLength %d",e.value),!!e}_parsePayload(){j("_parsePayload: payload %O",this._list);let e=!1;if(this.packet.length===0||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}e=!0}return j("_parsePayload complete result: %s",e),e}_parseConnect(){j("_parseConnect");let e,r,i,n,o={},s=this.packet,a=this._parseString();if(a===null)return this._emitError(new Error("Cannot parse protocolId"));if(a!=="MQTT"&&a!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(s.protocolId=a,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(s.protocolVersion=this._list.readUInt8(this._pos),s.protocolVersion>=128&&(s.bridgeMode=!0,s.protocolVersion=s.protocolVersion-128),s.protocolVersion!==3&&s.protocolVersion!==4&&s.protocolVersion!==5)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(this._list.readUInt8(this._pos)&1)return this._emitError(new Error("Connect flag bit 0 must be 0, but got 1"));o.username=this._list.readUInt8(this._pos)&G.USERNAME_MASK,o.password=this._list.readUInt8(this._pos)&G.PASSWORD_MASK,o.will=this._list.readUInt8(this._pos)&G.WILL_FLAG_MASK;let l=!!(this._list.readUInt8(this._pos)&G.WILL_RETAIN_MASK),c=(this._list.readUInt8(this._pos)&G.WILL_QOS_MASK)>>G.WILL_QOS_SHIFT;if(o.will)s.will={},s.will.retain=l,s.will.qos=c;else{if(l)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(c)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(s.clean=(this._list.readUInt8(this._pos)&G.CLEAN_SESSION_MASK)!==0,this._pos++,s.keepalive=this._parseNum(),s.keepalive===-1)return this._emitError(new Error("Packet too short"));if(s.protocolVersion===5){let d=this._parseProperties();Object.getOwnPropertyNames(d).length&&(s.properties=d)}let h=this._parseString();if(h===null)return this._emitError(new Error("Packet too short"));if(s.clientId=h,j("_parseConnect: packet.clientId: %s",s.clientId),o.will){if(s.protocolVersion===5){let d=this._parseProperties();Object.getOwnPropertyNames(d).length&&(s.will.properties=d)}if(e=this._parseString(),e===null)return this._emitError(new Error("Cannot parse will topic"));if(s.will.topic=e,j("_parseConnect: packet.will.topic: %s",s.will.topic),r=this._parseBuffer(),r===null)return this._emitError(new Error("Cannot parse will payload"));s.will.payload=r,j("_parseConnect: packet.will.paylaod: %s",s.will.payload)}if(o.username){if(n=this._parseString(),n===null)return this._emitError(new Error("Cannot parse username"));s.username=n,j("_parseConnect: packet.username: %s",s.username)}if(o.password){if(i=this._parseBuffer(),i===null)return this._emitError(new Error("Cannot parse password"));s.password=i}return this.settings=s,j("_parseConnect: complete"),s}_parseConnack(){j("_parseConnack");let e=this.packet;if(this._list.length<1)return null;let r=this._list.readUInt8(this._pos++);if(r>1)return this._emitError(new Error("Invalid connack flags, bits 7-1 must be set to 0"));if(e.sessionPresent=!!(r&G.SESSIONPRESENT_MASK),this.settings.protocolVersion===5)this._list.length>=2?e.reasonCode=this._list.readUInt8(this._pos++):e.reasonCode=0;else{if(this._list.length<2)return null;e.returnCode=this._list.readUInt8(this._pos++)}if(e.returnCode===-1||e.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){let i=this._parseProperties();Object.getOwnPropertyNames(i).length&&(e.properties=i)}j("_parseConnack: complete")}_parsePublish(){j("_parsePublish");let e=this.packet;if(e.topic=this._parseString(),e.topic===null)return this._emitError(new Error("Cannot parse topic"));if(!(e.qos>0&&!this._parseMessageId())){if(this.settings.protocolVersion===5){let r=this._parseProperties();Object.getOwnPropertyNames(r).length&&(e.properties=r)}e.payload=this._list.slice(this._pos,e.length),j("_parsePublish: payload from buffer list: %o",e.payload)}}_parseSubscribe(){j("_parseSubscribe");let e=this.packet,r,i,n,o,s,a,l;if(e.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(e.properties=c)}if(e.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<e.length;){if(r=this._parseString(),r===null)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=e.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(i=this._parseByte(),this.settings.protocolVersion===5){if(i&192)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(i&252)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(n=i&G.SUBSCRIBE_OPTIONS_QOS_MASK,n>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(a=(i>>G.SUBSCRIBE_OPTIONS_NL_SHIFT&G.SUBSCRIBE_OPTIONS_NL_MASK)!==0,s=(i>>G.SUBSCRIBE_OPTIONS_RAP_SHIFT&G.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,o=i>>G.SUBSCRIBE_OPTIONS_RH_SHIFT&G.SUBSCRIBE_OPTIONS_RH_MASK,o>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));l={topic:r,qos:n},this.settings.protocolVersion===5?(l.nl=a,l.rap=s,l.rh=o):this.settings.bridgeMode&&(l.rh=0,l.rap=!0,l.nl=!0),j("_parseSubscribe: push subscription `%s` to subscription",l),e.subscriptions.push(l)}}}_parseSuback(){j("_parseSuback");let e=this.packet;if(this.packet.granted=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let r=this._parseProperties();Object.getOwnPropertyNames(r).length&&(e.properties=r)}if(e.length<=0)return this._emitError(new Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){let r=this._list.readUInt8(this._pos++);if(this.settings.protocolVersion===5){if(!G.MQTT5_SUBACK_CODES[r])return this._emitError(new Error("Invalid suback code"))}else if(r>2&&r!==128)return this._emitError(new Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(r)}}}_parseUnsubscribe(){j("_parseUnsubscribe");let e=this.packet;if(e.unsubscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let r=this._parseProperties();Object.getOwnPropertyNames(r).length&&(e.properties=r)}if(e.length<=0)return this._emitError(new Error("Malformed unsubscribe, no payload specified"));for(;this._pos<e.length;){let r=this._parseString();if(r===null)return this._emitError(new Error("Cannot parse topic"));j("_parseUnsubscribe: push topic `%s` to unsubscriptions",r),e.unsubscriptions.push(r)}}}_parseUnsuback(){j("_parseUnsuback");let e=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if((this.settings.protocolVersion===3||this.settings.protocolVersion===4)&&e.length!==2)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(this.settings.protocolVersion===5){let r=this._parseProperties();for(Object.getOwnPropertyNames(r).length&&(e.properties=r),e.granted=[];this._pos<this.packet.length;){let i=this._list.readUInt8(this._pos++);if(!G.MQTT5_UNSUBACK_CODES[i])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(i)}}}_parseConfirmation(){j("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);let e=this.packet;if(this._parseMessageId(),this.settings.protocolVersion===5){if(e.length>2){switch(e.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!G.MQTT5_PUBACK_PUBREC_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!G.MQTT5_PUBREL_PUBCOMP_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break}j("_parseConfirmation: packet.reasonCode `%d`",e.reasonCode)}else e.reasonCode=0;if(e.length>3){let r=this._parseProperties();Object.getOwnPropertyNames(r).length&&(e.properties=r)}}return!0}_parseDisconnect(){let e=this.packet;if(j("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?(e.reasonCode=this._parseByte(),G.MQTT5_DISCONNECT_CODES[e.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):e.reasonCode=0;let r=this._parseProperties();Object.getOwnPropertyNames(r).length&&(e.properties=r)}return j("_parseDisconnect result: true"),!0}_parseAuth(){j("_parseAuth");let e=this.packet;if(this.settings.protocolVersion!==5)return this._emitError(new Error("Not supported auth packet for this version MQTT"));if(e.reasonCode=this._parseByte(),!G.MQTT5_AUTH_CODES[e.reasonCode])return this._emitError(new Error("Invalid auth reason code"));let r=this._parseProperties();return Object.getOwnPropertyNames(r).length&&(e.properties=r),j("_parseAuth: result: true"),!0}_parseMessageId(){let e=this.packet;return e.messageId=this._parseNum(),e.messageId===null?(this._emitError(new Error("Cannot parse messageId")),!1):(j("_parseMessageId: packet.messageId %d",e.messageId),!0)}_parseString(e){let r=this._parseNum(),i=r+this._pos;if(r===-1||i>this._list.length||i>this.packet.length)return null;let n=this._list.toString("utf8",this._pos,i);return this._pos+=r,j("_parseString: result: %s",n),n}_parseStringPair(){return j("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){let e=this._parseNum(),r=e+this._pos;if(e===-1||r>this._list.length||r>this.packet.length)return null;let i=this._list.slice(this._pos,r);return this._pos+=e,j("_parseBuffer: result: %o",i),i}_parseNum(){if(this._list.length-this._pos<2)return-1;let e=this._list.readUInt16BE(this._pos);return this._pos+=2,j("_parseNum: result: %s",e),e}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;let e=this._list.readUInt32BE(this._pos);return this._pos+=4,j("_parse4ByteNum: result: %s",e),e}_parseVarByteNum(e){j("_parseVarByteNum");let r=4,i=0,n=1,o=0,s=!1,a,l=this._pos?this._pos:0;for(;i<r&&l+i<this._list.length;){if(a=this._list.readUInt8(l+i++),o+=n*(a&G.VARBYTEINT_MASK),n*=128,!(a&G.VARBYTEINT_FIN_MASK)){s=!0;break}if(this._list.length<=i)break}return!s&&i===r&&this._list.length>=i&&this._emitError(new Error("Invalid variable byte integer")),l&&(this._pos+=i),s?e?s={bytes:i,value:o}:s=o:s=!1,j("_parseVarByteNum: result: %o",s),s}_parseByte(){let e;return this._pos<this._list.length&&(e=this._list.readUInt8(this._pos),this._pos++),j("_parseByte: result: %o",e),e}_parseByType(e){switch(j("_parseByType: type: %s",e),e){case"byte":return this._parseByte()!==0;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(){j("_parseProperties");let e=this._parseVarByteNum(),i=this._pos+e,n={};for(;this._pos<i;){let o=this._parseByte();if(!o)return this._emitError(new Error("Cannot parse property code type")),!1;let s=G.propertiesCodes[o];if(!s)return this._emitError(new Error("Unknown property")),!1;if(s==="userProperties"){n[s]||(n[s]=Object.create(null));let a=this._parseByType(G.propertiesTypes[s]);if(n[s][a.name])if(Array.isArray(n[s][a.name]))n[s][a.name].push(a.value);else{let l=n[s][a.name];n[s][a.name]=[l],n[s][a.name].push(a.value)}else n[s][a.name]=a.value;continue}n[s]?Array.isArray(n[s])?n[s].push(this._parseByType(G.propertiesTypes[s])):(n[s]=[n[s]],n[s].push(this._parseByType(G.propertiesTypes[s]))):n[s]=this._parseByType(G.propertiesTypes[s])}return n}_newPacket(){return j("_newPacket"),this.packet&&(this._list.consume(this.packet.length),j("_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)),j("_newPacket: new packet"),this.packet=new wg,this._pos=0,!0}_emitError(e){j("_emitError",e),this.error=e,this.emit("error",e)}};_g.exports=fl});var Ag=M((hL,Sg)=>{w();m();_();var{Buffer:Xi}=(de(),K(_e)),fS=65536,vg={},cS=Xi.isBuffer(Xi.from([1,2]).subarray(0,1));function Eg(t){let e=Xi.allocUnsafe(2);return e.writeUInt8(t>>8,0),e.writeUInt8(t&255,0+1),e}function hS(){for(let t=0;t<fS;t++)vg[t]=Eg(t)}function dS(t){let r=0,i=0,n=Xi.allocUnsafe(4);do r=t%128|0,t=t/128|0,t>0&&(r=r|128),n.writeUInt8(r,i++);while(t>0&&i<4);return t>0&&(i=0),cS?n.subarray(0,i):n.slice(0,i)}function pS(t){let e=Xi.allocUnsafe(4);return e.writeUInt32BE(t,0),e}Sg.exports={cache:vg,generateCache:hS,generateNumber:Eg,genBufVariableByteInt:dS,generate4ByteBuffer:pS}});var Rg=M((_L,cl)=>{"use strict";w();m();_();typeof R>"u"||!R.version||R.version.indexOf("v0.")===0||R.version.indexOf("v1.")===0&&R.version.indexOf("v1.8.")!==0?cl.exports={nextTick:gS}:cl.exports=R;function gS(t,e,r,i){if(typeof t!="function")throw new TypeError('"callback" argument must be a function');var n=arguments.length,o,s;switch(n){case 0:case 1:return R.nextTick(t);case 2:return R.nextTick(function(){t.call(null,e)});case 3:return R.nextTick(function(){t.call(null,e,r)});case 4:return R.nextTick(function(){t.call(null,e,r,i)});default:for(o=new Array(n-1),s=0;s<o.length;)o[s++]=arguments[s];return R.nextTick(function(){t.apply(null,o)})}}});var pl=M((TL,kg)=>{w();m();_();var F=ul(),{Buffer:q}=(de(),K(_e)),yS=q.allocUnsafe(0),bS=q.from([0]),Zi=Ag(),wS=Rg().nextTick,Ge=wt()("mqtt-packet:writeToStream"),ms=Zi.cache,_S=Zi.generateNumber,mS=Zi.generateCache,hl=Zi.genBufVariableByteInt,vS=Zi.generate4ByteBuffer,xe=dl,vs=!0;function Og(t,e,r){switch(Ge("generate called"),e.cork&&(e.cork(),wS(ES,e)),vs&&(vs=!1,mS()),Ge("generate: packet.cmd: %s",t.cmd),t.cmd){case"connect":return SS(t,e,r);case"connack":return AS(t,e,r);case"publish":return RS(t,e,r);case"puback":case"pubrec":case"pubrel":case"pubcomp":return TS(t,e,r);case"subscribe":return IS(t,e,r);case"suback":return CS(t,e,r);case"unsubscribe":return PS(t,e,r);case"unsuback":return BS(t,e,r);case"pingreq":case"pingresp":return OS(t,e,r);case"disconnect":return xS(t,e,r);case"auth":return kS(t,e,r);default:return e.destroy(new Error("Unknown command")),!1}}Object.defineProperty(Og,"cacheNumbers",{get(){return xe===dl},set(t){t?((!ms||Object.keys(ms).length===0)&&(vs=!0),xe=dl):(vs=!1,xe=MS)}});function ES(t){t.uncork()}function SS(t,e,r){let i=t||{},n=i.protocolId||"MQTT",o=i.protocolVersion||4,s=i.will,a=i.clean,l=i.keepalive||0,c=i.clientId||"",h=i.username,d=i.password,g=i.properties;a===void 0&&(a=!0);let y=0;if(!n||typeof n!="string"&&!q.isBuffer(n))return e.destroy(new Error("Invalid protocolId")),!1;if(y+=n.length+2,o!==3&&o!==4&&o!==5)return e.destroy(new Error("Invalid protocol version")),!1;if(y+=1,(typeof c=="string"||q.isBuffer(c))&&(c||o>=4)&&(c||a))y+=q.byteLength(c)+2;else{if(o<4)return e.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(a*1===0)return e.destroy(new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof l!="number"||l<0||l>65535||l%1!==0)return e.destroy(new Error("Invalid keepalive")),!1;y+=2,y+=1;let v,E;if(o===5){if(v=nr(e,g),!v)return!1;y+=v.length}if(s){if(typeof s!="object")return e.destroy(new Error("Invalid will")),!1;if(!s.topic||typeof s.topic!="string")return e.destroy(new Error("Invalid will topic")),!1;if(y+=q.byteLength(s.topic)+2,y+=2,s.payload)if(s.payload.length>=0)typeof s.payload=="string"?y+=q.byteLength(s.payload):y+=s.payload.length;else return e.destroy(new Error("Invalid will payload")),!1;if(E={},o===5){if(E=nr(e,s.properties),!E)return!1;y+=E.length}}let A=!1;if(h!=null)if(Bg(h))A=!0,y+=q.byteLength(h)+2;else return e.destroy(new Error("Invalid username")),!1;if(d!=null){if(!A)return e.destroy(new Error("Username is required to use password")),!1;if(Bg(d))y+=xg(d)+2;else return e.destroy(new Error("Invalid password")),!1}e.write(F.CONNECT_HEADER),Ke(e,y),vi(e,n),i.bridgeMode&&(o+=128),e.write(o===131?F.VERSION131:o===132?F.VERSION132:o===4?F.VERSION4:o===5?F.VERSION5:F.VERSION3);let T=0;return T|=h!=null?F.USERNAME_MASK:0,T|=d!=null?F.PASSWORD_MASK:0,T|=s&&s.retain?F.WILL_RETAIN_MASK:0,T|=s&&s.qos?s.qos<<F.WILL_QOS_SHIFT:0,T|=s?F.WILL_FLAG_MASK:0,T|=a?F.CLEAN_SESSION_MASK:0,e.write(q.from([T])),xe(e,l),o===5&&v.write(),vi(e,c),s&&(o===5&&E.write(),Lr(e,s.topic),vi(e,s.payload)),h!=null&&vi(e,h),d!=null&&vi(e,d),!0}function AS(t,e,r){let i=r?r.protocolVersion:4,n=t||{},o=i===5?n.reasonCode:n.returnCode,s=n.properties,a=2;if(typeof o!="number")return e.destroy(new Error("Invalid return code")),!1;let l=null;if(i===5){if(l=nr(e,s),!l)return!1;a+=l.length}return e.write(F.CONNACK_HEADER),Ke(e,a),e.write(n.sessionPresent?F.SESSIONPRESENT_HEADER:bS),e.write(q.from([o])),l?.write(),!0}function RS(t,e,r){Ge("publish: packet: %o",t);let i=r?r.protocolVersion:4,n=t||{},o=n.qos||0,s=n.retain?F.RETAIN_MASK:0,a=n.topic,l=n.payload||yS,c=n.messageId,h=n.properties,d=0;if(typeof a=="string")d+=q.byteLength(a)+2;else if(q.isBuffer(a))d+=a.length+2;else return e.destroy(new Error("Invalid topic")),!1;if(q.isBuffer(l)?d+=l.length:d+=q.byteLength(l),o&&typeof c!="number")return e.destroy(new Error("Invalid messageId")),!1;o&&(d+=2);let g=null;if(i===5){if(g=nr(e,h),!g)return!1;d+=g.length}return e.write(F.PUBLISH_HEADER[o][n.dup?1:0][s?1:0]),Ke(e,d),xe(e,xg(a)),e.write(a),o>0&&xe(e,c),g?.write(),Ge("publish: payload: %o",l),e.write(l)}function TS(t,e,r){let i=r?r.protocolVersion:4,n=t||{},o=n.cmd||"puback",s=n.messageId,a=n.dup&&o==="pubrel"?F.DUP_MASK:0,l=0,c=n.reasonCode,h=n.properties,d=i===5?3:2;if(o==="pubrel"&&(l=1),typeof s!="number")return e.destroy(new Error("Invalid messageId")),!1;let g=null;if(i===5&&typeof h=="object"){if(g=en(e,h,r,d),!g)return!1;d+=g.length}return e.write(F.ACKS[o][l][a][0]),d===3&&(d+=c!==0?1:-1),Ke(e,d),xe(e,s),i===5&&d!==2&&e.write(q.from([c])),g!==null?g.write():d===4&&e.write(q.from([0])),!0}function IS(t,e,r){Ge("subscribe: packet: ");let i=r?r.protocolVersion:4,n=t||{},o=n.dup?F.DUP_MASK:0,s=n.messageId,a=n.subscriptions,l=n.properties,c=0;if(typeof s!="number")return e.destroy(new Error("Invalid messageId")),!1;c+=2;let h=null;if(i===5){if(h=nr(e,l),!h)return!1;c+=h.length}if(typeof a=="object"&&a.length)for(let g=0;g<a.length;g+=1){let y=a[g].topic,v=a[g].qos;if(typeof y!="string")return e.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if(typeof v!="number")return e.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(i===5){if(typeof(a[g].nl||!1)!="boolean")return e.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(a[g].rap||!1)!="boolean")return e.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;let T=a[g].rh||0;if(typeof T!="number"||T>2)return e.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}c+=q.byteLength(y)+2+1}else return e.destroy(new Error("Invalid subscriptions")),!1;Ge("subscribe: writing to stream: %o",F.SUBSCRIBE_HEADER),e.write(F.SUBSCRIBE_HEADER[1][o?1:0][0]),Ke(e,c),xe(e,s),h!==null&&h.write();let d=!0;for(let g of a){let y=g.topic,v=g.qos,E=+g.nl,A=+g.rap,T=g.rh,O;Lr(e,y),O=F.SUBSCRIBE_OPTIONS_QOS[v],i===5&&(O|=E?F.SUBSCRIBE_OPTIONS_NL:0,O|=A?F.SUBSCRIBE_OPTIONS_RAP:0,O|=T?F.SUBSCRIBE_OPTIONS_RH[T]:0),d=e.write(q.from([O]))}return d}function CS(t,e,r){let i=r?r.protocolVersion:4,n=t||{},o=n.messageId,s=n.granted,a=n.properties,l=0;if(typeof o!="number")return e.destroy(new Error("Invalid messageId")),!1;if(l+=2,typeof s=="object"&&s.length)for(let h=0;h<s.length;h+=1){if(typeof s[h]!="number")return e.destroy(new Error("Invalid qos vector")),!1;l+=1}else return e.destroy(new Error("Invalid qos vector")),!1;let c=null;if(i===5){if(c=en(e,a,r,l),!c)return!1;l+=c.length}return e.write(F.SUBACK_HEADER),Ke(e,l),xe(e,o),c!==null&&c.write(),e.write(q.from(s))}function PS(t,e,r){let i=r?r.protocolVersion:4,n=t||{},o=n.messageId,s=n.dup?F.DUP_MASK:0,a=n.unsubscriptions,l=n.properties,c=0;if(typeof o!="number")return e.destroy(new Error("Invalid messageId")),!1;if(c+=2,typeof a=="object"&&a.length)for(let g=0;g<a.length;g+=1){if(typeof a[g]!="string")return e.destroy(new Error("Invalid unsubscriptions")),!1;c+=q.byteLength(a[g])+2}else return e.destroy(new Error("Invalid unsubscriptions")),!1;let h=null;if(i===5){if(h=nr(e,l),!h)return!1;c+=h.length}e.write(F.UNSUBSCRIBE_HEADER[1][s?1:0][0]),Ke(e,c),xe(e,o),h!==null&&h.write();let d=!0;for(let g=0;g<a.length;g++)d=Lr(e,a[g]);return d}function BS(t,e,r){let i=r?r.protocolVersion:4,n=t||{},o=n.messageId,s=n.dup?F.DUP_MASK:0,a=n.granted,l=n.properties,c=n.cmd,h=0,d=2;if(typeof o!="number")return e.destroy(new Error("Invalid messageId")),!1;if(i===5)if(typeof a=="object"&&a.length)for(let y=0;y<a.length;y+=1){if(typeof a[y]!="number")return e.destroy(new Error("Invalid qos vector")),!1;d+=1}else return e.destroy(new Error("Invalid qos vector")),!1;let g=null;if(i===5){if(g=en(e,l,r,d),!g)return!1;d+=g.length}return e.write(F.ACKS[c][h][s][0]),Ke(e,d),xe(e,o),g!==null&&g.write(),i===5&&e.write(q.from(a)),!0}function OS(t,e,r){return e.write(F.EMPTY[t.cmd])}function xS(t,e,r){let i=r?r.protocolVersion:4,n=t||{},o=n.reasonCode,s=n.properties,a=i===5?1:0,l=null;if(i===5){if(l=en(e,s,r,a),!l)return!1;a+=l.length}return e.write(q.from([F.codes.disconnect<<4])),Ke(e,a),i===5&&e.write(q.from([o])),l!==null&&l.write(),!0}function kS(t,e,r){let i=r?r.protocolVersion:4,n=t||{},o=n.reasonCode,s=n.properties,a=i===5?1:0;i!==5&&e.destroy(new Error("Invalid mqtt version for auth packet"));let l=en(e,s,r,a);return l?(a+=l.length,e.write(q.from([F.codes.auth<<4])),Ke(e,a),e.write(q.from([o])),l!==null&&l.write(),!0):!1}var Tg={};function Ke(t,e){if(e>F.VARBYTEINT_MAX)return t.destroy(new Error(`Invalid variable byte integer: ${e}`)),!1;let r=Tg[e];return r||(r=hl(e),e<16384&&(Tg[e]=r)),Ge("writeVarByteInt: writing to stream: %o",r),t.write(r)}function Lr(t,e){let r=q.byteLength(e);return xe(t,r),Ge("writeString: %s",e),t.write(e,"utf8")}function Ig(t,e,r){Lr(t,e),Lr(t,r)}function dl(t,e){return Ge("writeNumberCached: number: %d",e),Ge("writeNumberCached: %o",ms[e]),t.write(ms[e])}function MS(t,e){let r=_S(e);return Ge("writeNumberGenerated: %o",r),t.write(r)}function LS(t,e){let r=vS(e);return Ge("write4ByteNumber: %o",r),t.write(r)}function vi(t,e){typeof e=="string"?Lr(t,e):e?(xe(t,e.length),t.write(e)):xe(t,0)}function nr(t,e){if(typeof e!="object"||e.length!=null)return{length:1,write(){Pg(t,{},0)}};let r=0;function i(o,s){let a=F.propertiesTypes[o],l=0;switch(a){case"byte":{if(typeof s!="boolean")return t.destroy(new Error(`Invalid ${o}: ${s}`)),!1;l+=1+1;break}case"int8":{if(typeof s!="number"||s<0||s>255)return t.destroy(new Error(`Invalid ${o}: ${s}`)),!1;l+=1+1;break}case"binary":{if(s&&s===null)return t.destroy(new Error(`Invalid ${o}: ${s}`)),!1;l+=1+q.byteLength(s)+2;break}case"int16":{if(typeof s!="number"||s<0||s>65535)return t.destroy(new Error(`Invalid ${o}: ${s}`)),!1;l+=1+2;break}case"int32":{if(typeof s!="number"||s<0||s>4294967295)return t.destroy(new Error(`Invalid ${o}: ${s}`)),!1;l+=1+4;break}case"var":{if(typeof s!="number"||s<0||s>268435455)return t.destroy(new Error(`Invalid ${o}: ${s}`)),!1;l+=1+q.byteLength(hl(s));break}case"string":{if(typeof s!="string")return t.destroy(new Error(`Invalid ${o}: ${s}`)),!1;l+=1+2+q.byteLength(s.toString());break}case"pair":{if(typeof s!="object")return t.destroy(new Error(`Invalid ${o}: ${s}`)),!1;l+=Object.getOwnPropertyNames(s).reduce((c,h)=>{let d=s[h];return Array.isArray(d)?c+=d.reduce((g,y)=>(g+=1+2+q.byteLength(h.toString())+2+q.byteLength(y.toString()),g),0):c+=1+2+q.byteLength(h.toString())+2+q.byteLength(s[h].toString()),c},0);break}default:return t.destroy(new Error(`Invalid property ${o}: ${s}`)),!1}return l}if(e)for(let o in e){let s=0,a=0,l=e[o];if(Array.isArray(l))for(let c=0;c<l.length;c++){if(a=i(o,l[c]),!a)return!1;s+=a}else{if(a=i(o,l),!a)return!1;s=a}if(!s)return!1;r+=s}return{length:q.byteLength(hl(r))+r,write(){Pg(t,e,r)}}}function en(t,e,r,i){let n=["reasonString","userProperties"],o=r&&r.properties&&r.properties.maximumPacketSize?r.properties.maximumPacketSize:0,s=nr(t,e);if(o)for(;i+s.length>o;){let a=n.shift();if(a&&e[a])delete e[a],s=nr(t,e);else return!1}return s}function Cg(t,e,r){switch(F.propertiesTypes[e]){case"byte":{t.write(q.from([F.properties[e]])),t.write(q.from([+r]));break}case"int8":{t.write(q.from([F.properties[e]])),t.write(q.from([r]));break}case"binary":{t.write(q.from([F.properties[e]])),vi(t,r);break}case"int16":{t.write(q.from([F.properties[e]])),xe(t,r);break}case"int32":{t.write(q.from([F.properties[e]])),LS(t,r);break}case"var":{t.write(q.from([F.properties[e]])),Ke(t,r);break}case"string":{t.write(q.from([F.properties[e]])),Lr(t,r);break}case"pair":{Object.getOwnPropertyNames(r).forEach(n=>{let o=r[n];Array.isArray(o)?o.forEach(s=>{t.write(q.from([F.properties[e]])),Ig(t,n.toString(),s.toString())}):(t.write(q.from([F.properties[e]])),Ig(t,n.toString(),o.toString()))});break}default:return t.destroy(new Error(`Invalid property ${e} value: ${r}`)),!1}}function Pg(t,e,r){Ke(t,r);for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&e[i]!==null){let n=e[i];if(Array.isArray(n))for(let o=0;o<n.length;o++)Cg(t,i,n[o]);else Cg(t,i,n)}}function xg(t){return t?t instanceof q?t.length:q.byteLength(t):0}function Bg(t){return typeof t=="string"||t instanceof q}kg.exports=Og});var Ug=M((kL,Lg)=>{w();m();_();var US=pl(),{EventEmitter:NS}=(Ut(),K(Lt)),{Buffer:Mg}=(de(),K(_e));function DS(t,e){let r=new gl;return US(t,r,e),r.concat()}var gl=class extends NS{constructor(){super(),this._array=new Array(20),this._i=0}write(e){return this._array[this._i++]=e,!0}concat(){let e=0,r=new Array(this._array.length),i=this._array,n=0,o;for(o=0;o<i.length&&i[o]!==void 0;o++)typeof i[o]!="string"?r[o]=i[o].length:r[o]=Mg.byteLength(i[o]),e+=r[o];let s=Mg.allocUnsafe(e);for(o=0;o<i.length&&i[o]!==void 0;o++)typeof i[o]!="string"?(i[o].copy(s,n),n+=r[o]):(s.write(i[o],n),n+=r[o]);return s}destroy(e){e&&this.emit("error",e)}};Lg.exports=DS});var Ng=M(Es=>{w();m();_();Es.parser=mg().parser;Es.generate=Ug();Es.writeToStream=pl()});var wl=M(bl=>{"use strict";w();m();_();Object.defineProperty(bl,"__esModule",{value:!0});var yl=class{constructor(){this.nextId=Math.max(1,Math.floor(Math.random()*65535))}allocate(){let e=this.nextId++;return this.nextId===65536&&(this.nextId=1),e}getLastAllocated(){return this.nextId===1?65535:this.nextId-1}register(e){return!0}deallocate(e){}clear(){}};bl.default=yl});var qg=M((eU,Dg)=>{"use strict";w();m();_();function qS(t,e,r){var i=this;this._callback=t,this._args=r,this._interval=setInterval(t,e,this._args),this.reschedule=function(n){n||(n=i._interval),i._interval&&clearInterval(i._interval),i._interval=setInterval(i._callback,n,i._args)},this.clear=function(){i._interval&&(clearInterval(i._interval),i._interval=void 0)},this.destroy=function(){i._interval&&clearInterval(i._interval),i._callback=void 0,i._interval=void 0,i._args=void 0}}function jS(){if(typeof arguments[0]!="function")throw new Error("callback needed");if(typeof arguments[1]!="number")throw new Error("interval needed");var t;if(arguments.length>0){t=new Array(arguments.length-2);for(var e=0;e<t.length;e++)t[e]=arguments[e+2]}return new qS(arguments[0],arguments[1],t)}Dg.exports=jS});var Fg=M((aU,jg)=>{"use strict";w();m();_();jg.exports=FS;function Ei(t){return t instanceof B?B.from(t):new t.constructor(t.buffer.slice(),t.byteOffset,t.length)}function FS(t){if(t=t||{},t.circles)return WS(t);return t.proto?i:r;function e(n,o){for(var s=Object.keys(n),a=new Array(s.length),l=0;l<s.length;l++){var c=s[l],h=n[c];typeof h!="object"||h===null?a[c]=h:h instanceof Date?a[c]=new Date(h):ArrayBuffer.isView(h)?a[c]=Ei(h):a[c]=o(h)}return a}function r(n){if(typeof n!="object"||n===null)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return e(n,r);if(n instanceof Map)return new Map(e(Array.from(n),r));if(n instanceof Set)return new Set(e(Array.from(n),r));var o={};for(var s in n)if(Object.hasOwnProperty.call(n,s)!==!1){var a=n[s];typeof a!="object"||a===null?o[s]=a:a instanceof Date?o[s]=new Date(a):a instanceof Map?o[s]=new Map(e(Array.from(a),r)):a instanceof Set?o[s]=new Set(e(Array.from(a),r)):ArrayBuffer.isView(a)?o[s]=Ei(a):o[s]=r(a)}return o}function i(n){if(typeof n!="object"||n===null)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return e(n,i);if(n instanceof Map)return new Map(e(Array.from(n),i));if(n instanceof Set)return new Set(e(Array.from(n),i));var o={};for(var s in n){var a=n[s];typeof a!="object"||a===null?o[s]=a:a instanceof Date?o[s]=new Date(a):a instanceof Map?o[s]=new Map(e(Array.from(a),i)):a instanceof Set?o[s]=new Set(e(Array.from(a),i)):ArrayBuffer.isView(a)?o[s]=Ei(a):o[s]=i(a)}return o}}function WS(t){var e=[],r=[];return t.proto?o:n;function i(s,a){for(var l=Object.keys(s),c=new Array(l.length),h=0;h<l.length;h++){var d=l[h],g=s[d];if(typeof g!="object"||g===null)c[d]=g;else if(g instanceof Date)c[d]=new Date(g);else if(ArrayBuffer.isView(g))c[d]=Ei(g);else{var y=e.indexOf(g);y!==-1?c[d]=r[y]:c[d]=a(g)}}return c}function n(s){if(typeof s!="object"||s===null)return s;if(s instanceof Date)return new Date(s);if(Array.isArray(s))return i(s,n);if(s instanceof Map)return new Map(i(Array.from(s),n));if(s instanceof Set)return new Set(i(Array.from(s),n));var a={};e.push(s),r.push(a);for(var l in s)if(Object.hasOwnProperty.call(s,l)!==!1){var c=s[l];if(typeof c!="object"||c===null)a[l]=c;else if(c instanceof Date)a[l]=new Date(c);else if(c instanceof Map)a[l]=new Map(i(Array.from(c),n));else if(c instanceof Set)a[l]=new Set(i(Array.from(c),n));else if(ArrayBuffer.isView(c))a[l]=Ei(c);else{var h=e.indexOf(c);h!==-1?a[l]=r[h]:a[l]=n(c)}}return e.pop(),r.pop(),a}function o(s){if(typeof s!="object"||s===null)return s;if(s instanceof Date)return new Date(s);if(Array.isArray(s))return i(s,o);if(s instanceof Map)return new Map(i(Array.from(s),o));if(s instanceof Set)return new Set(i(Array.from(s),o));var a={};e.push(s),r.push(a);for(var l in s){var c=s[l];if(typeof c!="object"||c===null)a[l]=c;else if(c instanceof Date)a[l]=new Date(c);else if(c instanceof Map)a[l]=new Map(i(Array.from(c),o));else if(c instanceof Set)a[l]=new Set(i(Array.from(c),o));else if(ArrayBuffer.isView(c))a[l]=Ei(c);else{var h=e.indexOf(c);h!==-1?a[l]=r[h]:a[l]=o(c)}}return e.pop(),r.pop(),a}}});var $g=M((pU,Wg)=>{"use strict";w();m();_();Wg.exports=Fg()()});var Vg=M(Si=>{"use strict";w();m();_();Object.defineProperty(Si,"__esModule",{value:!0});Si.validateTopics=Si.validateTopic=void 0;function Hg(t){let e=t.split("/");for(let r=0;r<e.length;r++)if(e[r]!=="+"){if(e[r]==="#")return r===e.length-1;if(e[r].indexOf("+")!==-1||e[r].indexOf("#")!==-1)return!1}return!0}Si.validateTopic=Hg;function $S(t){if(t.length===0)return"empty_topic_list";for(let e=0;e<t.length;e++)if(!Hg(t[e]))return t[e];return null}Si.validateTopics=$S});var vl=M(ml=>{"use strict";w();m();_();Object.defineProperty(ml,"__esModule",{value:!0});var HS=kr(),VS={objectMode:!0},zS={clean:!0},_l=class{constructor(e){this.options=e||{},this.options=Object.assign(Object.assign({},zS),e),this._inflights=new Map}put(e,r){return this._inflights.set(e.messageId,e),r&&r(),this}createStream(){let e=new HS.Readable(VS),r=[],i=!1,n=0;return this._inflights.forEach((o,s)=>{r.push(o)}),e._read=()=>{!i&&n<r.length?e.push(r[n++]):e.push(null)},e.destroy=o=>{if(!i)return i=!0,setTimeout(()=>{e.emit("close")},0),e},e}del(e,r){let i=this._inflights.get(e.messageId);return i?(this._inflights.delete(e.messageId),r(null,i)):r&&r(new Error("missing packet")),this}get(e,r){let i=this._inflights.get(e.messageId);return i?r(null,i):r&&r(new Error("missing packet")),this}close(e){this.options.clean&&(this._inflights=null),e&&e()}};ml.default=_l});var Gg=M(El=>{"use strict";w();m();_();Object.defineProperty(El,"__esModule",{value:!0});var zg=[0,16,128,131,135,144,145,151,153],GS=(t,e,r)=>{t.log("handlePublish: packet %o",e),r=typeof r<"u"?r:t.noop;let i=e.topic.toString(),n=e.payload,{qos:o}=e,{messageId:s}=e,{options:a}=t;if(t.options.protocolVersion===5){let l;if(e.properties&&(l=e.properties.topicAlias),typeof l<"u")if(i.length===0)if(l>0&&l<=65535){let c=t.topicAliasRecv.getTopicByAlias(l);if(c)i=c,t.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",i,l);else{t.log("handlePublish :: unregistered topic alias. alias: %d",l),t.emit("error",new Error("Received unregistered Topic Alias"));return}}else{t.log("handlePublish :: topic alias out of range. alias: %d",l),t.emit("error",new Error("Received Topic Alias is out of range"));return}else if(t.topicAliasRecv.put(i,l))t.log("handlePublish :: registered topic: %s - alias: %d",i,l);else{t.log("handlePublish :: topic alias out of range. alias: %d",l),t.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(t.log("handlePublish: qos %d",o),o){case 2:{a.customHandleAcks(i,n,e,(l,c)=>{if(typeof l=="number"&&(c=l,l=null),l)return t.emit("error",l);if(zg.indexOf(c)===-1)return t.emit("error",new Error("Wrong reason code for pubrec"));c?t._sendPacket({cmd:"pubrec",messageId:s,reasonCode:c},r):t.incomingStore.put(e,()=>{t._sendPacket({cmd:"pubrec",messageId:s},r)})});break}case 1:{a.customHandleAcks(i,n,e,(l,c)=>{if(typeof l=="number"&&(c=l,l=null),l)return t.emit("error",l);if(zg.indexOf(c)===-1)return t.emit("error",new Error("Wrong reason code for puback"));c||t.emit("message",i,n,e),t.handleMessage(e,h=>{if(h)return r&&r(h);t._sendPacket({cmd:"puback",messageId:s,reasonCode:c},r)})});break}case 0:t.emit("message",i,n,e),t.handleMessage(e,r);break;default:t.log("handlePublish: unknown QoS. Doing nothing.");break}};El.default=GS});var tn=M(Ai=>{"use strict";w();m();_();Object.defineProperty(Ai,"__esModule",{value:!0});Ai.applyMixin=Ai.ErrorWithReasonCode=void 0;var Sl=class t extends Error{constructor(e,r){super(e),this.code=r,Object.setPrototypeOf(this,t.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}};Ai.ErrorWithReasonCode=Sl;function KS(t,e,r=!1){var i;let n=[e];for(;;){let o=n[0],s=Object.getPrototypeOf(o);if(s?.prototype)n.unshift(s);else break}for(let o of n)for(let s of Object.getOwnPropertyNames(o.prototype))(r||s!=="constructor")&&Object.defineProperty(t.prototype,s,(i=Object.getOwnPropertyDescriptor(o.prototype,s))!==null&&i!==void 0?i:Object.create(null))}Ai.applyMixin=KS});var rn=M(Ur=>{"use strict";w();m();_();Object.defineProperty(Ur,"__esModule",{value:!0});Ur.ReasonCodes=void 0;Ur.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"};var YS=(t,e)=>{let{messageId:r}=e,i=e.cmd,n=null,o=t.outgoing[r]?t.outgoing[r].cb:null,s;if(!o){t.log("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(t.log("_handleAck :: packet type",i),i){case"pubcomp":case"puback":{let a=e.reasonCode;a&&a>0&&a!==16?(s=new Error(`Publish error: ${Ur.ReasonCodes[a]}`),s.code=a,t._removeOutgoingAndStoreMessage(r,()=>{o(s,e)})):t._removeOutgoingAndStoreMessage(r,o);break}case"pubrec":{n={cmd:"pubrel",qos:2,messageId:r};let a=e.reasonCode;a&&a>0&&a!==16?(s=new Error(`Publish error: ${Ur.ReasonCodes[a]}`),s.code=a,t._removeOutgoingAndStoreMessage(r,()=>{o(s,e)})):t._sendPacket(n);break}case"suback":{delete t.outgoing[r],t.messageIdProvider.deallocate(r);let a=e.granted;for(let l=0;l<a.length;l++)if(a[l]&128){let c=t.messageIdToTopic[r];c&&c.forEach(h=>{delete t._resubscribeTopics[h]})}delete t.messageIdToTopic[r],t._invokeStoreProcessingQueue(),o(null,e);break}case"unsuback":{delete t.outgoing[r],t.messageIdProvider.deallocate(r),t._invokeStoreProcessingQueue(),o(null);break}default:t.emit("error",new Error("unrecognized packet type"))}t.disconnecting&&Object.keys(t.outgoing).length===0&&t.emit("outgoingEmpty")};Ur.default=YS});var Yg=M(Al=>{"use strict";w();m();_();Object.defineProperty(Al,"__esModule",{value:!0});var Kg=tn(),QS=rn(),JS=(t,e)=>{let{options:r}=t,i=r.protocolVersion,n=i===5?e.reasonCode:e.returnCode;if(i!==5){let o=new Kg.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${i}`,n);t.emit("error",o);return}t.handleAuth(e,(o,s)=>{if(o){t.emit("error",o);return}if(n===24)t.reconnecting=!1,t._sendPacket(s);else{let a=new Kg.ErrorWithReasonCode(`Connection refused: ${QS.ReasonCodes[n]}`,n);t.emit("error",a)}})};Al.default=JS});var ey=M(As=>{"use strict";w();m();_();Object.defineProperty(As,"__esModule",{value:!0});As.LRUCache=void 0;var nn=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Jg=new Set,Rl=typeof R=="object"&&R?R:{},Xg=(t,e,r,i)=>{typeof Rl.emitWarning=="function"?Rl.emitWarning(t,e,r,i):console.error(`[${r}] ${e}: ${t}`)},Ss=globalThis.AbortController,Qg=globalThis.AbortSignal;if(typeof Ss>"u"){Qg=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,n){this._onabort.push(n)}},Ss=class{constructor(){e()}signal=new Qg;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let n of this.signal._onabort)n(i);this.signal.onabort?.(i)}}};let t=Rl.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,Xg("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",e))}}var XS=t=>!Jg.has(t),cN=Symbol("type"),sr=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),Zg=t=>sr(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Ri:null:null,Ri=class extends Array{constructor(e){super(e),this.fill(0)}},Tl=class t{heap;length;static#l=!1;static create(e){let r=Zg(e);if(!r)return[];t.#l=!0;let i=new t(e,r);return t.#l=!1,i}constructor(e,r){if(!t.#l)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Il=class t{#l;#c;#p;#g;#P;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#i;#y;#n;#r;#e;#u;#h;#a;#s;#b;#o;#E;#S;#w;#_;#R;#f;static unsafeExposeInternals(e){return{starts:e.#S,ttls:e.#w,sizes:e.#E,keyMap:e.#n,keyList:e.#r,valList:e.#e,next:e.#u,prev:e.#h,get head(){return e.#a},get tail(){return e.#s},free:e.#b,isBackgroundFetch:r=>e.#t(r),backgroundFetch:(r,i,n,o)=>e.#x(r,i,n,o),moveToTail:r=>e.#C(r),indexes:r=>e.#m(r),rindexes:r=>e.#v(r),isStale:r=>e.#d(r)}}get max(){return this.#l}get maxSize(){return this.#c}get calculatedSize(){return this.#y}get size(){return this.#i}get fetchMethod(){return this.#P}get dispose(){return this.#p}get disposeAfter(){return this.#g}constructor(e){let{max:r=0,ttl:i,ttlResolution:n=1,ttlAutopurge:o,updateAgeOnGet:s,updateAgeOnHas:a,allowStale:l,dispose:c,disposeAfter:h,noDisposeOnSet:d,noUpdateTTL:g,maxSize:y=0,maxEntrySize:v=0,sizeCalculation:E,fetchMethod:A,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:O,allowStaleOnFetchRejection:I,allowStaleOnFetchAbort:N,ignoreFetchAbort:D}=e;if(r!==0&&!sr(r))throw new TypeError("max option must be a nonnegative integer");let Y=r?Zg(r):Array;if(!Y)throw new Error("invalid max value: "+r);if(this.#l=r,this.#c=y,this.maxEntrySize=v||this.#c,this.sizeCalculation=E,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(A!==void 0&&typeof A!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#P=A,this.#R=!!A,this.#n=new Map,this.#r=new Array(r).fill(void 0),this.#e=new Array(r).fill(void 0),this.#u=new Y(r),this.#h=new Y(r),this.#a=0,this.#s=0,this.#b=Tl.create(r),this.#i=0,this.#y=0,typeof c=="function"&&(this.#p=c),typeof h=="function"?(this.#g=h,this.#o=[]):(this.#g=void 0,this.#o=void 0),this.#_=!!this.#p,this.#f=!!this.#g,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!g,this.noDeleteOnFetchRejection=!!T,this.allowStaleOnFetchRejection=!!I,this.allowStaleOnFetchAbort=!!N,this.ignoreFetchAbort=!!D,this.maxEntrySize!==0){if(this.#c!==0&&!sr(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!sr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#D()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!O,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!a,this.ttlResolution=sr(n)||n===0?n:1,this.ttlAutopurge=!!o,this.ttl=i||0,this.ttl){if(!sr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#l===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#l&&!this.#c){let Z="LRU_CACHE_UNBOUNDED";XS(Z)&&(Jg.add(Z),Xg("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Z,t))}}getRemainingTTL(e){return this.#n.has(e)?1/0:0}#k(){let e=new Ri(this.#l),r=new Ri(this.#l);this.#w=e,this.#S=r,this.#M=(o,s,a=nn.now())=>{if(r[o]=s!==0?a:0,e[o]=s,s!==0&&this.ttlAutopurge){let l=setTimeout(()=>{this.#d(o)&&this.delete(this.#r[o])},s+1);l.unref&&l.unref()}},this.#T=o=>{r[o]=e[o]!==0?nn.now():0},this.#A=(o,s)=>{if(e[s]){let a=e[s],l=r[s];o.ttl=a,o.start=l,o.now=i||n();let c=o.now-l;o.remainingTTL=a-c}};let i=0,n=()=>{let o=nn.now();if(this.ttlResolution>0){i=o;let s=setTimeout(()=>i=0,this.ttlResolution);s.unref&&s.unref()}return o};this.getRemainingTTL=o=>{let s=this.#n.get(o);if(s===void 0)return 0;let a=e[s],l=r[s];if(a===0||l===0)return 1/0;let c=(i||n())-l;return a-c},this.#d=o=>e[o]!==0&&r[o]!==0&&(i||n())-r[o]>e[o]}#T=()=>{};#A=()=>{};#M=()=>{};#d=()=>!1;#D(){let e=new Ri(this.#l);this.#y=0,this.#E=e,this.#I=r=>{this.#y-=e[r],e[r]=0},this.#L=(r,i,n,o)=>{if(this.#t(i))return 0;if(!sr(n))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(n=o(i,r),!sr(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return n},this.#B=(r,i,n)=>{if(e[r]=i,this.#c){let o=this.#c-e[r];for(;this.#y>o;)this.#O(!0)}this.#y+=e[r],n&&(n.entrySize=i,n.totalCalculatedSize=this.#y)}}#I=e=>{};#B=(e,r,i)=>{};#L=(e,r,i,n)=>{if(i||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#m({allowStale:e=this.allowStale}={}){if(this.#i)for(let r=this.#s;!(!this.#U(r)||((e||!this.#d(r))&&(yield r),r===this.#a));)r=this.#h[r]}*#v({allowStale:e=this.allowStale}={}){if(this.#i)for(let r=this.#a;!(!this.#U(r)||((e||!this.#d(r))&&(yield r),r===this.#s));)r=this.#u[r]}#U(e){return e!==void 0&&this.#n.get(this.#r[e])===e}*entries(){for(let e of this.#m())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e])&&(yield[this.#r[e],this.#e[e]])}*rentries(){for(let e of this.#v())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e])&&(yield[this.#r[e],this.#e[e]])}*keys(){for(let e of this.#m()){let r=this.#r[e];r!==void 0&&!this.#t(this.#e[e])&&(yield r)}}*rkeys(){for(let e of this.#v()){let r=this.#r[e];r!==void 0&&!this.#t(this.#e[e])&&(yield r)}}*values(){for(let e of this.#m())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e])}*rvalues(){for(let e of this.#v())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e])}[Symbol.iterator](){return this.entries()}find(e,r={}){for(let i of this.#m()){let n=this.#e[i],o=this.#t(n)?n.__staleWhileFetching:n;if(o!==void 0&&e(o,this.#r[i],this))return this.get(this.#r[i],r)}}forEach(e,r=this){for(let i of this.#m()){let n=this.#e[i],o=this.#t(n)?n.__staleWhileFetching:n;o!==void 0&&e.call(r,o,this.#r[i],this)}}rforEach(e,r=this){for(let i of this.#v()){let n=this.#e[i],o=this.#t(n)?n.__staleWhileFetching:n;o!==void 0&&e.call(r,o,this.#r[i],this)}}purgeStale(){let e=!1;for(let r of this.#v({allowStale:!0}))this.#d(r)&&(this.delete(this.#r[r]),e=!0);return e}dump(){let e=[];for(let r of this.#m({allowStale:!0})){let i=this.#r[r],n=this.#e[r],o=this.#t(n)?n.__staleWhileFetching:n;if(o===void 0||i===void 0)continue;let s={value:o};if(this.#w&&this.#S){s.ttl=this.#w[r];let a=nn.now()-this.#S[r];s.start=Math.floor(Date.now()-a)}this.#E&&(s.size=this.#E[r]),e.unshift([i,s])}return e}load(e){this.clear();for(let[r,i]of e){if(i.start){let n=Date.now()-i.start;i.start=nn.now()-n}this.set(r,i.value,i)}}set(e,r,i={}){if(r===void 0)return this.delete(e),this;let{ttl:n=this.ttl,start:o,noDisposeOnSet:s=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:l}=i,{noUpdateTTL:c=this.noUpdateTTL}=i,h=this.#L(e,r,i.size||0,a);if(this.maxEntrySize&&h>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.delete(e),this;let d=this.#i===0?void 0:this.#n.get(e);if(d===void 0)d=this.#i===0?this.#s:this.#b.length!==0?this.#b.pop():this.#i===this.#l?this.#O(!1):this.#i,this.#r[d]=e,this.#e[d]=r,this.#n.set(e,d),this.#u[this.#s]=d,this.#h[d]=this.#s,this.#s=d,this.#i++,this.#B(d,h,l),l&&(l.set="add"),c=!1;else{this.#C(d);let g=this.#e[d];if(r!==g){if(this.#R&&this.#t(g)){g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:y}=g;y!==void 0&&!s&&(this.#_&&this.#p?.(y,e,"set"),this.#f&&this.#o?.push([y,e,"set"]))}else s||(this.#_&&this.#p?.(g,e,"set"),this.#f&&this.#o?.push([g,e,"set"]));if(this.#I(d),this.#B(d,h,l),this.#e[d]=r,l){l.set="replace";let y=g&&this.#t(g)?g.__staleWhileFetching:g;y!==void 0&&(l.oldValue=y)}}else l&&(l.set="update")}if(n!==0&&!this.#w&&this.#k(),this.#w&&(c||this.#M(d,n,o),l&&this.#A(l,d)),!s&&this.#f&&this.#o){let g=this.#o,y;for(;y=g?.shift();)this.#g?.(...y)}return this}pop(){try{for(;this.#i;){let e=this.#e[this.#a];if(this.#O(!0),this.#t(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#f&&this.#o){let e=this.#o,r;for(;r=e?.shift();)this.#g?.(...r)}}}#O(e){let r=this.#a,i=this.#r[r],n=this.#e[r];return this.#R&&this.#t(n)?n.__abortController.abort(new Error("evicted")):(this.#_||this.#f)&&(this.#_&&this.#p?.(n,i,"evict"),this.#f&&this.#o?.push([n,i,"evict"])),this.#I(r),e&&(this.#r[r]=void 0,this.#e[r]=void 0,this.#b.push(r)),this.#i===1?(this.#a=this.#s=0,this.#b.length=0):this.#a=this.#u[r],this.#n.delete(i),this.#i--,r}has(e,r={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:n}=r,o=this.#n.get(e);if(o!==void 0){let s=this.#e[o];if(this.#t(s)&&s.__staleWhileFetching===void 0)return!1;if(this.#d(o))n&&(n.has="stale",this.#A(n,o));else return i&&this.#T(o),n&&(n.has="hit",this.#A(n,o)),!0}else n&&(n.has="miss");return!1}peek(e,r={}){let{allowStale:i=this.allowStale}=r,n=this.#n.get(e);if(n!==void 0&&(i||!this.#d(n))){let o=this.#e[n];return this.#t(o)?o.__staleWhileFetching:o}}#x(e,r,i,n){let o=r===void 0?void 0:this.#e[r];if(this.#t(o))return o;let s=new Ss,{signal:a}=i;a?.addEventListener("abort",()=>s.abort(a.reason),{signal:s.signal});let l={signal:s.signal,options:i,context:n},c=(E,A=!1)=>{let{aborted:T}=s.signal,O=i.ignoreFetchAbort&&E!==void 0;if(i.status&&(T&&!A?(i.status.fetchAborted=!0,i.status.fetchError=s.signal.reason,O&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),T&&!O&&!A)return d(s.signal.reason);let I=y;return this.#e[r]===y&&(E===void 0?I.__staleWhileFetching?this.#e[r]=I.__staleWhileFetching:this.delete(e):(i.status&&(i.status.fetchUpdated=!0),this.set(e,E,l.options))),E},h=E=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=E),d(E)),d=E=>{let{aborted:A}=s.signal,T=A&&i.allowStaleOnFetchAbort,O=T||i.allowStaleOnFetchRejection,I=O||i.noDeleteOnFetchRejection,N=y;if(this.#e[r]===y&&(!I||N.__staleWhileFetching===void 0?this.delete(e):T||(this.#e[r]=N.__staleWhileFetching)),O)return i.status&&N.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),N.__staleWhileFetching;if(N.__returned===N)throw E},g=(E,A)=>{let T=this.#P?.(e,o,l);T&&T instanceof Promise&&T.then(O=>E(O===void 0?void 0:O),A),s.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(E(void 0),i.allowStaleOnFetchAbort&&(E=O=>c(O,!0)))})};i.status&&(i.status.fetchDispatched=!0);let y=new Promise(g).then(c,h),v=Object.assign(y,{__abortController:s,__staleWhileFetching:o,__returned:void 0});return r===void 0?(this.set(e,v,{...l.options,status:void 0}),r=this.#n.get(e)):this.#e[r]=v,v}#t(e){if(!this.#R)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof Ss}async fetch(e,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:l=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:h=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:g=this.allowStaleOnFetchRejection,ignoreFetchAbort:y=this.ignoreFetchAbort,allowStaleOnFetchAbort:v=this.allowStaleOnFetchAbort,context:E,forceRefresh:A=!1,status:T,signal:O}=r;if(!this.#R)return T&&(T.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:o,status:T});let I={allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:o,ttl:s,noDisposeOnSet:a,size:l,sizeCalculation:c,noUpdateTTL:h,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:g,allowStaleOnFetchAbort:v,ignoreFetchAbort:y,status:T,signal:O},N=this.#n.get(e);if(N===void 0){T&&(T.fetch="miss");let D=this.#x(e,N,I,E);return D.__returned=D}else{let D=this.#e[N];if(this.#t(D)){let Pe=i&&D.__staleWhileFetching!==void 0;return T&&(T.fetch="inflight",Pe&&(T.returnedStale=!0)),Pe?D.__staleWhileFetching:D.__returned=D}let Y=this.#d(N);if(!A&&!Y)return T&&(T.fetch="hit"),this.#C(N),n&&this.#T(N),T&&this.#A(T,N),D;let Z=this.#x(e,N,I,E),te=Z.__staleWhileFetching!==void 0&&i;return T&&(T.fetch=Y?"stale":"refresh",te&&Y&&(T.returnedStale=!0)),te?Z.__staleWhileFetching:Z.__returned=Z}}get(e,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:s}=r,a=this.#n.get(e);if(a!==void 0){let l=this.#e[a],c=this.#t(l);return s&&this.#A(s,a),this.#d(a)?(s&&(s.get="stale"),c?(s&&i&&l.__staleWhileFetching!==void 0&&(s.returnedStale=!0),i?l.__staleWhileFetching:void 0):(o||this.delete(e),s&&i&&(s.returnedStale=!0),i?l:void 0)):(s&&(s.get="hit"),c?l.__staleWhileFetching:(this.#C(a),n&&this.#T(a),l))}else s&&(s.get="miss")}#N(e,r){this.#h[r]=e,this.#u[e]=r}#C(e){e!==this.#s&&(e===this.#a?this.#a=this.#u[e]:this.#N(this.#h[e],this.#u[e]),this.#N(this.#s,e),this.#s=e)}delete(e){let r=!1;if(this.#i!==0){let i=this.#n.get(e);if(i!==void 0)if(r=!0,this.#i===1)this.clear();else{this.#I(i);let n=this.#e[i];this.#t(n)?n.__abortController.abort(new Error("deleted")):(this.#_||this.#f)&&(this.#_&&this.#p?.(n,e,"delete"),this.#f&&this.#o?.push([n,e,"delete"])),this.#n.delete(e),this.#r[i]=void 0,this.#e[i]=void 0,i===this.#s?this.#s=this.#h[i]:i===this.#a?this.#a=this.#u[i]:(this.#u[this.#h[i]]=this.#u[i],this.#h[this.#u[i]]=this.#h[i]),this.#i--,this.#b.push(i)}}if(this.#f&&this.#o?.length){let i=this.#o,n;for(;n=i?.shift();)this.#g?.(...n)}return r}clear(){for(let e of this.#v({allowStale:!0})){let r=this.#e[e];if(this.#t(r))r.__abortController.abort(new Error("deleted"));else{let i=this.#r[e];this.#_&&this.#p?.(r,i,"delete"),this.#f&&this.#o?.push([r,i,"delete"])}}if(this.#n.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#w&&this.#S&&(this.#w.fill(0),this.#S.fill(0)),this.#E&&this.#E.fill(0),this.#a=0,this.#s=0,this.#b.length=0,this.#y=0,this.#i=0,this.#f&&this.#o){let e=this.#o,r;for(;r=e?.shift();)this.#g?.(...r)}}};As.LRUCache=Il});var _t=M(or=>{"use strict";w();m();_();Object.defineProperty(or,"t",{value:!0});or.ContainerIterator=or.Container=or.Base=void 0;var Cl=class{constructor(e=0){this.iteratorType=e}equals(e){return this.o===e.o}};or.ContainerIterator=Cl;var Rs=class{constructor(){this.i=0}get length(){return this.i}size(){return this.i}empty(){return this.i===0}};or.Base=Rs;var Pl=class extends Rs{};or.Container=Pl});var ty=M(Ts=>{"use strict";w();m();_();Object.defineProperty(Ts,"t",{value:!0});Ts.default=void 0;var ZS=_t(),Bl=class extends ZS.Base{constructor(e=[]){super(),this.S=[];let r=this;e.forEach(function(i){r.push(i)})}clear(){this.i=0,this.S=[]}push(e){return this.S.push(e),this.i+=1,this.i}pop(){if(this.i!==0)return this.i-=1,this.S.pop()}top(){return this.S[this.i-1]}},eA=Bl;Ts.default=eA});var ry=M(Is=>{"use strict";w();m();_();Object.defineProperty(Is,"t",{value:!0});Is.default=void 0;var tA=_t(),Ol=class extends tA.Base{constructor(e=[]){super(),this.j=0,this.q=[];let r=this;e.forEach(function(i){r.push(i)})}clear(){this.q=[],this.i=this.j=0}push(e){let r=this.q.length;if(this.j/r>.5&&this.j+this.i>=r&&r>4096){let i=this.i;for(let n=0;n<i;++n)this.q[n]=this.q[this.j+n];this.j=0,this.q[this.i]=e}else this.q[this.j+this.i]=e;return++this.i}pop(){if(this.i===0)return;let e=this.q[this.j++];return this.i-=1,e}front(){if(this.i!==0)return this.q[this.j]}},rA=Ol;Is.default=rA});var iy=M(Cs=>{"use strict";w();m();_();Object.defineProperty(Cs,"t",{value:!0});Cs.default=void 0;var iA=_t(),xl=class extends iA.Base{constructor(e=[],r=function(n,o){return n>o?-1:n<o?1:0},i=!0){if(super(),this.v=r,Array.isArray(e))this.C=i?[...e]:e;else{this.C=[];let o=this;e.forEach(function(s){o.C.push(s)})}this.i=this.C.length;let n=this.i>>1;for(let o=this.i-1>>1;o>=0;--o)this.k(o,n)}m(e){let r=this.C[e];for(;e>0;){let i=e-1>>1,n=this.C[i];if(this.v(n,r)<=0)break;this.C[e]=n,e=i}this.C[e]=r}k(e,r){let i=this.C[e];for(;e<r;){let n=e<<1|1,o=n+1,s=this.C[n];if(o<this.i&&this.v(s,this.C[o])>0&&(n=o,s=this.C[o]),this.v(s,i)>=0)break;this.C[e]=s,e=n}this.C[e]=i}clear(){this.i=0,this.C.length=0}push(e){this.C.push(e),this.m(this.i),this.i+=1}pop(){if(this.i===0)return;let e=this.C[0],r=this.C.pop();return this.i-=1,this.i&&(this.C[0]=r,this.k(0,this.i>>1)),e}top(){return this.C[0]}find(e){return this.C.indexOf(e)>=0}remove(e){let r=this.C.indexOf(e);return r<0?!1:(r===0?this.pop():r===this.i-1?(this.C.pop(),this.i-=1):(this.C.splice(r,1,this.C.pop()),this.i-=1,this.m(r),this.k(r,this.i>>1)),!0)}updateItem(e){let r=this.C.indexOf(e);return r<0?!1:(this.m(r),this.k(r,this.i>>1),!0)}toArray(){return[...this.C]}},nA=xl;Cs.default=nA});var Bs=M(Ps=>{"use strict";w();m();_();Object.defineProperty(Ps,"t",{value:!0});Ps.default=void 0;var sA=_t(),kl=class extends sA.Container{},oA=kl;Ps.default=oA});var mt=M(Ml=>{"use strict";w();m();_();Object.defineProperty(Ml,"t",{value:!0});Ml.throwIteratorAccessError=aA;function aA(){throw new RangeError("Iterator access denied!")}});var Ul=M(xs=>{"use strict";w();m();_();Object.defineProperty(xs,"t",{value:!0});xs.RandomIterator=void 0;var lA=_t(),Os=mt(),Ll=class extends lA.ContainerIterator{constructor(e,r){super(r),this.o=e,this.iteratorType===0?(this.pre=function(){return this.o===0&&(0,Os.throwIteratorAccessError)(),this.o-=1,this},this.next=function(){return this.o===this.container.size()&&(0,Os.throwIteratorAccessError)(),this.o+=1,this}):(this.pre=function(){return this.o===this.container.size()-1&&(0,Os.throwIteratorAccessError)(),this.o+=1,this},this.next=function(){return this.o===-1&&(0,Os.throwIteratorAccessError)(),this.o-=1,this})}get pointer(){return this.container.getElementByPos(this.o)}set pointer(e){this.container.setElementByPos(this.o,e)}};xs.RandomIterator=Ll});var ny=M(ks=>{"use strict";w();m();_();Object.defineProperty(ks,"t",{value:!0});ks.default=void 0;var uA=cA(Bs()),fA=Ul();function cA(t){return t&&t.t?t:{default:t}}var Nr=class t extends fA.RandomIterator{constructor(e,r,i){super(e,i),this.container=r}copy(){return new t(this.o,this.container,this.iteratorType)}},Nl=class extends uA.default{constructor(e=[],r=!0){if(super(),Array.isArray(e))this.J=r?[...e]:e,this.i=e.length;else{this.J=[];let i=this;e.forEach(function(n){i.pushBack(n)})}}clear(){this.i=0,this.J.length=0}begin(){return new Nr(0,this)}end(){return new Nr(this.i,this)}rBegin(){return new Nr(this.i-1,this,1)}rEnd(){return new Nr(-1,this,1)}front(){return this.J[0]}back(){return this.J[this.i-1]}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;return this.J[e]}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;return this.J.splice(e,1),this.i-=1,this.i}eraseElementByValue(e){let r=0;for(let i=0;i<this.i;++i)this.J[i]!==e&&(this.J[r++]=this.J[i]);return this.i=this.J.length=r,this.i}eraseElementByIterator(e){let r=e.o;return e=e.next(),this.eraseElementByPos(r),e}pushBack(e){return this.J.push(e),this.i+=1,this.i}popBack(){if(this.i!==0)return this.i-=1,this.J.pop()}setElementByPos(e,r){if(e<0||e>this.i-1)throw new RangeError;this.J[e]=r}insert(e,r,i=1){if(e<0||e>this.i)throw new RangeError;return this.J.splice(e,0,...new Array(i).fill(r)),this.i+=i,this.i}find(e){for(let r=0;r<this.i;++r)if(this.J[r]===e)return new Nr(r,this);return this.end()}reverse(){this.J.reverse()}unique(){let e=1;for(let r=1;r<this.i;++r)this.J[r]!==this.J[r-1]&&(this.J[e++]=this.J[r]);return this.i=this.J.length=e,this.i}sort(e){this.J.sort(e)}forEach(e){for(let r=0;r<this.i;++r)e(this.J[r],r,this)}[Symbol.iterator](){return function*(){yield*this.J}.bind(this)()}},hA=Nl;ks.default=hA});var sy=M(Ms=>{"use strict";w();m();_();Object.defineProperty(Ms,"t",{value:!0});Ms.default=void 0;var dA=gA(Bs()),pA=_t(),Dr=mt();function gA(t){return t&&t.t?t:{default:t}}var qr=class t extends pA.ContainerIterator{constructor(e,r,i,n){super(n),this.o=e,this.h=r,this.container=i,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,Dr.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,Dr.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,Dr.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,Dr.throwIteratorAccessError)(),this.o=this.o.L,this})}get pointer(){return this.o===this.h&&(0,Dr.throwIteratorAccessError)(),this.o.l}set pointer(e){this.o===this.h&&(0,Dr.throwIteratorAccessError)(),this.o.l=e}copy(){return new t(this.o,this.h,this.container,this.iteratorType)}},Dl=class extends dA.default{constructor(e=[]){super(),this.h={},this.p=this._=this.h.L=this.h.B=this.h;let r=this;e.forEach(function(i){r.pushBack(i)})}V(e){let{L:r,B:i}=e;r.B=i,i.L=r,e===this.p&&(this.p=i),e===this._&&(this._=r),this.i-=1}G(e,r){let i=r.B,n={l:e,L:r,B:i};r.B=n,i.L=n,r===this.h&&(this.p=n),i===this.h&&(this._=n),this.i+=1}clear(){this.i=0,this.p=this._=this.h.L=this.h.B=this.h}begin(){return new qr(this.p,this.h,this)}end(){return new qr(this.h,this.h,this)}rBegin(){return new qr(this._,this.h,this,1)}rEnd(){return new qr(this.h,this.h,this,1)}front(){return this.p.l}back(){return this._.l}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let r=this.p;for(;e--;)r=r.B;return r.l}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let r=this.p;for(;e--;)r=r.B;return this.V(r),this.i}eraseElementByValue(e){let r=this.p;for(;r!==this.h;)r.l===e&&this.V(r),r=r.B;return this.i}eraseElementByIterator(e){let r=e.o;return r===this.h&&(0,Dr.throwIteratorAccessError)(),e=e.next(),this.V(r),e}pushBack(e){return this.G(e,this._),this.i}popBack(){if(this.i===0)return;let e=this._.l;return this.V(this._),e}pushFront(e){return this.G(e,this.h),this.i}popFront(){if(this.i===0)return;let e=this.p.l;return this.V(this.p),e}setElementByPos(e,r){if(e<0||e>this.i-1)throw new RangeError;let i=this.p;for(;e--;)i=i.B;i.l=r}insert(e,r,i=1){if(e<0||e>this.i)throw new RangeError;if(i<=0)return this.i;if(e===0)for(;i--;)this.pushFront(r);else if(e===this.i)for(;i--;)this.pushBack(r);else{let n=this.p;for(let s=1;s<e;++s)n=n.B;let o=n.B;for(this.i+=i;i--;)n.B={l:r,L:n},n.B.L=n,n=n.B;n.B=o,o.L=n}return this.i}find(e){let r=this.p;for(;r!==this.h;){if(r.l===e)return new qr(r,this.h,this);r=r.B}return this.end()}reverse(){if(this.i<=1)return;let e=this.p,r=this._,i=0;for(;i<<1<this.i;){let n=e.l;e.l=r.l,r.l=n,e=e.B,r=r.L,i+=1}}unique(){if(this.i<=1)return this.i;let e=this.p;for(;e!==this.h;){let r=e;for(;r.B!==this.h&&r.l===r.B.l;)r=r.B,this.i-=1;e.B=r.B,e.B.L=e,e=e.B}return this.i}sort(e){if(this.i<=1)return;let r=[];this.forEach(function(n){r.push(n)}),r.sort(e);let i=this.p;r.forEach(function(n){i.l=n,i=i.B})}merge(e){let r=this;if(this.i===0)e.forEach(function(i){r.pushBack(i)});else{let i=this.p;e.forEach(function(n){for(;i!==r.h&&i.l<=n;)i=i.B;r.G(n,i.L)})}return this.i}forEach(e){let r=this.p,i=0;for(;r!==this.h;)e(r.l,i++,this),r=r.B}[Symbol.iterator](){return function*(){if(this.i===0)return;let e=this.p;for(;e!==this.h;)yield e.l,e=e.B}.bind(this)()}},yA=Dl;Ms.default=yA});var oy=M(Ls=>{"use strict";w();m();_();Object.defineProperty(Ls,"t",{value:!0});Ls.default=void 0;var bA=_A(Bs()),wA=Ul();function _A(t){return t&&t.t?t:{default:t}}var jr=class t extends wA.RandomIterator{constructor(e,r,i){super(e,i),this.container=r}copy(){return new t(this.o,this.container,this.iteratorType)}},ql=class extends bA.default{constructor(e=[],r=4096){super(),this.j=0,this.D=0,this.R=0,this.N=0,this.P=0,this.A=[];let i=(()=>{if(typeof e.length=="number")return e.length;if(typeof e.size=="number")return e.size;if(typeof e.size=="function")return e.size();throw new TypeError("Cannot get the length or size of the container")})();this.F=r,this.P=Math.max(Math.ceil(i/this.F),1);for(let s=0;s<this.P;++s)this.A.push(new Array(this.F));let n=Math.ceil(i/this.F);this.j=this.R=(this.P>>1)-(n>>1),this.D=this.N=this.F-i%this.F>>1;let o=this;e.forEach(function(s){o.pushBack(s)})}T(){let e=[],r=Math.max(this.P>>1,1);for(let i=0;i<r;++i)e[i]=new Array(this.F);for(let i=this.j;i<this.P;++i)e[e.length]=this.A[i];for(let i=0;i<this.R;++i)e[e.length]=this.A[i];e[e.length]=[...this.A[this.R]],this.j=r,this.R=e.length-1;for(let i=0;i<r;++i)e[e.length]=new Array(this.F);this.A=e,this.P=e.length}O(e){let r=this.D+e+1,i=r%this.F,n=i-1,o=this.j+(r-i)/this.F;return i===0&&(o-=1),o%=this.P,n<0&&(n+=this.F),{curNodeBucketIndex:o,curNodePointerIndex:n}}clear(){this.A=[new Array(this.F)],this.P=1,this.j=this.R=this.i=0,this.D=this.N=this.F>>1}begin(){return new jr(0,this)}end(){return new jr(this.i,this)}rBegin(){return new jr(this.i-1,this,1)}rEnd(){return new jr(-1,this,1)}front(){if(this.i!==0)return this.A[this.j][this.D]}back(){if(this.i!==0)return this.A[this.R][this.N]}pushBack(e){return this.i&&(this.N<this.F-1?this.N+=1:this.R<this.P-1?(this.R+=1,this.N=0):(this.R=0,this.N=0),this.R===this.j&&this.N===this.D&&this.T()),this.i+=1,this.A[this.R][this.N]=e,this.i}popBack(){if(this.i===0)return;let e=this.A[this.R][this.N];return this.i!==1&&(this.N>0?this.N-=1:this.R>0?(this.R-=1,this.N=this.F-1):(this.R=this.P-1,this.N=this.F-1)),this.i-=1,e}pushFront(e){return this.i&&(this.D>0?this.D-=1:this.j>0?(this.j-=1,this.D=this.F-1):(this.j=this.P-1,this.D=this.F-1),this.j===this.R&&this.D===this.N&&this.T()),this.i+=1,this.A[this.j][this.D]=e,this.i}popFront(){if(this.i===0)return;let e=this.A[this.j][this.D];return this.i!==1&&(this.D<this.F-1?this.D+=1:this.j<this.P-1?(this.j+=1,this.D=0):(this.j=0,this.D=0)),this.i-=1,e}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let{curNodeBucketIndex:r,curNodePointerIndex:i}=this.O(e);return this.A[r][i]}setElementByPos(e,r){if(e<0||e>this.i-1)throw new RangeError;let{curNodeBucketIndex:i,curNodePointerIndex:n}=this.O(e);this.A[i][n]=r}insert(e,r,i=1){if(e<0||e>this.i)throw new RangeError;if(e===0)for(;i--;)this.pushFront(r);else if(e===this.i)for(;i--;)this.pushBack(r);else{let n=[];for(let o=e;o<this.i;++o)n.push(this.getElementByPos(o));this.cut(e-1);for(let o=0;o<i;++o)this.pushBack(r);for(let o=0;o<n.length;++o)this.pushBack(n[o])}return this.i}cut(e){if(e<0)return this.clear(),0;let{curNodeBucketIndex:r,curNodePointerIndex:i}=this.O(e);return this.R=r,this.N=i,this.i=e+1,this.i}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;if(e===0)this.popFront();else if(e===this.i-1)this.popBack();else{let r=[];for(let n=e+1;n<this.i;++n)r.push(this.getElementByPos(n));this.cut(e),this.popBack();let i=this;r.forEach(function(n){i.pushBack(n)})}return this.i}eraseElementByValue(e){if(this.i===0)return 0;let r=[];for(let n=0;n<this.i;++n){let o=this.getElementByPos(n);o!==e&&r.push(o)}let i=r.length;for(let n=0;n<i;++n)this.setElementByPos(n,r[n]);return this.cut(i-1)}eraseElementByIterator(e){let r=e.o;return this.eraseElementByPos(r),e=e.next(),e}find(e){for(let r=0;r<this.i;++r)if(this.getElementByPos(r)===e)return new jr(r,this);return this.end()}reverse(){let e=0,r=this.i-1;for(;e<r;){let i=this.getElementByPos(e);this.setElementByPos(e,this.getElementByPos(r)),this.setElementByPos(r,i),e+=1,r-=1}}unique(){if(this.i<=1)return this.i;let e=1,r=this.getElementByPos(0);for(let i=1;i<this.i;++i){let n=this.getElementByPos(i);n!==r&&(r=n,this.setElementByPos(e++,n))}for(;this.i>e;)this.popBack();return this.i}sort(e){let r=[];for(let i=0;i<this.i;++i)r.push(this.getElementByPos(i));r.sort(e);for(let i=0;i<this.i;++i)this.setElementByPos(i,r[i])}shrinkToFit(){if(this.i===0)return;let e=[];this.forEach(function(r){e.push(r)}),this.P=Math.max(Math.ceil(this.i/this.F),1),this.i=this.j=this.R=this.D=this.N=0,this.A=[];for(let r=0;r<this.P;++r)this.A.push(new Array(this.F));for(let r=0;r<e.length;++r)this.pushBack(e[r])}forEach(e){for(let r=0;r<this.i;++r)e(this.getElementByPos(r),r,this)}[Symbol.iterator](){return function*(){for(let e=0;e<this.i;++e)yield this.getElementByPos(e)}.bind(this)()}},mA=ql;Ls.default=mA});var ay=M(Ti=>{"use strict";w();m();_();Object.defineProperty(Ti,"t",{value:!0});Ti.TreeNodeEnableIndex=Ti.TreeNode=void 0;var Us=class{constructor(e,r){this.ee=1,this.u=void 0,this.l=void 0,this.U=void 0,this.W=void 0,this.tt=void 0,this.u=e,this.l=r}L(){let e=this;if(e.ee===1&&e.tt.tt===e)e=e.W;else if(e.U)for(e=e.U;e.W;)e=e.W;else{let r=e.tt;for(;r.U===e;)e=r,r=e.tt;e=r}return e}B(){let e=this;if(e.W){for(e=e.W;e.U;)e=e.U;return e}else{let r=e.tt;for(;r.W===e;)e=r,r=e.tt;return e.W!==r?r:e}}te(){let e=this.tt,r=this.W,i=r.U;return e.tt===this?e.tt=r:e.U===this?e.U=r:e.W=r,r.tt=e,r.U=this,this.tt=r,this.W=i,i&&(i.tt=this),r}se(){let e=this.tt,r=this.U,i=r.W;return e.tt===this?e.tt=r:e.U===this?e.U=r:e.W=r,r.tt=e,r.W=this,this.tt=r,this.U=i,i&&(i.tt=this),r}};Ti.TreeNode=Us;var jl=class extends Us{constructor(){super(...arguments),this.rt=1}te(){let e=super.te();return this.ie(),e.ie(),e}se(){let e=super.se();return this.ie(),e.ie(),e}ie(){this.rt=1,this.U&&(this.rt+=this.U.rt),this.W&&(this.rt+=this.W.rt)}};Ti.TreeNodeEnableIndex=jl});var Wl=M(Ns=>{"use strict";w();m();_();Object.defineProperty(Ns,"t",{value:!0});Ns.default=void 0;var ly=ay(),vA=_t(),uy=mt(),Fl=class extends vA.Container{constructor(e=function(i,n){return i<n?-1:i>n?1:0},r=!1){super(),this.Y=void 0,this.v=e,r?(this.re=ly.TreeNodeEnableIndex,this.M=function(i,n,o){let s=this.ne(i,n,o);if(s){let a=s.tt;for(;a!==this.h;)a.rt+=1,a=a.tt;let l=this.he(s);if(l){let{parentNode:c,grandParent:h,curNode:d}=l;c.ie(),h.ie(),d.ie()}}return this.i},this.V=function(i){let n=this.fe(i);for(;n!==this.h;)n.rt-=1,n=n.tt}):(this.re=ly.TreeNode,this.M=function(i,n,o){let s=this.ne(i,n,o);return s&&this.he(s),this.i},this.V=this.fe),this.h=new this.re}X(e,r){let i=this.h;for(;e;){let n=this.v(e.u,r);if(n<0)e=e.W;else if(n>0)i=e,e=e.U;else return e}return i}Z(e,r){let i=this.h;for(;e;)this.v(e.u,r)<=0?e=e.W:(i=e,e=e.U);return i}$(e,r){let i=this.h;for(;e;){let n=this.v(e.u,r);if(n<0)i=e,e=e.W;else if(n>0)e=e.U;else return e}return i}rr(e,r){let i=this.h;for(;e;)this.v(e.u,r)<0?(i=e,e=e.W):e=e.U;return i}ue(e){for(;;){let r=e.tt;if(r===this.h)return;if(e.ee===1){e.ee=0;return}if(e===r.U){let i=r.W;if(i.ee===1)i.ee=0,r.ee=1,r===this.Y?this.Y=r.te():r.te();else if(i.W&&i.W.ee===1){i.ee=r.ee,r.ee=0,i.W.ee=0,r===this.Y?this.Y=r.te():r.te();return}else i.U&&i.U.ee===1?(i.ee=1,i.U.ee=0,i.se()):(i.ee=1,e=r)}else{let i=r.U;if(i.ee===1)i.ee=0,r.ee=1,r===this.Y?this.Y=r.se():r.se();else if(i.U&&i.U.ee===1){i.ee=r.ee,r.ee=0,i.U.ee=0,r===this.Y?this.Y=r.se():r.se();return}else i.W&&i.W.ee===1?(i.ee=1,i.W.ee=0,i.te()):(i.ee=1,e=r)}}}fe(e){if(this.i===1)return this.clear(),this.h;let r=e;for(;r.U||r.W;){if(r.W)for(r=r.W;r.U;)r=r.U;else r=r.U;[e.u,r.u]=[r.u,e.u],[e.l,r.l]=[r.l,e.l],e=r}this.h.U===r?this.h.U=r.tt:this.h.W===r&&(this.h.W=r.tt),this.ue(r);let i=r.tt;return r===i.U?i.U=void 0:i.W=void 0,this.i-=1,this.Y.ee=0,i}oe(e,r){return e===void 0?!1:this.oe(e.U,r)||r(e)?!0:this.oe(e.W,r)}he(e){for(;;){let r=e.tt;if(r.ee===0)return;let i=r.tt;if(r===i.U){let n=i.W;if(n&&n.ee===1){if(n.ee=r.ee=0,i===this.Y)return;i.ee=1,e=i;continue}else if(e===r.W){if(e.ee=0,e.U&&(e.U.tt=r),e.W&&(e.W.tt=i),r.W=e.U,i.U=e.W,e.U=r,e.W=i,i===this.Y)this.Y=e,this.h.tt=e;else{let o=i.tt;o.U===i?o.U=e:o.W=e}return e.tt=i.tt,r.tt=e,i.tt=e,i.ee=1,{parentNode:r,grandParent:i,curNode:e}}else r.ee=0,i===this.Y?this.Y=i.se():i.se(),i.ee=1}else{let n=i.U;if(n&&n.ee===1){if(n.ee=r.ee=0,i===this.Y)return;i.ee=1,e=i;continue}else if(e===r.U){if(e.ee=0,e.U&&(e.U.tt=i),e.W&&(e.W.tt=r),i.W=e.U,r.U=e.W,e.U=i,e.W=r,i===this.Y)this.Y=e,this.h.tt=e;else{let o=i.tt;o.U===i?o.U=e:o.W=e}return e.tt=i.tt,r.tt=e,i.tt=e,i.ee=1,{parentNode:r,grandParent:i,curNode:e}}else r.ee=0,i===this.Y?this.Y=i.te():i.te(),i.ee=1}return}}ne(e,r,i){if(this.Y===void 0){this.i+=1,this.Y=new this.re(e,r),this.Y.ee=0,this.Y.tt=this.h,this.h.tt=this.Y,this.h.U=this.Y,this.h.W=this.Y;return}let n,o=this.h.U,s=this.v(o.u,e);if(s===0){o.l=r;return}else if(s>0)o.U=new this.re(e,r),o.U.tt=o,n=o.U,this.h.U=n;else{let a=this.h.W,l=this.v(a.u,e);if(l===0){a.l=r;return}else if(l<0)a.W=new this.re(e,r),a.W.tt=a,n=a.W,this.h.W=n;else{if(i!==void 0){let c=i.o;if(c!==this.h){let h=this.v(c.u,e);if(h===0){c.l=r;return}else if(h>0){let d=c.L(),g=this.v(d.u,e);if(g===0){d.l=r;return}else g<0&&(n=new this.re(e,r),d.W===void 0?(d.W=n,n.tt=d):(c.U=n,n.tt=c))}}}if(n===void 0)for(n=this.Y;;){let c=this.v(n.u,e);if(c>0){if(n.U===void 0){n.U=new this.re(e,r),n.U.tt=n,n=n.U;break}n=n.U}else if(c<0){if(n.W===void 0){n.W=new this.re(e,r),n.W.tt=n,n=n.W;break}n=n.W}else{n.l=r;return}}}}return this.i+=1,n}I(e,r){for(;e;){let i=this.v(e.u,r);if(i<0)e=e.W;else if(i>0)e=e.U;else return e}return e||this.h}clear(){this.i=0,this.Y=void 0,this.h.tt=void 0,this.h.U=this.h.W=void 0}updateKeyByIterator(e,r){let i=e.o;if(i===this.h&&(0,uy.throwIteratorAccessError)(),this.i===1)return i.u=r,!0;if(i===this.h.U)return this.v(i.B().u,r)>0?(i.u=r,!0):!1;if(i===this.h.W)return this.v(i.L().u,r)<0?(i.u=r,!0):!1;let n=i.L().u;if(this.v(n,r)>=0)return!1;let o=i.B().u;return this.v(o,r)<=0?!1:(i.u=r,!0)}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let r=0,i=this;return this.oe(this.Y,function(n){return e===r?(i.V(n),!0):(r+=1,!1)}),this.i}eraseElementByKey(e){if(this.i===0)return!1;let r=this.I(this.Y,e);return r===this.h?!1:(this.V(r),!0)}eraseElementByIterator(e){let r=e.o;r===this.h&&(0,uy.throwIteratorAccessError)();let i=r.W===void 0;return e.iteratorType===0?i&&e.next():(!i||r.U===void 0)&&e.next(),this.V(r),e}forEach(e){let r=0;for(let i of this)e(i,r++,this)}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let r,i=0;for(let n of this){if(i===e){r=n;break}i+=1}return r}getHeight(){if(this.i===0)return 0;let e=function(r){return r?Math.max(e(r.U),e(r.W))+1:0};return e(this.Y)}},EA=Fl;Ns.default=EA});var Hl=M(qs=>{"use strict";w();m();_();Object.defineProperty(qs,"t",{value:!0});qs.default=void 0;var SA=_t(),Ds=mt(),$l=class extends SA.ContainerIterator{constructor(e,r,i){super(i),this.o=e,this.h=r,this.iteratorType===0?(this.pre=function(){return this.o===this.h.U&&(0,Ds.throwIteratorAccessError)(),this.o=this.o.L(),this},this.next=function(){return this.o===this.h&&(0,Ds.throwIteratorAccessError)(),this.o=this.o.B(),this}):(this.pre=function(){return this.o===this.h.W&&(0,Ds.throwIteratorAccessError)(),this.o=this.o.B(),this},this.next=function(){return this.o===this.h&&(0,Ds.throwIteratorAccessError)(),this.o=this.o.L(),this})}get index(){let e=this.o,r=this.h.tt;if(e===this.h)return r?r.rt-1:0;let i=0;for(e.U&&(i+=e.U.rt);e!==r;){let n=e.tt;e===n.W&&(i+=1,n.U&&(i+=n.U.rt)),e=n}return i}},AA=$l;qs.default=AA});var cy=M(js=>{"use strict";w();m();_();Object.defineProperty(js,"t",{value:!0});js.default=void 0;var RA=fy(Wl()),TA=fy(Hl()),IA=mt();function fy(t){return t&&t.t?t:{default:t}}var st=class t extends TA.default{constructor(e,r,i,n){super(e,r,n),this.container=i}get pointer(){return this.o===this.h&&(0,IA.throwIteratorAccessError)(),this.o.u}copy(){return new t(this.o,this.h,this.container,this.iteratorType)}},Vl=class extends RA.default{constructor(e=[],r,i){super(r,i);let n=this;e.forEach(function(o){n.insert(o)})}*K(e){e!==void 0&&(yield*this.K(e.U),yield e.u,yield*this.K(e.W))}begin(){return new st(this.h.U||this.h,this.h,this)}end(){return new st(this.h,this.h,this)}rBegin(){return new st(this.h.W||this.h,this.h,this,1)}rEnd(){return new st(this.h,this.h,this,1)}front(){return this.h.U?this.h.U.u:void 0}back(){return this.h.W?this.h.W.u:void 0}insert(e,r){return this.M(e,void 0,r)}find(e){let r=this.I(this.Y,e);return new st(r,this.h,this)}lowerBound(e){let r=this.X(this.Y,e);return new st(r,this.h,this)}upperBound(e){let r=this.Z(this.Y,e);return new st(r,this.h,this)}reverseLowerBound(e){let r=this.$(this.Y,e);return new st(r,this.h,this)}reverseUpperBound(e){let r=this.rr(this.Y,e);return new st(r,this.h,this)}union(e){let r=this;return e.forEach(function(i){r.insert(i)}),this.i}[Symbol.iterator](){return this.K(this.Y)}},CA=Vl;js.default=CA});var dy=M(Fs=>{"use strict";w();m();_();Object.defineProperty(Fs,"t",{value:!0});Fs.default=void 0;var PA=hy(Wl()),BA=hy(Hl()),OA=mt();function hy(t){return t&&t.t?t:{default:t}}var ot=class t extends BA.default{constructor(e,r,i,n){super(e,r,n),this.container=i}get pointer(){this.o===this.h&&(0,OA.throwIteratorAccessError)();let e=this;return new Proxy([],{get(r,i){if(i==="0")return e.o.u;if(i==="1")return e.o.l},set(r,i,n){if(i!=="1")throw new TypeError("props must be 1");return e.o.l=n,!0}})}copy(){return new t(this.o,this.h,this.container,this.iteratorType)}},zl=class extends PA.default{constructor(e=[],r,i){super(r,i);let n=this;e.forEach(function(o){n.setElement(o[0],o[1])})}*K(e){e!==void 0&&(yield*this.K(e.U),yield[e.u,e.l],yield*this.K(e.W))}begin(){return new ot(this.h.U||this.h,this.h,this)}end(){return new ot(this.h,this.h,this)}rBegin(){return new ot(this.h.W||this.h,this.h,this,1)}rEnd(){return new ot(this.h,this.h,this,1)}front(){if(this.i===0)return;let e=this.h.U;return[e.u,e.l]}back(){if(this.i===0)return;let e=this.h.W;return[e.u,e.l]}lowerBound(e){let r=this.X(this.Y,e);return new ot(r,this.h,this)}upperBound(e){let r=this.Z(this.Y,e);return new ot(r,this.h,this)}reverseLowerBound(e){let r=this.$(this.Y,e);return new ot(r,this.h,this)}reverseUpperBound(e){let r=this.rr(this.Y,e);return new ot(r,this.h,this)}setElement(e,r,i){return this.M(e,r,i)}find(e){let r=this.I(this.Y,e);return new ot(r,this.h,this)}getElementByKey(e){return this.I(this.Y,e).l}union(e){let r=this;return e.forEach(function(i){r.setElement(i[0],i[1])}),this.i}[Symbol.iterator](){return this.K(this.Y)}},xA=zl;Fs.default=xA});var Kl=M(Gl=>{"use strict";w();m();_();Object.defineProperty(Gl,"t",{value:!0});Gl.default=kA;function kA(t){let e=typeof t;return e==="object"&&t!==null||e==="function"}});var Xl=M(Ii=>{"use strict";w();m();_();Object.defineProperty(Ii,"t",{value:!0});Ii.HashContainerIterator=Ii.HashContainer=void 0;var py=_t(),Yl=MA(Kl()),sn=mt();function MA(t){return t&&t.t?t:{default:t}}var Ql=class extends py.ContainerIterator{constructor(e,r,i){super(i),this.o=e,this.h=r,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,sn.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,sn.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,sn.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,sn.throwIteratorAccessError)(),this.o=this.o.L,this})}};Ii.HashContainerIterator=Ql;var Jl=class extends py.Container{constructor(){super(),this.H=[],this.g={},this.HASH_TAG=Symbol("@@HASH_TAG"),Object.setPrototypeOf(this.g,null),this.h={},this.h.L=this.h.B=this.p=this._=this.h}V(e){let{L:r,B:i}=e;r.B=i,i.L=r,e===this.p&&(this.p=i),e===this._&&(this._=r),this.i-=1}M(e,r,i){i===void 0&&(i=(0,Yl.default)(e));let n;if(i){let o=e[this.HASH_TAG];if(o!==void 0)return this.H[o].l=r,this.i;Object.defineProperty(e,this.HASH_TAG,{value:this.H.length,configurable:!0}),n={u:e,l:r,L:this._,B:this.h},this.H.push(n)}else{let o=this.g[e];if(o)return o.l=r,this.i;n={u:e,l:r,L:this._,B:this.h},this.g[e]=n}return this.i===0?(this.p=n,this.h.B=n):this._.B=n,this._=n,this.h.L=n,++this.i}I(e,r){if(r===void 0&&(r=(0,Yl.default)(e)),r){let i=e[this.HASH_TAG];return i===void 0?this.h:this.H[i]}else return this.g[e]||this.h}clear(){let e=this.HASH_TAG;this.H.forEach(function(r){delete r.u[e]}),this.H=[],this.g={},Object.setPrototypeOf(this.g,null),this.i=0,this.p=this._=this.h.L=this.h.B=this.h}eraseElementByKey(e,r){let i;if(r===void 0&&(r=(0,Yl.default)(e)),r){let n=e[this.HASH_TAG];if(n===void 0)return!1;delete e[this.HASH_TAG],i=this.H[n],delete this.H[n]}else{if(i=this.g[e],i===void 0)return!1;delete this.g[e]}return this.V(i),!0}eraseElementByIterator(e){let r=e.o;return r===this.h&&(0,sn.throwIteratorAccessError)(),this.V(r),e.next()}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let r=this.p;for(;e--;)r=r.B;return this.V(r),this.i}};Ii.HashContainer=Jl});var yy=M(Ws=>{"use strict";w();m();_();Object.defineProperty(Ws,"t",{value:!0});Ws.default=void 0;var gy=Xl(),LA=mt(),Fr=class t extends gy.HashContainerIterator{constructor(e,r,i,n){super(e,r,n),this.container=i}get pointer(){return this.o===this.h&&(0,LA.throwIteratorAccessError)(),this.o.u}copy(){return new t(this.o,this.h,this.container,this.iteratorType)}},Zl=class extends gy.HashContainer{constructor(e=[]){super();let r=this;e.forEach(function(i){r.insert(i)})}begin(){return new Fr(this.p,this.h,this)}end(){return new Fr(this.h,this.h,this)}rBegin(){return new Fr(this._,this.h,this,1)}rEnd(){return new Fr(this.h,this.h,this,1)}front(){return this.p.u}back(){return this._.u}insert(e,r){return this.M(e,void 0,r)}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let r=this.p;for(;e--;)r=r.B;return r.u}find(e,r){let i=this.I(e,r);return new Fr(i,this.h,this)}forEach(e){let r=0,i=this.p;for(;i!==this.h;)e(i.u,r++,this),i=i.B}[Symbol.iterator](){return function*(){let e=this.p;for(;e!==this.h;)yield e.u,e=e.B}.bind(this)()}},UA=Zl;Ws.default=UA});var wy=M($s=>{"use strict";w();m();_();Object.defineProperty($s,"t",{value:!0});$s.default=void 0;var by=Xl(),NA=qA(Kl()),DA=mt();function qA(t){return t&&t.t?t:{default:t}}var Wr=class t extends by.HashContainerIterator{constructor(e,r,i,n){super(e,r,n),this.container=i}get pointer(){this.o===this.h&&(0,DA.throwIteratorAccessError)();let e=this;return new Proxy([],{get(r,i){if(i==="0")return e.o.u;if(i==="1")return e.o.l},set(r,i,n){if(i!=="1")throw new TypeError("props must be 1");return e.o.l=n,!0}})}copy(){return new t(this.o,this.h,this.container,this.iteratorType)}},eu=class extends by.HashContainer{constructor(e=[]){super();let r=this;e.forEach(function(i){r.setElement(i[0],i[1])})}begin(){return new Wr(this.p,this.h,this)}end(){return new Wr(this.h,this.h,this)}rBegin(){return new Wr(this._,this.h,this,1)}rEnd(){return new Wr(this.h,this.h,this,1)}front(){if(this.i!==0)return[this.p.u,this.p.l]}back(){if(this.i!==0)return[this._.u,this._.l]}setElement(e,r,i){return this.M(e,r,i)}getElementByKey(e,r){if(r===void 0&&(r=(0,NA.default)(e)),r){let n=e[this.HASH_TAG];return n!==void 0?this.H[n].l:void 0}let i=this.g[e];return i?i.l:void 0}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let r=this.p;for(;e--;)r=r.B;return[r.u,r.l]}find(e,r){let i=this.I(e,r);return new Wr(i,this.h,this)}forEach(e){let r=0,i=this.p;for(;i!==this.h;)e([i.u,i.l],r++,this),i=i.B}[Symbol.iterator](){return function*(){let e=this.p;for(;e!==this.h;)yield[e.u,e.l],e=e.B}.bind(this)()}},jA=eu;$s.default=jA});var _y=M(Ye=>{"use strict";w();m();_();Object.defineProperty(Ye,"t",{value:!0});Object.defineProperty(Ye,"Deque",{enumerable:!0,get:function(){return zA.default}});Object.defineProperty(Ye,"HashMap",{enumerable:!0,get:function(){return QA.default}});Object.defineProperty(Ye,"HashSet",{enumerable:!0,get:function(){return YA.default}});Object.defineProperty(Ye,"LinkList",{enumerable:!0,get:function(){return VA.default}});Object.defineProperty(Ye,"OrderedMap",{enumerable:!0,get:function(){return KA.default}});Object.defineProperty(Ye,"OrderedSet",{enumerable:!0,get:function(){return GA.default}});Object.defineProperty(Ye,"PriorityQueue",{enumerable:!0,get:function(){return $A.default}});Object.defineProperty(Ye,"Queue",{enumerable:!0,get:function(){return WA.default}});Object.defineProperty(Ye,"Stack",{enumerable:!0,get:function(){return FA.default}});Object.defineProperty(Ye,"Vector",{enumerable:!0,get:function(){return HA.default}});var FA=vt(ty()),WA=vt(ry()),$A=vt(iy()),HA=vt(ny()),VA=vt(sy()),zA=vt(oy()),GA=vt(cy()),KA=vt(dy()),YA=vt(yy()),QA=vt(wy());function vt(t){return t&&t.t?t:{default:t}}});var vy=M((Jq,my)=>{"use strict";w();m();_();var JA=_y().OrderedSet,Et=wt()("number-allocator:trace"),XA=wt()("number-allocator:error");function ke(t,e){this.low=t,this.high=e}ke.prototype.equals=function(t){return this.low===t.low&&this.high===t.high};ke.prototype.compare=function(t){return this.low<t.low&&this.high<t.low?-1:t.low<this.low&&t.high<this.low?1:0};function St(t,e){if(!(this instanceof St))return new St(t,e);this.min=t,this.max=e,this.ss=new JA([],(r,i)=>r.compare(i)),Et("Create"),this.clear()}St.prototype.firstVacant=function(){return this.ss.size()===0?null:this.ss.front().low};St.prototype.alloc=function(){if(this.ss.size()===0)return Et("alloc():empty"),null;let t=this.ss.begin(),e=t.pointer.low,r=t.pointer.high,i=e;return i+1<=r?this.ss.updateKeyByIterator(t,new ke(e+1,r)):this.ss.eraseElementByPos(0),Et("alloc():"+i),i};St.prototype.use=function(t){let e=new ke(t,t),r=this.ss.lowerBound(e);if(!r.equals(this.ss.end())){let i=r.pointer.low,n=r.pointer.high;return r.pointer.equals(e)?(this.ss.eraseElementByIterator(r),Et("use():"+t),!0):i>t?!1:i===t?(this.ss.updateKeyByIterator(r,new ke(i+1,n)),Et("use():"+t),!0):n===t?(this.ss.updateKeyByIterator(r,new ke(i,n-1)),Et("use():"+t),!0):(this.ss.updateKeyByIterator(r,new ke(t+1,n)),this.ss.insert(new ke(i,t-1)),Et("use():"+t),!0)}return Et("use():failed"),!1};St.prototype.free=function(t){if(t<this.min||t>this.max){XA("free():"+t+" is out of range");return}let e=new ke(t,t),r=this.ss.upperBound(e);if(r.equals(this.ss.end())){if(r.equals(this.ss.begin())){this.ss.insert(e);return}r.pre();let i=r.pointer.high;r.pointer.high+1===t?this.ss.updateKeyByIterator(r,new ke(i,t)):this.ss.insert(e)}else if(r.equals(this.ss.begin()))if(t+1===r.pointer.low){let i=r.pointer.high;this.ss.updateKeyByIterator(r,new ke(t,i))}else this.ss.insert(e);else{let i=r.pointer.low,n=r.pointer.high;r.pre();let o=r.pointer.low;r.pointer.high+1===t?t+1===i?(this.ss.eraseElementByIterator(r),this.ss.updateKeyByIterator(r,new ke(o,n))):this.ss.updateKeyByIterator(r,new ke(o,t)):t+1===i?(this.ss.eraseElementByIterator(r.next()),this.ss.insert(new ke(t,n))):this.ss.insert(e)}Et("free():"+t)};St.prototype.clear=function(){Et("clear()"),this.ss.clear(),this.ss.insert(new ke(this.min,this.max))};St.prototype.intervalCount=function(){return this.ss.size()};St.prototype.dump=function(){console.log("length:"+this.ss.size());for(let t of this.ss)console.log(t)};my.exports=St});var tu=M((nj,Ey)=>{w();m();_();var ZA=vy();Ey.exports.NumberAllocator=ZA});var Sy=M(iu=>{"use strict";w();m();_();Object.defineProperty(iu,"__esModule",{value:!0});var eR=ey(),tR=tu(),ru=class{constructor(e){e>0&&(this.aliasToTopic=new eR.LRUCache({max:e}),this.topicToAlias={},this.numberAllocator=new tR.NumberAllocator(1,e),this.max=e,this.length=0)}put(e,r){if(r===0||r>this.max)return!1;let i=this.aliasToTopic.get(r);return i&&delete this.topicToAlias[i],this.aliasToTopic.set(r,e),this.topicToAlias[e]=r,this.numberAllocator.use(r),this.length=this.aliasToTopic.size,!0}getTopicByAlias(e){return this.aliasToTopic.get(e)}getAliasByTopic(e){let r=this.topicToAlias[e];return typeof r<"u"&&this.aliasToTopic.get(r),r}clear(){this.aliasToTopic.clear(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0}getLruAlias(){let e=this.numberAllocator.firstVacant();return e||[...this.aliasToTopic.keys()][this.aliasToTopic.size-1]}};iu.default=ru});var Ay=M(on=>{"use strict";w();m();_();var rR=on&&on.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(on,"__esModule",{value:!0});var iR=rn(),nR=rR(Sy()),sR=tn(),oR=(t,e)=>{t.log("_handleConnack");let{options:r}=t,n=r.protocolVersion===5?e.reasonCode:e.returnCode;if(clearTimeout(t.connackTimer),delete t.topicAliasSend,e.properties){if(e.properties.topicAliasMaximum){if(e.properties.topicAliasMaximum>65535){t.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}e.properties.topicAliasMaximum>0&&(t.topicAliasSend=new nR.default(e.properties.topicAliasMaximum))}e.properties.serverKeepAlive&&r.keepalive&&(r.keepalive=e.properties.serverKeepAlive,t._shiftPingInterval()),e.properties.maximumPacketSize&&(r.properties||(r.properties={}),r.properties.maximumPacketSize=e.properties.maximumPacketSize)}if(n===0)t.reconnecting=!1,t._onConnect(e);else if(n>0){let o=new sR.ErrorWithReasonCode(`Connection refused: ${iR.ReasonCodes[n]}`,n);t.emit("error",o)}};on.default=oR});var Ry=M(nu=>{"use strict";w();m();_();Object.defineProperty(nu,"__esModule",{value:!0});var aR=(t,e,r)=>{t.log("handling pubrel packet");let i=typeof r<"u"?r:t.noop,{messageId:n}=e,o={cmd:"pubcomp",messageId:n};t.incomingStore.get(e,(s,a)=>{s?t._sendPacket(o,i):(t.emit("message",a.topic,a.payload,a),t.handleMessage(a,l=>{if(l)return i(l);t.incomingStore.del(a,t.noop),t._sendPacket(o,i)}))})};nu.default=aR});var Ty=M(an=>{"use strict";w();m();_();var ln=an&&an.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(an,"__esModule",{value:!0});var lR=ln(Gg()),uR=ln(Yg()),fR=ln(Ay()),cR=ln(rn()),hR=ln(Ry()),dR=(t,e,r)=>{let{options:i}=t;if(i.protocolVersion===5&&i.properties&&i.properties.maximumPacketSize&&i.properties.maximumPacketSize<e.length)return t.emit("error",new Error(`exceeding packets size ${e.cmd}`)),t.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),t;switch(t.log("_handlePacket :: emitting packetreceive"),t.emit("packetreceive",e),e.cmd){case"publish":(0,lR.default)(t,e,r);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":(0,cR.default)(t,e),r();break;case"pubrel":(0,hR.default)(t,e,r);break;case"connack":(0,fR.default)(t,e),r();break;case"auth":(0,uR.default)(t,e),r();break;case"pingresp":t.pingResp=!0,r();break;case"disconnect":t.emit("disconnect",e),r();break;default:t.log("_handlePacket :: unknown command"),r();break}};an.default=dR});var Iy=M(Ci=>{"use strict";w();m();_();var pR=Ci&&Ci.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ci,"__esModule",{value:!0});Ci.TypedEventEmitter=void 0;var gR=pR((Ut(),K(Lt))),yR=tn(),Hs=class{};Ci.TypedEventEmitter=Hs;(0,yR.applyMixin)(Hs,gR.default)});var zs=M(at=>{"use strict";w();m();_();var bR=at&&at.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),wR=at&&at.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),_R=at&&at.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&bR(e,t,r);return wR(e,t),e},ar=at&&at.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(at,"__esModule",{value:!0});var mR=ar(Qc()),su=ar(Ng()),vR=ar(wl()),ER=kr(),SR=ar(qg()),Cy=ar($g()),Py=_R(Vg()),AR=ar(wt()),Vs=ar(vl()),RR=ar(Ty()),TR=Iy(),au=R?R.nextTick:t=>{setTimeout(t,0)},ou=window.setImmediate||((...t)=>{let e=t.shift();au(()=>{e(...t)})}),By={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0,writeCache:!0},IR=["ECONNREFUSED","EADDRINUSE","ECONNRESET","ENOTFOUND","ETIMEDOUT"],lu=class t extends TR.TypedEventEmitter{static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}constructor(e,r){super(),this.options=r||{};for(let i in By)typeof this.options[i]>"u"?this.options[i]=By[i]:this.options[i]=r[i];this.log=this.options.log||(0,AR.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: options.protocol",r.protocol),this.log("MqttClient :: options.protocolVersion",r.protocolVersion),this.log("MqttClient :: options.username",r.username),this.log("MqttClient :: options.keepalive",r.keepalive),this.log("MqttClient :: options.reconnectPeriod",r.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",r.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",r.properties?r.properties.topicAliasMaximum:void 0),this.options.clientId=typeof r.clientId=="string"?r.clientId:t.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=r.protocolVersion===5&&r.customHandleAcks?r.customHandleAcks:(...i)=>{i[3](null,0)},this.options.writeCache||(su.default.writeToStream.cacheNumbers=!1),this.streamBuilder=e,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new vR.default:this.options.messageIdProvider,this.outgoingStore=r.outgoingStore||new Vs.default,this.incomingStore=r.incomingStore||new Vs.default,this.queueQoSZero=r.queueQoSZero===void 0?!0:r.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.pingTimer=null,this.connected=!1,this.disconnecting=!1,this.reconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,r.properties&&r.properties.topicAliasMaximum>0&&(r.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new mR.default(r.properties.topicAliasMaximum)),this.on("connect",()=>{let{queue:i}=this,n=()=>{let o=i.shift();this.log("deliver :: entry %o",o);let s=null;if(!o){this._resubscribe();return}s=o.packet,this.log("deliver :: call _sendPacket for %o",s);let a=!0;s.messageId&&s.messageId!==0&&(this.messageIdProvider.register(s.messageId)||(a=!1)),a?this._sendPacket(s,l=>{o.cb&&o.cb(l),n()}):(this.log("messageId: %d has already used. The message is skipped and removed.",s.messageId),n())};this.log("connect :: sending queued packets"),n()}),this.on("close",()=>{this.log("close :: connected set to `false`"),this.connected=!1,this.log("close :: clearing connackTimer"),clearTimeout(this.connackTimer),this.log("close :: clearing ping timer"),this.pingTimer!==null&&(this.pingTimer.clear(),this.pingTimer=null),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,r){r()}handleMessage(e,r){r()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}connect(){var e;let r=new ER.Writable,i=su.default.parser(this.options),n=null,o=[];this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),i.on("packet",h=>{this.log("parser :: on packet push to packets array."),o.push(h)});let s=()=>{this.log("work :: getting next packet in queue");let h=o.shift();if(h)this.log("work :: packet pulled from queue"),(0,RR.default)(this,h,a);else{this.log("work :: no packets in queue");let d=n;n=null,this.log("work :: done flag is %s",!!d),d&&d()}},a=()=>{if(o.length)au(s);else{let h=n;n=null,h()}};r._write=(h,d,g)=>{n=g,this.log("writable stream :: parsing buffer"),i.parse(h),s()};let l=h=>{this.log("streamErrorHandler :: error",h.message),IR.includes(h.code)?(this.log("streamErrorHandler :: emitting error"),this.emit("error",h)):this.noop(h)};this.log("connect :: pipe stream to writable stream"),this.stream.pipe(r),this.stream.on("error",l),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`");let c={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};if(this.options.will&&(c.will=Object.assign(Object.assign({},this.options.will),{payload:(e=this.options.will)===null||e===void 0?void 0:e.payload})),this.topicAliasRecv&&(c.properties||(c.properties={}),this.topicAliasRecv&&(c.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket(c),i.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&&typeof this.options.authPacket=="object"){let h=Object.assign({cmd:"auth",reasonCode:0},this.options.authPacket);this._writePacket(h)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(()=>{this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this._cleanUp(!0)},this.options.connectTimeout),this}publish(e,r,i,n){this.log("publish :: message `%s` to topic `%s`",r,e);let{options:o}=this;typeof i=="function"&&(n=i,i=null),i=i||{},i=Object.assign(Object.assign({},{qos:0,retain:!1,dup:!1}),i);let{qos:a,retain:l,dup:c,properties:h,cbStorePut:d}=i;if(this._checkDisconnecting(n))return this;let g=()=>{let y=0;if((a===1||a===2)&&(y=this._nextId(),y===null))return this.log("No messageId left"),!1;let v={cmd:"publish",topic:e,payload:r,qos:a,retain:l,messageId:y,dup:c};switch(o.protocolVersion===5&&(v.properties=h),this.log("publish :: qos",a),a){case 1:case 2:this.outgoing[v.messageId]={volatile:!1,cb:n||this.noop},this.log("MqttClient:publish: packet cmd: %s",v.cmd),this._sendPacket(v,void 0,d);break;default:this.log("MqttClient:publish: packet cmd: %s",v.cmd),this._sendPacket(v,n,d);break}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!g())&&this._storeProcessingQueue.push({invoke:g,cbStorePut:i.cbStorePut,callback:n}),this}publishAsync(e,r,i){return new Promise((n,o)=>{this.publish(e,r,i,(s,a)=>{s?o(s):n(a)})})}subscribe(e,r,i){let n=this.options.protocolVersion;typeof r=="function"&&(i=r),i=i||this.noop;let o=!1,s=[];typeof e=="string"?(e=[e],s=e):Array.isArray(e)?s=e:typeof e=="object"&&(o=e.resubscribe,delete e.resubscribe,s=Object.keys(e));let a=Py.validateTopics(s);if(a!==null)return ou(i,new Error(`Invalid topic ${a}`)),this;if(this._checkDisconnecting(i))return this.log("subscribe: discconecting true"),this;let l={qos:0};n===5&&(l.nl=!1,l.rap=!1,l.rh=0),r=Object.assign(Object.assign({},l),r);let c=r.properties,h=[],d=(y,v)=>{if(v=v||r,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,y)||this._resubscribeTopics[y].qos<v.qos||o){let E={topic:y,qos:v.qos};n===5&&(E.nl=v.nl,E.rap=v.rap,E.rh=v.rh,E.properties=c),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",E.topic,E.qos),h.push(E)}};if(Array.isArray(e)?e.forEach(y=>{this.log("subscribe: array topic %s",y),d(y)}):Object.keys(e).forEach(y=>{this.log("subscribe: object topic %s, %o",y,e[y]),d(y,e[y])}),!h.length)return i(null,[]),this;let g=()=>{let y=this._nextId();if(y===null)return this.log("No messageId left"),!1;let v={cmd:"subscribe",subscriptions:h,messageId:y};if(c&&(v.properties=c),this.options.resubscribe){this.log("subscribe :: resubscribe true");let E=[];h.forEach(A=>{if(this.options.reconnectPeriod>0){let T={qos:A.qos};n===5&&(T.nl=A.nl||!1,T.rap=A.rap||!1,T.rh=A.rh||0,T.properties=A.properties),this._resubscribeTopics[A.topic]=T,E.push(A.topic)}}),this.messageIdToTopic[v.messageId]=E}return this.outgoing[v.messageId]={volatile:!0,cb(E,A){if(!E){let{granted:T}=A;for(let O=0;O<T.length;O+=1)h[O].qos=T[O]}i(E,h)}},this.log("subscribe :: call _sendPacket"),this._sendPacket(v),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!g())&&this._storeProcessingQueue.push({invoke:g,callback:i}),this}subscribeAsync(e,r){return new Promise((i,n)=>{this.subscribe(e,r,(o,s)=>{o?n(o):i(s)})})}unsubscribe(e,r,i){typeof e=="string"&&(e=[e]),typeof r=="function"&&(i=r),i=i||this.noop;let n=Py.validateTopics(e);if(n!==null)return ou(i,new Error(`Invalid topic ${n}`)),this;if(this._checkDisconnecting(i))return this;let o=()=>{let s=this._nextId();if(s===null)return this.log("No messageId left"),!1;let a={cmd:"unsubscribe",messageId:s,unsubscriptions:[]};return typeof e=="string"?a.unsubscriptions=[e]:Array.isArray(e)&&(a.unsubscriptions=e),this.options.resubscribe&&a.unsubscriptions.forEach(l=>{delete this._resubscribeTopics[l]}),typeof r=="object"&&r.properties&&(a.properties=r.properties),this.outgoing[a.messageId]={volatile:!0,cb:i},this.log("unsubscribe: call _sendPacket"),this._sendPacket(a),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!o())&&this._storeProcessingQueue.push({invoke:o,callback:i}),this}unsubscribeAsync(e,r){return new Promise((i,n)=>{this.unsubscribe(e,r,(o,s)=>{o?n(o):i(s)})})}end(e,r,i){this.log("end :: (%s)",this.options.clientId),(e==null||typeof e!="boolean")&&(i=i||r,r=e,e=!1),typeof r!="object"&&(i=i||r,r=null),this.log("end :: cb? %s",!!i),(!i||typeof i!="function")&&(i=this.noop);let n=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this.incomingStore.close(s=>{this.outgoingStore.close(a=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),i){let l=s||a;this.log("end :: closeStores: invoking callback with args"),i(l)}})}),this._deferredReconnect&&this._deferredReconnect()},o=()=>{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"),au(n)},r)};return this.disconnecting?(i(),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,o,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),o()),this)}endAsync(e,r){return new Promise((i,n)=>{this.end(e,r,o=>{o?n(o):i()})})}removeOutgoingMessage(e){if(this.outgoing[e]){let{cb:r}=this.outgoing[e];this._removeOutgoingAndStoreMessage(e,()=>{r(new Error("Message removed"))})}return this}reconnect(e){this.log("client reconnect");let r=()=>{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 Vs.default,this.outgoingStore=this.options.outgoingStore||new Vs.default,this.disconnecting=!1,this.disconnected=!1,this._deferredReconnect=null,this._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=r:r(),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&&typeof this.outgoing[e].cb=="function"&&(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=>{typeof this.outgoing[e].cb=="function"&&(this.outgoing[e].cb(new Error("Connection closed")),delete this.outgoing[e])}))}_removeTopicAliasAndRecoverTopicName(e){let r;e.properties&&(r=e.properties.topicAlias);let i=e.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",r,i),i.length===0){if(typeof r>"u")return new Error("Unregistered Topic Alias");if(i=this.topicAliasSend.getTopicByAlias(r),typeof i>"u")return new Error("Unregistered Topic Alias");e.topic=i}r&&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.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,r,i={}){if(r&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",r)),this.log("_cleanUp :: forced? %s",e),e)this.options.reconnectPeriod===0&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{let n=Object.assign({cmd:"disconnect"},i);this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(n,()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),ou(()=>{this.stream.end(()=>{this.log("_cleanUp :: (%s) :: stream destroyed",this.options.clientId)})})})}this.disconnecting||(this.log("_cleanUp :: client not disconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this.pingTimer!==null&&(this.log("_cleanUp :: clearing pingTimer"),this.pingTimer.clear(),this.pingTimer=null),r&&!this.connected&&(this.log("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",r),r())}_storeAndSend(e,r,i){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",e.cmd);let n=e,o;if(n.cmd==="publish"&&(n=(0,Cy.default)(e),o=this._removeTopicAliasAndRecoverTopicName(n),o))return r&&r(o);this.outgoingStore.put(n,s=>{if(s)return r&&r(s);i(),this._writePacket(e,r)})}_applyTopicAlias(e){if(this.options.protocolVersion===5&&e.cmd==="publish"){let r;e.properties&&(r=e.properties.topicAlias);let i=e.topic.toString();if(this.topicAliasSend)if(r){if(i.length!==0&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",i,r),!this.topicAliasSend.put(i,r)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",i,r),new Error("Sending Topic Alias out of range")}else i.length!==0&&(this.options.autoAssignTopicAlias?(r=this.topicAliasSend.getAliasByTopic(i),r?(e.topic="",e.properties=Object.assign(Object.assign({},e.properties),{topicAlias:r}),this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",i,r)):(r=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(i,r),e.properties=Object.assign(Object.assign({},e.properties),{topicAlias:r}),this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",i,r))):this.options.autoUseTopicAlias&&(r=this.topicAliasSend.getAliasByTopic(i),r&&(e.topic="",e.properties=Object.assign(Object.assign({},e.properties),{topicAlias:r}),this.log("applyTopicAlias :: auto use topic: %s - alias: %d",i,r))));else if(r)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",i,r),new Error("Sending Topic Alias out of range")}}_noop(e){this.log("noop ::",e)}_writePacket(e,r){this.log("_writePacket :: packet: %O",e),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",e),this._shiftPingInterval(),this.log("_writePacket :: writing to stream");let i=su.default.writeToStream(e,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",i),!i&&r&&r!==this.noop?(this.log("_writePacket :: handle events on `drain` once through callback."),this.stream.once("drain",r)):r&&(this.log("_writePacket :: invoking cb"),r())}_sendPacket(e,r,i,n){this.log("_sendPacket :: (%s) :: start",this.options.clientId),i=i||this.noop,r=r||this.noop;let o=this._applyTopicAlias(e);if(o){r(o);return}if(!this.connected){if(e.cmd==="auth"){this._writePacket(e,r);return}this.log("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(e,r,i);return}if(n){this._writePacket(e,r);return}switch(e.cmd){case"publish":break;case"pubrel":this._storeAndSend(e,r,i);return;default:this._writePacket(e,r);return}switch(e.qos){case 2:case 1:this._storeAndSend(e,r,i);break;case 0:default:this._writePacket(e,r);break}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}_storePacket(e,r,i){this.log("_storePacket :: packet: %o",e),this.log("_storePacket :: cb? %s",!!r),i=i||this.noop;let n=e;if(n.cmd==="publish"){n=(0,Cy.default)(e);let s=this._removeTopicAliasAndRecoverTopicName(n);if(s)return r&&r(s)}let o=n.qos||0;o===0&&this.queueQoSZero||n.cmd!=="publish"?this.queue.push({packet:n,cb:r}):o>0?(r=this.outgoing[n.messageId]?this.outgoing[n.messageId].cb:null,this.outgoingStore.put(n,s=>{if(s)return r&&r(s);i()})):r&&r(new Error("No connection to broker"))}_setupPingTimer(){this.log("_setupPingTimer :: keepalive %d (seconds)",this.options.keepalive),!this.pingTimer&&this.options.keepalive&&(this.pingResp=!0,this.pingTimer=(0,SR.default)(()=>{this._checkPing()},this.options.keepalive*1e3))}_shiftPingInterval(){this.pingTimer&&this.options.keepalive&&this.options.reschedulePings&&this.pingTimer.reschedule(this.options.keepalive*1e3)}_checkPing(){this.log("_checkPing :: checking ping..."),this.pingResp?(this.log("_checkPing :: ping response received. Clearing flag and sending `pingreq`"),this.pingResp=!1,this._sendPacket({cmd:"pingreq"})):(this.log("_checkPing :: calling _cleanUp with force true"),this._cleanUp(!0))}_resubscribe(){this.log("_resubscribe");let 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(this.options.protocolVersion===5){this.log("_resubscribe: protocolVersion 5");for(let r=0;r<e.length;r++){let i={};i[e[r]]=this._resubscribeTopics[e[r]],i.resubscribe=!0,this.subscribe(i,{properties:i[e[r]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1}_onConnect(e){if(this.disconnected){this.emit("connect",e);return}this.connackPacket=e,this.messageIdProvider.clear(),this._setupPingTimer(),this.connected=!0;let r=()=>{let i=this.outgoingStore.createStream(),n=()=>{i.destroy(),i=null,this._flushStoreProcessingQueue(),o()},o=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",n),i.on("error",a=>{o(),this._flushStoreProcessingQueue(),this.removeListener("close",n),this.emit("error",a)});let s=()=>{if(!i)return;let a=i.read(1),l;if(!a){i.once("readable",s);return}if(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[a.messageId]){s();return}!this.disconnecting&&!this.reconnectTimer?(l=this.outgoing[a.messageId]?this.outgoing[a.messageId].cb:null,this.outgoing[a.messageId]={volatile:!1,cb(c,h){l&&l(c,h),s()}},this._packetIdsDuringStoreProcessing[a.messageId]=!0,this.messageIdProvider.register(a.messageId)?this._sendPacket(a,void 0,void 0,!0):this.log("messageId: %d has already used.",a.messageId)):i.destroy&&i.destroy()};i.on("end",()=>{let a=!0;for(let l in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[l]){a=!1;break}a?(o(),this.removeListener("close",n),this._invokeAllStoreProcessingQueue(),this.emit("connect",e)):r()}),s()};r()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){let e=this._storeProcessingQueue[0];if(e&&e.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(let 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,r){delete this.outgoing[e],this.outgoingStore.del({messageId:e},(i,n)=>{r(i,n),this.messageIdProvider.deallocate(e),this._invokeStoreProcessingQueue()})}};at.default=lu});var Oy=M(fu=>{"use strict";w();m();_();Object.defineProperty(fu,"__esModule",{value:!0});var CR=tu(),uu=class{constructor(){this.numberAllocator=new CR.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()}};fu.default=uu});function $r(t){throw new RangeError(xR[t])}function xy(t,e){let r=t.split("@"),i="";r.length>1&&(i=r[0]+"@",t=r[1]);let n=function(o,s){let a=[],l=o.length;for(;l--;)a[l]=s(o[l]);return a}((t=t.replace(OR,".")).split("."),e).join(".");return i+n}function Uy(t){let e=[],r=0,i=t.length;for(;r<i;){let n=t.charCodeAt(r++);if(n>=55296&&n<=56319&&r<i){let o=t.charCodeAt(r++);(64512&o)==56320?e.push(((1023&n)<<10)+(1023&o)+65536):(e.push(n),r--)}else e.push(n)}return e}var PR,BR,OR,xR,At,cu,ky,Ny,My,Ly,lr,Dy=we(()=>{w();m();_();PR=/^xn--/,BR=/[^\0-\x7E]/,OR=/[\x2E\u3002\uFF0E\uFF61]/g,xR={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},At=Math.floor,cu=String.fromCharCode;ky=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},Ny=function(t,e,r){let i=0;for(t=r?At(t/700):t>>1,t+=At(t/e);t>455;i+=36)t=At(t/35);return At(i+36*t/(t+38))},My=function(t){let e=[],r=t.length,i=0,n=128,o=72,s=t.lastIndexOf("-");s<0&&(s=0);for(let l=0;l<s;++l)t.charCodeAt(l)>=128&&$r("not-basic"),e.push(t.charCodeAt(l));for(let l=s>0?s+1:0;l<r;){let c=i;for(let d=1,g=36;;g+=36){l>=r&&$r("invalid-input");let y=(a=t.charCodeAt(l++))-48<10?a-22:a-65<26?a-65:a-97<26?a-97:36;(y>=36||y>At((2147483647-i)/d))&&$r("overflow"),i+=y*d;let v=g<=o?1:g>=o+26?26:g-o;if(y<v)break;let E=36-v;d>At(2147483647/E)&&$r("overflow"),d*=E}let h=e.length+1;o=Ny(i-c,h,c==0),At(i/h)>2147483647-n&&$r("overflow"),n+=At(i/h),i%=h,e.splice(i++,0,n)}var a;return String.fromCodePoint(...e)},Ly=function(t){let e=[],r=(t=Uy(t)).length,i=128,n=0,o=72;for(let l of t)l<128&&e.push(cu(l));let s=e.length,a=s;for(s&&e.push("-");a<r;){let l=2147483647;for(let h of t)h>=i&&h<l&&(l=h);let c=a+1;l-i>At((2147483647-n)/c)&&$r("overflow"),n+=(l-i)*c,i=l;for(let h of t)if(h<i&&++n>2147483647&&$r("overflow"),h==i){let d=n;for(let g=36;;g+=36){let y=g<=o?1:g>=o+26?26:g-o;if(d<y)break;let v=d-y,E=36-y;e.push(cu(ky(y+v%E,0))),d=At(v/E)}e.push(cu(ky(d,0))),o=Ny(n,c,a==s),n=0,++a}++n,++i}return e.join("")},lr={version:"2.1.0",ucs2:{decode:Uy,encode:t=>String.fromCodePoint(...t)},decode:My,encode:Ly,toASCII:function(t){return xy(t,function(e){return BR.test(e)?"xn--"+Ly(e):e})},toUnicode:function(t){return xy(t,function(e){return PR.test(e)?My(e.slice(4).toLowerCase()):e})}};lr.decode;lr.encode;lr.toASCII;lr.toUnicode;lr.ucs2;lr.version});function kR(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var MR,un,LR,Rt,qy=we(()=>{w();m();_();MR=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if(typeof t!="string"||t.length===0)return n;var o=/\+/g;t=t.split(e);var s=1e3;i&&typeof i.maxKeys=="number"&&(s=i.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var l=0;l<a;++l){var c,h,d,g,y=t[l].replace(o,"%20"),v=y.indexOf(r);v>=0?(c=y.substr(0,v),h=y.substr(v+1)):(c=y,h=""),d=decodeURIComponent(c),g=decodeURIComponent(h),kR(n,d)?Array.isArray(n[d])?n[d].push(g):n[d]=[n[d],g]:n[d]=g}return n},un=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},LR=function(t,e,r,i){return e=e||"&",r=r||"=",t===null&&(t=void 0),typeof t=="object"?Object.keys(t).map(function(n){var o=encodeURIComponent(un(n))+r;return Array.isArray(t[n])?t[n].map(function(s){return o+encodeURIComponent(un(s))}).join(e):o+encodeURIComponent(un(t[n]))}).join(e):i?encodeURIComponent(un(i))+r+encodeURIComponent(un(t)):""},Rt={};Rt.decode=Rt.parse=MR,Rt.encode=Rt.stringify=LR;Rt.decode;Rt.encode;Rt.parse;Rt.stringify});function hu(){throw new Error("setTimeout has not been defined")}function du(){throw new Error("clearTimeout has not been defined")}function Wy(t){if(Ht===setTimeout)return setTimeout(t,0);if((Ht===hu||!Ht)&&setTimeout)return Ht=setTimeout,setTimeout(t,0);try{return Ht(t,0)}catch{try{return Ht.call(null,t,0)}catch{return Ht.call(this||Bi,t,0)}}}function UR(){Pi&&Hr&&(Pi=!1,Hr.length?zt=Hr.concat(zt):Gs=-1,zt.length&&$y())}function $y(){if(!Pi){var t=Wy(UR);Pi=!0;for(var e=zt.length;e;){for(Hr=zt,zt=[];++Gs<e;)Hr&&Hr[Gs].run();Gs=-1,e=zt.length}Hr=null,Pi=!1,function(r){if(Vt===clearTimeout)return clearTimeout(r);if((Vt===du||!Vt)&&clearTimeout)return Vt=clearTimeout,clearTimeout(r);try{Vt(r)}catch{try{return Vt.call(null,r)}catch{return Vt.call(this||Bi,r)}}}(t)}}function jy(t,e){(this||Bi).fun=t,(this||Bi).array=e}function $t(){}var Fy,Ht,Vt,Bi,be,Hr,zt,Pi,Gs,se,fn=we(()=>{w();m();_();Bi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window,be=Fy={};(function(){try{Ht=typeof setTimeout=="function"?setTimeout:hu}catch{Ht=hu}try{Vt=typeof clearTimeout=="function"?clearTimeout:du}catch{Vt=du}})();zt=[],Pi=!1,Gs=-1;be.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];zt.push(new jy(t,e)),zt.length!==1||Pi||Wy($y)},jy.prototype.run=function(){(this||Bi).fun.apply(null,(this||Bi).array)},be.title="browser",be.browser=!0,be.env={},be.argv=[],be.version="",be.versions={},be.on=$t,be.addListener=$t,be.once=$t,be.off=$t,be.removeListener=$t,be.removeAllListeners=$t,be.emit=$t,be.prependListener=$t,be.prependOnceListener=$t,be.listeners=function(t){return[]},be.binding=function(t){throw new Error("process.binding is not supported")},be.cwd=function(){return"/"},be.chdir=function(t){throw new Error("process.chdir is not supported")},be.umask=function(){return 0};se=Fy;se.addListener;se.argv;se.binding;se.browser;se.chdir;se.cwd;se.emit;se.env;se.listeners;se.nextTick;se.off;se.on;se.once;se.prependListener;se.prependOnceListener;se.removeAllListeners;se.removeListener;se.title;se.umask;se.version;se.versions});function NR(){if(Hy)return pu;Hy=!0;var t=pu={},e,r;function i(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=i}catch{e=i}try{typeof clearTimeout=="function"?r=clearTimeout:r=n}catch{r=n}})();function o(E){if(e===setTimeout)return setTimeout(E,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(E,0);try{return e(E,0)}catch{try{return e.call(null,E,0)}catch{return e.call(this||Oi,E,0)}}}function s(E){if(r===clearTimeout)return clearTimeout(E);if((r===n||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(E);try{return r(E)}catch{try{return r.call(null,E)}catch{return r.call(this||Oi,E)}}}var a=[],l=!1,c,h=-1;function d(){!l||!c||(l=!1,c.length?a=c.concat(a):h=-1,a.length&&g())}function g(){if(!l){var E=o(d);l=!0;for(var A=a.length;A;){for(c=a,a=[];++h<A;)c&&c[h].run();h=-1,A=a.length}c=null,l=!1,s(E)}}t.nextTick=function(E){var A=new Array(arguments.length-1);if(arguments.length>1)for(var T=1;T<arguments.length;T++)A[T-1]=arguments[T];a.push(new y(E,A)),a.length===1&&!l&&o(g)};function y(E,A){(this||Oi).fun=E,(this||Oi).array=A}y.prototype.run=function(){(this||Oi).fun.apply(null,(this||Oi).array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function v(){}return t.on=v,t.addListener=v,t.once=v,t.off=v,t.removeListener=v,t.removeAllListeners=v,t.emit=v,t.prependListener=v,t.prependOnceListener=v,t.listeners=function(E){return[]},t.binding=function(E){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(E){throw new Error("process.chdir is not supported")},t.umask=function(){return 0},pu}var pu,Hy,Oi,ae,gu=we(()=>{w();m();_();pu={},Hy=!1,Oi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;ae=NR();ae.platform="browser";ae.addListener;ae.argv;ae.binding;ae.browser;ae.chdir;ae.cwd;ae.emit;ae.env;ae.listeners;ae.nextTick;ae.off;ae.on;ae.once;ae.prependListener;ae.prependOnceListener;ae.removeAllListeners;ae.removeListener;ae.title;ae.umask;ae.version;ae.versions});function DR(){if(Vy)return yu;Vy=!0;var t=ae;function e(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function r(o,s){for(var a="",l=0,c=-1,h=0,d,g=0;g<=o.length;++g){if(g<o.length)d=o.charCodeAt(g);else{if(d===47)break;d=47}if(d===47){if(!(c===g-1||h===1))if(c!==g-1&&h===2){if(a.length<2||l!==2||a.charCodeAt(a.length-1)!==46||a.charCodeAt(a.length-2)!==46){if(a.length>2){var y=a.lastIndexOf("/");if(y!==a.length-1){y===-1?(a="",l=0):(a=a.slice(0,y),l=a.length-1-a.lastIndexOf("/")),c=g,h=0;continue}}else if(a.length===2||a.length===1){a="",l=0,c=g,h=0;continue}}s&&(a.length>0?a+="/..":a="..",l=2)}else a.length>0?a+="/"+o.slice(c+1,g):a=o.slice(c+1,g),l=g-c-1;c=g,h=0}else d===46&&h!==-1?++h:h=-1}return a}function i(o,s){var a=s.dir||s.root,l=s.base||(s.name||"")+(s.ext||"");return a?a===s.root?a+l:a+o+l:l}var n={resolve:function(){for(var s="",a=!1,l,c=arguments.length-1;c>=-1&&!a;c--){var h;c>=0?h=arguments[c]:(l===void 0&&(l=t.cwd()),h=l),e(h),h.length!==0&&(s=h+"/"+s,a=h.charCodeAt(0)===47)}return s=r(s,!a),a?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(s){if(e(s),s.length===0)return".";var a=s.charCodeAt(0)===47,l=s.charCodeAt(s.length-1)===47;return s=r(s,!a),s.length===0&&!a&&(s="."),s.length>0&&l&&(s+="/"),a?"/"+s:s},isAbsolute:function(s){return e(s),s.length>0&&s.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var s,a=0;a<arguments.length;++a){var l=arguments[a];e(l),l.length>0&&(s===void 0?s=l:s+="/"+l)}return s===void 0?".":n.normalize(s)},relative:function(s,a){if(e(s),e(a),s===a||(s=n.resolve(s),a=n.resolve(a),s===a))return"";for(var l=1;l<s.length&&s.charCodeAt(l)===47;++l);for(var c=s.length,h=c-l,d=1;d<a.length&&a.charCodeAt(d)===47;++d);for(var g=a.length,y=g-d,v=h<y?h:y,E=-1,A=0;A<=v;++A){if(A===v){if(y>v){if(a.charCodeAt(d+A)===47)return a.slice(d+A+1);if(A===0)return a.slice(d+A)}else h>v&&(s.charCodeAt(l+A)===47?E=A:A===0&&(E=0));break}var T=s.charCodeAt(l+A),O=a.charCodeAt(d+A);if(T!==O)break;T===47&&(E=A)}var I="";for(A=l+E+1;A<=c;++A)(A===c||s.charCodeAt(A)===47)&&(I.length===0?I+="..":I+="/..");return I.length>0?I+a.slice(d+E):(d+=E,a.charCodeAt(d)===47&&++d,a.slice(d))},_makeLong:function(s){return s},dirname:function(s){if(e(s),s.length===0)return".";for(var a=s.charCodeAt(0),l=a===47,c=-1,h=!0,d=s.length-1;d>=1;--d)if(a=s.charCodeAt(d),a===47){if(!h){c=d;break}}else h=!1;return c===-1?l?"/":".":l&&c===1?"//":s.slice(0,c)},basename:function(s,a){if(a!==void 0&&typeof a!="string")throw new TypeError('"ext" argument must be a string');e(s);var l=0,c=-1,h=!0,d;if(a!==void 0&&a.length>0&&a.length<=s.length){if(a.length===s.length&&a===s)return"";var g=a.length-1,y=-1;for(d=s.length-1;d>=0;--d){var v=s.charCodeAt(d);if(v===47){if(!h){l=d+1;break}}else y===-1&&(h=!1,y=d+1),g>=0&&(v===a.charCodeAt(g)?--g===-1&&(c=d):(g=-1,c=y))}return l===c?c=y:c===-1&&(c=s.length),s.slice(l,c)}else{for(d=s.length-1;d>=0;--d)if(s.charCodeAt(d)===47){if(!h){l=d+1;break}}else c===-1&&(h=!1,c=d+1);return c===-1?"":s.slice(l,c)}},extname:function(s){e(s);for(var a=-1,l=0,c=-1,h=!0,d=0,g=s.length-1;g>=0;--g){var y=s.charCodeAt(g);if(y===47){if(!h){l=g+1;break}continue}c===-1&&(h=!1,c=g+1),y===46?a===-1?a=g:d!==1&&(d=1):a!==-1&&(d=-1)}return a===-1||c===-1||d===0||d===1&&a===c-1&&a===l+1?"":s.slice(a,c)},format:function(s){if(s===null||typeof s!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof s);return i("/",s)},parse:function(s){e(s);var a={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return a;var l=s.charCodeAt(0),c=l===47,h;c?(a.root="/",h=1):h=0;for(var d=-1,g=0,y=-1,v=!0,E=s.length-1,A=0;E>=h;--E){if(l=s.charCodeAt(E),l===47){if(!v){g=E+1;break}continue}y===-1&&(v=!1,y=E+1),l===46?d===-1?d=E:A!==1&&(A=1):d!==-1&&(A=-1)}return d===-1||y===-1||A===0||A===1&&d===y-1&&d===g+1?y!==-1&&(g===0&&c?a.base=a.name=s.slice(1,y):a.base=a.name=s.slice(g,y)):(g===0&&c?(a.name=s.slice(1,d),a.base=s.slice(1,y)):(a.name=s.slice(g,d),a.base=s.slice(g,y)),a.ext=s.slice(d,y)),g>0?a.dir=s.slice(0,g-1):c&&(a.dir="/"),a},sep:"/",delimiter:":",win32:null,posix:null};return n.posix=n,yu=n,yu}var yu,Vy,bu,zy=we(()=>{w();m();_();gu();yu={},Vy=!1;bu=DR()});var eb={};Qt(eb,{URL:()=>pT,Url:()=>uT,default:()=>ie,fileURLToPath:()=>Xy,format:()=>fT,parse:()=>dT,pathToFileURL:()=>Zy,resolve:()=>cT,resolveObject:()=>hT});function Qe(){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}function cn(t,e,r){if(t&&Tt.isObject(t)&&t instanceof Qe)return t;var i=new Qe;return i.parse(t,e,r),i}function zR(){if(Qy)return mu;Qy=!0;var t=se;function e(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function r(o,s){for(var a="",l=0,c=-1,h=0,d,g=0;g<=o.length;++g){if(g<o.length)d=o.charCodeAt(g);else{if(d===47)break;d=47}if(d===47){if(!(c===g-1||h===1))if(c!==g-1&&h===2){if(a.length<2||l!==2||a.charCodeAt(a.length-1)!==46||a.charCodeAt(a.length-2)!==46){if(a.length>2){var y=a.lastIndexOf("/");if(y!==a.length-1){y===-1?(a="",l=0):(a=a.slice(0,y),l=a.length-1-a.lastIndexOf("/")),c=g,h=0;continue}}else if(a.length===2||a.length===1){a="",l=0,c=g,h=0;continue}}s&&(a.length>0?a+="/..":a="..",l=2)}else a.length>0?a+="/"+o.slice(c+1,g):a=o.slice(c+1,g),l=g-c-1;c=g,h=0}else d===46&&h!==-1?++h:h=-1}return a}function i(o,s){var a=s.dir||s.root,l=s.base||(s.name||"")+(s.ext||"");return a?a===s.root?a+l:a+o+l:l}var n={resolve:function(){for(var s="",a=!1,l,c=arguments.length-1;c>=-1&&!a;c--){var h;c>=0?h=arguments[c]:(l===void 0&&(l=t.cwd()),h=l),e(h),h.length!==0&&(s=h+"/"+s,a=h.charCodeAt(0)===47)}return s=r(s,!a),a?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(s){if(e(s),s.length===0)return".";var a=s.charCodeAt(0)===47,l=s.charCodeAt(s.length-1)===47;return s=r(s,!a),s.length===0&&!a&&(s="."),s.length>0&&l&&(s+="/"),a?"/"+s:s},isAbsolute:function(s){return e(s),s.length>0&&s.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var s,a=0;a<arguments.length;++a){var l=arguments[a];e(l),l.length>0&&(s===void 0?s=l:s+="/"+l)}return s===void 0?".":n.normalize(s)},relative:function(s,a){if(e(s),e(a),s===a||(s=n.resolve(s),a=n.resolve(a),s===a))return"";for(var l=1;l<s.length&&s.charCodeAt(l)===47;++l);for(var c=s.length,h=c-l,d=1;d<a.length&&a.charCodeAt(d)===47;++d);for(var g=a.length,y=g-d,v=h<y?h:y,E=-1,A=0;A<=v;++A){if(A===v){if(y>v){if(a.charCodeAt(d+A)===47)return a.slice(d+A+1);if(A===0)return a.slice(d+A)}else h>v&&(s.charCodeAt(l+A)===47?E=A:A===0&&(E=0));break}var T=s.charCodeAt(l+A),O=a.charCodeAt(d+A);if(T!==O)break;T===47&&(E=A)}var I="";for(A=l+E+1;A<=c;++A)(A===c||s.charCodeAt(A)===47)&&(I.length===0?I+="..":I+="/..");return I.length>0?I+a.slice(d+E):(d+=E,a.charCodeAt(d)===47&&++d,a.slice(d))},_makeLong:function(s){return s},dirname:function(s){if(e(s),s.length===0)return".";for(var a=s.charCodeAt(0),l=a===47,c=-1,h=!0,d=s.length-1;d>=1;--d)if(a=s.charCodeAt(d),a===47){if(!h){c=d;break}}else h=!1;return c===-1?l?"/":".":l&&c===1?"//":s.slice(0,c)},basename:function(s,a){if(a!==void 0&&typeof a!="string")throw new TypeError('"ext" argument must be a string');e(s);var l=0,c=-1,h=!0,d;if(a!==void 0&&a.length>0&&a.length<=s.length){if(a.length===s.length&&a===s)return"";var g=a.length-1,y=-1;for(d=s.length-1;d>=0;--d){var v=s.charCodeAt(d);if(v===47){if(!h){l=d+1;break}}else y===-1&&(h=!1,y=d+1),g>=0&&(v===a.charCodeAt(g)?--g===-1&&(c=d):(g=-1,c=y))}return l===c?c=y:c===-1&&(c=s.length),s.slice(l,c)}else{for(d=s.length-1;d>=0;--d)if(s.charCodeAt(d)===47){if(!h){l=d+1;break}}else c===-1&&(h=!1,c=d+1);return c===-1?"":s.slice(l,c)}},extname:function(s){e(s);for(var a=-1,l=0,c=-1,h=!0,d=0,g=s.length-1;g>=0;--g){var y=s.charCodeAt(g);if(y===47){if(!h){l=g+1;break}continue}c===-1&&(h=!1,c=g+1),y===46?a===-1?a=g:d!==1&&(d=1):a!==-1&&(d=-1)}return a===-1||c===-1||d===0||d===1&&a===c-1&&a===l+1?"":s.slice(a,c)},format:function(s){if(s===null||typeof s!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof s);return i("/",s)},parse:function(s){e(s);var a={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return a;var l=s.charCodeAt(0),c=l===47,h;c?(a.root="/",h=1):h=0;for(var d=-1,g=0,y=-1,v=!0,E=s.length-1,A=0;E>=h;--E){if(l=s.charCodeAt(E),l===47){if(!v){g=E+1;break}continue}y===-1&&(v=!1,y=E+1),l===46?d===-1?d=E:A!==1&&(A=1):d!==-1&&(A=-1)}return d===-1||y===-1||A===0||A===1&&d===y-1&&d===g+1?y!==-1&&(g===0&&c?a.base=a.name=s.slice(1,y):a.base=a.name=s.slice(g,y)):(g===0&&c?(a.name=s.slice(1,d),a.base=s.slice(1,y)):(a.name=s.slice(g,d),a.base=s.slice(g,y)),a.ext=s.slice(d,y)),g>0?a.dir=s.slice(0,g-1):c&&(a.dir="/"),a},sep:"/",delimiter:":",win32:null,posix:null};return n.posix=n,mu=n,mu}function nT(t){if(typeof t=="string")t=new URL(t);else if(!(t instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(t.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return Eu?sT(t):oT(t)}function sT(t){let e=t.hostname,r=t.pathname;for(let i=0;i<r.length;i++)if(r[i]==="%"){let n=r.codePointAt(i+2)||32;if(r[i+1]==="2"&&n===102||r[i+1]==="5"&&n===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(r=r.replace(XR,"\\"),r=decodeURIComponent(r),e!=="")return`\\\\${e}${r}`;{let i=r.codePointAt(1)|32,n=r[2];if(i<QR||i>JR||n!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return r.slice(1)}}function oT(t){if(t.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let e=t.pathname;for(let r=0;r<e.length;r++)if(e[r]==="%"){let i=e.codePointAt(r+2)||32;if(e[r+1]==="2"&&i===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(e)}function aT(t){let e=Jy.resolve(t),r=t.charCodeAt(t.length-1);(r===YR||Eu&&r===KR)&&e[e.length-1]!==Jy.sep&&(e+="/");let i=new URL("file://");return e.includes("%")&&(e=e.replace(ZR,"%25")),!Eu&&e.includes("\\")&&(e=e.replace(eT,"%5C")),e.includes(`
|
|
3
|
+
`)&&(e=e.replace(tT,"%0A")),e.includes("\r")&&(e=e.replace(rT,"%0D")),e.includes(" ")&&(e=e.replace(iT,"%09")),i.pathname=e,i}function Xy(t){if(typeof t=="string")t=new URL(t);else if(!(t instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(t.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return Su?RT(t):TT(t)}function RT(t){let e=t.hostname,r=t.pathname;for(let i=0;i<r.length;i++)if(r[i]==="%"){let n=r.codePointAt(i+2)||32;if(r[i+1]==="2"&&n===102||r[i+1]==="5"&&n===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(r=r.replace(_T,"\\"),r=decodeURIComponent(r),e!=="")return`\\\\${e}${r}`;{let i=r.codePointAt(1)|32,n=r[2];if(i<bT||i>wT||n!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return r.slice(1)}}function TT(t){if(t.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let e=t.pathname;for(let r=0;r<e.length;r++)if(e[r]==="%"){let i=e.codePointAt(r+2)||32;if(e[r+1]==="2"&&i===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(e)}function Zy(t){let e=bu.resolve(t),r=t.charCodeAt(t.length-1);(r===yT||Su&&r===gT)&&e[e.length-1]!==bu.sep&&(e+="/");let i=new URL("file://");return e.includes("%")&&(e=e.replace(mT,"%25")),!Su&&e.includes("\\")&&(e=e.replace(vT,"%5C")),e.includes(`
|
|
4
|
+
`)&&(e=e.replace(ET,"%0A")),e.includes("\r")&&(e=e.replace(ST,"%0D")),e.includes(" ")&&(e=e.replace(AT,"%09")),i.pathname=e,i}var ie,qR,Tt,jR,FR,WR,$R,vu,Gy,Ky,Yy,HR,VR,wu,xi,_u,mu,Qy,Jy,GR,KR,YR,QR,JR,Eu,XR,ZR,eT,tT,rT,iT,lT,uT,fT,cT,hT,dT,pT,gT,yT,bT,wT,Su,_T,mT,vT,ET,ST,AT,tb=we(()=>{w();m();_();Dy();qy();fn();zy();gu();ie={},qR=lr,Tt={isString:function(t){return typeof t=="string"},isObject:function(t){return typeof t=="object"&&t!==null},isNull:function(t){return t===null},isNullOrUndefined:function(t){return t==null}};ie.parse=cn,ie.resolve=function(t,e){return cn(t,!1,!0).resolve(e)},ie.resolveObject=function(t,e){return t?cn(t,!1,!0).resolveObject(e):e},ie.format=function(t){return Tt.isString(t)&&(t=cn(t)),t instanceof Qe?t.format():Qe.prototype.format.call(t)},ie.Url=Qe;jR=/^([a-z0-9.+-]+:)/i,FR=/:[0-9]*$/,WR=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,$R=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
5
|
+
`," "]),vu=["'"].concat($R),Gy=["%","/","?",";","#"].concat(vu),Ky=["/","?","#"],Yy=/^[+a-z0-9A-Z_-]{0,63}$/,HR=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,VR={javascript:!0,"javascript:":!0},wu={javascript:!0,"javascript:":!0},xi={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},_u=Rt;Qe.prototype.parse=function(t,e,r){if(!Tt.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=i!==-1&&i<t.indexOf("#")?"?":"#",o=t.split(n);o[0]=o[0].replace(/\\/g,"/");var s=t=o.join(n);if(s=s.trim(),!r&&t.split("#").length===1){var a=WR.exec(s);if(a)return this.path=s,this.href=s,this.pathname=a[1],a[2]?(this.search=a[2],this.query=e?_u.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var l=jR.exec(s);if(l){var c=(l=l[0]).toLowerCase();this.protocol=c,s=s.substr(l.length)}if(r||l||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var h=s.substr(0,2)==="//";!h||l&&wu[l]||(s=s.substr(2),this.slashes=!0)}if(!wu[l]&&(h||l&&!xi[l])){for(var d,g,y=-1,v=0;v<Ky.length;v++)(E=s.indexOf(Ky[v]))!==-1&&(y===-1||E<y)&&(y=E);for((g=y===-1?s.lastIndexOf("@"):s.lastIndexOf("@",y))!==-1&&(d=s.slice(0,g),s=s.slice(g+1),this.auth=decodeURIComponent(d)),y=-1,v=0;v<Gy.length;v++){var E;(E=s.indexOf(Gy[v]))!==-1&&(y===-1||E<y)&&(y=E)}y===-1&&(y=s.length),this.host=s.slice(0,y),s=s.slice(y),this.parseHost(),this.hostname=this.hostname||"";var A=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!A)for(var T=this.hostname.split(/\./),O=(v=0,T.length);v<O;v++){var I=T[v];if(I&&!I.match(Yy)){for(var N="",D=0,Y=I.length;D<Y;D++)I.charCodeAt(D)>127?N+="x":N+=I[D];if(!N.match(Yy)){var Z=T.slice(0,v),J=T.slice(v+1),te=I.match(HR);te&&(Z.push(te[1]),J.unshift(te[2])),J.length&&(s="/"+J.join(".")+s),this.hostname=Z.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),A||(this.hostname=qR.toASCII(this.hostname));var Pe=this.port?":"+this.port:"",Di=this.hostname||"";this.host=Di+Pe,this.href+=this.host,A&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),s[0]!=="/"&&(s="/"+s))}if(!VR[c])for(v=0,O=vu.length;v<O;v++){var Te=vu[v];if(s.indexOf(Te)!==-1){var ti=encodeURIComponent(Te);ti===Te&&(ti=escape(Te)),s=s.split(Te).join(ti)}}var ri=s.indexOf("#");ri!==-1&&(this.hash=s.substr(ri),s=s.slice(0,ri));var ii=s.indexOf("?");if(ii!==-1?(this.search=s.substr(ii),this.query=s.substr(ii+1),e&&(this.query=_u.parse(this.query)),s=s.slice(0,ii)):e&&(this.search="",this.query={}),s&&(this.pathname=s),xi[c]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){Pe=this.pathname||"";var xo=this.search||"";this.path=Pe+xo}return this.href=this.format(),this},Qe.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",i=this.hash||"",n=!1,o="";this.host?n=t+this.host:this.hostname&&(n=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&Tt.isObject(this.query)&&Object.keys(this.query).length&&(o=_u.stringify(this.query));var s=this.search||o&&"?"+o||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||xi[e])&&n!==!1?(n="//"+(n||""),r&&r.charAt(0)!=="/"&&(r="/"+r)):n||(n=""),i&&i.charAt(0)!=="#"&&(i="#"+i),s&&s.charAt(0)!=="?"&&(s="?"+s),e+n+(r=r.replace(/[?#]/g,function(a){return encodeURIComponent(a)}))+(s=s.replace("#","%23"))+i},Qe.prototype.resolve=function(t){return this.resolveObject(cn(t,!1,!0)).format()},Qe.prototype.resolveObject=function(t){if(Tt.isString(t)){var e=new Qe;e.parse(t,!1,!0),t=e}for(var r=new Qe,i=Object.keys(this),n=0;n<i.length;n++){var o=i[n];r[o]=this[o]}if(r.hash=t.hash,t.href==="")return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var s=Object.keys(t),a=0;a<s.length;a++){var l=s[a];l!=="protocol"&&(r[l]=t[l])}return xi[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!xi[t.protocol]){for(var c=Object.keys(t),h=0;h<c.length;h++){var d=c[h];r[d]=t[d]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||wu[t.protocol])r.pathname=t.pathname;else{for(var g=(t.pathname||"").split("/");g.length&&!(t.host=g.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),g[0]!==""&&g.unshift(""),g.length<2&&g.unshift(""),r.pathname=g.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var y=r.pathname||"",v=r.search||"";r.path=y+v}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var E=r.pathname&&r.pathname.charAt(0)==="/",A=t.host||t.pathname&&t.pathname.charAt(0)==="/",T=A||E||r.host&&t.pathname,O=T,I=r.pathname&&r.pathname.split("/")||[],N=(g=t.pathname&&t.pathname.split("/")||[],r.protocol&&!xi[r.protocol]);if(N&&(r.hostname="",r.port=null,r.host&&(I[0]===""?I[0]=r.host:I.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(g[0]===""?g[0]=t.host:g.unshift(t.host)),t.host=null),T=T&&(g[0]===""||I[0]==="")),A)r.host=t.host||t.host===""?t.host:r.host,r.hostname=t.hostname||t.hostname===""?t.hostname:r.hostname,r.search=t.search,r.query=t.query,I=g;else if(g.length)I||(I=[]),I.pop(),I=I.concat(g),r.search=t.search,r.query=t.query;else if(!Tt.isNullOrUndefined(t.search))return N&&(r.hostname=r.host=I.shift(),(te=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=te.shift(),r.host=r.hostname=te.shift())),r.search=t.search,r.query=t.query,Tt.isNull(r.pathname)&&Tt.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!I.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var D=I.slice(-1)[0],Y=(r.host||t.host||I.length>1)&&(D==="."||D==="..")||D==="",Z=0,J=I.length;J>=0;J--)(D=I[J])==="."?I.splice(J,1):D===".."?(I.splice(J,1),Z++):Z&&(I.splice(J,1),Z--);if(!T&&!O)for(;Z--;Z)I.unshift("..");!T||I[0]===""||I[0]&&I[0].charAt(0)==="/"||I.unshift(""),Y&&I.join("/").substr(-1)!=="/"&&I.push("");var te,Pe=I[0]===""||I[0]&&I[0].charAt(0)==="/";return N&&(r.hostname=r.host=Pe?"":I.length?I.shift():"",(te=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=te.shift(),r.host=r.hostname=te.shift())),(T=T||r.host&&I.length)&&!Pe&&I.unshift(""),I.length?r.pathname=I.join("/"):(r.pathname=null,r.path=null),Tt.isNull(r.pathname)&&Tt.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},Qe.prototype.parseHost=function(){var t=this.host,e=FR.exec(t);e&&((e=e[0])!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};ie.Url;ie.format;ie.resolve;ie.resolveObject;mu={},Qy=!1;Jy=zR(),GR=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;ie.URL=typeof URL<"u"?URL:null;ie.pathToFileURL=aT;ie.fileURLToPath=nT;ie.Url;ie.format;ie.resolve;ie.resolveObject;ie.URL;KR=92,YR=47,QR=97,JR=122,Eu=GR==="win32",XR=/\//g,ZR=/%/g,eT=/\\/g,tT=/\n/g,rT=/\r/g,iT=/\t/g;lT=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;ie.URL=typeof URL<"u"?URL:null;ie.pathToFileURL=Zy;ie.fileURLToPath=Xy;uT=ie.Url,fT=ie.format,cT=ie.resolve,hT=ie.resolveObject,dT=ie.parse,pT=ie.URL,gT=92,yT=47,bT=97,wT=122,Su=lT==="win32",_T=/\//g,mT=/%/g,vT=/\\/g,ET=/\n/g,ST=/\r/g,AT=/\t/g});var Ru=M(Au=>{"use strict";w();m();_();Object.defineProperty(Au,"__esModule",{value:!0});var IT=typeof window<"u"&&typeof window.document<"u"||typeof self=="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope"||typeof navigator<"u"&&navigator.product==="ReactNative";Au.default=IT});var Tu={};Qt(Tu,{Server:()=>$e,Socket:()=>$e,Stream:()=>$e,_createServerHandle:()=>$e,_normalizeArgs:()=>$e,_setSimultaneousAccepts:()=>$e,connect:()=>$e,createConnection:()=>$e,createServer:()=>$e,default:()=>CT,isIP:()=>$e,isIPv4:()=>$e,isIPv6:()=>$e});function $e(){throw new Error("Node.js net module is not supported by JSPM core outside of Node.js")}var CT,Iu=we(()=>{w();m();_();CT={_createServerHandle:$e,_normalizeArgs:$e,_setSimultaneousAccepts:$e,connect:$e,createConnection:$e,createServer:$e,isIP:$e,isIPv4:$e,isIPv6:$e,Server:$e,Socket:$e,Stream:$e}});var Cu=M(hn=>{"use strict";w();m();_();var rb=hn&&hn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(hn,"__esModule",{value:!0});var PT=rb((Iu(),K(Tu))),BT=rb(wt()),OT=(0,BT.default)("mqttjs:tcp"),xT=(t,e)=>{e.port=e.port||1883,e.hostname=e.hostname||e.host||"localhost";let{port:r}=e,i=e.hostname;return OT("port %d and host %s",r,i),PT.default.createConnection(r,i)};hn.default=xT});var ib={};Qt(ib,{default:()=>kT});var kT,nb=we(()=>{w();m();_();kT={}});var Bu=M(dn=>{"use strict";w();m();_();var Pu=dn&&dn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(dn,"__esModule",{value:!0});var MT=Pu((nb(),K(ib))),LT=Pu((Iu(),K(Tu))),UT=Pu(wt()),NT=(0,UT.default)("mqttjs:tls"),DT=(t,e)=>{e.port=e.port||8883,e.host=e.hostname||e.host||"localhost",LT.default.isIP(e.host)===0&&(e.servername=e.host),e.rejectUnauthorized=e.rejectUnauthorized!==!1,delete e.path,NT("port %d host %s rejectUnauthorized %b",e.port,e.host,e.rejectUnauthorized);let r=MT.default.connect(e);r.on("secureConnect",()=>{e.rejectUnauthorized&&!r.authorized?r.emit("error",new Error("TLS not authorized")):r.removeListener("error",i)});function i(n){e.rejectUnauthorized&&t.emit("error",n),r.end()}return r.on("error",i),r};dn.default=DT});var Ou=M((x3,sb)=>{w();m();_();sb.exports=(Ut(),K(Lt)).EventEmitter});function Gr(t){return t.call.bind(t)}function bn(t,e){if(typeof t!="object")return!1;try{return e(t),!0}catch{return!1}}function ab(t){return qe&&He?Je(t)!==void 0:Eb(t)||Sb(t)||Ab(t)||Rb(t)||Tb(t)||Ib(t)||Cb(t)||Pb(t)||Bb(t)||Ob(t)||xb(t)}function Eb(t){return qe&&He?Je(t)==="Uint8Array":ue(t)==="[object Uint8Array]"||KT(t)&&t.buffer!==void 0}function Sb(t){return qe&&He?Je(t)==="Uint8ClampedArray":ue(t)==="[object Uint8ClampedArray]"}function Ab(t){return qe&&He?Je(t)==="Uint16Array":ue(t)==="[object Uint16Array]"}function Rb(t){return qe&&He?Je(t)==="Uint32Array":ue(t)==="[object Uint32Array]"}function Tb(t){return qe&&He?Je(t)==="Int8Array":ue(t)==="[object Int8Array]"}function Ib(t){return qe&&He?Je(t)==="Int16Array":ue(t)==="[object Int16Array]"}function Cb(t){return qe&&He?Je(t)==="Int32Array":ue(t)==="[object Int32Array]"}function Pb(t){return qe&&He?Je(t)==="Float32Array":ue(t)==="[object Float32Array]"}function Bb(t){return qe&&He?Je(t)==="Float64Array":ue(t)==="[object Float64Array]"}function Ob(t){return qe&&He?Je(t)==="BigInt64Array":ue(t)==="[object BigInt64Array]"}function xb(t){return qe&&He?Je(t)==="BigUint64Array":ue(t)==="[object BigUint64Array]"}function Ks(t){return ue(t)==="[object Map]"}function Ys(t){return ue(t)==="[object Set]"}function Qs(t){return ue(t)==="[object WeakMap]"}function xu(t){return ue(t)==="[object WeakSet]"}function eo(t){return ue(t)==="[object ArrayBuffer]"}function lb(t){return typeof ArrayBuffer<"u"&&(eo.working?eo(t):t instanceof ArrayBuffer)}function to(t){return ue(t)==="[object DataView]"}function ub(t){return typeof DataView<"u"&&(to.working?to(t):t instanceof DataView)}function ro(t){return ue(t)==="[object SharedArrayBuffer]"}function fb(t){return typeof SharedArrayBuffer<"u"&&(ro.working?ro(t):t instanceof SharedArrayBuffer)}function cb(t){return bn(t,ZT)}function hb(t){return bn(t,eI)}function db(t){return bn(t,tI)}function pb(t){return vb&&bn(t,rI)}function gb(t){return Nu&&bn(t,iI)}function ur(t,e){var r={seen:[],stylize:oI};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),Du(e)?r.showHidden=e:e&&x._extend(r,e),zr(r.showHidden)&&(r.showHidden=!1),zr(r.depth)&&(r.depth=2),zr(r.colors)&&(r.colors=!1),zr(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=sI),io(r,t,r.depth)}function sI(t,e){var r=ur.styles[e];return r?"\x1B["+ur.colors[r][0]+"m"+t+"\x1B["+ur.colors[r][1]+"m":t}function oI(t,e){return t}function io(t,e,r){if(t.customInspect&&e&&Zs(e.inspect)&&e.inspect!==x.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(r,t);return no(i)||(i=io(t,i,r)),i}var n=function(g,y){if(zr(y))return g.stylize("undefined","undefined");if(no(y)){var v="'"+JSON.stringify(y).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return g.stylize(v,"string")}if(Lb(y))return g.stylize(""+y,"number");if(Du(y))return g.stylize(""+y,"boolean");if(ao(y))return g.stylize("null","null")}(t,e);if(n)return n;var o=Object.keys(e),s=function(g){var y={};return g.forEach(function(v,E){y[v]=!0}),y}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),yn(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return ku(e);if(o.length===0){if(Zs(e)){var a=e.name?": "+e.name:"";return t.stylize("[Function"+a+"]","special")}if(gn(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(so(e))return t.stylize(Date.prototype.toString.call(e),"date");if(yn(e))return ku(e)}var l,c="",h=!1,d=["{","}"];return Mb(e)&&(h=!0,d=["[","]"]),Zs(e)&&(c=" [Function"+(e.name?": "+e.name:"")+"]"),gn(e)&&(c=" "+RegExp.prototype.toString.call(e)),so(e)&&(c=" "+Date.prototype.toUTCString.call(e)),yn(e)&&(c=" "+ku(e)),o.length!==0||h&&e.length!=0?r<0?gn(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),l=h?function(g,y,v,E,A){for(var T=[],O=0,I=y.length;O<I;++O)Ub(y,String(O))?T.push(Mu(g,y,v,E,String(O),!0)):T.push("");return A.forEach(function(N){N.match(/^\d+$/)||T.push(Mu(g,y,v,E,N,!0))}),T}(t,e,r,s,o):o.map(function(g){return Mu(t,e,r,s,g,h)}),t.seen.pop(),function(g,y,v){var E=0;return g.reduce(function(A,T){return E++,T.indexOf(`
|
|
6
6
|
`)>=0&&E++,A+T.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?v[0]+(y===""?"":y+`
|
|
7
7
|
`)+" "+g.join(`,
|
|
8
|
-
`)+" "+v[1]:v[0]+y+" "+g.join(", ")+" "+v[1]}(l,c,d)):d[0]+c+d[1]}function
|
|
8
|
+
`)+" "+v[1]:v[0]+y+" "+g.join(", ")+" "+v[1]}(l,c,d)):d[0]+c+d[1]}function ku(t){return"["+Error.prototype.toString.call(t)+"]"}function Mu(t,e,r,i,n,o){var s,a,l;if((l=Object.getOwnPropertyDescriptor(e,n)||{value:e[n]}).get?a=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(a=t.stylize("[Setter]","special")),Ub(i,n)||(s="["+n+"]"),a||(t.seen.indexOf(l.value)<0?(a=ao(r)?io(t,l.value,null):io(t,l.value,r-1)).indexOf(`
|
|
9
9
|
`)>-1&&(a=o?a.split(`
|
|
10
10
|
`).map(function(c){return" "+c}).join(`
|
|
11
11
|
`).substr(2):`
|
|
12
12
|
`+a.split(`
|
|
13
13
|
`).map(function(c){return" "+c}).join(`
|
|
14
|
-
`)):a=t.stylize("[Circular]","special")),Vr(s)){if(o&&n.match(/^\d+$/))return a;(s=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function xb(t){return Array.isArray(t)}function Nu(t){return typeof t=="boolean"}function oo(t){return t===null}function kb(t){return typeof t=="number"}function io(t){return typeof t=="string"}function Vr(t){return t===void 0}function pn(t){return xi(t)&&Du(t)==="[object RegExp]"}function xi(t){return typeof t=="object"&&t!==null}function no(t){return xi(t)&&Du(t)==="[object Date]"}function gn(t){return xi(t)&&(Du(t)==="[object Error]"||t instanceof Error)}function Xs(t){return typeof t=="function"}function Du(t){return Object.prototype.toString.call(t)}function Mu(t){return t<10?"0"+t.toString(10):t.toString(10)}function sI(){var t=new Date,e=[Mu(t.getHours()),Mu(t.getMinutes()),Mu(t.getSeconds())].join(":");return[t.getDate(),nI[t.getMonth()],e].join(" ")}function Mb(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function oI(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}var UT,Lu,so,gb,NT,DT,qT,jT,FT,yb,bb,nb,WT,$T,HT,wb,V,VT,zT,GT,_b,Uu,He,qe,KT,ue,QT,JT,XT,dn,x,Tt,pb,tI,Qs,Ob,Js,nI,Hr,ao=we(()=>{w();m();_();un();UT=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",Lu=Object.prototype.toString,so=function(t){return!(UT&&t&&typeof t=="object"&&Symbol.toStringTag in t)&&Lu.call(t)==="[object Arguments]"},gb=function(t){return!!so(t)||t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Lu.call(t)!=="[object Array]"&&Lu.call(t.callee)==="[object Function]"},NT=function(){return so(arguments)}();so.isLegacyArguments=gb;DT=NT?so:gb,qT=Object.prototype.toString,jT=Function.prototype.toString,FT=/^\s*(?:function)?\*/,yb=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",bb=Object.getPrototypeOf,nb=function(){if(!yb)return!1;try{return Function("return function*() {}")()}catch{}}(),WT=nb?bb(nb):{},$T=function(t){return typeof t=="function"&&(!!FT.test(jT.call(t))||(yb?bb(t)===WT:qT.call(t)==="[object GeneratorFunction]"))},HT=typeof Object.create=="function"?function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},wb=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"},V={},VT=wb,zT=DT,GT=$T;_b=typeof BigInt<"u",Uu=typeof Symbol<"u",He=Uu&&Symbol.toStringTag!==void 0,qe=typeof Uint8Array<"u",KT=typeof ArrayBuffer<"u";if(qe&&He)var YT=Object.getPrototypeOf(Uint8Array.prototype),Je=zr(Object.getOwnPropertyDescriptor(YT,Symbol.toStringTag).get);ue=zr(Object.prototype.toString),QT=zr(Number.prototype.valueOf),JT=zr(String.prototype.valueOf),XT=zr(Boolean.prototype.valueOf);if(_b)var ZT=zr(BigInt.prototype.valueOf);if(Uu)var eI=zr(Symbol.prototype.valueOf);V.isArgumentsObject=zT,V.isGeneratorFunction=GT,V.isPromise=function(t){return typeof Promise<"u"&&t instanceof Promise||t!==null&&typeof t=="object"&&typeof t.then=="function"&&typeof t.catch=="function"},V.isArrayBufferView=function(t){return KT&&ArrayBuffer.isView?ArrayBuffer.isView(t):sb(t)||ab(t)},V.isTypedArray=sb,V.isUint8Array=mb,V.isUint8ClampedArray=vb,V.isUint16Array=Eb,V.isUint32Array=Sb,V.isInt8Array=Ab,V.isInt16Array=Rb,V.isInt32Array=Tb,V.isFloat32Array=Ib,V.isFloat64Array=Cb,V.isBigInt64Array=Pb,V.isBigUint64Array=Bb,Gs.working=typeof Map<"u"&&Gs(new Map),V.isMap=function(t){return typeof Map<"u"&&(Gs.working?Gs(t):t instanceof Map)},Ks.working=typeof Set<"u"&&Ks(new Set),V.isSet=function(t){return typeof Set<"u"&&(Ks.working?Ks(t):t instanceof Set)},Ys.working=typeof WeakMap<"u"&&Ys(new WeakMap),V.isWeakMap=function(t){return typeof WeakMap<"u"&&(Ys.working?Ys(t):t instanceof WeakMap)},Ou.working=typeof WeakSet<"u"&&Ou(new WeakSet),V.isWeakSet=function(t){return Ou(t)},Zs.working=typeof ArrayBuffer<"u"&&Zs(new ArrayBuffer),V.isArrayBuffer=ob,eo.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&eo(new DataView(new ArrayBuffer(1),0,1)),V.isDataView=ab,to.working=typeof SharedArrayBuffer<"u"&&to(new SharedArrayBuffer),V.isSharedArrayBuffer=lb,V.isAsyncFunction=function(t){return ue(t)==="[object AsyncFunction]"},V.isMapIterator=function(t){return ue(t)==="[object Map Iterator]"},V.isSetIterator=function(t){return ue(t)==="[object Set Iterator]"},V.isGeneratorObject=function(t){return ue(t)==="[object Generator]"},V.isWebAssemblyCompiledModule=function(t){return ue(t)==="[object WebAssembly.Module]"},V.isNumberObject=ub,V.isStringObject=fb,V.isBooleanObject=cb,V.isBigIntObject=hb,V.isSymbolObject=db,V.isBoxedPrimitive=function(t){return ub(t)||fb(t)||cb(t)||hb(t)||db(t)},V.isAnyArrayBuffer=function(t){return qe&&(ob(t)||lb(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(t){Object.defineProperty(V,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})});dn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window,x={},Tt=se,pb=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},i=0;i<e.length;i++)r[e[i]]=Object.getOwnPropertyDescriptor(t,e[i]);return r},tI=/%[sdj%]/g;x.format=function(t){if(!io(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(lr(arguments[r]));return e.join(" ")}r=1;for(var i=arguments,n=i.length,o=String(t).replace(tI,function(a){if(a==="%%")return"%";if(r>=n)return a;switch(a){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch{return"[Circular]"}default:return a}}),s=i[r];r<n;s=i[++r])oo(s)||!xi(s)?o+=" "+s:o+=" "+lr(s);return o},x.deprecate=function(t,e){if(Tt!==void 0&&Tt.noDeprecation===!0)return t;if(Tt===void 0)return function(){return x.deprecate(t,e).apply(this||dn,arguments)};var r=!1;return function(){if(!r){if(Tt.throwDeprecation)throw new Error(e);Tt.traceDeprecation?console.trace(e):console.error(e),r=!0}return t.apply(this||dn,arguments)}};Qs={},Ob=/^$/;Tt.env.NODE_DEBUG&&(Js=Tt.env.NODE_DEBUG,Js=Js.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),Ob=new RegExp("^"+Js+"$","i"));x.debuglog=function(t){if(t=t.toUpperCase(),!Qs[t])if(Ob.test(t)){var e=Tt.pid;Qs[t]=function(){var r=x.format.apply(x,arguments);console.error("%s %d: %s",t,e,r)}}else Qs[t]=function(){};return Qs[t]},x.inspect=lr,lr.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]},lr.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},x.types=V,x.isArray=xb,x.isBoolean=Nu,x.isNull=oo,x.isNullOrUndefined=function(t){return t==null},x.isNumber=kb,x.isString=io,x.isSymbol=function(t){return typeof t=="symbol"},x.isUndefined=Vr,x.isRegExp=pn,x.types.isRegExp=pn,x.isObject=xi,x.isDate=no,x.types.isDate=no,x.isError=gn,x.types.isNativeError=gn,x.isFunction=Xs,x.isPrimitive=function(t){return t===null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||typeof t=="symbol"||t===void 0},x.isBuffer=wb;nI=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];x.log=function(){console.log("%s - %s",sI(),x.format.apply(x,arguments))},x.inherits=HT,x._extend=function(t,e){if(!e||!xi(e))return t;for(var r=Object.keys(e),i=r.length;i--;)t[r[i]]=e[r[i]];return t};Hr=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;x.promisify=function(t){if(typeof t!="function")throw new TypeError('The "original" argument must be of type Function');if(Hr&&t[Hr]){var e;if(typeof(e=t[Hr])!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,Hr,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var r,i,n=new Promise(function(a,l){r=a,i=l}),o=[],s=0;s<arguments.length;s++)o.push(arguments[s]);o.push(function(a,l){a?i(a):r(l)});try{t.apply(this||dn,o)}catch(a){i(a)}return n}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Hr&&Object.defineProperty(e,Hr,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,pb(t))},x.promisify.custom=Hr,x.callbackify=function(t){if(typeof t!="function")throw new TypeError('The "original" argument must be of type Function');function e(){for(var r=[],i=0;i<arguments.length;i++)r.push(arguments[i]);var n=r.pop();if(typeof n!="function")throw new TypeError("The last argument must be of type Function");var o=this||dn,s=function(){return n.apply(o,arguments)};t.apply(this||dn,r).then(function(a){Tt.nextTick(s.bind(null,null,a))},function(a){Tt.nextTick(oI.bind(null,a,s))})}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,pb(t)),e}});var W3,$3,H3,V3,z3,G3,K3,Y3,Q3,J3,X3,Z3,e8,t8,r8,i8,n8,s8,o8,a8,l8,u8,f8,c8,h8,d8,p8,Lb=we(()=>{w();m();_();ao();un();x._extend;x.callbackify;x.debuglog;x.deprecate;x.format;x.inherits;x.inspect;x.isArray;x.isBoolean;x.isBuffer;x.isDate;x.isError;x.isFunction;x.isNull;x.isNullOrUndefined;x.isNumber;x.isObject;x.isPrimitive;x.isRegExp;x.isString;x.isSymbol;x.isUndefined;x.log;x.promisify;W3=x._extend,$3=x.callbackify,H3=x.debuglog,V3=x.deprecate,z3=x.format,G3=x.inherits,K3=x.inspect,Y3=x.isArray,Q3=x.isBoolean,J3=x.isBuffer,X3=x.isDate,Z3=x.isError,e8=x.isFunction,t8=x.isNull,r8=x.isNullOrUndefined,i8=x.isNumber,n8=x.isObject,s8=x.isPrimitive,o8=x.isRegExp,a8=x.isString,l8=x.isSymbol,u8=x.isUndefined,f8=x.log,c8=x.promisify,h8=x.types,d8=self.TextEncoder,p8=self.TextDecoder});var qu={};Yt(qu,{TextDecoder:()=>kI,TextEncoder:()=>xI,_extend:()=>aI,callbackify:()=>lI,debuglog:()=>uI,default:()=>x,deprecate:()=>fI,format:()=>cI,inherits:()=>hI,inspect:()=>dI,isArray:()=>pI,isBoolean:()=>gI,isBuffer:()=>yI,isDate:()=>bI,isError:()=>wI,isFunction:()=>_I,isNull:()=>mI,isNullOrUndefined:()=>vI,isNumber:()=>EI,isObject:()=>SI,isPrimitive:()=>AI,isRegExp:()=>RI,isString:()=>TI,isSymbol:()=>II,isUndefined:()=>CI,log:()=>PI,promisify:()=>BI,types:()=>OI});var aI,lI,uI,fI,cI,hI,dI,pI,gI,yI,bI,wI,_I,mI,vI,EI,SI,AI,RI,TI,II,CI,PI,BI,OI,xI,kI,ju=we(()=>{w();m();_();Lb();ao();ao();un();aI=x._extend,lI=x.callbackify,uI=x.debuglog,fI=x.deprecate,cI=x.format,hI=x.inherits,dI=x.inspect,pI=x.isArray,gI=x.isBoolean,yI=x.isBuffer,bI=x.isDate,wI=x.isError,_I=x.isFunction,mI=x.isNull,vI=x.isNullOrUndefined,EI=x.isNumber,SI=x.isObject,AI=x.isPrimitive,RI=x.isRegExp,TI=x.isString,II=x.isSymbol,CI=x.isUndefined,PI=x.log,BI=x.promisify,OI=x.types,xI=x.TextEncoder=globalThis.TextEncoder,kI=x.TextDecoder=globalThis.TextDecoder});var qb=M((x8,Db)=>{"use strict";w();m();_();function Ub(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function MI(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ub(Object(r),!0).forEach(function(i){LI(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ub(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function LI(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function UI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Nb(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function NI(t,e,r){return e&&Nb(t.prototype,e),r&&Nb(t,r),t}var DI=(de(),K(_e)),lo=DI.Buffer,qI=(ju(),K(qu)),Fu=qI.inspect,jI=Fu&&Fu.custom||"inspect";function FI(t,e,r){lo.prototype.copy.call(t,e,r)}Db.exports=function(){function t(){UI(this,t),this.head=null,this.tail=null,this.length=0}return NI(t,[{key:"push",value:function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}},{key:"unshift",value:function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n}},{key:"concat",value:function(r){if(this.length===0)return lo.alloc(0);for(var i=lo.allocUnsafe(r>>>0),n=this.head,o=0;n;)FI(n.data,i,o),o+=n.data.length,n=n.next;return i}},{key:"consume",value:function(r,i){var n;return r<this.head.data.length?(n=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?n=this.shift():n=i?this._getString(r):this._getBuffer(r),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var i=this.head,n=1,o=i.data;for(r-=o.length;i=i.next;){var s=i.data,a=r>s.length?s.length:r;if(a===s.length?o+=s:o+=s.slice(0,r),r-=a,r===0){a===s.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=s.slice(a));break}++n}return this.length-=n,o}},{key:"_getBuffer",value:function(r){var i=lo.allocUnsafe(r),n=this.head,o=1;for(n.data.copy(i),r-=n.data.length;n=n.next;){var s=n.data,a=r>s.length?s.length:r;if(s.copy(i,i.length-r,0,a),r-=a,r===0){a===s.length?(++o,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(a));break}++o}return this.length-=o,i}},{key:jI,value:function(r,i){return Fu(this,MI({},i,{depth:0,customInspect:!1}))}}]),t}()});var $u=M((q8,Fb)=>{"use strict";w();m();_();function WI(t,e){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,R.nextTick(Wu,this,t)):R.nextTick(Wu,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(o){!e&&o?r._writableState?r._writableState.errorEmitted?R.nextTick(uo,r):(r._writableState.errorEmitted=!0,R.nextTick(jb,r,o)):R.nextTick(jb,r,o):e?(R.nextTick(uo,r),e(o)):R.nextTick(uo,r)}),this)}function jb(t,e){Wu(t,e),uo(t)}function uo(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function $I(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Wu(t,e){t.emit("error",e)}function HI(t,e){var r=t._readableState,i=t._writableState;r&&r.autoDestroy||i&&i.autoDestroy?t.destroy(e):t.emit("error",e)}Fb.exports={destroy:WI,undestroy:$I,errorOrDestroy:HI}});var Gr=M((z8,Hb)=>{"use strict";w();m();_();function VI(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var $b={};function Xe(t,e,r){r||(r=Error);function i(o,s,a){return typeof e=="string"?e:e(o,s,a)}var n=function(o){VI(s,o);function s(a,l,c){return o.call(this,i(a,l,c))||this}return s}(r);n.prototype.name=r.name,n.prototype.code=t,$b[t]=n}function Wb(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(i){return String(i)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:r===2?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}else return"of ".concat(e," ").concat(String(t))}function zI(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function GI(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function KI(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}Xe("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);Xe("ERR_INVALID_ARG_TYPE",function(t,e,r){var i;typeof e=="string"&&zI(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be";var n;if(GI(t," argument"))n="The ".concat(t," ").concat(i," ").concat(Wb(e,"type"));else{var o=KI(t,".")?"property":"argument";n='The "'.concat(t,'" ').concat(o," ").concat(i," ").concat(Wb(e,"type"))}return n+=". Received type ".concat(typeof r),n},TypeError);Xe("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Xe("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});Xe("ERR_STREAM_PREMATURE_CLOSE","Premature close");Xe("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});Xe("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Xe("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Xe("ERR_STREAM_WRITE_AFTER_END","write after end");Xe("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Xe("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);Xe("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Hb.exports.codes=$b});var Hu=M((Z8,Vb)=>{"use strict";w();m();_();var YI=Gr().codes.ERR_INVALID_OPT_VALUE;function QI(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function JI(t,e,r,i){var n=QI(e,i,r);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var o=i?r:"highWaterMark";throw new YI(o,n)}return Math.floor(n)}return t.objectMode?16:16*1024}Vb.exports={getHighWaterMark:JI}});var Gb=M((o4,zb)=>{w();m();_();zb.exports=XI;function XI(t,e){if(Vu("noDeprecation"))return t;var r=!1;function i(){if(!r){if(Vu("throwDeprecation"))throw new Error(e);Vu("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}return i}function Vu(t){try{if(!window.localStorage)return!1}catch{return!1}var e=window.localStorage[t];return e==null?!1:String(e).toLowerCase()==="true"}});var Ku=M((d4,Zb)=>{"use strict";w();m();_();Zb.exports=he;function Yb(t){var e=this;this.next=null,this.entry=null,this.finish=function(){R2(e,t)}}var ki;he.WritableState=wn;var ZI={deprecate:Gb()},Qb=Bu(),co=(de(),K(_e)).Buffer,e2=window.Uint8Array||function(){};function t2(t){return co.from(t)}function r2(t){return co.isBuffer(t)||t instanceof e2}var Gu=$u(),i2=Hu(),n2=i2.getHighWaterMark,ur=Gr().codes,s2=ur.ERR_INVALID_ARG_TYPE,o2=ur.ERR_METHOD_NOT_IMPLEMENTED,a2=ur.ERR_MULTIPLE_CALLBACK,l2=ur.ERR_STREAM_CANNOT_PIPE,u2=ur.ERR_STREAM_DESTROYED,f2=ur.ERR_STREAM_NULL_VALUES,c2=ur.ERR_STREAM_WRITE_AFTER_END,h2=ur.ERR_UNKNOWN_ENCODING,Mi=Gu.errorOrDestroy;tr()(he,Qb);function d2(){}function wn(t,e,r){ki=ki||Kr(),t=t||{},typeof r!="boolean"&&(r=e instanceof ki),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=n2(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=t.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(n){m2(e,n)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new Yb(this)}wn.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(wn.prototype,"buffer",{get:ZI.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var fo;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(fo=Function.prototype[Symbol.hasInstance],Object.defineProperty(he,Symbol.hasInstance,{value:function(e){return fo.call(this,e)?!0:this!==he?!1:e&&e._writableState instanceof wn}})):fo=function(e){return e instanceof this};function he(t){ki=ki||Kr();var e=this instanceof ki;if(!e&&!fo.call(he,this))return new he(t);this._writableState=new wn(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),Qb.call(this)}he.prototype.pipe=function(){Mi(this,new l2)};function p2(t,e){var r=new c2;Mi(t,r),R.nextTick(e,r)}function g2(t,e,r,i){var n;return r===null?n=new f2:typeof r!="string"&&!e.objectMode&&(n=new s2("chunk",["string","Buffer"],r)),n?(Mi(t,n),R.nextTick(i,n),!1):!0}he.prototype.write=function(t,e,r){var i=this._writableState,n=!1,o=!i.objectMode&&r2(t);return o&&!co.isBuffer(t)&&(t=t2(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=i.defaultEncoding),typeof r!="function"&&(r=d2),i.ending?p2(this,r):(o||g2(this,i,t,r))&&(i.pendingcb++,n=b2(this,i,o,t,e,r)),n};he.prototype.cork=function(){this._writableState.corked++};he.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&Jb(this,t))};he.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new h2(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(he.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function y2(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=co.from(e,r)),e}Object.defineProperty(he.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function b2(t,e,r,i,n,o){if(!r){var s=y2(e,i,n);i!==s&&(r=!0,n="buffer",i=s)}var a=e.objectMode?1:i.length;e.length+=a;var l=e.length<e.highWaterMark;if(l||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else zu(t,e,!1,a,i,n,o);return l}function zu(t,e,r,i,n,o,s){e.writelen=i,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new u2("write")):r?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}function w2(t,e,r,i,n){--e.pendingcb,r?(R.nextTick(n,i),R.nextTick(bn,t,e),t._writableState.errorEmitted=!0,Mi(t,i)):(n(i),t._writableState.errorEmitted=!0,Mi(t,i),bn(t,e))}function _2(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function m2(t,e){var r=t._writableState,i=r.sync,n=r.writecb;if(typeof n!="function")throw new a2;if(_2(r),e)w2(t,r,i,e,n);else{var o=Xb(r)||t.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&Jb(t,r),i?R.nextTick(Kb,t,r,o,n):Kb(t,r,o,n)}}function Kb(t,e,r,i){r||v2(t,e),e.pendingcb--,i(),bn(t,e)}function v2(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function Jb(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount,n=new Array(i),o=e.corkedRequestsFree;o.entry=r;for(var s=0,a=!0;r;)n[s]=r,r.isBuf||(a=!1),r=r.next,s+=1;n.allBuffers=a,zu(t,e,!0,e.length,n,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new Yb(e),e.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,c=r.encoding,h=r.callback,d=e.objectMode?1:l.length;if(zu(t,e,!1,d,l,c,h),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}he.prototype._write=function(t,e,r){r(new o2("_write()"))};he.prototype._writev=null;he.prototype.end=function(t,e,r){var i=this._writableState;return typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||A2(this,i,r),this};Object.defineProperty(he.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Xb(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function E2(t,e){t._final(function(r){e.pendingcb--,r&&Mi(t,r),e.prefinished=!0,t.emit("prefinish"),bn(t,e)})}function S2(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,R.nextTick(E2,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function bn(t,e){var r=Xb(e);if(r&&(S2(t,e),e.pendingcb===0&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return r}function A2(t,e,r){e.ending=!0,bn(t,e),r&&(e.finished?R.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function R2(t,e,r){var i=t.entry;for(t.entry=null;i;){var n=i.callback;e.pendingcb--,n(r),i=i.next}e.corkedRequestsFree.next=t}Object.defineProperty(he.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});he.prototype.destroy=Gu.destroy;he.prototype._undestroy=Gu.undestroy;he.prototype._destroy=function(t,e){e(t)}});var Kr=M((m4,tw)=>{"use strict";w();m();_();var T2=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};tw.exports=It;var ew=Ju(),Qu=Ku();tr()(It,ew);for(Yu=T2(Qu.prototype),ho=0;ho<Yu.length;ho++)po=Yu[ho],It.prototype[po]||(It.prototype[po]=Qu.prototype[po]);var Yu,po,ho;function It(t){if(!(this instanceof It))return new It(t);ew.call(this,t),Qu.call(this,t),this.allowHalfOpen=!0,t&&(t.readable===!1&&(this.readable=!1),t.writable===!1&&(this.writable=!1),t.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",I2)))}Object.defineProperty(It.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(It.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(It.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function I2(){this._writableState.ended||R.nextTick(C2,this)}function C2(t){t.end()}Object.defineProperty(It.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var nw=M((Xu,iw)=>{w();m();_();var go=(de(),K(_e)),Ct=go.Buffer;function rw(t,e){for(var r in t)e[r]=t[r]}Ct.from&&Ct.alloc&&Ct.allocUnsafe&&Ct.allocUnsafeSlow?iw.exports=go:(rw(go,Xu),Xu.Buffer=Yr);function Yr(t,e,r){return Ct(t,e,r)}Yr.prototype=Object.create(Ct.prototype);rw(Ct,Yr);Yr.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Ct(t,e,r)};Yr.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=Ct(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i};Yr.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Ct(t)};Yr.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return go.SlowBuffer(t)}});var tf=M(ow=>{"use strict";w();m();_();var ef=nw().Buffer,sw=ef.isEncoding||function(t){switch(t=""+t,t&&t.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 P2(t){if(!t)return"utf8";for(var e;;)switch(t){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 t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function B2(t){var e=P2(t);if(typeof e!="string"&&(ef.isEncoding===sw||!sw(t)))throw new Error("Unknown encoding: "+t);return e||t}ow.StringDecoder=_n;function _n(t){this.encoding=B2(t);var e;switch(this.encoding){case"utf16le":this.text=U2,this.end=N2,e=4;break;case"utf8":this.fillLast=k2,e=4;break;case"base64":this.text=D2,this.end=q2,e=3;break;default:this.write=j2,this.end=F2;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=ef.allocUnsafe(e)}_n.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};_n.prototype.end=L2;_n.prototype.text=M2;_n.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function Zu(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function O2(t,e,r){var i=e.length-1;if(i<r)return 0;var n=Zu(e[i]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--i<r||n===-2?0:(n=Zu(e[i]),n>=0?(n>0&&(t.lastNeed=n-2),n):--i<r||n===-2?0:(n=Zu(e[i]),n>=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}function x2(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function k2(t){var e=this.lastTotal-this.lastNeed,r=x2(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function M2(t,e){var r=O2(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)}function L2(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function U2(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function N2(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function D2(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function q2(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function j2(t){return t.toString(this.encoding)}function F2(t){return t&&t.length?this.write(t):""}});var yo=M((j4,uw)=>{"use strict";w();m();_();var aw=Gr().codes.ERR_STREAM_PREMATURE_CLOSE;function W2(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];t.apply(this,i)}}}function $2(){}function H2(t){return t.setHeader&&typeof t.abort=="function"}function lw(t,e,r){if(typeof e=="function")return lw(t,null,e);e||(e={}),r=W2(r||$2);var i=e.readable||e.readable!==!1&&t.readable,n=e.writable||e.writable!==!1&&t.writable,o=function(){t.writable||a()},s=t._writableState&&t._writableState.finished,a=function(){n=!1,s=!0,i||r.call(t)},l=t._readableState&&t._readableState.endEmitted,c=function(){i=!1,l=!0,n||r.call(t)},h=function(v){r.call(t,v)},d=function(){var v;if(i&&!l)return(!t._readableState||!t._readableState.ended)&&(v=new aw),r.call(t,v);if(n&&!s)return(!t._writableState||!t._writableState.ended)&&(v=new aw),r.call(t,v)},g=function(){t.req.on("finish",a)};return H2(t)?(t.on("complete",a),t.on("abort",d),t.req?g():t.on("request",g)):n&&!t._writableState&&(t.on("end",o),t.on("close",o)),t.on("end",c),t.on("finish",a),e.error!==!1&&t.on("error",h),t.on("close",d),function(){t.removeListener("complete",a),t.removeListener("abort",d),t.removeListener("request",g),t.req&&t.req.removeListener("finish",a),t.removeListener("end",o),t.removeListener("close",o),t.removeListener("finish",a),t.removeListener("end",c),t.removeListener("error",h),t.removeListener("close",d)}}uw.exports=lw});var cw=M((G4,fw)=>{"use strict";w();m();_();var bo;function fr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var V2=yo(),cr=Symbol("lastResolve"),Qr=Symbol("lastReject"),mn=Symbol("error"),wo=Symbol("ended"),Jr=Symbol("lastPromise"),rf=Symbol("handlePromise"),Xr=Symbol("stream");function hr(t,e){return{value:t,done:e}}function z2(t){var e=t[cr];if(e!==null){var r=t[Xr].read();r!==null&&(t[Jr]=null,t[cr]=null,t[Qr]=null,e(hr(r,!1)))}}function G2(t){R.nextTick(z2,t)}function K2(t,e){return function(r,i){t.then(function(){if(e[wo]){r(hr(void 0,!0));return}e[rf](r,i)},i)}}var Y2=Object.getPrototypeOf(function(){}),Q2=Object.setPrototypeOf((bo={get stream(){return this[Xr]},next:function(){var e=this,r=this[mn];if(r!==null)return Promise.reject(r);if(this[wo])return Promise.resolve(hr(void 0,!0));if(this[Xr].destroyed)return new Promise(function(s,a){R.nextTick(function(){e[mn]?a(e[mn]):s(hr(void 0,!0))})});var i=this[Jr],n;if(i)n=new Promise(K2(i,this));else{var o=this[Xr].read();if(o!==null)return Promise.resolve(hr(o,!1));n=new Promise(this[rf])}return this[Jr]=n,n}},fr(bo,Symbol.asyncIterator,function(){return this}),fr(bo,"return",function(){var e=this;return new Promise(function(r,i){e[Xr].destroy(null,function(n){if(n){i(n);return}r(hr(void 0,!0))})})}),bo),Y2),J2=function(e){var r,i=Object.create(Q2,(r={},fr(r,Xr,{value:e,writable:!0}),fr(r,cr,{value:null,writable:!0}),fr(r,Qr,{value:null,writable:!0}),fr(r,mn,{value:null,writable:!0}),fr(r,wo,{value:e._readableState.endEmitted,writable:!0}),fr(r,rf,{value:function(o,s){var a=i[Xr].read();a?(i[Jr]=null,i[cr]=null,i[Qr]=null,o(hr(a,!1))):(i[cr]=o,i[Qr]=s)},writable:!0}),r));return i[Jr]=null,V2(e,function(n){if(n&&n.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=i[Qr];o!==null&&(i[Jr]=null,i[cr]=null,i[Qr]=null,o(n)),i[mn]=n;return}var s=i[cr];s!==null&&(i[Jr]=null,i[cr]=null,i[Qr]=null,s(hr(void 0,!0))),i[wo]=!0}),e.on("readable",G2.bind(null,i)),i};fw.exports=J2});var dw=M((eF,hw)=>{w();m();_();hw.exports=function(){throw new Error("Readable.from is not available in the browser")}});var Ju=M((lF,Sw)=>{"use strict";w();m();_();Sw.exports=Q;var Li;Q.ReadableState=bw;var aF=(Lt(),K(Mt)).EventEmitter,yw=function(e,r){return e.listeners(r).length},En=Bu(),_o=(de(),K(_e)).Buffer,X2=window.Uint8Array||function(){};function Z2(t){return _o.from(t)}function eC(t){return _o.isBuffer(t)||t instanceof X2}var nf=(ju(),K(qu)),H;nf&&nf.debuglog?H=nf.debuglog("stream"):H=function(){};var tC=qb(),cf=$u(),rC=Hu(),iC=rC.getHighWaterMark,mo=Gr().codes,nC=mo.ERR_INVALID_ARG_TYPE,sC=mo.ERR_STREAM_PUSH_AFTER_EOF,oC=mo.ERR_METHOD_NOT_IMPLEMENTED,aC=mo.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Ui,sf,of;tr()(Q,En);var vn=cf.errorOrDestroy,af=["error","close","destroy","pause","resume"];function lC(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function bw(t,e,r){Li=Li||Kr(),t=t||{},typeof r!="boolean"&&(r=e instanceof Li),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=iC(this,t,"readableHighWaterMark",r),this.buffer=new tC,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=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(Ui||(Ui=tf().StringDecoder),this.decoder=new Ui(t.encoding),this.encoding=t.encoding)}function Q(t){if(Li=Li||Kr(),!(this instanceof Q))return new Q(t);var e=this instanceof Li;this._readableState=new bw(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),En.call(this)}Object.defineProperty(Q.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});Q.prototype.destroy=cf.destroy;Q.prototype._undestroy=cf.undestroy;Q.prototype._destroy=function(t,e){e(t)};Q.prototype.push=function(t,e){var r=this._readableState,i;return r.objectMode?i=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=_o.from(t,e),e=""),i=!0),ww(this,t,e,!1,i)};Q.prototype.unshift=function(t){return ww(this,t,null,!0,!1)};function ww(t,e,r,i,n){H("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,cC(t,o);else{var s;if(n||(s=uC(o,e)),s)vn(t,s);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==_o.prototype&&(e=Z2(e)),i)o.endEmitted?vn(t,new aC):lf(t,o,e,!0);else if(o.ended)vn(t,new sC);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?lf(t,o,e,!1):ff(t,o)):lf(t,o,e,!1)}else i||(o.reading=!1,ff(t,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function lf(t,e,r,i){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&vo(t)),ff(t,e)}function uC(t,e){var r;return!eC(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new nC("chunk",["string","Buffer","Uint8Array"],e)),r}Q.prototype.isPaused=function(){return this._readableState.flowing===!1};Q.prototype.setEncoding=function(t){Ui||(Ui=tf().StringDecoder);var e=new Ui(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";r!==null;)i+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),i!==""&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var pw=1073741824;function fC(t){return t>=pw?t=pw:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function gw(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=fC(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}Q.prototype.read=function(t){H("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return H("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?uf(this):vo(this),null;if(t=gw(t,e),t===0&&e.ended)return e.length===0&&uf(this),null;var i=e.needReadable;H("need readable",i),(e.length===0||e.length-t<e.highWaterMark)&&(i=!0,H("length less than watermark",i)),e.ended||e.reading?(i=!1,H("reading or ended",i)):i&&(H("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=gw(r,e)));var n;return t>0?n=vw(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&uf(this)),n!==null&&this.emit("data",n),n};function cC(t,e){if(H("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?vo(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,_w(t)))}}function vo(t){var e=t._readableState;H("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(H("emitReadable",e.flowing),e.emittedReadable=!0,R.nextTick(_w,t))}function _w(t){var e=t._readableState;H("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,hf(t)}function ff(t,e){e.readingMore||(e.readingMore=!0,R.nextTick(hC,t,e))}function hC(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(H("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}Q.prototype._read=function(t){vn(this,new oC("_read()"))};Q.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t);break}i.pipesCount+=1,H("pipe count=%d opts=%j",i.pipesCount,e);var n=(!e||e.end!==!1)&&t!==R.stdout&&t!==R.stderr,o=n?a:E;i.endEmitted?R.nextTick(o):r.once("end",o),t.on("unpipe",s);function s(A,T){H("onunpipe"),A===r&&T&&T.hasUnpiped===!1&&(T.hasUnpiped=!0,h())}function a(){H("onend"),t.end()}var l=dC(r);t.on("drain",l);var c=!1;function h(){H("cleanup"),t.removeListener("close",y),t.removeListener("finish",v),t.removeListener("drain",l),t.removeListener("error",g),t.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",E),r.removeListener("data",d),c=!0,i.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&l()}r.on("data",d);function d(A){H("ondata");var T=t.write(A);H("dest.write",T),T===!1&&((i.pipesCount===1&&i.pipes===t||i.pipesCount>1&&Ew(i.pipes,t)!==-1)&&!c&&(H("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function g(A){H("onerror",A),E(),t.removeListener("error",g),yw(t,"error")===0&&vn(t,A)}lC(t,"error",g);function y(){t.removeListener("finish",v),E()}t.once("close",y);function v(){H("onfinish"),t.removeListener("close",y),E()}t.once("finish",v);function E(){H("unpipe"),r.unpipe(t)}return t.emit("pipe",r),i.flowing||(H("pipe resume"),r.resume()),t};function dC(t){return function(){var r=t._readableState;H("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&yw(t,"data")&&(r.flowing=!0,hf(t))}}Q.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=Ew(e.pipes,t);return s===-1?this:(e.pipes.splice(s,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};Q.prototype.on=function(t,e){var r=En.prototype.on.call(this,t,e),i=this._readableState;return t==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):t==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,H("on readable",i.length,i.reading),i.length?vo(this):i.reading||R.nextTick(pC,this)),r};Q.prototype.addListener=Q.prototype.on;Q.prototype.removeListener=function(t,e){var r=En.prototype.removeListener.call(this,t,e);return t==="readable"&&R.nextTick(mw,this),r};Q.prototype.removeAllListeners=function(t){var e=En.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&R.nextTick(mw,this),e};function mw(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function pC(t){H("readable nexttick read 0"),t.read(0)}Q.prototype.resume=function(){var t=this._readableState;return t.flowing||(H("resume"),t.flowing=!t.readableListening,gC(this,t)),t.paused=!1,this};function gC(t,e){e.resumeScheduled||(e.resumeScheduled=!0,R.nextTick(yC,t,e))}function yC(t,e){H("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),hf(t),e.flowing&&!e.reading&&t.read(0)}Q.prototype.pause=function(){return H("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(H("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function hf(t){var e=t._readableState;for(H("flow",e.flowing);e.flowing&&t.read()!==null;);}Q.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;t.on("end",function(){if(H("wrapped end"),r.decoder&&!r.ended){var s=r.decoder.end();s&&s.length&&e.push(s)}e.push(null)}),t.on("data",function(s){if(H("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!(r.objectMode&&s==null)&&!(!r.objectMode&&(!s||!s.length))){var a=e.push(s);a||(i=!0,t.pause())}});for(var n in t)this[n]===void 0&&typeof t[n]=="function"&&(this[n]=function(a){return function(){return t[a].apply(t,arguments)}}(n));for(var o=0;o<af.length;o++)t.on(af[o],this.emit.bind(this,af[o]));return this._read=function(s){H("wrapped _read",s),i&&(i=!1,t.resume())},this};typeof Symbol=="function"&&(Q.prototype[Symbol.asyncIterator]=function(){return sf===void 0&&(sf=cw()),sf(this)});Object.defineProperty(Q.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(Q.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(Q.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});Q._fromList=vw;Object.defineProperty(Q.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function vw(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function uf(t){var e=t._readableState;H("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,R.nextTick(bC,e,t))}function bC(t,e){if(H("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&(Q.from=function(t,e){return of===void 0&&(of=dw()),of(Q,t,e)});function Ew(t,e){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}});var df=M((gF,Rw)=>{"use strict";w();m();_();Rw.exports=zt;var Eo=Gr().codes,wC=Eo.ERR_METHOD_NOT_IMPLEMENTED,_C=Eo.ERR_MULTIPLE_CALLBACK,mC=Eo.ERR_TRANSFORM_ALREADY_TRANSFORMING,vC=Eo.ERR_TRANSFORM_WITH_LENGTH_0,So=Kr();tr()(zt,So);function EC(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(i===null)return this.emit("error",new _C);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function zt(t){if(!(this instanceof zt))return new zt(t);So.call(this,t),this._transformState={afterTransform:EC.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",SC)}function SC(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){Aw(t,e,r)}):Aw(this,null,null)}zt.prototype.push=function(t,e){return this._transformState.needTransform=!1,So.prototype.push.call(this,t,e)};zt.prototype._transform=function(t,e,r){r(new wC("_transform()"))};zt.prototype._write=function(t,e,r){var i=this._transformState;if(i.writecb=r,i.writechunk=t,i.writeencoding=e,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}};zt.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};zt.prototype._destroy=function(t,e){So.prototype._destroy.call(this,t,function(r){e(r)})};function Aw(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new vC;if(t._transformState.transforming)throw new mC;return t.push(null)}});var Cw=M((EF,Iw)=>{"use strict";w();m();_();Iw.exports=Sn;var Tw=df();tr()(Sn,Tw);function Sn(t){if(!(this instanceof Sn))return new Sn(t);Tw.call(this,t)}Sn.prototype._transform=function(t,e,r){r(null,t)}});var kw=M((PF,xw)=>{"use strict";w();m();_();var pf;function AC(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var Ow=Gr().codes,RC=Ow.ERR_MISSING_ARGS,TC=Ow.ERR_STREAM_DESTROYED;function Pw(t){if(t)throw t}function IC(t){return t.setHeader&&typeof t.abort=="function"}function CC(t,e,r,i){i=AC(i);var n=!1;t.on("close",function(){n=!0}),pf===void 0&&(pf=yo()),pf(t,{readable:e,writable:r},function(s){if(s)return i(s);n=!0,i()});var o=!1;return function(s){if(!n&&!o){if(o=!0,IC(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();i(s||new TC("pipe"))}}}function Bw(t){t()}function PC(t,e){return t.pipe(e)}function BC(t){return!t.length||typeof t[t.length-1]!="function"?Pw:t.pop()}function OC(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var i=BC(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new RC("streams");var n,o=e.map(function(s,a){var l=a<e.length-1,c=a>0;return CC(s,l,c,function(h){n||(n=h),h&&o.forEach(Bw),!l&&(o.forEach(Bw),i(n))})});return e.reduce(PC)}xw.exports=OC});var Lw=M((Ze,Mw)=>{w();m();_();Ze=Mw.exports=Ju();Ze.Stream=Ze;Ze.Readable=Ze;Ze.Writable=Ku();Ze.Duplex=Kr();Ze.Transform=df();Ze.PassThrough=Cw();Ze.finished=yo();Ze.pipeline=kw()});var Dw=M((WF,Nw)=>{w();m();_();Nw.exports=Uw;function Uw(t,e){if(t&&e)return Uw(t)(e);if(typeof t!="function")throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(i){r[i]=t[i]}),r;function r(){for(var i=new Array(arguments.length),n=0;n<i.length;n++)i[n]=arguments[n];var o=t.apply(this,i),s=i[i.length-1];return typeof o=="function"&&o!==s&&Object.keys(s).forEach(function(a){o[a]=s[a]}),o}}});var Fw=M((YF,gf)=>{w();m();_();var qw=Dw();gf.exports=qw(Ao);gf.exports.strict=qw(jw);Ao.proto=Ao(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return Ao(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return jw(this)},configurable:!0})});function Ao(t){var e=function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function jw(t){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},r=t.name||"Function wrapped with `once`";return e.onceError=r+" shouldn't be called more than once",e.called=!1,e}});var Hw=M((r5,$w)=>{w();m();_();var xC=Fw(),kC=function(){},MC=function(t){return t.setHeader&&typeof t.abort=="function"},LC=function(t){return t.stdio&&Array.isArray(t.stdio)&&t.stdio.length===3},Ww=function(t,e,r){if(typeof e=="function")return Ww(t,null,e);e||(e={}),r=xC(r||kC);var i=t._writableState,n=t._readableState,o=e.readable||e.readable!==!1&&t.readable,s=e.writable||e.writable!==!1&&t.writable,a=!1,l=function(){t.writable||c()},c=function(){s=!1,o||r.call(t)},h=function(){o=!1,s||r.call(t)},d=function(A){r.call(t,A?new Error("exited with error code: "+A):null)},g=function(A){r.call(t,A)},y=function(){R.nextTick(v)},v=function(){if(!a){if(o&&!(n&&n.ended&&!n.destroyed))return r.call(t,new Error("premature close"));if(s&&!(i&&i.ended&&!i.destroyed))return r.call(t,new Error("premature close"))}},E=function(){t.req.on("finish",c)};return MC(t)?(t.on("complete",c),t.on("abort",y),t.req?E():t.on("request",E)):s&&!i&&(t.on("end",l),t.on("close",l)),LC(t)&&t.on("exit",d),t.on("end",h),t.on("finish",c),e.error!==!1&&t.on("error",g),t.on("close",y),function(){a=!0,t.removeListener("complete",c),t.removeListener("abort",y),t.removeListener("request",E),t.req&&t.req.removeListener("finish",c),t.removeListener("end",l),t.removeListener("close",l),t.removeListener("finish",c),t.removeListener("exit",d),t.removeListener("end",h),t.removeListener("error",g),t.removeListener("close",y)}};$w.exports=Ww});var zw=M((u5,Vw)=>{w();m();_();Vw.exports=UC;function UC(t){var e=t._readableState;return e?e.objectMode||typeof t._duplexState=="number"?t.read():t.read(NC(e)):null}function NC(t){return t.buffer.length?t.buffer.head?t.buffer.head.data.length:t.buffer[0].length:t.length}});var To=M((y5,Qw)=>{w();m();_();var Ro=Lw(),Gw=Hw(),DC=tr(),qC=zw(),Kw=O.from&&O.from!==Uint8Array.from?O.from([0]):new O([0]),yf=function(t,e){t._corked?t.once("uncork",e):e()},jC=function(t,e){t._autoDestroy&&t.destroy(e)},Yw=function(t,e){return function(r){r?jC(t,r.message==="premature close"?null:r):e&&!t._ended&&t.end()}},FC=function(t,e){if(!t||t._writableState&&t._writableState.finished)return e();if(t._writableState)return t.end(e);t.end(),e()},WC=function(){},$C=function(t){return new Ro.Readable({objectMode:!0,highWaterMark:16}).wrap(t)},Re=function(t,e,r){if(!(this instanceof Re))return new Re(t,e,r);Ro.Duplex.call(this,r),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!r||r.autoDestroy!==!1,this._forwardDestroy=!r||r.destroy!==!1,this._forwardEnd=!r||r.end!==!1,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,t&&this.setWritable(t),e&&this.setReadable(e)};DC(Re,Ro.Duplex);Re.obj=function(t,e,r){return r||(r={}),r.objectMode=!0,r.highWaterMark=16,new Re(t,e,r)};Re.prototype.cork=function(){++this._corked===1&&this.emit("cork")};Re.prototype.uncork=function(){this._corked&&--this._corked===0&&this.emit("uncork")};Re.prototype.setWritable=function(t){if(this._unwrite&&this._unwrite(),this.destroyed){t&&t.destroy&&t.destroy();return}if(t===null||t===!1){this.end();return}var e=this,r=Gw(t,{writable:!0,readable:!1},Yw(this,this._forwardEnd)),i=function(){var o=e._ondrain;e._ondrain=null,o&&o()},n=function(){e._writable.removeListener("drain",i),r()};this._unwrite&&R.nextTick(i),this._writable=t,this._writable.on("drain",i),this._unwrite=n,this.uncork()};Re.prototype.setReadable=function(t){if(this._unread&&this._unread(),this.destroyed){t&&t.destroy&&t.destroy();return}if(t===null||t===!1){this.push(null),this.resume();return}var e=this,r=Gw(t,{writable:!1,readable:!0},Yw(this)),i=function(){e._forward()},n=function(){e.push(null)},o=function(){e._readable2.removeListener("readable",i),e._readable2.removeListener("end",n),r()};this._drained=!0,this._readable=t,this._readable2=t._readableState?t:$C(t),this._readable2.on("readable",i),this._readable2.on("end",n),this._unread=o,this._forward()};Re.prototype._read=function(){this._drained=!0,this._forward()};Re.prototype._forward=function(){if(!(this._forwarding||!this._readable2||!this._drained)){this._forwarding=!0;for(var t;this._drained&&(t=qC(this._readable2))!==null;)this.destroyed||(this._drained=this.push(t));this._forwarding=!1}};Re.prototype.destroy=function(t,e){if(e||(e=WC),this.destroyed)return e(null);this.destroyed=!0;var r=this;R.nextTick(function(){r._destroy(t),e(null)})};Re.prototype._destroy=function(t){if(t){var e=this._ondrain;this._ondrain=null,e?e(t):this.emit("error",t)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")};Re.prototype._write=function(t,e,r){if(!this.destroyed){if(this._corked)return yf(this,this._write.bind(this,t,e,r));if(t===Kw)return this._finish(r);if(!this._writable)return r();this._writable.write(t)===!1?this._ondrain=r:this.destroyed||r()}};Re.prototype._finish=function(t){var e=this;this.emit("preend"),yf(this,function(){FC(e._forwardEnd&&e._writable,function(){e._writableState.prefinished===!1&&(e._writableState.prefinished=!0),e.emit("prefinish"),yf(e,t)})})};Re.prototype.end=function(t,e,r){return typeof t=="function"?this.end(null,null,t):typeof e=="function"?this.end(t,null,e):(this._ended=!0,t&&this.write(t),!this._writableState.ending&&!this._writableState.destroyed&&this.write(Kw),Ro.Writable.prototype.end.call(this,r))};Qw.exports=Re});var bf=M(An=>{"use strict";w();m();_();var HC=An&&An.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(An,"__esModule",{value:!0});var Jw=(de(),K(_e)),VC=xr(),zC=HC(To()),Gt,Io,je;function GC(){let t=new VC.Transform;return t._write=(e,r,i)=>{Gt.send({data:e.buffer,success(){i()},fail(n){i(new Error(n))}})},t._flush=e=>{Gt.close({success(){e()}})},t}function KC(t){t.hostname||(t.hostname="localhost"),t.path||(t.path="/"),t.wsOptions||(t.wsOptions={})}function YC(t,e){let r=t.protocol==="wxs"?"wss":"ws",i=`${r}://${t.hostname}${t.path}`;return t.port&&t.port!==80&&t.port!==443&&(i=`${r}://${t.hostname}:${t.port}${t.path}`),typeof t.transformWsUrl=="function"&&(i=t.transformWsUrl(i,t,e)),i}function QC(){Gt.onOpen(()=>{je.setReadable(Io),je.setWritable(Io),je.emit("connect")}),Gt.onMessage(t=>{let{data:e}=t;e instanceof ArrayBuffer?e=Jw.Buffer.from(e):e=Jw.Buffer.from(e,"utf8"),Io.push(e)}),Gt.onClose(()=>{je.emit("close"),je.end(),je.destroy()}),Gt.onError(t=>{je.destroy(new Error(t.errMsg))})}var JC=(t,e)=>{if(e.hostname=e.hostname||e.host,!e.hostname)throw new Error("Could not determine host. Specify host manually.");let r=e.protocolId==="MQIsdp"&&e.protocolVersion===3?"mqttv3.1":"mqtt";KC(e);let i=YC(e,t);Gt=wx.connectSocket({url:i,protocols:[r]}),Io=GC(),je=zC.default.obj(),je._destroy=(o,s)=>{Gt.close({success(){s&&s(o)}})};let n=je.destroy;return je.destroy=()=>{je.destroy=n,setTimeout(()=>{Gt.close({fail(){je._destroy(new Error)}})},0)},QC(),je};An.default=JC});var _f=M(Tn=>{"use strict";w();m();_();var XC=Tn&&Tn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Tn,"__esModule",{value:!0});var wf=(de(),K(_e)),ZC=xr(),eP=XC(To()),pr,Rn,dr,Xw=!1;function tP(){let t=new ZC.Transform;return t._write=(e,r,i)=>{pr.sendSocketMessage({data:e.buffer,success(){i()},fail(){i(new Error)}})},t._flush=e=>{pr.closeSocket({success(){e()}})},t}function rP(t){t.hostname||(t.hostname="localhost"),t.path||(t.path="/"),t.wsOptions||(t.wsOptions={})}function iP(t,e){let r=t.protocol==="alis"?"wss":"ws",i=`${r}://${t.hostname}${t.path}`;return t.port&&t.port!==80&&t.port!==443&&(i=`${r}://${t.hostname}:${t.port}${t.path}`),typeof t.transformWsUrl=="function"&&(i=t.transformWsUrl(i,t,e)),i}function nP(){Xw||(Xw=!0,pr.onSocketOpen(()=>{dr.setReadable(Rn),dr.setWritable(Rn),dr.emit("connect")}),pr.onSocketMessage(t=>{if(typeof t.data=="string"){let e=wf.Buffer.from(t.data,"base64");Rn.push(e)}else{let e=new FileReader;e.addEventListener("load",()=>{let r=e.result;r instanceof ArrayBuffer?r=wf.Buffer.from(r):r=wf.Buffer.from(r,"utf8"),Rn.push(r)}),e.readAsArrayBuffer(t.data)}}),pr.onSocketClose(()=>{dr.end(),dr.destroy()}),pr.onSocketError(t=>{dr.destroy(t)}))}var sP=(t,e)=>{if(e.hostname=e.hostname||e.host,!e.hostname)throw new Error("Could not determine host. Specify host manually.");let r=e.protocolId==="MQIsdp"&&e.protocolVersion===3?"mqttv3.1":"mqtt";rP(e);let i=iP(e,t);return pr=e.my,pr.connectSocket({url:i,protocols:r}),Rn=tP(),dr=eP.default.obj(),nP(),dr};Tn.default=sP});var e_=M((N5,Zw)=>{"use strict";w();m();_();Zw.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}});var mf=M(Pn=>{"use strict";w();m();_();var Co=Pn&&Pn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Pn,"__esModule",{value:!0});var In=(de(),K(_e)),t_=Co(e_()),oP=Co(bt()),aP=Co(To()),lP=xr(),r_=Co(Au()),Cn=(0,oP.default)("mqttjs:ws"),uP=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function i_(t,e){let r=`${t.protocol}://${t.hostname}:${t.port}${t.path}`;return typeof t.transformWsUrl=="function"&&(r=t.transformWsUrl(r,t,e)),r}function n_(t){let e=t;return t.hostname||(e.hostname="localhost"),t.port||(t.protocol==="wss"?e.port=443:e.port=80),t.path||(e.path="/"),t.wsOptions||(e.wsOptions={}),!r_.default&&t.protocol==="wss"&&uP.forEach(r=>{Object.prototype.hasOwnProperty.call(t,r)&&!Object.prototype.hasOwnProperty.call(t.wsOptions,r)&&(e.wsOptions[r]=t[r])}),e}function fP(t){let e=n_(t);if(e.hostname||(e.hostname=e.host),!e.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");let r=new URL(document.URL);e.hostname=r.hostname,e.port||(e.port=Number(r.port))}return e.objectMode===void 0&&(e.objectMode=!(e.binary===!0||e.binary===void 0)),e}function cP(t,e,r){Cn("createWebSocket"),Cn(`protocol: ${r.protocolId} ${r.protocolVersion}`);let i=r.protocolId==="MQIsdp"&&r.protocolVersion===3?"mqttv3.1":"mqtt";Cn(`creating new Websocket for url: ${e} and protocol: ${i}`);let n;return r.createWebsocket?n=r.createWebsocket(e,[i],r):n=new t_.default(e,[i],r.wsOptions),n}function hP(t,e){let r=e.protocolId==="MQIsdp"&&e.protocolVersion===3?"mqttv3.1":"mqtt",i=i_(e,t),n;return e.createWebsocket?n=e.createWebsocket(i,[r],e):n=new WebSocket(i,[r]),n.binaryType="arraybuffer",n}var dP=(t,e)=>{Cn("streamBuilder");let r=n_(e),i=i_(r,t),n=cP(t,i,r),o=t_.default.createWebSocketStream(n,r.wsOptions);return o.url=i,n.on("close",()=>{o.destroy()}),o},pP=(t,e)=>{Cn("browserStreamBuilder");let r,n=fP(e).browserBufferSize||1024*512,o=e.browserBufferTimeout||1e3,s=!e.objectMode,a=hP(t,e),l=h(e,A,T);e.objectMode||(l._writev=E),l.on("close",()=>{a.close()});let c=typeof a.addEventListener<"u";a.readyState===a.OPEN?r=l:(r=(0,aP.default)(void 0,void 0,e),e.objectMode||(r._writev=E),c?a.addEventListener("open",d):a.onopen=d),r.socket=a,c?(a.addEventListener("close",g),a.addEventListener("error",y),a.addEventListener("message",v)):(a.onclose=g,a.onerror=y,a.onmessage=v);function h(B,I,N){let D=new lP.Transform({objectMode:B.objectMode});return D._write=I,D._flush=N,D}function d(){r.setReadable(l),r.setWritable(l),r.emit("connect")}function g(){r.end(),r.destroy()}function y(B){r.destroy(B)}function v(B){let{data:I}=B;I instanceof ArrayBuffer?I=In.Buffer.from(I):I=In.Buffer.from(I,"utf8"),l.push(I)}function E(B,I){let N=new Array(B.length);for(let D=0;D<B.length;D++)typeof B[D].chunk=="string"?N[D]=In.Buffer.from(B[D],"utf8"):N[D]=B[D].chunk;this._write(In.Buffer.concat(N),"binary",I)}function A(B,I,N){a.bufferedAmount>n&&setTimeout(A,o,B,I,N),s&&typeof B=="string"&&(B=In.Buffer.from(B,"utf8"));try{a.send(B)}catch(D){return N(D)}N()}function T(B){a.close(),B()}return r};Pn.default=r_.default?pP:dP});var a_=M(Zr=>{"use strict";w();m();_();var Po=Zr&&Zr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Zr,"__esModule",{value:!0});Zr.connectAsync=void 0;var gP=Po(bt()),yP=Po((Zy(),K(Xy))),bP=Po(Vs()),wP=Po(Au()),s_=(0,gP.default)("mqttjs"),Me={};wP.default?(Me.wx=bf().default,Me.wxs=bf().default,Me.ali=_f().default,Me.alis=_f().default):(Me.mqtt=Iu().default,Me.tcp=Iu().default,Me.ssl=Pu().default,Me.tls=Me.ssl,Me.mqtts=Pu().default);Me.ws=mf().default;Me.wss=mf().default;function _P(t){let e;t.auth&&(e=t.auth.match(/^(.+):(.+)$/),e?(t.username=e[1],t.password=e[2]):t.username=t.auth)}function o_(t,e){if(s_("connecting to an MQTT broker..."),typeof t=="object"&&!e&&(e=t,t=""),e=e||{},t&&typeof t=="string"){let n=yP.default.parse(t,!0);if(n.port!=null&&(n.port=Number(n.port)),e=Object.assign(Object.assign({},n),e),e.protocol===null)throw new Error("Missing protocol");e.protocol=e.protocol.replace(/:$/,"")}if(_P(e),e.query&&typeof e.query.clientId=="string"&&(e.clientId=e.query.clientId),e.cert&&e.key)if(e.protocol){if(["mqtts","wss","wxs","alis"].indexOf(e.protocol)===-1)switch(e.protocol){case"mqtt":e.protocol="mqtts";break;case"ws":e.protocol="wss";break;case"wx":e.protocol="wxs";break;case"ali":e.protocol="alis";break;default:throw new Error(`Unknown protocol for secure connection: "${e.protocol}"!`)}}else throw new Error("Missing secure protocol key");if(!Me[e.protocol]){let n=["mqtts","wss"].indexOf(e.protocol)!==-1;e.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((o,s)=>n&&s%2===0?!1:typeof Me[o]=="function")[0]}if(e.clean===!1&&!e.clientId)throw new Error("Missing clientId for unclean clients");e.protocol&&(e.defaultProtocol=e.protocol);function r(n){return e.servers&&((!n._reconnectCount||n._reconnectCount===e.servers.length)&&(n._reconnectCount=0),e.host=e.servers[n._reconnectCount].host,e.port=e.servers[n._reconnectCount].port,e.protocol=e.servers[n._reconnectCount].protocol?e.servers[n._reconnectCount].protocol:e.defaultProtocol,e.hostname=e.host,n._reconnectCount++),s_("calling streambuilder for",e.protocol),Me[e.protocol](n,e)}let i=new bP.default(r,e);return i.on("error",()=>{}),i}function mP(t,e,r=!0){return new Promise((i,n)=>{let o=o_(t,e),s={connect:l=>{a(),i(o)},end:()=>{a(),i(o)},error:l=>{a(),o.end(),n(l)}};r===!1&&(s.close=()=>{s.error(new Error("Couldn't connect to server"))});function a(){Object.keys(s).forEach(l=>{o.off(l,s[l])})}Object.keys(s).forEach(l=>{o.on(l,s[l])})})}Zr.connectAsync=mP;Zr.default=o_});var IP=M(X=>{w();m();_();var l_=X&&X.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),vP=X&&X.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),EP=X&&X.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&l_(e,t,r);return vP(e,t),e},u_=X&&X.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&l_(e,t,r)},Bo=X&&X.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(X,"__esModule",{value:!0});X.ReasonCodes=X.UniqueMessageIdProvider=X.DefaultMessageIdProvider=X.Store=X.MqttClient=X.connectAsync=X.connect=X.Client=void 0;var f_=Bo(Vs());X.MqttClient=f_.default;var SP=Bo(bl());X.DefaultMessageIdProvider=SP.default;var AP=Bo(Py());X.UniqueMessageIdProvider=AP.default;var RP=Bo(ml());X.Store=RP.default;var c_=EP(a_());X.connect=c_.default;Object.defineProperty(X,"connectAsync",{enumerable:!0,get:function(){return c_.connectAsync}});X.Client=f_.default;u_(Vs(),X);u_(en(),X);var TP=tn();Object.defineProperty(X,"ReasonCodes",{enumerable:!0,get:function(){return TP.ReasonCodes}})});return IP();})();
|
|
14
|
+
`)):a=t.stylize("[Circular]","special")),zr(s)){if(o&&n.match(/^\d+$/))return a;(s=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function Mb(t){return Array.isArray(t)}function Du(t){return typeof t=="boolean"}function ao(t){return t===null}function Lb(t){return typeof t=="number"}function no(t){return typeof t=="string"}function zr(t){return t===void 0}function gn(t){return ki(t)&&qu(t)==="[object RegExp]"}function ki(t){return typeof t=="object"&&t!==null}function so(t){return ki(t)&&qu(t)==="[object Date]"}function yn(t){return ki(t)&&(qu(t)==="[object Error]"||t instanceof Error)}function Zs(t){return typeof t=="function"}function qu(t){return Object.prototype.toString.call(t)}function Lu(t){return t<10?"0"+t.toString(10):t.toString(10)}function lI(){var t=new Date,e=[Lu(t.getHours()),Lu(t.getMinutes()),Lu(t.getSeconds())].join(":");return[t.getDate(),aI[t.getMonth()],e].join(" ")}function Ub(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function uI(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}var qT,Uu,oo,bb,jT,FT,WT,$T,HT,wb,_b,ob,VT,zT,GT,mb,V,KT,YT,QT,vb,Nu,He,qe,JT,ue,ZT,eI,tI,pn,x,It,yb,nI,Js,kb,Xs,aI,Vr,lo=we(()=>{w();m();_();fn();qT=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",Uu=Object.prototype.toString,oo=function(t){return!(qT&&t&&typeof t=="object"&&Symbol.toStringTag in t)&&Uu.call(t)==="[object Arguments]"},bb=function(t){return!!oo(t)||t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Uu.call(t)!=="[object Array]"&&Uu.call(t.callee)==="[object Function]"},jT=function(){return oo(arguments)}();oo.isLegacyArguments=bb;FT=jT?oo:bb,WT=Object.prototype.toString,$T=Function.prototype.toString,HT=/^\s*(?:function)?\*/,wb=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",_b=Object.getPrototypeOf,ob=function(){if(!wb)return!1;try{return Function("return function*() {}")()}catch{}}(),VT=ob?_b(ob):{},zT=function(t){return typeof t=="function"&&(!!HT.test($T.call(t))||(wb?_b(t)===VT:WT.call(t)==="[object GeneratorFunction]"))},GT=typeof Object.create=="function"?function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},mb=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"},V={},KT=mb,YT=FT,QT=zT;vb=typeof BigInt<"u",Nu=typeof Symbol<"u",He=Nu&&Symbol.toStringTag!==void 0,qe=typeof Uint8Array<"u",JT=typeof ArrayBuffer<"u";if(qe&&He)var XT=Object.getPrototypeOf(Uint8Array.prototype),Je=Gr(Object.getOwnPropertyDescriptor(XT,Symbol.toStringTag).get);ue=Gr(Object.prototype.toString),ZT=Gr(Number.prototype.valueOf),eI=Gr(String.prototype.valueOf),tI=Gr(Boolean.prototype.valueOf);if(vb)var rI=Gr(BigInt.prototype.valueOf);if(Nu)var iI=Gr(Symbol.prototype.valueOf);V.isArgumentsObject=YT,V.isGeneratorFunction=QT,V.isPromise=function(t){return typeof Promise<"u"&&t instanceof Promise||t!==null&&typeof t=="object"&&typeof t.then=="function"&&typeof t.catch=="function"},V.isArrayBufferView=function(t){return JT&&ArrayBuffer.isView?ArrayBuffer.isView(t):ab(t)||ub(t)},V.isTypedArray=ab,V.isUint8Array=Eb,V.isUint8ClampedArray=Sb,V.isUint16Array=Ab,V.isUint32Array=Rb,V.isInt8Array=Tb,V.isInt16Array=Ib,V.isInt32Array=Cb,V.isFloat32Array=Pb,V.isFloat64Array=Bb,V.isBigInt64Array=Ob,V.isBigUint64Array=xb,Ks.working=typeof Map<"u"&&Ks(new Map),V.isMap=function(t){return typeof Map<"u"&&(Ks.working?Ks(t):t instanceof Map)},Ys.working=typeof Set<"u"&&Ys(new Set),V.isSet=function(t){return typeof Set<"u"&&(Ys.working?Ys(t):t instanceof Set)},Qs.working=typeof WeakMap<"u"&&Qs(new WeakMap),V.isWeakMap=function(t){return typeof WeakMap<"u"&&(Qs.working?Qs(t):t instanceof WeakMap)},xu.working=typeof WeakSet<"u"&&xu(new WeakSet),V.isWeakSet=function(t){return xu(t)},eo.working=typeof ArrayBuffer<"u"&&eo(new ArrayBuffer),V.isArrayBuffer=lb,to.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&to(new DataView(new ArrayBuffer(1),0,1)),V.isDataView=ub,ro.working=typeof SharedArrayBuffer<"u"&&ro(new SharedArrayBuffer),V.isSharedArrayBuffer=fb,V.isAsyncFunction=function(t){return ue(t)==="[object AsyncFunction]"},V.isMapIterator=function(t){return ue(t)==="[object Map Iterator]"},V.isSetIterator=function(t){return ue(t)==="[object Set Iterator]"},V.isGeneratorObject=function(t){return ue(t)==="[object Generator]"},V.isWebAssemblyCompiledModule=function(t){return ue(t)==="[object WebAssembly.Module]"},V.isNumberObject=cb,V.isStringObject=hb,V.isBooleanObject=db,V.isBigIntObject=pb,V.isSymbolObject=gb,V.isBoxedPrimitive=function(t){return cb(t)||hb(t)||db(t)||pb(t)||gb(t)},V.isAnyArrayBuffer=function(t){return qe&&(lb(t)||fb(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(t){Object.defineProperty(V,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})});pn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window,x={},It=se,yb=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},i=0;i<e.length;i++)r[e[i]]=Object.getOwnPropertyDescriptor(t,e[i]);return r},nI=/%[sdj%]/g;x.format=function(t){if(!no(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(ur(arguments[r]));return e.join(" ")}r=1;for(var i=arguments,n=i.length,o=String(t).replace(nI,function(a){if(a==="%%")return"%";if(r>=n)return a;switch(a){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch{return"[Circular]"}default:return a}}),s=i[r];r<n;s=i[++r])ao(s)||!ki(s)?o+=" "+s:o+=" "+ur(s);return o},x.deprecate=function(t,e){if(It!==void 0&&It.noDeprecation===!0)return t;if(It===void 0)return function(){return x.deprecate(t,e).apply(this||pn,arguments)};var r=!1;return function(){if(!r){if(It.throwDeprecation)throw new Error(e);It.traceDeprecation?console.trace(e):console.error(e),r=!0}return t.apply(this||pn,arguments)}};Js={},kb=/^$/;It.env.NODE_DEBUG&&(Xs=It.env.NODE_DEBUG,Xs=Xs.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),kb=new RegExp("^"+Xs+"$","i"));x.debuglog=function(t){if(t=t.toUpperCase(),!Js[t])if(kb.test(t)){var e=It.pid;Js[t]=function(){var r=x.format.apply(x,arguments);console.error("%s %d: %s",t,e,r)}}else Js[t]=function(){};return Js[t]},x.inspect=ur,ur.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]},ur.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},x.types=V,x.isArray=Mb,x.isBoolean=Du,x.isNull=ao,x.isNullOrUndefined=function(t){return t==null},x.isNumber=Lb,x.isString=no,x.isSymbol=function(t){return typeof t=="symbol"},x.isUndefined=zr,x.isRegExp=gn,x.types.isRegExp=gn,x.isObject=ki,x.isDate=so,x.types.isDate=so,x.isError=yn,x.types.isNativeError=yn,x.isFunction=Zs,x.isPrimitive=function(t){return t===null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||typeof t=="symbol"||t===void 0},x.isBuffer=mb;aI=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];x.log=function(){console.log("%s - %s",lI(),x.format.apply(x,arguments))},x.inherits=GT,x._extend=function(t,e){if(!e||!ki(e))return t;for(var r=Object.keys(e),i=r.length;i--;)t[r[i]]=e[r[i]];return t};Vr=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;x.promisify=function(t){if(typeof t!="function")throw new TypeError('The "original" argument must be of type Function');if(Vr&&t[Vr]){var e;if(typeof(e=t[Vr])!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,Vr,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var r,i,n=new Promise(function(a,l){r=a,i=l}),o=[],s=0;s<arguments.length;s++)o.push(arguments[s]);o.push(function(a,l){a?i(a):r(l)});try{t.apply(this||pn,o)}catch(a){i(a)}return n}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Vr&&Object.defineProperty(e,Vr,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,yb(t))},x.promisify.custom=Vr,x.callbackify=function(t){if(typeof t!="function")throw new TypeError('The "original" argument must be of type Function');function e(){for(var r=[],i=0;i<arguments.length;i++)r.push(arguments[i]);var n=r.pop();if(typeof n!="function")throw new TypeError("The last argument must be of type Function");var o=this||pn,s=function(){return n.apply(o,arguments)};t.apply(this||pn,r).then(function(a){It.nextTick(s.bind(null,null,a))},function(a){It.nextTick(uI.bind(null,a,s))})}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,yb(t)),e}});var Y3,Q3,J3,X3,Z3,e8,t8,r8,i8,n8,s8,o8,a8,l8,u8,f8,c8,h8,d8,p8,g8,y8,b8,w8,_8,m8,v8,Nb=we(()=>{w();m();_();lo();fn();x._extend;x.callbackify;x.debuglog;x.deprecate;x.format;x.inherits;x.inspect;x.isArray;x.isBoolean;x.isBuffer;x.isDate;x.isError;x.isFunction;x.isNull;x.isNullOrUndefined;x.isNumber;x.isObject;x.isPrimitive;x.isRegExp;x.isString;x.isSymbol;x.isUndefined;x.log;x.promisify;Y3=x._extend,Q3=x.callbackify,J3=x.debuglog,X3=x.deprecate,Z3=x.format,e8=x.inherits,t8=x.inspect,r8=x.isArray,i8=x.isBoolean,n8=x.isBuffer,s8=x.isDate,o8=x.isError,a8=x.isFunction,l8=x.isNull,u8=x.isNullOrUndefined,f8=x.isNumber,c8=x.isObject,h8=x.isPrimitive,d8=x.isRegExp,p8=x.isString,g8=x.isSymbol,y8=x.isUndefined,b8=x.log,w8=x.promisify,_8=x.types,m8=self.TextEncoder,v8=self.TextDecoder});var ju={};Qt(ju,{TextDecoder:()=>UI,TextEncoder:()=>LI,_extend:()=>fI,callbackify:()=>cI,debuglog:()=>hI,default:()=>x,deprecate:()=>dI,format:()=>pI,inherits:()=>gI,inspect:()=>yI,isArray:()=>bI,isBoolean:()=>wI,isBuffer:()=>_I,isDate:()=>mI,isError:()=>vI,isFunction:()=>EI,isNull:()=>SI,isNullOrUndefined:()=>AI,isNumber:()=>RI,isObject:()=>TI,isPrimitive:()=>II,isRegExp:()=>CI,isString:()=>PI,isSymbol:()=>BI,isUndefined:()=>OI,log:()=>xI,promisify:()=>kI,types:()=>MI});var fI,cI,hI,dI,pI,gI,yI,bI,wI,_I,mI,vI,EI,SI,AI,RI,TI,II,CI,PI,BI,OI,xI,kI,MI,LI,UI,Fu=we(()=>{w();m();_();Nb();lo();lo();fn();fI=x._extend,cI=x.callbackify,hI=x.debuglog,dI=x.deprecate,pI=x.format,gI=x.inherits,yI=x.inspect,bI=x.isArray,wI=x.isBoolean,_I=x.isBuffer,mI=x.isDate,vI=x.isError,EI=x.isFunction,SI=x.isNull,AI=x.isNullOrUndefined,RI=x.isNumber,TI=x.isObject,II=x.isPrimitive,CI=x.isRegExp,PI=x.isString,BI=x.isSymbol,OI=x.isUndefined,xI=x.log,kI=x.promisify,MI=x.types,LI=x.TextEncoder=globalThis.TextEncoder,UI=x.TextDecoder=globalThis.TextDecoder});var Fb=M((q8,jb)=>{"use strict";w();m();_();function Db(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function NI(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Db(Object(r),!0).forEach(function(i){DI(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Db(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function DI(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function qb(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function jI(t,e,r){return e&&qb(t.prototype,e),r&&qb(t,r),t}var FI=(de(),K(_e)),uo=FI.Buffer,WI=(Fu(),K(ju)),Wu=WI.inspect,$I=Wu&&Wu.custom||"inspect";function HI(t,e,r){uo.prototype.copy.call(t,e,r)}jb.exports=function(){function t(){qI(this,t),this.head=null,this.tail=null,this.length=0}return jI(t,[{key:"push",value:function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}},{key:"unshift",value:function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n}},{key:"concat",value:function(r){if(this.length===0)return uo.alloc(0);for(var i=uo.allocUnsafe(r>>>0),n=this.head,o=0;n;)HI(n.data,i,o),o+=n.data.length,n=n.next;return i}},{key:"consume",value:function(r,i){var n;return r<this.head.data.length?(n=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?n=this.shift():n=i?this._getString(r):this._getBuffer(r),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var i=this.head,n=1,o=i.data;for(r-=o.length;i=i.next;){var s=i.data,a=r>s.length?s.length:r;if(a===s.length?o+=s:o+=s.slice(0,r),r-=a,r===0){a===s.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=s.slice(a));break}++n}return this.length-=n,o}},{key:"_getBuffer",value:function(r){var i=uo.allocUnsafe(r),n=this.head,o=1;for(n.data.copy(i),r-=n.data.length;n=n.next;){var s=n.data,a=r>s.length?s.length:r;if(s.copy(i,i.length-r,0,a),r-=a,r===0){a===s.length?(++o,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(a));break}++o}return this.length-=o,i}},{key:$I,value:function(r,i){return Wu(this,NI({},i,{depth:0,customInspect:!1}))}}]),t}()});var Hu=M((z8,$b)=>{"use strict";w();m();_();function VI(t,e){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,R.nextTick($u,this,t)):R.nextTick($u,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(o){!e&&o?r._writableState?r._writableState.errorEmitted?R.nextTick(fo,r):(r._writableState.errorEmitted=!0,R.nextTick(Wb,r,o)):R.nextTick(Wb,r,o):e?(R.nextTick(fo,r),e(o)):R.nextTick(fo,r)}),this)}function Wb(t,e){$u(t,e),fo(t)}function fo(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function zI(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function $u(t,e){t.emit("error",e)}function GI(t,e){var r=t._readableState,i=t._writableState;r&&r.autoDestroy||i&&i.autoDestroy?t.destroy(e):t.emit("error",e)}$b.exports={destroy:VI,undestroy:zI,errorOrDestroy:GI}});var Kr=M((Z8,zb)=>{"use strict";w();m();_();function KI(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var Vb={};function Xe(t,e,r){r||(r=Error);function i(o,s,a){return typeof e=="string"?e:e(o,s,a)}var n=function(o){KI(s,o);function s(a,l,c){return o.call(this,i(a,l,c))||this}return s}(r);n.prototype.name=r.name,n.prototype.code=t,Vb[t]=n}function Hb(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(i){return String(i)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:r===2?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}else return"of ".concat(e," ").concat(String(t))}function YI(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function QI(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function JI(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}Xe("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);Xe("ERR_INVALID_ARG_TYPE",function(t,e,r){var i;typeof e=="string"&&YI(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be";var n;if(QI(t," argument"))n="The ".concat(t," ").concat(i," ").concat(Hb(e,"type"));else{var o=JI(t,".")?"property":"argument";n='The "'.concat(t,'" ').concat(o," ").concat(i," ").concat(Hb(e,"type"))}return n+=". Received type ".concat(typeof r),n},TypeError);Xe("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Xe("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});Xe("ERR_STREAM_PREMATURE_CLOSE","Premature close");Xe("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});Xe("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Xe("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Xe("ERR_STREAM_WRITE_AFTER_END","write after end");Xe("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Xe("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);Xe("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");zb.exports.codes=Vb});var Vu=M((o4,Gb)=>{"use strict";w();m();_();var XI=Kr().codes.ERR_INVALID_OPT_VALUE;function ZI(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function eC(t,e,r,i){var n=ZI(e,i,r);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var o=i?r:"highWaterMark";throw new XI(o,n)}return Math.floor(n)}return t.objectMode?16:16*1024}Gb.exports={getHighWaterMark:eC}});var Yb=M((d4,Kb)=>{w();m();_();Kb.exports=tC;function tC(t,e){if(zu("noDeprecation"))return t;var r=!1;function i(){if(!r){if(zu("throwDeprecation"))throw new Error(e);zu("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}return i}function zu(t){try{if(!window.localStorage)return!1}catch{return!1}var e=window.localStorage[t];return e==null?!1:String(e).toLowerCase()==="true"}});var Yu=M((m4,tw)=>{"use strict";w();m();_();tw.exports=he;function Jb(t){var e=this;this.next=null,this.entry=null,this.finish=function(){CC(e,t)}}var Mi;he.WritableState=_n;var rC={deprecate:Yb()},Xb=Ou(),ho=(de(),K(_e)).Buffer,iC=window.Uint8Array||function(){};function nC(t){return ho.from(t)}function sC(t){return ho.isBuffer(t)||t instanceof iC}var Ku=Hu(),oC=Vu(),aC=oC.getHighWaterMark,fr=Kr().codes,lC=fr.ERR_INVALID_ARG_TYPE,uC=fr.ERR_METHOD_NOT_IMPLEMENTED,fC=fr.ERR_MULTIPLE_CALLBACK,cC=fr.ERR_STREAM_CANNOT_PIPE,hC=fr.ERR_STREAM_DESTROYED,dC=fr.ERR_STREAM_NULL_VALUES,pC=fr.ERR_STREAM_WRITE_AFTER_END,gC=fr.ERR_UNKNOWN_ENCODING,Li=Ku.errorOrDestroy;rr()(he,Xb);function yC(){}function _n(t,e,r){Mi=Mi||Yr(),t=t||{},typeof r!="boolean"&&(r=e instanceof Mi),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=aC(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=t.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(n){SC(e,n)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new Jb(this)}_n.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(_n.prototype,"buffer",{get:rC.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var co;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(co=Function.prototype[Symbol.hasInstance],Object.defineProperty(he,Symbol.hasInstance,{value:function(e){return co.call(this,e)?!0:this!==he?!1:e&&e._writableState instanceof _n}})):co=function(e){return e instanceof this};function he(t){Mi=Mi||Yr();var e=this instanceof Mi;if(!e&&!co.call(he,this))return new he(t);this._writableState=new _n(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),Xb.call(this)}he.prototype.pipe=function(){Li(this,new cC)};function bC(t,e){var r=new pC;Li(t,r),R.nextTick(e,r)}function wC(t,e,r,i){var n;return r===null?n=new dC:typeof r!="string"&&!e.objectMode&&(n=new lC("chunk",["string","Buffer"],r)),n?(Li(t,n),R.nextTick(i,n),!1):!0}he.prototype.write=function(t,e,r){var i=this._writableState,n=!1,o=!i.objectMode&&sC(t);return o&&!ho.isBuffer(t)&&(t=nC(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=i.defaultEncoding),typeof r!="function"&&(r=yC),i.ending?bC(this,r):(o||wC(this,i,t,r))&&(i.pendingcb++,n=mC(this,i,o,t,e,r)),n};he.prototype.cork=function(){this._writableState.corked++};he.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&Zb(this,t))};he.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new gC(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(he.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function _C(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=ho.from(e,r)),e}Object.defineProperty(he.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function mC(t,e,r,i,n,o){if(!r){var s=_C(e,i,n);i!==s&&(r=!0,n="buffer",i=s)}var a=e.objectMode?1:i.length;e.length+=a;var l=e.length<e.highWaterMark;if(l||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else Gu(t,e,!1,a,i,n,o);return l}function Gu(t,e,r,i,n,o,s){e.writelen=i,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new hC("write")):r?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}function vC(t,e,r,i,n){--e.pendingcb,r?(R.nextTick(n,i),R.nextTick(wn,t,e),t._writableState.errorEmitted=!0,Li(t,i)):(n(i),t._writableState.errorEmitted=!0,Li(t,i),wn(t,e))}function EC(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function SC(t,e){var r=t._writableState,i=r.sync,n=r.writecb;if(typeof n!="function")throw new fC;if(EC(r),e)vC(t,r,i,e,n);else{var o=ew(r)||t.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&Zb(t,r),i?R.nextTick(Qb,t,r,o,n):Qb(t,r,o,n)}}function Qb(t,e,r,i){r||AC(t,e),e.pendingcb--,i(),wn(t,e)}function AC(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function Zb(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount,n=new Array(i),o=e.corkedRequestsFree;o.entry=r;for(var s=0,a=!0;r;)n[s]=r,r.isBuf||(a=!1),r=r.next,s+=1;n.allBuffers=a,Gu(t,e,!0,e.length,n,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new Jb(e),e.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,c=r.encoding,h=r.callback,d=e.objectMode?1:l.length;if(Gu(t,e,!1,d,l,c,h),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}he.prototype._write=function(t,e,r){r(new uC("_write()"))};he.prototype._writev=null;he.prototype.end=function(t,e,r){var i=this._writableState;return typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||IC(this,i,r),this};Object.defineProperty(he.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function ew(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function RC(t,e){t._final(function(r){e.pendingcb--,r&&Li(t,r),e.prefinished=!0,t.emit("prefinish"),wn(t,e)})}function TC(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,R.nextTick(RC,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function wn(t,e){var r=ew(e);if(r&&(TC(t,e),e.pendingcb===0&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return r}function IC(t,e,r){e.ending=!0,wn(t,e),r&&(e.finished?R.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function CC(t,e,r){var i=t.entry;for(t.entry=null;i;){var n=i.callback;e.pendingcb--,n(r),i=i.next}e.corkedRequestsFree.next=t}Object.defineProperty(he.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});he.prototype.destroy=Ku.destroy;he.prototype._undestroy=Ku.undestroy;he.prototype._destroy=function(t,e){e(t)}});var Yr=M((I4,iw)=>{"use strict";w();m();_();var PC=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};iw.exports=Ct;var rw=Xu(),Ju=Yu();rr()(Ct,rw);for(Qu=PC(Ju.prototype),po=0;po<Qu.length;po++)go=Qu[po],Ct.prototype[go]||(Ct.prototype[go]=Ju.prototype[go]);var Qu,go,po;function Ct(t){if(!(this instanceof Ct))return new Ct(t);rw.call(this,t),Ju.call(this,t),this.allowHalfOpen=!0,t&&(t.readable===!1&&(this.readable=!1),t.writable===!1&&(this.writable=!1),t.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",BC)))}Object.defineProperty(Ct.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Ct.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Ct.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function BC(){this._writableState.ended||R.nextTick(OC,this)}function OC(t){t.end()}Object.defineProperty(Ct.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var ow=M((Zu,sw)=>{w();m();_();var yo=(de(),K(_e)),Pt=yo.Buffer;function nw(t,e){for(var r in t)e[r]=t[r]}Pt.from&&Pt.alloc&&Pt.allocUnsafe&&Pt.allocUnsafeSlow?sw.exports=yo:(nw(yo,Zu),Zu.Buffer=Qr);function Qr(t,e,r){return Pt(t,e,r)}Qr.prototype=Object.create(Pt.prototype);nw(Pt,Qr);Qr.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Pt(t,e,r)};Qr.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=Pt(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i};Qr.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Pt(t)};Qr.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return yo.SlowBuffer(t)}});var rf=M(lw=>{"use strict";w();m();_();var tf=ow().Buffer,aw=tf.isEncoding||function(t){switch(t=""+t,t&&t.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 xC(t){if(!t)return"utf8";for(var e;;)switch(t){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 t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function kC(t){var e=xC(t);if(typeof e!="string"&&(tf.isEncoding===aw||!aw(t)))throw new Error("Unknown encoding: "+t);return e||t}lw.StringDecoder=mn;function mn(t){this.encoding=kC(t);var e;switch(this.encoding){case"utf16le":this.text=qC,this.end=jC,e=4;break;case"utf8":this.fillLast=UC,e=4;break;case"base64":this.text=FC,this.end=WC,e=3;break;default:this.write=$C,this.end=HC;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=tf.allocUnsafe(e)}mn.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};mn.prototype.end=DC;mn.prototype.text=NC;mn.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function ef(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function MC(t,e,r){var i=e.length-1;if(i<r)return 0;var n=ef(e[i]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--i<r||n===-2?0:(n=ef(e[i]),n>=0?(n>0&&(t.lastNeed=n-2),n):--i<r||n===-2?0:(n=ef(e[i]),n>=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}function LC(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function UC(t){var e=this.lastTotal-this.lastNeed,r=LC(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function NC(t,e){var r=MC(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)}function DC(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function qC(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function jC(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function FC(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function WC(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function $C(t){return t.toString(this.encoding)}function HC(t){return t&&t.length?this.write(t):""}});var bo=M((G4,cw)=>{"use strict";w();m();_();var uw=Kr().codes.ERR_STREAM_PREMATURE_CLOSE;function VC(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];t.apply(this,i)}}}function zC(){}function GC(t){return t.setHeader&&typeof t.abort=="function"}function fw(t,e,r){if(typeof e=="function")return fw(t,null,e);e||(e={}),r=VC(r||zC);var i=e.readable||e.readable!==!1&&t.readable,n=e.writable||e.writable!==!1&&t.writable,o=function(){t.writable||a()},s=t._writableState&&t._writableState.finished,a=function(){n=!1,s=!0,i||r.call(t)},l=t._readableState&&t._readableState.endEmitted,c=function(){i=!1,l=!0,n||r.call(t)},h=function(v){r.call(t,v)},d=function(){var v;if(i&&!l)return(!t._readableState||!t._readableState.ended)&&(v=new uw),r.call(t,v);if(n&&!s)return(!t._writableState||!t._writableState.ended)&&(v=new uw),r.call(t,v)},g=function(){t.req.on("finish",a)};return GC(t)?(t.on("complete",a),t.on("abort",d),t.req?g():t.on("request",g)):n&&!t._writableState&&(t.on("end",o),t.on("close",o)),t.on("end",c),t.on("finish",a),e.error!==!1&&t.on("error",h),t.on("close",d),function(){t.removeListener("complete",a),t.removeListener("abort",d),t.removeListener("request",g),t.req&&t.req.removeListener("finish",a),t.removeListener("end",o),t.removeListener("close",o),t.removeListener("finish",a),t.removeListener("end",c),t.removeListener("error",h),t.removeListener("close",d)}}cw.exports=fw});var dw=M((eF,hw)=>{"use strict";w();m();_();var wo;function cr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var KC=bo(),hr=Symbol("lastResolve"),Jr=Symbol("lastReject"),vn=Symbol("error"),_o=Symbol("ended"),Xr=Symbol("lastPromise"),nf=Symbol("handlePromise"),Zr=Symbol("stream");function dr(t,e){return{value:t,done:e}}function YC(t){var e=t[hr];if(e!==null){var r=t[Zr].read();r!==null&&(t[Xr]=null,t[hr]=null,t[Jr]=null,e(dr(r,!1)))}}function QC(t){R.nextTick(YC,t)}function JC(t,e){return function(r,i){t.then(function(){if(e[_o]){r(dr(void 0,!0));return}e[nf](r,i)},i)}}var XC=Object.getPrototypeOf(function(){}),ZC=Object.setPrototypeOf((wo={get stream(){return this[Zr]},next:function(){var e=this,r=this[vn];if(r!==null)return Promise.reject(r);if(this[_o])return Promise.resolve(dr(void 0,!0));if(this[Zr].destroyed)return new Promise(function(s,a){R.nextTick(function(){e[vn]?a(e[vn]):s(dr(void 0,!0))})});var i=this[Xr],n;if(i)n=new Promise(JC(i,this));else{var o=this[Zr].read();if(o!==null)return Promise.resolve(dr(o,!1));n=new Promise(this[nf])}return this[Xr]=n,n}},cr(wo,Symbol.asyncIterator,function(){return this}),cr(wo,"return",function(){var e=this;return new Promise(function(r,i){e[Zr].destroy(null,function(n){if(n){i(n);return}r(dr(void 0,!0))})})}),wo),XC),e2=function(e){var r,i=Object.create(ZC,(r={},cr(r,Zr,{value:e,writable:!0}),cr(r,hr,{value:null,writable:!0}),cr(r,Jr,{value:null,writable:!0}),cr(r,vn,{value:null,writable:!0}),cr(r,_o,{value:e._readableState.endEmitted,writable:!0}),cr(r,nf,{value:function(o,s){var a=i[Zr].read();a?(i[Xr]=null,i[hr]=null,i[Jr]=null,o(dr(a,!1))):(i[hr]=o,i[Jr]=s)},writable:!0}),r));return i[Xr]=null,KC(e,function(n){if(n&&n.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=i[Jr];o!==null&&(i[Xr]=null,i[hr]=null,i[Jr]=null,o(n)),i[vn]=n;return}var s=i[hr];s!==null&&(i[Xr]=null,i[hr]=null,i[Jr]=null,s(dr(void 0,!0))),i[_o]=!0}),e.on("readable",QC.bind(null,i)),i};hw.exports=e2});var gw=M((aF,pw)=>{w();m();_();pw.exports=function(){throw new Error("Readable.from is not available in the browser")}});var Xu=M((gF,Rw)=>{"use strict";w();m();_();Rw.exports=Q;var Ui;Q.ReadableState=_w;var pF=(Ut(),K(Lt)).EventEmitter,ww=function(e,r){return e.listeners(r).length},Sn=Ou(),mo=(de(),K(_e)).Buffer,t2=window.Uint8Array||function(){};function r2(t){return mo.from(t)}function i2(t){return mo.isBuffer(t)||t instanceof t2}var sf=(Fu(),K(ju)),H;sf&&sf.debuglog?H=sf.debuglog("stream"):H=function(){};var n2=Fb(),hf=Hu(),s2=Vu(),o2=s2.getHighWaterMark,vo=Kr().codes,a2=vo.ERR_INVALID_ARG_TYPE,l2=vo.ERR_STREAM_PUSH_AFTER_EOF,u2=vo.ERR_METHOD_NOT_IMPLEMENTED,f2=vo.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Ni,of,af;rr()(Q,Sn);var En=hf.errorOrDestroy,lf=["error","close","destroy","pause","resume"];function c2(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function _w(t,e,r){Ui=Ui||Yr(),t=t||{},typeof r!="boolean"&&(r=e instanceof Ui),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=o2(this,t,"readableHighWaterMark",r),this.buffer=new n2,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=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(Ni||(Ni=rf().StringDecoder),this.decoder=new Ni(t.encoding),this.encoding=t.encoding)}function Q(t){if(Ui=Ui||Yr(),!(this instanceof Q))return new Q(t);var e=this instanceof Ui;this._readableState=new _w(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),Sn.call(this)}Object.defineProperty(Q.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});Q.prototype.destroy=hf.destroy;Q.prototype._undestroy=hf.undestroy;Q.prototype._destroy=function(t,e){e(t)};Q.prototype.push=function(t,e){var r=this._readableState,i;return r.objectMode?i=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=mo.from(t,e),e=""),i=!0),mw(this,t,e,!1,i)};Q.prototype.unshift=function(t){return mw(this,t,null,!0,!1)};function mw(t,e,r,i,n){H("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,p2(t,o);else{var s;if(n||(s=h2(o,e)),s)En(t,s);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==mo.prototype&&(e=r2(e)),i)o.endEmitted?En(t,new f2):uf(t,o,e,!0);else if(o.ended)En(t,new l2);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?uf(t,o,e,!1):cf(t,o)):uf(t,o,e,!1)}else i||(o.reading=!1,cf(t,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function uf(t,e,r,i){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&Eo(t)),cf(t,e)}function h2(t,e){var r;return!i2(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new a2("chunk",["string","Buffer","Uint8Array"],e)),r}Q.prototype.isPaused=function(){return this._readableState.flowing===!1};Q.prototype.setEncoding=function(t){Ni||(Ni=rf().StringDecoder);var e=new Ni(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";r!==null;)i+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),i!==""&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var yw=1073741824;function d2(t){return t>=yw?t=yw:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function bw(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=d2(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}Q.prototype.read=function(t){H("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return H("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?ff(this):Eo(this),null;if(t=bw(t,e),t===0&&e.ended)return e.length===0&&ff(this),null;var i=e.needReadable;H("need readable",i),(e.length===0||e.length-t<e.highWaterMark)&&(i=!0,H("length less than watermark",i)),e.ended||e.reading?(i=!1,H("reading or ended",i)):i&&(H("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=bw(r,e)));var n;return t>0?n=Sw(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&ff(this)),n!==null&&this.emit("data",n),n};function p2(t,e){if(H("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?Eo(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,vw(t)))}}function Eo(t){var e=t._readableState;H("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(H("emitReadable",e.flowing),e.emittedReadable=!0,R.nextTick(vw,t))}function vw(t){var e=t._readableState;H("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,df(t)}function cf(t,e){e.readingMore||(e.readingMore=!0,R.nextTick(g2,t,e))}function g2(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(H("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}Q.prototype._read=function(t){En(this,new u2("_read()"))};Q.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t);break}i.pipesCount+=1,H("pipe count=%d opts=%j",i.pipesCount,e);var n=(!e||e.end!==!1)&&t!==R.stdout&&t!==R.stderr,o=n?a:E;i.endEmitted?R.nextTick(o):r.once("end",o),t.on("unpipe",s);function s(A,T){H("onunpipe"),A===r&&T&&T.hasUnpiped===!1&&(T.hasUnpiped=!0,h())}function a(){H("onend"),t.end()}var l=y2(r);t.on("drain",l);var c=!1;function h(){H("cleanup"),t.removeListener("close",y),t.removeListener("finish",v),t.removeListener("drain",l),t.removeListener("error",g),t.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",E),r.removeListener("data",d),c=!0,i.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&l()}r.on("data",d);function d(A){H("ondata");var T=t.write(A);H("dest.write",T),T===!1&&((i.pipesCount===1&&i.pipes===t||i.pipesCount>1&&Aw(i.pipes,t)!==-1)&&!c&&(H("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function g(A){H("onerror",A),E(),t.removeListener("error",g),ww(t,"error")===0&&En(t,A)}c2(t,"error",g);function y(){t.removeListener("finish",v),E()}t.once("close",y);function v(){H("onfinish"),t.removeListener("close",y),E()}t.once("finish",v);function E(){H("unpipe"),r.unpipe(t)}return t.emit("pipe",r),i.flowing||(H("pipe resume"),r.resume()),t};function y2(t){return function(){var r=t._readableState;H("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&ww(t,"data")&&(r.flowing=!0,df(t))}}Q.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=Aw(e.pipes,t);return s===-1?this:(e.pipes.splice(s,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};Q.prototype.on=function(t,e){var r=Sn.prototype.on.call(this,t,e),i=this._readableState;return t==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):t==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,H("on readable",i.length,i.reading),i.length?Eo(this):i.reading||R.nextTick(b2,this)),r};Q.prototype.addListener=Q.prototype.on;Q.prototype.removeListener=function(t,e){var r=Sn.prototype.removeListener.call(this,t,e);return t==="readable"&&R.nextTick(Ew,this),r};Q.prototype.removeAllListeners=function(t){var e=Sn.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&R.nextTick(Ew,this),e};function Ew(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function b2(t){H("readable nexttick read 0"),t.read(0)}Q.prototype.resume=function(){var t=this._readableState;return t.flowing||(H("resume"),t.flowing=!t.readableListening,w2(this,t)),t.paused=!1,this};function w2(t,e){e.resumeScheduled||(e.resumeScheduled=!0,R.nextTick(_2,t,e))}function _2(t,e){H("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),df(t),e.flowing&&!e.reading&&t.read(0)}Q.prototype.pause=function(){return H("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(H("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function df(t){var e=t._readableState;for(H("flow",e.flowing);e.flowing&&t.read()!==null;);}Q.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;t.on("end",function(){if(H("wrapped end"),r.decoder&&!r.ended){var s=r.decoder.end();s&&s.length&&e.push(s)}e.push(null)}),t.on("data",function(s){if(H("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!(r.objectMode&&s==null)&&!(!r.objectMode&&(!s||!s.length))){var a=e.push(s);a||(i=!0,t.pause())}});for(var n in t)this[n]===void 0&&typeof t[n]=="function"&&(this[n]=function(a){return function(){return t[a].apply(t,arguments)}}(n));for(var o=0;o<lf.length;o++)t.on(lf[o],this.emit.bind(this,lf[o]));return this._read=function(s){H("wrapped _read",s),i&&(i=!1,t.resume())},this};typeof Symbol=="function"&&(Q.prototype[Symbol.asyncIterator]=function(){return of===void 0&&(of=dw()),of(this)});Object.defineProperty(Q.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(Q.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(Q.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});Q._fromList=Sw;Object.defineProperty(Q.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function Sw(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function ff(t){var e=t._readableState;H("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,R.nextTick(m2,e,t))}function m2(t,e){if(H("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&(Q.from=function(t,e){return af===void 0&&(af=gw()),af(Q,t,e)});function Aw(t,e){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}});var pf=M((EF,Iw)=>{"use strict";w();m();_();Iw.exports=Gt;var So=Kr().codes,v2=So.ERR_METHOD_NOT_IMPLEMENTED,E2=So.ERR_MULTIPLE_CALLBACK,S2=So.ERR_TRANSFORM_ALREADY_TRANSFORMING,A2=So.ERR_TRANSFORM_WITH_LENGTH_0,Ao=Yr();rr()(Gt,Ao);function R2(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(i===null)return this.emit("error",new E2);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function Gt(t){if(!(this instanceof Gt))return new Gt(t);Ao.call(this,t),this._transformState={afterTransform:R2.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",T2)}function T2(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){Tw(t,e,r)}):Tw(this,null,null)}Gt.prototype.push=function(t,e){return this._transformState.needTransform=!1,Ao.prototype.push.call(this,t,e)};Gt.prototype._transform=function(t,e,r){r(new v2("_transform()"))};Gt.prototype._write=function(t,e,r){var i=this._transformState;if(i.writecb=r,i.writechunk=t,i.writeencoding=e,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}};Gt.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};Gt.prototype._destroy=function(t,e){Ao.prototype._destroy.call(this,t,function(r){e(r)})};function Tw(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new A2;if(t._transformState.transforming)throw new S2;return t.push(null)}});var Bw=M((PF,Pw)=>{"use strict";w();m();_();Pw.exports=An;var Cw=pf();rr()(An,Cw);function An(t){if(!(this instanceof An))return new An(t);Cw.call(this,t)}An.prototype._transform=function(t,e,r){r(null,t)}});var Lw=M((UF,Mw)=>{"use strict";w();m();_();var gf;function I2(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var kw=Kr().codes,C2=kw.ERR_MISSING_ARGS,P2=kw.ERR_STREAM_DESTROYED;function Ow(t){if(t)throw t}function B2(t){return t.setHeader&&typeof t.abort=="function"}function O2(t,e,r,i){i=I2(i);var n=!1;t.on("close",function(){n=!0}),gf===void 0&&(gf=bo()),gf(t,{readable:e,writable:r},function(s){if(s)return i(s);n=!0,i()});var o=!1;return function(s){if(!n&&!o){if(o=!0,B2(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();i(s||new P2("pipe"))}}}function xw(t){t()}function x2(t,e){return t.pipe(e)}function k2(t){return!t.length||typeof t[t.length-1]!="function"?Ow:t.pop()}function M2(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var i=k2(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new C2("streams");var n,o=e.map(function(s,a){var l=a<e.length-1,c=a>0;return O2(s,l,c,function(h){n||(n=h),h&&o.forEach(xw),!l&&(o.forEach(xw),i(n))})});return e.reduce(x2)}Mw.exports=M2});var Nw=M((Ze,Uw)=>{w();m();_();Ze=Uw.exports=Xu();Ze.Stream=Ze;Ze.Readable=Ze;Ze.Writable=Yu();Ze.Duplex=Yr();Ze.Transform=pf();Ze.PassThrough=Bw();Ze.finished=bo();Ze.pipeline=Lw()});var jw=M((YF,qw)=>{w();m();_();qw.exports=Dw;function Dw(t,e){if(t&&e)return Dw(t)(e);if(typeof t!="function")throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(i){r[i]=t[i]}),r;function r(){for(var i=new Array(arguments.length),n=0;n<i.length;n++)i[n]=arguments[n];var o=t.apply(this,i),s=i[i.length-1];return typeof o=="function"&&o!==s&&Object.keys(s).forEach(function(a){o[a]=s[a]}),o}}});var $w=M((r5,yf)=>{w();m();_();var Fw=jw();yf.exports=Fw(Ro);yf.exports.strict=Fw(Ww);Ro.proto=Ro(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return Ro(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return Ww(this)},configurable:!0})});function Ro(t){var e=function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function Ww(t){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},r=t.name||"Function wrapped with `once`";return e.onceError=r+" shouldn't be called more than once",e.called=!1,e}});var zw=M((u5,Vw)=>{w();m();_();var L2=$w(),U2=function(){},N2=function(t){return t.setHeader&&typeof t.abort=="function"},D2=function(t){return t.stdio&&Array.isArray(t.stdio)&&t.stdio.length===3},Hw=function(t,e,r){if(typeof e=="function")return Hw(t,null,e);e||(e={}),r=L2(r||U2);var i=t._writableState,n=t._readableState,o=e.readable||e.readable!==!1&&t.readable,s=e.writable||e.writable!==!1&&t.writable,a=!1,l=function(){t.writable||c()},c=function(){s=!1,o||r.call(t)},h=function(){o=!1,s||r.call(t)},d=function(A){r.call(t,A?new Error("exited with error code: "+A):null)},g=function(A){r.call(t,A)},y=function(){R.nextTick(v)},v=function(){if(!a){if(o&&!(n&&n.ended&&!n.destroyed))return r.call(t,new Error("premature close"));if(s&&!(i&&i.ended&&!i.destroyed))return r.call(t,new Error("premature close"))}},E=function(){t.req.on("finish",c)};return N2(t)?(t.on("complete",c),t.on("abort",y),t.req?E():t.on("request",E)):s&&!i&&(t.on("end",l),t.on("close",l)),D2(t)&&t.on("exit",d),t.on("end",h),t.on("finish",c),e.error!==!1&&t.on("error",g),t.on("close",y),function(){a=!0,t.removeListener("complete",c),t.removeListener("abort",y),t.removeListener("request",E),t.req&&t.req.removeListener("finish",c),t.removeListener("end",l),t.removeListener("close",l),t.removeListener("finish",c),t.removeListener("exit",d),t.removeListener("end",h),t.removeListener("error",g),t.removeListener("close",y)}};Vw.exports=Hw});var Kw=M((y5,Gw)=>{w();m();_();Gw.exports=q2;function q2(t){var e=t._readableState;return e?e.objectMode||typeof t._duplexState=="number"?t.read():t.read(j2(e)):null}function j2(t){return t.buffer.length?t.buffer.head?t.buffer.head.data.length:t.buffer[0].length:t.length}});var Io=M((S5,Xw)=>{w();m();_();var To=Nw(),Yw=zw(),F2=rr(),W2=Kw(),Qw=B.from&&B.from!==Uint8Array.from?B.from([0]):new B([0]),bf=function(t,e){t._corked?t.once("uncork",e):e()},$2=function(t,e){t._autoDestroy&&t.destroy(e)},Jw=function(t,e){return function(r){r?$2(t,r.message==="premature close"?null:r):e&&!t._ended&&t.end()}},H2=function(t,e){if(!t||t._writableState&&t._writableState.finished)return e();if(t._writableState)return t.end(e);t.end(),e()},V2=function(){},z2=function(t){return new To.Readable({objectMode:!0,highWaterMark:16}).wrap(t)},Re=function(t,e,r){if(!(this instanceof Re))return new Re(t,e,r);To.Duplex.call(this,r),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!r||r.autoDestroy!==!1,this._forwardDestroy=!r||r.destroy!==!1,this._forwardEnd=!r||r.end!==!1,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,t&&this.setWritable(t),e&&this.setReadable(e)};F2(Re,To.Duplex);Re.obj=function(t,e,r){return r||(r={}),r.objectMode=!0,r.highWaterMark=16,new Re(t,e,r)};Re.prototype.cork=function(){++this._corked===1&&this.emit("cork")};Re.prototype.uncork=function(){this._corked&&--this._corked===0&&this.emit("uncork")};Re.prototype.setWritable=function(t){if(this._unwrite&&this._unwrite(),this.destroyed){t&&t.destroy&&t.destroy();return}if(t===null||t===!1){this.end();return}var e=this,r=Yw(t,{writable:!0,readable:!1},Jw(this,this._forwardEnd)),i=function(){var o=e._ondrain;e._ondrain=null,o&&o()},n=function(){e._writable.removeListener("drain",i),r()};this._unwrite&&R.nextTick(i),this._writable=t,this._writable.on("drain",i),this._unwrite=n,this.uncork()};Re.prototype.setReadable=function(t){if(this._unread&&this._unread(),this.destroyed){t&&t.destroy&&t.destroy();return}if(t===null||t===!1){this.push(null),this.resume();return}var e=this,r=Yw(t,{writable:!1,readable:!0},Jw(this)),i=function(){e._forward()},n=function(){e.push(null)},o=function(){e._readable2.removeListener("readable",i),e._readable2.removeListener("end",n),r()};this._drained=!0,this._readable=t,this._readable2=t._readableState?t:z2(t),this._readable2.on("readable",i),this._readable2.on("end",n),this._unread=o,this._forward()};Re.prototype._read=function(){this._drained=!0,this._forward()};Re.prototype._forward=function(){if(!(this._forwarding||!this._readable2||!this._drained)){this._forwarding=!0;for(var t;this._drained&&(t=W2(this._readable2))!==null;)this.destroyed||(this._drained=this.push(t));this._forwarding=!1}};Re.prototype.destroy=function(t,e){if(e||(e=V2),this.destroyed)return e(null);this.destroyed=!0;var r=this;R.nextTick(function(){r._destroy(t),e(null)})};Re.prototype._destroy=function(t){if(t){var e=this._ondrain;this._ondrain=null,e?e(t):this.emit("error",t)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")};Re.prototype._write=function(t,e,r){if(!this.destroyed){if(this._corked)return bf(this,this._write.bind(this,t,e,r));if(t===Qw)return this._finish(r);if(!this._writable)return r();this._writable.write(t)===!1?this._ondrain=r:this.destroyed||r()}};Re.prototype._finish=function(t){var e=this;this.emit("preend"),bf(this,function(){H2(e._forwardEnd&&e._writable,function(){e._writableState.prefinished===!1&&(e._writableState.prefinished=!0),e.emit("prefinish"),bf(e,t)})})};Re.prototype.end=function(t,e,r){return typeof t=="function"?this.end(null,null,t):typeof e=="function"?this.end(t,null,e):(this._ended=!0,t&&this.write(t),!this._writableState.ending&&!this._writableState.destroyed&&this.write(Qw),To.Writable.prototype.end.call(this,r))};Xw.exports=Re});var wf=M(Rn=>{"use strict";w();m();_();var G2=Rn&&Rn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Rn,"__esModule",{value:!0});var Zw=(de(),K(_e)),K2=kr(),Y2=G2(Io()),Kt,Co,je;function Q2(){let t=new K2.Transform;return t._write=(e,r,i)=>{Kt.send({data:e.buffer,success(){i()},fail(n){i(new Error(n))}})},t._flush=e=>{Kt.close({success(){e()}})},t}function J2(t){t.hostname||(t.hostname="localhost"),t.path||(t.path="/"),t.wsOptions||(t.wsOptions={})}function X2(t,e){let r=t.protocol==="wxs"?"wss":"ws",i=`${r}://${t.hostname}${t.path}`;return t.port&&t.port!==80&&t.port!==443&&(i=`${r}://${t.hostname}:${t.port}${t.path}`),typeof t.transformWsUrl=="function"&&(i=t.transformWsUrl(i,t,e)),i}function Z2(){Kt.onOpen(()=>{je.setReadable(Co),je.setWritable(Co),je.emit("connect")}),Kt.onMessage(t=>{let{data:e}=t;e instanceof ArrayBuffer?e=Zw.Buffer.from(e):e=Zw.Buffer.from(e,"utf8"),Co.push(e)}),Kt.onClose(()=>{je.emit("close"),je.end(),je.destroy()}),Kt.onError(t=>{je.destroy(new Error(t.errMsg))})}var eP=(t,e)=>{if(e.hostname=e.hostname||e.host,!e.hostname)throw new Error("Could not determine host. Specify host manually.");let r=e.protocolId==="MQIsdp"&&e.protocolVersion===3?"mqttv3.1":"mqtt";J2(e);let i=X2(e,t);Kt=wx.connectSocket({url:i,protocols:[r]}),Co=Q2(),je=Y2.default.obj(),je._destroy=(o,s)=>{Kt.close({success(){s&&s(o)}})};let n=je.destroy;return je.destroy=()=>{je.destroy=n,setTimeout(()=>{Kt.close({fail(){je._destroy(new Error)}})},0)},Z2(),je};Rn.default=eP});var mf=M(In=>{"use strict";w();m();_();var tP=In&&In.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(In,"__esModule",{value:!0});var _f=(de(),K(_e)),rP=kr(),iP=tP(Io()),gr,Tn,pr,e_=!1;function nP(){let t=new rP.Transform;return t._write=(e,r,i)=>{gr.sendSocketMessage({data:e.buffer,success(){i()},fail(){i(new Error)}})},t._flush=e=>{gr.closeSocket({success(){e()}})},t}function sP(t){t.hostname||(t.hostname="localhost"),t.path||(t.path="/"),t.wsOptions||(t.wsOptions={})}function oP(t,e){let r=t.protocol==="alis"?"wss":"ws",i=`${r}://${t.hostname}${t.path}`;return t.port&&t.port!==80&&t.port!==443&&(i=`${r}://${t.hostname}:${t.port}${t.path}`),typeof t.transformWsUrl=="function"&&(i=t.transformWsUrl(i,t,e)),i}function aP(){e_||(e_=!0,gr.onSocketOpen(()=>{pr.setReadable(Tn),pr.setWritable(Tn),pr.emit("connect")}),gr.onSocketMessage(t=>{if(typeof t.data=="string"){let e=_f.Buffer.from(t.data,"base64");Tn.push(e)}else{let e=new FileReader;e.addEventListener("load",()=>{let r=e.result;r instanceof ArrayBuffer?r=_f.Buffer.from(r):r=_f.Buffer.from(r,"utf8"),Tn.push(r)}),e.readAsArrayBuffer(t.data)}}),gr.onSocketClose(()=>{pr.end(),pr.destroy()}),gr.onSocketError(t=>{pr.destroy(t)}))}var lP=(t,e)=>{if(e.hostname=e.hostname||e.host,!e.hostname)throw new Error("Could not determine host. Specify host manually.");let r=e.protocolId==="MQIsdp"&&e.protocolVersion===3?"mqttv3.1":"mqtt";sP(e);let i=oP(e,t);return gr=e.my,gr.connectSocket({url:i,protocols:r}),Tn=nP(),pr=iP.default.obj(),aP(),pr};In.default=lP});var r_=M((H5,t_)=>{"use strict";w();m();_();t_.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}});var vf=M(Bn=>{"use strict";w();m();_();var Po=Bn&&Bn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Bn,"__esModule",{value:!0});var Cn=(de(),K(_e)),i_=Po(r_()),uP=Po(wt()),fP=Po(Io()),cP=kr(),n_=Po(Ru()),Pn=(0,uP.default)("mqttjs:ws"),hP=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function s_(t,e){let r=`${t.protocol}://${t.hostname}:${t.port}${t.path}`;return typeof t.transformWsUrl=="function"&&(r=t.transformWsUrl(r,t,e)),r}function o_(t){let e=t;return t.hostname||(e.hostname="localhost"),t.port||(t.protocol==="wss"?e.port=443:e.port=80),t.path||(e.path="/"),t.wsOptions||(e.wsOptions={}),!n_.default&&t.protocol==="wss"&&hP.forEach(r=>{Object.prototype.hasOwnProperty.call(t,r)&&!Object.prototype.hasOwnProperty.call(t.wsOptions,r)&&(e.wsOptions[r]=t[r])}),e}function dP(t){let e=o_(t);if(e.hostname||(e.hostname=e.host),!e.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");let r=new URL(document.URL);e.hostname=r.hostname,e.port||(e.port=Number(r.port))}return e.objectMode===void 0&&(e.objectMode=!(e.binary===!0||e.binary===void 0)),e}function pP(t,e,r){Pn("createWebSocket"),Pn(`protocol: ${r.protocolId} ${r.protocolVersion}`);let i=r.protocolId==="MQIsdp"&&r.protocolVersion===3?"mqttv3.1":"mqtt";Pn(`creating new Websocket for url: ${e} and protocol: ${i}`);let n;return r.createWebsocket?n=r.createWebsocket(e,[i],r):n=new i_.default(e,[i],r.wsOptions),n}function gP(t,e){let r=e.protocolId==="MQIsdp"&&e.protocolVersion===3?"mqttv3.1":"mqtt",i=s_(e,t),n;return e.createWebsocket?n=e.createWebsocket(i,[r],e):n=new WebSocket(i,[r]),n.binaryType="arraybuffer",n}var yP=(t,e)=>{Pn("streamBuilder");let r=o_(e),i=s_(r,t),n=pP(t,i,r),o=i_.default.createWebSocketStream(n,r.wsOptions);return o.url=i,n.on("close",()=>{o.destroy()}),o},bP=(t,e)=>{Pn("browserStreamBuilder");let r,n=dP(e).browserBufferSize||1024*512,o=e.browserBufferTimeout||1e3,s=!e.objectMode,a=gP(t,e),l=h(e,A,T);e.objectMode||(l._writev=E),l.on("close",()=>{a.close()});let c=typeof a.addEventListener<"u";a.readyState===a.OPEN?r=l:(r=(0,fP.default)(void 0,void 0,e),e.objectMode||(r._writev=E),c?a.addEventListener("open",d):a.onopen=d),r.socket=a,c?(a.addEventListener("close",g),a.addEventListener("error",y),a.addEventListener("message",v)):(a.onclose=g,a.onerror=y,a.onmessage=v);function h(O,I,N){let D=new cP.Transform({objectMode:O.objectMode});return D._write=I,D._flush=N,D}function d(){r.setReadable(l),r.setWritable(l),r.emit("connect")}function g(){r.end(),r.destroy()}function y(O){r.destroy(O)}function v(O){let{data:I}=O;I instanceof ArrayBuffer?I=Cn.Buffer.from(I):I=Cn.Buffer.from(I,"utf8"),l.push(I)}function E(O,I){let N=new Array(O.length);for(let D=0;D<O.length;D++)typeof O[D].chunk=="string"?N[D]=Cn.Buffer.from(O[D],"utf8"):N[D]=O[D].chunk;this._write(Cn.Buffer.concat(N),"binary",I)}function A(O,I,N){a.bufferedAmount>n&&setTimeout(A,o,O,I,N),s&&typeof O=="string"&&(O=Cn.Buffer.from(O,"utf8"));try{a.send(O)}catch(D){return N(D)}N()}function T(O){a.close(),O()}return r};Bn.default=n_.default?bP:yP});var u_=M(ei=>{"use strict";w();m();_();var Bo=ei&&ei.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ei,"__esModule",{value:!0});ei.connectAsync=void 0;var wP=Bo(wt()),_P=Bo((tb(),K(eb))),mP=Bo(zs()),vP=Bo(Ru()),a_=(0,wP.default)("mqttjs"),Me={};vP.default?(Me.wx=wf().default,Me.wxs=wf().default,Me.ali=mf().default,Me.alis=mf().default):(Me.mqtt=Cu().default,Me.tcp=Cu().default,Me.ssl=Bu().default,Me.tls=Me.ssl,Me.mqtts=Bu().default);Me.ws=vf().default;Me.wss=vf().default;function EP(t){let e;t.auth&&(e=t.auth.match(/^(.+):(.+)$/),e?(t.username=e[1],t.password=e[2]):t.username=t.auth)}function l_(t,e){if(a_("connecting to an MQTT broker..."),typeof t=="object"&&!e&&(e=t,t=""),e=e||{},t&&typeof t=="string"){let n=_P.default.parse(t,!0);if(n.port!=null&&(n.port=Number(n.port)),e=Object.assign(Object.assign({},n),e),e.protocol===null)throw new Error("Missing protocol");e.protocol=e.protocol.replace(/:$/,"")}if(EP(e),e.query&&typeof e.query.clientId=="string"&&(e.clientId=e.query.clientId),e.cert&&e.key)if(e.protocol){if(["mqtts","wss","wxs","alis"].indexOf(e.protocol)===-1)switch(e.protocol){case"mqtt":e.protocol="mqtts";break;case"ws":e.protocol="wss";break;case"wx":e.protocol="wxs";break;case"ali":e.protocol="alis";break;default:throw new Error(`Unknown protocol for secure connection: "${e.protocol}"!`)}}else throw new Error("Missing secure protocol key");if(!Me[e.protocol]){let n=["mqtts","wss"].indexOf(e.protocol)!==-1;e.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((o,s)=>n&&s%2===0?!1:typeof Me[o]=="function")[0]}if(e.clean===!1&&!e.clientId)throw new Error("Missing clientId for unclean clients");e.protocol&&(e.defaultProtocol=e.protocol);function r(n){return e.servers&&((!n._reconnectCount||n._reconnectCount===e.servers.length)&&(n._reconnectCount=0),e.host=e.servers[n._reconnectCount].host,e.port=e.servers[n._reconnectCount].port,e.protocol=e.servers[n._reconnectCount].protocol?e.servers[n._reconnectCount].protocol:e.defaultProtocol,e.hostname=e.host,n._reconnectCount++),a_("calling streambuilder for",e.protocol),Me[e.protocol](n,e)}let i=new mP.default(r,e);return i.on("error",()=>{}),i}function SP(t,e,r=!0){return new Promise((i,n)=>{let o=l_(t,e),s={connect:l=>{a(),i(o)},end:()=>{a(),i(o)},error:l=>{a(),o.end(),n(l)}};r===!1&&(s.close=()=>{s.error(new Error("Couldn't connect to server"))});function a(){Object.keys(s).forEach(l=>{o.off(l,s[l])})}Object.keys(s).forEach(l=>{o.on(l,s[l])})})}ei.connectAsync=SP;ei.default=l_});var Ef=M(X=>{"use strict";w();m();_();var f_=X&&X.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),AP=X&&X.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),RP=X&&X.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&f_(e,t,r);return AP(e,t),e},c_=X&&X.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&f_(e,t,r)},Oo=X&&X.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(X,"__esModule",{value:!0});X.ReasonCodes=X.UniqueMessageIdProvider=X.DefaultMessageIdProvider=X.Store=X.MqttClient=X.connectAsync=X.connect=X.Client=void 0;var h_=Oo(zs());X.MqttClient=h_.default;var TP=Oo(wl());X.DefaultMessageIdProvider=TP.default;var IP=Oo(Oy());X.UniqueMessageIdProvider=IP.default;var CP=Oo(vl());X.Store=CP.default;var d_=RP(u_());X.connect=d_.default;Object.defineProperty(X,"connectAsync",{enumerable:!0,get:function(){return d_.connectAsync}});X.Client=h_.default;c_(zs(),X);c_(tn(),X);var PP=rn();Object.defineProperty(X,"ReasonCodes",{enumerable:!0,get:function(){return PP.ReasonCodes}})});var MP=M(et=>{w();m();_();var p_=et&&et.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),BP=et&&et.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),OP=et&&et.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&p_(e,t,r);return BP(e,t),e},xP=et&&et.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&p_(e,t,r)};Object.defineProperty(et,"__esModule",{value:!0});var kP=OP(Ef());et.default=kP;xP(Ef(),et)});return MP();})();
|
|
15
15
|
/*! Bundled license information:
|
|
16
16
|
|
|
17
17
|
@jspm/core/nodelibs/browser/buffer.js:
|