mqtt 5.16.1 → 5.17.0

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/dist/mqtt.min.js CHANGED
@@ -1,11 +1,11 @@
1
- "use strict";var mqtt=(()=>{var So=Object.defineProperty;var dy=Object.getOwnPropertyDescriptor;var hy=Object.getOwnPropertyNames;var py=Object.prototype.hasOwnProperty;var $e=(t,e)=>()=>(t&&(e=t(t=0)),e);var H=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Tr=(t,e)=>{for(var r in e)So(t,r,{get:e[r],enumerable:!0})},gy=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of hy(e))!py.call(t,i)&&i!==r&&So(t,i,{get:()=>e[i],enumerable:!(n=dy(e,i))||n.enumerable});return t};var ge=t=>gy(So({},"__esModule",{value:!0}),t);var x=$e(()=>{});function Io(t){throw new Error("Node.js process "+t+" is not supported by JSPM core outside of Node.js")}function yy(){!Pr||!ir||(Pr=!1,ir.length?vt=ir.concat(vt):oi=-1,vt.length&&Yu())}function Yu(){if(!Pr){var t=setTimeout(yy,0);Pr=!0;for(var e=vt.length;e;){for(ir=vt,vt=[];++oi<e;)ir&&ir[oi].run();oi=-1,e=vt.length}ir=null,Pr=!1,clearTimeout(t)}}function by(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 Ju(t,e)),vt.length===1&&!Pr&&setTimeout(Yu,0)}function Ju(t,e){this.fun=t,this.array=e}function qe(){}function gl(t){Io("_linkedBinding")}function _l(t){Io("dlopen")}function wl(){return[]}function vl(){return[]}function Rl(t,e){if(!t)throw new Error(e||"assertion error")}function Bl(){return!1}function Jl(){return Dt.now()/1e3}function si(t){var e=Math.floor((Date.now()-Dt.now())*.001),r=Dt.now()*.001,n=Math.floor(r)+e,i=Math.floor(r%1*1e9);return t&&(n=n-t[0],i=i-t[1],i<0&&(n--,i+=Ao)),[n,i]}function St(){return xo}function lc(t){return[]}var vt,Pr,ir,oi,Xu,Zu,el,tl,rl,nl,il,ol,sl,al,ul,ll,cl,fl,dl,hl,pl,yl,bl,ml,Sl,El,ai,Al,Il,xl,Tl,Pl,Ol,kl,Cl,Ml,Nl,Ll,ql,Dl,Ul,Fl,jl,$l,Wl,Vl,Hl,zl,Gl,Ql,Kl,Yl,Dt,Eo,Ao,Xl,Zl,ec,tc,rc,nc,ic,oc,sc,ac,uc,xo,To=$e(()=>{x();P();T();vt=[],Pr=!1,oi=-1;Ju.prototype.run=function(){this.fun.apply(null,this.array)};Xu="browser",Zu="x64",el="browser",tl={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},rl=["/usr/bin/node"],nl=[],il="v16.8.0",ol={},sl=function(t,e){console.warn((e?e+": ":"")+t)},al=function(t){Io("binding")},ul=function(t){return 0},ll=function(){return"/"},cl=function(t){},fl={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};dl=!0,hl=qe,pl=[];yl={},bl=!1,ml={};Sl=qe,El=qe,ai=function(){return{}},Al=ai,Il=ai,xl=qe,Tl=qe,Pl=qe,Ol={};kl={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},Cl=qe,Ml=qe;Nl=qe,Ll=qe,ql=qe,Dl=qe,Ul=qe,Fl=void 0,jl=void 0,$l=void 0,Wl=qe,Vl=2,Hl=1,zl="/bin/usr/node",Gl=9229,Ql="node",Kl=[],Yl=qe,Dt={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};Dt.now===void 0&&(Eo=Date.now(),Dt.timing&&Dt.timing.navigationStart&&(Eo=Dt.timing.navigationStart),Dt.now=()=>Date.now()-Eo);Ao=1e9;si.bigint=function(t){var e=si(t);return typeof BigInt>"u"?e[0]*Ao+e[1]:BigInt(e[0]*Ao)+BigInt(e[1])};Xl=10,Zl={},ec=0;tc=St,rc=St,nc=St,ic=St,oc=St,sc=qe,ac=St,uc=St;xo={version:il,versions:ol,arch:Zu,platform:el,browser:dl,release:fl,_rawDebug:hl,moduleLoadList:pl,binding:al,_linkedBinding:gl,_events:Zl,_eventsCount:ec,_maxListeners:Xl,on:St,addListener:tc,once:rc,off:nc,removeListener:ic,removeAllListeners:oc,emit:sc,prependListener:ac,prependOnceListener:uc,listeners:lc,domain:yl,_exiting:bl,config:ml,dlopen:_l,uptime:Jl,_getActiveRequests:wl,_getActiveHandles:vl,reallyExit:Sl,_kill:El,cpuUsage:ai,resourceUsage:Al,memoryUsage:Il,kill:xl,exit:Tl,openStdin:Pl,allowedNodeEnvironmentFlags:Ol,assert:Rl,features:kl,_fatalExceptions:Cl,setUncaughtExceptionCaptureCallback:Ml,hasUncaughtExceptionCaptureCallback:Bl,emitWarning:sl,nextTick:by,_tickCallback:Nl,_debugProcess:Ll,_debugEnd:ql,_startProfilerIdleNotifier:Dl,_stopProfilerIdleNotifier:Ul,stdout:Fl,stdin:$l,stderr:jl,abort:Wl,umask:ul,chdir:cl,cwd:ll,env:tl,title:Xu,argv:rl,execArgv:nl,pid:Vl,ppid:Hl,execPath:zl,debugPort:Gl,hrtime:si,argv0:Ql,_preload_modules:Kl,setSourceMapsEnabled:Yl}});var L={};Tr(L,{_debugEnd:()=>ql,_debugProcess:()=>Ll,_events:()=>Zl,_eventsCount:()=>ec,_exiting:()=>bl,_fatalExceptions:()=>Cl,_getActiveHandles:()=>vl,_getActiveRequests:()=>wl,_kill:()=>El,_linkedBinding:()=>gl,_maxListeners:()=>Xl,_preload_modules:()=>Kl,_rawDebug:()=>hl,_startProfilerIdleNotifier:()=>Dl,_stopProfilerIdleNotifier:()=>Ul,_tickCallback:()=>Nl,abort:()=>Wl,addListener:()=>tc,allowedNodeEnvironmentFlags:()=>Ol,arch:()=>Zu,argv:()=>rl,argv0:()=>Ql,assert:()=>Rl,binding:()=>al,browser:()=>dl,chdir:()=>cl,config:()=>ml,cpuUsage:()=>ai,cwd:()=>ll,debugPort:()=>Gl,default:()=>_y,dlopen:()=>_l,domain:()=>yl,emit:()=>sc,emitWarning:()=>sl,env:()=>tl,execArgv:()=>nl,execPath:()=>zl,exit:()=>Tl,features:()=>kl,hasUncaughtExceptionCaptureCallback:()=>Bl,hrtime:()=>si,kill:()=>xl,listeners:()=>lc,memoryUsage:()=>Il,moduleLoadList:()=>pl,nextTick:()=>cc,off:()=>nc,on:()=>St,once:()=>rc,openStdin:()=>Pl,pid:()=>Vl,platform:()=>el,ppid:()=>Hl,prependListener:()=>ac,prependOnceListener:()=>uc,reallyExit:()=>Sl,release:()=>fl,removeAllListeners:()=>oc,removeListener:()=>ic,resourceUsage:()=>Al,setSourceMapsEnabled:()=>Yl,setUncaughtExceptionCaptureCallback:()=>Ml,stderr:()=>jl,stdin:()=>$l,stdout:()=>Fl,title:()=>Xu,umask:()=>ul,uptime:()=>Jl,version:()=>il,versions:()=>ol});function cc(t,...e){my(()=>t(...e))}var my,_y,Et=$e(()=>{x();P();T();To();To();my=typeof queueMicrotask=="function"?queueMicrotask:t=>setTimeout(t,0);_y={...xo,nextTick:cc}});var T=$e(()=>{Et()});function wy(){if(fc)return sn;fc=!0,sn.byteLength=u,sn.toByteArray=f,sn.fromByteArray=_;for(var t=[],e=[],r=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,s=n.length;i<s;++i)t[i]=n[i],e[n.charCodeAt(i)]=i;e[45]=62,e[95]=63;function o(y){var I=y.length;if(I%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var S=y.indexOf("=");S===-1&&(S=I);var b=S===I?0:4-S%4;return[S,b]}function u(y){var I=o(y),S=I[0],b=I[1];return(S+b)*3/4-b}function c(y,I,S){return(I+S)*3/4-S}function f(y){var I,S=o(y),b=S[0],m=S[1],w=new r(c(y,b,m)),R=0,A=m>0?b-4:b,g;for(g=0;g<A;g+=4)I=e[y.charCodeAt(g)]<<18|e[y.charCodeAt(g+1)]<<12|e[y.charCodeAt(g+2)]<<6|e[y.charCodeAt(g+3)],w[R++]=I>>16&255,w[R++]=I>>8&255,w[R++]=I&255;return m===2&&(I=e[y.charCodeAt(g)]<<2|e[y.charCodeAt(g+1)]>>4,w[R++]=I&255),m===1&&(I=e[y.charCodeAt(g)]<<10|e[y.charCodeAt(g+1)]<<4|e[y.charCodeAt(g+2)]>>2,w[R++]=I>>8&255,w[R++]=I&255),w}function d(y){return t[y>>18&63]+t[y>>12&63]+t[y>>6&63]+t[y&63]}function h(y,I,S){for(var b,m=[],w=I;w<S;w+=3)b=(y[w]<<16&16711680)+(y[w+1]<<8&65280)+(y[w+2]&255),m.push(d(b));return m.join("")}function _(y){for(var I,S=y.length,b=S%3,m=[],w=16383,R=0,A=S-b;R<A;R+=w)m.push(h(y,R,R+w>A?A:R+w));return b===1?(I=y[S-1],m.push(t[I>>2]+t[I<<4&63]+"==")):b===2&&(I=(y[S-2]<<8)+y[S-1],m.push(t[I>>10]+t[I>>4&63]+t[I<<2&63]+"=")),m.join("")}return sn}function vy(){if(dc)return ui;dc=!0;return ui.read=function(t,e,r,n,i){var s,o,u=i*8-n-1,c=(1<<u)-1,f=c>>1,d=-7,h=r?i-1:0,_=r?-1:1,y=t[e+h];for(h+=_,s=y&(1<<-d)-1,y>>=-d,d+=u;d>0;s=s*256+t[e+h],h+=_,d-=8);for(o=s&(1<<-d)-1,s>>=-d,d+=n;d>0;o=o*256+t[e+h],h+=_,d-=8);if(s===0)s=1-f;else{if(s===c)return o?NaN:(y?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-f}return(y?-1:1)*o*Math.pow(2,s-n)},ui.write=function(t,e,r,n,i,s){var o,u,c,f=s*8-i-1,d=(1<<f)-1,h=d>>1,_=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:s-1,I=n?1:-1,S=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,o=d):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+h>=1?e+=_/c:e+=_*Math.pow(2,1-h),e*c>=2&&(o++,c/=2),o+h>=d?(u=0,o=d):o+h>=1?(u=(e*c-1)*Math.pow(2,i),o=o+h):(u=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+y]=u&255,y+=I,u/=256,i-=8);for(o=o<<i|u,f+=i;f>0;t[r+y]=o&255,y+=I,o/=256,f-=8);t[r+y-I]|=S*128},ui}function pc(){if(hc)return or;hc=!0;let t=wy(),e=vy(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;or.Buffer=o,or.SlowBuffer=m,or.INSPECT_MAX_BYTES=50;let n=2147483647;or.kMaxLength=n,o.TYPED_ARRAY_SUPPORT=i(),!o.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 i(){try{let p=new Uint8Array(1),a={foo:function(){return 42}};return Object.setPrototypeOf(a,Uint8Array.prototype),Object.setPrototypeOf(p,a),p.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function s(p){if(p>n)throw new RangeError('The value "'+p+'" is invalid for option "size"');let a=new Uint8Array(p);return Object.setPrototypeOf(a,o.prototype),a}function o(p,a,l){if(typeof p=="number"){if(typeof a=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(p)}return u(p,a,l)}o.poolSize=8192;function u(p,a,l){if(typeof p=="string")return h(p,a);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(Je(p,ArrayBuffer)||p&&Je(p.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Je(p,SharedArrayBuffer)||p&&Je(p.buffer,SharedArrayBuffer)))return I(p,a,l);if(typeof p=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let E=p.valueOf&&p.valueOf();if(E!=null&&E!==p)return o.from(E,a,l);let C=S(p);if(C)return C;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof p[Symbol.toPrimitive]=="function")return o.from(p[Symbol.toPrimitive]("string"),a,l);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof p)}o.from=function(p,a,l){return u(p,a,l)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function c(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 f(p,a,l){return c(p),p<=0?s(p):a!==void 0?typeof l=="string"?s(p).fill(a,l):s(p).fill(a):s(p)}o.alloc=function(p,a,l){return f(p,a,l)};function d(p){return c(p),s(p<0?0:b(p)|0)}o.allocUnsafe=function(p){return d(p)},o.allocUnsafeSlow=function(p){return d(p)};function h(p,a){if((typeof a!="string"||a==="")&&(a="utf8"),!o.isEncoding(a))throw new TypeError("Unknown encoding: "+a);let l=w(p,a)|0,E=s(l),C=E.write(p,a);return C!==l&&(E=E.slice(0,C)),E}function _(p){let a=p.length<0?0:b(p.length)|0,l=s(a);for(let E=0;E<a;E+=1)l[E]=p[E]&255;return l}function y(p){if(Je(p,Uint8Array)){let a=new Uint8Array(p);return I(a.buffer,a.byteOffset,a.byteLength)}return _(p)}function I(p,a,l){if(a<0||p.byteLength<a)throw new RangeError('"offset" is outside of buffer bounds');if(p.byteLength<a+(l||0))throw new RangeError('"length" is outside of buffer bounds');let E;return a===void 0&&l===void 0?E=new Uint8Array(p):l===void 0?E=new Uint8Array(p,a):E=new Uint8Array(p,a,l),Object.setPrototypeOf(E,o.prototype),E}function S(p){if(o.isBuffer(p)){let a=b(p.length)|0,l=s(a);return l.length===0||p.copy(l,0,0,a),l}if(p.length!==void 0)return typeof p.length!="number"||nn(p.length)?s(0):_(p);if(p.type==="Buffer"&&Array.isArray(p.data))return _(p.data)}function b(p){if(p>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return p|0}function m(p){return+p!=p&&(p=0),o.alloc(+p)}o.isBuffer=function(a){return a!=null&&a._isBuffer===!0&&a!==o.prototype},o.compare=function(a,l){if(Je(a,Uint8Array)&&(a=o.from(a,a.offset,a.byteLength)),Je(l,Uint8Array)&&(l=o.from(l,l.offset,l.byteLength)),!o.isBuffer(a)||!o.isBuffer(l))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(a===l)return 0;let E=a.length,C=l.length;for(let N=0,F=Math.min(E,C);N<F;++N)if(a[N]!==l[N]){E=a[N],C=l[N];break}return E<C?-1:C<E?1:0},o.isEncoding=function(a){switch(String(a).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}},o.concat=function(a,l){if(!Array.isArray(a))throw new TypeError('"list" argument must be an Array of Buffers');if(a.length===0)return o.alloc(0);let E;if(l===void 0)for(l=0,E=0;E<a.length;++E)l+=a[E].length;let C=o.allocUnsafe(l),N=0;for(E=0;E<a.length;++E){let F=a[E];if(Je(F,Uint8Array))N+F.length>C.length?(o.isBuffer(F)||(F=o.from(F)),F.copy(C,N)):Uint8Array.prototype.set.call(C,F,N);else if(o.isBuffer(F))F.copy(C,N);else throw new TypeError('"list" argument must be an Array of Buffers');N+=F.length}return C};function w(p,a){if(o.isBuffer(p))return p.length;if(ArrayBuffer.isView(p)||Je(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 l=p.length,E=arguments.length>2&&arguments[2]===!0;if(!E&&l===0)return 0;let C=!1;for(;;)switch(a){case"ascii":case"latin1":case"binary":return l;case"utf8":case"utf-8":return _t(p).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return l*2;case"hex":return l>>>1;case"base64":return ri(p).length;default:if(C)return E?-1:_t(p).length;a=(""+a).toLowerCase(),C=!0}}o.byteLength=w;function R(p,a,l){let E=!1;if((a===void 0||a<0)&&(a=0),a>this.length||((l===void 0||l>this.length)&&(l=this.length),l<=0)||(l>>>=0,a>>>=0,l<=a))return"";for(p||(p="utf8");;)switch(p){case"hex":return W(this,a,l);case"utf8":case"utf-8":return $(this,a,l);case"ascii":return ee(this,a,l);case"latin1":case"binary":return z(this,a,l);case"base64":return U(this,a,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return te(this,a,l);default:if(E)throw new TypeError("Unknown encoding: "+p);p=(p+"").toLowerCase(),E=!0}}o.prototype._isBuffer=!0;function A(p,a,l){let E=p[a];p[a]=p[l],p[l]=E}o.prototype.swap16=function(){let a=this.length;if(a%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let l=0;l<a;l+=2)A(this,l,l+1);return this},o.prototype.swap32=function(){let a=this.length;if(a%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let l=0;l<a;l+=4)A(this,l,l+3),A(this,l+1,l+2);return this},o.prototype.swap64=function(){let a=this.length;if(a%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let l=0;l<a;l+=8)A(this,l,l+7),A(this,l+1,l+6),A(this,l+2,l+5),A(this,l+3,l+4);return this},o.prototype.toString=function(){let a=this.length;return a===0?"":arguments.length===0?$(this,0,a):R.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(a){if(!o.isBuffer(a))throw new TypeError("Argument must be a Buffer");return this===a?!0:o.compare(this,a)===0},o.prototype.inspect=function(){let a="",l=or.INSPECT_MAX_BYTES;return a=this.toString("hex",0,l).replace(/(.{2})/g,"$1 ").trim(),this.length>l&&(a+=" ... "),"<Buffer "+a+">"},r&&(o.prototype[r]=o.prototype.inspect),o.prototype.compare=function(a,l,E,C,N){if(Je(a,Uint8Array)&&(a=o.from(a,a.offset,a.byteLength)),!o.isBuffer(a))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof a);if(l===void 0&&(l=0),E===void 0&&(E=a?a.length:0),C===void 0&&(C=0),N===void 0&&(N=this.length),l<0||E>a.length||C<0||N>this.length)throw new RangeError("out of range index");if(C>=N&&l>=E)return 0;if(C>=N)return-1;if(l>=E)return 1;if(l>>>=0,E>>>=0,C>>>=0,N>>>=0,this===a)return 0;let F=N-C,k=E-l,M=Math.min(F,k),re=this.slice(C,N),ie=a.slice(l,E);for(let oe=0;oe<M;++oe)if(re[oe]!==ie[oe]){F=re[oe],k=ie[oe];break}return F<k?-1:k<F?1:0};function g(p,a,l,E,C){if(p.length===0)return-1;if(typeof l=="string"?(E=l,l=0):l>2147483647?l=2147483647:l<-2147483648&&(l=-2147483648),l=+l,nn(l)&&(l=C?0:p.length-1),l<0&&(l=p.length+l),l>=p.length){if(C)return-1;l=p.length-1}else if(l<0)if(C)l=0;else return-1;if(typeof a=="string"&&(a=o.from(a,E)),o.isBuffer(a))return a.length===0?-1:O(p,a,l,E,C);if(typeof a=="number")return a=a&255,typeof Uint8Array.prototype.indexOf=="function"?C?Uint8Array.prototype.indexOf.call(p,a,l):Uint8Array.prototype.lastIndexOf.call(p,a,l):O(p,[a],l,E,C);throw new TypeError("val must be string, number or Buffer")}function O(p,a,l,E,C){let N=1,F=p.length,k=a.length;if(E!==void 0&&(E=String(E).toLowerCase(),E==="ucs2"||E==="ucs-2"||E==="utf16le"||E==="utf-16le")){if(p.length<2||a.length<2)return-1;N=2,F/=2,k/=2,l/=2}function M(ie,oe){return N===1?ie[oe]:ie.readUInt16BE(oe*N)}let re;if(C){let ie=-1;for(re=l;re<F;re++)if(M(p,re)===M(a,ie===-1?0:re-ie)){if(ie===-1&&(ie=re),re-ie+1===k)return ie*N}else ie!==-1&&(re-=re-ie),ie=-1}else for(l+k>F&&(l=F-k),re=l;re>=0;re--){let ie=!0;for(let oe=0;oe<k;oe++)if(M(p,re+oe)!==M(a,oe)){ie=!1;break}if(ie)return re}return-1}o.prototype.includes=function(a,l,E){return this.indexOf(a,l,E)!==-1},o.prototype.indexOf=function(a,l,E){return g(this,a,l,E,!0)},o.prototype.lastIndexOf=function(a,l,E){return g(this,a,l,E,!1)};function v(p,a,l,E){l=Number(l)||0;let C=p.length-l;E?(E=Number(E),E>C&&(E=C)):E=C;let N=a.length;E>N/2&&(E=N/2);let F;for(F=0;F<E;++F){let k=parseInt(a.substr(F*2,2),16);if(nn(k))return F;p[l+F]=k}return F}function B(p,a,l,E){return Ar(_t(a,p.length-l),p,l,E)}function D(p,a,l,E){return Ar(wt(a),p,l,E)}function q(p,a,l,E){return Ar(ri(a),p,l,E)}function K(p,a,l,E){return Ar(rn(a,p.length-l),p,l,E)}o.prototype.write=function(a,l,E,C){if(l===void 0)C="utf8",E=this.length,l=0;else if(E===void 0&&typeof l=="string")C=l,E=this.length,l=0;else if(isFinite(l))l=l>>>0,isFinite(E)?(E=E>>>0,C===void 0&&(C="utf8")):(C=E,E=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let N=this.length-l;if((E===void 0||E>N)&&(E=N),a.length>0&&(E<0||l<0)||l>this.length)throw new RangeError("Attempt to write outside buffer bounds");C||(C="utf8");let F=!1;for(;;)switch(C){case"hex":return v(this,a,l,E);case"utf8":case"utf-8":return B(this,a,l,E);case"ascii":case"latin1":case"binary":return D(this,a,l,E);case"base64":return q(this,a,l,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return K(this,a,l,E);default:if(F)throw new TypeError("Unknown encoding: "+C);C=(""+C).toLowerCase(),F=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function U(p,a,l){return a===0&&l===p.length?t.fromByteArray(p):t.fromByteArray(p.slice(a,l))}function $(p,a,l){l=Math.min(p.length,l);let E=[],C=a;for(;C<l;){let N=p[C],F=null,k=N>239?4:N>223?3:N>191?2:1;if(C+k<=l){let M,re,ie,oe;switch(k){case 1:N<128&&(F=N);break;case 2:M=p[C+1],(M&192)===128&&(oe=(N&31)<<6|M&63,oe>127&&(F=oe));break;case 3:M=p[C+1],re=p[C+2],(M&192)===128&&(re&192)===128&&(oe=(N&15)<<12|(M&63)<<6|re&63,oe>2047&&(oe<55296||oe>57343)&&(F=oe));break;case 4:M=p[C+1],re=p[C+2],ie=p[C+3],(M&192)===128&&(re&192)===128&&(ie&192)===128&&(oe=(N&15)<<18|(M&63)<<12|(re&63)<<6|ie&63,oe>65535&&oe<1114112&&(F=oe))}}F===null?(F=65533,k=1):F>65535&&(F-=65536,E.push(F>>>10&1023|55296),F=56320|F&1023),E.push(F),C+=k}return J(E)}let G=4096;function J(p){let a=p.length;if(a<=G)return String.fromCharCode.apply(String,p);let l="",E=0;for(;E<a;)l+=String.fromCharCode.apply(String,p.slice(E,E+=G));return l}function ee(p,a,l){let E="";l=Math.min(p.length,l);for(let C=a;C<l;++C)E+=String.fromCharCode(p[C]&127);return E}function z(p,a,l){let E="";l=Math.min(p.length,l);for(let C=a;C<l;++C)E+=String.fromCharCode(p[C]);return E}function W(p,a,l){let E=p.length;(!a||a<0)&&(a=0),(!l||l<0||l>E)&&(l=E);let C="";for(let N=a;N<l;++N)C+=ho[p[N]];return C}function te(p,a,l){let E=p.slice(a,l),C="";for(let N=0;N<E.length-1;N+=2)C+=String.fromCharCode(E[N]+E[N+1]*256);return C}o.prototype.slice=function(a,l){let E=this.length;a=~~a,l=l===void 0?E:~~l,a<0?(a+=E,a<0&&(a=0)):a>E&&(a=E),l<0?(l+=E,l<0&&(l=0)):l>E&&(l=E),l<a&&(l=a);let C=this.subarray(a,l);return Object.setPrototypeOf(C,o.prototype),C};function Y(p,a,l){if(p%1!==0||p<0)throw new RangeError("offset is not uint");if(p+a>l)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(a,l,E){a=a>>>0,l=l>>>0,E||Y(a,l,this.length);let C=this[a],N=1,F=0;for(;++F<l&&(N*=256);)C+=this[a+F]*N;return C},o.prototype.readUintBE=o.prototype.readUIntBE=function(a,l,E){a=a>>>0,l=l>>>0,E||Y(a,l,this.length);let C=this[a+--l],N=1;for(;l>0&&(N*=256);)C+=this[a+--l]*N;return C},o.prototype.readUint8=o.prototype.readUInt8=function(a,l){return a=a>>>0,l||Y(a,1,this.length),this[a]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(a,l){return a=a>>>0,l||Y(a,2,this.length),this[a]|this[a+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(a,l){return a=a>>>0,l||Y(a,2,this.length),this[a]<<8|this[a+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(a,l){return a=a>>>0,l||Y(a,4,this.length),(this[a]|this[a+1]<<8|this[a+2]<<16)+this[a+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(a,l){return a=a>>>0,l||Y(a,4,this.length),this[a]*16777216+(this[a+1]<<16|this[a+2]<<8|this[a+3])},o.prototype.readBigUInt64LE=it(function(a){a=a>>>0,xe(a,"offset");let l=this[a],E=this[a+7];(l===void 0||E===void 0)&&nt(a,this.length-8);let C=l+this[++a]*2**8+this[++a]*2**16+this[++a]*2**24,N=this[++a]+this[++a]*2**8+this[++a]*2**16+E*2**24;return BigInt(C)+(BigInt(N)<<BigInt(32))}),o.prototype.readBigUInt64BE=it(function(a){a=a>>>0,xe(a,"offset");let l=this[a],E=this[a+7];(l===void 0||E===void 0)&&nt(a,this.length-8);let C=l*2**24+this[++a]*2**16+this[++a]*2**8+this[++a],N=this[++a]*2**24+this[++a]*2**16+this[++a]*2**8+E;return(BigInt(C)<<BigInt(32))+BigInt(N)}),o.prototype.readIntLE=function(a,l,E){a=a>>>0,l=l>>>0,E||Y(a,l,this.length);let C=this[a],N=1,F=0;for(;++F<l&&(N*=256);)C+=this[a+F]*N;return N*=128,C>=N&&(C-=Math.pow(2,8*l)),C},o.prototype.readIntBE=function(a,l,E){a=a>>>0,l=l>>>0,E||Y(a,l,this.length);let C=l,N=1,F=this[a+--C];for(;C>0&&(N*=256);)F+=this[a+--C]*N;return N*=128,F>=N&&(F-=Math.pow(2,8*l)),F},o.prototype.readInt8=function(a,l){return a=a>>>0,l||Y(a,1,this.length),this[a]&128?(255-this[a]+1)*-1:this[a]},o.prototype.readInt16LE=function(a,l){a=a>>>0,l||Y(a,2,this.length);let E=this[a]|this[a+1]<<8;return E&32768?E|4294901760:E},o.prototype.readInt16BE=function(a,l){a=a>>>0,l||Y(a,2,this.length);let E=this[a+1]|this[a]<<8;return E&32768?E|4294901760:E},o.prototype.readInt32LE=function(a,l){return a=a>>>0,l||Y(a,4,this.length),this[a]|this[a+1]<<8|this[a+2]<<16|this[a+3]<<24},o.prototype.readInt32BE=function(a,l){return a=a>>>0,l||Y(a,4,this.length),this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]},o.prototype.readBigInt64LE=it(function(a){a=a>>>0,xe(a,"offset");let l=this[a],E=this[a+7];(l===void 0||E===void 0)&&nt(a,this.length-8);let C=this[a+4]+this[a+5]*2**8+this[a+6]*2**16+(E<<24);return(BigInt(C)<<BigInt(32))+BigInt(l+this[++a]*2**8+this[++a]*2**16+this[++a]*2**24)}),o.prototype.readBigInt64BE=it(function(a){a=a>>>0,xe(a,"offset");let l=this[a],E=this[a+7];(l===void 0||E===void 0)&&nt(a,this.length-8);let C=(l<<24)+this[++a]*2**16+this[++a]*2**8+this[++a];return(BigInt(C)<<BigInt(32))+BigInt(this[++a]*2**24+this[++a]*2**16+this[++a]*2**8+E)}),o.prototype.readFloatLE=function(a,l){return a=a>>>0,l||Y(a,4,this.length),e.read(this,a,!0,23,4)},o.prototype.readFloatBE=function(a,l){return a=a>>>0,l||Y(a,4,this.length),e.read(this,a,!1,23,4)},o.prototype.readDoubleLE=function(a,l){return a=a>>>0,l||Y(a,8,this.length),e.read(this,a,!0,52,8)},o.prototype.readDoubleBE=function(a,l){return a=a>>>0,l||Y(a,8,this.length),e.read(this,a,!1,52,8)};function X(p,a,l,E,C,N){if(!o.isBuffer(p))throw new TypeError('"buffer" argument must be a Buffer instance');if(a>C||a<N)throw new RangeError('"value" argument is out of bounds');if(l+E>p.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(a,l,E,C){if(a=+a,l=l>>>0,E=E>>>0,!C){let k=Math.pow(2,8*E)-1;X(this,a,l,E,k,0)}let N=1,F=0;for(this[l]=a&255;++F<E&&(N*=256);)this[l+F]=a/N&255;return l+E},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(a,l,E,C){if(a=+a,l=l>>>0,E=E>>>0,!C){let k=Math.pow(2,8*E)-1;X(this,a,l,E,k,0)}let N=E-1,F=1;for(this[l+N]=a&255;--N>=0&&(F*=256);)this[l+N]=a/F&255;return l+E},o.prototype.writeUint8=o.prototype.writeUInt8=function(a,l,E){return a=+a,l=l>>>0,E||X(this,a,l,1,255,0),this[l]=a&255,l+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(a,l,E){return a=+a,l=l>>>0,E||X(this,a,l,2,65535,0),this[l]=a&255,this[l+1]=a>>>8,l+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(a,l,E){return a=+a,l=l>>>0,E||X(this,a,l,2,65535,0),this[l]=a>>>8,this[l+1]=a&255,l+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(a,l,E){return a=+a,l=l>>>0,E||X(this,a,l,4,4294967295,0),this[l+3]=a>>>24,this[l+2]=a>>>16,this[l+1]=a>>>8,this[l]=a&255,l+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(a,l,E){return a=+a,l=l>>>0,E||X(this,a,l,4,4294967295,0),this[l]=a>>>24,this[l+1]=a>>>16,this[l+2]=a>>>8,this[l+3]=a&255,l+4};function ce(p,a,l,E,C){Pe(a,E,C,p,l,7);let N=Number(a&BigInt(4294967295));p[l++]=N,N=N>>8,p[l++]=N,N=N>>8,p[l++]=N,N=N>>8,p[l++]=N;let F=Number(a>>BigInt(32)&BigInt(4294967295));return p[l++]=F,F=F>>8,p[l++]=F,F=F>>8,p[l++]=F,F=F>>8,p[l++]=F,l}function Z(p,a,l,E,C){Pe(a,E,C,p,l,7);let N=Number(a&BigInt(4294967295));p[l+7]=N,N=N>>8,p[l+6]=N,N=N>>8,p[l+5]=N,N=N>>8,p[l+4]=N;let F=Number(a>>BigInt(32)&BigInt(4294967295));return p[l+3]=F,F=F>>8,p[l+2]=F,F=F>>8,p[l+1]=F,F=F>>8,p[l]=F,l+8}o.prototype.writeBigUInt64LE=it(function(a,l=0){return ce(this,a,l,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=it(function(a,l=0){return Z(this,a,l,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(a,l,E,C){if(a=+a,l=l>>>0,!C){let M=Math.pow(2,8*E-1);X(this,a,l,E,M-1,-M)}let N=0,F=1,k=0;for(this[l]=a&255;++N<E&&(F*=256);)a<0&&k===0&&this[l+N-1]!==0&&(k=1),this[l+N]=(a/F>>0)-k&255;return l+E},o.prototype.writeIntBE=function(a,l,E,C){if(a=+a,l=l>>>0,!C){let M=Math.pow(2,8*E-1);X(this,a,l,E,M-1,-M)}let N=E-1,F=1,k=0;for(this[l+N]=a&255;--N>=0&&(F*=256);)a<0&&k===0&&this[l+N+1]!==0&&(k=1),this[l+N]=(a/F>>0)-k&255;return l+E},o.prototype.writeInt8=function(a,l,E){return a=+a,l=l>>>0,E||X(this,a,l,1,127,-128),a<0&&(a=255+a+1),this[l]=a&255,l+1},o.prototype.writeInt16LE=function(a,l,E){return a=+a,l=l>>>0,E||X(this,a,l,2,32767,-32768),this[l]=a&255,this[l+1]=a>>>8,l+2},o.prototype.writeInt16BE=function(a,l,E){return a=+a,l=l>>>0,E||X(this,a,l,2,32767,-32768),this[l]=a>>>8,this[l+1]=a&255,l+2},o.prototype.writeInt32LE=function(a,l,E){return a=+a,l=l>>>0,E||X(this,a,l,4,2147483647,-2147483648),this[l]=a&255,this[l+1]=a>>>8,this[l+2]=a>>>16,this[l+3]=a>>>24,l+4},o.prototype.writeInt32BE=function(a,l,E){return a=+a,l=l>>>0,E||X(this,a,l,4,2147483647,-2147483648),a<0&&(a=4294967295+a+1),this[l]=a>>>24,this[l+1]=a>>>16,this[l+2]=a>>>8,this[l+3]=a&255,l+4},o.prototype.writeBigInt64LE=it(function(a,l=0){return ce(this,a,l,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=it(function(a,l=0){return Z(this,a,l,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ne(p,a,l,E,C,N){if(l+E>p.length)throw new RangeError("Index out of range");if(l<0)throw new RangeError("Index out of range")}function de(p,a,l,E,C){return a=+a,l=l>>>0,C||ne(p,a,l,4),e.write(p,a,l,E,23,4),l+4}o.prototype.writeFloatLE=function(a,l,E){return de(this,a,l,!0,E)},o.prototype.writeFloatBE=function(a,l,E){return de(this,a,l,!1,E)};function me(p,a,l,E,C){return a=+a,l=l>>>0,C||ne(p,a,l,8),e.write(p,a,l,E,52,8),l+8}o.prototype.writeDoubleLE=function(a,l,E){return me(this,a,l,!0,E)},o.prototype.writeDoubleBE=function(a,l,E){return me(this,a,l,!1,E)},o.prototype.copy=function(a,l,E,C){if(!o.isBuffer(a))throw new TypeError("argument should be a Buffer");if(E||(E=0),!C&&C!==0&&(C=this.length),l>=a.length&&(l=a.length),l||(l=0),C>0&&C<E&&(C=E),C===E||a.length===0||this.length===0)return 0;if(l<0)throw new RangeError("targetStart out of bounds");if(E<0||E>=this.length)throw new RangeError("Index out of range");if(C<0)throw new RangeError("sourceEnd out of bounds");C>this.length&&(C=this.length),a.length-l<C-E&&(C=a.length-l+E);let N=C-E;return this===a&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(l,E,C):Uint8Array.prototype.set.call(a,this.subarray(E,C),l),N},o.prototype.fill=function(a,l,E,C){if(typeof a=="string"){if(typeof l=="string"?(C=l,l=0,E=this.length):typeof E=="string"&&(C=E,E=this.length),C!==void 0&&typeof C!="string")throw new TypeError("encoding must be a string");if(typeof C=="string"&&!o.isEncoding(C))throw new TypeError("Unknown encoding: "+C);if(a.length===1){let F=a.charCodeAt(0);(C==="utf8"&&F<128||C==="latin1")&&(a=F)}}else typeof a=="number"?a=a&255:typeof a=="boolean"&&(a=Number(a));if(l<0||this.length<l||this.length<E)throw new RangeError("Out of range index");if(E<=l)return this;l=l>>>0,E=E===void 0?this.length:E>>>0,a||(a=0);let N;if(typeof a=="number")for(N=l;N<E;++N)this[N]=a;else{let F=o.isBuffer(a)?a:o.from(a,C),k=F.length;if(k===0)throw new TypeError('The value "'+a+'" is invalid for argument "value"');for(N=0;N<E-l;++N)this[N+l]=F[N%k]}return this};let ye={};function Ae(p,a,l){ye[p]=class extends l{constructor(){super(),Object.defineProperty(this,"message",{value:a.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${p}]`,this.stack,delete this.name}get code(){return p}set code(C){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:C,writable:!0})}toString(){return`${this.name} [${p}]: ${this.message}`}}}Ae("ERR_BUFFER_OUT_OF_BOUNDS",function(p){return p?`${p} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Ae("ERR_INVALID_ARG_TYPE",function(p,a){return`The "${p}" argument must be of type number. Received type ${typeof a}`},TypeError),Ae("ERR_OUT_OF_RANGE",function(p,a,l){let E=`The value of "${p}" is out of range.`,C=l;return Number.isInteger(l)&&Math.abs(l)>2**32?C=we(String(l)):typeof l=="bigint"&&(C=String(l),(l>BigInt(2)**BigInt(32)||l<-(BigInt(2)**BigInt(32)))&&(C=we(C)),C+="n"),E+=` It must be ${a}. Received ${C}`,E},RangeError);function we(p){let a="",l=p.length,E=p[0]==="-"?1:0;for(;l>=E+4;l-=3)a=`_${p.slice(l-3,l)}${a}`;return`${p.slice(0,l)}${a}`}function ve(p,a,l){xe(a,"offset"),(p[a]===void 0||p[a+l]===void 0)&&nt(a,p.length-(l+1))}function Pe(p,a,l,E,C,N){if(p>l||p<a){let F=typeof a=="bigint"?"n":"",k;throw a===0||a===BigInt(0)?k=`>= 0${F} and < 2${F} ** ${(N+1)*8}${F}`:k=`>= -(2${F} ** ${(N+1)*8-1}${F}) and < 2 ** ${(N+1)*8-1}${F}`,new ye.ERR_OUT_OF_RANGE("value",k,p)}ve(E,C,N)}function xe(p,a){if(typeof p!="number")throw new ye.ERR_INVALID_ARG_TYPE(a,"number",p)}function nt(p,a,l){throw Math.floor(p)!==p?(xe(p,l),new ye.ERR_OUT_OF_RANGE("offset","an integer",p)):a<0?new ye.ERR_BUFFER_OUT_OF_BOUNDS:new ye.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${a}`,p)}let Oe=/[^+/0-9A-Za-z-_]/g;function Be(p){if(p=p.split("=")[0],p=p.trim().replace(Oe,""),p.length<2)return"";for(;p.length%4!==0;)p=p+"=";return p}function _t(p,a){a=a||1/0;let l,E=p.length,C=null,N=[];for(let F=0;F<E;++F){if(l=p.charCodeAt(F),l>55295&&l<57344){if(!C){if(l>56319){(a-=3)>-1&&N.push(239,191,189);continue}else if(F+1===E){(a-=3)>-1&&N.push(239,191,189);continue}C=l;continue}if(l<56320){(a-=3)>-1&&N.push(239,191,189),C=l;continue}l=(C-55296<<10|l-56320)+65536}else C&&(a-=3)>-1&&N.push(239,191,189);if(C=null,l<128){if((a-=1)<0)break;N.push(l)}else if(l<2048){if((a-=2)<0)break;N.push(l>>6|192,l&63|128)}else if(l<65536){if((a-=3)<0)break;N.push(l>>12|224,l>>6&63|128,l&63|128)}else if(l<1114112){if((a-=4)<0)break;N.push(l>>18|240,l>>12&63|128,l>>6&63|128,l&63|128)}else throw new Error("Invalid code point")}return N}function wt(p){let a=[];for(let l=0;l<p.length;++l)a.push(p.charCodeAt(l)&255);return a}function rn(p,a){let l,E,C,N=[];for(let F=0;F<p.length&&!((a-=2)<0);++F)l=p.charCodeAt(F),E=l>>8,C=l%256,N.push(C),N.push(E);return N}function ri(p){return t.toByteArray(Be(p))}function Ar(p,a,l,E){let C;for(C=0;C<E&&!(C+l>=a.length||C>=p.length);++C)a[C+l]=p[C];return C}function Je(p,a){return p instanceof a||p!=null&&p.constructor!=null&&p.constructor.name!=null&&p.constructor.name===a.name}function nn(p){return p!==p}let ho=(function(){let p="0123456789abcdef",a=new Array(256);for(let l=0;l<16;++l){let E=l*16;for(let C=0;C<16;++C)a[E+C]=p[l]+p[C]}return a})();function it(p){return typeof BigInt>"u"?po:p}function po(){throw new Error("BigInt not supported")}return or}var sn,fc,ui,dc,or,hc,gc=$e(()=>{x();P();T();sn={},fc=!1;ui={},dc=!1;or={},hc=!1});var Ne={};Tr(Ne,{Buffer:()=>V,INSPECT_MAX_BYTES:()=>Sy,default:()=>Ut,kMaxLength:()=>Ey});var Ut,V,Sy,Ey,Re=$e(()=>{x();P();T();gc();Ut=pc();Ut.Buffer;Ut.SlowBuffer;Ut.INSPECT_MAX_BYTES;Ut.kMaxLength;V=Ut.Buffer,Sy=Ut.INSPECT_MAX_BYTES,Ey=Ut.kMaxLength});var P=$e(()=>{Re()});var Ee=H((rx,yc)=>{"use strict";x();P();T();var Po=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 n=0;n<e.length;n++)r+=` ${e[n].stack}
2
- `;super(r),this.name="AggregateError",this.errors=e}};yc.exports={AggregateError:Po,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)},PromiseResolve(t){return Promise.resolve(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,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(t,e,r){return t.set(e,r)},Boolean,Uint8Array}});var Oo=H((lx,bc)=>{"use strict";x();P();T();bc.exports={format(t,...e){return t.replace(/%([sdifj])/g,function(...[r,n]){let i=e.shift();return n==="f"?i.toFixed(6):n==="j"?JSON.stringify(i):n==="s"&&typeof i=="object"?`${i.constructor!==Object?i.constructor.name:""} {}`.trim():i.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"{}"}}}});var De=H((yx,wc)=>{"use strict";x();P();T();var{format:Ay,inspect:li}=Oo(),{AggregateError:Iy}=Ee(),xy=globalThis.AggregateError||Iy,Ty=Symbol("kIsNodeError"),Py=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Oy=/^([A-Z][a-z0-9]*)+$/,Ry="__node_internal_",ci={};function sr(t,e){if(!t)throw new ci.ERR_INTERNAL_ASSERTION(e)}function mc(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function ky(t,e,r){if(typeof e=="function")return sr(e.length<=r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${e.length}).`),e(...r);let n=(e.match(/%[dfijoOs]/g)||[]).length;return sr(n===r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${n}).`),r.length===0?e:Ay(e,...r)}function Le(t,e,r){r||(r=Error);class n extends r{constructor(...s){super(ky(t,e,s))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(n.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}}),n.prototype.code=t,n.prototype[Ty]=!0,ci[t]=n}function _c(t){let e=Ry+t.name;return Object.defineProperty(t,"name",{value:e}),t}function Cy(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let r=new xy([e,t],e.message);return r.code=e.code,r}return t||e}var Ro=class extends Error{constructor(e="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new ci.ERR_INVALID_ARG_TYPE("options","Object",r);super(e,r),this.code="ABORT_ERR",this.name="AbortError"}};Le("ERR_ASSERTION","%s",Error);Le("ERR_INVALID_ARG_TYPE",(t,e,r)=>{sr(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let n="The ";t.endsWith(" argument")?n+=`${t} `:n+=`"${t}" ${t.includes(".")?"property":"argument"} `,n+="must be ";let i=[],s=[],o=[];for(let c of e)sr(typeof c=="string","All expected entries have to be of type string"),Py.includes(c)?i.push(c.toLowerCase()):Oy.test(c)?s.push(c):(sr(c!=="object",'The value "object" should be written as "Object"'),o.push(c));if(s.length>0){let c=i.indexOf("object");c!==-1&&(i.splice(i,c,1),s.push("Object"))}if(i.length>0){switch(i.length){case 1:n+=`of type ${i[0]}`;break;case 2:n+=`one of type ${i[0]} or ${i[1]}`;break;default:{let c=i.pop();n+=`one of type ${i.join(", ")}, or ${c}`}}(s.length>0||o.length>0)&&(n+=" or ")}if(s.length>0){switch(s.length){case 1:n+=`an instance of ${s[0]}`;break;case 2:n+=`an instance of ${s[0]} or ${s[1]}`;break;default:{let c=s.pop();n+=`an instance of ${s.join(", ")}, or ${c}`}}o.length>0&&(n+=" or ")}switch(o.length){case 0:break;case 1:o[0].toLowerCase()!==o[0]&&(n+="an "),n+=`${o[0]}`;break;case 2:n+=`one of ${o[0]} or ${o[1]}`;break;default:{let c=o.pop();n+=`one of ${o.join(", ")}, or ${c}`}}if(r==null)n+=`. Received ${r}`;else if(typeof r=="function"&&r.name)n+=`. Received function ${r.name}`;else if(typeof r=="object"){var u;if((u=r.constructor)!==null&&u!==void 0&&u.name)n+=`. Received an instance of ${r.constructor.name}`;else{let c=li(r,{depth:-1});n+=`. Received ${c}`}}else{let c=li(r,{colors:!1});c.length>25&&(c=`${c.slice(0,25)}...`),n+=`. Received type ${typeof r} (${c})`}return n},TypeError);Le("ERR_INVALID_ARG_VALUE",(t,e,r="is invalid")=>{let n=li(e);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${r}. Received ${n}`},TypeError);Le("ERR_INVALID_RETURN_VALUE",(t,e,r)=>{var n;let i=r!=null&&(n=r.constructor)!==null&&n!==void 0&&n.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${t} to be returned from the "${e}" function but got ${i}.`},TypeError);Le("ERR_MISSING_ARGS",(...t)=>{sr(t.length>0,"At least one arg needs to be specified");let e,r=t.length;switch(t=(Array.isArray(t)?t:[t]).map(n=>`"${n}"`).join(" or "),r){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let n=t.pop();e+=`The ${t.join(", ")}, and ${n} arguments`}break}return`${e} must be specified`},TypeError);Le("ERR_OUT_OF_RANGE",(t,e,r)=>{sr(e,'Missing "range" argument');let n;if(Number.isInteger(r)&&Math.abs(r)>2**32)n=mc(String(r));else if(typeof r=="bigint"){n=String(r);let i=BigInt(2)**BigInt(32);(r>i||r<-i)&&(n=mc(n)),n+="n"}else n=li(r);return`The value of "${t}" is out of range. It must be ${e}. Received ${n}`},RangeError);Le("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);Le("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);Le("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);Le("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);Le("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);Le("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Le("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);Le("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);Le("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);Le("ERR_STREAM_WRITE_AFTER_END","write after end",Error);Le("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);wc.exports={AbortError:Ro,aggregateTwoErrors:_c(Cy),hideStackFrames:_c,codes:ci}});var Or=H((Ax,fi)=>{"use strict";x();P();T();var{AbortController:vc,AbortSignal:My}=typeof self<"u"?self:typeof window<"u"?window:void 0;fi.exports=vc;fi.exports.AbortSignal=My;fi.exports.default=vc});var Ft={};Tr(Ft,{EventEmitter:()=>Ny,default:()=>an,defaultMaxListeners:()=>Ly,init:()=>qy,listenerCount:()=>Dy,on:()=>Uy,once:()=>Fy});function By(){if(Sc)return di;Sc=!0;var t=typeof Reflect=="object"?Reflect:null,e=t&&typeof t.apply=="function"?t.apply:function(g,O,v){return Function.prototype.apply.call(g,O,v)},r;t&&typeof t.ownKeys=="function"?r=t.ownKeys:Object.getOwnPropertySymbols?r=function(g){return Object.getOwnPropertyNames(g).concat(Object.getOwnPropertySymbols(g))}:r=function(g){return Object.getOwnPropertyNames(g)};function n(A){console&&console.warn&&console.warn(A)}var i=Number.isNaN||function(g){return g!==g};function s(){s.init.call(this)}di=s,di.once=m,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function u(A){if(typeof A!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof A)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(A){if(typeof A!="number"||A<0||i(A))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+A+".");o=A}}),s.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},s.prototype.setMaxListeners=function(g){if(typeof g!="number"||g<0||i(g))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+g+".");return this._maxListeners=g,this};function c(A){return A._maxListeners===void 0?s.defaultMaxListeners:A._maxListeners}s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(g){for(var O=[],v=1;v<arguments.length;v++)O.push(arguments[v]);var B=g==="error",D=this._events;if(D!==void 0)B=B&&D.error===void 0;else if(!B)return!1;if(B){var q;if(O.length>0&&(q=O[0]),q instanceof Error)throw q;var K=new Error("Unhandled error."+(q?" ("+q.message+")":""));throw K.context=q,K}var U=D[g];if(U===void 0)return!1;if(typeof U=="function")e(U,this,O);else for(var $=U.length,G=I(U,$),v=0;v<$;++v)e(G[v],this,O);return!0};function f(A,g,O,v){var B,D,q;if(u(O),D=A._events,D===void 0?(D=A._events=Object.create(null),A._eventsCount=0):(D.newListener!==void 0&&(A.emit("newListener",g,O.listener?O.listener:O),D=A._events),q=D[g]),q===void 0)q=D[g]=O,++A._eventsCount;else if(typeof q=="function"?q=D[g]=v?[O,q]:[q,O]:v?q.unshift(O):q.push(O),B=c(A),B>0&&q.length>B&&!q.warned){q.warned=!0;var K=new Error("Possible EventEmitter memory leak detected. "+q.length+" "+String(g)+" listeners added. Use emitter.setMaxListeners() to increase limit");K.name="MaxListenersExceededWarning",K.emitter=A,K.type=g,K.count=q.length,n(K)}return A}s.prototype.addListener=function(g,O){return f(this,g,O,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(g,O){return f(this,g,O,!0)};function d(){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 h(A,g,O){var v={fired:!1,wrapFn:void 0,target:A,type:g,listener:O},B=d.bind(v);return B.listener=O,v.wrapFn=B,B}s.prototype.once=function(g,O){return u(O),this.on(g,h(this,g,O)),this},s.prototype.prependOnceListener=function(g,O){return u(O),this.prependListener(g,h(this,g,O)),this},s.prototype.removeListener=function(g,O){var v,B,D,q,K;if(u(O),B=this._events,B===void 0)return this;if(v=B[g],v===void 0)return this;if(v===O||v.listener===O)--this._eventsCount===0?this._events=Object.create(null):(delete B[g],B.removeListener&&this.emit("removeListener",g,v.listener||O));else if(typeof v!="function"){for(D=-1,q=v.length-1;q>=0;q--)if(v[q]===O||v[q].listener===O){K=v[q].listener,D=q;break}if(D<0)return this;D===0?v.shift():S(v,D),v.length===1&&(B[g]=v[0]),B.removeListener!==void 0&&this.emit("removeListener",g,K||O)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(g){var O,v,B;if(v=this._events,v===void 0)return this;if(v.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):v[g]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete v[g]),this;if(arguments.length===0){var D=Object.keys(v),q;for(B=0;B<D.length;++B)q=D[B],q!=="removeListener"&&this.removeAllListeners(q);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(O=v[g],typeof O=="function")this.removeListener(g,O);else if(O!==void 0)for(B=O.length-1;B>=0;B--)this.removeListener(g,O[B]);return this};function _(A,g,O){var v=A._events;if(v===void 0)return[];var B=v[g];return B===void 0?[]:typeof B=="function"?O?[B.listener||B]:[B]:O?b(B):I(B,B.length)}s.prototype.listeners=function(g){return _(this,g,!0)},s.prototype.rawListeners=function(g){return _(this,g,!1)},s.listenerCount=function(A,g){return typeof A.listenerCount=="function"?A.listenerCount(g):y.call(A,g)},s.prototype.listenerCount=y;function y(A){var g=this._events;if(g!==void 0){var O=g[A];if(typeof O=="function")return 1;if(O!==void 0)return O.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]};function I(A,g){for(var O=new Array(g),v=0;v<g;++v)O[v]=A[v];return O}function S(A,g){for(;g+1<A.length;g++)A[g]=A[g+1];A.pop()}function b(A){for(var g=new Array(A.length),O=0;O<g.length;++O)g[O]=A[O].listener||A[O];return g}function m(A,g){return new Promise(function(O,v){function B(q){A.removeListener(g,D),v(q)}function D(){typeof A.removeListener=="function"&&A.removeListener("error",B),O([].slice.call(arguments))}R(A,g,D,{once:!0}),g!=="error"&&w(A,B,{once:!0})})}function w(A,g,O){typeof A.on=="function"&&R(A,"error",g,O)}function R(A,g,O,v){if(typeof A.on=="function")v.once?A.once(g,O):A.on(g,O);else if(typeof A.addEventListener=="function")A.addEventListener(g,function B(D){v.once&&A.removeEventListener(g,B),O(D)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof A)}return di}var di,Sc,an,Ny,Ly,qy,Dy,Uy,Fy,jt=$e(()=>{x();P();T();di={},Sc=!1;an=By();an.once;an.once=function(t,e){return new Promise((r,n)=>{function i(...o){s!==void 0&&t.removeListener("error",s),r(o)}let s;e!=="error"&&(s=o=>{t.removeListener(name,i),n(o)},t.once("error",s)),t.once(e,i)})};an.on=function(t,e){let r=[],n=[],i=null,s=!1,o={async next(){let f=r.shift();if(f)return createIterResult(f,!1);if(i){let d=Promise.reject(i);return i=null,d}return s?createIterResult(void 0,!0):new Promise((d,h)=>n.push({resolve:d,reject:h}))},async return(){t.removeListener(e,u),t.removeListener("error",c),s=!0;for(let f of n)f.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(f){i=f,t.removeListener(e,u),t.removeListener("error",c)},[Symbol.asyncIterator](){return this}};return t.on(e,u),t.on("error",c),o;function u(...f){let d=n.shift();d?d.resolve(createIterResult(f,!1)):r.push(f)}function c(f){s=!0;let d=n.shift();d?d.reject(f):i=f,o.return()}};({EventEmitter:Ny,defaultMaxListeners:Ly,init:qy,listenerCount:Dy,on:Uy,once:Fy}=an)});var We=H((qx,Co)=>{"use strict";x();P();T();var jy=(Re(),ge(Ne)),{format:$y,inspect:Wy}=Oo(),{codes:{ERR_INVALID_ARG_TYPE:ko}}=De(),{kResistStopPropagation:Vy,AggregateError:Hy,SymbolDispose:zy}=Ee(),Gy=globalThis.AbortSignal||Or().AbortSignal,Qy=globalThis.AbortController||Or().AbortController,Ky=Object.getPrototypeOf(async function(){}).constructor,Ec=globalThis.Blob||jy.Blob,Yy=typeof Ec<"u"?function(e){return e instanceof Ec}:function(e){return!1},Ac=(t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ko(e,"AbortSignal",t)},Jy=(t,e)=>{if(typeof t!="function")throw new ko(e,"Function",t)};Co.exports={AggregateError:Hy,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((n,i)=>{t=n,e=i}),resolve:t,reject:e}},promisify(t){return new Promise((e,r)=>{t((n,...i)=>n?r(n):e(...i))})},debuglog(){return function(){}},format:$y,inspect:Wy,types:{isAsyncFunction(t){return t instanceof Ky},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:Yy,deprecate(t,e){return t},addAbortListener:(jt(),ge(Ft)).addAbortListener||function(e,r){if(e===void 0)throw new ko("signal","AbortSignal",e);Ac(e,"signal"),Jy(r,"listener");let n;return e.aborted?queueMicrotask(()=>r()):(e.addEventListener("abort",r,{__proto__:null,once:!0,[Vy]:!0}),n=()=>{e.removeEventListener("abort",r)}),{__proto__:null,[zy](){var i;(i=n)===null||i===void 0||i()}}},AbortSignalAny:Gy.any||function(e){if(e.length===1)return e[0];let r=new Qy,n=()=>r.abort();return e.forEach(i=>{Ac(i,"signals"),i.addEventListener("abort",n,{once:!0})}),r.signal.addEventListener("abort",()=>{e.forEach(i=>i.removeEventListener("abort",n))},{once:!0}),r.signal}};Co.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var kr=H((Vx,Bc)=>{"use strict";x();P();T();var{ArrayIsArray:Bo,ArrayPrototypeIncludes:Pc,ArrayPrototypeJoin:Oc,ArrayPrototypeMap:Xy,NumberIsInteger:No,NumberIsNaN:Zy,NumberMAX_SAFE_INTEGER:eb,NumberMIN_SAFE_INTEGER:tb,NumberParseInt:rb,ObjectPrototypeHasOwnProperty:nb,RegExpPrototypeExec:Rc,String:ib,StringPrototypeToUpperCase:ob,StringPrototypeTrim:sb}=Ee(),{hideStackFrames:Xe,codes:{ERR_SOCKET_BAD_PORT:ab,ERR_INVALID_ARG_TYPE:Ue,ERR_INVALID_ARG_VALUE:Rr,ERR_OUT_OF_RANGE:ar,ERR_UNKNOWN_SIGNAL:Ic}}=De(),{normalizeEncoding:ub}=We(),{isAsyncFunction:lb,isArrayBufferView:cb}=We().types,xc={};function fb(t){return t===(t|0)}function db(t){return t===t>>>0}var hb=/^[0-7]+$/,pb="must be a 32-bit unsigned integer or an octal string";function gb(t,e,r){if(typeof t>"u"&&(t=r),typeof t=="string"){if(Rc(hb,t)===null)throw new Rr(e,t,pb);t=rb(t,8)}return kc(t,e),t}var yb=Xe((t,e,r=tb,n=eb)=>{if(typeof t!="number")throw new Ue(e,"number",t);if(!No(t))throw new ar(e,"an integer",t);if(t<r||t>n)throw new ar(e,`>= ${r} && <= ${n}`,t)}),bb=Xe((t,e,r=-2147483648,n=2147483647)=>{if(typeof t!="number")throw new Ue(e,"number",t);if(!No(t))throw new ar(e,"an integer",t);if(t<r||t>n)throw new ar(e,`>= ${r} && <= ${n}`,t)}),kc=Xe((t,e,r=!1)=>{if(typeof t!="number")throw new Ue(e,"number",t);if(!No(t))throw new ar(e,"an integer",t);let n=r?1:0,i=4294967295;if(t<n||t>i)throw new ar(e,`>= ${n} && <= ${i}`,t)});function Lo(t,e){if(typeof t!="string")throw new Ue(e,"string",t)}function mb(t,e,r=void 0,n){if(typeof t!="number")throw new Ue(e,"number",t);if(r!=null&&t<r||n!=null&&t>n||(r!=null||n!=null)&&Zy(t))throw new ar(e,`${r!=null?`>= ${r}`:""}${r!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,t)}var _b=Xe((t,e,r)=>{if(!Pc(r,t)){let i="must be one of: "+Oc(Xy(r,s=>typeof s=="string"?`'${s}'`:ib(s)),", ");throw new Rr(e,t,i)}});function Cc(t,e){if(typeof t!="boolean")throw new Ue(e,"boolean",t)}function Mo(t,e,r){return t==null||!nb(t,e)?r:t[e]}var wb=Xe((t,e,r=null)=>{let n=Mo(r,"allowArray",!1),i=Mo(r,"allowFunction",!1);if(!Mo(r,"nullable",!1)&&t===null||!n&&Bo(t)||typeof t!="object"&&(!i||typeof t!="function"))throw new Ue(e,"Object",t)}),vb=Xe((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new Ue(e,"a dictionary",t)}),hi=Xe((t,e,r=0)=>{if(!Bo(t))throw new Ue(e,"Array",t);if(t.length<r){let n=`must be longer than ${r}`;throw new Rr(e,t,n)}});function Sb(t,e){hi(t,e);for(let r=0;r<t.length;r++)Lo(t[r],`${e}[${r}]`)}function Eb(t,e){hi(t,e);for(let r=0;r<t.length;r++)Cc(t[r],`${e}[${r}]`)}function Ab(t,e){hi(t,e);for(let r=0;r<t.length;r++){let n=t[r],i=`${e}[${r}]`;if(n==null)throw new Ue(i,"AbortSignal",n);Mc(n,i)}}function Ib(t,e="signal"){if(Lo(t,e),xc[t]===void 0)throw xc[ob(t)]!==void 0?new Ic(t+" (signals must use all capital letters)"):new Ic(t)}var xb=Xe((t,e="buffer")=>{if(!cb(t))throw new Ue(e,["Buffer","TypedArray","DataView"],t)});function Tb(t,e){let r=ub(e),n=t.length;if(r==="hex"&&n%2!==0)throw new Rr("encoding",e,`is invalid for data of length ${n}`)}function Pb(t,e="Port",r=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&sb(t).length===0||+t!==+t>>>0||t>65535||t===0&&!r)throw new ab(e,t,r);return t|0}var Mc=Xe((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new Ue(e,"AbortSignal",t)}),Ob=Xe((t,e)=>{if(typeof t!="function")throw new Ue(e,"Function",t)}),Rb=Xe((t,e)=>{if(typeof t!="function"||lb(t))throw new Ue(e,"Function",t)}),kb=Xe((t,e)=>{if(t!==void 0)throw new Ue(e,"undefined",t)});function Cb(t,e,r){if(!Pc(r,t))throw new Ue(e,`('${Oc(r,"|")}')`,t)}var Mb=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Tc(t,e){if(typeof t>"u"||!Rc(Mb,t))throw new Rr(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function Bb(t){if(typeof t=="string")return Tc(t,"hints"),t;if(Bo(t)){let e=t.length,r="";if(e===0)return r;for(let n=0;n<e;n++){let i=t[n];Tc(i,"hints"),r+=i,n!==e-1&&(r+=", ")}return r}throw new Rr("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}Bc.exports={isInt32:fb,isUint32:db,parseFileMode:gb,validateArray:hi,validateStringArray:Sb,validateBooleanArray:Eb,validateAbortSignalArray:Ab,validateBoolean:Cc,validateBuffer:xb,validateDictionary:vb,validateEncoding:Tb,validateFunction:Ob,validateInt32:bb,validateInteger:yb,validateNumber:mb,validateObject:wb,validateOneOf:_b,validatePlainFunction:Rb,validatePort:Pb,validateSignalName:Ib,validateString:Lo,validateUint32:kc,validateUndefined:kb,validateUnion:Cb,validateAbortSignal:Mc,validateLinkHeaderValue:Bb}});var dt=H((Jx,Kc)=>{"use strict";x();P();T();var{SymbolAsyncIterator:Nc,SymbolIterator:Lc,SymbolFor:ur}=Ee(),qc=ur("nodejs.stream.destroyed"),Dc=ur("nodejs.stream.errored"),qo=ur("nodejs.stream.readable"),Do=ur("nodejs.stream.writable"),Uc=ur("nodejs.stream.disturbed"),Nb=ur("nodejs.webstream.isClosedPromise"),Lb=ur("nodejs.webstream.controllerErrorFunction");function pi(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 gi(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 qb(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}function ft(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}function Fc(t){return!!(t&&!ft(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}function jc(t){return!!(t&&!ft(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}function $c(t){return!!(t&&!ft(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}function Db(t){return Fc(t)||jc(t)||$c(t)}function Ub(t,e){return t==null?!1:e===!0?typeof t[Nc]=="function":e===!1?typeof t[Lc]=="function":typeof t[Nc]=="function"||typeof t[Lc]=="function"}function yi(t){if(!ft(t))return null;let e=t._writableState,r=t._readableState,n=e||r;return!!(t.destroyed||t[qc]||n!=null&&n.destroyed)}function Wc(t){if(!gi(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 Fb(t,e){if(!gi(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 jb(t){if(!pi(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 Vc(t,e){if(!pi(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 Hc(t){return t&&t[qo]!=null?t[qo]:typeof t?.readable!="boolean"?null:yi(t)?!1:pi(t)&&t.readable&&!Vc(t)}function zc(t){return t&&t[Do]!=null?t[Do]:typeof t?.writable!="boolean"?null:yi(t)?!1:gi(t)&&t.writable&&!Wc(t)}function $b(t,e){return ft(t)?yi(t)?!0:!(e?.readable!==!1&&Hc(t)||e?.writable!==!1&&zc(t)):null}function Wb(t){var e,r;return ft(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 Vb(t){var e,r;return ft(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 Hb(t){if(!ft(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"&&Gc(t)?t._closed:null}function Gc(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}function Qc(t){return typeof t._sent100=="boolean"&&Gc(t)}function zb(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 Gb(t){if(!ft(t))return null;let e=t._writableState,r=t._readableState,n=e||r;return!n&&Qc(t)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}function Qb(t){var e;return!!(t&&((e=t[Uc])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}function Kb(t){var e,r,n,i,s,o,u,c,f,d;return!!(t&&((e=(r=(n=(i=(s=(o=t[Dc])!==null&&o!==void 0?o:t.readableErrored)!==null&&s!==void 0?s:t.writableErrored)!==null&&i!==void 0?i:(u=t._readableState)===null||u===void 0?void 0:u.errorEmitted)!==null&&n!==void 0?n:(c=t._writableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&r!==void 0?r:(f=t._readableState)===null||f===void 0?void 0:f.errored)!==null&&e!==void 0?e:!((d=t._writableState)===null||d===void 0)&&d.errored))}Kc.exports={isDestroyed:yi,kIsDestroyed:qc,isDisturbed:Qb,kIsDisturbed:Uc,isErrored:Kb,kIsErrored:Dc,isReadable:Hc,kIsReadable:qo,kIsClosedPromise:Nb,kControllerErrorFunction:Lb,kIsWritable:Do,isClosed:Hb,isDuplexNodeStream:qb,isFinished:$b,isIterable:Ub,isReadableNodeStream:pi,isReadableStream:Fc,isReadableEnded:jb,isReadableFinished:Vc,isReadableErrored:Vb,isNodeStream:ft,isWebStream:Db,isWritable:zc,isWritableNodeStream:gi,isWritableStream:jc,isWritableEnded:Wc,isWritableFinished:Fb,isWritableErrored:Wb,isServerRequest:zb,isServerResponse:Qc,willEmitClose:Gb,isTransformStream:$c}});var At=H((iT,Wo)=>{"use strict";x();P();T();var $t=(Et(),ge(L)),{AbortError:of,codes:Yb}=De(),{ERR_INVALID_ARG_TYPE:Jb,ERR_STREAM_PREMATURE_CLOSE:Yc}=Yb,{kEmptyObject:Fo,once:jo}=We(),{validateAbortSignal:Xb,validateFunction:Zb,validateObject:em,validateBoolean:tm}=kr(),{Promise:rm,PromisePrototypeThen:nm,SymbolDispose:sf}=Ee(),{isClosed:im,isReadable:Jc,isReadableNodeStream:Uo,isReadableStream:om,isReadableFinished:Xc,isReadableErrored:Zc,isWritable:ef,isWritableNodeStream:tf,isWritableStream:sm,isWritableFinished:rf,isWritableErrored:nf,isNodeStream:am,willEmitClose:um,kIsClosedPromise:lm}=dt(),Cr;function cm(t){return t.setHeader&&typeof t.abort=="function"}var $o=()=>{};function af(t,e,r){var n,i;if(arguments.length===2?(r=e,e=Fo):e==null?e=Fo:em(e,"options"),Zb(r,"callback"),Xb(e.signal,"options.signal"),r=jo(r),om(t)||sm(t))return fm(t,e,r);if(!am(t))throw new Jb("stream",["ReadableStream","WritableStream","Stream"],t);let s=(n=e.readable)!==null&&n!==void 0?n:Uo(t),o=(i=e.writable)!==null&&i!==void 0?i:tf(t),u=t._writableState,c=t._readableState,f=()=>{t.writable||_()},d=um(t)&&Uo(t)===s&&tf(t)===o,h=rf(t,!1),_=()=>{h=!0,t.destroyed&&(d=!1),!(d&&(!t.readable||s))&&(!s||y)&&r.call(t)},y=Xc(t,!1),I=()=>{y=!0,t.destroyed&&(d=!1),!(d&&(!t.writable||o))&&(!o||h)&&r.call(t)},S=g=>{r.call(t,g)},b=im(t),m=()=>{b=!0;let g=nf(t)||Zc(t);if(g&&typeof g!="boolean")return r.call(t,g);if(s&&!y&&Uo(t,!0)&&!Xc(t,!1))return r.call(t,new Yc);if(o&&!h&&!rf(t,!1))return r.call(t,new Yc);r.call(t)},w=()=>{b=!0;let g=nf(t)||Zc(t);if(g&&typeof g!="boolean")return r.call(t,g);r.call(t)},R=()=>{t.req.on("finish",_)};cm(t)?(t.on("complete",_),d||t.on("abort",m),t.req?R():t.on("request",R)):o&&!u&&(t.on("end",f),t.on("close",f)),!d&&typeof t.aborted=="boolean"&&t.on("aborted",m),t.on("end",I),t.on("finish",_),e.error!==!1&&t.on("error",S),t.on("close",m),b?$t.nextTick(m):u!=null&&u.errorEmitted||c!=null&&c.errorEmitted?d||$t.nextTick(w):(!s&&(!d||Jc(t))&&(h||ef(t)===!1)||!o&&(!d||ef(t))&&(y||Jc(t)===!1)||c&&t.req&&t.aborted)&&$t.nextTick(w);let A=()=>{r=$o,t.removeListener("aborted",m),t.removeListener("complete",_),t.removeListener("abort",m),t.removeListener("request",R),t.req&&t.req.removeListener("finish",_),t.removeListener("end",f),t.removeListener("close",f),t.removeListener("finish",_),t.removeListener("end",I),t.removeListener("error",S),t.removeListener("close",m)};if(e.signal&&!b){let g=()=>{let O=r;A(),O.call(t,new of(void 0,{cause:e.signal.reason}))};if(e.signal.aborted)$t.nextTick(g);else{Cr=Cr||We().addAbortListener;let O=Cr(e.signal,g),v=r;r=jo((...B)=>{O[sf](),v.apply(t,B)})}}return A}function fm(t,e,r){let n=!1,i=$o;if(e.signal)if(i=()=>{n=!0,r.call(t,new of(void 0,{cause:e.signal.reason}))},e.signal.aborted)$t.nextTick(i);else{Cr=Cr||We().addAbortListener;let o=Cr(e.signal,i),u=r;r=jo((...c)=>{o[sf](),u.apply(t,c)})}let s=(...o)=>{n||$t.nextTick(()=>r.apply(t,o))};return nm(t[lm].promise,s,s),$o}function dm(t,e){var r;let n=!1;return e===null&&(e=Fo),(r=e)!==null&&r!==void 0&&r.cleanup&&(tm(e.cleanup,"cleanup"),n=e.cleanup),new rm((i,s)=>{let o=af(t,e,u=>{n&&o(),u?s(u):i()})})}Wo.exports=af;Wo.exports.finished=dm});var lr=H((fT,gf)=>{"use strict";x();P();T();var ht=(Et(),ge(L)),{aggregateTwoErrors:hm,codes:{ERR_MULTIPLE_CALLBACK:pm},AbortError:gm}=De(),{Symbol:cf}=Ee(),{kIsDestroyed:ym,isDestroyed:bm,isFinished:mm,isServerRequest:_m}=dt(),ff=cf("kDestroy"),Vo=cf("kConstruct");function df(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,n=this._writableState,i=n||r;return n!=null&&n.destroyed||r!=null&&r.destroyed?(typeof e=="function"&&e(),this):(df(t,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),i.constructed?uf(this,t,e):this.once(ff,function(s){uf(this,hm(s,t),e)}),this)}function uf(t,e,r){let n=!1;function i(s){if(n)return;n=!0;let o=t._readableState,u=t._writableState;df(s,u,o),u&&(u.closed=!0),o&&(o.closed=!0),typeof r=="function"&&r(s),s?ht.nextTick(vm,t,s):ht.nextTick(hf,t)}try{t._destroy(e||null,i)}catch(s){i(s)}}function vm(t,e){Ho(t,e),hf(t)}function hf(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 Ho(t,e){let r=t._readableState,n=t._writableState;n!=null&&n.errorEmitted||r!=null&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),t.emit("error",e))}function Sm(){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 zo(t,e,r){let n=t._readableState,i=t._writableState;if(i!=null&&i.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||i!=null&&i.autoDestroy?t.destroy(e):e&&(e.stack,i&&!i.errored&&(i.errored=e),n&&!n.errored&&(n.errored=e),r?ht.nextTick(Ho,t,e):Ho(t,e))}function Em(t,e){if(typeof t._construct!="function")return;let r=t._readableState,n=t._writableState;r&&(r.constructed=!1),n&&(n.constructed=!1),t.once(Vo,e),!(t.listenerCount(Vo)>1)&&ht.nextTick(Am,t)}function Am(t){let e=!1;function r(n){if(e){zo(t,n??new pm);return}e=!0;let i=t._readableState,s=t._writableState,o=s||i;i&&(i.constructed=!0),s&&(s.constructed=!0),o.destroyed?t.emit(ff,n):n?zo(t,n,!0):ht.nextTick(Im,t)}try{t._construct(n=>{ht.nextTick(r,n)})}catch(n){ht.nextTick(r,n)}}function Im(t){t.emit(Vo)}function lf(t){return t?.setHeader&&typeof t.abort=="function"}function pf(t){t.emit("close")}function xm(t,e){t.emit("error",e),ht.nextTick(pf,t)}function Tm(t,e){!t||bm(t)||(!e&&!mm(t)&&(e=new gm),_m(t)?(t.socket=null,t.destroy(e)):lf(t)?t.abort():lf(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?ht.nextTick(xm,t,e):ht.nextTick(pf,t),t.destroyed||(t[ym]=!0))}gf.exports={construct:Em,destroyer:Tm,destroy:wm,undestroy:Sm,errorOrDestroy:zo}});var _i=H((mT,bf)=>{"use strict";x();P();T();var{ArrayIsArray:Pm,ObjectSetPrototypeOf:yf}=Ee(),{EventEmitter:bi}=(jt(),ge(Ft));function mi(t){bi.call(this,t)}yf(mi.prototype,bi.prototype);yf(mi,bi);mi.prototype.pipe=function(t,e){let r=this;function n(d){t.writable&&t.write(d)===!1&&r.pause&&r.pause()}r.on("data",n);function i(){r.readable&&r.resume&&r.resume()}t.on("drain",i),!t._isStdio&&(!e||e.end!==!1)&&(r.on("end",o),r.on("close",u));let s=!1;function o(){s||(s=!0,t.end())}function u(){s||(s=!0,typeof t.destroy=="function"&&t.destroy())}function c(d){f(),bi.listenerCount(this,"error")===0&&this.emit("error",d)}Go(r,"error",c),Go(t,"error",c);function f(){r.removeListener("data",n),t.removeListener("drain",i),r.removeListener("end",o),r.removeListener("close",u),r.removeListener("error",c),t.removeListener("error",c),r.removeListener("end",f),r.removeListener("close",f),t.removeListener("close",f)}return r.on("end",f),r.on("close",f),t.on("close",f),t.emit("pipe",r),t};function Go(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Pm(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}bf.exports={Stream:mi,prependListener:Go}});var un=H((IT,wi)=>{"use strict";x();P();T();var{SymbolDispose:Om}=Ee(),{AbortError:mf,codes:Rm}=De(),{isNodeStream:_f,isWebStream:km,kControllerErrorFunction:Cm}=dt(),Mm=At(),{ERR_INVALID_ARG_TYPE:wf}=Rm,Qo,Bm=(t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new wf(e,"AbortSignal",t)};wi.exports.addAbortSignal=function(e,r){if(Bm(e,"signal"),!_f(r)&&!km(r))throw new wf("stream",["ReadableStream","WritableStream","Stream"],r);return wi.exports.addAbortSignalNoValidate(e,r)};wi.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let r=_f(e)?()=>{e.destroy(new mf(void 0,{cause:t.reason}))}:()=>{e[Cm](new mf(void 0,{cause:t.reason}))};if(t.aborted)r();else{Qo=Qo||We().addAbortListener;let n=Qo(t,r);Mm(e,n[Om])}return e}});var Ef=H((MT,Sf)=>{"use strict";x();P();T();var{StringPrototypeSlice:vf,SymbolIterator:Nm,TypedArrayPrototypeSet:vi,Uint8Array:Lm}=Ee(),{Buffer:Ko}=(Re(),ge(Ne)),{inspect:qm}=We();Sf.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,n=""+r.data;for(;(r=r.next)!==null;)n+=e+r.data;return n}concat(e){if(this.length===0)return Ko.alloc(0);let r=Ko.allocUnsafe(e>>>0),n=this.head,i=0;for(;n;)vi(r,n.data,i),i+=n.data.length,n=n.next;return r}consume(e,r){let n=this.head.data;if(e<n.length){let i=n.slice(0,e);return this.head.data=n.slice(e),i}return e===n.length?this.shift():r?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[Nm](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let r="",n=this.head,i=0;do{let s=n.data;if(e>s.length)r+=s,e-=s.length;else{e===s.length?(r+=s,++i,n.next?this.head=n.next:this.head=this.tail=null):(r+=vf(s,0,e),this.head=n,n.data=vf(s,e));break}++i}while((n=n.next)!==null);return this.length-=i,r}_getBuffer(e){let r=Ko.allocUnsafe(e),n=e,i=this.head,s=0;do{let o=i.data;if(e>o.length)vi(r,o,n-e),e-=o.length;else{e===o.length?(vi(r,o,n-e),++s,i.next?this.head=i.next:this.head=this.tail=null):(vi(r,new Lm(o.buffer,o.byteOffset,e),n-e),this.head=i,i.data=o.slice(e));break}++s}while((i=i.next)!==null);return this.length-=s,r}[Symbol.for("nodejs.util.inspect.custom")](e,r){return qm(this,{...r,depth:0,customInspect:!1})}}});var ln=H((FT,Tf)=>{"use strict";x();P();T();var{MathFloor:Dm,NumberIsInteger:Um}=Ee(),{validateInteger:Fm}=kr(),{ERR_INVALID_ARG_VALUE:jm}=De().codes,Af=16*1024,If=16;function $m(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function xf(t){return t?If:Af}function Wm(t,e){Fm(e,"value",0),t?If=e:Af=e}function Vm(t,e,r,n){let i=$m(e,n,r);if(i!=null){if(!Um(i)||i<0){let s=n?`options.${r}`:"options.highWaterMark";throw new jm(s,i)}return Dm(i)}return xf(t.objectMode)}Tf.exports={getHighWaterMark:Vm,getDefaultHighWaterMark:xf,setDefaultHighWaterMark:Wm}});var Rf=H((Yo,Of)=>{x();P();T();var Si=(Re(),ge(Ne)),pt=Si.Buffer;function Pf(t,e){for(var r in t)e[r]=t[r]}pt.from&&pt.alloc&&pt.allocUnsafe&&pt.allocUnsafeSlow?Of.exports=Si:(Pf(Si,Yo),Yo.Buffer=cr);function cr(t,e,r){return pt(t,e,r)}cr.prototype=Object.create(pt.prototype);Pf(pt,cr);cr.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return pt(t,e,r)};cr.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=pt(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};cr.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return pt(t)};cr.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Si.SlowBuffer(t)}});var Mf=H(Cf=>{"use strict";x();P();T();var Xo=Rf().Buffer,kf=Xo.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 Hm(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 zm(t){var e=Hm(t);if(typeof e!="string"&&(Xo.isEncoding===kf||!kf(t)))throw new Error("Unknown encoding: "+t);return e||t}Cf.StringDecoder=cn;function cn(t){this.encoding=zm(t);var e;switch(this.encoding){case"utf16le":this.text=Xm,this.end=Zm,e=4;break;case"utf8":this.fillLast=Km,e=4;break;case"base64":this.text=e_,this.end=t_,e=3;break;default:this.write=r_,this.end=n_;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Xo.allocUnsafe(e)}cn.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||""};cn.prototype.end=Jm;cn.prototype.text=Ym;cn.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 Jo(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function Gm(t,e,r){var n=e.length-1;if(n<r)return 0;var i=Jo(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=Jo(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=Jo(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function Qm(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 Km(t){var e=this.lastTotal-this.lastNeed,r=Qm(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 Ym(t,e){var r=Gm(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}function Jm(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function Xm(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=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 Zm(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 e_(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 t_(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function r_(t){return t.toString(this.encoding)}function n_(t){return t&&t.length?this.write(t):""}});var Zo=H((sP,qf)=>{"use strict";x();P();T();var Bf=(Et(),ge(L)),{PromisePrototypeThen:i_,SymbolAsyncIterator:Nf,SymbolIterator:Lf}=Ee(),{Buffer:o_}=(Re(),ge(Ne)),{ERR_INVALID_ARG_TYPE:s_,ERR_STREAM_NULL_VALUES:a_}=De().codes;function u_(t,e,r){let n;if(typeof e=="string"||e instanceof o_)return new t({objectMode:!0,...r,read(){this.push(e),this.push(null)}});let i;if(e&&e[Nf])i=!0,n=e[Nf]();else if(e&&e[Lf])i=!1,n=e[Lf]();else throw new s_("iterable",["Iterable"],e);let s=new t({objectMode:!0,highWaterMark:1,...r}),o=!1;s._read=function(){o||(o=!0,c())},s._destroy=function(f,d){i_(u(f),()=>Bf.nextTick(d,f),h=>Bf.nextTick(d,h||f))};async function u(f){let d=f!=null,h=typeof n.throw=="function";if(d&&h){let{value:_,done:y}=await n.throw(f);if(await _,y)return}if(typeof n.return=="function"){let{value:_}=await n.return();await _}}async function c(){for(;;){try{let{value:f,done:d}=i?await n.next():n.next();if(d)s.push(null);else{let h=f&&typeof f.then=="function"?await f:f;if(h===null)throw o=!1,new a_;if(s.push(h))continue;o=!1}}catch(f){s.destroy(f)}break}}return s}qf.exports=u_});var dn=H((hP,td)=>{"use strict";x();P();T();var st=(Et(),ge(L)),{ArrayPrototypeIndexOf:l_,NumberIsInteger:c_,NumberIsNaN:f_,NumberParseInt:d_,ObjectDefineProperties:as,ObjectKeys:h_,ObjectSetPrototypeOf:Ff,Promise:jf,SafeSet:p_,SymbolAsyncDispose:g_,SymbolAsyncIterator:y_,Symbol:b_}=Ee();td.exports=le;le.ReadableState=xi;var{EventEmitter:m_}=(jt(),ge(Ft)),{Stream:Wt,prependListener:__}=_i(),{Buffer:es}=(Re(),ge(Ne)),{addAbortSignal:w_}=un(),$f=At(),he=We().debuglog("stream",t=>{he=t}),v_=Ef(),Nr=lr(),{getHighWaterMark:S_,getDefaultHighWaterMark:E_}=ln(),{aggregateTwoErrors:Df,codes:{ERR_INVALID_ARG_TYPE:A_,ERR_METHOD_NOT_IMPLEMENTED:I_,ERR_OUT_OF_RANGE:x_,ERR_STREAM_PUSH_AFTER_EOF:T_,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:P_},AbortError:O_}=De(),{validateObject:R_}=kr(),fr=b_("kPaused"),{StringDecoder:Wf}=Mf(),k_=Zo();Ff(le.prototype,Wt.prototype);Ff(le,Wt);var ts=()=>{},{errorOrDestroy:Mr}=Nr,Br=1,C_=2,Vf=4,fn=8,Hf=16,Ei=32,Ai=64,zf=128,M_=256,B_=512,N_=1024,os=2048,ss=4096,L_=8192,q_=16384,D_=32768,Gf=65536,U_=1<<17,F_=1<<18;function ke(t){return{enumerable:!1,get(){return(this.state&t)!==0},set(e){e?this.state|=t:this.state&=~t}}}as(xi.prototype,{objectMode:ke(Br),ended:ke(C_),endEmitted:ke(Vf),reading:ke(fn),constructed:ke(Hf),sync:ke(Ei),needReadable:ke(Ai),emittedReadable:ke(zf),readableListening:ke(M_),resumeScheduled:ke(B_),errorEmitted:ke(N_),emitClose:ke(os),autoDestroy:ke(ss),destroyed:ke(L_),closed:ke(q_),closeEmitted:ke(D_),multiAwaitDrain:ke(Gf),readingMore:ke(U_),dataEmitted:ke(F_)});function xi(t,e,r){typeof r!="boolean"&&(r=e instanceof gt()),this.state=os|ss|Hf|Ei,t&&t.objectMode&&(this.state|=Br),r&&t&&t.readableObjectMode&&(this.state|=Br),this.highWaterMark=t?S_(this,t,"readableHighWaterMark",r):E_(!1),this.buffer=new v_,this.length=0,this.pipes=[],this.flowing=null,this[fr]=null,t&&t.emitClose===!1&&(this.state&=~os),t&&t.autoDestroy===!1&&(this.state&=~ss),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new Wf(t.encoding),this.encoding=t.encoding)}function le(t){if(!(this instanceof le))return new le(t);let e=this instanceof gt();this._readableState=new xi(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&&w_(t.signal,this)),Wt.call(this,t),Nr.construct(this,()=>{this._readableState.needReadable&&Ii(this,this._readableState)})}le.prototype.destroy=Nr.destroy;le.prototype._undestroy=Nr.undestroy;le.prototype._destroy=function(t,e){e(t)};le.prototype[m_.captureRejectionSymbol]=function(t){this.destroy(t)};le.prototype[g_]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new O_,this.destroy(t)),new jf((e,r)=>$f(this,n=>n&&n!==t?r(n):e(null)))};le.prototype.push=function(t,e){return Qf(this,t,e,!1)};le.prototype.unshift=function(t,e){return Qf(this,t,e,!0)};function Qf(t,e,r,n){he("readableAddChunk",e);let i=t._readableState,s;if((i.state&Br)===0&&(typeof e=="string"?(r=r||i.defaultEncoding,i.encoding!==r&&(n&&i.encoding?e=es.from(e,r).toString(i.encoding):(e=es.from(e,r),r=""))):e instanceof es?r="":Wt._isUint8Array(e)?(e=Wt._uint8ArrayToBuffer(e),r=""):e!=null&&(s=new A_("chunk",["string","Buffer","Uint8Array"],e))),s)Mr(t,s);else if(e===null)i.state&=~fn,W_(t,i);else if((i.state&Br)!==0||e&&e.length>0)if(n)if((i.state&Vf)!==0)Mr(t,new P_);else{if(i.destroyed||i.errored)return!1;rs(t,i,e,!0)}else if(i.ended)Mr(t,new T_);else{if(i.destroyed||i.errored)return!1;i.state&=~fn,i.decoder&&!r?(e=i.decoder.write(e),i.objectMode||e.length!==0?rs(t,i,e,!1):Ii(t,i)):rs(t,i,e,!1)}else n||(i.state&=~fn,Ii(t,i));return!i.ended&&(i.length<i.highWaterMark||i.length===0)}function rs(t,e,r,n){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?((e.state&Gf)!==0?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),(e.state&Ai)!==0&&Ti(t)),Ii(t,e)}le.prototype.isPaused=function(){let t=this._readableState;return t[fr]===!0||t.flowing===!1};le.prototype.setEncoding=function(t){let e=new Wf(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,n="";for(let i of r)n+=e.write(i);return r.clear(),n!==""&&r.push(n),this._readableState.length=n.length,this};var j_=1073741824;function $_(t){if(t>j_)throw new x_("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}function Uf(t,e){return t<=0||e.length===0&&e.ended?0:(e.state&Br)!==0?1:f_(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}le.prototype.read=function(t){he("read",t),t===void 0?t=NaN:c_(t)||(t=d_(t,10));let e=this._readableState,r=t;if(t>e.highWaterMark&&(e.highWaterMark=$_(t)),t!==0&&(e.state&=~zf),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return he("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?ns(this):Ti(this),null;if(t=Uf(t,e),t===0&&e.ended)return e.length===0&&ns(this),null;let n=(e.state&Ai)!==0;if(he("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,he("length less than watermark",n)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)n=!1,he("reading, ended or constructing",n);else if(n){he("do read"),e.state|=fn|Ei,e.length===0&&(e.state|=Ai);try{this._read(e.highWaterMark)}catch(s){Mr(this,s)}e.state&=~Ei,e.reading||(t=Uf(r,e))}let i;return t>0?i=Zf(t,e):i=null,i===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&&ns(this)),i!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",i)),i};function W_(t,e){if(he("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?Ti(t):(e.needReadable=!1,e.emittedReadable=!0,Kf(t))}}function Ti(t){let e=t._readableState;he("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(he("emitReadable",e.flowing),e.emittedReadable=!0,st.nextTick(Kf,t))}function Kf(t){let e=t._readableState;he("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,Jf(t)}function Ii(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,st.nextTick(V_,t,e))}function V_(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let r=e.length;if(he("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}le.prototype._read=function(t){throw new I_("_read()")};le.prototype.pipe=function(t,e){let r=this,n=this._readableState;n.pipes.length===1&&(n.multiAwaitDrain||(n.multiAwaitDrain=!0,n.awaitDrainWriters=new p_(n.awaitDrainWriters?[n.awaitDrainWriters]:[]))),n.pipes.push(t),he("pipe count=%d opts=%j",n.pipes.length,e);let s=(!e||e.end!==!1)&&t!==st.stdout&&t!==st.stderr?u:b;n.endEmitted?st.nextTick(s):r.once("end",s),t.on("unpipe",o);function o(m,w){he("onunpipe"),m===r&&w&&w.hasUnpiped===!1&&(w.hasUnpiped=!0,d())}function u(){he("onend"),t.end()}let c,f=!1;function d(){he("cleanup"),t.removeListener("close",I),t.removeListener("finish",S),c&&t.removeListener("drain",c),t.removeListener("error",y),t.removeListener("unpipe",o),r.removeListener("end",u),r.removeListener("end",b),r.removeListener("data",_),f=!0,c&&n.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&c()}function h(){f||(n.pipes.length===1&&n.pipes[0]===t?(he("false write response, pause",0),n.awaitDrainWriters=t,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(t)&&(he("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(t)),r.pause()),c||(c=H_(r,t),t.on("drain",c))}r.on("data",_);function _(m){he("ondata");let w=t.write(m);he("dest.write",w),w===!1&&h()}function y(m){if(he("onerror",m),b(),t.removeListener("error",y),t.listenerCount("error")===0){let w=t._writableState||t._readableState;w&&!w.errorEmitted?Mr(t,m):t.emit("error",m)}}__(t,"error",y);function I(){t.removeListener("finish",S),b()}t.once("close",I);function S(){he("onfinish"),t.removeListener("close",I),b()}t.once("finish",S);function b(){he("unpipe"),r.unpipe(t)}return t.emit("pipe",r),t.writableNeedDrain===!0?h():n.flowing||(he("pipe resume"),r.resume()),t};function H_(t,e){return function(){let n=t._readableState;n.awaitDrainWriters===e?(he("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(he("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(e)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()}}le.prototype.unpipe=function(t){let e=this._readableState,r={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let i=e.pipes;e.pipes=[],this.pause();for(let s=0;s<i.length;s++)i[s].emit("unpipe",this,{hasUnpiped:!1});return this}let n=l_(e.pipes,t);return n===-1?this:(e.pipes.splice(n,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,r),this)};le.prototype.on=function(t,e){let r=Wt.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,he("on readable",n.length,n.reading),n.length?Ti(this):n.reading||st.nextTick(z_,this)),r};le.prototype.addListener=le.prototype.on;le.prototype.removeListener=function(t,e){let r=Wt.prototype.removeListener.call(this,t,e);return t==="readable"&&st.nextTick(Yf,this),r};le.prototype.off=le.prototype.removeListener;le.prototype.removeAllListeners=function(t){let e=Wt.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&st.nextTick(Yf,this),e};function Yf(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[fr]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}function z_(t){he("readable nexttick read 0"),t.read(0)}le.prototype.resume=function(){let t=this._readableState;return t.flowing||(he("resume"),t.flowing=!t.readableListening,G_(this,t)),t[fr]=!1,this};function G_(t,e){e.resumeScheduled||(e.resumeScheduled=!0,st.nextTick(Q_,t,e))}function Q_(t,e){he("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Jf(t),e.flowing&&!e.reading&&t.read(0)}le.prototype.pause=function(){return he("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(he("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[fr]=!0,this};function Jf(t){let e=t._readableState;for(he("flow",e.flowing);e.flowing&&t.read()!==null;);}le.prototype.wrap=function(t){let e=!1;t.on("data",n=>{!this.push(n)&&t.pause&&(e=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",n=>{Mr(this,n)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let r=h_(t);for(let n=1;n<r.length;n++){let i=r[n];this[i]===void 0&&typeof t[i]=="function"&&(this[i]=t[i].bind(t))}return this};le.prototype[y_]=function(){return Xf(this)};le.prototype.iterator=function(t){return t!==void 0&&R_(t,"options"),Xf(this,t)};function Xf(t,e){typeof t.read!="function"&&(t=le.wrap(t,{objectMode:!0}));let r=K_(t,e);return r.stream=t,r}async function*K_(t,e){let r=ts;function n(o){this===t?(r(),r=ts):r=o}t.on("readable",n);let i,s=$f(t,{writable:!1},o=>{i=o?Df(i,o):null,r(),r=ts});try{for(;;){let o=t.destroyed?null:t.read();if(o!==null)yield o;else{if(i)throw i;if(i===null)return;await new jf(n)}}}catch(o){throw i=Df(i,o),i}finally{(i||e?.destroyOnReturn!==!1)&&(i===void 0||t._readableState.autoDestroy)?Nr.destroyer(t,null):(t.off("readable",n),s())}}as(le.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}}});as(xi.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[fr]!==!1},set(t){this[fr]=!!t}}});le._fromList=Zf;function Zf(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 ns(t){let e=t._readableState;he("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,st.nextTick(Y_,e,t))}function Y_(t,e){if(he("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)st.nextTick(J_,e);else if(t.autoDestroy){let r=e._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&e.destroy()}}}function J_(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}le.from=function(t,e){return k_(le,t,e)};var is;function ed(){return is===void 0&&(is={}),is}le.fromWeb=function(t,e){return ed().newStreamReadableFromReadableStream(t,e)};le.toWeb=function(t,e){return ed().newReadableStreamFromStreamReadable(t,e)};le.wrap=function(t,e){var r,n;return new le({objectMode:(r=(n=t.readableObjectMode)!==null&&n!==void 0?n:t.objectMode)!==null&&r!==void 0?r:!0,...e,destroy(i,s){Nr.destroyer(t,i),s(i)}}).wrap(t)}});var Ci=H((wP,hd)=>{"use strict";x();P();T();var dr=(Et(),ge(L)),{ArrayPrototypeSlice:id,Error:X_,FunctionPrototypeSymbolHasInstance:od,ObjectDefineProperty:sd,ObjectDefineProperties:Z_,ObjectSetPrototypeOf:ad,StringPrototypeToLowerCase:ew,Symbol:tw,SymbolHasInstance:rw}=Ee();hd.exports=Ie;Ie.WritableState=gn;var{EventEmitter:nw}=(jt(),ge(Ft)),hn=_i().Stream,{Buffer:Pi}=(Re(),ge(Ne)),ki=lr(),{addAbortSignal:iw}=un(),{getHighWaterMark:ow,getDefaultHighWaterMark:sw}=ln(),{ERR_INVALID_ARG_TYPE:aw,ERR_METHOD_NOT_IMPLEMENTED:uw,ERR_MULTIPLE_CALLBACK:ud,ERR_STREAM_CANNOT_PIPE:lw,ERR_STREAM_DESTROYED:pn,ERR_STREAM_ALREADY_FINISHED:cw,ERR_STREAM_NULL_VALUES:fw,ERR_STREAM_WRITE_AFTER_END:dw,ERR_UNKNOWN_ENCODING:ld}=De().codes,{errorOrDestroy:Lr}=ki;ad(Ie.prototype,hn.prototype);ad(Ie,hn);function cs(){}var qr=tw("kOnFinished");function gn(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?ow(this,t,"writableHighWaterMark",r):sw(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!!(t&&t.decodeStrings===!1);this.decodeStrings=!n,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=pw.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Ri(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[qr]=[]}function Ri(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}gn.prototype.getBuffer=function(){return id(this.buffered,this.bufferedIndex)};sd(gn.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function Ie(t){let e=this instanceof gt();if(!e&&!od(Ie,this))return new Ie(t);this._writableState=new gn(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&&iw(t.signal,this)),hn.call(this,t),ki.construct(this,()=>{let r=this._writableState;r.writing||ds(this,r),hs(this,r)})}sd(Ie,rw,{__proto__:null,value:function(t){return od(this,t)?!0:this!==Ie?!1:t&&t._writableState instanceof gn}});Ie.prototype.pipe=function(){Lr(this,new lw)};function cd(t,e,r,n){let i=t._writableState;if(typeof r=="function")n=r,r=i.defaultEncoding;else{if(!r)r=i.defaultEncoding;else if(r!=="buffer"&&!Pi.isEncoding(r))throw new ld(r);typeof n!="function"&&(n=cs)}if(e===null)throw new fw;if(!i.objectMode)if(typeof e=="string")i.decodeStrings!==!1&&(e=Pi.from(e,r),r="buffer");else if(e instanceof Pi)r="buffer";else if(hn._isUint8Array(e))e=hn._uint8ArrayToBuffer(e),r="buffer";else throw new aw("chunk",["string","Buffer","Uint8Array"],e);let s;return i.ending?s=new dw:i.destroyed&&(s=new pn("write")),s?(dr.nextTick(n,s),Lr(t,s,!0),s):(i.pendingcb++,hw(t,i,e,r,n))}Ie.prototype.write=function(t,e,r){return cd(this,t,e,r)===!0};Ie.prototype.cork=function(){this._writableState.corked++};Ie.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||ds(this,t))};Ie.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=ew(e)),!Pi.isEncoding(e))throw new ld(e);return this._writableState.defaultEncoding=e,this};function hw(t,e,r,n,i){let s=e.objectMode?1:r.length;e.length+=s;let o=e.length<e.highWaterMark;return o||(e.needDrain=!0),e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:r,encoding:n,callback:i}),e.allBuffers&&n!=="buffer"&&(e.allBuffers=!1),e.allNoop&&i!==cs&&(e.allNoop=!1)):(e.writelen=s,e.writecb=i,e.writing=!0,e.sync=!0,t._write(r,n,e.onwrite),e.sync=!1),o&&!e.errored&&!e.destroyed}function rd(t,e,r,n,i,s,o){e.writelen=n,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new pn("write")):r?t._writev(i,e.onwrite):t._write(i,s,e.onwrite),e.sync=!1}function nd(t,e,r,n){--e.pendingcb,n(r),fs(e),Lr(t,r)}function pw(t,e){let r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function"){Lr(t,new ud);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),n?dr.nextTick(nd,t,r,e,i):nd(t,r,e,i)):(r.buffered.length>r.bufferedIndex&&ds(t,r),n?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===i?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:i,stream:t,state:r},dr.nextTick(gw,r.afterWriteTickInfo)):fd(t,r,1,i))}function gw({stream:t,state:e,count:r,cb:n}){return e.afterWriteTickInfo=null,fd(t,e,r,n)}function fd(t,e,r,n){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));r-- >0;)e.pendingcb--,n();e.destroyed&&fs(e),hs(t,e)}function fs(t){if(t.writing)return;for(let i=t.bufferedIndex;i<t.buffered.length;++i){var e;let{chunk:s,callback:o}=t.buffered[i],u=t.objectMode?1:s.length;t.length-=u,o((e=t.errored)!==null&&e!==void 0?e:new pn("write"))}let r=t[qr].splice(0);for(let i=0;i<r.length;i++){var n;r[i]((n=t.errored)!==null&&n!==void 0?n:new pn("end"))}Ri(t)}function ds(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:r,bufferedIndex:n,objectMode:i}=e,s=r.length-n;if(!s)return;let o=n;if(e.bufferProcessing=!0,s>1&&t._writev){e.pendingcb-=s-1;let u=e.allNoop?cs:f=>{for(let d=o;d<r.length;++d)r[d].callback(f)},c=e.allNoop&&o===0?r:id(r,o);c.allBuffers=e.allBuffers,rd(t,e,!0,e.length,c,"",u),Ri(e)}else{do{let{chunk:u,encoding:c,callback:f}=r[o];r[o++]=null;let d=i?1:u.length;rd(t,e,!1,d,u,c,f)}while(o<r.length&&!e.writing);o===r.length?Ri(e):o>256?(r.splice(0,o),e.bufferedIndex=0):e.bufferedIndex=o}e.bufferProcessing=!1}Ie.prototype._write=function(t,e,r){if(this._writev)this._writev([{chunk:t,encoding:e}],r);else throw new uw("_write()")};Ie.prototype._writev=null;Ie.prototype.end=function(t,e,r){let n=this._writableState;typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null);let i;if(t!=null){let s=cd(this,t,e);s instanceof X_&&(i=s)}return n.corked&&(n.corked=1,this.uncork()),i||(!n.errored&&!n.ending?(n.ending=!0,hs(this,n,!0),n.ended=!0):n.finished?i=new cw("end"):n.destroyed&&(i=new pn("end"))),typeof r=="function"&&(i||n.finished?dr.nextTick(r,i):n[qr].push(r)),this};function Oi(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 yw(t,e){let r=!1;function n(i){if(r){Lr(t,i??ud());return}if(r=!0,e.pendingcb--,i){let s=e[qr].splice(0);for(let o=0;o<s.length;o++)s[o](i);Lr(t,i,e.sync)}else Oi(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,dr.nextTick(ls,t,e))}e.sync=!0,e.pendingcb++;try{t._final(n)}catch(i){n(i)}e.sync=!1}function bw(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,yw(t,e)):(e.prefinished=!0,t.emit("prefinish")))}function hs(t,e,r){Oi(e)&&(bw(t,e),e.pendingcb===0&&(r?(e.pendingcb++,dr.nextTick((n,i)=>{Oi(i)?ls(n,i):i.pendingcb--},t,e)):Oi(e)&&(e.pendingcb++,ls(t,e))))}function ls(t,e){e.pendingcb--,e.finished=!0;let r=e[qr].splice(0);for(let n=0;n<r.length;n++)r[n]();if(t.emit("finish"),e.autoDestroy){let n=t._readableState;(!n||n.autoDestroy&&(n.endEmitted||n.readable===!1))&&t.destroy()}}Z_(Ie.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 mw=ki.destroy;Ie.prototype.destroy=function(t,e){let r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[qr].length)&&dr.nextTick(fs,r),mw.call(this,t,e),this};Ie.prototype._undestroy=ki.undestroy;Ie.prototype._destroy=function(t,e){e(t)};Ie.prototype[nw.captureRejectionSymbol]=function(t){this.destroy(t)};var us;function dd(){return us===void 0&&(us={}),us}Ie.fromWeb=function(t,e){return dd().newStreamWritableFromWritableStream(t,e)};Ie.toWeb=function(t){return dd().newWritableStreamFromStreamWritable(t)}});var Pd=H((TP,Td)=>{x();P();T();var ps=(Et(),ge(L)),_w=(Re(),ge(Ne)),{isReadable:ww,isWritable:vw,isIterable:pd,isNodeStream:Sw,isReadableNodeStream:gd,isWritableNodeStream:yd,isDuplexNodeStream:Ew,isReadableStream:bd,isWritableStream:md}=dt(),_d=At(),{AbortError:Id,codes:{ERR_INVALID_ARG_TYPE:Aw,ERR_INVALID_RETURN_VALUE:wd}}=De(),{destroyer:Ur}=lr(),Iw=gt(),xd=dn(),xw=Ci(),{createDeferredPromise:vd}=We(),Sd=Zo(),Ed=globalThis.Blob||_w.Blob,Tw=typeof Ed<"u"?function(e){return e instanceof Ed}:function(e){return!1},Pw=globalThis.AbortController||Or().AbortController,{FunctionPrototypeCall:Ad}=Ee(),Vt=class extends Iw{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)}};Td.exports=function t(e,r){if(Ew(e))return e;if(gd(e))return Dr({readable:e});if(yd(e))return Dr({writable:e});if(Sw(e))return Dr({writable:!1,readable:!1});if(bd(e))return Dr({readable:xd.fromWeb(e)});if(md(e))return Dr({writable:xw.fromWeb(e)});if(typeof e=="function"){let{value:i,write:s,final:o,destroy:u}=Ow(e);if(pd(i))return Sd(Vt,i,{objectMode:!0,write:s,final:o,destroy:u});let c=i?.then;if(typeof c=="function"){let f,d=Ad(c,i,h=>{if(h!=null)throw new wd("nully","body",h)},h=>{Ur(f,h)});return f=new Vt({objectMode:!0,readable:!1,write:s,final(h){o(async()=>{try{await d,ps.nextTick(h,null)}catch(_){ps.nextTick(h,_)}})},destroy:u})}throw new wd("Iterable, AsyncIterable or AsyncFunction",r,i)}if(Tw(e))return t(e.arrayBuffer());if(pd(e))return Sd(Vt,e,{objectMode:!0,writable:!1});if(bd(e?.readable)&&md(e?.writable))return Vt.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let i=e!=null&&e.readable?gd(e?.readable)?e?.readable:t(e.readable):void 0,s=e!=null&&e.writable?yd(e?.writable)?e?.writable:t(e.writable):void 0;return Dr({readable:i,writable:s})}let n=e?.then;if(typeof n=="function"){let i;return Ad(n,e,s=>{s!=null&&i.push(s),i.push(null)},s=>{Ur(i,s)}),i=new Vt({objectMode:!0,writable:!1,read(){}})}throw new Aw(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)};function Ow(t){let{promise:e,resolve:r}=vd(),n=new Pw,i=n.signal;return{value:t((async function*(){for(;;){let o=e;e=null;let{chunk:u,done:c,cb:f}=await o;if(ps.nextTick(f),c)return;if(i.aborted)throw new Id(void 0,{cause:i.reason});({promise:e,resolve:r}=vd()),yield u}})(),{signal:i}),write(o,u,c){let f=r;r=null,f({chunk:o,done:!1,cb:c})},final(o){let u=r;r=null,u({done:!0,cb:o})},destroy(o,u){n.abort(),u(o)}}}function Dr(t){let e=t.readable&&typeof t.readable.read!="function"?xd.wrap(t.readable):t.readable,r=t.writable,n=!!ww(e),i=!!vw(r),s,o,u,c,f;function d(h){let _=c;c=null,_?_(h):h&&f.destroy(h)}return f=new Vt({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:n,writable:i}),i&&(_d(r,h=>{i=!1,h&&Ur(e,h),d(h)}),f._write=function(h,_,y){r.write(h,_)?y():s=y},f._final=function(h){r.end(),o=h},r.on("drain",function(){if(s){let h=s;s=null,h()}}),r.on("finish",function(){if(o){let h=o;o=null,h()}})),n&&(_d(e,h=>{n=!1,h&&Ur(e,h),d(h)}),e.on("readable",function(){if(u){let h=u;u=null,h()}}),e.on("end",function(){f.push(null)}),f._read=function(){for(;;){let h=e.read();if(h===null){u=f._read;return}if(!f.push(h))return}}),f._destroy=function(h,_){!h&&c!==null&&(h=new Id),u=null,s=null,o=null,c===null?_(h):(c=_,Ur(r,h),Ur(e,h))},f}});var gt=H((BP,kd)=>{"use strict";x();P();T();var{ObjectDefineProperties:Rw,ObjectGetOwnPropertyDescriptor:It,ObjectKeys:kw,ObjectSetPrototypeOf:Od}=Ee();kd.exports=at;var bs=dn(),Ze=Ci();Od(at.prototype,bs.prototype);Od(at,bs);{let t=kw(Ze.prototype);for(let e=0;e<t.length;e++){let r=t[e];at.prototype[r]||(at.prototype[r]=Ze.prototype[r])}}function at(t){if(!(this instanceof at))return new at(t);bs.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}Rw(at.prototype,{writable:{__proto__:null,...It(Ze.prototype,"writable")},writableHighWaterMark:{__proto__:null,...It(Ze.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...It(Ze.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...It(Ze.prototype,"writableBuffer")},writableLength:{__proto__:null,...It(Ze.prototype,"writableLength")},writableFinished:{__proto__:null,...It(Ze.prototype,"writableFinished")},writableCorked:{__proto__:null,...It(Ze.prototype,"writableCorked")},writableEnded:{__proto__:null,...It(Ze.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...It(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 gs;function Rd(){return gs===void 0&&(gs={}),gs}at.fromWeb=function(t,e){return Rd().newStreamDuplexFromReadableWritablePair(t,e)};at.toWeb=function(t){return Rd().newReadableWritablePairFromDuplex(t)};var ys;at.from=function(t){return ys||(ys=Pd()),ys(t,"body")}});var ws=H((jP,Md)=>{"use strict";x();P();T();var{ObjectSetPrototypeOf:Cd,Symbol:Cw}=Ee();Md.exports=xt;var{ERR_METHOD_NOT_IMPLEMENTED:Mw}=De().codes,_s=gt(),{getHighWaterMark:Bw}=ln();Cd(xt.prototype,_s.prototype);Cd(xt,_s);var yn=Cw("kCallback");function xt(t){if(!(this instanceof xt))return new xt(t);let e=t?Bw(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),_s.call(this,t),this._readableState.sync=!1,this[yn]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",Nw)}function ms(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 Nw(){this._final!==ms&&ms.call(this)}xt.prototype._final=ms;xt.prototype._transform=function(t,e,r){throw new Mw("_transform()")};xt.prototype._write=function(t,e,r){let n=this._readableState,i=this._writableState,s=n.length;this._transform(t,e,(o,u)=>{if(o){r(o);return}u!=null&&this.push(u),i.ended||s===n.length||n.length<n.highWaterMark?r():this[yn]=r})};xt.prototype._read=function(){if(this[yn]){let t=this[yn];this[yn]=null,t()}}});var Ss=H((QP,Nd)=>{"use strict";x();P();T();var{ObjectSetPrototypeOf:Bd}=Ee();Nd.exports=Fr;var vs=ws();Bd(Fr.prototype,vs.prototype);Bd(Fr,vs);function Fr(t){if(!(this instanceof Fr))return new Fr(t);vs.call(this,t)}Fr.prototype._transform=function(t,e,r){r(null,t)}});var Li=H((tO,Fd)=>{x();P();T();var bn=(Et(),ge(L)),{ArrayIsArray:Lw,Promise:qw,SymbolAsyncIterator:Dw,SymbolDispose:Uw}=Ee(),Ni=At(),{once:Fw}=We(),jw=lr(),Ld=gt(),{aggregateTwoErrors:$w,codes:{ERR_INVALID_ARG_TYPE:ks,ERR_INVALID_RETURN_VALUE:Es,ERR_MISSING_ARGS:Ww,ERR_STREAM_DESTROYED:Vw,ERR_STREAM_PREMATURE_CLOSE:Hw},AbortError:zw}=De(),{validateFunction:Gw,validateAbortSignal:Qw}=kr(),{isIterable:hr,isReadable:As,isReadableNodeStream:Bi,isNodeStream:qd,isTransformStream:jr,isWebStream:Kw,isReadableStream:Is,isReadableFinished:Yw}=dt(),Jw=globalThis.AbortController||Or().AbortController,xs,Ts,Ps;function Dd(t,e,r){let n=!1;t.on("close",()=>{n=!0});let i=Ni(t,{readable:e,writable:r},s=>{n=!s});return{destroy:s=>{n||(n=!0,jw.destroyer(t,s||new Vw("pipe")))},cleanup:i}}function Xw(t){return Gw(t[t.length-1],"streams[stream.length - 1]"),t.pop()}function Os(t){if(hr(t))return t;if(Bi(t))return Zw(t);throw new ks("val",["Readable","Iterable","AsyncIterable"],t)}async function*Zw(t){Ts||(Ts=dn()),yield*Ts.prototype[Dw].call(t)}async function Mi(t,e,r,{end:n}){let i,s=null,o=f=>{if(f&&(i=f),s){let d=s;s=null,d()}},u=()=>new qw((f,d)=>{i?d(i):s=()=>{i?d(i):f()}});e.on("drain",o);let c=Ni(e,{readable:!1},o);try{e.writableNeedDrain&&await u();for await(let f of t)e.write(f)||await u();n&&(e.end(),await u()),r()}catch(f){r(i!==f?$w(i,f):f)}finally{c(),e.off("drain",o)}}async function Rs(t,e,r,{end:n}){jr(e)&&(e=e.writable);let i=e.getWriter();try{for await(let s of t)await i.ready,i.write(s).catch(()=>{});await i.ready,n&&await i.close(),r()}catch(s){try{await i.abort(s),r(s)}catch(o){r(o)}}}function ev(...t){return Ud(t,Fw(Xw(t)))}function Ud(t,e,r){if(t.length===1&&Lw(t[0])&&(t=t[0]),t.length<2)throw new Ww("streams");let n=new Jw,i=n.signal,s=r?.signal,o=[];Qw(s,"options.signal");function u(){I(new zw)}Ps=Ps||We().addAbortListener;let c;s&&(c=Ps(s,u));let f,d,h=[],_=0;function y(R){I(R,--_===0)}function I(R,A){var g;if(R&&(!f||f.code==="ERR_STREAM_PREMATURE_CLOSE")&&(f=R),!(!f&&!A)){for(;h.length;)h.shift()(f);(g=c)===null||g===void 0||g[Uw](),n.abort(),A&&(f||o.forEach(O=>O()),bn.nextTick(e,f,d))}}let S;for(let R=0;R<t.length;R++){let A=t[R],g=R<t.length-1,O=R>0,v=g||r?.end!==!1,B=R===t.length-1;if(qd(A)){let D=function(q){q&&q.name!=="AbortError"&&q.code!=="ERR_STREAM_PREMATURE_CLOSE"&&y(q)};var w=D;if(v){let{destroy:q,cleanup:K}=Dd(A,g,O);h.push(q),As(A)&&B&&o.push(K)}A.on("error",D),As(A)&&B&&o.push(()=>{A.removeListener("error",D)})}if(R===0)if(typeof A=="function"){if(S=A({signal:i}),!hr(S))throw new Es("Iterable, AsyncIterable or Stream","source",S)}else hr(A)||Bi(A)||jr(A)?S=A:S=Ld.from(A);else if(typeof A=="function"){if(jr(S)){var b;S=Os((b=S)===null||b===void 0?void 0:b.readable)}else S=Os(S);if(S=A(S,{signal:i}),g){if(!hr(S,!0))throw new Es("AsyncIterable",`transform[${R-1}]`,S)}else{var m;xs||(xs=Ss());let D=new xs({objectMode:!0}),q=(m=S)===null||m===void 0?void 0:m.then;if(typeof q=="function")_++,q.call(S,$=>{d=$,$!=null&&D.write($),v&&D.end(),bn.nextTick(y)},$=>{D.destroy($),bn.nextTick(y,$)});else if(hr(S,!0))_++,Mi(S,D,y,{end:v});else if(Is(S)||jr(S)){let $=S.readable||S;_++,Mi($,D,y,{end:v})}else throw new Es("AsyncIterable or Promise","destination",S);S=D;let{destroy:K,cleanup:U}=Dd(S,!1,!0);h.push(K),B&&o.push(U)}}else if(qd(A)){if(Bi(S)){_+=2;let D=tv(S,A,y,{end:v});As(A)&&B&&o.push(D)}else if(jr(S)||Is(S)){let D=S.readable||S;_++,Mi(D,A,y,{end:v})}else if(hr(S))_++,Mi(S,A,y,{end:v});else throw new ks("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],S);S=A}else if(Kw(A)){if(Bi(S))_++,Rs(Os(S),A,y,{end:v});else if(Is(S)||hr(S))_++,Rs(S,A,y,{end:v});else if(jr(S))_++,Rs(S.readable,A,y,{end:v});else throw new ks("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],S);S=A}else S=Ld.from(A)}return(i!=null&&i.aborted||s!=null&&s.aborted)&&bn.nextTick(u),S}function tv(t,e,r,{end:n}){let i=!1;if(e.on("close",()=>{i||r(new Hw)}),t.pipe(e,{end:!1}),n){let o=function(){i=!0,e.end()};var s=o;Yw(t)?bn.nextTick(o):t.once("end",o)}else r();return Ni(t,{readable:!0,writable:!1},o=>{let u=t._readableState;o&&o.code==="ERR_STREAM_PREMATURE_CLOSE"&&u&&u.ended&&!u.errored&&!u.errorEmitted?t.once("end",r).once("error",r):r(o)}),Ni(e,{readable:!1,writable:!0},r)}Fd.exports={pipelineImpl:Ud,pipeline:ev}});var Ms=H((uO,zd)=>{"use strict";x();P();T();var{pipeline:rv}=Li(),qi=gt(),{destroyer:nv}=lr(),{isNodeStream:Di,isReadable:jd,isWritable:$d,isWebStream:Cs,isTransformStream:pr,isWritableStream:Wd,isReadableStream:Vd}=dt(),{AbortError:iv,codes:{ERR_INVALID_ARG_VALUE:Hd,ERR_MISSING_ARGS:ov}}=De(),sv=At();zd.exports=function(...e){if(e.length===0)throw new ov("streams");if(e.length===1)return qi.from(e[0]);let r=[...e];if(typeof e[0]=="function"&&(e[0]=qi.from(e[0])),typeof e[e.length-1]=="function"){let y=e.length-1;e[y]=qi.from(e[y])}for(let y=0;y<e.length;++y)if(!(!Di(e[y])&&!Cs(e[y]))){if(y<e.length-1&&!(jd(e[y])||Vd(e[y])||pr(e[y])))throw new Hd(`streams[${y}]`,r[y],"must be readable");if(y>0&&!($d(e[y])||Wd(e[y])||pr(e[y])))throw new Hd(`streams[${y}]`,r[y],"must be writable")}let n,i,s,o,u;function c(y){let I=o;o=null,I?I(y):y?u.destroy(y):!_&&!h&&u.destroy()}let f=e[0],d=rv(e,c),h=!!($d(f)||Wd(f)||pr(f)),_=!!(jd(d)||Vd(d)||pr(d));if(u=new qi({writableObjectMode:!!(f!=null&&f.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:h,readable:_}),h){if(Di(f))u._write=function(I,S,b){f.write(I,S)?b():n=b},u._final=function(I){f.end(),i=I},f.on("drain",function(){if(n){let I=n;n=null,I()}});else if(Cs(f)){let S=(pr(f)?f.writable:f).getWriter();u._write=async function(b,m,w){try{await S.ready,S.write(b).catch(()=>{}),w()}catch(R){w(R)}},u._final=async function(b){try{await S.ready,S.close().catch(()=>{}),i=b}catch(m){b(m)}}}let y=pr(d)?d.readable:d;sv(y,()=>{if(i){let I=i;i=null,I()}})}if(_){if(Di(d))d.on("readable",function(){if(s){let y=s;s=null,y()}}),d.on("end",function(){u.push(null)}),u._read=function(){for(;;){let y=d.read();if(y===null){s=u._read;return}if(!u.push(y))return}};else if(Cs(d)){let I=(pr(d)?d.readable:d).getReader();u._read=async function(){for(;;)try{let{value:S,done:b}=await I.read();if(!u.push(S))return;if(b){u.push(null);return}}catch{return}}}}return u._destroy=function(y,I){!y&&o!==null&&(y=new iv),s=null,n=null,i=null,o===null?I(y):(o=I,Di(d)&&nv(d,y))},u}});var rh=H((gO,Ls)=>{"use strict";x();P();T();var av=globalThis.AbortController||Or().AbortController,{codes:{ERR_INVALID_ARG_VALUE:uv,ERR_INVALID_ARG_TYPE:mn,ERR_MISSING_ARGS:lv,ERR_OUT_OF_RANGE:cv},AbortError:yt}=De(),{validateAbortSignal:gr,validateInteger:Gd,validateObject:yr}=kr(),fv=Ee().Symbol("kWeak"),dv=Ee().Symbol("kResistStopPropagation"),{finished:hv}=At(),pv=Ms(),{addAbortSignalNoValidate:gv}=un(),{isWritable:yv,isNodeStream:bv}=dt(),{deprecate:mv}=We(),{ArrayPrototypePush:_v,Boolean:wv,MathFloor:Qd,Number:vv,NumberIsNaN:Sv,Promise:Kd,PromiseReject:Yd,PromiseResolve:Ev,PromisePrototypeThen:Jd,Symbol:Zd}=Ee(),Ui=Zd("kEmpty"),Xd=Zd("kEof");function Av(t,e){if(e!=null&&yr(e,"options"),e?.signal!=null&&gr(e.signal,"options.signal"),bv(t)&&!yv(t))throw new uv("stream",t,"must be writable");let r=pv(this,t);return e!=null&&e.signal&&gv(e.signal,r),r}function Fi(t,e){if(typeof t!="function")throw new mn("fn",["Function","AsyncFunction"],t);e!=null&&yr(e,"options"),e?.signal!=null&&gr(e.signal,"options.signal");let r=1;e?.concurrency!=null&&(r=Qd(e.concurrency));let n=r-1;return e?.highWaterMark!=null&&(n=Qd(e.highWaterMark)),Gd(r,"options.concurrency",1),Gd(n,"options.highWaterMark",0),n+=r,async function*(){let s=We().AbortSignalAny([e?.signal].filter(wv)),o=this,u=[],c={signal:s},f,d,h=!1,_=0;function y(){h=!0,I()}function I(){_-=1,S()}function S(){d&&!h&&_<r&&u.length<n&&(d(),d=null)}async function b(){try{for await(let m of o){if(h)return;if(s.aborted)throw new yt;try{if(m=t(m,c),m===Ui)continue;m=Ev(m)}catch(w){m=Yd(w)}_+=1,Jd(m,I,y),u.push(m),f&&(f(),f=null),!h&&(u.length>=n||_>=r)&&await new Kd(w=>{d=w})}u.push(Xd)}catch(m){let w=Yd(m);Jd(w,I,y),u.push(w)}finally{h=!0,f&&(f(),f=null)}}b();try{for(;;){for(;u.length>0;){let m=await u[0];if(m===Xd)return;if(s.aborted)throw new yt;m!==Ui&&(yield m),u.shift(),S()}await new Kd(m=>{f=m})}}finally{h=!0,d&&(d(),d=null)}}.call(this)}function Iv(t=void 0){return t!=null&&yr(t,"options"),t?.signal!=null&&gr(t.signal,"options.signal"),async function*(){let r=0;for await(let i of this){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new yt({cause:t.signal.reason});yield[r++,i]}}.call(this)}async function eh(t,e=void 0){for await(let r of Ns.call(this,t,e))return!0;return!1}async function xv(t,e=void 0){if(typeof t!="function")throw new mn("fn",["Function","AsyncFunction"],t);return!await eh.call(this,async(...r)=>!await t(...r),e)}async function Tv(t,e){for await(let r of Ns.call(this,t,e))return r}async function Pv(t,e){if(typeof t!="function")throw new mn("fn",["Function","AsyncFunction"],t);async function r(n,i){return await t(n,i),Ui}for await(let n of Fi.call(this,r,e));}function Ns(t,e){if(typeof t!="function")throw new mn("fn",["Function","AsyncFunction"],t);async function r(n,i){return await t(n,i)?n:Ui}return Fi.call(this,r,e)}var Bs=class extends lv{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function Ov(t,e,r){var n;if(typeof t!="function")throw new mn("reducer",["Function","AsyncFunction"],t);r!=null&&yr(r,"options"),r?.signal!=null&&gr(r.signal,"options.signal");let i=arguments.length>1;if(r!=null&&(n=r.signal)!==null&&n!==void 0&&n.aborted){let f=new yt(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await hv(this.destroy(f)),f}let s=new av,o=s.signal;if(r!=null&&r.signal){let f={once:!0,[fv]:this,[dv]:!0};r.signal.addEventListener("abort",()=>s.abort(),f)}let u=!1;try{for await(let f of this){var c;if(u=!0,r!=null&&(c=r.signal)!==null&&c!==void 0&&c.aborted)throw new yt;i?e=await t(e,f,{signal:o}):(e=f,i=!0)}if(!u&&!i)throw new Bs}finally{s.abort()}return e}async function Rv(t){t!=null&&yr(t,"options"),t?.signal!=null&&gr(t.signal,"options.signal");let e=[];for await(let n 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});_v(e,n)}return e}function kv(t,e){let r=Fi.call(this,t,e);return async function*(){for await(let i of r)yield*i}.call(this)}function th(t){if(t=vv(t),Sv(t))return 0;if(t<0)throw new cv("number",">= 0",t);return t}function Cv(t,e=void 0){return e!=null&&yr(e,"options"),e?.signal!=null&&gr(e.signal,"options.signal"),t=th(t),async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new yt;for await(let s of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new yt;t--<=0&&(yield s)}}.call(this)}function Mv(t,e=void 0){return e!=null&&yr(e,"options"),e?.signal!=null&&gr(e.signal,"options.signal"),t=th(t),async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new yt;for await(let s of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new yt;if(t-- >0&&(yield s),t<=0)return}}.call(this)}Ls.exports.streamReturningOperators={asIndexedPairs:mv(Iv,"readable.asIndexedPairs will be removed in a future version."),drop:Cv,filter:Ns,flatMap:kv,map:Fi,take:Mv,compose:Av};Ls.exports.promiseReturningOperators={every:xv,forEach:Pv,reduce:Ov,toArray:Rv,some:eh,find:Tv}});var qs=H((SO,nh)=>{"use strict";x();P();T();var{ArrayPrototypePop:Bv,Promise:Nv}=Ee(),{isIterable:Lv,isNodeStream:qv,isWebStream:Dv}=dt(),{pipelineImpl:Uv}=Li(),{finished:Fv}=At();Ds();function jv(...t){return new Nv((e,r)=>{let n,i,s=t[t.length-1];if(s&&typeof s=="object"&&!qv(s)&&!Lv(s)&&!Dv(s)){let o=Bv(t);n=o.signal,i=o.end}Uv(t,(o,u)=>{o?r(o):e(u)},{signal:n,end:i})})}nh.exports={finished:Fv,pipeline:jv}});var Ds=H((OO,dh)=>{"use strict";x();P();T();var{Buffer:$v}=(Re(),ge(Ne)),{ObjectDefineProperty:Tt,ObjectKeys:sh,ReflectApply:ah}=Ee(),{promisify:{custom:uh}}=We(),{streamReturningOperators:ih,promiseReturningOperators:oh}=rh(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:lh}}=De(),Wv=Ms(),{setDefaultHighWaterMark:Vv,getDefaultHighWaterMark:Hv}=ln(),{pipeline:ch}=Li(),{destroyer:zv}=lr(),fh=At(),Us=qs(),_n=dt(),Se=dh.exports=_i().Stream;Se.isDestroyed=_n.isDestroyed;Se.isDisturbed=_n.isDisturbed;Se.isErrored=_n.isErrored;Se.isReadable=_n.isReadable;Se.isWritable=_n.isWritable;Se.Readable=dn();for(let t of sh(ih)){let r=function(...n){if(new.target)throw lh();return Se.Readable.from(ah(e,this,n))},e=ih[t];Tt(r,"name",{__proto__:null,value:e.name}),Tt(r,"length",{__proto__:null,value:e.length}),Tt(Se.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}for(let t of sh(oh)){let r=function(...n){if(new.target)throw lh();return ah(e,this,n)},e=oh[t];Tt(r,"name",{__proto__:null,value:e.name}),Tt(r,"length",{__proto__:null,value:e.length}),Tt(Se.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}Se.Writable=Ci();Se.Duplex=gt();Se.Transform=ws();Se.PassThrough=Ss();Se.pipeline=ch;var{addAbortSignal:Gv}=un();Se.addAbortSignal=Gv;Se.finished=fh;Se.destroy=zv;Se.compose=Wv;Se.setDefaultHighWaterMark=Vv;Se.getDefaultHighWaterMark=Hv;Tt(Se,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return Us}});Tt(ch,uh,{__proto__:null,enumerable:!0,get(){return Us.pipeline}});Tt(fh,uh,{__proto__:null,enumerable:!0,get(){return Us.finished}});Se.Stream=Se;Se._isUint8Array=function(e){return e instanceof Uint8Array};Se._uint8ArrayToBuffer=function(e){return $v.from(e.buffer,e.byteOffset,e.byteLength)}});var Ht=H((LO,Te)=>{"use strict";x();P();T();var Ce=Ds(),Qv=qs(),Kv=Ce.Readable.destroy;Te.exports=Ce.Readable;Te.exports._uint8ArrayToBuffer=Ce._uint8ArrayToBuffer;Te.exports._isUint8Array=Ce._isUint8Array;Te.exports.isDisturbed=Ce.isDisturbed;Te.exports.isErrored=Ce.isErrored;Te.exports.isReadable=Ce.isReadable;Te.exports.Readable=Ce.Readable;Te.exports.Writable=Ce.Writable;Te.exports.Duplex=Ce.Duplex;Te.exports.Transform=Ce.Transform;Te.exports.PassThrough=Ce.PassThrough;Te.exports.addAbortSignal=Ce.addAbortSignal;Te.exports.finished=Ce.finished;Te.exports.destroy=Ce.destroy;Te.exports.destroy=Kv;Te.exports.pipeline=Ce.pipeline;Te.exports.compose=Ce.compose;Object.defineProperty(Ce,"promises",{configurable:!0,enumerable:!0,get(){return Qv}});Te.exports.Stream=Ce.Stream;Te.exports.default=Te.exports});var hh=H((WO,Fs)=>{x();P();T();typeof Object.create=="function"?Fs.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Fs.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}}});var yh=H((YO,gh)=>{"use strict";x();P();T();var{Buffer:ut}=(Re(),ge(Ne)),ph=Symbol.for("BufferList");function _e(t){if(!(this instanceof _e))return new _e(t);_e._init.call(this,t)}_e._init=function(e){Object.defineProperty(this,ph,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)};_e.prototype._new=function(e){return new _e(e)};_e.prototype._offset=function(e){if(e===0)return[0,0];let r=0;for(let n=0;n<this._bufs.length;n++){let i=r+this._bufs[n].length;if(e<i||n===this._bufs.length-1)return[n,e-r];r=i}};_e.prototype._reverseOffset=function(t){let e=t[0],r=t[1];for(let n=0;n<e;n++)r+=this._bufs[n].length;return r};_e.prototype.getBuffers=function(){return this._bufs};_e.prototype.get=function(e){if(e>this.length||e<0)return;let r=this._offset(e);return this._bufs[r[0]][r[1]]};_e.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)};_e.prototype.copy=function(e,r,n,i){if((typeof n!="number"||n<0)&&(n=0),(typeof i!="number"||i>this.length)&&(i=this.length),n>=this.length||i<=0)return e||ut.alloc(0);let s=!!e,o=this._offset(n),u=i-n,c=u,f=s&&r||0,d=o[1];if(n===0&&i===this.length){if(!s)return this._bufs.length===1?this._bufs[0]:ut.concat(this._bufs,this.length);for(let h=0;h<this._bufs.length;h++)this._bufs[h].copy(e,f),f+=this._bufs[h].length;return e}if(c<=this._bufs[o[0]].length-d)return s?this._bufs[o[0]].copy(e,r,d,d+c):this._bufs[o[0]].slice(d,d+c);s||(e=ut.allocUnsafe(u));for(let h=o[0];h<this._bufs.length;h++){let _=this._bufs[h].length-d;if(c>_)this._bufs[h].copy(e,f,d),f+=_;else{this._bufs[h].copy(e,f,d,d+c),f+=_;break}c-=_,d&&(d=0)}return e.length>f?e.slice(0,f):e};_e.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 n=this._offset(e),i=this._offset(r),s=this._bufs.slice(n[0],i[0]+1);return i[1]===0?s.pop():s[s.length-1]=s[s.length-1].slice(0,i[1]),n[1]!==0&&(s[0]=s[0].slice(n[1])),this._new(s)};_e.prototype.toString=function(e,r,n){return this.slice(r,n).toString(e)};_e.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};_e.prototype.duplicate=function(){let e=this._new();for(let r=0;r<this._bufs.length;r++)e.append(this._bufs[r]);return e};_e.prototype.append=function(e){return this._attach(e,_e.prototype._appendBuffer)};_e.prototype.prepend=function(e){return this._attach(e,_e.prototype._prependBuffer,!0)};_e.prototype._attach=function(e,r,n){if(e==null)return this;if(e.buffer)r.call(this,ut.from(e.buffer,e.byteOffset,e.byteLength));else if(Array.isArray(e)){let[i,s]=n?[e.length-1,-1]:[0,1];for(let o=i;o>=0&&o<e.length;o+=s)this._attach(e[o],r,n)}else if(this._isBufferList(e)){let[i,s]=n?[e._bufs.length-1,-1]:[0,1];for(let o=i;o>=0&&o<e._bufs.length;o+=s)this._attach(e._bufs[o],r,n)}else typeof e=="number"&&(e=e.toString()),r.call(this,ut.from(e));return this};_e.prototype._appendBuffer=function(e){this._bufs.push(e),this.length+=e.length};_e.prototype._prependBuffer=function(e){this._bufs.unshift(e),this.length+=e.length};_e.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=ut.from([t]):typeof t=="string"?t=ut.from(t,r):this._isBufferList(t)?t=t.slice():Array.isArray(t.buffer)?t=ut.from(t.buffer,t.byteOffset,t.byteLength):ut.isBuffer(t)||(t=ut.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 n=this._offset(e),i=n[0],s=n[1];for(;i<this._bufs.length;i++){let o=this._bufs[i];for(;s<o.length;)if(o.length-s>=t.length){let c=o.indexOf(t,s);if(c!==-1)return this._reverseOffset([i,c]);s=o.length-t.length+1}else{let c=this._reverseOffset([i,s]);if(this._match(c,t))return c;s++}s=0}return-1};_e.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?_e.prototype[r]=function(n,i){return this.slice(n,n+i)[r](0,i)}:_e.prototype[r]=function(n=0){return this.slice(n,n+t[r])[r](0)}})(e)})();_e.prototype._isBufferList=function(e){return e instanceof _e||_e.isBufferList(e)};_e.isBufferList=function(e){return e!=null&&e[ph]};gh.exports=_e});var bh=H((nR,ji)=>{"use strict";x();P();T();var js=Ht().Duplex,Yv=hh(),wn=yh();function Fe(t){if(!(this instanceof Fe))return new Fe(t);if(typeof t=="function"){this._callback=t;let e=function(n){this._callback&&(this._callback(n),this._callback=null)}.bind(this);this.on("pipe",function(n){n.on("error",e)}),this.on("unpipe",function(n){n.removeListener("error",e)}),t=null}wn._init.call(this,t),js.call(this)}Yv(Fe,js);Object.assign(Fe.prototype,wn.prototype);Fe.prototype._new=function(e){return new Fe(e)};Fe.prototype._write=function(e,r,n){this._appendBuffer(e),typeof n=="function"&&n()};Fe.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)};Fe.prototype.end=function(e){js.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)};Fe.prototype._destroy=function(e,r){this._bufs.length=0,this.length=0,r(e)};Fe.prototype._isBufferList=function(e){return e instanceof Fe||e instanceof wn||Fe.isBufferList(e)};Fe.isBufferList=wn.isBufferList;ji.exports=Fe;ji.exports.BufferListStream=Fe;ji.exports.BufferList=wn});var _h=H((cR,mh)=>{x();P();T();var $s=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}};mh.exports=$s});var Ws=H((bR,wh)=>{x();P();T();var Q=wh.exports,{Buffer:ze}=(Re(),ge(Ne));Q.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"};Q.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};Q.requiredHeaderFlagsErrors={};for(let t in Q.requiredHeaderFlags){let e=Q.requiredHeaderFlags[t];Q.requiredHeaderFlagsErrors[t]="Invalid header flag bits, must be 0x"+e.toString(16)+" for "+Q.types[t]+" packet"}Q.codes={};for(let t in Q.types){let e=Q.types[t];Q.codes[e]=t}Q.CMD_SHIFT=4;Q.CMD_MASK=240;Q.DUP_MASK=8;Q.QOS_MASK=3;Q.QOS_SHIFT=1;Q.RETAIN_MASK=1;Q.VARBYTEINT_MASK=127;Q.VARBYTEINT_FIN_MASK=128;Q.VARBYTEINT_MAX=268435455;Q.SESSIONPRESENT_MASK=1;Q.SESSIONPRESENT_HEADER=ze.from([Q.SESSIONPRESENT_MASK]);Q.CONNACK_HEADER=ze.from([Q.codes.connack<<Q.CMD_SHIFT]);Q.USERNAME_MASK=128;Q.PASSWORD_MASK=64;Q.WILL_RETAIN_MASK=32;Q.WILL_QOS_MASK=24;Q.WILL_QOS_SHIFT=3;Q.WILL_FLAG_MASK=4;Q.CLEAN_SESSION_MASK=2;Q.CONNECT_HEADER=ze.from([Q.codes.connect<<Q.CMD_SHIFT]);Q.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};Q.propertiesCodes={};for(let t in Q.properties){let e=Q.properties[t];Q.propertiesCodes[e]=t}Q.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 zt(t){return[0,1,2].map(e=>[0,1].map(r=>[0,1].map(n=>{let i=ze.alloc(1);return i.writeUInt8(Q.codes[t]<<Q.CMD_SHIFT|(r?Q.DUP_MASK:0)|e<<Q.QOS_SHIFT|n,0,!0),i})))}Q.PUBLISH_HEADER=zt("publish");Q.SUBSCRIBE_HEADER=zt("subscribe");Q.SUBSCRIBE_OPTIONS_QOS_MASK=3;Q.SUBSCRIBE_OPTIONS_NL_MASK=1;Q.SUBSCRIBE_OPTIONS_NL_SHIFT=2;Q.SUBSCRIBE_OPTIONS_RAP_MASK=1;Q.SUBSCRIBE_OPTIONS_RAP_SHIFT=3;Q.SUBSCRIBE_OPTIONS_RH_MASK=3;Q.SUBSCRIBE_OPTIONS_RH_SHIFT=4;Q.SUBSCRIBE_OPTIONS_RH=[0,16,32];Q.SUBSCRIBE_OPTIONS_NL=4;Q.SUBSCRIBE_OPTIONS_RAP=8;Q.SUBSCRIBE_OPTIONS_QOS=[0,1,2];Q.UNSUBSCRIBE_HEADER=zt("unsubscribe");Q.ACKS={unsuback:zt("unsuback"),puback:zt("puback"),pubcomp:zt("pubcomp"),pubrel:zt("pubrel"),pubrec:zt("pubrec")};Q.SUBACK_HEADER=ze.from([Q.codes.suback<<Q.CMD_SHIFT]);Q.VERSION3=ze.from([3]);Q.VERSION4=ze.from([4]);Q.VERSION5=ze.from([5]);Q.VERSION131=ze.from([131]);Q.VERSION132=ze.from([132]);Q.QOS=[0,1,2].map(t=>ze.from([t]));Q.EMPTY={pingreq:ze.from([Q.codes.pingreq<<4,0]),pingresp:ze.from([Q.codes.pingresp<<4,0]),disconnect:ze.from([Q.codes.disconnect<<4,0])};Q.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"};Q.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"};Q.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"};Q.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"};Q.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"};Q.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}});var Sh=H((AR,vh)=>{x();P();T();var $r=1e3,Wr=$r*60,Vr=Wr*60,br=Vr*24,Jv=br*7,Xv=br*365.25;vh.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return Zv(t);if(r==="number"&&isFinite(t))return e.long?t0(t):e0(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Zv(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]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Xv;case"weeks":case"week":case"w":return r*Jv;case"days":case"day":case"d":return r*br;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Vr;case"minutes":case"minute":case"mins":case"min":case"m":return r*Wr;case"seconds":case"second":case"secs":case"sec":case"s":return r*$r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function e0(t){var e=Math.abs(t);return e>=br?Math.round(t/br)+"d":e>=Vr?Math.round(t/Vr)+"h":e>=Wr?Math.round(t/Wr)+"m":e>=$r?Math.round(t/$r)+"s":t+"ms"}function t0(t){var e=Math.abs(t);return e>=br?$i(t,e,br,"day"):e>=Vr?$i(t,e,Vr,"hour"):e>=Wr?$i(t,e,Wr,"minute"):e>=$r?$i(t,e,$r,"second"):t+" ms"}function $i(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var Ah=H((kR,Eh)=>{x();P();T();function r0(t){r.debug=r,r.default=r,r.coerce=c,r.disable=o,r.enable=i,r.enabled=u,r.humanize=Sh(),r.destroy=f,Object.keys(t).forEach(d=>{r[d]=t[d]}),r.names=[],r.skips=[],r.formatters={};function e(d){let h=0;for(let _=0;_<d.length;_++)h=(h<<5)-h+d.charCodeAt(_),h|=0;return r.colors[Math.abs(h)%r.colors.length]}r.selectColor=e;function r(d){let h,_=null,y,I;function S(...b){if(!S.enabled)return;let m=S,w=Number(new Date),R=w-(h||w);m.diff=R,m.prev=h,m.curr=w,h=w,b[0]=r.coerce(b[0]),typeof b[0]!="string"&&b.unshift("%O");let A=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(O,v)=>{if(O==="%%")return"%";A++;let B=r.formatters[v];if(typeof B=="function"){let D=b[A];O=B.call(m,D),b.splice(A,1),A--}return O}),r.formatArgs.call(m,b),(m.log||r.log).apply(m,b)}return S.namespace=d,S.useColors=r.useColors(),S.color=r.selectColor(d),S.extend=n,S.destroy=r.destroy,Object.defineProperty(S,"enabled",{enumerable:!0,configurable:!1,get:()=>_!==null?_:(y!==r.namespaces&&(y=r.namespaces,I=r.enabled(d)),I),set:b=>{_=b}}),typeof r.init=="function"&&r.init(S),S}function n(d,h){let _=r(this.namespace+(typeof h>"u"?":":h)+d);return _.log=this.log,_}function i(d){r.save(d),r.namespaces=d,r.names=[],r.skips=[];let h=(typeof d=="string"?d:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let _ of h)_[0]==="-"?r.skips.push(_.slice(1)):r.names.push(_)}function s(d,h){let _=0,y=0,I=-1,S=0;for(;_<d.length;)if(y<h.length&&(h[y]===d[_]||h[y]==="*"))h[y]==="*"?(I=y,S=_,y++):(_++,y++);else if(I!==-1)y=I+1,S++,_=S;else return!1;for(;y<h.length&&h[y]==="*";)y++;return y===h.length}function o(){let d=[...r.names,...r.skips.map(h=>"-"+h)].join(",");return r.enable(""),d}function u(d){for(let h of r.skips)if(s(d,h))return!1;for(let h of r.names)if(s(d,h))return!0;return!1}function c(d){return d instanceof Error?d.stack||d.message:d}function f(){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}Eh.exports=r0});var Gt=H((Ge,Wi)=>{x();P();T();Ge.formatArgs=i0;Ge.save=o0;Ge.load=s0;Ge.useColors=n0;Ge.storage=a0();Ge.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`."))}})();Ge.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 n0(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return 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&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function i0(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Wi.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}Ge.log=console.debug||console.log||(()=>{});function o0(t){try{t?Ge.storage.setItem("debug",t):Ge.storage.removeItem("debug")}catch{}}function s0(){let t;try{t=Ge.storage.getItem("debug")||Ge.storage.getItem("DEBUG")}catch{}return!t&&typeof L<"u"&&"env"in L&&(t=L.env.DEBUG),t}function a0(){try{return localStorage}catch{}}Wi.exports=Ah()(Ge);var{formatters:u0}=Wi.exports;u0.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Th=H((VR,xh)=>{x();P();T();var l0=bh(),{EventEmitter:c0}=(jt(),ge(Ft)),Ih=_h(),pe=Ws(),ae=Gt()("mqtt-packet:parser"),Vs=class t extends c0{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(){ae("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new Ih,this.error=null,this._list=l0(),this._stateCounter=0}parse(e){for(this.error&&this._resetState(),this._list.append(e),ae("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++,ae("parse: state complete. _stateCounter is now: %d",this._stateCounter),ae("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return ae("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>>pe.CMD_SHIFT;this.packet.cmd=pe.types[r];let n=e&15,i=pe.requiredHeaderFlags[r];return i!=null&&n!==i?this._emitError(new Error(pe.requiredHeaderFlagsErrors[r])):(this.packet.retain=(e&pe.RETAIN_MASK)!==0,this.packet.qos=e>>pe.QOS_SHIFT&pe.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=(e&pe.DUP_MASK)!==0,ae("_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)),ae("_parseLength %d",e.value),!!e}_parsePayload(){ae("_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 ae("_parsePayload complete result: %s",e),e}_parseConnect(){ae("_parseConnect");let e,r,n,i,s={},o=this.packet,u=this._parseString();if(u===null)return this._emitError(new Error("Cannot parse protocolId"));if(u!=="MQTT"&&u!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(o.protocolId=u,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(o.protocolVersion=this._list.readUInt8(this._pos),o.protocolVersion>=128&&(o.bridgeMode=!0,o.protocolVersion=o.protocolVersion-128),o.protocolVersion!==3&&o.protocolVersion!==4&&o.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"));s.username=this._list.readUInt8(this._pos)&pe.USERNAME_MASK,s.password=this._list.readUInt8(this._pos)&pe.PASSWORD_MASK,s.will=this._list.readUInt8(this._pos)&pe.WILL_FLAG_MASK;let c=!!(this._list.readUInt8(this._pos)&pe.WILL_RETAIN_MASK),f=(this._list.readUInt8(this._pos)&pe.WILL_QOS_MASK)>>pe.WILL_QOS_SHIFT;if(s.will)o.will={},o.will.retain=c,o.will.qos=f;else{if(c)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(f)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(o.clean=(this._list.readUInt8(this._pos)&pe.CLEAN_SESSION_MASK)!==0,this._pos++,o.keepalive=this._parseNum(),o.keepalive===-1)return this._emitError(new Error("Packet too short"));if(o.protocolVersion===5){let h=this._parseProperties();Object.getOwnPropertyNames(h).length&&(o.properties=h)}let d=this._parseString();if(d===null)return this._emitError(new Error("Packet too short"));if(o.clientId=d,ae("_parseConnect: packet.clientId: %s",o.clientId),s.will){if(o.protocolVersion===5){let h=this._parseProperties();Object.getOwnPropertyNames(h).length&&(o.will.properties=h)}if(e=this._parseString(),e===null)return this._emitError(new Error("Cannot parse will topic"));if(o.will.topic=e,ae("_parseConnect: packet.will.topic: %s",o.will.topic),r=this._parseBuffer(),r===null)return this._emitError(new Error("Cannot parse will payload"));o.will.payload=r,ae("_parseConnect: packet.will.paylaod: %s",o.will.payload)}if(s.username){if(i=this._parseString(),i===null)return this._emitError(new Error("Cannot parse username"));o.username=i,ae("_parseConnect: packet.username: %s",o.username)}if(s.password){if(n=this._parseBuffer(),n===null)return this._emitError(new Error("Cannot parse password"));o.password=n}return this.settings=o,ae("_parseConnect: complete"),o}_parseConnack(){ae("_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&pe.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 n=this._parseProperties();Object.getOwnPropertyNames(n).length&&(e.properties=n)}ae("_parseConnack: complete")}_parsePublish(){ae("_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),ae("_parsePublish: payload from buffer list: %o",e.payload)}}_parseSubscribe(){ae("_parseSubscribe");let e=this.packet,r,n,i,s,o,u,c;if(e.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let f=this._parseProperties();Object.getOwnPropertyNames(f).length&&(e.properties=f)}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(n=this._parseByte(),this.settings.protocolVersion===5){if(n&192)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(n&252)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(i=n&pe.SUBSCRIBE_OPTIONS_QOS_MASK,i>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(u=(n>>pe.SUBSCRIBE_OPTIONS_NL_SHIFT&pe.SUBSCRIBE_OPTIONS_NL_MASK)!==0,o=(n>>pe.SUBSCRIBE_OPTIONS_RAP_SHIFT&pe.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,s=n>>pe.SUBSCRIBE_OPTIONS_RH_SHIFT&pe.SUBSCRIBE_OPTIONS_RH_MASK,s>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));c={topic:r,qos:i},this.settings.protocolVersion===5?(c.nl=u,c.rap=o,c.rh=s):this.settings.bridgeMode&&(c.rh=0,c.rap=!0,c.nl=!0),ae("_parseSubscribe: push subscription `%s` to subscription",c),e.subscriptions.push(c)}}}_parseSuback(){ae("_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(!pe.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(){ae("_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"));ae("_parseUnsubscribe: push topic `%s` to unsubscriptions",r),e.unsubscriptions.push(r)}}}_parseUnsuback(){ae("_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 n=this._list.readUInt8(this._pos++);if(!pe.MQTT5_UNSUBACK_CODES[n])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(n)}}}_parseConfirmation(){ae("_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(!pe.MQTT5_PUBACK_PUBREC_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!pe.MQTT5_PUBREL_PUBCOMP_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break}ae("_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(ae("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?(e.reasonCode=this._parseByte(),pe.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 ae("_parseDisconnect result: true"),!0}_parseAuth(){ae("_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(),!pe.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),ae("_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):(ae("_parseMessageId: packet.messageId %d",e.messageId),!0)}_parseString(e){let r=this._parseNum(),n=r+this._pos;if(r===-1||n>this._list.length||n>this.packet.length)return null;let i=this._list.toString("utf8",this._pos,n);return this._pos+=r,ae("_parseString: result: %s",i),i}_parseStringPair(){return ae("_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 n=this._list.slice(this._pos,r);return this._pos+=e,ae("_parseBuffer: result: %o",n),n}_parseNum(){if(this._list.length-this._pos<2)return-1;let e=this._list.readUInt16BE(this._pos);return this._pos+=2,ae("_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,ae("_parse4ByteNum: result: %s",e),e}_parseVarByteNum(e){ae("_parseVarByteNum");let r=4,n=0,i=1,s=0,o=!1,u,c=this._pos?this._pos:0;for(;n<r&&c+n<this._list.length;){if(u=this._list.readUInt8(c+n++),s+=i*(u&pe.VARBYTEINT_MASK),i*=128,(u&pe.VARBYTEINT_FIN_MASK)===0){o=!0;break}if(this._list.length<=n)break}return!o&&n===r&&this._list.length>=n&&this._emitError(new Error("Invalid variable byte integer")),c&&(this._pos+=n),o?e?o={bytes:n,value:s}:o=s:o=!1,ae("_parseVarByteNum: result: %o",o),o}_parseByte(){let e;return this._pos<this._list.length&&(e=this._list.readUInt8(this._pos),this._pos++),ae("_parseByte: result: %o",e),e}_parseByType(e){switch(ae("_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(){ae("_parseProperties");let e=this._parseVarByteNum(),n=this._pos+e,i={};for(;this._pos<n;){let s=this._parseByte();if(!s)return this._emitError(new Error("Cannot parse property code type")),!1;let o=pe.propertiesCodes[s];if(!o)return this._emitError(new Error("Unknown property")),!1;if(o==="userProperties"){i[o]||(i[o]=Object.create(null));let u=this._parseByType(pe.propertiesTypes[o]);if(i[o][u.name])if(Array.isArray(i[o][u.name]))i[o][u.name].push(u.value);else{let c=i[o][u.name];i[o][u.name]=[c],i[o][u.name].push(u.value)}else i[o][u.name]=u.value;continue}i[o]?Array.isArray(i[o])?i[o].push(this._parseByType(pe.propertiesTypes[o])):(i[o]=[i[o]],i[o].push(this._parseByType(pe.propertiesTypes[o]))):i[o]=this._parseByType(pe.propertiesTypes[o])}return i}_newPacket(){return ae("_newPacket"),this.packet&&(this._list.consume(this.packet.length),ae("_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)),ae("_newPacket: new packet"),this.packet=new Ih,this._pos=0,!0}_emitError(e){ae("_emitError",e),this.error=e,this.emit("error",e)}};xh.exports=Vs});var kh=H((JR,Rh)=>{x();P();T();var{Buffer:vn}=(Re(),ge(Ne)),f0=65536,Ph={},d0=vn.isBuffer(vn.from([1,2]).subarray(0,1));function Oh(t){let e=vn.allocUnsafe(2);return e.writeUInt8(t>>8,0),e.writeUInt8(t&255,1),e}function h0(){for(let t=0;t<f0;t++)Ph[t]=Oh(t)}function p0(t){let r=0,n=0,i=vn.allocUnsafe(4);do r=t%128|0,t=t/128|0,t>0&&(r=r|128),i.writeUInt8(r,n++);while(t>0&&n<4);return t>0&&(n=0),d0?i.subarray(0,n):i.slice(0,n)}function g0(t){let e=vn.allocUnsafe(4);return e.writeUInt32BE(t,0),e}Rh.exports={cache:Ph,generateCache:h0,generateNumber:Oh,genBufVariableByteInt:p0,generate4ByteBuffer:g0}});var Ch=H((ik,Hs)=>{"use strict";x();P();T();typeof L>"u"||!L.version||L.version.indexOf("v0.")===0||L.version.indexOf("v1.")===0&&L.version.indexOf("v1.8.")!==0?Hs.exports={nextTick:y0}:Hs.exports=L;function y0(t,e,r,n){if(typeof t!="function")throw new TypeError('"callback" argument must be a function');var i=arguments.length,s,o;switch(i){case 0:case 1:return L.nextTick(t);case 2:return L.nextTick(function(){t.call(null,e)});case 3:return L.nextTick(function(){t.call(null,e,r)});case 4:return L.nextTick(function(){t.call(null,e,r,n)});default:for(s=new Array(i-1),o=0;o<s.length;)s[o++]=arguments[o];return L.nextTick(function(){t.apply(null,s)})}}});var Qs=H((fk,Fh)=>{x();P();T();var ue=Ws(),{Buffer:se}=(Re(),ge(Ne)),b0=se.allocUnsafe(0),m0=se.from([0]),Sn=kh(),_0=Ch().nextTick,et=Gt()("mqtt-packet:writeToStream"),Vi=Sn.cache,w0=Sn.generateNumber,v0=Sn.generateCache,zs=Sn.genBufVariableByteInt,S0=Sn.generate4ByteBuffer,Ve=Gs,Hi=!0;function Dh(t,e,r){switch(et("generate called"),e.cork&&(e.cork(),_0(E0,e)),Hi&&(Hi=!1,v0()),et("generate: packet.cmd: %s",t.cmd),t.cmd){case"connect":return A0(t,e,r);case"connack":return I0(t,e,r);case"publish":return x0(t,e,r);case"puback":case"pubrec":case"pubrel":case"pubcomp":return T0(t,e,r);case"subscribe":return P0(t,e,r);case"suback":return O0(t,e,r);case"unsubscribe":return R0(t,e,r);case"unsuback":return k0(t,e,r);case"pingreq":case"pingresp":return C0(t,e,r);case"disconnect":return M0(t,e,r);case"auth":return B0(t,e,r);default:return e.destroy(new Error("Unknown command")),!1}}Object.defineProperty(Dh,"cacheNumbers",{get(){return Ve===Gs},set(t){t?((!Vi||Object.keys(Vi).length===0)&&(Hi=!0),Ve=Gs):(Hi=!1,Ve=N0)}});function E0(t){t.uncork()}function A0(t,e,r){let n=t||{},i=n.protocolId||"MQTT",s=n.protocolVersion||4,o=n.will,u=n.clean,c=n.keepalive||0,f=n.clientId||"",d=n.username,h=n.password,_=n.properties;u===void 0&&(u=!0);let y=0;if(!i||typeof i!="string"&&!se.isBuffer(i))return e.destroy(new Error("Invalid protocolId")),!1;if(y+=i.length+2,s!==3&&s!==4&&s!==5)return e.destroy(new Error("Invalid protocol version")),!1;if(y+=1,(typeof f=="string"||se.isBuffer(f))&&(f||s>=4)&&(f||u))y+=se.byteLength(f)+2;else{if(s<4)return e.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(u*1===0)return e.destroy(new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof c!="number"||c<0||c>65535||c%1!==0)return e.destroy(new Error("Invalid keepalive")),!1;y+=2,y+=1;let I,S;if(s===5){if(I=Qt(e,_),!I)return!1;y+=I.length}if(o){if(typeof o!="object")return e.destroy(new Error("Invalid will")),!1;if(!o.topic||typeof o.topic!="string")return e.destroy(new Error("Invalid will topic")),!1;if(y+=se.byteLength(o.topic)+2,y+=2,o.payload)if(o.payload.length>=0)typeof o.payload=="string"?y+=se.byteLength(o.payload):y+=o.payload.length;else return e.destroy(new Error("Invalid will payload")),!1;if(S={},s===5){if(S=Qt(e,o.properties),!S)return!1;y+=S.length}}let b=!1;if(d!=null)if(qh(d))b=!0,y+=se.byteLength(d)+2;else return e.destroy(new Error("Invalid username")),!1;if(h!=null){if(!b)return e.destroy(new Error("Username is required to use password")),!1;if(qh(h))y+=Uh(h)+2;else return e.destroy(new Error("Invalid password")),!1}e.write(ue.CONNECT_HEADER),tt(e,y),Hr(e,i),n.bridgeMode&&(s+=128),e.write(s===131?ue.VERSION131:s===132?ue.VERSION132:s===4?ue.VERSION4:s===5?ue.VERSION5:ue.VERSION3);let m=0;return m|=d!=null?ue.USERNAME_MASK:0,m|=h!=null?ue.PASSWORD_MASK:0,m|=o&&o.retain?ue.WILL_RETAIN_MASK:0,m|=o&&o.qos?o.qos<<ue.WILL_QOS_SHIFT:0,m|=o?ue.WILL_FLAG_MASK:0,m|=u?ue.CLEAN_SESSION_MASK:0,e.write(se.from([m])),Ve(e,c),s===5&&I.write(),Hr(e,f),o&&(s===5&&S.write(),mr(e,o.topic),Hr(e,o.payload)),d!=null&&Hr(e,d),h!=null&&Hr(e,h),!0}function I0(t,e,r){let n=r?r.protocolVersion:4,i=t||{},s=n===5?i.reasonCode:i.returnCode,o=i.properties,u=2;if(typeof s!="number")return e.destroy(new Error("Invalid return code")),!1;let c=null;if(n===5){if(c=Qt(e,o),!c)return!1;u+=c.length}return e.write(ue.CONNACK_HEADER),tt(e,u),e.write(i.sessionPresent?ue.SESSIONPRESENT_HEADER:m0),e.write(se.from([s])),c?.write(),!0}function x0(t,e,r){et("publish: packet: %o",t);let n=r?r.protocolVersion:4,i=t||{},s=i.qos||0,o=i.retain?ue.RETAIN_MASK:0,u=i.topic,c=i.payload||b0,f=i.messageId,d=i.properties,h=0;if(typeof u=="string")h+=se.byteLength(u)+2;else if(se.isBuffer(u))h+=u.length+2;else return e.destroy(new Error("Invalid topic")),!1;if(se.isBuffer(c)?h+=c.length:h+=se.byteLength(c),s&&typeof f!="number")return e.destroy(new Error("Invalid messageId")),!1;s&&(h+=2);let _=null;if(n===5){if(_=Qt(e,d),!_)return!1;h+=_.length}return e.write(ue.PUBLISH_HEADER[s][i.dup?1:0][o?1:0]),tt(e,h),Ve(e,Uh(u)),e.write(u),s>0&&Ve(e,f),_?.write(),et("publish: payload: %o",c),e.write(c)}function T0(t,e,r){let n=r?r.protocolVersion:4,i=t||{},s=i.cmd||"puback",o=i.messageId,u=i.dup&&s==="pubrel"?ue.DUP_MASK:0,c=0,f=i.reasonCode,d=i.properties,h=n===5?3:2;if(s==="pubrel"&&(c=1),typeof o!="number")return e.destroy(new Error("Invalid messageId")),!1;let _=null;if(n===5&&typeof d=="object"){if(_=En(e,d,r,h),!_)return!1;h+=_.length}return e.write(ue.ACKS[s][c][u][0]),h===3&&(h+=f!==0?1:-1),tt(e,h),Ve(e,o),n===5&&h!==2&&e.write(se.from([f])),_!==null?_.write():h===4&&e.write(se.from([0])),!0}function P0(t,e,r){et("subscribe: packet: ");let n=r?r.protocolVersion:4,i=t||{},s=i.dup?ue.DUP_MASK:0,o=i.messageId,u=i.subscriptions,c=i.properties,f=0;if(typeof o!="number")return e.destroy(new Error("Invalid messageId")),!1;f+=2;let d=null;if(n===5){if(d=Qt(e,c),!d)return!1;f+=d.length}if(typeof u=="object"&&u.length)for(let _=0;_<u.length;_+=1){let y=u[_].topic,I=u[_].qos;if(typeof y!="string")return e.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if(typeof I!="number")return e.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(n===5){if(typeof(u[_].nl||!1)!="boolean")return e.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(u[_].rap||!1)!="boolean")return e.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;let m=u[_].rh||0;if(typeof m!="number"||m>2)return e.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}f+=se.byteLength(y)+2+1}else return e.destroy(new Error("Invalid subscriptions")),!1;et("subscribe: writing to stream: %o",ue.SUBSCRIBE_HEADER),e.write(ue.SUBSCRIBE_HEADER[1][s?1:0][0]),tt(e,f),Ve(e,o),d!==null&&d.write();let h=!0;for(let _ of u){let y=_.topic,I=_.qos,S=+_.nl,b=+_.rap,m=_.rh,w;mr(e,y),w=ue.SUBSCRIBE_OPTIONS_QOS[I],n===5&&(w|=S?ue.SUBSCRIBE_OPTIONS_NL:0,w|=b?ue.SUBSCRIBE_OPTIONS_RAP:0,w|=m?ue.SUBSCRIBE_OPTIONS_RH[m]:0),h=e.write(se.from([w]))}return h}function O0(t,e,r){let n=r?r.protocolVersion:4,i=t||{},s=i.messageId,o=i.granted,u=i.properties,c=0;if(typeof s!="number")return e.destroy(new Error("Invalid messageId")),!1;if(c+=2,typeof o=="object"&&o.length)for(let d=0;d<o.length;d+=1){if(typeof o[d]!="number")return e.destroy(new Error("Invalid qos vector")),!1;c+=1}else return e.destroy(new Error("Invalid qos vector")),!1;let f=null;if(n===5){if(f=En(e,u,r,c),!f)return!1;c+=f.length}return e.write(ue.SUBACK_HEADER),tt(e,c),Ve(e,s),f!==null&&f.write(),e.write(se.from(o))}function R0(t,e,r){let n=r?r.protocolVersion:4,i=t||{},s=i.messageId,o=i.dup?ue.DUP_MASK:0,u=i.unsubscriptions,c=i.properties,f=0;if(typeof s!="number")return e.destroy(new Error("Invalid messageId")),!1;if(f+=2,typeof u=="object"&&u.length)for(let _=0;_<u.length;_+=1){if(typeof u[_]!="string")return e.destroy(new Error("Invalid unsubscriptions")),!1;f+=se.byteLength(u[_])+2}else return e.destroy(new Error("Invalid unsubscriptions")),!1;let d=null;if(n===5){if(d=Qt(e,c),!d)return!1;f+=d.length}e.write(ue.UNSUBSCRIBE_HEADER[1][o?1:0][0]),tt(e,f),Ve(e,s),d!==null&&d.write();let h=!0;for(let _=0;_<u.length;_++)h=mr(e,u[_]);return h}function k0(t,e,r){let n=r?r.protocolVersion:4,i=t||{},s=i.messageId,o=i.dup?ue.DUP_MASK:0,u=i.granted,c=i.properties,f=i.cmd,d=0,h=2;if(typeof s!="number")return e.destroy(new Error("Invalid messageId")),!1;if(n===5)if(typeof u=="object"&&u.length)for(let y=0;y<u.length;y+=1){if(typeof u[y]!="number")return e.destroy(new Error("Invalid qos vector")),!1;h+=1}else return e.destroy(new Error("Invalid qos vector")),!1;let _=null;if(n===5){if(_=En(e,c,r,h),!_)return!1;h+=_.length}return e.write(ue.ACKS[f][d][o][0]),tt(e,h),Ve(e,s),_!==null&&_.write(),n===5&&e.write(se.from(u)),!0}function C0(t,e,r){return e.write(ue.EMPTY[t.cmd])}function M0(t,e,r){let n=r?r.protocolVersion:4,i=t||{},s=i.reasonCode,o=i.properties,u=n===5?1:0,c=null;if(n===5){if(c=En(e,o,r,u),!c)return!1;u+=c.length}return e.write(se.from([ue.codes.disconnect<<4])),tt(e,u),n===5&&e.write(se.from([s])),c!==null&&c.write(),!0}function B0(t,e,r){let n=r?r.protocolVersion:4,i=t||{},s=i.reasonCode,o=i.properties,u=n===5?1:0;n!==5&&e.destroy(new Error("Invalid mqtt version for auth packet"));let c=En(e,o,r,u);return c?(u+=c.length,e.write(se.from([ue.codes.auth<<4])),tt(e,u),e.write(se.from([s])),c!==null&&c.write(),!0):!1}var Mh={};function tt(t,e){if(e>ue.VARBYTEINT_MAX)return t.destroy(new Error(`Invalid variable byte integer: ${e}`)),!1;let r=Mh[e];return r||(r=zs(e),e<16384&&(Mh[e]=r)),et("writeVarByteInt: writing to stream: %o",r),t.write(r)}function mr(t,e){let r=se.byteLength(e);return Ve(t,r),et("writeString: %s",e),t.write(e,"utf8")}function Bh(t,e,r){mr(t,e),mr(t,r)}function Gs(t,e){return et("writeNumberCached: number: %d",e),et("writeNumberCached: %o",Vi[e]),t.write(Vi[e])}function N0(t,e){let r=w0(e);return et("writeNumberGenerated: %o",r),t.write(r)}function L0(t,e){let r=S0(e);return et("write4ByteNumber: %o",r),t.write(r)}function Hr(t,e){typeof e=="string"?mr(t,e):e?(Ve(t,e.length),t.write(e)):Ve(t,0)}function Qt(t,e){if(typeof e!="object"||e.length!=null)return{length:1,write(){Lh(t,{},0)}};let r=0;function n(s,o){let u=ue.propertiesTypes[s],c=0;switch(u){case"byte":{if(typeof o!="boolean")return t.destroy(new Error(`Invalid ${s}: ${o}`)),!1;c+=2;break}case"int8":{if(typeof o!="number"||o<0||o>255)return t.destroy(new Error(`Invalid ${s}: ${o}`)),!1;c+=2;break}case"binary":{if(o&&o===null)return t.destroy(new Error(`Invalid ${s}: ${o}`)),!1;c+=1+se.byteLength(o)+2;break}case"int16":{if(typeof o!="number"||o<0||o>65535)return t.destroy(new Error(`Invalid ${s}: ${o}`)),!1;c+=3;break}case"int32":{if(typeof o!="number"||o<0||o>4294967295)return t.destroy(new Error(`Invalid ${s}: ${o}`)),!1;c+=5;break}case"var":{if(typeof o!="number"||o<0||o>268435455)return t.destroy(new Error(`Invalid ${s}: ${o}`)),!1;c+=1+se.byteLength(zs(o));break}case"string":{if(typeof o!="string")return t.destroy(new Error(`Invalid ${s}: ${o}`)),!1;c+=3+se.byteLength(o.toString());break}case"pair":{if(typeof o!="object")return t.destroy(new Error(`Invalid ${s}: ${o}`)),!1;c+=Object.getOwnPropertyNames(o).reduce((f,d)=>{let h=o[d];return Array.isArray(h)?f+=h.reduce((_,y)=>(_+=3+se.byteLength(d.toString())+2+se.byteLength(y.toString()),_),0):f+=3+se.byteLength(d.toString())+2+se.byteLength(o[d].toString()),f},0);break}default:return t.destroy(new Error(`Invalid property ${s}: ${o}`)),!1}return c}if(e)for(let s in e){let o=0,u=0,c=e[s];if(c!==void 0){if(Array.isArray(c))for(let f=0;f<c.length;f++){if(u=n(s,c[f]),!u)return!1;o+=u}else{if(u=n(s,c),!u)return!1;o=u}if(!o)return!1;r+=o}}return{length:se.byteLength(zs(r))+r,write(){Lh(t,e,r)}}}function En(t,e,r,n){let i=["reasonString","userProperties"],s=r&&r.properties&&r.properties.maximumPacketSize?r.properties.maximumPacketSize:0,o=Qt(t,e);if(s)for(;n+o.length>s;){let u=i.shift();if(u&&e[u])delete e[u],o=Qt(t,e);else return!1}return o}function Nh(t,e,r){switch(ue.propertiesTypes[e]){case"byte":{t.write(se.from([ue.properties[e]])),t.write(se.from([+r]));break}case"int8":{t.write(se.from([ue.properties[e]])),t.write(se.from([r]));break}case"binary":{t.write(se.from([ue.properties[e]])),Hr(t,r);break}case"int16":{t.write(se.from([ue.properties[e]])),Ve(t,r);break}case"int32":{t.write(se.from([ue.properties[e]])),L0(t,r);break}case"var":{t.write(se.from([ue.properties[e]])),tt(t,r);break}case"string":{t.write(se.from([ue.properties[e]])),mr(t,r);break}case"pair":{Object.getOwnPropertyNames(r).forEach(i=>{let s=r[i];Array.isArray(s)?s.forEach(o=>{t.write(se.from([ue.properties[e]])),Bh(t,i.toString(),o.toString())}):(t.write(se.from([ue.properties[e]])),Bh(t,i.toString(),s.toString()))});break}default:return t.destroy(new Error(`Invalid property ${e} value: ${r}`)),!1}}function Lh(t,e,r){tt(t,r);for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&e[n]!=null){let i=e[n];if(Array.isArray(i))for(let s=0;s<i.length;s++)Nh(t,n,i[s]);else Nh(t,n,i)}}function Uh(t){return t?t instanceof se?t.length:se.byteLength(t):0}function qh(t){return typeof t=="string"||t instanceof se}Fh.exports=Dh});var Wh=H((mk,$h)=>{x();P();T();var q0=Qs(),{EventEmitter:D0}=(jt(),ge(Ft)),{Buffer:jh}=(Re(),ge(Ne));function U0(t,e){let r=new Ks;return q0(t,r,e),r.concat()}var Ks=class extends D0{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),n=this._array,i=0,s;for(s=0;s<n.length&&n[s]!==void 0;s++)typeof n[s]!="string"?r[s]=n[s].length:r[s]=jh.byteLength(n[s]),e+=r[s];let o=jh.allocUnsafe(e);for(s=0;s<n.length&&n[s]!==void 0;s++)typeof n[s]!="string"?(n[s].copy(o,i),i+=r[s]):(o.write(n[s],i),i+=r[s]);return o}destroy(e){e&&this.emit("error",e)}};$h.exports=U0});var Vh=H(zi=>{x();P();T();zi.parser=Th().parser;zi.generate=Wh();zi.writeToStream=Qs()});var zh=H((Ck,Hh)=>{"use strict";x();P();T();Hh.exports=F0;function zr(t){return t instanceof V?V.from(t):new t.constructor(t.buffer.slice(),t.byteOffset,t.length)}function F0(t){if(t=t||{},t.circles)return j0(t);let e=new Map;if(e.set(Date,o=>new Date(o)),e.set(Map,(o,u)=>new Map(n(Array.from(o),u))),e.set(Set,(o,u)=>new Set(n(Array.from(o),u))),t.constructorHandlers)for(let o of t.constructorHandlers)e.set(o[0],o[1]);let r=null;return t.proto?s:i;function n(o,u){let c=Object.keys(o),f=new Array(c.length);for(let d=0;d<c.length;d++){let h=c[d],_=o[h];typeof _!="object"||_===null?f[h]=_:_.constructor!==Object&&(r=e.get(_.constructor))?f[h]=r(_,u):ArrayBuffer.isView(_)?f[h]=zr(_):f[h]=u(_)}return f}function i(o){if(typeof o!="object"||o===null)return o;if(Array.isArray(o))return n(o,i);if(o.constructor!==Object&&(r=e.get(o.constructor)))return r(o,i);let u={};for(let c in o){if(Object.hasOwnProperty.call(o,c)===!1)continue;let f=o[c];typeof f!="object"||f===null?u[c]=f:f.constructor!==Object&&(r=e.get(f.constructor))?u[c]=r(f,i):ArrayBuffer.isView(f)?u[c]=zr(f):u[c]=i(f)}return u}function s(o){if(typeof o!="object"||o===null)return o;if(Array.isArray(o))return n(o,s);if(o.constructor!==Object&&(r=e.get(o.constructor)))return r(o,s);let u={};for(let c in o){let f=o[c];typeof f!="object"||f===null?u[c]=f:f.constructor!==Object&&(r=e.get(f.constructor))?u[c]=r(f,s):ArrayBuffer.isView(f)?u[c]=zr(f):u[c]=s(f)}return u}}function j0(t){let e=[],r=[],n=new Map;if(n.set(Date,c=>new Date(c)),n.set(Map,(c,f)=>new Map(s(Array.from(c),f))),n.set(Set,(c,f)=>new Set(s(Array.from(c),f))),t.constructorHandlers)for(let c of t.constructorHandlers)n.set(c[0],c[1]);let i=null;return t.proto?u:o;function s(c,f){let d=Object.keys(c),h=new Array(d.length);for(let _=0;_<d.length;_++){let y=d[_],I=c[y];if(typeof I!="object"||I===null)h[y]=I;else if(I.constructor!==Object&&(i=n.get(I.constructor)))h[y]=i(I,f);else if(ArrayBuffer.isView(I))h[y]=zr(I);else{let S=e.indexOf(I);S!==-1?h[y]=r[S]:h[y]=f(I)}}return h}function o(c){if(typeof c!="object"||c===null)return c;if(Array.isArray(c))return s(c,o);if(c.constructor!==Object&&(i=n.get(c.constructor)))return i(c,o);let f={};e.push(c),r.push(f);for(let d in c){if(Object.hasOwnProperty.call(c,d)===!1)continue;let h=c[d];if(typeof h!="object"||h===null)f[d]=h;else if(h.constructor!==Object&&(i=n.get(h.constructor)))f[d]=i(h,o);else if(ArrayBuffer.isView(h))f[d]=zr(h);else{let _=e.indexOf(h);_!==-1?f[d]=r[_]:f[d]=o(h)}}return e.pop(),r.pop(),f}function u(c){if(typeof c!="object"||c===null)return c;if(Array.isArray(c))return s(c,u);if(c.constructor!==Object&&(i=n.get(c.constructor)))return i(c,u);let f={};e.push(c),r.push(f);for(let d in c){let h=c[d];if(typeof h!="object"||h===null)f[d]=h;else if(h.constructor!==Object&&(i=n.get(h.constructor)))f[d]=i(h,u);else if(ArrayBuffer.isView(h))f[d]=zr(h);else{let _=e.indexOf(h);_!==-1?f[d]=r[_]:f[d]=u(h)}}return e.pop(),r.pop(),f}}});var Qh=H((Uk,Gh)=>{"use strict";x();P();T();Gh.exports=zh()()});var Ys=H(Gi=>{"use strict";x();P();T();Object.defineProperty(Gi,"__esModule",{value:!0});Gi.validateTopic=Kh;Gi.validateTopics=$0;function Kh(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}function $0(t){if(t.length===0)return"empty_topic_list";for(let e=0;e<t.length;e++)if(!Kh(t[e]))return t[e];return null}});var Zs=H(Xs=>{"use strict";x();P();T();Object.defineProperty(Xs,"__esModule",{value:!0});var W0=Ht(),V0={objectMode:!0},H0={clean:!0},Js=class{options;_inflights;constructor(e){this.options=e||{},this.options={...H0,...e},this._inflights=new Map}put(e,r){return this._inflights.set(e.messageId,e),r&&r(),this}createStream(){let e=new W0.Readable(V0),r=[],n=!1,i=0;return this._inflights.forEach((s,o)=>{r.push(s)}),e._read=()=>{!n&&i<r.length?e.push(r[i++]):e.push(null)},e.destroy=s=>{if(!n)return n=!0,setTimeout(()=>{e.emit("close")},0),e},e}del(e,r){let n=this._inflights.get(e.messageId);return n?(this._inflights.delete(e.messageId),r(null,n)):r&&r(new Error("missing packet")),this}get(e,r){let n=this._inflights.get(e.messageId);return n?r(null,n):r&&r(new Error("missing packet")),this}close(e){this.options.clean&&(this._inflights=null),e&&e()}};Xs.default=Js});var Yh=H((sC,z0)=>{z0.exports={version:"5.16.1"}});var Pt=H(lt=>{"use strict";x();P();T();Object.defineProperty(lt,"__esModule",{value:!0});lt.MQTTJS_VERSION=lt.nextTick=lt.ErrorWithSubackPacket=lt.ErrorWithReasonCode=void 0;lt.applyMixin=G0;var ea=class t extends Error{code;constructor(e,r){super(e),this.code=r,Object.setPrototypeOf(this,t.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}};lt.ErrorWithReasonCode=ea;var ta=class t extends Error{packet;constructor(e,r){super(e),this.packet=r,Object.setPrototypeOf(this,t.prototype),Object.getPrototypeOf(this).name="ErrorWithSubackPacket"}};lt.ErrorWithSubackPacket=ta;function G0(t,e,r=!1){let n=[e];for(;;){let i=n[0],s=Object.getPrototypeOf(i);if(s?.prototype)n.unshift(s);else break}for(let i of n)for(let s of Object.getOwnPropertyNames(i.prototype))(r||s!=="constructor")&&Object.defineProperty(t.prototype,s,Object.getOwnPropertyDescriptor(i.prototype,s)??Object.create(null))}lt.nextTick=typeof L?.nextTick=="function"?L.nextTick:t=>{setTimeout(t,0)};lt.MQTTJS_VERSION=Yh().version});var Xh=H(ra=>{"use strict";x();P();T();Object.defineProperty(ra,"__esModule",{value:!0});var Q0=Pt(),Jh=[0,16,128,131,135,144,145,151,153],K0=148,Y0=130,Qi=(t,e,r,n,i=K0)=>{n?.discardParsedPackets(),(!n||n.isCurrent())&&t._cleanUp(!0),r(),t.emit("error",new Q0.ErrorWithReasonCode(e,i))},Ki=(t,e,r)=>{r(),t.emit("error",e)},J0=(t,e,r,n)=>{t.log("handlePublish: packet %o",e),r=typeof r<"u"?r:t.noop;let i=e.topic.toString(),s=e.payload,{qos:o}=e,{messageId:u}=e,{options:c}=t;if(t.options.protocolVersion===5){let f;if(e.properties&&(f=e.properties.topicAlias),typeof f<"u"){let d=t.topicAliasRecv;if(!d){t.log("handlePublish :: received unexpected topic alias. alias: %d",f),Qi(t,"Received a PUBLISH Topic Alias but no Topic Alias Maximum was advertised",r,n);return}if(i.length===0)if(f>0&&f<=65535){let h=d.getTopicByAlias(f);if(h)i=h,t.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",i,f);else{t.log("handlePublish :: unregistered topic alias. alias: %d",f),Qi(t,"Received unregistered Topic Alias",r,n,Y0);return}}else{t.log("handlePublish :: topic alias out of range. alias: %d",f),Qi(t,`Received Topic Alias ${f} is outside the valid range 1-65535`,r,n);return}else if(d.put(i,f))t.log("handlePublish :: registered topic: %s - alias: %d",i,f);else{t.log("handlePublish :: topic alias outside the advertised maximum. alias: %d - max: %d",f,d.max),Qi(t,`Received Topic Alias ${f} is outside the advertised Topic Alias Maximum range 1-${d.max}`,r,n);return}}}switch(t.log("handlePublish: qos %d",o),o){case 2:{c.customHandleAcks(i,s,e,(f,d)=>{if(typeof f=="number"&&(d=f,f=null),f)return Ki(t,f,r);if(Jh.indexOf(d)===-1)return Ki(t,new Error("Wrong reason code for pubrec"),r);if(d)t._sendPacket({cmd:"pubrec",messageId:u,reasonCode:d},r);else{if(!t._trackIncomingQoS2Publish(u,r,n))return;t.incomingStore.put(e,()=>{t._sendPacket({cmd:"pubrec",messageId:u},r)})}});break}case 1:{c.customHandleAcks(i,s,e,(f,d)=>{if(typeof f=="number"&&(d=f,f=null),f)return Ki(t,f,r);if(Jh.indexOf(d)===-1)return Ki(t,new Error("Wrong reason code for puback"),r);d||t.emit("message",i,s,e),t.handleMessage(e,h=>{if(h)return r&&r(h);t._sendPacket({cmd:"puback",messageId:u,reasonCode:d},r)})});break}case 0:t.emit("message",i,s,e),t.handleMessage(e,r);break;default:t.log("handlePublish: unknown QoS. Doing nothing.");break}};ra.default=J0});var Zh=H(na=>{"use strict";x();P();T();Object.defineProperty(na,"__esModule",{value:!0});var An=Pt(),In=130,Gr=(t,e,r)=>{t.log("handleAuth :: %s",e.message),r?.discardParsedPackets(),(!r||r.isCurrent())&&t._cleanUp(!0),t.emit("error",e)},X0=(t,e,r)=>{let{options:n}=t,i=n.protocolVersion,s=i===5?e.reasonCode:e.returnCode;if(i!==5){Gr(t,new An.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${i}`,In),r);return}let o=t._authenticationMethod;if(!o){Gr(t,new An.ErrorWithReasonCode("Protocol error: Auth packet received but enhanced authentication was not requested",In),r);return}if(e.properties?.authenticationMethod!==o){Gr(t,new An.ErrorWithReasonCode(`Protocol error: Auth packet Authentication Method does not match the "${o}" sent in CONNECT`,In),r);return}t.handleAuth(e,(u,c)=>{if(u){Gr(t,u,r);return}if(s===0){t.log("handleAuth :: authentication exchange completed successfully");return}if(s===24){if(!c){Gr(t,new An.ErrorWithReasonCode("Protocol error: No auth packet to continue the authentication exchange",In),r);return}t.reconnecting=!1,t._sendPacket(c);return}Gr(t,new An.ErrorWithReasonCode(`Protocol error: Auth packet reason code ${s} is not one a broker may send`,In),r)})};na.default=X0});var xn=H(Kt=>{"use strict";x();P();T();Object.defineProperty(Kt,"__esModule",{value:!0});Kt.ReasonCodes=void 0;var ep=Pt();Kt.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 Z0={publish:["puback","pubrec","pubcomp"],pubrel:["pubcomp"],subscribe:["suback"],unsubscribe:["unsuback"]},eS=(t,e)=>{let{messageId:r}=e,n=e.cmd,i=null,s=t.outgoing[r],o=s?s.cb:null,u=null;if(!o){t.log("_handleAck :: Server sent an ack in error. Ignoring.");return}if(!Z0[s.cmd]?.includes(n)){t.log("_handleAck :: %s does not answer the pending %s on message id %d. Ignoring.",n,s.cmd,r),t.emit("error",new Error(`Protocol error: ${n} does not answer the ${s.cmd} pending on message id ${r}`));return}switch(t.log("_handleAck :: packet type",n),n){case"pubcomp":case"puback":{let c=e.reasonCode;c&&c>0&&c!==16?(u=new ep.ErrorWithReasonCode(`Publish error: ${Kt.ReasonCodes[c]}`,c),t._removeOutgoingAndStoreMessage(r,()=>{o(u,e)})):t._removeOutgoingAndStoreMessage(r,o);break}case"pubrec":{i={cmd:"pubrel",qos:2,messageId:r};let c=e.reasonCode;c&&c>0&&c!==16?(u=new ep.ErrorWithReasonCode(`Publish error: ${Kt.ReasonCodes[c]}`,c),t._removeOutgoingAndStoreMessage(r,()=>{o(u,e)})):t._sendPacket(i);break}case"suback":{delete t.outgoing[r],t.messageIdProvider.deallocate(r);let c=e.granted;for(let f=0;f<c.length;f++){let d=c[f];if((d&128)!==0){u=new Error(`Subscribe error: ${Kt.ReasonCodes[d]}`),u.code=d;let h=t.messageIdToTopic[r];h&&h.forEach(_=>{delete t._resubscribeTopics[_]})}}delete t.messageIdToTopic[r],t._invokeStoreProcessingQueue(),o(u,e);break}case"unsuback":{delete t.outgoing[r],t.messageIdProvider.deallocate(r),t._invokeStoreProcessingQueue(),o(null,e);break}default:t.emit("error",new Error("unrecognized packet type"))}t.disconnecting&&Object.keys(t.outgoing).length===0&&t.emit("outgoingEmpty")};Kt.default=eS});var op=H(Ji=>{"use strict";x();P();T();Object.defineProperty(Ji,"__esModule",{value:!0});Ji.LRUCache=void 0;var Qr=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,rp=new Set,ia=typeof L=="object"&&L?L:{},np=(t,e,r,n)=>{typeof ia.emitWarning=="function"?ia.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},Yi=globalThis.AbortController,tp=globalThis.AbortSignal;if(typeof Yi>"u"){tp=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,i){this._onabort.push(i)}},Yi=class{constructor(){e()}signal=new tp;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let i of this.signal._onabort)i(n);this.signal.onabort?.(n)}}};let t=ia.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,np("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 tS=t=>!rp.has(t),qC=Symbol("type"),Yt=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),ip=t=>Yt(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Kr:null:null,Kr=class extends Array{constructor(e){super(e),this.fill(0)}},oa=class t{heap;length;static#u=!1;static create(e){let r=ip(e);if(!r)return[];t.#u=!0;let n=new t(e,r);return t.#u=!1,n}constructor(e,r){if(!t.#u)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]}},sa=class t{#u;#f;#g;#y;#R;#k;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#i;#b;#n;#r;#e;#l;#d;#a;#o;#m;#s;#_;#w;#h;#v;#x;#c;static unsafeExposeInternals(e){return{starts:e.#w,ttls:e.#h,sizes:e.#_,keyMap:e.#n,keyList:e.#r,valList:e.#e,next:e.#l,prev:e.#d,get head(){return e.#a},get tail(){return e.#o},free:e.#m,isBackgroundFetch:r=>e.#t(r),backgroundFetch:(r,n,i,s)=>e.#B(r,n,i,s),moveToTail:r=>e.#O(r),indexes:r=>e.#S(r),rindexes:r=>e.#E(r),isStale:r=>e.#p(r)}}get max(){return this.#u}get maxSize(){return this.#f}get calculatedSize(){return this.#b}get size(){return this.#i}get fetchMethod(){return this.#R}get memoMethod(){return this.#k}get dispose(){return this.#g}get disposeAfter(){return this.#y}constructor(e){let{max:r=0,ttl:n,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:u,allowStale:c,dispose:f,disposeAfter:d,noDisposeOnSet:h,noUpdateTTL:_,maxSize:y=0,maxEntrySize:I=0,sizeCalculation:S,fetchMethod:b,memoMethod:m,noDeleteOnFetchRejection:w,noDeleteOnStaleGet:R,allowStaleOnFetchRejection:A,allowStaleOnFetchAbort:g,ignoreFetchAbort:O}=e;if(r!==0&&!Yt(r))throw new TypeError("max option must be a nonnegative integer");let v=r?ip(r):Array;if(!v)throw new Error("invalid max value: "+r);if(this.#u=r,this.#f=y,this.maxEntrySize=I||this.#f,this.sizeCalculation=S,this.sizeCalculation){if(!this.#f&&!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(m!==void 0&&typeof m!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#k=m,b!==void 0&&typeof b!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#R=b,this.#x=!!b,this.#n=new Map,this.#r=new Array(r).fill(void 0),this.#e=new Array(r).fill(void 0),this.#l=new v(r),this.#d=new v(r),this.#a=0,this.#o=0,this.#m=oa.create(r),this.#i=0,this.#b=0,typeof f=="function"&&(this.#g=f),typeof d=="function"?(this.#y=d,this.#s=[]):(this.#y=void 0,this.#s=void 0),this.#v=!!this.#g,this.#c=!!this.#y,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!_,this.noDeleteOnFetchRejection=!!w,this.allowStaleOnFetchRejection=!!A,this.allowStaleOnFetchAbort=!!g,this.ignoreFetchAbort=!!O,this.maxEntrySize!==0){if(this.#f!==0&&!Yt(this.#f))throw new TypeError("maxSize must be a positive integer if specified");if(!Yt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#j()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!R,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!u,this.ttlResolution=Yt(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!Yt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#N()}if(this.#u===0&&this.ttl===0&&this.#f===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#u&&!this.#f){let B="LRU_CACHE_UNBOUNDED";tS(B)&&(rp.add(B),np("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",B,t))}}getRemainingTTL(e){return this.#n.has(e)?1/0:0}#N(){let e=new Kr(this.#u),r=new Kr(this.#u);this.#h=e,this.#w=r,this.#L=(s,o,u=Qr.now())=>{if(r[s]=o!==0?u:0,e[s]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#p(s)&&this.#A(this.#r[s],"expire")},o+1);c.unref&&c.unref()}},this.#T=s=>{r[s]=e[s]!==0?Qr.now():0},this.#I=(s,o)=>{if(e[o]){let u=e[o],c=r[o];if(!u||!c)return;s.ttl=u,s.start=c,s.now=n||i();let f=s.now-c;s.remainingTTL=u-f}};let n=0,i=()=>{let s=Qr.now();if(this.ttlResolution>0){n=s;let o=setTimeout(()=>n=0,this.ttlResolution);o.unref&&o.unref()}return s};this.getRemainingTTL=s=>{let o=this.#n.get(s);if(o===void 0)return 0;let u=e[o],c=r[o];if(!u||!c)return 1/0;let f=(n||i())-c;return u-f},this.#p=s=>{let o=r[s],u=e[s];return!!u&&!!o&&(n||i())-o>u}}#T=()=>{};#I=()=>{};#L=()=>{};#p=()=>!1;#j(){let e=new Kr(this.#u);this.#b=0,this.#_=e,this.#P=r=>{this.#b-=e[r],e[r]=0},this.#q=(r,n,i,s)=>{if(this.#t(n))return 0;if(!Yt(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(n,r),!Yt(i))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 i},this.#C=(r,n,i)=>{if(e[r]=n,this.#f){let s=this.#f-e[r];for(;this.#b>s;)this.#M(!0)}this.#b+=e[r],i&&(i.entrySize=n,i.totalCalculatedSize=this.#b)}}#P=e=>{};#C=(e,r,n)=>{};#q=(e,r,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#S({allowStale:e=this.allowStale}={}){if(this.#i)for(let r=this.#o;!(!this.#D(r)||((e||!this.#p(r))&&(yield r),r===this.#a));)r=this.#d[r]}*#E({allowStale:e=this.allowStale}={}){if(this.#i)for(let r=this.#a;!(!this.#D(r)||((e||!this.#p(r))&&(yield r),r===this.#o));)r=this.#l[r]}#D(e){return e!==void 0&&this.#n.get(this.#r[e])===e}*entries(){for(let e of this.#S())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.#E())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.#S()){let r=this.#r[e];r!==void 0&&!this.#t(this.#e[e])&&(yield r)}}*rkeys(){for(let e of this.#E()){let r=this.#r[e];r!==void 0&&!this.#t(this.#e[e])&&(yield r)}}*values(){for(let e of this.#S())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e])}*rvalues(){for(let e of this.#E())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let n of this.#S()){let i=this.#e[n],s=this.#t(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#r[n],this))return this.get(this.#r[n],r)}}forEach(e,r=this){for(let n of this.#S()){let i=this.#e[n],s=this.#t(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(r,s,this.#r[n],this)}}rforEach(e,r=this){for(let n of this.#E()){let i=this.#e[n],s=this.#t(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(r,s,this.#r[n],this)}}purgeStale(){let e=!1;for(let r of this.#E({allowStale:!0}))this.#p(r)&&(this.#A(this.#r[r],"expire"),e=!0);return e}info(e){let r=this.#n.get(e);if(r===void 0)return;let n=this.#e[r],i=this.#t(n)?n.__staleWhileFetching:n;if(i===void 0)return;let s={value:i};if(this.#h&&this.#w){let o=this.#h[r],u=this.#w[r];if(o&&u){let c=o-(Qr.now()-u);s.ttl=c,s.start=Date.now()}}return this.#_&&(s.size=this.#_[r]),s}dump(){let e=[];for(let r of this.#S({allowStale:!0})){let n=this.#r[r],i=this.#e[r],s=this.#t(i)?i.__staleWhileFetching:i;if(s===void 0||n===void 0)continue;let o={value:s};if(this.#h&&this.#w){o.ttl=this.#h[r];let u=Qr.now()-this.#w[r];o.start=Math.floor(Date.now()-u)}this.#_&&(o.size=this.#_[r]),e.unshift([n,o])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let i=Date.now()-n.start;n.start=Qr.now()-i}this.set(r,n.value,n)}}set(e,r,n={}){if(r===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:c}=n,{noUpdateTTL:f=this.noUpdateTTL}=n,d=this.#q(e,r,n.size||0,u);if(this.maxEntrySize&&d>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#A(e,"set"),this;let h=this.#i===0?void 0:this.#n.get(e);if(h===void 0)h=this.#i===0?this.#o:this.#m.length!==0?this.#m.pop():this.#i===this.#u?this.#M(!1):this.#i,this.#r[h]=e,this.#e[h]=r,this.#n.set(e,h),this.#l[this.#o]=h,this.#d[h]=this.#o,this.#o=h,this.#i++,this.#C(h,d,c),c&&(c.set="add"),f=!1;else{this.#O(h);let _=this.#e[h];if(r!==_){if(this.#x&&this.#t(_)){_.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:y}=_;y!==void 0&&!o&&(this.#v&&this.#g?.(y,e,"set"),this.#c&&this.#s?.push([y,e,"set"]))}else o||(this.#v&&this.#g?.(_,e,"set"),this.#c&&this.#s?.push([_,e,"set"]));if(this.#P(h),this.#C(h,d,c),this.#e[h]=r,c){c.set="replace";let y=_&&this.#t(_)?_.__staleWhileFetching:_;y!==void 0&&(c.oldValue=y)}}else c&&(c.set="update")}if(i!==0&&!this.#h&&this.#N(),this.#h&&(f||this.#L(h,i,s),c&&this.#I(c,h)),!o&&this.#c&&this.#s){let _=this.#s,y;for(;y=_?.shift();)this.#y?.(...y)}return this}pop(){try{for(;this.#i;){let e=this.#e[this.#a];if(this.#M(!0),this.#t(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#c&&this.#s){let e=this.#s,r;for(;r=e?.shift();)this.#y?.(...r)}}}#M(e){let r=this.#a,n=this.#r[r],i=this.#e[r];return this.#x&&this.#t(i)?i.__abortController.abort(new Error("evicted")):(this.#v||this.#c)&&(this.#v&&this.#g?.(i,n,"evict"),this.#c&&this.#s?.push([i,n,"evict"])),this.#P(r),e&&(this.#r[r]=void 0,this.#e[r]=void 0,this.#m.push(r)),this.#i===1?(this.#a=this.#o=0,this.#m.length=0):this.#a=this.#l[r],this.#n.delete(n),this.#i--,r}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=r,s=this.#n.get(e);if(s!==void 0){let o=this.#e[s];if(this.#t(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#p(s))i&&(i.has="stale",this.#I(i,s));else return n&&this.#T(s),i&&(i.has="hit",this.#I(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,i=this.#n.get(e);if(i===void 0||!n&&this.#p(i))return;let s=this.#e[i];return this.#t(s)?s.__staleWhileFetching:s}#B(e,r,n,i){let s=r===void 0?void 0:this.#e[r];if(this.#t(s))return s;let o=new Yi,{signal:u}=n;u?.addEventListener("abort",()=>o.abort(u.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:i},f=(S,b=!1)=>{let{aborted:m}=o.signal,w=n.ignoreFetchAbort&&S!==void 0;if(n.status&&(m&&!b?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,w&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),m&&!w&&!b)return h(o.signal.reason);let R=y;return this.#e[r]===y&&(S===void 0?R.__staleWhileFetching?this.#e[r]=R.__staleWhileFetching:this.#A(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,S,c.options))),S},d=S=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=S),h(S)),h=S=>{let{aborted:b}=o.signal,m=b&&n.allowStaleOnFetchAbort,w=m||n.allowStaleOnFetchRejection,R=w||n.noDeleteOnFetchRejection,A=y;if(this.#e[r]===y&&(!R||A.__staleWhileFetching===void 0?this.#A(e,"fetch"):m||(this.#e[r]=A.__staleWhileFetching)),w)return n.status&&A.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),A.__staleWhileFetching;if(A.__returned===A)throw S},_=(S,b)=>{let m=this.#R?.(e,s,c);m&&m instanceof Promise&&m.then(w=>S(w===void 0?void 0:w),b),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(S(void 0),n.allowStaleOnFetchAbort&&(S=w=>f(w,!0)))})};n.status&&(n.status.fetchDispatched=!0);let y=new Promise(_).then(f,d),I=Object.assign(y,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.set(e,I,{...c.options,status:void 0}),r=this.#n.get(e)):this.#e[r]=I,I}#t(e){if(!this.#x)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof Yi}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:u=this.noDisposeOnSet,size:c=0,sizeCalculation:f=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:_=this.allowStaleOnFetchRejection,ignoreFetchAbort:y=this.ignoreFetchAbort,allowStaleOnFetchAbort:I=this.allowStaleOnFetchAbort,context:S,forceRefresh:b=!1,status:m,signal:w}=r;if(!this.#x)return m&&(m.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:m});let R={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:u,size:c,sizeCalculation:f,noUpdateTTL:d,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:I,ignoreFetchAbort:y,status:m,signal:w},A=this.#n.get(e);if(A===void 0){m&&(m.fetch="miss");let g=this.#B(e,A,R,S);return g.__returned=g}else{let g=this.#e[A];if(this.#t(g)){let q=n&&g.__staleWhileFetching!==void 0;return m&&(m.fetch="inflight",q&&(m.returnedStale=!0)),q?g.__staleWhileFetching:g.__returned=g}let O=this.#p(A);if(!b&&!O)return m&&(m.fetch="hit"),this.#O(A),i&&this.#T(A),m&&this.#I(m,A),g;let v=this.#B(e,A,R,S),D=v.__staleWhileFetching!==void 0&&n;return m&&(m.fetch=O?"stale":"refresh",D&&O&&(m.returnedStale=!0)),D?v.__staleWhileFetching:v.__returned=v}}async forceFetch(e,r={}){let n=await this.fetch(e,r);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,r={}){let n=this.#k;if(!n)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:s,...o}=r,u=this.get(e,o);if(!s&&u!==void 0)return u;let c=n(e,u,{options:o,context:i});return this.set(e,c,o),c}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=r,u=this.#n.get(e);if(u!==void 0){let c=this.#e[u],f=this.#t(c);return o&&this.#I(o,u),this.#p(u)?(o&&(o.get="stale"),f?(o&&n&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?c.__staleWhileFetching:void 0):(s||this.#A(e,"expire"),o&&n&&(o.returnedStale=!0),n?c:void 0)):(o&&(o.get="hit"),f?c.__staleWhileFetching:(this.#O(u),i&&this.#T(u),c))}else o&&(o.get="miss")}#U(e,r){this.#d[r]=e,this.#l[e]=r}#O(e){e!==this.#o&&(e===this.#a?this.#a=this.#l[e]:this.#U(this.#d[e],this.#l[e]),this.#U(this.#o,e),this.#o=e)}delete(e){return this.#A(e,"delete")}#A(e,r){let n=!1;if(this.#i!==0){let i=this.#n.get(e);if(i!==void 0)if(n=!0,this.#i===1)this.#F(r);else{this.#P(i);let s=this.#e[i];if(this.#t(s)?s.__abortController.abort(new Error("deleted")):(this.#v||this.#c)&&(this.#v&&this.#g?.(s,e,r),this.#c&&this.#s?.push([s,e,r])),this.#n.delete(e),this.#r[i]=void 0,this.#e[i]=void 0,i===this.#o)this.#o=this.#d[i];else if(i===this.#a)this.#a=this.#l[i];else{let o=this.#d[i];this.#l[o]=this.#l[i];let u=this.#l[i];this.#d[u]=this.#d[i]}this.#i--,this.#m.push(i)}}if(this.#c&&this.#s?.length){let i=this.#s,s;for(;s=i?.shift();)this.#y?.(...s)}return n}clear(){return this.#F("delete")}#F(e){for(let r of this.#E({allowStale:!0})){let n=this.#e[r];if(this.#t(n))n.__abortController.abort(new Error("deleted"));else{let i=this.#r[r];this.#v&&this.#g?.(n,i,e),this.#c&&this.#s?.push([n,i,e])}}if(this.#n.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#h&&this.#w&&(this.#h.fill(0),this.#w.fill(0)),this.#_&&this.#_.fill(0),this.#a=0,this.#o=0,this.#m.length=0,this.#b=0,this.#i=0,this.#c&&this.#s){let r=this.#s,n;for(;n=r?.shift();)this.#y?.(...n)}}};Ji.LRUCache=sa});var ua=H(Xi=>{"use strict";x();P();T();Object.defineProperty(Xi,"__esModule",{value:!0});Xi.NumberAllocator=void 0;var aa=class{used;min;max;lowWaterMark;constructor(e,r){this.min=e,this.max=r,this.used=new Set,this.lowWaterMark=e}firstVacant(){if(this.used.size===this.max-this.min+1)return null;for(let e=this.lowWaterMark;e<=this.max;e++)if(!this.used.has(e))return e;return null}alloc(){if(this.used.size===this.max-this.min+1)return null;for(let e=this.lowWaterMark;e<=this.max;e++)if(!this.used.has(e))return this.used.add(e),this.lowWaterMark=e+1,e;return null}use(e){return e<this.min||e>this.max||this.used.has(e)?!1:(this.used.add(e),!0)}free(e){e<this.min||e>this.max||(this.used.delete(e),e<this.lowWaterMark&&(this.lowWaterMark=e))}clear(){this.used.clear(),this.lowWaterMark=this.min}};Xi.NumberAllocator=aa});var sp=H(ca=>{"use strict";x();P();T();Object.defineProperty(ca,"__esModule",{value:!0});var rS=op(),nS=ua(),la=class{aliasToTopic;topicToAlias;max;numberAllocator;length;constructor(e){e>0&&(this.aliasToTopic=new rS.LRUCache({max:e}),this.topicToAlias={},this.numberAllocator=new nS.NumberAllocator(1,e),this.max=e,this.length=0)}put(e,r){if(r===0||r>this.max)return!1;let n=this.aliasToTopic.get(r);return n&&delete this.topicToAlias[n],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]}};ca.default=la});var up=H(Tn=>{"use strict";x();P();T();var iS=Tn&&Tn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Tn,"__esModule",{value:!0});var oS=xn(),sS=iS(sp()),ap=Pt(),aS=(t,e,r)=>{t.log("_handleConnack");let{options:n}=t,s=n.protocolVersion===5?e.reasonCode:e.returnCode;if(t.connackReceived){let o=new ap.ErrorWithReasonCode("Protocol error: duplicate CONNACK on the same network connection",130);r?.discardParsedPackets(),t._cleanUp(!0),t.emit("error",o);return}if(t.connackReceived=!0,clearTimeout(t.connackTimer),delete t.topicAliasSend,t._serverProperties=e.properties,e.properties&&e.properties.topicAliasMaximum){if(e.properties.topicAliasMaximum>65535){r?.discardParsedPackets(),t._cleanUp(!0),t.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}e.properties.topicAliasMaximum>0&&(t.topicAliasSend=new sS.default(e.properties.topicAliasMaximum))}if(s===0)t.reconnecting=!1,t._onConnect(e);else if(s>0){t.log("_handleConnack :: connection refused with reason code %d",s);let o=new ap.ErrorWithReasonCode(`Connection refused: ${oS.ReasonCodes[s]}`,s);r?.discardParsedPackets(),t.reconnectSuppressed=!0,t._cleanUp(!0);try{t.emit("error",o)}finally{n.reconnectOnConnackError&&(t.reconnectSuppressed=!1,t._setupReconnect())}}};Tn.default=aS});var lp=H(fa=>{"use strict";x();P();T();Object.defineProperty(fa,"__esModule",{value:!0});var uS=(t,e,r)=>{t.log("handling pubrel packet");let n=typeof r<"u"?r:t.noop,{messageId:i}=e,s={cmd:"pubcomp",messageId:i};t.incomingStore.get(e,(o,u)=>{o?t._sendPacket(s,n):(t.emit("message",u.topic,u.payload,u),t.handleMessage(u,c=>{if(c)return n(c);t.incomingStore.del(u,t.noop),t._releaseIncomingQoS2Publish(i),t._sendPacket(s,n)}))})};fa.default=uS});var cp=H(Pn=>{"use strict";x();P();T();var On=Pn&&Pn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Pn,"__esModule",{value:!0});var lS=On(Xh()),cS=On(Zh()),fS=On(up()),dS=On(xn()),hS=On(lp()),pS=Pt(),gS=t=>t<128?1:t<16384?2:t<2097152?3:4,yS=t=>1+gS(t)+t,bS=(t,e,r,n)=>{let{options:i}=t,s=i.properties?.maximumPacketSize,o=yS(e.length);if(i.protocolVersion===5&&s&&s<o)return t.log("_handlePacket :: %s packet of %d bytes exceeds the advertised maximumPacketSize %d",e.cmd,o,s),n?.discardParsedPackets(),t._cleanUp(!0),r(),t.emit("error",new pS.ErrorWithReasonCode(`exceeding packets size ${e.cmd}: ${o} bytes, maximumPacketSize is ${s}`,149)),t;switch(t.log("_handlePacket :: emitting packetreceive"),t.emit("packetreceive",e),e.cmd){case"publish":(0,lS.default)(t,e,r,n);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":t.reschedulePing();try{(0,dS.default)(t,e)}finally{r()}break;case"pubrel":t.reschedulePing(),(0,hS.default)(t,e,r);break;case"connack":try{(0,fS.default)(t,e,n)}finally{r()}break;case"auth":t.reschedulePing();try{(0,cS.default)(t,e,n)}finally{r()}break;case"pingresp":t.log("_handlePacket :: received pingresp"),t.reschedulePing(!0),r();break;case"disconnect":t.emit("disconnect",e),r();break;default:t.log("_handlePacket :: unknown command"),r();break}};Pn.default=bS});var pa=H(ha=>{"use strict";x();P();T();Object.defineProperty(ha,"__esModule",{value:!0});var da=class{nextId;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(){}};ha.default=da});var fp=H(ya=>{"use strict";x();P();T();Object.defineProperty(ya,"__esModule",{value:!0});var ga=class{aliasToTopic;max;length;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={}}};ya.default=ga});var dp=H(Yr=>{"use strict";x();P();T();var mS=Yr&&Yr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Yr,"__esModule",{value:!0});Yr.TypedEventEmitter=void 0;var _S=mS((jt(),ge(Ft))),wS=Pt(),Zi=class{};Yr.TypedEventEmitter=Zi;(0,wS.applyMixin)(Zi,_S.default)});var ba=H((eo,hp)=>{x();P();T();(function(t,e){typeof eo=="object"&&typeof hp<"u"?e(eo):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.fastUniqueNumbers={}))})(eo,(function(t){"use strict";var e=function(_){return function(y){var I=_(y);return y.add(I),I}},r=function(_){return function(y,I){return _.set(y,I),I}},n=Number.MAX_SAFE_INTEGER===void 0?9007199254740991:Number.MAX_SAFE_INTEGER,i=536870912,s=i*2,o=function(_,y){return function(I){var S=y.get(I),b=S===void 0?I.size:S<s?S+1:0;if(!I.has(b))return _(I,b);if(I.size<i){for(;I.has(b);)b=Math.floor(Math.random()*s);return _(I,b)}if(I.size>n)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;I.has(b);)b=Math.floor(Math.random()*n);return _(I,b)}},u=new WeakMap,c=r(u),f=o(c,u),d=e(f);t.addUniqueNumber=d,t.generateUniqueNumber=f}))});var Rn=H((ZM,Ot)=>{x();P();T();function ma(t){"@babel/helpers - typeof";return Ot.exports=ma=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ot.exports.__esModule=!0,Ot.exports.default=Ot.exports,ma(t)}Ot.exports=ma,Ot.exports.__esModule=!0,Ot.exports.default=Ot.exports});var gp=H((s2,kn)=>{x();P();T();var pp=Rn().default;function vS(t,e){if(pp(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(pp(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}kn.exports=vS,kn.exports.__esModule=!0,kn.exports.default=kn.exports});var yp=H((h2,Cn)=>{x();P();T();var SS=Rn().default,ES=gp();function AS(t){var e=ES(t,"string");return SS(e)=="symbol"?e:e+""}Cn.exports=AS,Cn.exports.__esModule=!0,Cn.exports.default=Cn.exports});var bp=H((w2,Mn)=>{x();P();T();var IS=yp();function xS(t,e,r){return(e=IS(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}Mn.exports=xS,Mn.exports.__esModule=!0,Mn.exports.default=Mn.exports});var mp=H((T2,Bn)=>{x();P();T();function TS(t){if(Array.isArray(t))return t}Bn.exports=TS,Bn.exports.__esModule=!0,Bn.exports.default=Bn.exports});var _p=H((B2,Nn)=>{x();P();T();function PS(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,o,u=[],c=!0,f=!1;try{if(s=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=s.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw i}}return u}}Nn.exports=PS,Nn.exports.__esModule=!0,Nn.exports.default=Nn.exports});var wp=H((j2,Ln)=>{x();P();T();function OS(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}Ln.exports=OS,Ln.exports.__esModule=!0,Ln.exports.default=Ln.exports});var Sp=H((Q2,qn)=>{x();P();T();var vp=wp();function RS(t,e){if(t){if(typeof t=="string")return vp(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?vp(t,e):void 0}}qn.exports=RS,qn.exports.__esModule=!0,qn.exports.default=qn.exports});var Ep=H((tB,Dn)=>{x();P();T();function kS(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}Dn.exports=kS,Dn.exports.__esModule=!0,Dn.exports.default=Dn.exports});var Ap=H((uB,Un)=>{x();P();T();var CS=mp(),MS=_p(),BS=Sp(),NS=Ep();function LS(t,e){return CS(t)||MS(t,e)||BS(t,e)||NS()}Un.exports=LS,Un.exports.__esModule=!0,Un.exports.default=Un.exports});var xp=H((gB,Fn)=>{x();P();T();function Ip(t,e,r,n,i,s,o){try{var u=t[s](o),c=u.value}catch(f){return void r(f)}u.done?e(c):Promise.resolve(c).then(n,i)}function qS(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function o(c){Ip(s,n,i,o,u,"next",c)}function u(c){Ip(s,n,i,o,u,"throw",c)}o(void 0)})}}Fn.exports=qS,Fn.exports.__esModule=!0,Fn.exports.default=Fn.exports});var _a=H((SB,jn)=>{x();P();T();function DS(t,e){this.v=t,this.k=e}jn.exports=DS,jn.exports.__esModule=!0,jn.exports.default=jn.exports});var wa=H((OB,Rt)=>{x();P();T();function to(t,e,r,n){var i=Object.defineProperty;try{i({},"",{})}catch{i=0}Rt.exports=to=function(o,u,c,f){function d(h,_){to(o,h,function(y){return this._invoke(h,_,y)})}u?i?i(o,u,{value:c,enumerable:!f,configurable:!f,writable:!f}):o[u]=c:(d("next",0),d("throw",1),d("return",2))},Rt.exports.__esModule=!0,Rt.exports.default=Rt.exports,to(t,e,r,n)}Rt.exports=to,Rt.exports.__esModule=!0,Rt.exports.default=Rt.exports});var va=H((LB,kt)=>{x();P();T();var bt=wa();function Tp(){var t,e,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function s(y,I,S,b){var m=I&&I.prototype instanceof u?I:u,w=Object.create(m.prototype);return bt(w,"_invoke",(function(R,A,g){var O,v,B,D=0,q=g||[],K=!1,U={p:0,n:0,v:t,a:$,f:$.bind(t,4),d:function(J,ee){return O=J,v=0,B=t,U.n=ee,o}};function $(G,J){for(v=G,B=J,e=0;!K&&D&&!ee&&e<q.length;e++){var ee,z=q[e],W=U.p,te=z[2];G>3?(ee=te===J)&&(B=z[(v=z[4])?5:(v=3,3)],z[4]=z[5]=t):z[0]<=W&&((ee=G<2&&W<z[1])?(v=0,U.v=J,U.n=z[1]):W<te&&(ee=G<3||z[0]>J||J>te)&&(z[4]=G,z[5]=J,U.n=te,v=0))}if(ee||G>1)return o;throw K=!0,J}return function(G,J,ee){if(D>1)throw TypeError("Generator is already running");for(K&&J===1&&$(J,ee),v=J,B=ee;(e=v<2?t:B)||!K;){O||(v?v<3?(v>1&&(U.n=-1),$(v,B)):U.n=B:U.v=B);try{if(D=2,O){if(v||(G="next"),e=O[G]){if(!(e=e.call(O,B)))throw TypeError("iterator result is not an object");if(!e.done)return e;B=e.value,v<2&&(v=0)}else v===1&&(e=O.return)&&e.call(O),v<2&&(B=TypeError("The iterator does not provide a '"+G+"' method"),v=1);O=t}else if((e=(K=U.n<0)?B:R.call(A,U))!==o)break}catch(z){O=t,v=1,B=z}finally{D=1}}return{value:e,done:K}}})(y,S,b),!0),w}var o={};function u(){}function c(){}function f(){}e=Object.getPrototypeOf;var d=[][n]?e(e([][n]())):(bt(e={},n,function(){return this}),e),h=f.prototype=u.prototype=Object.create(d);function _(y){return Object.setPrototypeOf?Object.setPrototypeOf(y,f):(y.__proto__=f,bt(y,i,"GeneratorFunction")),y.prototype=Object.create(h),y}return c.prototype=f,bt(h,"constructor",f),bt(f,"constructor",c),c.displayName="GeneratorFunction",bt(f,i,"GeneratorFunction"),bt(h),bt(h,i,"Generator"),bt(h,n,function(){return this}),bt(h,"toString",function(){return"[object Generator]"}),(kt.exports=Tp=function(){return{w:s,m:_}},kt.exports.__esModule=!0,kt.exports.default=kt.exports)()}kt.exports=Tp,kt.exports.__esModule=!0,kt.exports.default=kt.exports});var Aa=H((WB,$n)=>{x();P();T();var US=_a(),Sa=wa();function Ea(t,e){function r(i,s,o,u){try{var c=t[i](s),f=c.value;return f instanceof US?e.resolve(f.v).then(function(d){r("next",d,o,u)},function(d){r("throw",d,o,u)}):e.resolve(f).then(function(d){c.value=d,o(c)},function(d){return r("throw",d,o,u)})}catch(d){u(d)}}var n;this.next||(Sa(Ea.prototype),Sa(Ea.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),Sa(this,"_invoke",function(i,s,o){function u(){return new e(function(c,f){r(i,o,c,f)})}return n=n?n.then(u,u):u()},!0)}$n.exports=Ea,$n.exports.__esModule=!0,$n.exports.default=$n.exports});var Ia=H((YB,Wn)=>{x();P();T();var FS=va(),jS=Aa();function $S(t,e,r,n,i){return new jS(FS().w(t,e,r,n),i||Promise)}Wn.exports=$S,Wn.exports.__esModule=!0,Wn.exports.default=Wn.exports});var Pp=H((nN,Vn)=>{x();P();T();var WS=Ia();function VS(t,e,r,n,i){var s=WS(t,e,r,n,i);return s.next().then(function(o){return o.done?o.value:s.next()})}Vn.exports=VS,Vn.exports.__esModule=!0,Vn.exports.default=Vn.exports});var Op=H((cN,Hn)=>{x();P();T();function HS(t){var e=Object(t),r=[];for(var n in e)r.unshift(n);return function i(){for(;r.length;)if((n=r.pop())in e)return i.value=n,i.done=!1,i;return i.done=!0,i}}Hn.exports=HS,Hn.exports.__esModule=!0,Hn.exports.default=Hn.exports});var Rp=H((bN,zn)=>{x();P();T();var zS=Rn().default;function GS(t){if(t!=null){var e=t[typeof Symbol=="function"&&Symbol.iterator||"@@iterator"],r=0;if(e)return e.call(t);if(typeof t.next=="function")return t;if(!isNaN(t.length))return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}throw new TypeError(zS(t)+" is not iterable")}zn.exports=GS,zn.exports.__esModule=!0,zn.exports.default=zn.exports});var Cp=H((AN,Ct)=>{x();P();T();var QS=_a(),KS=va(),YS=Pp(),JS=Ia(),XS=Aa(),ZS=Op(),kp=Rp();function xa(){"use strict";var t=KS(),e=t.m(xa),r=(Object.getPrototypeOf?Object.getPrototypeOf(e):e.__proto__).constructor;function n(o){var u=typeof o=="function"&&o.constructor;return!!u&&(u===r||(u.displayName||u.name)==="GeneratorFunction")}var i={throw:1,return:2,break:3,continue:3};function s(o){var u,c;return function(f){u||(u={stop:function(){return c(f.a,2)},catch:function(){return f.v},abrupt:function(h,_){return c(f.a,i[h],_)},delegateYield:function(h,_,y){return u.resultName=_,c(f.d,kp(h),y)},finish:function(h){return c(f.f,h)}},c=function(h,_,y){f.p=u.prev,f.n=u.next;try{return h(_,y)}finally{u.next=f.n}}),u.resultName&&(u[u.resultName]=f.v,u.resultName=void 0),u.sent=f.v,u.next=f.n;try{return o.call(this,u)}finally{f.p=u.prev,f.n=u.next}}}return(Ct.exports=xa=function(){return{wrap:function(c,f,d,h){return t.w(s(c),f,d,h&&h.reverse())},isGeneratorFunction:n,mark:t.m,awrap:function(c,f){return new QS(c,f)},AsyncIterator:XS,async:function(c,f,d,h,_){return(n(f)?JS:YS)(s(c),f,d,h,_)},keys:ZS,values:kp}},Ct.exports.__esModule=!0,Ct.exports.default=Ct.exports)()}Ct.exports=xa,Ct.exports.__esModule=!0,Ct.exports.default=Ct.exports});var Bp=H((kN,Mp)=>{x();P();T();var ro=Cp()();Mp.exports=ro;try{regeneratorRuntime=ro}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=ro:Function("r","regeneratorRuntime = r")(ro)}});var Lp=H((no,Np)=>{x();P();T();(function(t,e){typeof no=="object"&&typeof Np<"u"?e(no,ba(),bp(),Ap(),xp(),Bp()):typeof define=="function"&&define.amd?define(["exports","fast-unique-numbers","@babel/runtime/helpers/defineProperty","@babel/runtime/helpers/slicedToArray","@babel/runtime/helpers/asyncToGenerator","@babel/runtime/regenerator"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.brokerFactory={},t.fastUniqueNumbers,t._defineProperty,t._slicedToArray,t._asyncToGenerator,t._regeneratorRuntime))})(no,(function(t,e,r,n,i,s){"use strict";function o(S,b){var m=Object.keys(S);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(S);b&&(w=w.filter(function(R){return Object.getOwnPropertyDescriptor(S,R).enumerable})),m.push.apply(m,w)}return m}function u(S){for(var b=1;b<arguments.length;b++){var m=arguments[b]!=null?arguments[b]:{};b%2?o(Object(m),!0).forEach(function(w){r(S,w,m[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(S,Object.getOwnPropertyDescriptors(m)):o(Object(m)).forEach(function(w){Object.defineProperty(S,w,Object.getOwnPropertyDescriptor(m,w))})}return S}var c=function(b,m,w,R){return function(A){var g=m(A);return function(O){var v=b(O);O.addEventListener("message",function(ee){var z=ee.data,W=z.id;if(W!==null&&v.has(W)){var te=v.get(W),Y=te.reject,X=te.resolve;v.delete(W),z.error===void 0?X(z.result):Y(new Error(z.error.message))}}),R(O)&&O.start();for(var B=function(z){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return new Promise(function(Y,X){var ce=w(v);v.set(ce,{reject:X,resolve:Y}),W===null?O.postMessage({id:ce,method:z},te):O.postMessage({id:ce,method:z,params:W},te)})},D=function(z,W){var te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];O.postMessage({id:null,method:z,params:W},te)},q={},K=0,U=Object.entries(g);K<U.length;K++){var $=n(U[K],2),G=$[0],J=$[1];q=u(u({},q),{},r({},G,J({call:B,notify:D})))}return u({},q)}}},f=function(b){return function(m){if(b.has(m))return b.get(m);var w=new Map;return b.set(m,w),w}};function d(S,b){var m=Object.keys(S);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(S);b&&(w=w.filter(function(R){return Object.getOwnPropertyDescriptor(S,R).enumerable})),m.push.apply(m,w)}return m}function h(S){for(var b=1;b<arguments.length;b++){var m=arguments[b]!=null?arguments[b]:{};b%2?d(Object(m),!0).forEach(function(w){r(S,w,m[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(S,Object.getOwnPropertyDescriptors(m)):d(Object(m)).forEach(function(w){Object.defineProperty(S,w,Object.getOwnPropertyDescriptor(m,w))})}return S}var _=function(b){return function(m){return h(h({},m),{},{connect:function(R){var A=R.call;return i(s.mark(function g(){var O,v,B,D;return s.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return O=new MessageChannel,v=O.port1,B=O.port2,q.next=1,A("connect",{port:v},[v]);case 1:return D=q.sent,b.set(B,D),q.abrupt("return",B);case 2:case"end":return q.stop()}},g)}))},disconnect:function(R){var A=R.call;return(function(){var g=i(s.mark(function O(v){var B;return s.wrap(function(D){for(;;)switch(D.prev=D.next){case 0:if(B=b.get(v),B!==void 0){D.next=1;break}throw new Error("The given port is not connected.");case 1:return D.next=2,A("disconnect",{portId:B});case 2:case"end":return D.stop()}},O)}));return function(O){return g.apply(this,arguments)}})()},isSupported:function(R){var A=R.call;return function(){return A("isSupported")}}})}},y=function(b){return typeof b.start=="function"},I=c(f(new WeakMap),_(new WeakMap),e.generateUniqueNumber,y);t.createBroker=I}))});var Dp=H((io,qp)=>{x();P();T();(function(t,e){typeof io=="object"&&typeof qp<"u"?e(io,Lp(),ba(),Rn()):typeof define=="function"&&define.amd?define(["exports","broker-factory","fast-unique-numbers","@babel/runtime/helpers/typeof"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.workerTimersBroker={},t.brokerFactory,t.fastUniqueNumbers,t._typeof))})(io,(function(t,e,r,n){"use strict";var i=function(m){return function(w){return function(R){n(m.get(R))==="symbol"&&(m.set(R,null),w(R).then(function(){m.delete(R)}))}}},s=function(m){return function(w){return function(R){n(m.get(R))==="symbol"&&(m.set(R,null),w(R).then(function(){m.delete(R)}))}}},o=function(m,w){return function(R){return function(A){for(var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,O=arguments.length,v=new Array(O>2?O-2:0),B=2;B<O;B++)v[B-2]=arguments[B];var D=Symbol(),q=m(w);w.set(q,D);var K=function(){return R(g,q).then(function(){var $=w.get(q);if($===void 0)throw new Error("The timer is in an undefined state.");$===D&&(A.apply(void 0,v),w.get(q)===D&&K())})};return K(),q}}},u=function(m,w){return function(R){return function(A){for(var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,O=arguments.length,v=new Array(O>2?O-2:0),B=2;B<O;B++)v[B-2]=arguments[B];var D=Symbol(),q=m(w);return w.set(q,D),R(g,q).then(function(){var K=w.get(q);if(K===void 0)throw new Error("The timer is in an undefined state.");K===D&&(w.delete(q),A.apply(void 0,v))}),q}}},c=new Map([[0,null]]),f=new Map([[0,null]]),d=i(c),h=s(f),_=o(r.generateUniqueNumber,c),y=u(r.generateUniqueNumber,f),I=e.createBroker({clearInterval:function(m){var w=m.call;return d(function(R){return w("clear",{timerId:R,timerType:"interval"})})},clearTimeout:function(m){var w=m.call;return h(function(R){return w("clear",{timerId:R,timerType:"timeout"})})},setInterval:function(m){var w=m.call;return _(function(R,A){return w("set",{delay:R,now:performance.timeOrigin+performance.now(),timerId:A,timerType:"interval"})})},setTimeout:function(m){var w=m.call;return y(function(R,A){return w("set",{delay:R,now:performance.timeOrigin+performance.now(),timerId:A,timerType:"timeout"})})}}),S=function(m){var w=new Worker(m);return I(w)};t.load=S,t.wrap=I}))});var Fp=H((oo,Up)=>{x();P();T();(function(t,e){typeof oo=="object"&&typeof Up<"u"?e(oo,Dp()):typeof define=="function"&&define.amd?define(["exports","worker-timers-broker"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.workerTimers={},t.workerTimersBroker))})(oo,(function(t,e){"use strict";var r=function(d,h){var _=null;return function(){if(_!==null)return _;var y=new Blob([h],{type:"application/javascript; charset=utf-8"}),I=URL.createObjectURL(y);return _=d(I),setTimeout(function(){return URL.revokeObjectURL(I)}),_}},n=`(()=>{var e={389(e,t){!function(e){"use strict";var t=function(e){return function(t){var r=e(t);return t.add(r),r}},r=function(e){return function(t,r){return e.set(t,r),r}},n=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,o=536870912,u=2*o,a=function(e,t){return function(r){var a=t.get(r),i=void 0===a?r.size:a<u?a+1:0;if(!r.has(i))return e(r,i);if(r.size<o){for(;r.has(i);)i=Math.floor(Math.random()*u);return e(r,i)}if(r.size>n)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;r.has(i);)i=Math.floor(Math.random()*n);return e(r,i)}},i=new WeakMap,s=r(i),c=a(s,i),f=t(c);e.addUniqueNumber=f,e.generateUniqueNumber=c}(t)},623(e,t,r){!function(e,t,r,n,o){"use strict";var u={INTERNAL_ERROR:-32603,INVALID_PARAMS:-32602,METHOD_NOT_FOUND:-32601},a=function(e,t){return Object.assign(new Error(e),{status:t})},i=function(e){return a('The requested method called "'.concat(e,'" is not supported.'),u.METHOD_NOT_FOUND)},s=function(e){return a('The handler of the method called "'.concat(e,'" returned no required result.'),u.INTERNAL_ERROR)},c=function(e){return a('The handler of the method called "'.concat(e,'" returned an unexpected result.'),u.INTERNAL_ERROR)},f=function(e){return a('The specified parameter called "portId" with the given value "'.concat(e,'" does not identify a port connected to this worker.'),u.INVALID_PARAMS)},l=function(e,n){return function(){var o=t(r.mark(function t(o){var u,a,f,l,p,d,v,x,y,b,h,m,_,g,w;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(u=o.data,a=u.id,f=u.method,l=u.params,p=n[f],t.prev=1,void 0!==p){t.next=2;break}throw i(f);case 2:if(void 0!==(d=void 0===l?p():p(l))){t.next=3;break}throw s(f);case 3:if(!(d instanceof Promise)){t.next=5;break}return t.next=4,d;case 4:g=t.sent,t.next=6;break;case 5:g=d;case 6:if(v=g,null!==a){t.next=8;break}if(void 0===v.result){t.next=7;break}throw c(f);case 7:t.next=10;break;case 8:if(void 0!==v.result){t.next=9;break}throw c(f);case 9:x=v.result,y=v.transferables,b=void 0===y?[]:y,e.postMessage({id:a,result:x},b);case 10:t.next=12;break;case 11:t.prev=11,w=t.catch(1),h=w.message,m=w.status,_=void 0===m?-32603:m,e.postMessage({error:{code:_,message:h},id:a});case 12:case"end":return t.stop()}},t,null,[[1,11]])}));return function(e){return o.apply(this,arguments)}}()},p=function(){return new Promise(function(e){var t=new ArrayBuffer(0),r=new MessageChannel,n=r.port1,o=r.port2;n.onmessage=function(t){var r=t.data;return e(null!==r)},o.postMessage(t,[t])})};function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var x=new Map,y=function(e,n,u){return v(v({},n),{},{connect:function(t){var r=t.port;r.start();var u=e(r,n),a=o.generateUniqueNumber(x);return x.set(a,function(){u(),r.close(),x.delete(a)}),{result:a}},disconnect:function(e){var t=e.portId,r=x.get(t);if(void 0===r)throw f(t);return r(),{result:null}},isSupported:function(){var e=t(r.mark(function e(){var t,n,o;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,p();case 1:if(!e.sent){e.next=5;break}if(!((t=u())instanceof Promise)){e.next=3;break}return e.next=2,t;case 2:o=e.sent,e.next=4;break;case 3:o=t;case 4:return n=o,e.abrupt("return",{result:n});case 5:return e.abrupt("return",{result:!1});case 6:case"end":return e.stop()}},e)}));function n(){return e.apply(this,arguments)}return n}()})},b=function(e,t){var r=y(b,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0}),n=l(e,r);return e.addEventListener("message",n),function(){return e.removeEventListener("message",n)}};e.createWorker=b,e.isSupported=p}(t,r(293),r(756),r(693),r(389))},472(e,t,r){!function(e,t,r,n){"use strict";var o=function(e,t){return function(r){var o=t.get(r);if(void 0===o)return Promise.resolve(!1);var u=n(o,2),a=u[0],i=u[1];return e(a),t.delete(r),i(!1),Promise.resolve(!0)}},u=function(e,t){var r=function(n,o,u,a){var i=n-e.now();i>0?o.set(a,[t(r,i,n,o,u,a),u]):(o.delete(a),u(!0))};return r},a=function(e,t,r,n){return function(o,u,a){var i=o+u-t.timeOrigin,s=i-t.now();return new Promise(function(t){e.set(a,[r(n,s,i,e,t,a),t])})}},i=new Map,s=o(globalThis.clearTimeout,i),c=new Map,f=o(globalThis.clearTimeout,c),l=u(performance,globalThis.setTimeout),p=a(i,performance,globalThis.setTimeout,l),d=a(c,performance,globalThis.setTimeout,l);r.createWorker(self,{clear:function(){var r=e(t.mark(function e(r){var n,o,u;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.timerId,o=r.timerType,e.next=1,"interval"===o?s(n):f(n);case 1:return u=e.sent,e.abrupt("return",{result:u});case 2:case"end":return e.stop()}},e)}));function n(e){return r.apply(this,arguments)}return n}(),set:function(){var r=e(t.mark(function e(r){var n,o,u,a,i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.delay,o=r.now,u=r.timerId,a=r.timerType,e.next=1,("interval"===a?p:d)(n,o,u);case 1:return i=e.sent,e.abrupt("return",{result:i});case 2:case"end":return e.stop()}},e)}));function n(e){return r.apply(this,arguments)}return n}()})}(r(293),r(756),r(623),r(715))},172(e){e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},79(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n},e.exports.__esModule=!0,e.exports.default=e.exports},987(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},293(e){function t(e,t,r,n,o,u,a){try{var i=e[u](a),s=i.value}catch(e){return void r(e)}i.done?t(s):Promise.resolve(s).then(n,o)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise(function(o,u){var a=e.apply(r,n);function i(e){t(a,o,u,i,s,"next",e)}function s(e){t(a,o,u,i,s,"throw",e)}i(void 0)})}},e.exports.__esModule=!0,e.exports.default=e.exports},693(e,t,r){var n=r(736);e.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},156(e){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,u,a,i=[],s=!0,c=!1;try{if(u=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=u.call(r)).done)&&(i.push(n.value),i.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return i}},e.exports.__esModule=!0,e.exports.default=e.exports},752(e){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},993(e,t,r){var n=r(546);function o(){var t,r,u="function"==typeof Symbol?Symbol:{},a=u.iterator||"@@iterator",i=u.toStringTag||"@@toStringTag";function s(e,o,u,a){var i=o&&o.prototype instanceof f?o:f,s=Object.create(i.prototype);return n(s,"_invoke",function(e,n,o){var u,a,i,s=0,f=o||[],l=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return u=e,a=0,i=t,p.n=r,c}};function d(e,n){for(a=e,i=n,r=0;!l&&s&&!o&&r<f.length;r++){var o,u=f[r],d=p.p,v=u[2];e>3?(o=v===n)&&(i=u[(a=u[4])?5:(a=3,3)],u[4]=u[5]=t):u[0]<=d&&((o=e<2&&d<u[1])?(a=0,p.v=n,p.n=u[1]):d<v&&(o=e<3||u[0]>n||n>v)&&(u[4]=e,u[5]=n,p.n=v,a=0))}if(o||e>1)return c;throw l=!0,n}return function(o,f,v){if(s>1)throw TypeError("Generator is already running");for(l&&1===f&&d(f,v),a=f,i=v;(r=a<2?t:i)||!l;){u||(a?a<3?(a>1&&(p.n=-1),d(a,i)):p.n=i:p.v=i);try{if(s=2,u){if(a||(o="next"),r=u[o]){if(!(r=r.call(u,i)))throw TypeError("iterator result is not an object");if(!r.done)return r;i=r.value,a<2&&(a=0)}else 1===a&&(r=u.return)&&r.call(u),a<2&&(i=TypeError("The iterator does not provide a '"+o+"' method"),a=1);u=t}else if((r=(l=p.n<0)?i:e.call(n,p))!==c)break}catch(e){u=t,a=1,i=e}finally{s=1}}return{value:r,done:l}}}(e,u,a),!0),s}var c={};function f(){}function l(){}function p(){}r=Object.getPrototypeOf;var d=[][a]?r(r([][a]())):(n(r={},a,function(){return this}),r),v=p.prototype=f.prototype=Object.create(d);function x(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,n(e,i,"GeneratorFunction")),e.prototype=Object.create(v),e}return l.prototype=p,n(v,"constructor",p),n(p,"constructor",l),l.displayName="GeneratorFunction",n(p,i,"GeneratorFunction"),n(v),n(v,i,"Generator"),n(v,a,function(){return this}),n(v,"toString",function(){return"[object Generator]"}),(e.exports=o=function(){return{w:s,m:x}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},869(e,t,r){var n=r(887);e.exports=function(e,t,r,o,u){var a=n(e,t,r,o,u);return a.next().then(function(e){return e.done?e.value:a.next()})},e.exports.__esModule=!0,e.exports.default=e.exports},887(e,t,r){var n=r(993),o=r(791);e.exports=function(e,t,r,u,a){return new o(n().w(e,t,r,u),a||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},791(e,t,r){var n=r(172),o=r(546);e.exports=function e(t,r){function u(e,o,a,i){try{var s=t[e](o),c=s.value;return c instanceof n?r.resolve(c.v).then(function(e){u("next",e,a,i)},function(e){u("throw",e,a,i)}):r.resolve(c).then(function(e){s.value=e,a(s)},function(e){return u("throw",e,a,i)})}catch(e){i(e)}}var a;this.next||(o(e.prototype),o(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),o(this,"_invoke",function(e,t,n){function o(){return new r(function(t,r){u(e,n,t,r)})}return a=a?a.then(o,o):o()},!0)},e.exports.__esModule=!0,e.exports.default=e.exports},546(e){function t(r,n,o,u){var a=Object.defineProperty;try{a({},"",{})}catch(r){a=0}e.exports=t=function(e,r,n,o){function u(r,n){t(e,r,function(e){return this._invoke(r,n,e)})}r?a?a(e,r,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[r]=n:(u("next",0),u("throw",1),u("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n,o,u)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},373(e){e.exports=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},633(e,t,r){var n=r(172),o=r(993),u=r(869),a=r(887),i=r(791),s=r(373),c=r(579);function f(){"use strict";var t=o(),r=t.m(f),l=(Object.getPrototypeOf?Object.getPrototypeOf(r):r.__proto__).constructor;function p(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===l||"GeneratorFunction"===(t.displayName||t.name))}var d={throw:1,return:2,break:3,continue:3};function v(e){var t,r;return function(n){t||(t={stop:function(){return r(n.a,2)},catch:function(){return n.v},abrupt:function(e,t){return r(n.a,d[e],t)},delegateYield:function(e,o,u){return t.resultName=o,r(n.d,c(e),u)},finish:function(e){return r(n.f,e)}},r=function(e,r,o){n.p=t.prev,n.n=t.next;try{return e(r,o)}finally{t.next=n.n}}),t.resultName&&(t[t.resultName]=n.v,t.resultName=void 0),t.sent=n.v,t.next=n.n;try{return e.call(this,t)}finally{n.p=t.prev,n.n=t.next}}}return(e.exports=f=function(){return{wrap:function(e,r,n,o){return t.w(v(e),r,n,o&&o.reverse())},isGeneratorFunction:p,mark:t.m,awrap:function(e,t){return new n(e,t)},AsyncIterator:i,async:function(e,t,r,n,o){return(p(t)?a:u)(v(e),t,r,n,o)},keys:s,values:c}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=f,e.exports.__esModule=!0,e.exports.default=e.exports},579(e,t,r){var n=r(738).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(n(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},715(e,t,r){var n=r(987),o=r(156),u=r(122),a=r(752);e.exports=function(e,t){return n(e)||o(e,t)||u(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},45(e,t,r){var n=r(738).default;e.exports=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},736(e,t,r){var n=r(738).default,o=r(45);e.exports=function(e){var t=o(e,"string");return"symbol"==n(t)?t:t+""},e.exports.__esModule=!0,e.exports.default=e.exports},738(e){function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},122(e,t,r){var n=r(79);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},756(e,t,r){var n=r(633)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var u=t[n]={exports:{}};return e[n].call(u.exports,u,u.exports,r),u.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";r(472)})()})();`,i=r(e.load,n),s=function(d){return i().clearInterval(d)},o=function(d){return i().clearTimeout(d)},u=function(){var d;return(d=i()).setInterval.apply(d,arguments)},c=function(){var d;return(d=i()).setTimeout.apply(d,arguments)};t.clearInterval=s,t.clearTimeout=o,t.setInterval=u,t.setTimeout=c}))});var Gn=H(_r=>{"use strict";x();P();T();Object.defineProperty(_r,"__esModule",{value:!0});_r.isReactNativeBrowser=_r.isWebWorker=void 0;var eE=()=>typeof window<"u"?typeof navigator<"u"&&navigator.userAgent?.toLowerCase().indexOf(" electron/")>-1&&L?.versions?!Object.prototype.hasOwnProperty.call(L.versions,"electron"):typeof window.document<"u":!1,jp=()=>!!(typeof self=="object"&&self?.constructor?.name?.includes("WorkerGlobalScope")&&typeof Deno>"u"),$p=()=>typeof navigator<"u"&&navigator.product==="ReactNative",tE=eE()||jp()||$p();_r.isWebWorker=jp();_r.isReactNativeBrowser=$p();_r.default=tE});var zp=H(Mt=>{"use strict";x();P();T();var rE=Mt&&Mt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),nE=Mt&&Mt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),iE=Mt&&Mt.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&rE(r,e,n[i]);return nE(r,e),r}})();Object.defineProperty(Mt,"__esModule",{value:!0});var Wp=Fp(),Ta=iE(Gn()),Vp={set:Wp.setInterval,clear:Wp.clearInterval},Hp={set:(t,e)=>setInterval(t,e),clear:t=>clearInterval(t)},oE=t=>{switch(t){case"native":return Hp;case"worker":return Vp;case"auto":default:return Ta.default&&!Ta.isWebWorker&&!Ta.isReactNativeBrowser?Vp:Hp}};Mt.default=oE});var Oa=H(Qn=>{"use strict";x();P();T();var sE=Qn&&Qn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Qn,"__esModule",{value:!0});var aE=sE(zp()),Pa=class{_keepalive;timerId;timer;destroyed=!1;counter;client;_keepaliveTimeoutTimestamp;_intervalEvery;get keepaliveTimeoutTimestamp(){return this._keepaliveTimeoutTimestamp}get intervalEvery(){return this._intervalEvery}get keepalive(){return this._keepalive}constructor(e,r){this.client=e,this.timer=typeof r=="object"&&"set"in r&&"clear"in r?r:(0,aE.default)(r),this.setKeepalive(e.keepalive)}clear(){this.timerId&&(this.timer.clear(this.timerId),this.timerId=null)}setKeepalive(e){if(e*=1e3,isNaN(e)||e<=0||e>2147483647)throw new Error(`Keepalive value must be an integer between 0 and 2147483647. Provided value is ${e}`);this._keepalive=e,this.reschedule(),this.client.log(`KeepaliveManager: set keepalive to ${e}ms`)}destroy(){this.clear(),this.destroyed=!0}reschedule(){if(this.destroyed)return;this.clear(),this.counter=0;let e=Math.ceil(this._keepalive*1.5);this._keepaliveTimeoutTimestamp=Date.now()+e,this._intervalEvery=Math.ceil(this._keepalive/2),this.timerId=this.timer.set(()=>{this.destroyed||(this.counter+=1,this.counter===2?this.client.sendPing():this.counter>2&&this.client.onKeepaliveTimeout())},this._intervalEvery)}};Qn.default=Pa});var ao=H(ct=>{"use strict";x();P();T();var uE=ct&&ct.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),lE=ct&&ct.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Xp=ct&&ct.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&uE(r,e,n[i]);return lE(r,e),r}})(),Jt=ct&&ct.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ct,"__esModule",{value:!0});var Ra=Jt(Vh()),cE=Ht(),Gp=Jt(Qh()),fE=Jt(Gt()),Qp=Xp(Ys()),Jr=Jt(Zs()),dE=Jt(cp()),hE=xn(),pE=Jt(pa()),gE=Jt(fp()),wr=Pt(),yE=dp(),bE=Jt(Oa()),Kp=Xp(Gn()),ka=globalThis.setImmediate||((...t)=>{let e=t.shift();(0,wr.nextTick)(()=>{e(...t)})}),so=65535,Yp=147,Jp={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0,subscribeBatchSize:null,writeCache:!0,timerVariant:"auto"},Ca=class t extends yE.TypedEventEmitter{static VERSION=wr.MQTTJS_VERSION;connected;disconnecting;disconnected;reconnecting;incomingStore;outgoingStore;options;queueQoSZero;_reconnectCount;log;messageIdProvider;outgoing;messageIdToTopic;noop;keepaliveManager;stream;queue;streamBuilder;_resubscribeTopics;connackTimer;reconnectTimer;_storeProcessing;_packetIdsDuringStoreProcessing;_storeProcessingQueue;_firstConnection;topicAliasRecv;topicAliasSend;_incomingQoS2Ids;_receiveMaximum;_deferredReconnect;_currentPump;connackReceived;reconnectSuppressed;_authenticationMethod;connackPacket;_serverProperties;static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}constructor(e,r){super(),this.options=r||{};for(let i in Jp)typeof this.options[i]>"u"?this.options[i]=Jp[i]:this.options[i]=r[i];this.log=this.options.log||(0,fE.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: version:",t.VERSION),Kp.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",Kp.default?"browser":"node"),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||(Ra.default.writeToStream.cacheNumbers=!1),this.streamBuilder=e,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new pE.default:this.options.messageIdProvider,this.outgoingStore=r.outgoingStore||new Jr.default,this.incomingStore=r.incomingStore||new Jr.default,this._incomingQoS2Ids=new Set,this._receiveMaximum=so;let n=r.properties?.receiveMaximum;n!==void 0&&(Number.isInteger(n)&&n>=1&&n<=so?this._receiveMaximum=n:this.log("MqttClient :: options.properties.receiveMaximum %o is not an integer between 1 and %d, enforcing and advertising %d instead",n,so,so)),this.queueQoSZero=r.queueQoSZero===void 0?!0:r.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.keepaliveManager=null,this.connected=!1,this.disconnecting=!1,this.reconnecting=!1,this.queue=[],this.connackTimer=null,this.connackReceived=!1,this.reconnectSuppressed=!1,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,r.properties&&r.properties.topicAliasMaximum>0&&(r.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new gE.default(r.properties.topicAliasMaximum)),this.on("connect",()=>{let{queue:i}=this,s=()=>{let o=i.shift();this.log("deliver :: entry %o",o);let u=null;if(!o){this._resubscribe();return}u=o.packet,this.log("deliver :: call _sendPacket for %o",u);let c=!0;u.messageId&&u.messageId!==0&&(this.messageIdProvider.register(u.messageId)||(c=!1)),c?this._sendPacket(u,f=>{o.cb&&o.cb(f),s()}):(this.log("messageId: %d has already used. The message is skipped and removed.",u.messageId),s())};this.log("connect :: sending queued packets"),s()}),this.on("close",()=>{this.log("close :: connected set to `false`"),this.connected=!1,this.log("close :: clearing connackTimer"),clearTimeout(this.connackTimer),this._destroyKeepaliveManager(),this._serverProperties=void 0,this.topicAliasRecv&&this.topicAliasRecv.clear(),this.log("close :: calling _setupReconnect"),this._setupReconnect()}),this.options.manualConnect||(this.log("MqttClient :: setting up stream"),this.connect())}handleAuth(e,r){r()}handleMessage(e,r){r()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}_trackIncomingQoS2Publish(e,r,n){return this._incomingQoS2Ids.has(e)?!0:this.options.protocolVersion===5&&this._incomingQoS2Ids.size>=this._receiveMaximum?(this.log("_trackIncomingQoS2Publish :: inbound QoS 2 messages exceeded receiveMaximum %d",this._receiveMaximum),n?.discardParsedPackets(),(!n||n.isCurrent())&&this._cleanUp(!0),r(),this.emit("error",new wr.ErrorWithReasonCode(`${hE.ReasonCodes[Yp]}: ${this._incomingQoS2Ids.size+1} inbound QoS 2 messages in flight, receiveMaximum is ${this._receiveMaximum}`,Yp)),!1):(this._incomingQoS2Ids.add(e),!0)}_releaseIncomingQoS2Publish(e){this._incomingQoS2Ids.delete(e)}_discardIncomingQoS2State(){if(this._incomingQoS2Ids.size!==0){this.log("_discardIncomingQoS2State :: session not resumed, dropping %d inbound QoS 2 message(s)",this._incomingQoS2Ids.size);for(let e of this._incomingQoS2Ids)this.incomingStore.del({messageId:e},this.noop);this._incomingQoS2Ids.clear()}}connect(){let e=new cE.Writable,r=Ra.default.parser(this.options),n=null,i=[],s={discardParsedPackets:()=>{i.length=0},isCurrent:()=>this._currentPump===s};this._currentPump=s,this.connackReceived=!1,this.reconnectSuppressed=!1,this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this._serverProperties=void 0,this.disconnected&&!this.reconnecting&&(this.incomingStore=this.options.incomingStore||new Jr.default,this.outgoingStore=this.options.outgoingStore||new Jr.default,this._incomingQoS2Ids.clear(),this.disconnecting=!1,this.disconnected=!1),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),r.on("packet",d=>{this.log("parser :: on packet push to packets array."),i.push(d)});let o=()=>{this.log("work :: getting next packet in queue"),this._currentPump!==s&&(this.log("work :: pump superseded, dropping %d queued packets",i.length),i.length=0);let d=i.shift();if(d)this.log("work :: packet pulled from queue"),(0,dE.default)(this,d,u,s);else{this.log("work :: no packets in queue");let h=n;n=null,this.log("work :: done flag is %s",!!h),h&&h()}},u=()=>{if(i.length)(0,wr.nextTick)(o);else{let d=n;n=null,d&&d()}};e._write=(d,h,_)=>{n=_,this.log("writable stream :: parsing buffer"),r.parse(d),o()};let c=d=>{this.log("streamErrorHandler :: error",d.message),d.code?(this.log("streamErrorHandler :: emitting error"),this.emit("error",d)):this.noop(d)};this.log("connect :: pipe stream to writable stream"),this.stream.pipe(e),this.stream.on("error",c),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 f={cmd:"connect",protocolId:this.options.protocolId,protocolVersion:this.options.protocolVersion,clean:this.options.clean,clientId:this.options.clientId,keepalive:this.options.keepalive,username:this.options.username,password:this.options.password,properties:this.options.properties?{...this.options.properties}:void 0};if(f.properties?.receiveMaximum!==void 0&&(f.properties.receiveMaximum=this._receiveMaximum),this.options.will&&(f.will={...this.options.will,payload:this.options.will?.payload}),this.topicAliasRecv&&(f.properties||(f.properties={}),this.topicAliasRecv&&(f.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._authenticationMethod=f.properties?.authenticationMethod,this._writePacket(f),r.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 d={cmd:"auth",reasonCode:0,...this.options.authPacket};this._writePacket(d)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(()=>this._onConnackTimeout(),this.options.connectTimeout),this}_onConnackTimeout(){this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this._cleanUp(!0),this.emit("error",new Error("connack timeout"))}publish(e,r,n,i){this.log("publish :: message `%s` to topic `%s`",r,e);let{options:s}=this;typeof n=="function"&&(i=n,n=null),n=n||{},n={...{qos:0,retain:!1,dup:!1},...n};let{qos:u,retain:c,dup:f,properties:d,cbStorePut:h}=n;if(this._checkDisconnecting(i))return this;let _=()=>{let y=0;if((u===1||u===2)&&(y=this._nextId(),y===null))return this.log("No messageId left"),!1;let I={cmd:"publish",topic:e,payload:r,qos:u,retain:c,messageId:y,dup:f};switch(s.protocolVersion===5&&(I.properties=d),this.log("publish :: qos",u),u){case 1:case 2:this.outgoing[I.messageId]={volatile:!1,cmd:"publish",cb:i||this.noop},this.log("MqttClient:publish: packet cmd: %s",I.cmd),this._sendPacket(I,void 0,h);break;default:this.log("MqttClient:publish: packet cmd: %s",I.cmd),this._sendPacket(I,i,h);break}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!_())&&this._storeProcessingQueue.push({invoke:_,cbStorePut:n.cbStorePut,callback:i}),this}publishAsync(e,r,n){return new Promise((i,s)=>{this.publish(e,r,n,(o,u)=>{o?s(o):i(u)})})}subscribe(e,r,n){let i=this.options.protocolVersion;typeof r=="function"&&(n=r),n=n||this.noop;let s=!1,o=[];typeof e=="string"?(e=[e],o=e):Array.isArray(e)?o=e:typeof e=="object"&&(s=e.resubscribe,delete e.resubscribe,o=Object.keys(e));let u=Qp.validateTopics(o);if(u!==null)return ka(n,new Error(`Invalid topic ${u}`)),this;if(this._checkDisconnecting(n))return this.log("subscribe: discconecting true"),this;let c={qos:0};i===5&&(c.nl=!1,c.rap=!1,c.rh=0),r={...c,...r};let{properties:f}=r,d=[],h=(I,S)=>{if(S=S||r,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,I)||this._resubscribeTopics[I].qos<S.qos||s){let b={topic:I,qos:S.qos};i===5&&(b.nl=S.nl,b.rap=S.rap,b.rh=S.rh,b.properties=f),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",b.topic,b.qos),d.push(b)}};if(Array.isArray(e)?e.forEach(I=>{this.log("subscribe: array topic %s",I),h(I)}):Object.keys(e).forEach(I=>{this.log("subscribe: object topic %s, %o",I,e[I]),h(I,e[I])}),!d.length)return n(null,[]),this;let _=(I,S)=>{let b={cmd:"subscribe",subscriptions:I,messageId:S};if(f&&(b.properties=f),this.options.resubscribe){this.log("subscribe :: resubscribe true");let w=[];I.forEach(R=>{if(this.options.reconnectPeriod>0){let A={qos:R.qos};i===5&&(A.nl=R.nl||!1,A.rap=R.rap||!1,A.rh=R.rh||0,A.properties=R.properties),this._resubscribeTopics[R.topic]=A,w.push(R.topic)}}),this.messageIdToTopic[b.messageId]=w}let m=new Promise((w,R)=>{this.outgoing[b.messageId]={volatile:!0,cmd:"subscribe",cb:(A,g)=>{if(A){R(new wr.ErrorWithSubackPacket(A.message,g));return}let{granted:O}=g;if(O.length!==I.length){R(new wr.ErrorWithSubackPacket(`Protocol error: suback granted ${O.length} reason code(s) for ${I.length} subscription(s)`,g)),this._cleanUp(!0);return}for(let v=0;v<O.length;v+=1)I[v].qos=O[v];w(g)}}});return this.log("subscribe :: call _sendPacket"),this._sendPacket(b),m},y=()=>{let I=this.options.subscribeBatchSize??d.length,S=[];for(let b=0;b<d.length;b+=I){let m=d.slice(b,b+I),w=this._nextId();if(w===null)return this.log("No messageId left"),!1;S.push(_(m,w))}return Promise.all(S).then(b=>{n(null,d,b.at(-1))}).catch(b=>{n(b,d,b.packet)}),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!y())&&this._storeProcessingQueue.push({invoke:y,callback:n}),this}subscribeAsync(e,r){return new Promise((n,i)=>{this.subscribe(e,r,(s,o)=>{s?i(s):n(o)})})}unsubscribe(e,r,n){typeof e=="string"&&(e=[e]),typeof r=="function"&&(n=r),n=n||this.noop;let i=Qp.validateTopics(e);if(i!==null)return ka(n,new Error(`Invalid topic ${i}`)),this;if(this._checkDisconnecting(n))return this;let s=()=>{let o=this._nextId();if(o===null)return this.log("No messageId left"),!1;let u={cmd:"unsubscribe",messageId:o,unsubscriptions:[]};return typeof e=="string"?u.unsubscriptions=[e]:Array.isArray(e)&&(u.unsubscriptions=e),this.options.resubscribe&&u.unsubscriptions.forEach(c=>{delete this._resubscribeTopics[c]}),typeof r=="object"&&r.properties&&(u.properties=r.properties),this.outgoing[u.messageId]={volatile:!0,cmd:"unsubscribe",cb:n},this.log("unsubscribe: call _sendPacket"),this._sendPacket(u),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!s())&&this._storeProcessingQueue.push({invoke:s,callback:n}),this}unsubscribeAsync(e,r){return new Promise((n,i)=>{this.unsubscribe(e,r,(s,o)=>{s?i(s):n(o)})})}end(e,r,n){this.log("end :: (%s)",this.options.clientId),(e==null||typeof e!="boolean")&&(n=n||r,r=e,e=!1),typeof r!="object"&&(n=n||r,r=null),this.log("end :: cb? %s",!!n),(!n||typeof n!="function")&&(n=this.noop);let i=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this._incomingQoS2Ids.clear(),this.incomingStore.close(o=>{this.outgoingStore.close(u=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),n){let c=o||u;this.log("end :: closeStores: invoking callback with args"),n(c)}})}),this._deferredReconnect?this._deferredReconnect():(this.options.reconnectPeriod===0||this.options.manualConnect)&&(this.disconnecting=!1)},s=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,e),this._cleanUp(e,()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),(0,wr.nextTick)(i)},r)};return this.disconnecting?(n(),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,s,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),s()),this)}endAsync(e,r){return new Promise((n,i)=>{this.end(e,r,s=>{s?i(s):n()})})}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 Jr.default,this.outgoingStore=this.options.outgoingStore||new Jr.default,this._incomingQoS2Ids.clear(),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 n=e.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",r,n),n.length===0){if(typeof r>"u")return new Error("Unregistered Topic Alias");if(n=this.topicAliasSend.getTopicByAlias(r),typeof n>"u")return new Error("Unregistered Topic Alias");e.topic=n}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.stream.destroyed?(this.end(()=>{this.connect()}),this.log("client already connected. disconnecting first.")):(this.log("_reconnect: calling connect"),this.connect())}_setupReconnect(){!this.disconnecting&&!this.reconnectSuppressed&&!this.reconnectTimer&&this.options.reconnectPeriod>0?(this.reconnecting||(this.log("_setupReconnect :: emit `offline` state"),this.emit("offline"),this.log("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),this.log("_setupReconnect :: setting reconnectTimer for %d ms",this.options.reconnectPeriod),this.reconnectTimer=setInterval(()=>{this.log("reconnectTimer :: reconnect triggered!"),this._reconnect()},this.options.reconnectPeriod)):this.log("_setupReconnect :: doing nothing...")}_clearReconnect(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)}_cleanUp(e,r,n={}){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 i={cmd:"disconnect",...n};this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(i,()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),ka(()=>{this.stream.end(()=>{this.log("_cleanUp :: (%s) :: stream destroyed",this.options.clientId)})})})}!this.disconnecting&&!this.reconnecting&&(this.log("_cleanUp :: client not disconnecting/reconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this._destroyKeepaliveManager(),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,n){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",e.cmd);let i=e,s;if(i.cmd==="publish"&&(i=(0,Gp.default)(e),s=this._removeTopicAliasAndRecoverTopicName(i),s))return r&&r(s);this.outgoingStore.put(i,o=>{if(o)return r&&r(o);n(),this._writePacket(e,r)})}_applyTopicAlias(e){if(this.options.protocolVersion===5&&e.cmd==="publish"){let r;e.properties&&(r=e.properties.topicAlias);let n=e.topic.toString();if(this.topicAliasSend)if(r){if(n.length!==0&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",n,r),!this.topicAliasSend.put(n,r)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",n,r),new Error("Sending Topic Alias out of range")}else n.length!==0&&(this.options.autoAssignTopicAlias?(r=this.topicAliasSend.getAliasByTopic(n),r?(e.topic="",e.properties={...e.properties,topicAlias:r},this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",n,r)):(r=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(n,r),e.properties={...e.properties,topicAlias:r},this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",n,r))):this.options.autoUseTopicAlias&&(r=this.topicAliasSend.getAliasByTopic(n),r&&(e.topic="",e.properties={...e.properties,topicAlias:r},this.log("applyTopicAlias :: auto use topic: %s - alias: %d",n,r))));else if(r)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",n,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.log("_writePacket :: writing to stream");let n=Ra.default.writeToStream(e,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",n),!n&&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,n,i){this.log("_sendPacket :: (%s) :: start",this.options.clientId),n=n||this.noop,r=r||this.noop;let s=this._applyTopicAlias(e);if(s){r(s);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,n);return}if(i){this._writePacket(e,r);return}switch(e.cmd){case"publish":break;case"pubrel":this._storeAndSend(e,r,n);return;default:this._writePacket(e,r);return}switch(e.qos){case 2:case 1:this._storeAndSend(e,r,n);break;case 0:default:this._writePacket(e,r);break}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}_storePacket(e,r,n){this.log("_storePacket :: packet: %o",e),this.log("_storePacket :: cb? %s",!!r),n=n||this.noop;let i=e;if(i.cmd==="publish"){i=(0,Gp.default)(e);let o=this._removeTopicAliasAndRecoverTopicName(i);if(o)return r&&r(o)}let s=i.qos||0;s===0&&this.queueQoSZero||i.cmd!=="publish"?this.queue.push({packet:i,cb:r}):s>0?(r=this.outgoing[i.messageId]?this.outgoing[i.messageId].cb:null,this.outgoingStore.put(i,o=>{if(o)return r&&r(o);n()})):r&&r(new Error("No connection to broker"))}get serverProperties(){return this._serverProperties}get keepalive(){let e=this.connected?this._serverProperties?.serverKeepAlive:void 0;return e&&this.options.keepalive?e:this.options.keepalive}_setupKeepaliveManager(){this.log("_setupKeepaliveManager :: keepalive %d (seconds)",this.keepalive),!this.keepaliveManager&&this.keepalive&&(this.keepaliveManager=new bE.default(this,this.options.timerVariant))}_destroyKeepaliveManager(){this.keepaliveManager&&(this.log("_destroyKeepaliveManager :: destroying keepalive manager"),this.keepaliveManager.destroy(),this.keepaliveManager=null)}reschedulePing(e=!1){this.keepaliveManager&&this.keepalive&&(e||this.options.reschedulePings)&&this._reschedulePing()}_reschedulePing(){this.log("_reschedulePing :: rescheduling ping"),this.keepaliveManager.reschedule()}sendPing(){this.log("_sendPing :: sending pingreq"),this._sendPacket({cmd:"pingreq"})}onKeepaliveTimeout(){this.log("onKeepaliveTimeout :: calling _cleanUp with force true"),this._cleanUp(!0),this.emit("error",new Error("Keepalive timeout"))}_resubscribe(){this.log("_resubscribe");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 n={};n[e[r]]=this._resubscribeTopics[e[r]],n.resubscribe=!0,this.subscribe(n,{properties:n[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.options.clean&&(this.options.protocolVersion<4||e.sessionPresent===!0)||this._discardIncomingQoS2State(),this.messageIdProvider.clear(),this.connected=!0,this._setupKeepaliveManager();let n=()=>{let i=this.outgoingStore.createStream(),s=()=>{i.destroy(),i=null,this._flushStoreProcessingQueue(),o()},o=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",s),i.on("error",c=>{o(),this._flushStoreProcessingQueue(),this.removeListener("close",s),this.emit("error",c)});let u=()=>{if(!i)return;let c=i.read(1),f;if(!c){i.once("readable",u);return}if(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[c.messageId]){u();return}!this.disconnecting&&!this.reconnectTimer?(f=this.outgoing[c.messageId]?this.outgoing[c.messageId].cb:null,this.outgoing[c.messageId]={volatile:!1,cmd:c.cmd,cb(d,h){f&&f(d,h),u()}},this._packetIdsDuringStoreProcessing[c.messageId]=!0,this.messageIdProvider.register(c.messageId)?this._sendPacket(c,void 0,void 0,!0):this.log("messageId: %d has already used.",c.messageId)):i.destroy&&i.destroy()};i.on("end",()=>{let c=!0;for(let f in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[f]){c=!1;break}this.removeListener("close",s),c?(o(),this._invokeAllStoreProcessingQueue(),this.emit("connect",e)):n()}),u()};n()}_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},(n,i)=>{r(n,i),this.messageIdProvider.deallocate(e),this._invokeStoreProcessingQueue()})}};ct.default=Ca});var Zp=H(Ba=>{"use strict";x();P();T();Object.defineProperty(Ba,"__esModule",{value:!0});var mE=ua(),Ma=class{numberAllocator;lastId;constructor(){this.numberAllocator=new mE.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()}};Ba.default=Ma});function _E(){if(eg)return Na;eg=!0;let t=2147483647,e=36,r=1,n=26,i=38,s=700,o=72,u=128,c="-",f=/^xn--/,d=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,_={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},y=e-r,I=Math.floor,S=String.fromCharCode;function b($){throw new RangeError(_[$])}function m($,G){let J=[],ee=$.length;for(;ee--;)J[ee]=G($[ee]);return J}function w($,G){let J=$.split("@"),ee="";J.length>1&&(ee=J[0]+"@",$=J[1]),$=$.replace(h,".");let z=$.split("."),W=m(z,G).join(".");return ee+W}function R($){let G=[],J=0,ee=$.length;for(;J<ee;){let z=$.charCodeAt(J++);if(z>=55296&&z<=56319&&J<ee){let W=$.charCodeAt(J++);(W&64512)==56320?G.push(((z&1023)<<10)+(W&1023)+65536):(G.push(z),J--)}else G.push(z)}return G}let A=$=>String.fromCodePoint(...$),g=function($){return $>=48&&$<58?26+($-48):$>=65&&$<91?$-65:$>=97&&$<123?$-97:e},O=function($,G){return $+22+75*($<26)-((G!=0)<<5)},v=function($,G,J){let ee=0;for($=J?I($/s):$>>1,$+=I($/G);$>y*n>>1;ee+=e)$=I($/y);return I(ee+(y+1)*$/($+i))},B=function($){let G=[],J=$.length,ee=0,z=u,W=o,te=$.lastIndexOf(c);te<0&&(te=0);for(let Y=0;Y<te;++Y)$.charCodeAt(Y)>=128&&b("not-basic"),G.push($.charCodeAt(Y));for(let Y=te>0?te+1:0;Y<J;){let X=ee;for(let Z=1,ne=e;;ne+=e){Y>=J&&b("invalid-input");let de=g($.charCodeAt(Y++));de>=e&&b("invalid-input"),de>I((t-ee)/Z)&&b("overflow"),ee+=de*Z;let me=ne<=W?r:ne>=W+n?n:ne-W;if(de<me)break;let ye=e-me;Z>I(t/ye)&&b("overflow"),Z*=ye}let ce=G.length+1;W=v(ee-X,ce,X==0),I(ee/ce)>t-z&&b("overflow"),z+=I(ee/ce),ee%=ce,G.splice(ee++,0,z)}return String.fromCodePoint(...G)},D=function($){let G=[];$=R($);let J=$.length,ee=u,z=0,W=o;for(let X of $)X<128&&G.push(S(X));let te=G.length,Y=te;for(te&&G.push(c);Y<J;){let X=t;for(let Z of $)Z>=ee&&Z<X&&(X=Z);let ce=Y+1;X-ee>I((t-z)/ce)&&b("overflow"),z+=(X-ee)*ce,ee=X;for(let Z of $)if(Z<ee&&++z>t&&b("overflow"),Z===ee){let ne=z;for(let de=e;;de+=e){let me=de<=W?r:de>=W+n?n:de-W;if(ne<me)break;let ye=ne-me,Ae=e-me;G.push(S(O(me+ye%Ae,0))),ne=I(ye/Ae)}G.push(S(O(ne,0))),W=v(z,ce,Y===te),z=0,++Y}++z,++ee}return G.join("")};return Na={version:"2.3.1",ucs2:{decode:R,encode:A},decode:B,encode:D,toASCII:function($){return w($,function(G){return d.test(G)?"xn--"+D(G):G})},toUnicode:function($){return w($,function(G){return f.test(G)?B(G.slice(4).toLowerCase()):G})}},Na}var Na,eg,Xt,qL,DL,UL,FL,jL,$L,tg=$e(()=>{x();P();T();Na={},eg=!1;Xt=_E(),qL=Xt.decode,DL=Xt.encode,UL=Xt.toASCII,FL=Xt.toUnicode,jL=Xt.ucs2,$L=Xt.version});function wE(){return rg||(rg=!0,La=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,r);if(o.value!==i||o.enumerable!==!0)return!1}return!0}),La}function vE(){return ng||(ng=!0,qa=Error),qa}function SE(){return ig||(ig=!0,Da=EvalError),Da}function EE(){return og||(og=!0,Ua=RangeError),Ua}function AE(){return sg||(sg=!0,Fa=ReferenceError),Fa}function Eg(){return ag||(ag=!0,ja=SyntaxError),ja}function Xr(){return ug||(ug=!0,$a=TypeError),$a}function IE(){return lg||(lg=!0,Wa=URIError),Wa}function xE(){if(cg)return Va;cg=!0;var t=typeof Symbol<"u"&&Symbol,e=wE();return Va=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},Va}function TE(){if(fg)return Ha;fg=!0;var t={__proto__:null,foo:{}},e=Object;return Ha=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof e)},Ha}function PE(){if(dg)return za;dg=!0;var t="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,r=Math.max,n="[object Function]",i=function(c,f){for(var d=[],h=0;h<c.length;h+=1)d[h]=c[h];for(var _=0;_<f.length;_+=1)d[_+c.length]=f[_];return d},s=function(c,f){for(var d=[],h=f,_=0;h<c.length;h+=1,_+=1)d[_]=c[h];return d},o=function(u,c){for(var f="",d=0;d<u.length;d+=1)f+=u[d],d+1<u.length&&(f+=c);return f};return za=function(c){var f=this;if(typeof f!="function"||e.apply(f)!==n)throw new TypeError(t+f);for(var d=s(arguments,1),h,_=function(){if(this instanceof h){var m=f.apply(this,i(d,arguments));return Object(m)===m?m:this}return f.apply(c,i(d,arguments))},y=r(0,f.length-d.length),I=[],S=0;S<y;S++)I[S]="$"+S;if(h=Function("binder","return function ("+o(I,",")+"){ return binder.apply(this,arguments); }")(_),f.prototype){var b=function(){};b.prototype=f.prototype,h.prototype=new b,b.prototype=null}return h},za}function ru(){if(hg)return Ga;hg=!0;var t=PE();return Ga=Function.prototype.bind||t,Ga}function OE(){if(pg)return Qa;pg=!0;var t=Function.prototype.call,e=Object.prototype.hasOwnProperty,r=ru();return Qa=r.call(t,e),Qa}function vr(){if(gg)return Ka;gg=!0;var t,e=vE(),r=SE(),n=EE(),i=AE(),s=Eg(),o=Xr(),u=IE(),c=Function,f=function(z){try{return c('"use strict"; return ('+z+").constructor;")()}catch{}},d=Object.getOwnPropertyDescriptor;if(d)try{d({},"")}catch{d=null}var h=function(){throw new o},_=d?(function(){try{return arguments.callee,h}catch{try{return d(arguments,"callee").get}catch{return h}}})():h,y=xE()(),I=TE()(),S=Object.getPrototypeOf||(I?function(z){return z.__proto__}:null),b={},m=typeof Uint8Array>"u"||!S?t:S(Uint8Array),w={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":y&&S?S([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":b,"%AsyncGenerator%":b,"%AsyncGeneratorFunction%":b,"%AsyncIteratorPrototype%":b,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":e,"%eval%":eval,"%EvalError%":r,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":c,"%GeneratorFunction%":b,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":y&&S?S(S([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!y||!S?t:S(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":n,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!y||!S?t:S(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":y&&S?S(""[Symbol.iterator]()):t,"%Symbol%":y?Symbol:t,"%SyntaxError%":s,"%ThrowTypeError%":_,"%TypedArray%":m,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet};if(S)try{null.error}catch(z){var R=S(S(z));w["%Error.prototype%"]=R}var A=function z(W){var te;if(W==="%AsyncFunction%")te=f("async function () {}");else if(W==="%GeneratorFunction%")te=f("function* () {}");else if(W==="%AsyncGeneratorFunction%")te=f("async function* () {}");else if(W==="%AsyncGenerator%"){var Y=z("%AsyncGeneratorFunction%");Y&&(te=Y.prototype)}else if(W==="%AsyncIteratorPrototype%"){var X=z("%AsyncGenerator%");X&&S&&(te=S(X.prototype))}return w[W]=te,te},g={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=ru(),v=OE(),B=O.call(Function.call,Array.prototype.concat),D=O.call(Function.apply,Array.prototype.splice),q=O.call(Function.call,String.prototype.replace),K=O.call(Function.call,String.prototype.slice),U=O.call(Function.call,RegExp.prototype.exec),$=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,G=/\\(\\)?/g,J=function(W){var te=K(W,0,1),Y=K(W,-1);if(te==="%"&&Y!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(Y==="%"&&te!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var X=[];return q(W,$,function(ce,Z,ne,de){X[X.length]=ne?q(de,G,"$1"):Z||ce}),X},ee=function(W,te){var Y=W,X;if(v(g,Y)&&(X=g[Y],Y="%"+X[0]+"%"),v(w,Y)){var ce=w[Y];if(ce===b&&(ce=A(Y)),typeof ce>"u"&&!te)throw new o("intrinsic "+W+" exists, but is not available. Please file an issue!");return{alias:X,name:Y,value:ce}}throw new s("intrinsic "+W+" does not exist!")};return Ka=function(W,te){if(typeof W!="string"||W.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof te!="boolean")throw new o('"allowMissing" argument must be a boolean');if(U(/^%?[^%]*%?$/,W)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Y=J(W),X=Y.length>0?Y[0]:"",ce=ee("%"+X+"%",te),Z=ce.name,ne=ce.value,de=!1,me=ce.alias;me&&(X=me[0],D(Y,B([0,1],me)));for(var ye=1,Ae=!0;ye<Y.length;ye+=1){var we=Y[ye],ve=K(we,0,1),Pe=K(we,-1);if((ve==='"'||ve==="'"||ve==="`"||Pe==='"'||Pe==="'"||Pe==="`")&&ve!==Pe)throw new s("property names with quotes must have matching quotes");if((we==="constructor"||!Ae)&&(de=!0),X+="."+we,Z="%"+X+"%",v(w,Z))ne=w[Z];else if(ne!=null){if(!(we in ne)){if(!te)throw new o("base intrinsic for "+W+" exists, but the property is not available.");return}if(d&&ye+1>=Y.length){var xe=d(ne,we);Ae=!!xe,Ae&&"get"in xe&&!("originalValue"in xe.get)?ne=xe.get:ne=ne[we]}else Ae=v(ne,we),ne=ne[we];Ae&&!de&&(w[Z]=ne)}}return ne},Ka}function nu(){if(yg)return Ya;yg=!0;var t=vr(),e=t("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return Ya=e,Ya}function Ag(){if(bg)return Ja;bg=!0;var t=vr(),e=t("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return Ja=e,Ja}function RE(){if(mg)return Xa;mg=!0;var t=nu(),e=Eg(),r=Xr(),n=Ag();return Xa=function(s,o,u){if(!s||typeof s!="object"&&typeof s!="function")throw new r("`obj` must be an object or a function`");if(typeof o!="string"&&typeof o!="symbol")throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new r("`loose`, if provided, must be a boolean");var c=arguments.length>3?arguments[3]:null,f=arguments.length>4?arguments[4]:null,d=arguments.length>5?arguments[5]:null,h=arguments.length>6?arguments[6]:!1,_=!!n&&n(s,o);if(t)t(s,o,{configurable:d===null&&_?_.configurable:!d,enumerable:c===null&&_?_.enumerable:!c,value:u,writable:f===null&&_?_.writable:!f});else if(h||!c&&!f&&!d)s[o]=u;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Xa}function kE(){if(_g)return Za;_g=!0;var t=nu(),e=function(){return!!t};return e.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},Za=e,Za}function CE(){if(wg)return eu;wg=!0;var t=vr(),e=RE(),r=kE()(),n=Ag(),i=Xr(),s=t("%Math.floor%");return eu=function(u,c){if(typeof u!="function")throw new i("`fn` is not a function");if(typeof c!="number"||c<0||c>4294967295||s(c)!==c)throw new i("`length` must be a positive 32-bit integer");var f=arguments.length>2&&!!arguments[2],d=!0,h=!0;if("length"in u&&n){var _=n(u,"length");_&&!_.configurable&&(d=!1),_&&!_.writable&&(h=!1)}return(d||h||!f)&&(r?e(u,"length",c,!0,!0):e(u,"length",c)),u},eu}function ME(){if(vg)return Kn;vg=!0;var t=ru(),e=vr(),r=CE(),n=Xr(),i=e("%Function.prototype.apply%"),s=e("%Function.prototype.call%"),o=e("%Reflect.apply%",!0)||t.call(s,i),u=nu(),c=e("%Math.max%");Kn=function(h){if(typeof h!="function")throw new n("a function is required");var _=o(t,s,arguments);return r(_,1+c(0,h.length-(arguments.length-1)),!0)};var f=function(){return o(t,i,arguments)};return u?u(Kn,"apply",{value:f}):Kn.apply=f,Kn}function Ig(){if(Sg)return tu;Sg=!0;var t=vr(),e=ME(),r=e(t("String.prototype.indexOf"));return tu=function(i,s){var o=t(i,!!s);return typeof o=="function"&&r(i,".prototype.")>-1?e(o):o},tu}var La,rg,qa,ng,Da,ig,Ua,og,Fa,sg,ja,ag,$a,ug,Wa,lg,Va,cg,Ha,fg,za,dg,Ga,hg,Qa,pg,Ka,gg,Ya,yg,Ja,bg,Xa,mg,Za,_g,eu,wg,Kn,vg,tu,Sg,xg=$e(()=>{x();P();T();La={},rg=!1;qa={},ng=!1;Da={},ig=!1;Ua={},og=!1;Fa={},sg=!1;ja={},ag=!1;$a={},ug=!1;Wa={},lg=!1;Va={},cg=!1;Ha={},fg=!1;za={},dg=!1;Ga={},hg=!1;Qa={},pg=!1;Ka={},gg=!1;Ya={},yg=!1;Ja={},bg=!1;Xa={},mg=!1;Za={},_g=!1;eu={},wg=!1;Kn={},vg=!1;tu={},Sg=!1});function au(t){throw new Error("Node.js process "+t+" is not supported by JSPM core outside of Node.js")}function BE(){!Zr||!Sr||(Zr=!1,Sr.length?Bt=Sr.concat(Bt):uo=-1,Bt.length&&Tg())}function Tg(){if(!Zr){var t=setTimeout(BE,0);Zr=!0;for(var e=Bt.length;e;){for(Sr=Bt,Bt=[];++uo<e;)Sr&&Sr[uo].run();uo=-1,e=Bt.length}Sr=null,Zr=!1,clearTimeout(t)}}function NE(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 Pg(t,e)),Bt.length===1&&!Zr&&setTimeout(Tg,0)}function Pg(t,e){this.fun=t,this.array=e}function je(){}function XE(t){au("_linkedBinding")}function r1(t){au("dlopen")}function n1(){return[]}function i1(){return[]}function h1(t,e){if(!t)throw new Error(e||"assertion error")}function b1(){return!1}function B1(){return Zt.now()/1e3}function su(t){var e=Math.floor((Date.now()-Zt.now())*.001),r=Zt.now()*.001,n=Math.floor(r)+e,i=Math.floor(r%1*1e9);return t&&(n=n-t[0],i=i-t[1],i<0&&(n--,i+=ou)),[n,i]}function er(){return lu}function z1(t){return[]}var Bt,Zr,Sr,uo,LE,qE,DE,UE,FE,jE,$E,WE,VE,HE,zE,GE,QE,KE,YE,JE,ZE,e1,t1,o1,s1,uu,a1,u1,l1,c1,f1,d1,p1,g1,y1,m1,_1,w1,v1,S1,E1,A1,I1,x1,T1,P1,O1,R1,k1,C1,M1,Zt,iu,ou,N1,L1,q1,D1,U1,F1,j1,$1,W1,V1,H1,lu,cu=$e(()=>{x();P();T();Bt=[],Zr=!1,uo=-1;Pg.prototype.run=function(){this.fun.apply(null,this.array)};LE="browser",qE="x64",DE="browser",UE={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},FE=["/usr/bin/node"],jE=[],$E="v16.8.0",WE={},VE=function(t,e){console.warn((e?e+": ":"")+t)},HE=function(t){au("binding")},zE=function(t){return 0},GE=function(){return"/"},QE=function(t){},KE={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};YE=je,JE=[];ZE={},e1=!1,t1={};o1=je,s1=je,uu=function(){return{}},a1=uu,u1=uu,l1=je,c1=je,f1=je,d1={};p1={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},g1=je,y1=je;m1=je,_1=je,w1=je,v1=je,S1=je,E1=void 0,A1=void 0,I1=void 0,x1=je,T1=2,P1=1,O1="/bin/usr/node",R1=9229,k1="node",C1=[],M1=je,Zt={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};Zt.now===void 0&&(iu=Date.now(),Zt.timing&&Zt.timing.navigationStart&&(iu=Zt.timing.navigationStart),Zt.now=()=>Date.now()-iu);ou=1e9;su.bigint=function(t){var e=su(t);return typeof BigInt>"u"?e[0]*ou+e[1]:BigInt(e[0]*ou)+BigInt(e[1])};N1=10,L1={},q1=0;D1=er,U1=er,F1=er,j1=er,$1=er,W1=je,V1=er,H1=er;lu={version:$E,versions:WE,arch:qE,platform:DE,release:KE,_rawDebug:YE,moduleLoadList:JE,binding:HE,_linkedBinding:XE,_events:L1,_eventsCount:q1,_maxListeners:N1,on:er,addListener:D1,once:U1,off:F1,removeListener:j1,removeAllListeners:$1,emit:W1,prependListener:V1,prependOnceListener:H1,listeners:z1,domain:ZE,_exiting:e1,config:t1,dlopen:r1,uptime:B1,_getActiveRequests:n1,_getActiveHandles:i1,reallyExit:o1,_kill:s1,cpuUsage:uu,resourceUsage:a1,memoryUsage:u1,kill:l1,exit:c1,openStdin:f1,allowedNodeEnvironmentFlags:d1,assert:h1,features:p1,_fatalExceptions:g1,setUncaughtExceptionCaptureCallback:y1,hasUncaughtExceptionCaptureCallback:b1,emitWarning:VE,nextTick:NE,_tickCallback:m1,_debugProcess:_1,_debugEnd:w1,_startProfilerIdleNotifier:v1,_stopProfilerIdleNotifier:S1,stdout:E1,stdin:I1,stderr:A1,abort:x1,umask:zE,chdir:QE,cwd:GE,env:UE,title:LE,argv:FE,execArgv:jE,pid:T1,ppid:P1,execPath:O1,debugPort:R1,hrtime:su,argv0:k1,_preload_modules:C1,setSourceMapsEnabled:M1}});function G1(){if(Og)return fu;Og=!0;var t=lu;function e(s){if(typeof s!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(s))}function r(s,o){for(var u="",c=0,f=-1,d=0,h,_=0;_<=s.length;++_){if(_<s.length)h=s.charCodeAt(_);else{if(h===47)break;h=47}if(h===47){if(!(f===_-1||d===1))if(f!==_-1&&d===2){if(u.length<2||c!==2||u.charCodeAt(u.length-1)!==46||u.charCodeAt(u.length-2)!==46){if(u.length>2){var y=u.lastIndexOf("/");if(y!==u.length-1){y===-1?(u="",c=0):(u=u.slice(0,y),c=u.length-1-u.lastIndexOf("/")),f=_,d=0;continue}}else if(u.length===2||u.length===1){u="",c=0,f=_,d=0;continue}}o&&(u.length>0?u+="/..":u="..",c=2)}else u.length>0?u+="/"+s.slice(f+1,_):u=s.slice(f+1,_),c=_-f-1;f=_,d=0}else h===46&&d!==-1?++d:d=-1}return u}function n(s,o){var u=o.dir||o.root,c=o.base||(o.name||"")+(o.ext||"");return u?u===o.root?u+c:u+s+c:c}var i={resolve:function(){for(var o="",u=!1,c,f=arguments.length-1;f>=-1&&!u;f--){var d;f>=0?d=arguments[f]:(c===void 0&&(c=t.cwd()),d=c),e(d),d.length!==0&&(o=d+"/"+o,u=d.charCodeAt(0)===47)}return o=r(o,!u),u?o.length>0?"/"+o:"/":o.length>0?o:"."},normalize:function(o){if(e(o),o.length===0)return".";var u=o.charCodeAt(0)===47,c=o.charCodeAt(o.length-1)===47;return o=r(o,!u),o.length===0&&!u&&(o="."),o.length>0&&c&&(o+="/"),u?"/"+o:o},isAbsolute:function(o){return e(o),o.length>0&&o.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var o,u=0;u<arguments.length;++u){var c=arguments[u];e(c),c.length>0&&(o===void 0?o=c:o+="/"+c)}return o===void 0?".":i.normalize(o)},relative:function(o,u){if(e(o),e(u),o===u||(o=i.resolve(o),u=i.resolve(u),o===u))return"";for(var c=1;c<o.length&&o.charCodeAt(c)===47;++c);for(var f=o.length,d=f-c,h=1;h<u.length&&u.charCodeAt(h)===47;++h);for(var _=u.length,y=_-h,I=d<y?d:y,S=-1,b=0;b<=I;++b){if(b===I){if(y>I){if(u.charCodeAt(h+b)===47)return u.slice(h+b+1);if(b===0)return u.slice(h+b)}else d>I&&(o.charCodeAt(c+b)===47?S=b:b===0&&(S=0));break}var m=o.charCodeAt(c+b),w=u.charCodeAt(h+b);if(m!==w)break;m===47&&(S=b)}var R="";for(b=c+S+1;b<=f;++b)(b===f||o.charCodeAt(b)===47)&&(R.length===0?R+="..":R+="/..");return R.length>0?R+u.slice(h+S):(h+=S,u.charCodeAt(h)===47&&++h,u.slice(h))},_makeLong:function(o){return o},dirname:function(o){if(e(o),o.length===0)return".";for(var u=o.charCodeAt(0),c=u===47,f=-1,d=!0,h=o.length-1;h>=1;--h)if(u=o.charCodeAt(h),u===47){if(!d){f=h;break}}else d=!1;return f===-1?c?"/":".":c&&f===1?"//":o.slice(0,f)},basename:function(o,u){if(u!==void 0&&typeof u!="string")throw new TypeError('"ext" argument must be a string');e(o);var c=0,f=-1,d=!0,h;if(u!==void 0&&u.length>0&&u.length<=o.length){if(u.length===o.length&&u===o)return"";var _=u.length-1,y=-1;for(h=o.length-1;h>=0;--h){var I=o.charCodeAt(h);if(I===47){if(!d){c=h+1;break}}else y===-1&&(d=!1,y=h+1),_>=0&&(I===u.charCodeAt(_)?--_===-1&&(f=h):(_=-1,f=y))}return c===f?f=y:f===-1&&(f=o.length),o.slice(c,f)}else{for(h=o.length-1;h>=0;--h)if(o.charCodeAt(h)===47){if(!d){c=h+1;break}}else f===-1&&(d=!1,f=h+1);return f===-1?"":o.slice(c,f)}},extname:function(o){e(o);for(var u=-1,c=0,f=-1,d=!0,h=0,_=o.length-1;_>=0;--_){var y=o.charCodeAt(_);if(y===47){if(!d){c=_+1;break}continue}f===-1&&(d=!1,f=_+1),y===46?u===-1?u=_:h!==1&&(h=1):u!==-1&&(h=-1)}return u===-1||f===-1||h===0||h===1&&u===f-1&&u===c+1?"":o.slice(u,f)},format:function(o){if(o===null||typeof o!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof o);return n("/",o)},parse:function(o){e(o);var u={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return u;var c=o.charCodeAt(0),f=c===47,d;f?(u.root="/",d=1):d=0;for(var h=-1,_=0,y=-1,I=!0,S=o.length-1,b=0;S>=d;--S){if(c=o.charCodeAt(S),c===47){if(!I){_=S+1;break}continue}y===-1&&(I=!1,y=S+1),c===46?h===-1?h=S:b!==1&&(b=1):h!==-1&&(b=-1)}return h===-1||y===-1||b===0||b===1&&h===y-1&&h===_+1?y!==-1&&(_===0&&f?u.base=u.name=o.slice(1,y):u.base=u.name=o.slice(_,y)):(_===0&&f?(u.name=o.slice(1,h),u.base=o.slice(1,y)):(u.name=o.slice(_,h),u.base=o.slice(_,y)),u.ext=o.slice(h,y)),_>0?u.dir=o.slice(0,_-1):f&&(u.dir="/"),u},sep:"/",delimiter:":",win32:null,posix:null};return i.posix=i,fu=i,fu}var fu,Og,du,Rg=$e(()=>{x();P();T();cu();fu={},Og=!1;du=G1()});var $g={};Tr($g,{URL:()=>aA,Url:()=>rA,default:()=>He,fileURLToPath:()=>Fg,format:()=>nA,parse:()=>sA,pathToFileURL:()=>jg,resolve:()=>iA,resolveObject:()=>oA});function K1(){if(kg)return hu;kg=!0;var t=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&t?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=t&&e&&typeof e.get=="function"?e.get:null,n=t&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,s=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,o=i&&s&&typeof s.get=="function"?s.get:null,u=i&&Set.prototype.forEach,c=typeof WeakMap=="function"&&WeakMap.prototype,f=c?WeakMap.prototype.has:null,d=typeof WeakSet=="function"&&WeakSet.prototype,h=d?WeakSet.prototype.has:null,_=typeof WeakRef=="function"&&WeakRef.prototype,y=_?WeakRef.prototype.deref:null,I=Boolean.prototype.valueOf,S=Object.prototype.toString,b=Function.prototype.toString,m=String.prototype.match,w=String.prototype.slice,R=String.prototype.replace,A=String.prototype.toUpperCase,g=String.prototype.toLowerCase,O=RegExp.prototype.test,v=Array.prototype.concat,B=Array.prototype.join,D=Array.prototype.slice,q=Math.floor,K=typeof BigInt=="function"?BigInt.prototype.valueOf:null,U=Object.getOwnPropertySymbols,$=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,G=typeof Symbol=="function"&&typeof Symbol.iterator=="object",J=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===G||!0)?Symbol.toStringTag:null,ee=Object.prototype.propertyIsEnumerable,z=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(k){return k.__proto__}:null);function W(k,M){if(k===1/0||k===-1/0||k!==k||k&&k>-1e3&&k<1e3||O.call(/e/,M))return M;var re=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof k=="number"){var ie=k<0?-q(-k):q(k);if(ie!==k){var oe=String(ie),fe=w.call(M,oe.length+1);return R.call(oe,re,"$&_")+"."+R.call(R.call(fe,/([0-9]{3})/g,"$&_"),/_$/,"")}}return R.call(M,re,"$&_")}var te=Q1,Y=te.custom,X=Pe(Y)?Y:null;hu=function k(M,re,ie,oe){var fe=re||{};if(Oe(fe,"quoteStyle")&&fe.quoteStyle!=="single"&&fe.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Oe(fe,"maxStringLength")&&(typeof fe.maxStringLength=="number"?fe.maxStringLength<0&&fe.maxStringLength!==1/0:fe.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Lt=Oe(fe,"customInspect")?fe.customInspect:!0;if(typeof Lt!="boolean"&&Lt!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Oe(fe,"indent")&&fe.indent!==null&&fe.indent!==" "&&!(parseInt(fe.indent,10)===fe.indent&&fe.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Oe(fe,"numericSeparator")&&typeof fe.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var nr=fe.numericSeparator;if(typeof M>"u")return"undefined";if(M===null)return"null";if(typeof M=="boolean")return M?"true":"false";if(typeof M=="string")return it(M,fe);if(typeof M=="number"){if(M===0)return 1/0/M>0?"0":"-0";var Qe=String(M);return nr?W(M,Qe):Qe}if(typeof M=="bigint"){var qt=String(M)+"n";return nr?W(M,qt):qt}var go=typeof fe.depth>"u"?5:fe.depth;if(typeof ie>"u"&&(ie=0),ie>=go&&go>0&&typeof M=="object")return ne(M)?"[Array]":"[Object]";var Ir=C(fe,ie);if(typeof oe>"u")oe=[];else if(wt(oe,M)>=0)return"[Circular]";function ot(xr,ii,fy){if(ii&&(oe=D.call(oe),oe.push(ii)),fy){var Ku={depth:fe.depth};return Oe(fe,"quoteStyle")&&(Ku.quoteStyle=fe.quoteStyle),k(xr,Ku,ie+1,oe)}return k(xr,fe,ie+1,oe)}if(typeof M=="function"&&!me(M)){var $u=_t(M),Wu=F(M,ot);return"[Function"+($u?": "+$u:" (anonymous)")+"]"+(Wu.length>0?" { "+B.call(Wu,", ")+" }":"")}if(Pe(M)){var Vu=G?R.call(String(M),/^(Symbol\(.*\))_[^)]*$/,"$1"):$.call(M);return typeof M=="object"&&!G?p(Vu):Vu}if(ho(M)){for(var on="<"+g.call(String(M.nodeName)),yo=M.attributes||[],ni=0;ni<yo.length;ni++)on+=" "+yo[ni].name+"="+ce(Z(yo[ni].value),"double",fe);return on+=">",M.childNodes&&M.childNodes.length&&(on+="..."),on+="</"+g.call(String(M.nodeName))+">",on}if(ne(M)){if(M.length===0)return"[]";var bo=F(M,ot);return Ir&&!E(bo)?"["+N(bo,Ir)+"]":"[ "+B.call(bo,", ")+" ]"}if(ye(M)){var mo=F(M,ot);return!("cause"in Error.prototype)&&"cause"in M&&!ee.call(M,"cause")?"{ ["+String(M)+"] "+B.call(v.call("[cause]: "+ot(M.cause),mo),", ")+" }":mo.length===0?"["+String(M)+"]":"{ ["+String(M)+"] "+B.call(mo,", ")+" }"}if(typeof M=="object"&&Lt){if(X&&typeof M[X]=="function"&&te)return te(M,{depth:go-ie});if(Lt!=="symbol"&&typeof M.inspect=="function")return M.inspect()}if(rn(M)){var Hu=[];return n&&n.call(M,function(xr,ii){Hu.push(ot(ii,M,!0)+" => "+ot(xr,M))}),l("Map",r.call(M),Hu,Ir)}if(Je(M)){var zu=[];return u&&u.call(M,function(xr){zu.push(ot(xr,M))}),l("Set",o.call(M),zu,Ir)}if(ri(M))return a("WeakMap");if(nn(M))return a("WeakSet");if(Ar(M))return a("WeakRef");if(we(M))return p(ot(Number(M)));if(xe(M))return p(ot(K.call(M)));if(ve(M))return p(I.call(M));if(Ae(M))return p(ot(String(M)));if(typeof window<"u"&&M===window)return"{ [object Window] }";if(typeof globalThis<"u"&&M===globalThis||typeof pu<"u"&&M===pu)return"{ [object globalThis] }";if(!de(M)&&!me(M)){var _o=F(M,ot),Gu=z?z(M)===Object.prototype:M instanceof Object||M.constructor===Object,wo=M instanceof Object?"":"null prototype",Qu=!Gu&&J&&Object(M)===M&&J in M?w.call(Be(M),8,-1):wo?"Object":"",cy=Gu||typeof M.constructor!="function"?"":M.constructor.name?M.constructor.name+" ":"",vo=cy+(Qu||wo?"["+B.call(v.call([],Qu||[],wo||[]),": ")+"] ":"");return _o.length===0?vo+"{}":Ir?vo+"{"+N(_o,Ir)+"}":vo+"{ "+B.call(_o,", ")+" }"}return String(M)};function ce(k,M,re){var ie=(re.quoteStyle||M)==="double"?'"':"'";return ie+k+ie}function Z(k){return R.call(String(k),/"/g,"&quot;")}function ne(k){return Be(k)==="[object Array]"&&(!J||!(typeof k=="object"&&J in k))}function de(k){return Be(k)==="[object Date]"&&(!J||!(typeof k=="object"&&J in k))}function me(k){return Be(k)==="[object RegExp]"&&(!J||!(typeof k=="object"&&J in k))}function ye(k){return Be(k)==="[object Error]"&&(!J||!(typeof k=="object"&&J in k))}function Ae(k){return Be(k)==="[object String]"&&(!J||!(typeof k=="object"&&J in k))}function we(k){return Be(k)==="[object Number]"&&(!J||!(typeof k=="object"&&J in k))}function ve(k){return Be(k)==="[object Boolean]"&&(!J||!(typeof k=="object"&&J in k))}function Pe(k){if(G)return k&&typeof k=="object"&&k instanceof Symbol;if(typeof k=="symbol")return!0;if(!k||typeof k!="object"||!$)return!1;try{return $.call(k),!0}catch{}return!1}function xe(k){if(!k||typeof k!="object"||!K)return!1;try{return K.call(k),!0}catch{}return!1}var nt=Object.prototype.hasOwnProperty||function(k){return k in(this||pu)};function Oe(k,M){return nt.call(k,M)}function Be(k){return S.call(k)}function _t(k){if(k.name)return k.name;var M=m.call(b.call(k),/^function\s*([\w$]+)/);return M?M[1]:null}function wt(k,M){if(k.indexOf)return k.indexOf(M);for(var re=0,ie=k.length;re<ie;re++)if(k[re]===M)return re;return-1}function rn(k){if(!r||!k||typeof k!="object")return!1;try{r.call(k);try{o.call(k)}catch{return!0}return k instanceof Map}catch{}return!1}function ri(k){if(!f||!k||typeof k!="object")return!1;try{f.call(k,f);try{h.call(k,h)}catch{return!0}return k instanceof WeakMap}catch{}return!1}function Ar(k){if(!y||!k||typeof k!="object")return!1;try{return y.call(k),!0}catch{}return!1}function Je(k){if(!o||!k||typeof k!="object")return!1;try{o.call(k);try{r.call(k)}catch{return!0}return k instanceof Set}catch{}return!1}function nn(k){if(!h||!k||typeof k!="object")return!1;try{h.call(k,h);try{f.call(k,f)}catch{return!0}return k instanceof WeakSet}catch{}return!1}function ho(k){return!k||typeof k!="object"?!1:typeof HTMLElement<"u"&&k instanceof HTMLElement?!0:typeof k.nodeName=="string"&&typeof k.getAttribute=="function"}function it(k,M){if(k.length>M.maxStringLength){var re=k.length-M.maxStringLength,ie="... "+re+" more character"+(re>1?"s":"");return it(w.call(k,0,M.maxStringLength),M)+ie}var oe=R.call(R.call(k,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,po);return ce(oe,"single",M)}function po(k){var M=k.charCodeAt(0),re={8:"b",9:"t",10:"n",12:"f",13:"r"}[M];return re?"\\"+re:"\\x"+(M<16?"0":"")+A.call(M.toString(16))}function p(k){return"Object("+k+")"}function a(k){return k+" { ? }"}function l(k,M,re,ie){var oe=ie?N(re,ie):B.call(re,", ");return k+" ("+M+") {"+oe+"}"}function E(k){for(var M=0;M<k.length;M++)if(wt(k[M],`
1
+ "use strict";var mqtt=(()=>{var Io=Object.defineProperty;var _y=Object.getOwnPropertyDescriptor;var wy=Object.getOwnPropertyNames;var vy=Object.prototype.hasOwnProperty;var je=(t,e)=>()=>(t&&(e=t(t=0)),e);var H=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Tr=(t,e)=>{for(var r in e)Io(t,r,{get:e[r],enumerable:!0})},Sy=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of wy(e))!vy.call(t,i)&&i!==r&&Io(t,i,{get:()=>e[i],enumerable:!(n=_y(e,i))||n.enumerable});return t};var ge=t=>Sy(Io({},"__esModule",{value:!0}),t);var x=je(()=>{});function To(t){throw new Error("Node.js process "+t+" is not supported by JSPM core outside of Node.js")}function Ey(){!Or||!sr||(Or=!1,sr.length?vt=sr.concat(vt):si=-1,vt.length&&rl())}function rl(){if(!Or){var t=setTimeout(Ey,0);Or=!0;for(var e=vt.length;e;){for(sr=vt,vt=[];++si<e;)sr&&sr[si].run();si=-1,e=vt.length}sr=null,Or=!1,clearTimeout(t)}}function Ay(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 nl(t,e)),vt.length===1&&!Or&&setTimeout(rl,0)}function nl(t,e){this.fun=t,this.array=e}function Le(){}function vl(t){To("_linkedBinding")}function Il(t){To("dlopen")}function xl(){return[]}function Pl(){return[]}function Ll(t,e){if(!t)throw new Error(e||"assertion error")}function Fl(){return!1}function nc(){return jt.now()/1e3}function ai(t){var e=Math.floor((Date.now()-jt.now())*.001),r=jt.now()*.001,n=Math.floor(r)+e,i=Math.floor(r%1*1e9);return t&&(n=n-t[0],i=i-t[1],i<0&&(n--,i+=Po)),[n,i]}function St(){return Oo}function gc(t){return[]}var vt,Or,sr,si,il,ol,sl,al,ul,ll,cl,fl,dl,hl,pl,gl,yl,bl,ml,_l,wl,Sl,El,Al,Tl,Ol,ui,Rl,kl,Cl,Ml,Bl,Nl,ql,Dl,Ul,jl,$l,Wl,Vl,Hl,zl,Gl,Ql,Kl,Yl,Jl,Xl,Zl,ec,tc,rc,jt,xo,Po,ic,oc,sc,ac,uc,lc,cc,fc,dc,hc,pc,Oo,Ro=je(()=>{x();T();P();vt=[],Or=!1,si=-1;nl.prototype.run=function(){this.fun.apply(null,this.array)};il="browser",ol="x64",sl="browser",al={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},ul=["/usr/bin/node"],ll=[],cl="v16.8.0",fl={},dl=function(t,e){console.warn((e?e+": ":"")+t)},hl=function(t){To("binding")},pl=function(t){return 0},gl=function(){return"/"},yl=function(t){},bl={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};ml=!0,_l=Le,wl=[];Sl={},El=!1,Al={};Tl=Le,Ol=Le,ui=function(){return{}},Rl=ui,kl=ui,Cl=Le,Ml=Le,Bl=Le,Nl={};ql={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},Dl=Le,Ul=Le;jl=Le,$l=Le,Wl=Le,Vl=Le,Hl=Le,zl=void 0,Gl=void 0,Ql=void 0,Kl=Le,Yl=2,Jl=1,Xl="/bin/usr/node",Zl=9229,ec="node",tc=[],rc=Le,jt={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};jt.now===void 0&&(xo=Date.now(),jt.timing&&jt.timing.navigationStart&&(xo=jt.timing.navigationStart),jt.now=()=>Date.now()-xo);Po=1e9;ai.bigint=function(t){var e=ai(t);return typeof BigInt>"u"?e[0]*Po+e[1]:BigInt(e[0]*Po)+BigInt(e[1])};ic=10,oc={},sc=0;ac=St,uc=St,lc=St,cc=St,fc=St,dc=Le,hc=St,pc=St;Oo={version:cl,versions:fl,arch:ol,platform:sl,browser:ml,release:bl,_rawDebug:_l,moduleLoadList:wl,binding:hl,_linkedBinding:vl,_events:oc,_eventsCount:sc,_maxListeners:ic,on:St,addListener:ac,once:uc,off:lc,removeListener:cc,removeAllListeners:fc,emit:dc,prependListener:hc,prependOnceListener:pc,listeners:gc,domain:Sl,_exiting:El,config:Al,dlopen:Il,uptime:nc,_getActiveRequests:xl,_getActiveHandles:Pl,reallyExit:Tl,_kill:Ol,cpuUsage:ui,resourceUsage:Rl,memoryUsage:kl,kill:Cl,exit:Ml,openStdin:Bl,allowedNodeEnvironmentFlags:Nl,assert:Ll,features:ql,_fatalExceptions:Dl,setUncaughtExceptionCaptureCallback:Ul,hasUncaughtExceptionCaptureCallback:Fl,emitWarning:dl,nextTick:Ay,_tickCallback:jl,_debugProcess:$l,_debugEnd:Wl,_startProfilerIdleNotifier:Vl,_stopProfilerIdleNotifier:Hl,stdout:zl,stdin:Ql,stderr:Gl,abort:Kl,umask:pl,chdir:yl,cwd:gl,env:al,title:il,argv:ul,execArgv:ll,pid:Yl,ppid:Jl,execPath:Xl,debugPort:Zl,hrtime:ai,argv0:ec,_preload_modules:tc,setSourceMapsEnabled:rc}});var L={};Tr(L,{_debugEnd:()=>Wl,_debugProcess:()=>$l,_events:()=>oc,_eventsCount:()=>sc,_exiting:()=>El,_fatalExceptions:()=>Dl,_getActiveHandles:()=>Pl,_getActiveRequests:()=>xl,_kill:()=>Ol,_linkedBinding:()=>vl,_maxListeners:()=>ic,_preload_modules:()=>tc,_rawDebug:()=>_l,_startProfilerIdleNotifier:()=>Vl,_stopProfilerIdleNotifier:()=>Hl,_tickCallback:()=>jl,abort:()=>Kl,addListener:()=>ac,allowedNodeEnvironmentFlags:()=>Nl,arch:()=>ol,argv:()=>ul,argv0:()=>ec,assert:()=>Ll,binding:()=>hl,browser:()=>ml,chdir:()=>yl,config:()=>Al,cpuUsage:()=>ui,cwd:()=>gl,debugPort:()=>Zl,default:()=>xy,dlopen:()=>Il,domain:()=>Sl,emit:()=>dc,emitWarning:()=>dl,env:()=>al,execArgv:()=>ll,execPath:()=>Xl,exit:()=>Ml,features:()=>ql,hasUncaughtExceptionCaptureCallback:()=>Fl,hrtime:()=>ai,kill:()=>Cl,listeners:()=>gc,memoryUsage:()=>kl,moduleLoadList:()=>wl,nextTick:()=>yc,off:()=>lc,on:()=>St,once:()=>uc,openStdin:()=>Bl,pid:()=>Yl,platform:()=>sl,ppid:()=>Jl,prependListener:()=>hc,prependOnceListener:()=>pc,reallyExit:()=>Tl,release:()=>bl,removeAllListeners:()=>fc,removeListener:()=>cc,resourceUsage:()=>Rl,setSourceMapsEnabled:()=>rc,setUncaughtExceptionCaptureCallback:()=>Ul,stderr:()=>Gl,stdin:()=>Ql,stdout:()=>zl,title:()=>il,umask:()=>pl,uptime:()=>nc,version:()=>cl,versions:()=>fl});function yc(t,...e){Iy(()=>t(...e))}var Iy,xy,Et=je(()=>{x();T();P();Ro();Ro();Iy=typeof queueMicrotask=="function"?queueMicrotask:t=>setTimeout(t,0);xy={...Oo,nextTick:yc}});var P=je(()=>{Et()});function Py(){if(bc)return an;bc=!0,an.byteLength=u,an.toByteArray=f,an.fromByteArray=m;for(var t=[],e=[],r=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,s=n.length;i<s;++i)t[i]=n[i],e[n.charCodeAt(i)]=i;e[45]=62,e[95]=63;function o(g){var I=g.length;if(I%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var S=g.indexOf("=");S===-1&&(S=I);var b=S===I?0:4-S%4;return[S,b]}function u(g){var I=o(g),S=I[0],b=I[1];return(S+b)*3/4-b}function c(g,I,S){return(I+S)*3/4-S}function f(g){var I,S=o(g),b=S[0],_=S[1],w=new r(c(g,b,_)),R=0,A=_>0?b-4:b,y;for(y=0;y<A;y+=4)I=e[g.charCodeAt(y)]<<18|e[g.charCodeAt(y+1)]<<12|e[g.charCodeAt(y+2)]<<6|e[g.charCodeAt(y+3)],w[R++]=I>>16&255,w[R++]=I>>8&255,w[R++]=I&255;return _===2&&(I=e[g.charCodeAt(y)]<<2|e[g.charCodeAt(y+1)]>>4,w[R++]=I&255),_===1&&(I=e[g.charCodeAt(y)]<<10|e[g.charCodeAt(y+1)]<<4|e[g.charCodeAt(y+2)]>>2,w[R++]=I>>8&255,w[R++]=I&255),w}function d(g){return t[g>>18&63]+t[g>>12&63]+t[g>>6&63]+t[g&63]}function h(g,I,S){for(var b,_=[],w=I;w<S;w+=3)b=(g[w]<<16&16711680)+(g[w+1]<<8&65280)+(g[w+2]&255),_.push(d(b));return _.join("")}function m(g){for(var I,S=g.length,b=S%3,_=[],w=16383,R=0,A=S-b;R<A;R+=w)_.push(h(g,R,R+w>A?A:R+w));return b===1?(I=g[S-1],_.push(t[I>>2]+t[I<<4&63]+"==")):b===2&&(I=(g[S-2]<<8)+g[S-1],_.push(t[I>>10]+t[I>>4&63]+t[I<<2&63]+"=")),_.join("")}return an}function Ty(){if(mc)return li;mc=!0;return li.read=function(t,e,r,n,i){var s,o,u=i*8-n-1,c=(1<<u)-1,f=c>>1,d=-7,h=r?i-1:0,m=r?-1:1,g=t[e+h];for(h+=m,s=g&(1<<-d)-1,g>>=-d,d+=u;d>0;s=s*256+t[e+h],h+=m,d-=8);for(o=s&(1<<-d)-1,s>>=-d,d+=n;d>0;o=o*256+t[e+h],h+=m,d-=8);if(s===0)s=1-f;else{if(s===c)return o?NaN:(g?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-f}return(g?-1:1)*o*Math.pow(2,s-n)},li.write=function(t,e,r,n,i,s){var o,u,c,f=s*8-i-1,d=(1<<f)-1,h=d>>1,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:s-1,I=n?1:-1,S=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,o=d):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+h>=1?e+=m/c:e+=m*Math.pow(2,1-h),e*c>=2&&(o++,c/=2),o+h>=d?(u=0,o=d):o+h>=1?(u=(e*c-1)*Math.pow(2,i),o=o+h):(u=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+g]=u&255,g+=I,u/=256,i-=8);for(o=o<<i|u,f+=i;f>0;t[r+g]=o&255,g+=I,o/=256,f-=8);t[r+g-I]|=S*128},li}function wc(){if(_c)return ar;_c=!0;let t=Py(),e=Ty(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ar.Buffer=o,ar.SlowBuffer=_,ar.INSPECT_MAX_BYTES=50;let n=2147483647;ar.kMaxLength=n,o.TYPED_ARRAY_SUPPORT=i(),!o.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 i(){try{let p=new Uint8Array(1),a={foo:function(){return 42}};return Object.setPrototypeOf(a,Uint8Array.prototype),Object.setPrototypeOf(p,a),p.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function s(p){if(p>n)throw new RangeError('The value "'+p+'" is invalid for option "size"');let a=new Uint8Array(p);return Object.setPrototypeOf(a,o.prototype),a}function o(p,a,l){if(typeof p=="number"){if(typeof a=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(p)}return u(p,a,l)}o.poolSize=8192;function u(p,a,l){if(typeof p=="string")return h(p,a);if(ArrayBuffer.isView(p))return g(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(Ye(p,ArrayBuffer)||p&&Ye(p.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ye(p,SharedArrayBuffer)||p&&Ye(p.buffer,SharedArrayBuffer)))return I(p,a,l);if(typeof p=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let E=p.valueOf&&p.valueOf();if(E!=null&&E!==p)return o.from(E,a,l);let C=S(p);if(C)return C;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof p[Symbol.toPrimitive]=="function")return o.from(p[Symbol.toPrimitive]("string"),a,l);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof p)}o.from=function(p,a,l){return u(p,a,l)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function c(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 f(p,a,l){return c(p),p<=0?s(p):a!==void 0?typeof l=="string"?s(p).fill(a,l):s(p).fill(a):s(p)}o.alloc=function(p,a,l){return f(p,a,l)};function d(p){return c(p),s(p<0?0:b(p)|0)}o.allocUnsafe=function(p){return d(p)},o.allocUnsafeSlow=function(p){return d(p)};function h(p,a){if((typeof a!="string"||a==="")&&(a="utf8"),!o.isEncoding(a))throw new TypeError("Unknown encoding: "+a);let l=w(p,a)|0,E=s(l),C=E.write(p,a);return C!==l&&(E=E.slice(0,C)),E}function m(p){let a=p.length<0?0:b(p.length)|0,l=s(a);for(let E=0;E<a;E+=1)l[E]=p[E]&255;return l}function g(p){if(Ye(p,Uint8Array)){let a=new Uint8Array(p);return I(a.buffer,a.byteOffset,a.byteLength)}return m(p)}function I(p,a,l){if(a<0||p.byteLength<a)throw new RangeError('"offset" is outside of buffer bounds');if(p.byteLength<a+(l||0))throw new RangeError('"length" is outside of buffer bounds');let E;return a===void 0&&l===void 0?E=new Uint8Array(p):l===void 0?E=new Uint8Array(p,a):E=new Uint8Array(p,a,l),Object.setPrototypeOf(E,o.prototype),E}function S(p){if(o.isBuffer(p)){let a=b(p.length)|0,l=s(a);return l.length===0||p.copy(l,0,0,a),l}if(p.length!==void 0)return typeof p.length!="number"||on(p.length)?s(0):m(p);if(p.type==="Buffer"&&Array.isArray(p.data))return m(p.data)}function b(p){if(p>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return p|0}function _(p){return+p!=p&&(p=0),o.alloc(+p)}o.isBuffer=function(a){return a!=null&&a._isBuffer===!0&&a!==o.prototype},o.compare=function(a,l){if(Ye(a,Uint8Array)&&(a=o.from(a,a.offset,a.byteLength)),Ye(l,Uint8Array)&&(l=o.from(l,l.offset,l.byteLength)),!o.isBuffer(a)||!o.isBuffer(l))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(a===l)return 0;let E=a.length,C=l.length;for(let N=0,F=Math.min(E,C);N<F;++N)if(a[N]!==l[N]){E=a[N],C=l[N];break}return E<C?-1:C<E?1:0},o.isEncoding=function(a){switch(String(a).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}},o.concat=function(a,l){if(!Array.isArray(a))throw new TypeError('"list" argument must be an Array of Buffers');if(a.length===0)return o.alloc(0);let E;if(l===void 0)for(l=0,E=0;E<a.length;++E)l+=a[E].length;let C=o.allocUnsafe(l),N=0;for(E=0;E<a.length;++E){let F=a[E];if(Ye(F,Uint8Array))N+F.length>C.length?(o.isBuffer(F)||(F=o.from(F)),F.copy(C,N)):Uint8Array.prototype.set.call(C,F,N);else if(o.isBuffer(F))F.copy(C,N);else throw new TypeError('"list" argument must be an Array of Buffers');N+=F.length}return C};function w(p,a){if(o.isBuffer(p))return p.length;if(ArrayBuffer.isView(p)||Ye(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 l=p.length,E=arguments.length>2&&arguments[2]===!0;if(!E&&l===0)return 0;let C=!1;for(;;)switch(a){case"ascii":case"latin1":case"binary":return l;case"utf8":case"utf-8":return _t(p).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return l*2;case"hex":return l>>>1;case"base64":return ni(p).length;default:if(C)return E?-1:_t(p).length;a=(""+a).toLowerCase(),C=!0}}o.byteLength=w;function R(p,a,l){let E=!1;if((a===void 0||a<0)&&(a=0),a>this.length||((l===void 0||l>this.length)&&(l=this.length),l<=0)||(l>>>=0,a>>>=0,l<=a))return"";for(p||(p="utf8");;)switch(p){case"hex":return V(this,a,l);case"utf8":case"utf-8":return W(this,a,l);case"ascii":return ee(this,a,l);case"latin1":case"binary":return z(this,a,l);case"base64":return U(this,a,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return te(this,a,l);default:if(E)throw new TypeError("Unknown encoding: "+p);p=(p+"").toLowerCase(),E=!0}}o.prototype._isBuffer=!0;function A(p,a,l){let E=p[a];p[a]=p[l],p[l]=E}o.prototype.swap16=function(){let a=this.length;if(a%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let l=0;l<a;l+=2)A(this,l,l+1);return this},o.prototype.swap32=function(){let a=this.length;if(a%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let l=0;l<a;l+=4)A(this,l,l+3),A(this,l+1,l+2);return this},o.prototype.swap64=function(){let a=this.length;if(a%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let l=0;l<a;l+=8)A(this,l,l+7),A(this,l+1,l+6),A(this,l+2,l+5),A(this,l+3,l+4);return this},o.prototype.toString=function(){let a=this.length;return a===0?"":arguments.length===0?W(this,0,a):R.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(a){if(!o.isBuffer(a))throw new TypeError("Argument must be a Buffer");return this===a?!0:o.compare(this,a)===0},o.prototype.inspect=function(){let a="",l=ar.INSPECT_MAX_BYTES;return a=this.toString("hex",0,l).replace(/(.{2})/g,"$1 ").trim(),this.length>l&&(a+=" ... "),"<Buffer "+a+">"},r&&(o.prototype[r]=o.prototype.inspect),o.prototype.compare=function(a,l,E,C,N){if(Ye(a,Uint8Array)&&(a=o.from(a,a.offset,a.byteLength)),!o.isBuffer(a))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof a);if(l===void 0&&(l=0),E===void 0&&(E=a?a.length:0),C===void 0&&(C=0),N===void 0&&(N=this.length),l<0||E>a.length||C<0||N>this.length)throw new RangeError("out of range index");if(C>=N&&l>=E)return 0;if(C>=N)return-1;if(l>=E)return 1;if(l>>>=0,E>>>=0,C>>>=0,N>>>=0,this===a)return 0;let F=N-C,k=E-l,M=Math.min(F,k),re=this.slice(C,N),ie=a.slice(l,E);for(let oe=0;oe<M;++oe)if(re[oe]!==ie[oe]){F=re[oe],k=ie[oe];break}return F<k?-1:k<F?1:0};function y(p,a,l,E,C){if(p.length===0)return-1;if(typeof l=="string"?(E=l,l=0):l>2147483647?l=2147483647:l<-2147483648&&(l=-2147483648),l=+l,on(l)&&(l=C?0:p.length-1),l<0&&(l=p.length+l),l>=p.length){if(C)return-1;l=p.length-1}else if(l<0)if(C)l=0;else return-1;if(typeof a=="string"&&(a=o.from(a,E)),o.isBuffer(a))return a.length===0?-1:O(p,a,l,E,C);if(typeof a=="number")return a=a&255,typeof Uint8Array.prototype.indexOf=="function"?C?Uint8Array.prototype.indexOf.call(p,a,l):Uint8Array.prototype.lastIndexOf.call(p,a,l):O(p,[a],l,E,C);throw new TypeError("val must be string, number or Buffer")}function O(p,a,l,E,C){let N=1,F=p.length,k=a.length;if(E!==void 0&&(E=String(E).toLowerCase(),E==="ucs2"||E==="ucs-2"||E==="utf16le"||E==="utf-16le")){if(p.length<2||a.length<2)return-1;N=2,F/=2,k/=2,l/=2}function M(ie,oe){return N===1?ie[oe]:ie.readUInt16BE(oe*N)}let re;if(C){let ie=-1;for(re=l;re<F;re++)if(M(p,re)===M(a,ie===-1?0:re-ie)){if(ie===-1&&(ie=re),re-ie+1===k)return ie*N}else ie!==-1&&(re-=re-ie),ie=-1}else for(l+k>F&&(l=F-k),re=l;re>=0;re--){let ie=!0;for(let oe=0;oe<k;oe++)if(M(p,re+oe)!==M(a,oe)){ie=!1;break}if(ie)return re}return-1}o.prototype.includes=function(a,l,E){return this.indexOf(a,l,E)!==-1},o.prototype.indexOf=function(a,l,E){return y(this,a,l,E,!0)},o.prototype.lastIndexOf=function(a,l,E){return y(this,a,l,E,!1)};function v(p,a,l,E){l=Number(l)||0;let C=p.length-l;E?(E=Number(E),E>C&&(E=C)):E=C;let N=a.length;E>N/2&&(E=N/2);let F;for(F=0;F<E;++F){let k=parseInt(a.substr(F*2,2),16);if(on(k))return F;p[l+F]=k}return F}function B(p,a,l,E){return Ir(_t(a,p.length-l),p,l,E)}function D(p,a,l,E){return Ir(wt(a),p,l,E)}function q(p,a,l,E){return Ir(ni(a),p,l,E)}function K(p,a,l,E){return Ir(nn(a,p.length-l),p,l,E)}o.prototype.write=function(a,l,E,C){if(l===void 0)C="utf8",E=this.length,l=0;else if(E===void 0&&typeof l=="string")C=l,E=this.length,l=0;else if(isFinite(l))l=l>>>0,isFinite(E)?(E=E>>>0,C===void 0&&(C="utf8")):(C=E,E=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let N=this.length-l;if((E===void 0||E>N)&&(E=N),a.length>0&&(E<0||l<0)||l>this.length)throw new RangeError("Attempt to write outside buffer bounds");C||(C="utf8");let F=!1;for(;;)switch(C){case"hex":return v(this,a,l,E);case"utf8":case"utf-8":return B(this,a,l,E);case"ascii":case"latin1":case"binary":return D(this,a,l,E);case"base64":return q(this,a,l,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return K(this,a,l,E);default:if(F)throw new TypeError("Unknown encoding: "+C);C=(""+C).toLowerCase(),F=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function U(p,a,l){return a===0&&l===p.length?t.fromByteArray(p):t.fromByteArray(p.slice(a,l))}function W(p,a,l){l=Math.min(p.length,l);let E=[],C=a;for(;C<l;){let N=p[C],F=null,k=N>239?4:N>223?3:N>191?2:1;if(C+k<=l){let M,re,ie,oe;switch(k){case 1:N<128&&(F=N);break;case 2:M=p[C+1],(M&192)===128&&(oe=(N&31)<<6|M&63,oe>127&&(F=oe));break;case 3:M=p[C+1],re=p[C+2],(M&192)===128&&(re&192)===128&&(oe=(N&15)<<12|(M&63)<<6|re&63,oe>2047&&(oe<55296||oe>57343)&&(F=oe));break;case 4:M=p[C+1],re=p[C+2],ie=p[C+3],(M&192)===128&&(re&192)===128&&(ie&192)===128&&(oe=(N&15)<<18|(M&63)<<12|(re&63)<<6|ie&63,oe>65535&&oe<1114112&&(F=oe))}}F===null?(F=65533,k=1):F>65535&&(F-=65536,E.push(F>>>10&1023|55296),F=56320|F&1023),E.push(F),C+=k}return J(E)}let G=4096;function J(p){let a=p.length;if(a<=G)return String.fromCharCode.apply(String,p);let l="",E=0;for(;E<a;)l+=String.fromCharCode.apply(String,p.slice(E,E+=G));return l}function ee(p,a,l){let E="";l=Math.min(p.length,l);for(let C=a;C<l;++C)E+=String.fromCharCode(p[C]&127);return E}function z(p,a,l){let E="";l=Math.min(p.length,l);for(let C=a;C<l;++C)E+=String.fromCharCode(p[C]);return E}function V(p,a,l){let E=p.length;(!a||a<0)&&(a=0),(!l||l<0||l>E)&&(l=E);let C="";for(let N=a;N<l;++N)C+=yo[p[N]];return C}function te(p,a,l){let E=p.slice(a,l),C="";for(let N=0;N<E.length-1;N+=2)C+=String.fromCharCode(E[N]+E[N+1]*256);return C}o.prototype.slice=function(a,l){let E=this.length;a=~~a,l=l===void 0?E:~~l,a<0?(a+=E,a<0&&(a=0)):a>E&&(a=E),l<0?(l+=E,l<0&&(l=0)):l>E&&(l=E),l<a&&(l=a);let C=this.subarray(a,l);return Object.setPrototypeOf(C,o.prototype),C};function Y(p,a,l){if(p%1!==0||p<0)throw new RangeError("offset is not uint");if(p+a>l)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(a,l,E){a=a>>>0,l=l>>>0,E||Y(a,l,this.length);let C=this[a],N=1,F=0;for(;++F<l&&(N*=256);)C+=this[a+F]*N;return C},o.prototype.readUintBE=o.prototype.readUIntBE=function(a,l,E){a=a>>>0,l=l>>>0,E||Y(a,l,this.length);let C=this[a+--l],N=1;for(;l>0&&(N*=256);)C+=this[a+--l]*N;return C},o.prototype.readUint8=o.prototype.readUInt8=function(a,l){return a=a>>>0,l||Y(a,1,this.length),this[a]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(a,l){return a=a>>>0,l||Y(a,2,this.length),this[a]|this[a+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(a,l){return a=a>>>0,l||Y(a,2,this.length),this[a]<<8|this[a+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(a,l){return a=a>>>0,l||Y(a,4,this.length),(this[a]|this[a+1]<<8|this[a+2]<<16)+this[a+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(a,l){return a=a>>>0,l||Y(a,4,this.length),this[a]*16777216+(this[a+1]<<16|this[a+2]<<8|this[a+3])},o.prototype.readBigUInt64LE=nt(function(a){a=a>>>0,xe(a,"offset");let l=this[a],E=this[a+7];(l===void 0||E===void 0)&&rt(a,this.length-8);let C=l+this[++a]*2**8+this[++a]*2**16+this[++a]*2**24,N=this[++a]+this[++a]*2**8+this[++a]*2**16+E*2**24;return BigInt(C)+(BigInt(N)<<BigInt(32))}),o.prototype.readBigUInt64BE=nt(function(a){a=a>>>0,xe(a,"offset");let l=this[a],E=this[a+7];(l===void 0||E===void 0)&&rt(a,this.length-8);let C=l*2**24+this[++a]*2**16+this[++a]*2**8+this[++a],N=this[++a]*2**24+this[++a]*2**16+this[++a]*2**8+E;return(BigInt(C)<<BigInt(32))+BigInt(N)}),o.prototype.readIntLE=function(a,l,E){a=a>>>0,l=l>>>0,E||Y(a,l,this.length);let C=this[a],N=1,F=0;for(;++F<l&&(N*=256);)C+=this[a+F]*N;return N*=128,C>=N&&(C-=Math.pow(2,8*l)),C},o.prototype.readIntBE=function(a,l,E){a=a>>>0,l=l>>>0,E||Y(a,l,this.length);let C=l,N=1,F=this[a+--C];for(;C>0&&(N*=256);)F+=this[a+--C]*N;return N*=128,F>=N&&(F-=Math.pow(2,8*l)),F},o.prototype.readInt8=function(a,l){return a=a>>>0,l||Y(a,1,this.length),this[a]&128?(255-this[a]+1)*-1:this[a]},o.prototype.readInt16LE=function(a,l){a=a>>>0,l||Y(a,2,this.length);let E=this[a]|this[a+1]<<8;return E&32768?E|4294901760:E},o.prototype.readInt16BE=function(a,l){a=a>>>0,l||Y(a,2,this.length);let E=this[a+1]|this[a]<<8;return E&32768?E|4294901760:E},o.prototype.readInt32LE=function(a,l){return a=a>>>0,l||Y(a,4,this.length),this[a]|this[a+1]<<8|this[a+2]<<16|this[a+3]<<24},o.prototype.readInt32BE=function(a,l){return a=a>>>0,l||Y(a,4,this.length),this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]},o.prototype.readBigInt64LE=nt(function(a){a=a>>>0,xe(a,"offset");let l=this[a],E=this[a+7];(l===void 0||E===void 0)&&rt(a,this.length-8);let C=this[a+4]+this[a+5]*2**8+this[a+6]*2**16+(E<<24);return(BigInt(C)<<BigInt(32))+BigInt(l+this[++a]*2**8+this[++a]*2**16+this[++a]*2**24)}),o.prototype.readBigInt64BE=nt(function(a){a=a>>>0,xe(a,"offset");let l=this[a],E=this[a+7];(l===void 0||E===void 0)&&rt(a,this.length-8);let C=(l<<24)+this[++a]*2**16+this[++a]*2**8+this[++a];return(BigInt(C)<<BigInt(32))+BigInt(this[++a]*2**24+this[++a]*2**16+this[++a]*2**8+E)}),o.prototype.readFloatLE=function(a,l){return a=a>>>0,l||Y(a,4,this.length),e.read(this,a,!0,23,4)},o.prototype.readFloatBE=function(a,l){return a=a>>>0,l||Y(a,4,this.length),e.read(this,a,!1,23,4)},o.prototype.readDoubleLE=function(a,l){return a=a>>>0,l||Y(a,8,this.length),e.read(this,a,!0,52,8)},o.prototype.readDoubleBE=function(a,l){return a=a>>>0,l||Y(a,8,this.length),e.read(this,a,!1,52,8)};function X(p,a,l,E,C,N){if(!o.isBuffer(p))throw new TypeError('"buffer" argument must be a Buffer instance');if(a>C||a<N)throw new RangeError('"value" argument is out of bounds');if(l+E>p.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(a,l,E,C){if(a=+a,l=l>>>0,E=E>>>0,!C){let k=Math.pow(2,8*E)-1;X(this,a,l,E,k,0)}let N=1,F=0;for(this[l]=a&255;++F<E&&(N*=256);)this[l+F]=a/N&255;return l+E},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(a,l,E,C){if(a=+a,l=l>>>0,E=E>>>0,!C){let k=Math.pow(2,8*E)-1;X(this,a,l,E,k,0)}let N=E-1,F=1;for(this[l+N]=a&255;--N>=0&&(F*=256);)this[l+N]=a/F&255;return l+E},o.prototype.writeUint8=o.prototype.writeUInt8=function(a,l,E){return a=+a,l=l>>>0,E||X(this,a,l,1,255,0),this[l]=a&255,l+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(a,l,E){return a=+a,l=l>>>0,E||X(this,a,l,2,65535,0),this[l]=a&255,this[l+1]=a>>>8,l+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(a,l,E){return a=+a,l=l>>>0,E||X(this,a,l,2,65535,0),this[l]=a>>>8,this[l+1]=a&255,l+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(a,l,E){return a=+a,l=l>>>0,E||X(this,a,l,4,4294967295,0),this[l+3]=a>>>24,this[l+2]=a>>>16,this[l+1]=a>>>8,this[l]=a&255,l+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(a,l,E){return a=+a,l=l>>>0,E||X(this,a,l,4,4294967295,0),this[l]=a>>>24,this[l+1]=a>>>16,this[l+2]=a>>>8,this[l+3]=a&255,l+4};function ce(p,a,l,E,C){Te(a,E,C,p,l,7);let N=Number(a&BigInt(4294967295));p[l++]=N,N=N>>8,p[l++]=N,N=N>>8,p[l++]=N,N=N>>8,p[l++]=N;let F=Number(a>>BigInt(32)&BigInt(4294967295));return p[l++]=F,F=F>>8,p[l++]=F,F=F>>8,p[l++]=F,F=F>>8,p[l++]=F,l}function Z(p,a,l,E,C){Te(a,E,C,p,l,7);let N=Number(a&BigInt(4294967295));p[l+7]=N,N=N>>8,p[l+6]=N,N=N>>8,p[l+5]=N,N=N>>8,p[l+4]=N;let F=Number(a>>BigInt(32)&BigInt(4294967295));return p[l+3]=F,F=F>>8,p[l+2]=F,F=F>>8,p[l+1]=F,F=F>>8,p[l]=F,l+8}o.prototype.writeBigUInt64LE=nt(function(a,l=0){return ce(this,a,l,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=nt(function(a,l=0){return Z(this,a,l,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(a,l,E,C){if(a=+a,l=l>>>0,!C){let M=Math.pow(2,8*E-1);X(this,a,l,E,M-1,-M)}let N=0,F=1,k=0;for(this[l]=a&255;++N<E&&(F*=256);)a<0&&k===0&&this[l+N-1]!==0&&(k=1),this[l+N]=(a/F>>0)-k&255;return l+E},o.prototype.writeIntBE=function(a,l,E,C){if(a=+a,l=l>>>0,!C){let M=Math.pow(2,8*E-1);X(this,a,l,E,M-1,-M)}let N=E-1,F=1,k=0;for(this[l+N]=a&255;--N>=0&&(F*=256);)a<0&&k===0&&this[l+N+1]!==0&&(k=1),this[l+N]=(a/F>>0)-k&255;return l+E},o.prototype.writeInt8=function(a,l,E){return a=+a,l=l>>>0,E||X(this,a,l,1,127,-128),a<0&&(a=255+a+1),this[l]=a&255,l+1},o.prototype.writeInt16LE=function(a,l,E){return a=+a,l=l>>>0,E||X(this,a,l,2,32767,-32768),this[l]=a&255,this[l+1]=a>>>8,l+2},o.prototype.writeInt16BE=function(a,l,E){return a=+a,l=l>>>0,E||X(this,a,l,2,32767,-32768),this[l]=a>>>8,this[l+1]=a&255,l+2},o.prototype.writeInt32LE=function(a,l,E){return a=+a,l=l>>>0,E||X(this,a,l,4,2147483647,-2147483648),this[l]=a&255,this[l+1]=a>>>8,this[l+2]=a>>>16,this[l+3]=a>>>24,l+4},o.prototype.writeInt32BE=function(a,l,E){return a=+a,l=l>>>0,E||X(this,a,l,4,2147483647,-2147483648),a<0&&(a=4294967295+a+1),this[l]=a>>>24,this[l+1]=a>>>16,this[l+2]=a>>>8,this[l+3]=a&255,l+4},o.prototype.writeBigInt64LE=nt(function(a,l=0){return ce(this,a,l,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=nt(function(a,l=0){return Z(this,a,l,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ne(p,a,l,E,C,N){if(l+E>p.length)throw new RangeError("Index out of range");if(l<0)throw new RangeError("Index out of range")}function de(p,a,l,E,C){return a=+a,l=l>>>0,C||ne(p,a,l,4),e.write(p,a,l,E,23,4),l+4}o.prototype.writeFloatLE=function(a,l,E){return de(this,a,l,!0,E)},o.prototype.writeFloatBE=function(a,l,E){return de(this,a,l,!1,E)};function me(p,a,l,E,C){return a=+a,l=l>>>0,C||ne(p,a,l,8),e.write(p,a,l,E,52,8),l+8}o.prototype.writeDoubleLE=function(a,l,E){return me(this,a,l,!0,E)},o.prototype.writeDoubleBE=function(a,l,E){return me(this,a,l,!1,E)},o.prototype.copy=function(a,l,E,C){if(!o.isBuffer(a))throw new TypeError("argument should be a Buffer");if(E||(E=0),!C&&C!==0&&(C=this.length),l>=a.length&&(l=a.length),l||(l=0),C>0&&C<E&&(C=E),C===E||a.length===0||this.length===0)return 0;if(l<0)throw new RangeError("targetStart out of bounds");if(E<0||E>=this.length)throw new RangeError("Index out of range");if(C<0)throw new RangeError("sourceEnd out of bounds");C>this.length&&(C=this.length),a.length-l<C-E&&(C=a.length-l+E);let N=C-E;return this===a&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(l,E,C):Uint8Array.prototype.set.call(a,this.subarray(E,C),l),N},o.prototype.fill=function(a,l,E,C){if(typeof a=="string"){if(typeof l=="string"?(C=l,l=0,E=this.length):typeof E=="string"&&(C=E,E=this.length),C!==void 0&&typeof C!="string")throw new TypeError("encoding must be a string");if(typeof C=="string"&&!o.isEncoding(C))throw new TypeError("Unknown encoding: "+C);if(a.length===1){let F=a.charCodeAt(0);(C==="utf8"&&F<128||C==="latin1")&&(a=F)}}else typeof a=="number"?a=a&255:typeof a=="boolean"&&(a=Number(a));if(l<0||this.length<l||this.length<E)throw new RangeError("Out of range index");if(E<=l)return this;l=l>>>0,E=E===void 0?this.length:E>>>0,a||(a=0);let N;if(typeof a=="number")for(N=l;N<E;++N)this[N]=a;else{let F=o.isBuffer(a)?a:o.from(a,C),k=F.length;if(k===0)throw new TypeError('The value "'+a+'" is invalid for argument "value"');for(N=0;N<E-l;++N)this[N+l]=F[N%k]}return this};let ye={};function Ae(p,a,l){ye[p]=class extends l{constructor(){super(),Object.defineProperty(this,"message",{value:a.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${p}]`,this.stack,delete this.name}get code(){return p}set code(C){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:C,writable:!0})}toString(){return`${this.name} [${p}]: ${this.message}`}}}Ae("ERR_BUFFER_OUT_OF_BOUNDS",function(p){return p?`${p} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Ae("ERR_INVALID_ARG_TYPE",function(p,a){return`The "${p}" argument must be of type number. Received type ${typeof a}`},TypeError),Ae("ERR_OUT_OF_RANGE",function(p,a,l){let E=`The value of "${p}" is out of range.`,C=l;return Number.isInteger(l)&&Math.abs(l)>2**32?C=we(String(l)):typeof l=="bigint"&&(C=String(l),(l>BigInt(2)**BigInt(32)||l<-(BigInt(2)**BigInt(32)))&&(C=we(C)),C+="n"),E+=` It must be ${a}. Received ${C}`,E},RangeError);function we(p){let a="",l=p.length,E=p[0]==="-"?1:0;for(;l>=E+4;l-=3)a=`_${p.slice(l-3,l)}${a}`;return`${p.slice(0,l)}${a}`}function ve(p,a,l){xe(a,"offset"),(p[a]===void 0||p[a+l]===void 0)&&rt(a,p.length-(l+1))}function Te(p,a,l,E,C,N){if(p>l||p<a){let F=typeof a=="bigint"?"n":"",k;throw a===0||a===BigInt(0)?k=`>= 0${F} and < 2${F} ** ${(N+1)*8}${F}`:k=`>= -(2${F} ** ${(N+1)*8-1}${F}) and < 2 ** ${(N+1)*8-1}${F}`,new ye.ERR_OUT_OF_RANGE("value",k,p)}ve(E,C,N)}function xe(p,a){if(typeof p!="number")throw new ye.ERR_INVALID_ARG_TYPE(a,"number",p)}function rt(p,a,l){throw Math.floor(p)!==p?(xe(p,l),new ye.ERR_OUT_OF_RANGE("offset","an integer",p)):a<0?new ye.ERR_BUFFER_OUT_OF_BOUNDS:new ye.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${a}`,p)}let Oe=/[^+/0-9A-Za-z-_]/g;function Me(p){if(p=p.split("=")[0],p=p.trim().replace(Oe,""),p.length<2)return"";for(;p.length%4!==0;)p=p+"=";return p}function _t(p,a){a=a||1/0;let l,E=p.length,C=null,N=[];for(let F=0;F<E;++F){if(l=p.charCodeAt(F),l>55295&&l<57344){if(!C){if(l>56319){(a-=3)>-1&&N.push(239,191,189);continue}else if(F+1===E){(a-=3)>-1&&N.push(239,191,189);continue}C=l;continue}if(l<56320){(a-=3)>-1&&N.push(239,191,189),C=l;continue}l=(C-55296<<10|l-56320)+65536}else C&&(a-=3)>-1&&N.push(239,191,189);if(C=null,l<128){if((a-=1)<0)break;N.push(l)}else if(l<2048){if((a-=2)<0)break;N.push(l>>6|192,l&63|128)}else if(l<65536){if((a-=3)<0)break;N.push(l>>12|224,l>>6&63|128,l&63|128)}else if(l<1114112){if((a-=4)<0)break;N.push(l>>18|240,l>>12&63|128,l>>6&63|128,l&63|128)}else throw new Error("Invalid code point")}return N}function wt(p){let a=[];for(let l=0;l<p.length;++l)a.push(p.charCodeAt(l)&255);return a}function nn(p,a){let l,E,C,N=[];for(let F=0;F<p.length&&!((a-=2)<0);++F)l=p.charCodeAt(F),E=l>>8,C=l%256,N.push(C),N.push(E);return N}function ni(p){return t.toByteArray(Me(p))}function Ir(p,a,l,E){let C;for(C=0;C<E&&!(C+l>=a.length||C>=p.length);++C)a[C+l]=p[C];return C}function Ye(p,a){return p instanceof a||p!=null&&p.constructor!=null&&p.constructor.name!=null&&p.constructor.name===a.name}function on(p){return p!==p}let yo=(function(){let p="0123456789abcdef",a=new Array(256);for(let l=0;l<16;++l){let E=l*16;for(let C=0;C<16;++C)a[E+C]=p[l]+p[C]}return a})();function nt(p){return typeof BigInt>"u"?bo:p}function bo(){throw new Error("BigInt not supported")}return ar}var an,bc,li,mc,ar,_c,vc=je(()=>{x();T();P();an={},bc=!1;li={},mc=!1;ar={},_c=!1});var Be={};Tr(Be,{Buffer:()=>$,INSPECT_MAX_BYTES:()=>Oy,default:()=>$t,kMaxLength:()=>Ry});var $t,$,Oy,Ry,Re=je(()=>{x();T();P();vc();$t=wc();$t.Buffer;$t.SlowBuffer;$t.INSPECT_MAX_BYTES;$t.kMaxLength;$=$t.Buffer,Oy=$t.INSPECT_MAX_BYTES,Ry=$t.kMaxLength});var T=je(()=>{Re()});var Ee=H((dx,Sc)=>{"use strict";x();T();P();var ko=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 n=0;n<e.length;n++)r+=` ${e[n].stack}
2
+ `;super(r),this.name="AggregateError",this.errors=e}};Sc.exports={AggregateError:ko,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)},PromiseResolve(t){return Promise.resolve(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,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(t,e,r){return t.set(e,r)},Boolean,Uint8Array}});var Co=H((_x,Ec)=>{"use strict";x();T();P();Ec.exports={format(t,...e){return t.replace(/%([sdifj])/g,function(...[r,n]){let i=e.shift();return n==="f"?i.toFixed(6):n==="j"?JSON.stringify(i):n==="s"&&typeof i=="object"?`${i.constructor!==Object?i.constructor.name:""} {}`.trim():i.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"{}"}}}});var qe=H((Px,xc)=>{"use strict";x();T();P();var{format:ky,inspect:ci}=Co(),{AggregateError:Cy}=Ee(),My=globalThis.AggregateError||Cy,By=Symbol("kIsNodeError"),Ny=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Ly=/^([A-Z][a-z0-9]*)+$/,qy="__node_internal_",fi={};function ur(t,e){if(!t)throw new fi.ERR_INTERNAL_ASSERTION(e)}function Ac(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function Dy(t,e,r){if(typeof e=="function")return ur(e.length<=r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${e.length}).`),e(...r);let n=(e.match(/%[dfijoOs]/g)||[]).length;return ur(n===r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${n}).`),r.length===0?e:ky(e,...r)}function Ne(t,e,r){r||(r=Error);class n extends r{constructor(...s){super(Dy(t,e,s))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(n.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}}),n.prototype.code=t,n.prototype[By]=!0,fi[t]=n}function Ic(t){let e=qy+t.name;return Object.defineProperty(t,"name",{value:e}),t}function Uy(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let r=new My([e,t],e.message);return r.code=e.code,r}return t||e}var Mo=class extends Error{constructor(e="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new fi.ERR_INVALID_ARG_TYPE("options","Object",r);super(e,r),this.code="ABORT_ERR",this.name="AbortError"}};Ne("ERR_ASSERTION","%s",Error);Ne("ERR_INVALID_ARG_TYPE",(t,e,r)=>{ur(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let n="The ";t.endsWith(" argument")?n+=`${t} `:n+=`"${t}" ${t.includes(".")?"property":"argument"} `,n+="must be ";let i=[],s=[],o=[];for(let c of e)ur(typeof c=="string","All expected entries have to be of type string"),Ny.includes(c)?i.push(c.toLowerCase()):Ly.test(c)?s.push(c):(ur(c!=="object",'The value "object" should be written as "Object"'),o.push(c));if(s.length>0){let c=i.indexOf("object");c!==-1&&(i.splice(i,c,1),s.push("Object"))}if(i.length>0){switch(i.length){case 1:n+=`of type ${i[0]}`;break;case 2:n+=`one of type ${i[0]} or ${i[1]}`;break;default:{let c=i.pop();n+=`one of type ${i.join(", ")}, or ${c}`}}(s.length>0||o.length>0)&&(n+=" or ")}if(s.length>0){switch(s.length){case 1:n+=`an instance of ${s[0]}`;break;case 2:n+=`an instance of ${s[0]} or ${s[1]}`;break;default:{let c=s.pop();n+=`an instance of ${s.join(", ")}, or ${c}`}}o.length>0&&(n+=" or ")}switch(o.length){case 0:break;case 1:o[0].toLowerCase()!==o[0]&&(n+="an "),n+=`${o[0]}`;break;case 2:n+=`one of ${o[0]} or ${o[1]}`;break;default:{let c=o.pop();n+=`one of ${o.join(", ")}, or ${c}`}}if(r==null)n+=`. Received ${r}`;else if(typeof r=="function"&&r.name)n+=`. Received function ${r.name}`;else if(typeof r=="object"){var u;if((u=r.constructor)!==null&&u!==void 0&&u.name)n+=`. Received an instance of ${r.constructor.name}`;else{let c=ci(r,{depth:-1});n+=`. Received ${c}`}}else{let c=ci(r,{colors:!1});c.length>25&&(c=`${c.slice(0,25)}...`),n+=`. Received type ${typeof r} (${c})`}return n},TypeError);Ne("ERR_INVALID_ARG_VALUE",(t,e,r="is invalid")=>{let n=ci(e);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${r}. Received ${n}`},TypeError);Ne("ERR_INVALID_RETURN_VALUE",(t,e,r)=>{var n;let i=r!=null&&(n=r.constructor)!==null&&n!==void 0&&n.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${t} to be returned from the "${e}" function but got ${i}.`},TypeError);Ne("ERR_MISSING_ARGS",(...t)=>{ur(t.length>0,"At least one arg needs to be specified");let e,r=t.length;switch(t=(Array.isArray(t)?t:[t]).map(n=>`"${n}"`).join(" or "),r){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let n=t.pop();e+=`The ${t.join(", ")}, and ${n} arguments`}break}return`${e} must be specified`},TypeError);Ne("ERR_OUT_OF_RANGE",(t,e,r)=>{ur(e,'Missing "range" argument');let n;if(Number.isInteger(r)&&Math.abs(r)>2**32)n=Ac(String(r));else if(typeof r=="bigint"){n=String(r);let i=BigInt(2)**BigInt(32);(r>i||r<-i)&&(n=Ac(n)),n+="n"}else n=ci(r);return`The value of "${t}" is out of range. It must be ${e}. Received ${n}`},RangeError);Ne("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);Ne("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);Ne("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);Ne("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);Ne("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);Ne("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Ne("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);Ne("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);Ne("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);Ne("ERR_STREAM_WRITE_AFTER_END","write after end",Error);Ne("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);xc.exports={AbortError:Mo,aggregateTwoErrors:Ic(Uy),hideStackFrames:Ic,codes:fi}});var Rr=H((Bx,di)=>{"use strict";x();T();P();var{AbortController:Pc,AbortSignal:Fy}=typeof self<"u"?self:typeof window<"u"?window:void 0;di.exports=Pc;di.exports.AbortSignal=Fy;di.exports.default=Pc});var Wt={};Tr(Wt,{EventEmitter:()=>$y,default:()=>un,defaultMaxListeners:()=>Wy,init:()=>Vy,listenerCount:()=>Hy,on:()=>zy,once:()=>Gy});function jy(){if(Tc)return hi;Tc=!0;var t=typeof Reflect=="object"?Reflect:null,e=t&&typeof t.apply=="function"?t.apply:function(y,O,v){return Function.prototype.apply.call(y,O,v)},r;t&&typeof t.ownKeys=="function"?r=t.ownKeys:Object.getOwnPropertySymbols?r=function(y){return Object.getOwnPropertyNames(y).concat(Object.getOwnPropertySymbols(y))}:r=function(y){return Object.getOwnPropertyNames(y)};function n(A){console&&console.warn&&console.warn(A)}var i=Number.isNaN||function(y){return y!==y};function s(){s.init.call(this)}hi=s,hi.once=_,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function u(A){if(typeof A!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof A)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(A){if(typeof A!="number"||A<0||i(A))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+A+".");o=A}}),s.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},s.prototype.setMaxListeners=function(y){if(typeof y!="number"||y<0||i(y))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+y+".");return this._maxListeners=y,this};function c(A){return A._maxListeners===void 0?s.defaultMaxListeners:A._maxListeners}s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(y){for(var O=[],v=1;v<arguments.length;v++)O.push(arguments[v]);var B=y==="error",D=this._events;if(D!==void 0)B=B&&D.error===void 0;else if(!B)return!1;if(B){var q;if(O.length>0&&(q=O[0]),q instanceof Error)throw q;var K=new Error("Unhandled error."+(q?" ("+q.message+")":""));throw K.context=q,K}var U=D[y];if(U===void 0)return!1;if(typeof U=="function")e(U,this,O);else for(var W=U.length,G=I(U,W),v=0;v<W;++v)e(G[v],this,O);return!0};function f(A,y,O,v){var B,D,q;if(u(O),D=A._events,D===void 0?(D=A._events=Object.create(null),A._eventsCount=0):(D.newListener!==void 0&&(A.emit("newListener",y,O.listener?O.listener:O),D=A._events),q=D[y]),q===void 0)q=D[y]=O,++A._eventsCount;else if(typeof q=="function"?q=D[y]=v?[O,q]:[q,O]:v?q.unshift(O):q.push(O),B=c(A),B>0&&q.length>B&&!q.warned){q.warned=!0;var K=new Error("Possible EventEmitter memory leak detected. "+q.length+" "+String(y)+" listeners added. Use emitter.setMaxListeners() to increase limit");K.name="MaxListenersExceededWarning",K.emitter=A,K.type=y,K.count=q.length,n(K)}return A}s.prototype.addListener=function(y,O){return f(this,y,O,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(y,O){return f(this,y,O,!0)};function d(){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 h(A,y,O){var v={fired:!1,wrapFn:void 0,target:A,type:y,listener:O},B=d.bind(v);return B.listener=O,v.wrapFn=B,B}s.prototype.once=function(y,O){return u(O),this.on(y,h(this,y,O)),this},s.prototype.prependOnceListener=function(y,O){return u(O),this.prependListener(y,h(this,y,O)),this},s.prototype.removeListener=function(y,O){var v,B,D,q,K;if(u(O),B=this._events,B===void 0)return this;if(v=B[y],v===void 0)return this;if(v===O||v.listener===O)--this._eventsCount===0?this._events=Object.create(null):(delete B[y],B.removeListener&&this.emit("removeListener",y,v.listener||O));else if(typeof v!="function"){for(D=-1,q=v.length-1;q>=0;q--)if(v[q]===O||v[q].listener===O){K=v[q].listener,D=q;break}if(D<0)return this;D===0?v.shift():S(v,D),v.length===1&&(B[y]=v[0]),B.removeListener!==void 0&&this.emit("removeListener",y,K||O)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(y){var O,v,B;if(v=this._events,v===void 0)return this;if(v.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):v[y]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete v[y]),this;if(arguments.length===0){var D=Object.keys(v),q;for(B=0;B<D.length;++B)q=D[B],q!=="removeListener"&&this.removeAllListeners(q);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(O=v[y],typeof O=="function")this.removeListener(y,O);else if(O!==void 0)for(B=O.length-1;B>=0;B--)this.removeListener(y,O[B]);return this};function m(A,y,O){var v=A._events;if(v===void 0)return[];var B=v[y];return B===void 0?[]:typeof B=="function"?O?[B.listener||B]:[B]:O?b(B):I(B,B.length)}s.prototype.listeners=function(y){return m(this,y,!0)},s.prototype.rawListeners=function(y){return m(this,y,!1)},s.listenerCount=function(A,y){return typeof A.listenerCount=="function"?A.listenerCount(y):g.call(A,y)},s.prototype.listenerCount=g;function g(A){var y=this._events;if(y!==void 0){var O=y[A];if(typeof O=="function")return 1;if(O!==void 0)return O.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]};function I(A,y){for(var O=new Array(y),v=0;v<y;++v)O[v]=A[v];return O}function S(A,y){for(;y+1<A.length;y++)A[y]=A[y+1];A.pop()}function b(A){for(var y=new Array(A.length),O=0;O<y.length;++O)y[O]=A[O].listener||A[O];return y}function _(A,y){return new Promise(function(O,v){function B(q){A.removeListener(y,D),v(q)}function D(){typeof A.removeListener=="function"&&A.removeListener("error",B),O([].slice.call(arguments))}R(A,y,D,{once:!0}),y!=="error"&&w(A,B,{once:!0})})}function w(A,y,O){typeof A.on=="function"&&R(A,"error",y,O)}function R(A,y,O,v){if(typeof A.on=="function")v.once?A.once(y,O):A.on(y,O);else if(typeof A.addEventListener=="function")A.addEventListener(y,function B(D){v.once&&A.removeEventListener(y,B),O(D)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof A)}return hi}var hi,Tc,un,$y,Wy,Vy,Hy,zy,Gy,Vt=je(()=>{x();T();P();hi={},Tc=!1;un=jy();un.once;un.once=function(t,e){return new Promise((r,n)=>{function i(...o){s!==void 0&&t.removeListener("error",s),r(o)}let s;e!=="error"&&(s=o=>{t.removeListener(name,i),n(o)},t.once("error",s)),t.once(e,i)})};un.on=function(t,e){let r=[],n=[],i=null,s=!1,o={async next(){let f=r.shift();if(f)return createIterResult(f,!1);if(i){let d=Promise.reject(i);return i=null,d}return s?createIterResult(void 0,!0):new Promise((d,h)=>n.push({resolve:d,reject:h}))},async return(){t.removeListener(e,u),t.removeListener("error",c),s=!0;for(let f of n)f.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(f){i=f,t.removeListener(e,u),t.removeListener("error",c)},[Symbol.asyncIterator](){return this}};return t.on(e,u),t.on("error",c),o;function u(...f){let d=n.shift();d?d.resolve(createIterResult(f,!1)):r.push(f)}function c(f){s=!0;let d=n.shift();d?d.reject(f):i=f,o.return()}};({EventEmitter:$y,defaultMaxListeners:Wy,init:Vy,listenerCount:Hy,on:zy,once:Gy}=un)});var $e=H((Gx,No)=>{"use strict";x();T();P();var Qy=(Re(),ge(Be)),{format:Ky,inspect:Yy}=Co(),{codes:{ERR_INVALID_ARG_TYPE:Bo}}=qe(),{kResistStopPropagation:Jy,AggregateError:Xy,SymbolDispose:Zy}=Ee(),eb=globalThis.AbortSignal||Rr().AbortSignal,tb=globalThis.AbortController||Rr().AbortController,rb=Object.getPrototypeOf(async function(){}).constructor,Oc=globalThis.Blob||Qy.Blob,nb=typeof Oc<"u"?function(e){return e instanceof Oc}:function(e){return!1},Rc=(t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new Bo(e,"AbortSignal",t)},ib=(t,e)=>{if(typeof t!="function")throw new Bo(e,"Function",t)};No.exports={AggregateError:Xy,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((n,i)=>{t=n,e=i}),resolve:t,reject:e}},promisify(t){return new Promise((e,r)=>{t((n,...i)=>n?r(n):e(...i))})},debuglog(){return function(){}},format:Ky,inspect:Yy,types:{isAsyncFunction(t){return t instanceof rb},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:nb,deprecate(t,e){return t},addAbortListener:(Vt(),ge(Wt)).addAbortListener||function(e,r){if(e===void 0)throw new Bo("signal","AbortSignal",e);Rc(e,"signal"),ib(r,"listener");let n;return e.aborted?queueMicrotask(()=>r()):(e.addEventListener("abort",r,{__proto__:null,once:!0,[Jy]:!0}),n=()=>{e.removeEventListener("abort",r)}),{__proto__:null,[Zy](){var i;(i=n)===null||i===void 0||i()}}},AbortSignalAny:eb.any||function(e){if(e.length===1)return e[0];let r=new tb,n=()=>r.abort();return e.forEach(i=>{Rc(i,"signals"),i.addEventListener("abort",n,{once:!0})}),r.signal.addEventListener("abort",()=>{e.forEach(i=>i.removeEventListener("abort",n))},{once:!0}),r.signal}};No.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var Cr=H((eP,Fc)=>{"use strict";x();T();P();var{ArrayIsArray:qo,ArrayPrototypeIncludes:Bc,ArrayPrototypeJoin:Nc,ArrayPrototypeMap:ob,NumberIsInteger:Do,NumberIsNaN:sb,NumberMAX_SAFE_INTEGER:ab,NumberMIN_SAFE_INTEGER:ub,NumberParseInt:lb,ObjectPrototypeHasOwnProperty:cb,RegExpPrototypeExec:Lc,String:fb,StringPrototypeToUpperCase:db,StringPrototypeTrim:hb}=Ee(),{hideStackFrames:Je,codes:{ERR_SOCKET_BAD_PORT:pb,ERR_INVALID_ARG_TYPE:De,ERR_INVALID_ARG_VALUE:kr,ERR_OUT_OF_RANGE:lr,ERR_UNKNOWN_SIGNAL:kc}}=qe(),{normalizeEncoding:gb}=$e(),{isAsyncFunction:yb,isArrayBufferView:bb}=$e().types,Cc={};function mb(t){return t===(t|0)}function _b(t){return t===t>>>0}var wb=/^[0-7]+$/,vb="must be a 32-bit unsigned integer or an octal string";function Sb(t,e,r){if(typeof t>"u"&&(t=r),typeof t=="string"){if(Lc(wb,t)===null)throw new kr(e,t,vb);t=lb(t,8)}return qc(t,e),t}var Eb=Je((t,e,r=ub,n=ab)=>{if(typeof t!="number")throw new De(e,"number",t);if(!Do(t))throw new lr(e,"an integer",t);if(t<r||t>n)throw new lr(e,`>= ${r} && <= ${n}`,t)}),Ab=Je((t,e,r=-2147483648,n=2147483647)=>{if(typeof t!="number")throw new De(e,"number",t);if(!Do(t))throw new lr(e,"an integer",t);if(t<r||t>n)throw new lr(e,`>= ${r} && <= ${n}`,t)}),qc=Je((t,e,r=!1)=>{if(typeof t!="number")throw new De(e,"number",t);if(!Do(t))throw new lr(e,"an integer",t);let n=r?1:0,i=4294967295;if(t<n||t>i)throw new lr(e,`>= ${n} && <= ${i}`,t)});function Uo(t,e){if(typeof t!="string")throw new De(e,"string",t)}function Ib(t,e,r=void 0,n){if(typeof t!="number")throw new De(e,"number",t);if(r!=null&&t<r||n!=null&&t>n||(r!=null||n!=null)&&sb(t))throw new lr(e,`${r!=null?`>= ${r}`:""}${r!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,t)}var xb=Je((t,e,r)=>{if(!Bc(r,t)){let i="must be one of: "+Nc(ob(r,s=>typeof s=="string"?`'${s}'`:fb(s)),", ");throw new kr(e,t,i)}});function Dc(t,e){if(typeof t!="boolean")throw new De(e,"boolean",t)}function Lo(t,e,r){return t==null||!cb(t,e)?r:t[e]}var Pb=Je((t,e,r=null)=>{let n=Lo(r,"allowArray",!1),i=Lo(r,"allowFunction",!1);if(!Lo(r,"nullable",!1)&&t===null||!n&&qo(t)||typeof t!="object"&&(!i||typeof t!="function"))throw new De(e,"Object",t)}),Tb=Je((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new De(e,"a dictionary",t)}),pi=Je((t,e,r=0)=>{if(!qo(t))throw new De(e,"Array",t);if(t.length<r){let n=`must be longer than ${r}`;throw new kr(e,t,n)}});function Ob(t,e){pi(t,e);for(let r=0;r<t.length;r++)Uo(t[r],`${e}[${r}]`)}function Rb(t,e){pi(t,e);for(let r=0;r<t.length;r++)Dc(t[r],`${e}[${r}]`)}function kb(t,e){pi(t,e);for(let r=0;r<t.length;r++){let n=t[r],i=`${e}[${r}]`;if(n==null)throw new De(i,"AbortSignal",n);Uc(n,i)}}function Cb(t,e="signal"){if(Uo(t,e),Cc[t]===void 0)throw Cc[db(t)]!==void 0?new kc(t+" (signals must use all capital letters)"):new kc(t)}var Mb=Je((t,e="buffer")=>{if(!bb(t))throw new De(e,["Buffer","TypedArray","DataView"],t)});function Bb(t,e){let r=gb(e),n=t.length;if(r==="hex"&&n%2!==0)throw new kr("encoding",e,`is invalid for data of length ${n}`)}function Nb(t,e="Port",r=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&hb(t).length===0||+t!==+t>>>0||t>65535||t===0&&!r)throw new pb(e,t,r);return t|0}var Uc=Je((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new De(e,"AbortSignal",t)}),Lb=Je((t,e)=>{if(typeof t!="function")throw new De(e,"Function",t)}),qb=Je((t,e)=>{if(typeof t!="function"||yb(t))throw new De(e,"Function",t)}),Db=Je((t,e)=>{if(t!==void 0)throw new De(e,"undefined",t)});function Ub(t,e,r){if(!Bc(r,t))throw new De(e,`('${Nc(r,"|")}')`,t)}var Fb=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Mc(t,e){if(typeof t>"u"||!Lc(Fb,t))throw new kr(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function jb(t){if(typeof t=="string")return Mc(t,"hints"),t;if(qo(t)){let e=t.length,r="";if(e===0)return r;for(let n=0;n<e;n++){let i=t[n];Mc(i,"hints"),r+=i,n!==e-1&&(r+=", ")}return r}throw new kr("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}Fc.exports={isInt32:mb,isUint32:_b,parseFileMode:Sb,validateArray:pi,validateStringArray:Ob,validateBooleanArray:Rb,validateAbortSignalArray:kb,validateBoolean:Dc,validateBuffer:Mb,validateDictionary:Tb,validateEncoding:Bb,validateFunction:Lb,validateInt32:Ab,validateInteger:Eb,validateNumber:Ib,validateObject:Pb,validateOneOf:xb,validatePlainFunction:qb,validatePort:Nb,validateSignalName:Cb,validateString:Uo,validateUint32:qc,validateUndefined:Db,validateUnion:Ub,validateAbortSignal:Uc,validateLinkHeaderValue:jb}});var dt=H((aP,tf)=>{"use strict";x();T();P();var{SymbolAsyncIterator:jc,SymbolIterator:$c,SymbolFor:cr}=Ee(),Wc=cr("nodejs.stream.destroyed"),Vc=cr("nodejs.stream.errored"),Fo=cr("nodejs.stream.readable"),jo=cr("nodejs.stream.writable"),Hc=cr("nodejs.stream.disturbed"),$b=cr("nodejs.webstream.isClosedPromise"),Wb=cr("nodejs.webstream.controllerErrorFunction");function gi(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 yi(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 Vb(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}function ft(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}function zc(t){return!!(t&&!ft(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}function Gc(t){return!!(t&&!ft(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}function Qc(t){return!!(t&&!ft(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}function Hb(t){return zc(t)||Gc(t)||Qc(t)}function zb(t,e){return t==null?!1:e===!0?typeof t[jc]=="function":e===!1?typeof t[$c]=="function":typeof t[jc]=="function"||typeof t[$c]=="function"}function bi(t){if(!ft(t))return null;let e=t._writableState,r=t._readableState,n=e||r;return!!(t.destroyed||t[Wc]||n!=null&&n.destroyed)}function Kc(t){if(!yi(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 Gb(t,e){if(!yi(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 Qb(t){if(!gi(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 Yc(t,e){if(!gi(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 Jc(t){return t&&t[Fo]!=null?t[Fo]:typeof t?.readable!="boolean"?null:bi(t)?!1:gi(t)&&t.readable&&!Yc(t)}function Xc(t){return t&&t[jo]!=null?t[jo]:typeof t?.writable!="boolean"?null:bi(t)?!1:yi(t)&&t.writable&&!Kc(t)}function Kb(t,e){return ft(t)?bi(t)?!0:!(e?.readable!==!1&&Jc(t)||e?.writable!==!1&&Xc(t)):null}function Yb(t){var e,r;return ft(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 Jb(t){var e,r;return ft(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 Xb(t){if(!ft(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"&&Zc(t)?t._closed:null}function Zc(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}function ef(t){return typeof t._sent100=="boolean"&&Zc(t)}function Zb(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 em(t){if(!ft(t))return null;let e=t._writableState,r=t._readableState,n=e||r;return!n&&ef(t)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}function tm(t){var e;return!!(t&&((e=t[Hc])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}function rm(t){var e,r,n,i,s,o,u,c,f,d;return!!(t&&((e=(r=(n=(i=(s=(o=t[Vc])!==null&&o!==void 0?o:t.readableErrored)!==null&&s!==void 0?s:t.writableErrored)!==null&&i!==void 0?i:(u=t._readableState)===null||u===void 0?void 0:u.errorEmitted)!==null&&n!==void 0?n:(c=t._writableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&r!==void 0?r:(f=t._readableState)===null||f===void 0?void 0:f.errored)!==null&&e!==void 0?e:!((d=t._writableState)===null||d===void 0)&&d.errored))}tf.exports={isDestroyed:bi,kIsDestroyed:Wc,isDisturbed:tm,kIsDisturbed:Hc,isErrored:rm,kIsErrored:Vc,isReadable:Jc,kIsReadable:Fo,kIsClosedPromise:$b,kControllerErrorFunction:Wb,kIsWritable:jo,isClosed:Xb,isDuplexNodeStream:Vb,isFinished:Kb,isIterable:zb,isReadableNodeStream:gi,isReadableStream:zc,isReadableEnded:Qb,isReadableFinished:Yc,isReadableErrored:Jb,isNodeStream:ft,isWebStream:Hb,isWritable:Xc,isWritableNodeStream:yi,isWritableStream:Gc,isWritableEnded:Kc,isWritableFinished:Gb,isWritableErrored:Yb,isServerRequest:Zb,isServerResponse:ef,willEmitClose:em,isTransformStream:Qc}});var At=H((pP,zo)=>{"use strict";x();T();P();var Ht=(Et(),ge(L)),{AbortError:ff,codes:nm}=qe(),{ERR_INVALID_ARG_TYPE:im,ERR_STREAM_PREMATURE_CLOSE:rf}=nm,{kEmptyObject:Wo,once:Vo}=$e(),{validateAbortSignal:om,validateFunction:sm,validateObject:am,validateBoolean:um}=Cr(),{Promise:lm,PromisePrototypeThen:cm,SymbolDispose:df}=Ee(),{isClosed:fm,isReadable:nf,isReadableNodeStream:$o,isReadableStream:dm,isReadableFinished:of,isReadableErrored:sf,isWritable:af,isWritableNodeStream:uf,isWritableStream:hm,isWritableFinished:lf,isWritableErrored:cf,isNodeStream:pm,willEmitClose:gm,kIsClosedPromise:ym}=dt(),Mr;function bm(t){return t.setHeader&&typeof t.abort=="function"}var Ho=()=>{};function hf(t,e,r){var n,i;if(arguments.length===2?(r=e,e=Wo):e==null?e=Wo:am(e,"options"),sm(r,"callback"),om(e.signal,"options.signal"),r=Vo(r),dm(t)||hm(t))return mm(t,e,r);if(!pm(t))throw new im("stream",["ReadableStream","WritableStream","Stream"],t);let s=(n=e.readable)!==null&&n!==void 0?n:$o(t),o=(i=e.writable)!==null&&i!==void 0?i:uf(t),u=t._writableState,c=t._readableState,f=()=>{t.writable||m()},d=gm(t)&&$o(t)===s&&uf(t)===o,h=lf(t,!1),m=()=>{h=!0,t.destroyed&&(d=!1),!(d&&(!t.readable||s))&&(!s||g)&&r.call(t)},g=of(t,!1),I=()=>{g=!0,t.destroyed&&(d=!1),!(d&&(!t.writable||o))&&(!o||h)&&r.call(t)},S=y=>{r.call(t,y)},b=fm(t),_=()=>{b=!0;let y=cf(t)||sf(t);if(y&&typeof y!="boolean")return r.call(t,y);if(s&&!g&&$o(t,!0)&&!of(t,!1))return r.call(t,new rf);if(o&&!h&&!lf(t,!1))return r.call(t,new rf);r.call(t)},w=()=>{b=!0;let y=cf(t)||sf(t);if(y&&typeof y!="boolean")return r.call(t,y);r.call(t)},R=()=>{t.req.on("finish",m)};bm(t)?(t.on("complete",m),d||t.on("abort",_),t.req?R():t.on("request",R)):o&&!u&&(t.on("end",f),t.on("close",f)),!d&&typeof t.aborted=="boolean"&&t.on("aborted",_),t.on("end",I),t.on("finish",m),e.error!==!1&&t.on("error",S),t.on("close",_),b?Ht.nextTick(_):u!=null&&u.errorEmitted||c!=null&&c.errorEmitted?d||Ht.nextTick(w):(!s&&(!d||nf(t))&&(h||af(t)===!1)||!o&&(!d||af(t))&&(g||nf(t)===!1)||c&&t.req&&t.aborted)&&Ht.nextTick(w);let A=()=>{r=Ho,t.removeListener("aborted",_),t.removeListener("complete",m),t.removeListener("abort",_),t.removeListener("request",R),t.req&&t.req.removeListener("finish",m),t.removeListener("end",f),t.removeListener("close",f),t.removeListener("finish",m),t.removeListener("end",I),t.removeListener("error",S),t.removeListener("close",_)};if(e.signal&&!b){let y=()=>{let O=r;A(),O.call(t,new ff(void 0,{cause:e.signal.reason}))};if(e.signal.aborted)Ht.nextTick(y);else{Mr=Mr||$e().addAbortListener;let O=Mr(e.signal,y),v=r;r=Vo((...B)=>{O[df](),v.apply(t,B)})}}return A}function mm(t,e,r){let n=!1,i=Ho;if(e.signal)if(i=()=>{n=!0,r.call(t,new ff(void 0,{cause:e.signal.reason}))},e.signal.aborted)Ht.nextTick(i);else{Mr=Mr||$e().addAbortListener;let o=Mr(e.signal,i),u=r;r=Vo((...c)=>{o[df](),u.apply(t,c)})}let s=(...o)=>{n||Ht.nextTick(()=>r.apply(t,o))};return cm(t[ym].promise,s,s),Ho}function _m(t,e){var r;let n=!1;return e===null&&(e=Wo),(r=e)!==null&&r!==void 0&&r.cleanup&&(um(e.cleanup,"cleanup"),n=e.cleanup),new lm((i,s)=>{let o=hf(t,e,u=>{n&&o(),u?s(u):i()})})}zo.exports=hf;zo.exports.finished=_m});var fr=H((vP,vf)=>{"use strict";x();T();P();var ht=(Et(),ge(L)),{aggregateTwoErrors:wm,codes:{ERR_MULTIPLE_CALLBACK:vm},AbortError:Sm}=qe(),{Symbol:yf}=Ee(),{kIsDestroyed:Em,isDestroyed:Am,isFinished:Im,isServerRequest:xm}=dt(),bf=yf("kDestroy"),Go=yf("kConstruct");function mf(t,e,r){t&&(t.stack,e&&!e.errored&&(e.errored=t),r&&!r.errored&&(r.errored=t))}function Pm(t,e){let r=this._readableState,n=this._writableState,i=n||r;return n!=null&&n.destroyed||r!=null&&r.destroyed?(typeof e=="function"&&e(),this):(mf(t,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),i.constructed?pf(this,t,e):this.once(bf,function(s){pf(this,wm(s,t),e)}),this)}function pf(t,e,r){let n=!1;function i(s){if(n)return;n=!0;let o=t._readableState,u=t._writableState;mf(s,u,o),u&&(u.closed=!0),o&&(o.closed=!0),typeof r=="function"&&r(s),s?ht.nextTick(Tm,t,s):ht.nextTick(_f,t)}try{t._destroy(e||null,i)}catch(s){i(s)}}function Tm(t,e){Qo(t,e),_f(t)}function _f(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 Qo(t,e){let r=t._readableState,n=t._writableState;n!=null&&n.errorEmitted||r!=null&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),t.emit("error",e))}function Om(){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 Ko(t,e,r){let n=t._readableState,i=t._writableState;if(i!=null&&i.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||i!=null&&i.autoDestroy?t.destroy(e):e&&(e.stack,i&&!i.errored&&(i.errored=e),n&&!n.errored&&(n.errored=e),r?ht.nextTick(Qo,t,e):Qo(t,e))}function Rm(t,e){if(typeof t._construct!="function")return;let r=t._readableState,n=t._writableState;r&&(r.constructed=!1),n&&(n.constructed=!1),t.once(Go,e),!(t.listenerCount(Go)>1)&&ht.nextTick(km,t)}function km(t){let e=!1;function r(n){if(e){Ko(t,n??new vm);return}e=!0;let i=t._readableState,s=t._writableState,o=s||i;i&&(i.constructed=!0),s&&(s.constructed=!0),o.destroyed?t.emit(bf,n):n?Ko(t,n,!0):ht.nextTick(Cm,t)}try{t._construct(n=>{ht.nextTick(r,n)})}catch(n){ht.nextTick(r,n)}}function Cm(t){t.emit(Go)}function gf(t){return t?.setHeader&&typeof t.abort=="function"}function wf(t){t.emit("close")}function Mm(t,e){t.emit("error",e),ht.nextTick(wf,t)}function Bm(t,e){!t||Am(t)||(!e&&!Im(t)&&(e=new Sm),xm(t)?(t.socket=null,t.destroy(e)):gf(t)?t.abort():gf(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?ht.nextTick(Mm,t,e):ht.nextTick(wf,t),t.destroyed||(t[Em]=!0))}vf.exports={construct:Rm,destroyer:Bm,destroy:Pm,undestroy:Om,errorOrDestroy:Ko}});var wi=H((TP,Ef)=>{"use strict";x();T();P();var{ArrayIsArray:Nm,ObjectSetPrototypeOf:Sf}=Ee(),{EventEmitter:mi}=(Vt(),ge(Wt));function _i(t){mi.call(this,t)}Sf(_i.prototype,mi.prototype);Sf(_i,mi);_i.prototype.pipe=function(t,e){let r=this;function n(d){t.writable&&t.write(d)===!1&&r.pause&&r.pause()}r.on("data",n);function i(){r.readable&&r.resume&&r.resume()}t.on("drain",i),!t._isStdio&&(!e||e.end!==!1)&&(r.on("end",o),r.on("close",u));let s=!1;function o(){s||(s=!0,t.end())}function u(){s||(s=!0,typeof t.destroy=="function"&&t.destroy())}function c(d){f(),mi.listenerCount(this,"error")===0&&this.emit("error",d)}Yo(r,"error",c),Yo(t,"error",c);function f(){r.removeListener("data",n),t.removeListener("drain",i),r.removeListener("end",o),r.removeListener("close",u),r.removeListener("error",c),t.removeListener("error",c),r.removeListener("end",f),r.removeListener("close",f),t.removeListener("close",f)}return r.on("end",f),r.on("close",f),t.on("close",f),t.emit("pipe",r),t};function Yo(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Nm(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}Ef.exports={Stream:_i,prependListener:Yo}});var ln=H((NP,vi)=>{"use strict";x();T();P();var{SymbolDispose:Lm}=Ee(),{AbortError:Af,codes:qm}=qe(),{isNodeStream:If,isWebStream:Dm,kControllerErrorFunction:Um}=dt(),Fm=At(),{ERR_INVALID_ARG_TYPE:xf}=qm,Jo,jm=(t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new xf(e,"AbortSignal",t)};vi.exports.addAbortSignal=function(e,r){if(jm(e,"signal"),!If(r)&&!Dm(r))throw new xf("stream",["ReadableStream","WritableStream","Stream"],r);return vi.exports.addAbortSignalNoValidate(e,r)};vi.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let r=If(e)?()=>{e.destroy(new Af(void 0,{cause:t.reason}))}:()=>{e[Um](new Af(void 0,{cause:t.reason}))};if(t.aborted)r();else{Jo=Jo||$e().addAbortListener;let n=Jo(t,r);Fm(e,n[Lm])}return e}});var Of=H((WP,Tf)=>{"use strict";x();T();P();var{StringPrototypeSlice:Pf,SymbolIterator:$m,TypedArrayPrototypeSet:Si,Uint8Array:Wm}=Ee(),{Buffer:Xo}=(Re(),ge(Be)),{inspect:Vm}=$e();Tf.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,n=""+r.data;for(;(r=r.next)!==null;)n+=e+r.data;return n}concat(e){if(this.length===0)return Xo.alloc(0);let r=Xo.allocUnsafe(e>>>0),n=this.head,i=0;for(;n;)Si(r,n.data,i),i+=n.data.length,n=n.next;return r}consume(e,r){let n=this.head.data;if(e<n.length){let i=n.slice(0,e);return this.head.data=n.slice(e),i}return e===n.length?this.shift():r?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[$m](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let r="",n=this.head,i=0;do{let s=n.data;if(e>s.length)r+=s,e-=s.length;else{e===s.length?(r+=s,++i,n.next?this.head=n.next:this.head=this.tail=null):(r+=Pf(s,0,e),this.head=n,n.data=Pf(s,e));break}++i}while((n=n.next)!==null);return this.length-=i,r}_getBuffer(e){let r=Xo.allocUnsafe(e),n=e,i=this.head,s=0;do{let o=i.data;if(e>o.length)Si(r,o,n-e),e-=o.length;else{e===o.length?(Si(r,o,n-e),++s,i.next?this.head=i.next:this.head=this.tail=null):(Si(r,new Wm(o.buffer,o.byteOffset,e),n-e),this.head=i,i.data=o.slice(e));break}++s}while((i=i.next)!==null);return this.length-=s,r}[Symbol.for("nodejs.util.inspect.custom")](e,r){return Vm(this,{...r,depth:0,customInspect:!1})}}});var cn=H((YP,Mf)=>{"use strict";x();T();P();var{MathFloor:Hm,NumberIsInteger:zm}=Ee(),{validateInteger:Gm}=Cr(),{ERR_INVALID_ARG_VALUE:Qm}=qe().codes,Rf=16*1024,kf=16;function Km(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function Cf(t){return t?kf:Rf}function Ym(t,e){Gm(e,"value",0),t?kf=e:Rf=e}function Jm(t,e,r,n){let i=Km(e,n,r);if(i!=null){if(!zm(i)||i<0){let s=n?`options.${r}`:"options.highWaterMark";throw new Qm(s,i)}return Hm(i)}return Cf(t.objectMode)}Mf.exports={getHighWaterMark:Jm,getDefaultHighWaterMark:Cf,setDefaultHighWaterMark:Ym}});var Lf=H((Zo,Nf)=>{x();T();P();var Ei=(Re(),ge(Be)),pt=Ei.Buffer;function Bf(t,e){for(var r in t)e[r]=t[r]}pt.from&&pt.alloc&&pt.allocUnsafe&&pt.allocUnsafeSlow?Nf.exports=Ei:(Bf(Ei,Zo),Zo.Buffer=dr);function dr(t,e,r){return pt(t,e,r)}dr.prototype=Object.create(pt.prototype);Bf(pt,dr);dr.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return pt(t,e,r)};dr.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=pt(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};dr.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return pt(t)};dr.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Ei.SlowBuffer(t)}});var Uf=H(Df=>{"use strict";x();T();P();var ts=Lf().Buffer,qf=ts.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 Xm(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 Zm(t){var e=Xm(t);if(typeof e!="string"&&(ts.isEncoding===qf||!qf(t)))throw new Error("Unknown encoding: "+t);return e||t}Df.StringDecoder=fn;function fn(t){this.encoding=Zm(t);var e;switch(this.encoding){case"utf16le":this.text=o_,this.end=s_,e=4;break;case"utf8":this.fillLast=r_,e=4;break;case"base64":this.text=a_,this.end=u_,e=3;break;default:this.write=l_,this.end=c_;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=ts.allocUnsafe(e)}fn.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||""};fn.prototype.end=i_;fn.prototype.text=n_;fn.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 es(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function e_(t,e,r){var n=e.length-1;if(n<r)return 0;var i=es(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=es(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=es(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function t_(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 r_(t){var e=this.lastTotal-this.lastNeed,r=t_(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 n_(t,e){var r=e_(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}function i_(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function o_(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=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 s_(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 a_(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 u_(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function l_(t){return t.toString(this.encoding)}function c_(t){return t&&t.length?this.write(t):""}});var rs=H((yT,Wf)=>{"use strict";x();T();P();var Ff=(Et(),ge(L)),{PromisePrototypeThen:f_,SymbolAsyncIterator:jf,SymbolIterator:$f}=Ee(),{Buffer:d_}=(Re(),ge(Be)),{ERR_INVALID_ARG_TYPE:h_,ERR_STREAM_NULL_VALUES:p_}=qe().codes;function g_(t,e,r){let n;if(typeof e=="string"||e instanceof d_)return new t({objectMode:!0,...r,read(){this.push(e),this.push(null)}});let i;if(e&&e[jf])i=!0,n=e[jf]();else if(e&&e[$f])i=!1,n=e[$f]();else throw new h_("iterable",["Iterable"],e);let s=new t({objectMode:!0,highWaterMark:1,...r}),o=!1;s._read=function(){o||(o=!0,c())},s._destroy=function(f,d){f_(u(f),()=>Ff.nextTick(d,f),h=>Ff.nextTick(d,h||f))};async function u(f){let d=f!=null,h=typeof n.throw=="function";if(d&&h){let{value:m,done:g}=await n.throw(f);if(await m,g)return}if(typeof n.return=="function"){let{value:m}=await n.return();await m}}async function c(){for(;;){try{let{value:f,done:d}=i?await n.next():n.next();if(d)s.push(null);else{let h=f&&typeof f.then=="function"?await f:f;if(h===null)throw o=!1,new p_;if(s.push(h))continue;o=!1}}catch(f){s.destroy(f)}break}}return s}Wf.exports=g_});var hn=H((ET,ad)=>{"use strict";x();T();P();var ot=(Et(),ge(L)),{ArrayPrototypeIndexOf:y_,NumberIsInteger:b_,NumberIsNaN:m_,NumberParseInt:__,ObjectDefineProperties:cs,ObjectKeys:w_,ObjectSetPrototypeOf:zf,Promise:Gf,SafeSet:v_,SymbolAsyncDispose:S_,SymbolAsyncIterator:E_,Symbol:A_}=Ee();ad.exports=le;le.ReadableState=Pi;var{EventEmitter:I_}=(Vt(),ge(Wt)),{Stream:zt,prependListener:x_}=wi(),{Buffer:ns}=(Re(),ge(Be)),{addAbortSignal:P_}=ln(),Qf=At(),he=$e().debuglog("stream",t=>{he=t}),T_=Of(),Lr=fr(),{getHighWaterMark:O_,getDefaultHighWaterMark:R_}=cn(),{aggregateTwoErrors:Vf,codes:{ERR_INVALID_ARG_TYPE:k_,ERR_METHOD_NOT_IMPLEMENTED:C_,ERR_OUT_OF_RANGE:M_,ERR_STREAM_PUSH_AFTER_EOF:B_,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:N_},AbortError:L_}=qe(),{validateObject:q_}=Cr(),hr=A_("kPaused"),{StringDecoder:Kf}=Uf(),D_=rs();zf(le.prototype,zt.prototype);zf(le,zt);var is=()=>{},{errorOrDestroy:Br}=Lr,Nr=1,U_=2,Yf=4,dn=8,Jf=16,Ai=32,Ii=64,Xf=128,F_=256,j_=512,$_=1024,us=2048,ls=4096,W_=8192,V_=16384,H_=32768,Zf=65536,z_=1<<17,G_=1<<18;function ke(t){return{enumerable:!1,get(){return(this.state&t)!==0},set(e){e?this.state|=t:this.state&=~t}}}cs(Pi.prototype,{objectMode:ke(Nr),ended:ke(U_),endEmitted:ke(Yf),reading:ke(dn),constructed:ke(Jf),sync:ke(Ai),needReadable:ke(Ii),emittedReadable:ke(Xf),readableListening:ke(F_),resumeScheduled:ke(j_),errorEmitted:ke($_),emitClose:ke(us),autoDestroy:ke(ls),destroyed:ke(W_),closed:ke(V_),closeEmitted:ke(H_),multiAwaitDrain:ke(Zf),readingMore:ke(z_),dataEmitted:ke(G_)});function Pi(t,e,r){typeof r!="boolean"&&(r=e instanceof gt()),this.state=us|ls|Jf|Ai,t&&t.objectMode&&(this.state|=Nr),r&&t&&t.readableObjectMode&&(this.state|=Nr),this.highWaterMark=t?O_(this,t,"readableHighWaterMark",r):R_(!1),this.buffer=new T_,this.length=0,this.pipes=[],this.flowing=null,this[hr]=null,t&&t.emitClose===!1&&(this.state&=~us),t&&t.autoDestroy===!1&&(this.state&=~ls),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new Kf(t.encoding),this.encoding=t.encoding)}function le(t){if(!(this instanceof le))return new le(t);let e=this instanceof gt();this._readableState=new Pi(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&&P_(t.signal,this)),zt.call(this,t),Lr.construct(this,()=>{this._readableState.needReadable&&xi(this,this._readableState)})}le.prototype.destroy=Lr.destroy;le.prototype._undestroy=Lr.undestroy;le.prototype._destroy=function(t,e){e(t)};le.prototype[I_.captureRejectionSymbol]=function(t){this.destroy(t)};le.prototype[S_]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new L_,this.destroy(t)),new Gf((e,r)=>Qf(this,n=>n&&n!==t?r(n):e(null)))};le.prototype.push=function(t,e){return ed(this,t,e,!1)};le.prototype.unshift=function(t,e){return ed(this,t,e,!0)};function ed(t,e,r,n){he("readableAddChunk",e);let i=t._readableState,s;if((i.state&Nr)===0&&(typeof e=="string"?(r=r||i.defaultEncoding,i.encoding!==r&&(n&&i.encoding?e=ns.from(e,r).toString(i.encoding):(e=ns.from(e,r),r=""))):e instanceof ns?r="":zt._isUint8Array(e)?(e=zt._uint8ArrayToBuffer(e),r=""):e!=null&&(s=new k_("chunk",["string","Buffer","Uint8Array"],e))),s)Br(t,s);else if(e===null)i.state&=~dn,Y_(t,i);else if((i.state&Nr)!==0||e&&e.length>0)if(n)if((i.state&Yf)!==0)Br(t,new N_);else{if(i.destroyed||i.errored)return!1;os(t,i,e,!0)}else if(i.ended)Br(t,new B_);else{if(i.destroyed||i.errored)return!1;i.state&=~dn,i.decoder&&!r?(e=i.decoder.write(e),i.objectMode||e.length!==0?os(t,i,e,!1):xi(t,i)):os(t,i,e,!1)}else n||(i.state&=~dn,xi(t,i));return!i.ended&&(i.length<i.highWaterMark||i.length===0)}function os(t,e,r,n){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?((e.state&Zf)!==0?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),(e.state&Ii)!==0&&Ti(t)),xi(t,e)}le.prototype.isPaused=function(){let t=this._readableState;return t[hr]===!0||t.flowing===!1};le.prototype.setEncoding=function(t){let e=new Kf(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,n="";for(let i of r)n+=e.write(i);return r.clear(),n!==""&&r.push(n),this._readableState.length=n.length,this};var Q_=1073741824;function K_(t){if(t>Q_)throw new M_("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}function Hf(t,e){return t<=0||e.length===0&&e.ended?0:(e.state&Nr)!==0?1:m_(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}le.prototype.read=function(t){he("read",t),t===void 0?t=NaN:b_(t)||(t=__(t,10));let e=this._readableState,r=t;if(t>e.highWaterMark&&(e.highWaterMark=K_(t)),t!==0&&(e.state&=~Xf),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return he("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?ss(this):Ti(this),null;if(t=Hf(t,e),t===0&&e.ended)return e.length===0&&ss(this),null;let n=(e.state&Ii)!==0;if(he("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,he("length less than watermark",n)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)n=!1,he("reading, ended or constructing",n);else if(n){he("do read"),e.state|=dn|Ai,e.length===0&&(e.state|=Ii);try{this._read(e.highWaterMark)}catch(s){Br(this,s)}e.state&=~Ai,e.reading||(t=Hf(r,e))}let i;return t>0?i=od(t,e):i=null,i===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&&ss(this)),i!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",i)),i};function Y_(t,e){if(he("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?Ti(t):(e.needReadable=!1,e.emittedReadable=!0,td(t))}}function Ti(t){let e=t._readableState;he("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(he("emitReadable",e.flowing),e.emittedReadable=!0,ot.nextTick(td,t))}function td(t){let e=t._readableState;he("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,nd(t)}function xi(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,ot.nextTick(J_,t,e))}function J_(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let r=e.length;if(he("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}le.prototype._read=function(t){throw new C_("_read()")};le.prototype.pipe=function(t,e){let r=this,n=this._readableState;n.pipes.length===1&&(n.multiAwaitDrain||(n.multiAwaitDrain=!0,n.awaitDrainWriters=new v_(n.awaitDrainWriters?[n.awaitDrainWriters]:[]))),n.pipes.push(t),he("pipe count=%d opts=%j",n.pipes.length,e);let s=(!e||e.end!==!1)&&t!==ot.stdout&&t!==ot.stderr?u:b;n.endEmitted?ot.nextTick(s):r.once("end",s),t.on("unpipe",o);function o(_,w){he("onunpipe"),_===r&&w&&w.hasUnpiped===!1&&(w.hasUnpiped=!0,d())}function u(){he("onend"),t.end()}let c,f=!1;function d(){he("cleanup"),t.removeListener("close",I),t.removeListener("finish",S),c&&t.removeListener("drain",c),t.removeListener("error",g),t.removeListener("unpipe",o),r.removeListener("end",u),r.removeListener("end",b),r.removeListener("data",m),f=!0,c&&n.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&c()}function h(){f||(n.pipes.length===1&&n.pipes[0]===t?(he("false write response, pause",0),n.awaitDrainWriters=t,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(t)&&(he("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(t)),r.pause()),c||(c=X_(r,t),t.on("drain",c))}r.on("data",m);function m(_){he("ondata");let w=t.write(_);he("dest.write",w),w===!1&&h()}function g(_){if(he("onerror",_),b(),t.removeListener("error",g),t.listenerCount("error")===0){let w=t._writableState||t._readableState;w&&!w.errorEmitted?Br(t,_):t.emit("error",_)}}x_(t,"error",g);function I(){t.removeListener("finish",S),b()}t.once("close",I);function S(){he("onfinish"),t.removeListener("close",I),b()}t.once("finish",S);function b(){he("unpipe"),r.unpipe(t)}return t.emit("pipe",r),t.writableNeedDrain===!0?h():n.flowing||(he("pipe resume"),r.resume()),t};function X_(t,e){return function(){let n=t._readableState;n.awaitDrainWriters===e?(he("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(he("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(e)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()}}le.prototype.unpipe=function(t){let e=this._readableState,r={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let i=e.pipes;e.pipes=[],this.pause();for(let s=0;s<i.length;s++)i[s].emit("unpipe",this,{hasUnpiped:!1});return this}let n=y_(e.pipes,t);return n===-1?this:(e.pipes.splice(n,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,r),this)};le.prototype.on=function(t,e){let r=zt.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,he("on readable",n.length,n.reading),n.length?Ti(this):n.reading||ot.nextTick(Z_,this)),r};le.prototype.addListener=le.prototype.on;le.prototype.removeListener=function(t,e){let r=zt.prototype.removeListener.call(this,t,e);return t==="readable"&&ot.nextTick(rd,this),r};le.prototype.off=le.prototype.removeListener;le.prototype.removeAllListeners=function(t){let e=zt.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&ot.nextTick(rd,this),e};function rd(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[hr]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}function Z_(t){he("readable nexttick read 0"),t.read(0)}le.prototype.resume=function(){let t=this._readableState;return t.flowing||(he("resume"),t.flowing=!t.readableListening,ew(this,t)),t[hr]=!1,this};function ew(t,e){e.resumeScheduled||(e.resumeScheduled=!0,ot.nextTick(tw,t,e))}function tw(t,e){he("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),nd(t),e.flowing&&!e.reading&&t.read(0)}le.prototype.pause=function(){return he("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(he("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[hr]=!0,this};function nd(t){let e=t._readableState;for(he("flow",e.flowing);e.flowing&&t.read()!==null;);}le.prototype.wrap=function(t){let e=!1;t.on("data",n=>{!this.push(n)&&t.pause&&(e=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",n=>{Br(this,n)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let r=w_(t);for(let n=1;n<r.length;n++){let i=r[n];this[i]===void 0&&typeof t[i]=="function"&&(this[i]=t[i].bind(t))}return this};le.prototype[E_]=function(){return id(this)};le.prototype.iterator=function(t){return t!==void 0&&q_(t,"options"),id(this,t)};function id(t,e){typeof t.read!="function"&&(t=le.wrap(t,{objectMode:!0}));let r=rw(t,e);return r.stream=t,r}async function*rw(t,e){let r=is;function n(o){this===t?(r(),r=is):r=o}t.on("readable",n);let i,s=Qf(t,{writable:!1},o=>{i=o?Vf(i,o):null,r(),r=is});try{for(;;){let o=t.destroyed?null:t.read();if(o!==null)yield o;else{if(i)throw i;if(i===null)return;await new Gf(n)}}}catch(o){throw i=Vf(i,o),i}finally{(i||e?.destroyOnReturn!==!1)&&(i===void 0||t._readableState.autoDestroy)?Lr.destroyer(t,null):(t.off("readable",n),s())}}cs(le.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}}});cs(Pi.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[hr]!==!1},set(t){this[hr]=!!t}}});le._fromList=od;function od(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 ss(t){let e=t._readableState;he("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,ot.nextTick(nw,e,t))}function nw(t,e){if(he("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)ot.nextTick(iw,e);else if(t.autoDestroy){let r=e._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&e.destroy()}}}function iw(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}le.from=function(t,e){return D_(le,t,e)};var as;function sd(){return as===void 0&&(as={}),as}le.fromWeb=function(t,e){return sd().newStreamReadableFromReadableStream(t,e)};le.toWeb=function(t,e){return sd().newReadableStreamFromStreamReadable(t,e)};le.wrap=function(t,e){var r,n;return new le({objectMode:(r=(n=t.readableObjectMode)!==null&&n!==void 0?n:t.objectMode)!==null&&r!==void 0?r:!0,...e,destroy(i,s){Lr.destroyer(t,i),s(i)}}).wrap(t)}});var Mi=H((RT,_d)=>{"use strict";x();T();P();var pr=(Et(),ge(L)),{ArrayPrototypeSlice:cd,Error:ow,FunctionPrototypeSymbolHasInstance:fd,ObjectDefineProperty:dd,ObjectDefineProperties:sw,ObjectSetPrototypeOf:hd,StringPrototypeToLowerCase:aw,Symbol:uw,SymbolHasInstance:lw}=Ee();_d.exports=Ie;Ie.WritableState=yn;var{EventEmitter:cw}=(Vt(),ge(Wt)),pn=wi().Stream,{Buffer:Oi}=(Re(),ge(Be)),Ci=fr(),{addAbortSignal:fw}=ln(),{getHighWaterMark:dw,getDefaultHighWaterMark:hw}=cn(),{ERR_INVALID_ARG_TYPE:pw,ERR_METHOD_NOT_IMPLEMENTED:gw,ERR_MULTIPLE_CALLBACK:pd,ERR_STREAM_CANNOT_PIPE:yw,ERR_STREAM_DESTROYED:gn,ERR_STREAM_ALREADY_FINISHED:bw,ERR_STREAM_NULL_VALUES:mw,ERR_STREAM_WRITE_AFTER_END:_w,ERR_UNKNOWN_ENCODING:gd}=qe().codes,{errorOrDestroy:qr}=Ci;hd(Ie.prototype,pn.prototype);hd(Ie,pn);function hs(){}var Dr=uw("kOnFinished");function yn(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?dw(this,t,"writableHighWaterMark",r):hw(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!!(t&&t.decodeStrings===!1);this.decodeStrings=!n,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=vw.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,ki(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[Dr]=[]}function ki(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}yn.prototype.getBuffer=function(){return cd(this.buffered,this.bufferedIndex)};dd(yn.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function Ie(t){let e=this instanceof gt();if(!e&&!fd(Ie,this))return new Ie(t);this._writableState=new yn(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&&fw(t.signal,this)),pn.call(this,t),Ci.construct(this,()=>{let r=this._writableState;r.writing||gs(this,r),ys(this,r)})}dd(Ie,lw,{__proto__:null,value:function(t){return fd(this,t)?!0:this!==Ie?!1:t&&t._writableState instanceof yn}});Ie.prototype.pipe=function(){qr(this,new yw)};function yd(t,e,r,n){let i=t._writableState;if(typeof r=="function")n=r,r=i.defaultEncoding;else{if(!r)r=i.defaultEncoding;else if(r!=="buffer"&&!Oi.isEncoding(r))throw new gd(r);typeof n!="function"&&(n=hs)}if(e===null)throw new mw;if(!i.objectMode)if(typeof e=="string")i.decodeStrings!==!1&&(e=Oi.from(e,r),r="buffer");else if(e instanceof Oi)r="buffer";else if(pn._isUint8Array(e))e=pn._uint8ArrayToBuffer(e),r="buffer";else throw new pw("chunk",["string","Buffer","Uint8Array"],e);let s;return i.ending?s=new _w:i.destroyed&&(s=new gn("write")),s?(pr.nextTick(n,s),qr(t,s,!0),s):(i.pendingcb++,ww(t,i,e,r,n))}Ie.prototype.write=function(t,e,r){return yd(this,t,e,r)===!0};Ie.prototype.cork=function(){this._writableState.corked++};Ie.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||gs(this,t))};Ie.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=aw(e)),!Oi.isEncoding(e))throw new gd(e);return this._writableState.defaultEncoding=e,this};function ww(t,e,r,n,i){let s=e.objectMode?1:r.length;e.length+=s;let o=e.length<e.highWaterMark;return o||(e.needDrain=!0),e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:r,encoding:n,callback:i}),e.allBuffers&&n!=="buffer"&&(e.allBuffers=!1),e.allNoop&&i!==hs&&(e.allNoop=!1)):(e.writelen=s,e.writecb=i,e.writing=!0,e.sync=!0,t._write(r,n,e.onwrite),e.sync=!1),o&&!e.errored&&!e.destroyed}function ud(t,e,r,n,i,s,o){e.writelen=n,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new gn("write")):r?t._writev(i,e.onwrite):t._write(i,s,e.onwrite),e.sync=!1}function ld(t,e,r,n){--e.pendingcb,n(r),ps(e),qr(t,r)}function vw(t,e){let r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function"){qr(t,new pd);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),n?pr.nextTick(ld,t,r,e,i):ld(t,r,e,i)):(r.buffered.length>r.bufferedIndex&&gs(t,r),n?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===i?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:i,stream:t,state:r},pr.nextTick(Sw,r.afterWriteTickInfo)):bd(t,r,1,i))}function Sw({stream:t,state:e,count:r,cb:n}){return e.afterWriteTickInfo=null,bd(t,e,r,n)}function bd(t,e,r,n){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));r-- >0;)e.pendingcb--,n();e.destroyed&&ps(e),ys(t,e)}function ps(t){if(t.writing)return;for(let i=t.bufferedIndex;i<t.buffered.length;++i){var e;let{chunk:s,callback:o}=t.buffered[i],u=t.objectMode?1:s.length;t.length-=u,o((e=t.errored)!==null&&e!==void 0?e:new gn("write"))}let r=t[Dr].splice(0);for(let i=0;i<r.length;i++){var n;r[i]((n=t.errored)!==null&&n!==void 0?n:new gn("end"))}ki(t)}function gs(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:r,bufferedIndex:n,objectMode:i}=e,s=r.length-n;if(!s)return;let o=n;if(e.bufferProcessing=!0,s>1&&t._writev){e.pendingcb-=s-1;let u=e.allNoop?hs:f=>{for(let d=o;d<r.length;++d)r[d].callback(f)},c=e.allNoop&&o===0?r:cd(r,o);c.allBuffers=e.allBuffers,ud(t,e,!0,e.length,c,"",u),ki(e)}else{do{let{chunk:u,encoding:c,callback:f}=r[o];r[o++]=null;let d=i?1:u.length;ud(t,e,!1,d,u,c,f)}while(o<r.length&&!e.writing);o===r.length?ki(e):o>256?(r.splice(0,o),e.bufferedIndex=0):e.bufferedIndex=o}e.bufferProcessing=!1}Ie.prototype._write=function(t,e,r){if(this._writev)this._writev([{chunk:t,encoding:e}],r);else throw new gw("_write()")};Ie.prototype._writev=null;Ie.prototype.end=function(t,e,r){let n=this._writableState;typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null);let i;if(t!=null){let s=yd(this,t,e);s instanceof ow&&(i=s)}return n.corked&&(n.corked=1,this.uncork()),i||(!n.errored&&!n.ending?(n.ending=!0,ys(this,n,!0),n.ended=!0):n.finished?i=new bw("end"):n.destroyed&&(i=new gn("end"))),typeof r=="function"&&(i||n.finished?pr.nextTick(r,i):n[Dr].push(r)),this};function Ri(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 Ew(t,e){let r=!1;function n(i){if(r){qr(t,i??pd());return}if(r=!0,e.pendingcb--,i){let s=e[Dr].splice(0);for(let o=0;o<s.length;o++)s[o](i);qr(t,i,e.sync)}else Ri(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,pr.nextTick(ds,t,e))}e.sync=!0,e.pendingcb++;try{t._final(n)}catch(i){n(i)}e.sync=!1}function Aw(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,Ew(t,e)):(e.prefinished=!0,t.emit("prefinish")))}function ys(t,e,r){Ri(e)&&(Aw(t,e),e.pendingcb===0&&(r?(e.pendingcb++,pr.nextTick((n,i)=>{Ri(i)?ds(n,i):i.pendingcb--},t,e)):Ri(e)&&(e.pendingcb++,ds(t,e))))}function ds(t,e){e.pendingcb--,e.finished=!0;let r=e[Dr].splice(0);for(let n=0;n<r.length;n++)r[n]();if(t.emit("finish"),e.autoDestroy){let n=t._readableState;(!n||n.autoDestroy&&(n.endEmitted||n.readable===!1))&&t.destroy()}}sw(Ie.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 Iw=Ci.destroy;Ie.prototype.destroy=function(t,e){let r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[Dr].length)&&pr.nextTick(ps,r),Iw.call(this,t,e),this};Ie.prototype._undestroy=Ci.undestroy;Ie.prototype._destroy=function(t,e){e(t)};Ie.prototype[cw.captureRejectionSymbol]=function(t){this.destroy(t)};var fs;function md(){return fs===void 0&&(fs={}),fs}Ie.fromWeb=function(t,e){return md().newStreamWritableFromWritableStream(t,e)};Ie.toWeb=function(t){return md().newWritableStreamFromStreamWritable(t)}});var Bd=H((qT,Md)=>{x();T();P();var bs=(Et(),ge(L)),xw=(Re(),ge(Be)),{isReadable:Pw,isWritable:Tw,isIterable:wd,isNodeStream:Ow,isReadableNodeStream:vd,isWritableNodeStream:Sd,isDuplexNodeStream:Rw,isReadableStream:Ed,isWritableStream:Ad}=dt(),Id=At(),{AbortError:kd,codes:{ERR_INVALID_ARG_TYPE:kw,ERR_INVALID_RETURN_VALUE:xd}}=qe(),{destroyer:Fr}=fr(),Cw=gt(),Cd=hn(),Mw=Mi(),{createDeferredPromise:Pd}=$e(),Td=rs(),Od=globalThis.Blob||xw.Blob,Bw=typeof Od<"u"?function(e){return e instanceof Od}:function(e){return!1},Nw=globalThis.AbortController||Rr().AbortController,{FunctionPrototypeCall:Rd}=Ee(),Gt=class extends Cw{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)}};Md.exports=function t(e,r){if(Rw(e))return e;if(vd(e))return Ur({readable:e});if(Sd(e))return Ur({writable:e});if(Ow(e))return Ur({writable:!1,readable:!1});if(Ed(e))return Ur({readable:Cd.fromWeb(e)});if(Ad(e))return Ur({writable:Mw.fromWeb(e)});if(typeof e=="function"){let{value:i,write:s,final:o,destroy:u}=Lw(e);if(wd(i))return Td(Gt,i,{objectMode:!0,write:s,final:o,destroy:u});let c=i?.then;if(typeof c=="function"){let f,d=Rd(c,i,h=>{if(h!=null)throw new xd("nully","body",h)},h=>{Fr(f,h)});return f=new Gt({objectMode:!0,readable:!1,write:s,final(h){o(async()=>{try{await d,bs.nextTick(h,null)}catch(m){bs.nextTick(h,m)}})},destroy:u})}throw new xd("Iterable, AsyncIterable or AsyncFunction",r,i)}if(Bw(e))return t(e.arrayBuffer());if(wd(e))return Td(Gt,e,{objectMode:!0,writable:!1});if(Ed(e?.readable)&&Ad(e?.writable))return Gt.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let i=e!=null&&e.readable?vd(e?.readable)?e?.readable:t(e.readable):void 0,s=e!=null&&e.writable?Sd(e?.writable)?e?.writable:t(e.writable):void 0;return Ur({readable:i,writable:s})}let n=e?.then;if(typeof n=="function"){let i;return Rd(n,e,s=>{s!=null&&i.push(s),i.push(null)},s=>{Fr(i,s)}),i=new Gt({objectMode:!0,writable:!1,read(){}})}throw new kw(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)};function Lw(t){let{promise:e,resolve:r}=Pd(),n=new Nw,i=n.signal;return{value:t((async function*(){for(;;){let o=e;e=null;let{chunk:u,done:c,cb:f}=await o;if(bs.nextTick(f),c)return;if(i.aborted)throw new kd(void 0,{cause:i.reason});({promise:e,resolve:r}=Pd()),yield u}})(),{signal:i}),write(o,u,c){let f=r;r=null,f({chunk:o,done:!1,cb:c})},final(o){let u=r;r=null,u({done:!0,cb:o})},destroy(o,u){n.abort(),u(o)}}}function Ur(t){let e=t.readable&&typeof t.readable.read!="function"?Cd.wrap(t.readable):t.readable,r=t.writable,n=!!Pw(e),i=!!Tw(r),s,o,u,c,f;function d(h){let m=c;c=null,m?m(h):h&&f.destroy(h)}return f=new Gt({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:n,writable:i}),i&&(Id(r,h=>{i=!1,h&&Fr(e,h),d(h)}),f._write=function(h,m,g){r.write(h,m)?g():s=g},f._final=function(h){r.end(),o=h},r.on("drain",function(){if(s){let h=s;s=null,h()}}),r.on("finish",function(){if(o){let h=o;o=null,h()}})),n&&(Id(e,h=>{n=!1,h&&Fr(e,h),d(h)}),e.on("readable",function(){if(u){let h=u;u=null,h()}}),e.on("end",function(){f.push(null)}),f._read=function(){for(;;){let h=e.read();if(h===null){u=f._read;return}if(!f.push(h))return}}),f._destroy=function(h,m){!h&&c!==null&&(h=new kd),u=null,s=null,o=null,c===null?m(h):(c=m,Fr(r,h),Fr(e,h))},f}});var gt=H((VT,qd)=>{"use strict";x();T();P();var{ObjectDefineProperties:qw,ObjectGetOwnPropertyDescriptor:It,ObjectKeys:Dw,ObjectSetPrototypeOf:Nd}=Ee();qd.exports=st;var ws=hn(),Xe=Mi();Nd(st.prototype,ws.prototype);Nd(st,ws);{let t=Dw(Xe.prototype);for(let e=0;e<t.length;e++){let r=t[e];st.prototype[r]||(st.prototype[r]=Xe.prototype[r])}}function st(t){if(!(this instanceof st))return new st(t);ws.call(this,t),Xe.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}qw(st.prototype,{writable:{__proto__:null,...It(Xe.prototype,"writable")},writableHighWaterMark:{__proto__:null,...It(Xe.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...It(Xe.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...It(Xe.prototype,"writableBuffer")},writableLength:{__proto__:null,...It(Xe.prototype,"writableLength")},writableFinished:{__proto__:null,...It(Xe.prototype,"writableFinished")},writableCorked:{__proto__:null,...It(Xe.prototype,"writableCorked")},writableEnded:{__proto__:null,...It(Xe.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...It(Xe.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 ms;function Ld(){return ms===void 0&&(ms={}),ms}st.fromWeb=function(t,e){return Ld().newStreamDuplexFromReadableWritablePair(t,e)};st.toWeb=function(t){return Ld().newReadableWritablePairFromDuplex(t)};var _s;st.from=function(t){return _s||(_s=Bd()),_s(t,"body")}});var Es=H((JT,Ud)=>{"use strict";x();T();P();var{ObjectSetPrototypeOf:Dd,Symbol:Uw}=Ee();Ud.exports=xt;var{ERR_METHOD_NOT_IMPLEMENTED:Fw}=qe().codes,Ss=gt(),{getHighWaterMark:jw}=cn();Dd(xt.prototype,Ss.prototype);Dd(xt,Ss);var bn=Uw("kCallback");function xt(t){if(!(this instanceof xt))return new xt(t);let e=t?jw(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),Ss.call(this,t),this._readableState.sync=!1,this[bn]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",$w)}function vs(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 $w(){this._final!==vs&&vs.call(this)}xt.prototype._final=vs;xt.prototype._transform=function(t,e,r){throw new Fw("_transform()")};xt.prototype._write=function(t,e,r){let n=this._readableState,i=this._writableState,s=n.length;this._transform(t,e,(o,u)=>{if(o){r(o);return}u!=null&&this.push(u),i.ended||s===n.length||n.length<n.highWaterMark?r():this[bn]=r})};xt.prototype._read=function(){if(this[bn]){let t=this[bn];this[bn]=null,t()}}});var Is=H((iO,jd)=>{"use strict";x();T();P();var{ObjectSetPrototypeOf:Fd}=Ee();jd.exports=jr;var As=Es();Fd(jr.prototype,As.prototype);Fd(jr,As);function jr(t){if(!(this instanceof jr))return new jr(t);As.call(this,t)}jr.prototype._transform=function(t,e,r){r(null,t)}});var qi=H((fO,zd)=>{x();T();P();var mn=(Et(),ge(L)),{ArrayIsArray:Ww,Promise:Vw,SymbolAsyncIterator:Hw,SymbolDispose:zw}=Ee(),Li=At(),{once:Gw}=$e(),Qw=fr(),$d=gt(),{aggregateTwoErrors:Kw,codes:{ERR_INVALID_ARG_TYPE:Bs,ERR_INVALID_RETURN_VALUE:xs,ERR_MISSING_ARGS:Yw,ERR_STREAM_DESTROYED:Jw,ERR_STREAM_PREMATURE_CLOSE:Xw},AbortError:Zw}=qe(),{validateFunction:ev,validateAbortSignal:tv}=Cr(),{isIterable:gr,isReadable:Ps,isReadableNodeStream:Ni,isNodeStream:Wd,isTransformStream:$r,isWebStream:rv,isReadableStream:Ts,isReadableFinished:nv}=dt(),iv=globalThis.AbortController||Rr().AbortController,Os,Rs,ks;function Vd(t,e,r){let n=!1;t.on("close",()=>{n=!0});let i=Li(t,{readable:e,writable:r},s=>{n=!s});return{destroy:s=>{n||(n=!0,Qw.destroyer(t,s||new Jw("pipe")))},cleanup:i}}function ov(t){return ev(t[t.length-1],"streams[stream.length - 1]"),t.pop()}function Cs(t){if(gr(t))return t;if(Ni(t))return sv(t);throw new Bs("val",["Readable","Iterable","AsyncIterable"],t)}async function*sv(t){Rs||(Rs=hn()),yield*Rs.prototype[Hw].call(t)}async function Bi(t,e,r,{end:n}){let i,s=null,o=f=>{if(f&&(i=f),s){let d=s;s=null,d()}},u=()=>new Vw((f,d)=>{i?d(i):s=()=>{i?d(i):f()}});e.on("drain",o);let c=Li(e,{readable:!1},o);try{e.writableNeedDrain&&await u();for await(let f of t)e.write(f)||await u();n&&(e.end(),await u()),r()}catch(f){r(i!==f?Kw(i,f):f)}finally{c(),e.off("drain",o)}}async function Ms(t,e,r,{end:n}){$r(e)&&(e=e.writable);let i=e.getWriter();try{for await(let s of t)await i.ready,i.write(s).catch(()=>{});await i.ready,n&&await i.close(),r()}catch(s){try{await i.abort(s),r(s)}catch(o){r(o)}}}function av(...t){return Hd(t,Gw(ov(t)))}function Hd(t,e,r){if(t.length===1&&Ww(t[0])&&(t=t[0]),t.length<2)throw new Yw("streams");let n=new iv,i=n.signal,s=r?.signal,o=[];tv(s,"options.signal");function u(){I(new Zw)}ks=ks||$e().addAbortListener;let c;s&&(c=ks(s,u));let f,d,h=[],m=0;function g(R){I(R,--m===0)}function I(R,A){var y;if(R&&(!f||f.code==="ERR_STREAM_PREMATURE_CLOSE")&&(f=R),!(!f&&!A)){for(;h.length;)h.shift()(f);(y=c)===null||y===void 0||y[zw](),n.abort(),A&&(f||o.forEach(O=>O()),mn.nextTick(e,f,d))}}let S;for(let R=0;R<t.length;R++){let A=t[R],y=R<t.length-1,O=R>0,v=y||r?.end!==!1,B=R===t.length-1;if(Wd(A)){let D=function(q){q&&q.name!=="AbortError"&&q.code!=="ERR_STREAM_PREMATURE_CLOSE"&&g(q)};var w=D;if(v){let{destroy:q,cleanup:K}=Vd(A,y,O);h.push(q),Ps(A)&&B&&o.push(K)}A.on("error",D),Ps(A)&&B&&o.push(()=>{A.removeListener("error",D)})}if(R===0)if(typeof A=="function"){if(S=A({signal:i}),!gr(S))throw new xs("Iterable, AsyncIterable or Stream","source",S)}else gr(A)||Ni(A)||$r(A)?S=A:S=$d.from(A);else if(typeof A=="function"){if($r(S)){var b;S=Cs((b=S)===null||b===void 0?void 0:b.readable)}else S=Cs(S);if(S=A(S,{signal:i}),y){if(!gr(S,!0))throw new xs("AsyncIterable",`transform[${R-1}]`,S)}else{var _;Os||(Os=Is());let D=new Os({objectMode:!0}),q=(_=S)===null||_===void 0?void 0:_.then;if(typeof q=="function")m++,q.call(S,W=>{d=W,W!=null&&D.write(W),v&&D.end(),mn.nextTick(g)},W=>{D.destroy(W),mn.nextTick(g,W)});else if(gr(S,!0))m++,Bi(S,D,g,{end:v});else if(Ts(S)||$r(S)){let W=S.readable||S;m++,Bi(W,D,g,{end:v})}else throw new xs("AsyncIterable or Promise","destination",S);S=D;let{destroy:K,cleanup:U}=Vd(S,!1,!0);h.push(K),B&&o.push(U)}}else if(Wd(A)){if(Ni(S)){m+=2;let D=uv(S,A,g,{end:v});Ps(A)&&B&&o.push(D)}else if($r(S)||Ts(S)){let D=S.readable||S;m++,Bi(D,A,g,{end:v})}else if(gr(S))m++,Bi(S,A,g,{end:v});else throw new Bs("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],S);S=A}else if(rv(A)){if(Ni(S))m++,Ms(Cs(S),A,g,{end:v});else if(Ts(S)||gr(S))m++,Ms(S,A,g,{end:v});else if($r(S))m++,Ms(S.readable,A,g,{end:v});else throw new Bs("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],S);S=A}else S=$d.from(A)}return(i!=null&&i.aborted||s!=null&&s.aborted)&&mn.nextTick(u),S}function uv(t,e,r,{end:n}){let i=!1;if(e.on("close",()=>{i||r(new Xw)}),t.pipe(e,{end:!1}),n){let o=function(){i=!0,e.end()};var s=o;nv(t)?mn.nextTick(o):t.once("end",o)}else r();return Li(t,{readable:!0,writable:!1},o=>{let u=t._readableState;o&&o.code==="ERR_STREAM_PREMATURE_CLOSE"&&u&&u.ended&&!u.errored&&!u.errorEmitted?t.once("end",r).once("error",r):r(o)}),Li(e,{readable:!1,writable:!0},r)}zd.exports={pipelineImpl:Hd,pipeline:av}});var Ls=H((mO,Xd)=>{"use strict";x();T();P();var{pipeline:lv}=qi(),Di=gt(),{destroyer:cv}=fr(),{isNodeStream:Ui,isReadable:Gd,isWritable:Qd,isWebStream:Ns,isTransformStream:yr,isWritableStream:Kd,isReadableStream:Yd}=dt(),{AbortError:fv,codes:{ERR_INVALID_ARG_VALUE:Jd,ERR_MISSING_ARGS:dv}}=qe(),hv=At();Xd.exports=function(...e){if(e.length===0)throw new dv("streams");if(e.length===1)return Di.from(e[0]);let r=[...e];if(typeof e[0]=="function"&&(e[0]=Di.from(e[0])),typeof e[e.length-1]=="function"){let g=e.length-1;e[g]=Di.from(e[g])}for(let g=0;g<e.length;++g)if(!(!Ui(e[g])&&!Ns(e[g]))){if(g<e.length-1&&!(Gd(e[g])||Yd(e[g])||yr(e[g])))throw new Jd(`streams[${g}]`,r[g],"must be readable");if(g>0&&!(Qd(e[g])||Kd(e[g])||yr(e[g])))throw new Jd(`streams[${g}]`,r[g],"must be writable")}let n,i,s,o,u;function c(g){let I=o;o=null,I?I(g):g?u.destroy(g):!m&&!h&&u.destroy()}let f=e[0],d=lv(e,c),h=!!(Qd(f)||Kd(f)||yr(f)),m=!!(Gd(d)||Yd(d)||yr(d));if(u=new Di({writableObjectMode:!!(f!=null&&f.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:h,readable:m}),h){if(Ui(f))u._write=function(I,S,b){f.write(I,S)?b():n=b},u._final=function(I){f.end(),i=I},f.on("drain",function(){if(n){let I=n;n=null,I()}});else if(Ns(f)){let S=(yr(f)?f.writable:f).getWriter();u._write=async function(b,_,w){try{await S.ready,S.write(b).catch(()=>{}),w()}catch(R){w(R)}},u._final=async function(b){try{await S.ready,S.close().catch(()=>{}),i=b}catch(_){b(_)}}}let g=yr(d)?d.readable:d;hv(g,()=>{if(i){let I=i;i=null,I()}})}if(m){if(Ui(d))d.on("readable",function(){if(s){let g=s;s=null,g()}}),d.on("end",function(){u.push(null)}),u._read=function(){for(;;){let g=d.read();if(g===null){s=u._read;return}if(!u.push(g))return}};else if(Ns(d)){let I=(yr(d)?d.readable:d).getReader();u._read=async function(){for(;;)try{let{value:S,done:b}=await I.read();if(!u.push(S))return;if(b){u.push(null);return}}catch{return}}}}return u._destroy=function(g,I){!g&&o!==null&&(g=new fv),s=null,n=null,i=null,o===null?I(g):(o=I,Ui(d)&&cv(d,g))},u}});var uh=H((IO,Us)=>{"use strict";x();T();P();var pv=globalThis.AbortController||Rr().AbortController,{codes:{ERR_INVALID_ARG_VALUE:gv,ERR_INVALID_ARG_TYPE:_n,ERR_MISSING_ARGS:yv,ERR_OUT_OF_RANGE:bv},AbortError:yt}=qe(),{validateAbortSignal:br,validateInteger:Zd,validateObject:mr}=Cr(),mv=Ee().Symbol("kWeak"),_v=Ee().Symbol("kResistStopPropagation"),{finished:wv}=At(),vv=Ls(),{addAbortSignalNoValidate:Sv}=ln(),{isWritable:Ev,isNodeStream:Av}=dt(),{deprecate:Iv}=$e(),{ArrayPrototypePush:xv,Boolean:Pv,MathFloor:eh,Number:Tv,NumberIsNaN:Ov,Promise:th,PromiseReject:rh,PromiseResolve:Rv,PromisePrototypeThen:nh,Symbol:oh}=Ee(),Fi=oh("kEmpty"),ih=oh("kEof");function kv(t,e){if(e!=null&&mr(e,"options"),e?.signal!=null&&br(e.signal,"options.signal"),Av(t)&&!Ev(t))throw new gv("stream",t,"must be writable");let r=vv(this,t);return e!=null&&e.signal&&Sv(e.signal,r),r}function ji(t,e){if(typeof t!="function")throw new _n("fn",["Function","AsyncFunction"],t);e!=null&&mr(e,"options"),e?.signal!=null&&br(e.signal,"options.signal");let r=1;e?.concurrency!=null&&(r=eh(e.concurrency));let n=r-1;return e?.highWaterMark!=null&&(n=eh(e.highWaterMark)),Zd(r,"options.concurrency",1),Zd(n,"options.highWaterMark",0),n+=r,async function*(){let s=$e().AbortSignalAny([e?.signal].filter(Pv)),o=this,u=[],c={signal:s},f,d,h=!1,m=0;function g(){h=!0,I()}function I(){m-=1,S()}function S(){d&&!h&&m<r&&u.length<n&&(d(),d=null)}async function b(){try{for await(let _ of o){if(h)return;if(s.aborted)throw new yt;try{if(_=t(_,c),_===Fi)continue;_=Rv(_)}catch(w){_=rh(w)}m+=1,nh(_,I,g),u.push(_),f&&(f(),f=null),!h&&(u.length>=n||m>=r)&&await new th(w=>{d=w})}u.push(ih)}catch(_){let w=rh(_);nh(w,I,g),u.push(w)}finally{h=!0,f&&(f(),f=null)}}b();try{for(;;){for(;u.length>0;){let _=await u[0];if(_===ih)return;if(s.aborted)throw new yt;_!==Fi&&(yield _),u.shift(),S()}await new th(_=>{f=_})}}finally{h=!0,d&&(d(),d=null)}}.call(this)}function Cv(t=void 0){return t!=null&&mr(t,"options"),t?.signal!=null&&br(t.signal,"options.signal"),async function*(){let r=0;for await(let i of this){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new yt({cause:t.signal.reason});yield[r++,i]}}.call(this)}async function sh(t,e=void 0){for await(let r of Ds.call(this,t,e))return!0;return!1}async function Mv(t,e=void 0){if(typeof t!="function")throw new _n("fn",["Function","AsyncFunction"],t);return!await sh.call(this,async(...r)=>!await t(...r),e)}async function Bv(t,e){for await(let r of Ds.call(this,t,e))return r}async function Nv(t,e){if(typeof t!="function")throw new _n("fn",["Function","AsyncFunction"],t);async function r(n,i){return await t(n,i),Fi}for await(let n of ji.call(this,r,e));}function Ds(t,e){if(typeof t!="function")throw new _n("fn",["Function","AsyncFunction"],t);async function r(n,i){return await t(n,i)?n:Fi}return ji.call(this,r,e)}var qs=class extends yv{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function Lv(t,e,r){var n;if(typeof t!="function")throw new _n("reducer",["Function","AsyncFunction"],t);r!=null&&mr(r,"options"),r?.signal!=null&&br(r.signal,"options.signal");let i=arguments.length>1;if(r!=null&&(n=r.signal)!==null&&n!==void 0&&n.aborted){let f=new yt(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await wv(this.destroy(f)),f}let s=new pv,o=s.signal;if(r!=null&&r.signal){let f={once:!0,[mv]:this,[_v]:!0};r.signal.addEventListener("abort",()=>s.abort(),f)}let u=!1;try{for await(let f of this){var c;if(u=!0,r!=null&&(c=r.signal)!==null&&c!==void 0&&c.aborted)throw new yt;i?e=await t(e,f,{signal:o}):(e=f,i=!0)}if(!u&&!i)throw new qs}finally{s.abort()}return e}async function qv(t){t!=null&&mr(t,"options"),t?.signal!=null&&br(t.signal,"options.signal");let e=[];for await(let n 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});xv(e,n)}return e}function Dv(t,e){let r=ji.call(this,t,e);return async function*(){for await(let i of r)yield*i}.call(this)}function ah(t){if(t=Tv(t),Ov(t))return 0;if(t<0)throw new bv("number",">= 0",t);return t}function Uv(t,e=void 0){return e!=null&&mr(e,"options"),e?.signal!=null&&br(e.signal,"options.signal"),t=ah(t),async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new yt;for await(let s of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new yt;t--<=0&&(yield s)}}.call(this)}function Fv(t,e=void 0){return e!=null&&mr(e,"options"),e?.signal!=null&&br(e.signal,"options.signal"),t=ah(t),async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new yt;for await(let s of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new yt;if(t-- >0&&(yield s),t<=0)return}}.call(this)}Us.exports.streamReturningOperators={asIndexedPairs:Iv(Cv,"readable.asIndexedPairs will be removed in a future version."),drop:Uv,filter:Ds,flatMap:Dv,map:ji,take:Fv,compose:kv};Us.exports.promiseReturningOperators={every:Mv,forEach:Nv,reduce:Lv,toArray:qv,some:sh,find:Bv}});var Fs=H((CO,lh)=>{"use strict";x();T();P();var{ArrayPrototypePop:jv,Promise:$v}=Ee(),{isIterable:Wv,isNodeStream:Vv,isWebStream:Hv}=dt(),{pipelineImpl:zv}=qi(),{finished:Gv}=At();js();function Qv(...t){return new $v((e,r)=>{let n,i,s=t[t.length-1];if(s&&typeof s=="object"&&!Vv(s)&&!Wv(s)&&!Hv(s)){let o=jv(t);n=o.signal,i=o.end}zv(t,(o,u)=>{o?r(o):e(u)},{signal:n,end:i})})}lh.exports={finished:Gv,pipeline:Qv}});var js=H((UO,mh)=>{"use strict";x();T();P();var{Buffer:Kv}=(Re(),ge(Be)),{ObjectDefineProperty:Pt,ObjectKeys:dh,ReflectApply:hh}=Ee(),{promisify:{custom:ph}}=$e(),{streamReturningOperators:ch,promiseReturningOperators:fh}=uh(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:gh}}=qe(),Yv=Ls(),{setDefaultHighWaterMark:Jv,getDefaultHighWaterMark:Xv}=cn(),{pipeline:yh}=qi(),{destroyer:Zv}=fr(),bh=At(),$s=Fs(),wn=dt(),Se=mh.exports=wi().Stream;Se.isDestroyed=wn.isDestroyed;Se.isDisturbed=wn.isDisturbed;Se.isErrored=wn.isErrored;Se.isReadable=wn.isReadable;Se.isWritable=wn.isWritable;Se.Readable=hn();for(let t of dh(ch)){let r=function(...n){if(new.target)throw gh();return Se.Readable.from(hh(e,this,n))},e=ch[t];Pt(r,"name",{__proto__:null,value:e.name}),Pt(r,"length",{__proto__:null,value:e.length}),Pt(Se.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}for(let t of dh(fh)){let r=function(...n){if(new.target)throw gh();return hh(e,this,n)},e=fh[t];Pt(r,"name",{__proto__:null,value:e.name}),Pt(r,"length",{__proto__:null,value:e.length}),Pt(Se.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}Se.Writable=Mi();Se.Duplex=gt();Se.Transform=Es();Se.PassThrough=Is();Se.pipeline=yh;var{addAbortSignal:e0}=ln();Se.addAbortSignal=e0;Se.finished=bh;Se.destroy=Zv;Se.compose=Yv;Se.setDefaultHighWaterMark=Jv;Se.getDefaultHighWaterMark=Xv;Pt(Se,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return $s}});Pt(yh,ph,{__proto__:null,enumerable:!0,get(){return $s.pipeline}});Pt(bh,ph,{__proto__:null,enumerable:!0,get(){return $s.finished}});Se.Stream=Se;Se._isUint8Array=function(e){return e instanceof Uint8Array};Se._uint8ArrayToBuffer=function(e){return Kv.from(e.buffer,e.byteOffset,e.byteLength)}});var Qt=H((zO,Pe)=>{"use strict";x();T();P();var Ce=js(),t0=Fs(),r0=Ce.Readable.destroy;Pe.exports=Ce.Readable;Pe.exports._uint8ArrayToBuffer=Ce._uint8ArrayToBuffer;Pe.exports._isUint8Array=Ce._isUint8Array;Pe.exports.isDisturbed=Ce.isDisturbed;Pe.exports.isErrored=Ce.isErrored;Pe.exports.isReadable=Ce.isReadable;Pe.exports.Readable=Ce.Readable;Pe.exports.Writable=Ce.Writable;Pe.exports.Duplex=Ce.Duplex;Pe.exports.Transform=Ce.Transform;Pe.exports.PassThrough=Ce.PassThrough;Pe.exports.addAbortSignal=Ce.addAbortSignal;Pe.exports.finished=Ce.finished;Pe.exports.destroy=Ce.destroy;Pe.exports.destroy=r0;Pe.exports.pipeline=Ce.pipeline;Pe.exports.compose=Ce.compose;Object.defineProperty(Ce,"promises",{configurable:!0,enumerable:!0,get(){return t0}});Pe.exports.Stream=Ce.Stream;Pe.exports.default=Pe.exports});var _h=H((ZO,Ws)=>{x();T();P();typeof Object.create=="function"?Ws.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Ws.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}}});var Sh=H((sR,vh)=>{"use strict";x();T();P();var{Buffer:at}=(Re(),ge(Be)),wh=Symbol.for("BufferList");function _e(t){if(!(this instanceof _e))return new _e(t);_e._init.call(this,t)}_e._init=function(e){Object.defineProperty(this,wh,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)};_e.prototype._new=function(e){return new _e(e)};_e.prototype._offset=function(e){if(e===0)return[0,0];let r=0;for(let n=0;n<this._bufs.length;n++){let i=r+this._bufs[n].length;if(e<i||n===this._bufs.length-1)return[n,e-r];r=i}};_e.prototype._reverseOffset=function(t){let e=t[0],r=t[1];for(let n=0;n<e;n++)r+=this._bufs[n].length;return r};_e.prototype.getBuffers=function(){return this._bufs};_e.prototype.get=function(e){if(e>this.length||e<0)return;let r=this._offset(e);return this._bufs[r[0]][r[1]]};_e.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)};_e.prototype.copy=function(e,r,n,i){if((typeof n!="number"||n<0)&&(n=0),(typeof i!="number"||i>this.length)&&(i=this.length),n>=this.length||i<=0)return e||at.alloc(0);let s=!!e,o=this._offset(n),u=i-n,c=u,f=s&&r||0,d=o[1];if(n===0&&i===this.length){if(!s)return this._bufs.length===1?this._bufs[0]:at.concat(this._bufs,this.length);for(let h=0;h<this._bufs.length;h++)this._bufs[h].copy(e,f),f+=this._bufs[h].length;return e}if(c<=this._bufs[o[0]].length-d)return s?this._bufs[o[0]].copy(e,r,d,d+c):this._bufs[o[0]].slice(d,d+c);s||(e=at.allocUnsafe(u));for(let h=o[0];h<this._bufs.length;h++){let m=this._bufs[h].length-d;if(c>m)this._bufs[h].copy(e,f,d),f+=m;else{this._bufs[h].copy(e,f,d,d+c),f+=m;break}c-=m,d&&(d=0)}return e.length>f?e.slice(0,f):e};_e.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 n=this._offset(e),i=this._offset(r),s=this._bufs.slice(n[0],i[0]+1);return i[1]===0?s.pop():s[s.length-1]=s[s.length-1].slice(0,i[1]),n[1]!==0&&(s[0]=s[0].slice(n[1])),this._new(s)};_e.prototype.toString=function(e,r,n){return this.slice(r,n).toString(e)};_e.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};_e.prototype.duplicate=function(){let e=this._new();for(let r=0;r<this._bufs.length;r++)e.append(this._bufs[r]);return e};_e.prototype.append=function(e){return this._attach(e,_e.prototype._appendBuffer)};_e.prototype.prepend=function(e){return this._attach(e,_e.prototype._prependBuffer,!0)};_e.prototype._attach=function(e,r,n){if(e==null)return this;if(e.buffer)r.call(this,at.from(e.buffer,e.byteOffset,e.byteLength));else if(Array.isArray(e)){let[i,s]=n?[e.length-1,-1]:[0,1];for(let o=i;o>=0&&o<e.length;o+=s)this._attach(e[o],r,n)}else if(this._isBufferList(e)){let[i,s]=n?[e._bufs.length-1,-1]:[0,1];for(let o=i;o>=0&&o<e._bufs.length;o+=s)this._attach(e._bufs[o],r,n)}else typeof e=="number"&&(e=e.toString()),r.call(this,at.from(e));return this};_e.prototype._appendBuffer=function(e){this._bufs.push(e),this.length+=e.length};_e.prototype._prependBuffer=function(e){this._bufs.unshift(e),this.length+=e.length};_e.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=at.from([t]):typeof t=="string"?t=at.from(t,r):this._isBufferList(t)?t=t.slice():Array.isArray(t.buffer)?t=at.from(t.buffer,t.byteOffset,t.byteLength):at.isBuffer(t)||(t=at.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 n=this._offset(e),i=n[0],s=n[1];for(;i<this._bufs.length;i++){let o=this._bufs[i];for(;s<o.length;)if(o.length-s>=t.length){let c=o.indexOf(t,s);if(c!==-1)return this._reverseOffset([i,c]);s=o.length-t.length+1}else{let c=this._reverseOffset([i,s]);if(this._match(c,t))return c;s++}s=0}return-1};_e.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?_e.prototype[r]=function(n,i){return this.slice(n,n+i)[r](0,i)}:_e.prototype[r]=function(n=0){return this.slice(n,n+t[r])[r](0)}})(e)})();_e.prototype._isBufferList=function(e){return e instanceof _e||_e.isBufferList(e)};_e.isBufferList=function(e){return e!=null&&e[wh]};vh.exports=_e});var Eh=H((hR,$i)=>{"use strict";x();T();P();var Vs=Qt().Duplex,n0=_h(),vn=Sh();function Ue(t){if(!(this instanceof Ue))return new Ue(t);if(typeof t=="function"){this._callback=t;let e=function(n){this._callback&&(this._callback(n),this._callback=null)}.bind(this);this.on("pipe",function(n){n.on("error",e)}),this.on("unpipe",function(n){n.removeListener("error",e)}),t=null}vn._init.call(this,t),Vs.call(this)}n0(Ue,Vs);Object.assign(Ue.prototype,vn.prototype);Ue.prototype._new=function(e){return new Ue(e)};Ue.prototype._write=function(e,r,n){this._appendBuffer(e),typeof n=="function"&&n()};Ue.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)};Ue.prototype.end=function(e){Vs.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)};Ue.prototype._destroy=function(e,r){this._bufs.length=0,this.length=0,r(e)};Ue.prototype._isBufferList=function(e){return e instanceof Ue||e instanceof vn||Ue.isBufferList(e)};Ue.isBufferList=vn.isBufferList;$i.exports=Ue;$i.exports.BufferListStream=Ue;$i.exports.BufferList=vn});var Ih=H((wR,Ah)=>{x();T();P();var Hs=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}};Ah.exports=Hs});var zs=H((PR,xh)=>{x();T();P();var Q=xh.exports,{Buffer:He}=(Re(),ge(Be));Q.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"};Q.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};Q.requiredHeaderFlagsErrors={};for(let t in Q.requiredHeaderFlags){let e=Q.requiredHeaderFlags[t];Q.requiredHeaderFlagsErrors[t]="Invalid header flag bits, must be 0x"+e.toString(16)+" for "+Q.types[t]+" packet"}Q.codes={};for(let t in Q.types){let e=Q.types[t];Q.codes[e]=t}Q.CMD_SHIFT=4;Q.CMD_MASK=240;Q.DUP_MASK=8;Q.QOS_MASK=3;Q.QOS_SHIFT=1;Q.RETAIN_MASK=1;Q.VARBYTEINT_MASK=127;Q.VARBYTEINT_FIN_MASK=128;Q.VARBYTEINT_MAX=268435455;Q.SESSIONPRESENT_MASK=1;Q.SESSIONPRESENT_HEADER=He.from([Q.SESSIONPRESENT_MASK]);Q.CONNACK_HEADER=He.from([Q.codes.connack<<Q.CMD_SHIFT]);Q.USERNAME_MASK=128;Q.PASSWORD_MASK=64;Q.WILL_RETAIN_MASK=32;Q.WILL_QOS_MASK=24;Q.WILL_QOS_SHIFT=3;Q.WILL_FLAG_MASK=4;Q.CLEAN_SESSION_MASK=2;Q.CONNECT_HEADER=He.from([Q.codes.connect<<Q.CMD_SHIFT]);Q.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};Q.propertiesCodes={};for(let t in Q.properties){let e=Q.properties[t];Q.propertiesCodes[e]=t}Q.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 Kt(t){return[0,1,2].map(e=>[0,1].map(r=>[0,1].map(n=>{let i=He.alloc(1);return i.writeUInt8(Q.codes[t]<<Q.CMD_SHIFT|(r?Q.DUP_MASK:0)|e<<Q.QOS_SHIFT|n,0,!0),i})))}Q.PUBLISH_HEADER=Kt("publish");Q.SUBSCRIBE_HEADER=Kt("subscribe");Q.SUBSCRIBE_OPTIONS_QOS_MASK=3;Q.SUBSCRIBE_OPTIONS_NL_MASK=1;Q.SUBSCRIBE_OPTIONS_NL_SHIFT=2;Q.SUBSCRIBE_OPTIONS_RAP_MASK=1;Q.SUBSCRIBE_OPTIONS_RAP_SHIFT=3;Q.SUBSCRIBE_OPTIONS_RH_MASK=3;Q.SUBSCRIBE_OPTIONS_RH_SHIFT=4;Q.SUBSCRIBE_OPTIONS_RH=[0,16,32];Q.SUBSCRIBE_OPTIONS_NL=4;Q.SUBSCRIBE_OPTIONS_RAP=8;Q.SUBSCRIBE_OPTIONS_QOS=[0,1,2];Q.UNSUBSCRIBE_HEADER=Kt("unsubscribe");Q.ACKS={unsuback:Kt("unsuback"),puback:Kt("puback"),pubcomp:Kt("pubcomp"),pubrel:Kt("pubrel"),pubrec:Kt("pubrec")};Q.SUBACK_HEADER=He.from([Q.codes.suback<<Q.CMD_SHIFT]);Q.VERSION3=He.from([3]);Q.VERSION4=He.from([4]);Q.VERSION5=He.from([5]);Q.VERSION131=He.from([131]);Q.VERSION132=He.from([132]);Q.QOS=[0,1,2].map(t=>He.from([t]));Q.EMPTY={pingreq:He.from([Q.codes.pingreq<<4,0]),pingresp:He.from([Q.codes.pingresp<<4,0]),disconnect:He.from([Q.codes.disconnect<<4,0])};Q.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"};Q.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"};Q.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"};Q.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"};Q.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"};Q.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}});var Th=H((BR,Ph)=>{x();T();P();var Wr=1e3,Vr=Wr*60,Hr=Vr*60,_r=Hr*24,i0=_r*7,o0=_r*365.25;Ph.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return s0(t);if(r==="number"&&isFinite(t))return e.long?u0(t):a0(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function s0(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]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*o0;case"weeks":case"week":case"w":return r*i0;case"days":case"day":case"d":return r*_r;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Hr;case"minutes":case"minute":case"mins":case"min":case"m":return r*Vr;case"seconds":case"second":case"secs":case"sec":case"s":return r*Wr;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function a0(t){var e=Math.abs(t);return e>=_r?Math.round(t/_r)+"d":e>=Hr?Math.round(t/Hr)+"h":e>=Vr?Math.round(t/Vr)+"m":e>=Wr?Math.round(t/Wr)+"s":t+"ms"}function u0(t){var e=Math.abs(t);return e>=_r?Wi(t,e,_r,"day"):e>=Hr?Wi(t,e,Hr,"hour"):e>=Vr?Wi(t,e,Vr,"minute"):e>=Wr?Wi(t,e,Wr,"second"):t+" ms"}function Wi(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var Rh=H((jR,Oh)=>{x();T();P();function l0(t){r.debug=r,r.default=r,r.coerce=c,r.disable=o,r.enable=i,r.enabled=u,r.humanize=Th(),r.destroy=f,Object.keys(t).forEach(d=>{r[d]=t[d]}),r.names=[],r.skips=[],r.formatters={};function e(d){let h=0;for(let m=0;m<d.length;m++)h=(h<<5)-h+d.charCodeAt(m),h|=0;return r.colors[Math.abs(h)%r.colors.length]}r.selectColor=e;function r(d){let h,m=null,g,I;function S(...b){if(!S.enabled)return;let _=S,w=Number(new Date),R=w-(h||w);_.diff=R,_.prev=h,_.curr=w,h=w,b[0]=r.coerce(b[0]),typeof b[0]!="string"&&b.unshift("%O");let A=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(O,v)=>{if(O==="%%")return"%";A++;let B=r.formatters[v];if(typeof B=="function"){let D=b[A];O=B.call(_,D),b.splice(A,1),A--}return O}),r.formatArgs.call(_,b),(_.log||r.log).apply(_,b)}return S.namespace=d,S.useColors=r.useColors(),S.color=r.selectColor(d),S.extend=n,S.destroy=r.destroy,Object.defineProperty(S,"enabled",{enumerable:!0,configurable:!1,get:()=>m!==null?m:(g!==r.namespaces&&(g=r.namespaces,I=r.enabled(d)),I),set:b=>{m=b}}),typeof r.init=="function"&&r.init(S),S}function n(d,h){let m=r(this.namespace+(typeof h>"u"?":":h)+d);return m.log=this.log,m}function i(d){r.save(d),r.namespaces=d,r.names=[],r.skips=[];let h=(typeof d=="string"?d:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let m of h)m[0]==="-"?r.skips.push(m.slice(1)):r.names.push(m)}function s(d,h){let m=0,g=0,I=-1,S=0;for(;m<d.length;)if(g<h.length&&(h[g]===d[m]||h[g]==="*"))h[g]==="*"?(I=g,S=m,g++):(m++,g++);else if(I!==-1)g=I+1,S++,m=S;else return!1;for(;g<h.length&&h[g]==="*";)g++;return g===h.length}function o(){let d=[...r.names,...r.skips.map(h=>"-"+h)].join(",");return r.enable(""),d}function u(d){for(let h of r.skips)if(s(d,h))return!1;for(let h of r.names)if(s(d,h))return!0;return!1}function c(d){return d instanceof Error?d.stack||d.message:d}function f(){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}Oh.exports=l0});var Yt=H((ze,Vi)=>{x();T();P();ze.formatArgs=f0;ze.save=d0;ze.load=h0;ze.useColors=c0;ze.storage=p0();ze.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`."))}})();ze.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 c0(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return 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&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function f0(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Vi.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}ze.log=console.debug||console.log||(()=>{});function d0(t){try{t?ze.storage.setItem("debug",t):ze.storage.removeItem("debug")}catch{}}function h0(){let t;try{t=ze.storage.getItem("debug")||ze.storage.getItem("DEBUG")}catch{}return!t&&typeof L<"u"&&"env"in L&&(t=L.env.DEBUG),t}function p0(){try{return localStorage}catch{}}Vi.exports=Rh()(ze);var{formatters:g0}=Vi.exports;g0.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Mh=H((ek,Ch)=>{x();T();P();var y0=Eh(),{EventEmitter:b0}=(Vt(),ge(Wt)),kh=Ih(),pe=zs(),ae=Yt()("mqtt-packet:parser"),Gs=class t extends b0{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(){ae("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new kh,this.error=null,this._list=y0(),this._stateCounter=0}parse(e){for(this.error&&this._resetState(),this._list.append(e),ae("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++,ae("parse: state complete. _stateCounter is now: %d",this._stateCounter),ae("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return ae("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>>pe.CMD_SHIFT;this.packet.cmd=pe.types[r];let n=e&15,i=pe.requiredHeaderFlags[r];return i!=null&&n!==i?this._emitError(new Error(pe.requiredHeaderFlagsErrors[r])):(this.packet.retain=(e&pe.RETAIN_MASK)!==0,this.packet.qos=e>>pe.QOS_SHIFT&pe.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=(e&pe.DUP_MASK)!==0,ae("_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)),ae("_parseLength %d",e.value),!!e}_parsePayload(){ae("_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 ae("_parsePayload complete result: %s",e),e}_parseConnect(){ae("_parseConnect");let e,r,n,i,s={},o=this.packet,u=this._parseString();if(u===null)return this._emitError(new Error("Cannot parse protocolId"));if(u!=="MQTT"&&u!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(o.protocolId=u,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(o.protocolVersion=this._list.readUInt8(this._pos),o.protocolVersion>=128&&(o.bridgeMode=!0,o.protocolVersion=o.protocolVersion-128),o.protocolVersion!==3&&o.protocolVersion!==4&&o.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"));s.username=this._list.readUInt8(this._pos)&pe.USERNAME_MASK,s.password=this._list.readUInt8(this._pos)&pe.PASSWORD_MASK,s.will=this._list.readUInt8(this._pos)&pe.WILL_FLAG_MASK;let c=!!(this._list.readUInt8(this._pos)&pe.WILL_RETAIN_MASK),f=(this._list.readUInt8(this._pos)&pe.WILL_QOS_MASK)>>pe.WILL_QOS_SHIFT;if(s.will)o.will={},o.will.retain=c,o.will.qos=f;else{if(c)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(f)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(o.clean=(this._list.readUInt8(this._pos)&pe.CLEAN_SESSION_MASK)!==0,this._pos++,o.keepalive=this._parseNum(),o.keepalive===-1)return this._emitError(new Error("Packet too short"));if(o.protocolVersion===5){let h=this._parseProperties();Object.getOwnPropertyNames(h).length&&(o.properties=h)}let d=this._parseString();if(d===null)return this._emitError(new Error("Packet too short"));if(o.clientId=d,ae("_parseConnect: packet.clientId: %s",o.clientId),s.will){if(o.protocolVersion===5){let h=this._parseProperties();Object.getOwnPropertyNames(h).length&&(o.will.properties=h)}if(e=this._parseString(),e===null)return this._emitError(new Error("Cannot parse will topic"));if(o.will.topic=e,ae("_parseConnect: packet.will.topic: %s",o.will.topic),r=this._parseBuffer(),r===null)return this._emitError(new Error("Cannot parse will payload"));o.will.payload=r,ae("_parseConnect: packet.will.paylaod: %s",o.will.payload)}if(s.username){if(i=this._parseString(),i===null)return this._emitError(new Error("Cannot parse username"));o.username=i,ae("_parseConnect: packet.username: %s",o.username)}if(s.password){if(n=this._parseBuffer(),n===null)return this._emitError(new Error("Cannot parse password"));o.password=n}return this.settings=o,ae("_parseConnect: complete"),o}_parseConnack(){ae("_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&pe.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 n=this._parseProperties();Object.getOwnPropertyNames(n).length&&(e.properties=n)}ae("_parseConnack: complete")}_parsePublish(){ae("_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),ae("_parsePublish: payload from buffer list: %o",e.payload)}}_parseSubscribe(){ae("_parseSubscribe");let e=this.packet,r,n,i,s,o,u,c;if(e.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let f=this._parseProperties();Object.getOwnPropertyNames(f).length&&(e.properties=f)}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(n=this._parseByte(),this.settings.protocolVersion===5){if(n&192)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(n&252)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(i=n&pe.SUBSCRIBE_OPTIONS_QOS_MASK,i>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(u=(n>>pe.SUBSCRIBE_OPTIONS_NL_SHIFT&pe.SUBSCRIBE_OPTIONS_NL_MASK)!==0,o=(n>>pe.SUBSCRIBE_OPTIONS_RAP_SHIFT&pe.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,s=n>>pe.SUBSCRIBE_OPTIONS_RH_SHIFT&pe.SUBSCRIBE_OPTIONS_RH_MASK,s>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));c={topic:r,qos:i},this.settings.protocolVersion===5?(c.nl=u,c.rap=o,c.rh=s):this.settings.bridgeMode&&(c.rh=0,c.rap=!0,c.nl=!0),ae("_parseSubscribe: push subscription `%s` to subscription",c),e.subscriptions.push(c)}}}_parseSuback(){ae("_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(!pe.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(){ae("_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"));ae("_parseUnsubscribe: push topic `%s` to unsubscriptions",r),e.unsubscriptions.push(r)}}}_parseUnsuback(){ae("_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 n=this._list.readUInt8(this._pos++);if(!pe.MQTT5_UNSUBACK_CODES[n])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(n)}}}_parseConfirmation(){ae("_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(!pe.MQTT5_PUBACK_PUBREC_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!pe.MQTT5_PUBREL_PUBCOMP_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break}ae("_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(ae("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?(e.reasonCode=this._parseByte(),pe.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 ae("_parseDisconnect result: true"),!0}_parseAuth(){ae("_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(),!pe.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),ae("_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):(ae("_parseMessageId: packet.messageId %d",e.messageId),!0)}_parseString(e){let r=this._parseNum(),n=r+this._pos;if(r===-1||n>this._list.length||n>this.packet.length)return null;let i=this._list.toString("utf8",this._pos,n);return this._pos+=r,ae("_parseString: result: %s",i),i}_parseStringPair(){return ae("_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 n=this._list.slice(this._pos,r);return this._pos+=e,ae("_parseBuffer: result: %o",n),n}_parseNum(){if(this._list.length-this._pos<2)return-1;let e=this._list.readUInt16BE(this._pos);return this._pos+=2,ae("_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,ae("_parse4ByteNum: result: %s",e),e}_parseVarByteNum(e){ae("_parseVarByteNum");let r=4,n=0,i=1,s=0,o=!1,u,c=this._pos?this._pos:0;for(;n<r&&c+n<this._list.length;){if(u=this._list.readUInt8(c+n++),s+=i*(u&pe.VARBYTEINT_MASK),i*=128,(u&pe.VARBYTEINT_FIN_MASK)===0){o=!0;break}if(this._list.length<=n)break}return!o&&n===r&&this._list.length>=n&&this._emitError(new Error("Invalid variable byte integer")),c&&(this._pos+=n),o?e?o={bytes:n,value:s}:o=s:o=!1,ae("_parseVarByteNum: result: %o",o),o}_parseByte(){let e;return this._pos<this._list.length&&(e=this._list.readUInt8(this._pos),this._pos++),ae("_parseByte: result: %o",e),e}_parseByType(e){switch(ae("_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(){ae("_parseProperties");let e=this._parseVarByteNum(),n=this._pos+e,i={};for(;this._pos<n;){let s=this._parseByte();if(!s)return this._emitError(new Error("Cannot parse property code type")),!1;let o=pe.propertiesCodes[s];if(!o)return this._emitError(new Error("Unknown property")),!1;if(o==="userProperties"){i[o]||(i[o]=Object.create(null));let u=this._parseByType(pe.propertiesTypes[o]);if(i[o][u.name])if(Array.isArray(i[o][u.name]))i[o][u.name].push(u.value);else{let c=i[o][u.name];i[o][u.name]=[c],i[o][u.name].push(u.value)}else i[o][u.name]=u.value;continue}i[o]?Array.isArray(i[o])?i[o].push(this._parseByType(pe.propertiesTypes[o])):(i[o]=[i[o]],i[o].push(this._parseByType(pe.propertiesTypes[o]))):i[o]=this._parseByType(pe.propertiesTypes[o])}return i}_newPacket(){return ae("_newPacket"),this.packet&&(this._list.consume(this.packet.length),ae("_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)),ae("_newPacket: new packet"),this.packet=new kh,this._pos=0,!0}_emitError(e){ae("_emitError",e),this.error=e,this.emit("error",e)}};Ch.exports=Gs});var qh=H((ak,Lh)=>{x();T();P();var{Buffer:Sn}=(Re(),ge(Be)),m0=65536,Bh={},_0=Sn.isBuffer(Sn.from([1,2]).subarray(0,1));function Nh(t){let e=Sn.allocUnsafe(2);return e.writeUInt8(t>>8,0),e.writeUInt8(t&255,1),e}function w0(){for(let t=0;t<m0;t++)Bh[t]=Nh(t)}function v0(t){let r=0,n=0,i=Sn.allocUnsafe(4);do r=t%128|0,t=t/128|0,t>0&&(r=r|128),i.writeUInt8(r,n++);while(t>0&&n<4);return t>0&&(n=0),_0?i.subarray(0,n):i.slice(0,n)}function S0(t){let e=Sn.allocUnsafe(4);return e.writeUInt32BE(t,0),e}Lh.exports={cache:Bh,generateCache:w0,generateNumber:Nh,genBufVariableByteInt:v0,generate4ByteBuffer:S0}});var Dh=H((pk,Qs)=>{"use strict";x();T();P();typeof L>"u"||!L.version||L.version.indexOf("v0.")===0||L.version.indexOf("v1.")===0&&L.version.indexOf("v1.8.")!==0?Qs.exports={nextTick:E0}:Qs.exports=L;function E0(t,e,r,n){if(typeof t!="function")throw new TypeError('"callback" argument must be a function');var i=arguments.length,s,o;switch(i){case 0:case 1:return L.nextTick(t);case 2:return L.nextTick(function(){t.call(null,e)});case 3:return L.nextTick(function(){t.call(null,e,r)});case 4:return L.nextTick(function(){t.call(null,e,r,n)});default:for(s=new Array(i-1),o=0;o<s.length;)s[o++]=arguments[o];return L.nextTick(function(){t.apply(null,s)})}}});var Js=H((vk,zh)=>{x();T();P();var ue=zs(),{Buffer:se}=(Re(),ge(Be)),A0=se.allocUnsafe(0),I0=se.from([0]),En=qh(),x0=Dh().nextTick,Ze=Yt()("mqtt-packet:writeToStream"),Hi=En.cache,P0=En.generateNumber,T0=En.generateCache,Ks=En.genBufVariableByteInt,O0=En.generate4ByteBuffer,We=Ys,zi=!0;function Vh(t,e,r){switch(Ze("generate called"),e.cork&&(e.cork(),x0(R0,e)),zi&&(zi=!1,T0()),Ze("generate: packet.cmd: %s",t.cmd),t.cmd){case"connect":return k0(t,e,r);case"connack":return C0(t,e,r);case"publish":return M0(t,e,r);case"puback":case"pubrec":case"pubrel":case"pubcomp":return B0(t,e,r);case"subscribe":return N0(t,e,r);case"suback":return L0(t,e,r);case"unsubscribe":return q0(t,e,r);case"unsuback":return D0(t,e,r);case"pingreq":case"pingresp":return U0(t,e,r);case"disconnect":return F0(t,e,r);case"auth":return j0(t,e,r);default:return e.destroy(new Error("Unknown command")),!1}}Object.defineProperty(Vh,"cacheNumbers",{get(){return We===Ys},set(t){t?((!Hi||Object.keys(Hi).length===0)&&(zi=!0),We=Ys):(zi=!1,We=$0)}});function R0(t){t.uncork()}function k0(t,e,r){let n=t||{},i=n.protocolId||"MQTT",s=n.protocolVersion||4,o=n.will,u=n.clean,c=n.keepalive||0,f=n.clientId||"",d=n.username,h=n.password,m=n.properties;u===void 0&&(u=!0);let g=0;if(!i||typeof i!="string"&&!se.isBuffer(i))return e.destroy(new Error("Invalid protocolId")),!1;if(g+=i.length+2,s!==3&&s!==4&&s!==5)return e.destroy(new Error("Invalid protocol version")),!1;if(g+=1,(typeof f=="string"||se.isBuffer(f))&&(f||s>=4)&&(f||u))g+=se.byteLength(f)+2;else{if(s<4)return e.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(u*1===0)return e.destroy(new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof c!="number"||c<0||c>65535||c%1!==0)return e.destroy(new Error("Invalid keepalive")),!1;g+=2,g+=1;let I,S;if(s===5){if(I=Jt(e,m),!I)return!1;g+=I.length}if(o){if(typeof o!="object")return e.destroy(new Error("Invalid will")),!1;if(!o.topic||typeof o.topic!="string")return e.destroy(new Error("Invalid will topic")),!1;if(g+=se.byteLength(o.topic)+2,g+=2,o.payload)if(o.payload.length>=0)typeof o.payload=="string"?g+=se.byteLength(o.payload):g+=o.payload.length;else return e.destroy(new Error("Invalid will payload")),!1;if(S={},s===5){if(S=Jt(e,o.properties),!S)return!1;g+=S.length}}let b=!1;if(d!=null)if(Wh(d))b=!0,g+=se.byteLength(d)+2;else return e.destroy(new Error("Invalid username")),!1;if(h!=null){if(!b)return e.destroy(new Error("Username is required to use password")),!1;if(Wh(h))g+=Hh(h)+2;else return e.destroy(new Error("Invalid password")),!1}e.write(ue.CONNECT_HEADER),et(e,g),zr(e,i),n.bridgeMode&&(s+=128),e.write(s===131?ue.VERSION131:s===132?ue.VERSION132:s===4?ue.VERSION4:s===5?ue.VERSION5:ue.VERSION3);let _=0;return _|=d!=null?ue.USERNAME_MASK:0,_|=h!=null?ue.PASSWORD_MASK:0,_|=o&&o.retain?ue.WILL_RETAIN_MASK:0,_|=o&&o.qos?o.qos<<ue.WILL_QOS_SHIFT:0,_|=o?ue.WILL_FLAG_MASK:0,_|=u?ue.CLEAN_SESSION_MASK:0,e.write(se.from([_])),We(e,c),s===5&&I.write(),zr(e,f),o&&(s===5&&S.write(),wr(e,o.topic),zr(e,o.payload)),d!=null&&zr(e,d),h!=null&&zr(e,h),!0}function C0(t,e,r){let n=r?r.protocolVersion:4,i=t||{},s=n===5?i.reasonCode:i.returnCode,o=i.properties,u=2;if(typeof s!="number")return e.destroy(new Error("Invalid return code")),!1;let c=null;if(n===5){if(c=Jt(e,o),!c)return!1;u+=c.length}return e.write(ue.CONNACK_HEADER),et(e,u),e.write(i.sessionPresent?ue.SESSIONPRESENT_HEADER:I0),e.write(se.from([s])),c?.write(),!0}function M0(t,e,r){Ze("publish: packet: %o",t);let n=r?r.protocolVersion:4,i=t||{},s=i.qos||0,o=i.retain?ue.RETAIN_MASK:0,u=i.topic,c=i.payload||A0,f=i.messageId,d=i.properties,h=0;if(typeof u=="string")h+=se.byteLength(u)+2;else if(se.isBuffer(u))h+=u.length+2;else return e.destroy(new Error("Invalid topic")),!1;if(se.isBuffer(c)?h+=c.length:h+=se.byteLength(c),s&&typeof f!="number")return e.destroy(new Error("Invalid messageId")),!1;s&&(h+=2);let m=null;if(n===5){if(m=Jt(e,d),!m)return!1;h+=m.length}return e.write(ue.PUBLISH_HEADER[s][i.dup?1:0][o?1:0]),et(e,h),We(e,Hh(u)),e.write(u),s>0&&We(e,f),m?.write(),Ze("publish: payload: %o",c),e.write(c)}function B0(t,e,r){let n=r?r.protocolVersion:4,i=t||{},s=i.cmd||"puback",o=i.messageId,u=i.dup&&s==="pubrel"?ue.DUP_MASK:0,c=0,f=i.reasonCode,d=i.properties,h=n===5?3:2;if(s==="pubrel"&&(c=1),typeof o!="number")return e.destroy(new Error("Invalid messageId")),!1;let m=null;if(n===5&&typeof d=="object"){if(m=An(e,d,r,h),!m)return!1;h+=m.length}return e.write(ue.ACKS[s][c][u][0]),h===3&&(h+=f!==0?1:-1),et(e,h),We(e,o),n===5&&h!==2&&e.write(se.from([f])),m!==null?m.write():h===4&&e.write(se.from([0])),!0}function N0(t,e,r){Ze("subscribe: packet: ");let n=r?r.protocolVersion:4,i=t||{},s=i.dup?ue.DUP_MASK:0,o=i.messageId,u=i.subscriptions,c=i.properties,f=0;if(typeof o!="number")return e.destroy(new Error("Invalid messageId")),!1;f+=2;let d=null;if(n===5){if(d=Jt(e,c),!d)return!1;f+=d.length}if(typeof u=="object"&&u.length)for(let m=0;m<u.length;m+=1){let g=u[m].topic,I=u[m].qos;if(typeof g!="string")return e.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if(typeof I!="number")return e.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(n===5){if(typeof(u[m].nl||!1)!="boolean")return e.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(u[m].rap||!1)!="boolean")return e.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;let _=u[m].rh||0;if(typeof _!="number"||_>2)return e.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}f+=se.byteLength(g)+2+1}else return e.destroy(new Error("Invalid subscriptions")),!1;Ze("subscribe: writing to stream: %o",ue.SUBSCRIBE_HEADER),e.write(ue.SUBSCRIBE_HEADER[1][s?1:0][0]),et(e,f),We(e,o),d!==null&&d.write();let h=!0;for(let m of u){let g=m.topic,I=m.qos,S=+m.nl,b=+m.rap,_=m.rh,w;wr(e,g),w=ue.SUBSCRIBE_OPTIONS_QOS[I],n===5&&(w|=S?ue.SUBSCRIBE_OPTIONS_NL:0,w|=b?ue.SUBSCRIBE_OPTIONS_RAP:0,w|=_?ue.SUBSCRIBE_OPTIONS_RH[_]:0),h=e.write(se.from([w]))}return h}function L0(t,e,r){let n=r?r.protocolVersion:4,i=t||{},s=i.messageId,o=i.granted,u=i.properties,c=0;if(typeof s!="number")return e.destroy(new Error("Invalid messageId")),!1;if(c+=2,typeof o=="object"&&o.length)for(let d=0;d<o.length;d+=1){if(typeof o[d]!="number")return e.destroy(new Error("Invalid qos vector")),!1;c+=1}else return e.destroy(new Error("Invalid qos vector")),!1;let f=null;if(n===5){if(f=An(e,u,r,c),!f)return!1;c+=f.length}return e.write(ue.SUBACK_HEADER),et(e,c),We(e,s),f!==null&&f.write(),e.write(se.from(o))}function q0(t,e,r){let n=r?r.protocolVersion:4,i=t||{},s=i.messageId,o=i.dup?ue.DUP_MASK:0,u=i.unsubscriptions,c=i.properties,f=0;if(typeof s!="number")return e.destroy(new Error("Invalid messageId")),!1;if(f+=2,typeof u=="object"&&u.length)for(let m=0;m<u.length;m+=1){if(typeof u[m]!="string")return e.destroy(new Error("Invalid unsubscriptions")),!1;f+=se.byteLength(u[m])+2}else return e.destroy(new Error("Invalid unsubscriptions")),!1;let d=null;if(n===5){if(d=Jt(e,c),!d)return!1;f+=d.length}e.write(ue.UNSUBSCRIBE_HEADER[1][o?1:0][0]),et(e,f),We(e,s),d!==null&&d.write();let h=!0;for(let m=0;m<u.length;m++)h=wr(e,u[m]);return h}function D0(t,e,r){let n=r?r.protocolVersion:4,i=t||{},s=i.messageId,o=i.dup?ue.DUP_MASK:0,u=i.granted,c=i.properties,f=i.cmd,d=0,h=2;if(typeof s!="number")return e.destroy(new Error("Invalid messageId")),!1;if(n===5)if(typeof u=="object"&&u.length)for(let g=0;g<u.length;g+=1){if(typeof u[g]!="number")return e.destroy(new Error("Invalid qos vector")),!1;h+=1}else return e.destroy(new Error("Invalid qos vector")),!1;let m=null;if(n===5){if(m=An(e,c,r,h),!m)return!1;h+=m.length}return e.write(ue.ACKS[f][d][o][0]),et(e,h),We(e,s),m!==null&&m.write(),n===5&&e.write(se.from(u)),!0}function U0(t,e,r){return e.write(ue.EMPTY[t.cmd])}function F0(t,e,r){let n=r?r.protocolVersion:4,i=t||{},s=i.reasonCode,o=i.properties,u=n===5?1:0,c=null;if(n===5){if(c=An(e,o,r,u),!c)return!1;u+=c.length}return e.write(se.from([ue.codes.disconnect<<4])),et(e,u),n===5&&e.write(se.from([s])),c!==null&&c.write(),!0}function j0(t,e,r){let n=r?r.protocolVersion:4,i=t||{},s=i.reasonCode,o=i.properties,u=n===5?1:0;n!==5&&e.destroy(new Error("Invalid mqtt version for auth packet"));let c=An(e,o,r,u);return c?(u+=c.length,e.write(se.from([ue.codes.auth<<4])),et(e,u),e.write(se.from([s])),c!==null&&c.write(),!0):!1}var Uh={};function et(t,e){if(e>ue.VARBYTEINT_MAX)return t.destroy(new Error(`Invalid variable byte integer: ${e}`)),!1;let r=Uh[e];return r||(r=Ks(e),e<16384&&(Uh[e]=r)),Ze("writeVarByteInt: writing to stream: %o",r),t.write(r)}function wr(t,e){let r=se.byteLength(e);return We(t,r),Ze("writeString: %s",e),t.write(e,"utf8")}function Fh(t,e,r){wr(t,e),wr(t,r)}function Ys(t,e){return Ze("writeNumberCached: number: %d",e),Ze("writeNumberCached: %o",Hi[e]),t.write(Hi[e])}function $0(t,e){let r=P0(e);return Ze("writeNumberGenerated: %o",r),t.write(r)}function W0(t,e){let r=O0(e);return Ze("write4ByteNumber: %o",r),t.write(r)}function zr(t,e){typeof e=="string"?wr(t,e):e?(We(t,e.length),t.write(e)):We(t,0)}function Jt(t,e){if(typeof e!="object"||e.length!=null)return{length:1,write(){$h(t,{},0)}};let r=0;function n(s,o){let u=ue.propertiesTypes[s],c=0;switch(u){case"byte":{if(typeof o!="boolean")return t.destroy(new Error(`Invalid ${s}: ${o}`)),!1;c+=2;break}case"int8":{if(typeof o!="number"||o<0||o>255)return t.destroy(new Error(`Invalid ${s}: ${o}`)),!1;c+=2;break}case"binary":{if(o&&o===null)return t.destroy(new Error(`Invalid ${s}: ${o}`)),!1;c+=1+se.byteLength(o)+2;break}case"int16":{if(typeof o!="number"||o<0||o>65535)return t.destroy(new Error(`Invalid ${s}: ${o}`)),!1;c+=3;break}case"int32":{if(typeof o!="number"||o<0||o>4294967295)return t.destroy(new Error(`Invalid ${s}: ${o}`)),!1;c+=5;break}case"var":{if(typeof o!="number"||o<0||o>268435455)return t.destroy(new Error(`Invalid ${s}: ${o}`)),!1;c+=1+se.byteLength(Ks(o));break}case"string":{if(typeof o!="string")return t.destroy(new Error(`Invalid ${s}: ${o}`)),!1;c+=3+se.byteLength(o.toString());break}case"pair":{if(typeof o!="object")return t.destroy(new Error(`Invalid ${s}: ${o}`)),!1;c+=Object.getOwnPropertyNames(o).reduce((f,d)=>{let h=o[d];return Array.isArray(h)?f+=h.reduce((m,g)=>(m+=3+se.byteLength(d.toString())+2+se.byteLength(g.toString()),m),0):f+=3+se.byteLength(d.toString())+2+se.byteLength(o[d].toString()),f},0);break}default:return t.destroy(new Error(`Invalid property ${s}: ${o}`)),!1}return c}if(e)for(let s in e){let o=0,u=0,c=e[s];if(c!==void 0){if(Array.isArray(c))for(let f=0;f<c.length;f++){if(u=n(s,c[f]),!u)return!1;o+=u}else{if(u=n(s,c),!u)return!1;o=u}if(!o)return!1;r+=o}}return{length:se.byteLength(Ks(r))+r,write(){$h(t,e,r)}}}function An(t,e,r,n){let i=["reasonString","userProperties"],s=r&&r.properties&&r.properties.maximumPacketSize?r.properties.maximumPacketSize:0,o=Jt(t,e);if(s)for(;n+o.length>s;){let u=i.shift();if(u&&e[u])delete e[u],o=Jt(t,e);else return!1}return o}function jh(t,e,r){switch(ue.propertiesTypes[e]){case"byte":{t.write(se.from([ue.properties[e]])),t.write(se.from([+r]));break}case"int8":{t.write(se.from([ue.properties[e]])),t.write(se.from([r]));break}case"binary":{t.write(se.from([ue.properties[e]])),zr(t,r);break}case"int16":{t.write(se.from([ue.properties[e]])),We(t,r);break}case"int32":{t.write(se.from([ue.properties[e]])),W0(t,r);break}case"var":{t.write(se.from([ue.properties[e]])),et(t,r);break}case"string":{t.write(se.from([ue.properties[e]])),wr(t,r);break}case"pair":{Object.getOwnPropertyNames(r).forEach(i=>{let s=r[i];Array.isArray(s)?s.forEach(o=>{t.write(se.from([ue.properties[e]])),Fh(t,i.toString(),o.toString())}):(t.write(se.from([ue.properties[e]])),Fh(t,i.toString(),s.toString()))});break}default:return t.destroy(new Error(`Invalid property ${e} value: ${r}`)),!1}}function $h(t,e,r){et(t,r);for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&e[n]!=null){let i=e[n];if(Array.isArray(i))for(let s=0;s<i.length;s++)jh(t,n,i[s]);else jh(t,n,i)}}function Hh(t){return t?t instanceof se?t.length:se.byteLength(t):0}function Wh(t){return typeof t=="string"||t instanceof se}zh.exports=Vh});var Kh=H((Tk,Qh)=>{x();T();P();var V0=Js(),{EventEmitter:H0}=(Vt(),ge(Wt)),{Buffer:Gh}=(Re(),ge(Be));function z0(t,e){let r=new Xs;return V0(t,r,e),r.concat()}var Xs=class extends H0{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),n=this._array,i=0,s;for(s=0;s<n.length&&n[s]!==void 0;s++)typeof n[s]!="string"?r[s]=n[s].length:r[s]=Gh.byteLength(n[s]),e+=r[s];let o=Gh.allocUnsafe(e);for(s=0;s<n.length&&n[s]!==void 0;s++)typeof n[s]!="string"?(n[s].copy(o,i),i+=r[s]):(o.write(n[s],i),i+=r[s]);return o}destroy(e){e&&this.emit("error",e)}};Qh.exports=z0});var Yh=H(Gi=>{x();T();P();Gi.parser=Mh().parser;Gi.generate=Kh();Gi.writeToStream=Js()});var Xh=H(($k,Jh)=>{"use strict";x();T();P();Jh.exports=G0;function Gr(t){return t instanceof $?$.from(t):new t.constructor(t.buffer.slice(),t.byteOffset,t.length)}function G0(t){if(t=t||{},t.circles)return Q0(t);let e=new Map;if(e.set(Date,o=>new Date(o)),e.set(Map,(o,u)=>new Map(n(Array.from(o),u))),e.set(Set,(o,u)=>new Set(n(Array.from(o),u))),t.constructorHandlers)for(let o of t.constructorHandlers)e.set(o[0],o[1]);let r=null;return t.proto?s:i;function n(o,u){let c=Object.keys(o),f=new Array(c.length);for(let d=0;d<c.length;d++){let h=c[d],m=o[h];typeof m!="object"||m===null?f[h]=m:m.constructor!==Object&&(r=e.get(m.constructor))?f[h]=r(m,u):ArrayBuffer.isView(m)?f[h]=Gr(m):f[h]=u(m)}return f}function i(o){if(typeof o!="object"||o===null)return o;if(Array.isArray(o))return n(o,i);if(o.constructor!==Object&&(r=e.get(o.constructor)))return r(o,i);let u={};for(let c in o){if(Object.hasOwnProperty.call(o,c)===!1)continue;let f=o[c];typeof f!="object"||f===null?u[c]=f:f.constructor!==Object&&(r=e.get(f.constructor))?u[c]=r(f,i):ArrayBuffer.isView(f)?u[c]=Gr(f):u[c]=i(f)}return u}function s(o){if(typeof o!="object"||o===null)return o;if(Array.isArray(o))return n(o,s);if(o.constructor!==Object&&(r=e.get(o.constructor)))return r(o,s);let u={};for(let c in o){let f=o[c];typeof f!="object"||f===null?u[c]=f:f.constructor!==Object&&(r=e.get(f.constructor))?u[c]=r(f,s):ArrayBuffer.isView(f)?u[c]=Gr(f):u[c]=s(f)}return u}}function Q0(t){let e=[],r=[],n=new Map;if(n.set(Date,c=>new Date(c)),n.set(Map,(c,f)=>new Map(s(Array.from(c),f))),n.set(Set,(c,f)=>new Set(s(Array.from(c),f))),t.constructorHandlers)for(let c of t.constructorHandlers)n.set(c[0],c[1]);let i=null;return t.proto?u:o;function s(c,f){let d=Object.keys(c),h=new Array(d.length);for(let m=0;m<d.length;m++){let g=d[m],I=c[g];if(typeof I!="object"||I===null)h[g]=I;else if(I.constructor!==Object&&(i=n.get(I.constructor)))h[g]=i(I,f);else if(ArrayBuffer.isView(I))h[g]=Gr(I);else{let S=e.indexOf(I);S!==-1?h[g]=r[S]:h[g]=f(I)}}return h}function o(c){if(typeof c!="object"||c===null)return c;if(Array.isArray(c))return s(c,o);if(c.constructor!==Object&&(i=n.get(c.constructor)))return i(c,o);let f={};e.push(c),r.push(f);for(let d in c){if(Object.hasOwnProperty.call(c,d)===!1)continue;let h=c[d];if(typeof h!="object"||h===null)f[d]=h;else if(h.constructor!==Object&&(i=n.get(h.constructor)))f[d]=i(h,o);else if(ArrayBuffer.isView(h))f[d]=Gr(h);else{let m=e.indexOf(h);m!==-1?f[d]=r[m]:f[d]=o(h)}}return e.pop(),r.pop(),f}function u(c){if(typeof c!="object"||c===null)return c;if(Array.isArray(c))return s(c,u);if(c.constructor!==Object&&(i=n.get(c.constructor)))return i(c,u);let f={};e.push(c),r.push(f);for(let d in c){let h=c[d];if(typeof h!="object"||h===null)f[d]=h;else if(h.constructor!==Object&&(i=n.get(h.constructor)))f[d]=i(h,u);else if(ArrayBuffer.isView(h))f[d]=Gr(h);else{let m=e.indexOf(h);m!==-1?f[d]=r[m]:f[d]=u(h)}}return e.pop(),r.pop(),f}}});var ep=H((Kk,Zh)=>{"use strict";x();T();P();Zh.exports=Xh()()});var Zs=H(Qi=>{"use strict";x();T();P();Object.defineProperty(Qi,"__esModule",{value:!0});Qi.validateTopic=tp;Qi.validateTopics=K0;function tp(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}function K0(t){if(t.length===0)return"empty_topic_list";for(let e=0;e<t.length;e++)if(!tp(t[e]))return t[e];return null}});var ra=H(ta=>{"use strict";x();T();P();Object.defineProperty(ta,"__esModule",{value:!0});var Y0=Qt(),J0={objectMode:!0},X0={clean:!0},ea=class{options;_inflights;constructor(e){this.options=e||{},this.options={...X0,...e},this._inflights=new Map}put(e,r){return this._inflights.set(e.messageId,e),r&&r(),this}createStream(){let e=new Y0.Readable(J0),r=[],n=!1,i=0;return this._inflights.forEach((s,o)=>{r.push(s)}),e._read=()=>{!n&&i<r.length?e.push(r[i++]):e.push(null)},e.destroy=s=>{if(!n)return n=!0,setTimeout(()=>{e.emit("close")},0),e},e}del(e,r){let n=this._inflights.get(e.messageId);return n?(this._inflights.delete(e.messageId),r(null,n)):r&&r(new Error("missing packet")),this}get(e,r){let n=this._inflights.get(e.messageId);return n?r(null,n):r&&r(new Error("missing packet")),this}close(e){this.options.clean&&(this._inflights=null),e&&e()}};ta.default=ea});var rp=H((yC,Z0)=>{Z0.exports={version:"5.17.0"}});var Tt=H(ut=>{"use strict";x();T();P();Object.defineProperty(ut,"__esModule",{value:!0});ut.MQTTJS_VERSION=ut.nextTick=ut.ErrorWithSubackPacket=ut.ErrorWithReasonCode=void 0;ut.applyMixin=eS;var na=class t extends Error{code;constructor(e,r){super(e),this.code=r,Object.setPrototypeOf(this,t.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}};ut.ErrorWithReasonCode=na;var ia=class t extends Error{packet;constructor(e,r){super(e),this.packet=r,Object.setPrototypeOf(this,t.prototype),Object.getPrototypeOf(this).name="ErrorWithSubackPacket"}};ut.ErrorWithSubackPacket=ia;function eS(t,e,r=!1){let n=[e];for(;;){let i=n[0],s=Object.getPrototypeOf(i);if(s?.prototype)n.unshift(s);else break}for(let i of n)for(let s of Object.getOwnPropertyNames(i.prototype))(r||s!=="constructor")&&Object.defineProperty(t.prototype,s,Object.getOwnPropertyDescriptor(i.prototype,s)??Object.create(null))}ut.nextTick=typeof L?.nextTick=="function"?L.nextTick:t=>{setTimeout(t,0)};ut.MQTTJS_VERSION=rp().version});var ip=H(oa=>{"use strict";x();T();P();Object.defineProperty(oa,"__esModule",{value:!0});var tS=Tt(),np=[0,16,128,131,135,144,145,151,153],rS=148,nS=130,Ki=(t,e,r,n,i=rS)=>{n?.discardParsedPackets(),(!n||n.isCurrent())&&t._cleanUp(!0),r(),t.emit("error",new tS.ErrorWithReasonCode(e,i))},Yi=(t,e,r)=>{r(),t.emit("error",e)},iS=(t,e,r,n)=>{t.log("handlePublish: packet %o",e),r=typeof r<"u"?r:t.noop;let i=e.topic.toString(),s=e.payload,{qos:o}=e,{messageId:u}=e,{options:c}=t;if(t.options.protocolVersion===5){let f;if(e.properties&&(f=e.properties.topicAlias),typeof f<"u"){let d=t.topicAliasRecv;if(!d){t.log("handlePublish :: received unexpected topic alias. alias: %d",f),Ki(t,"Received a PUBLISH Topic Alias but no Topic Alias Maximum was advertised",r,n);return}if(i.length===0)if(f>0&&f<=65535){let h=d.getTopicByAlias(f);if(h)i=h,e.topic=i,t.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",i,f);else{t.log("handlePublish :: unregistered topic alias. alias: %d",f),Ki(t,"Received unregistered Topic Alias",r,n,nS);return}}else{t.log("handlePublish :: topic alias out of range. alias: %d",f),Ki(t,`Received Topic Alias ${f} is outside the valid range 1-65535`,r,n);return}else if(d.put(i,f))t.log("handlePublish :: registered topic: %s - alias: %d",i,f);else{t.log("handlePublish :: topic alias outside the advertised maximum. alias: %d - max: %d",f,d.max),Ki(t,`Received Topic Alias ${f} is outside the advertised Topic Alias Maximum range 1-${d.max}`,r,n);return}}}switch(t.log("handlePublish: qos %d",o),o){case 2:{c.customHandleAcks(i,s,e,(f,d)=>{if(typeof f=="number"&&(d=f,f=null),f)return Yi(t,f,r);if(np.indexOf(d)===-1)return Yi(t,new Error("Wrong reason code for pubrec"),r);if(d)t._sendPacket({cmd:"pubrec",messageId:u,reasonCode:d},r);else{if(!t._trackIncomingQoS2Publish(u,r,n))return;t.incomingStore.put(e,()=>{t._sendPacket({cmd:"pubrec",messageId:u},r)})}});break}case 1:{c.customHandleAcks(i,s,e,(f,d)=>{if(typeof f=="number"&&(d=f,f=null),f)return Yi(t,f,r);if(np.indexOf(d)===-1)return Yi(t,new Error("Wrong reason code for puback"),r);d||t.emit("message",i,s,e),t.handleMessage(e,h=>{if(h)return r&&r(h);t._sendPacket({cmd:"puback",messageId:u,reasonCode:d},r)})});break}case 0:t.emit("message",i,s,e),t.handleMessage(e,r);break;default:t.log("handlePublish: unknown QoS. Doing nothing.");break}};oa.default=iS});var op=H(sa=>{"use strict";x();T();P();Object.defineProperty(sa,"__esModule",{value:!0});var In=Tt(),xn=130,Qr=(t,e,r)=>{t.log("handleAuth :: %s",e.message),r?.discardParsedPackets(),(!r||r.isCurrent())&&t._cleanUp(!0),t.emit("error",e)},oS=(t,e,r)=>{let{options:n}=t,i=n.protocolVersion,s=i===5?e.reasonCode:e.returnCode;if(i!==5){Qr(t,new In.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${i}`,xn),r);return}let o=t._authenticationMethod;if(!o){Qr(t,new In.ErrorWithReasonCode("Protocol error: Auth packet received but enhanced authentication was not requested",xn),r);return}if(e.properties?.authenticationMethod!==o){Qr(t,new In.ErrorWithReasonCode(`Protocol error: Auth packet Authentication Method does not match the "${o}" sent in CONNECT`,xn),r);return}t.handleAuth(e,(u,c)=>{if(u){Qr(t,u,r);return}if(s===0){t.log("handleAuth :: authentication exchange completed successfully");return}if(s===24){if(!c){Qr(t,new In.ErrorWithReasonCode("Protocol error: No auth packet to continue the authentication exchange",xn),r);return}t.reconnecting=!1,t._sendPacket(c);return}Qr(t,new In.ErrorWithReasonCode(`Protocol error: Auth packet reason code ${s} is not one a broker may send`,xn),r)})};sa.default=oS});var Pn=H(Ot=>{"use strict";x();T();P();Object.defineProperty(Ot,"__esModule",{value:!0});Ot.ReasonCodes=void 0;var aa=Tt();Ot.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 sS={publish:["puback","pubrec","pubcomp"],pubrel:["pubcomp"],subscribe:["suback"],unsubscribe:["unsuback"]},aS=(t,e)=>{let{messageId:r}=e,n=e.cmd,i=null,s=t.outgoing[r],o=s?s.cb:null,u=null;if(!o){t.log("_handleAck :: Server sent an ack in error. Ignoring.");return}if(!sS[s.cmd]?.includes(n)){t.log("_handleAck :: %s does not answer the pending %s on message id %d. Ignoring.",n,s.cmd,r),t.emit("error",new Error(`Protocol error: ${n} does not answer the ${s.cmd} pending on message id ${r}`));return}switch(t.log("_handleAck :: packet type",n),n){case"pubcomp":case"puback":{let c=e.reasonCode;c&&c>0&&c!==16?(u=new aa.ErrorWithReasonCode(`Publish error: ${Ot.ReasonCodes[c]}`,c),t._removeOutgoingAndStoreMessage(r,()=>{o(u,e)})):t._removeOutgoingAndStoreMessage(r,o);break}case"pubrec":{i={cmd:"pubrel",qos:2,messageId:r};let c=e.reasonCode;c&&c>0&&c!==16?(u=new aa.ErrorWithReasonCode(`Publish error: ${Ot.ReasonCodes[c]}`,c),t._removeOutgoingAndStoreMessage(r,()=>{o(u,e)})):t._sendPacket(i);break}case"suback":{delete t.outgoing[r],t.messageIdProvider.deallocate(r);let c=e.granted,f=t.messageIdToTopic[r];for(let d=0;d<c.length;d++){let h=c[d];if((h&128)!==0){u=new Error(`Subscribe error: ${Ot.ReasonCodes[h]}`),u.code=h;let m=f?.[d];m!==void 0&&delete t._resubscribeTopics[m]}}delete t.messageIdToTopic[r],t._invokeStoreProcessingQueue(),o(u,e);break}case"unsuback":{delete t.outgoing[r],t.messageIdProvider.deallocate(r),t._invokeStoreProcessingQueue();let c=(e.granted??[]).find(f=>(f&128)!==0);c!==void 0&&(u=new aa.ErrorWithReasonCode(`Unsubscribe error: ${Ot.ReasonCodes[c]}`,c)),o(u,e);break}default:t.emit("error",new Error("unrecognized packet type"))}t.disconnecting&&Object.keys(t.outgoing).length===0&&t.emit("outgoingEmpty")};Ot.default=aS});var cp=H(Xi=>{"use strict";x();T();P();Object.defineProperty(Xi,"__esModule",{value:!0});Xi.LRUCache=void 0;var Kr=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,ap=new Set,ua=typeof L=="object"&&L?L:{},up=(t,e,r,n)=>{typeof ua.emitWarning=="function"?ua.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},Ji=globalThis.AbortController,sp=globalThis.AbortSignal;if(typeof Ji>"u"){sp=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,i){this._onabort.push(i)}},Ji=class{constructor(){e()}signal=new sp;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let i of this.signal._onabort)i(n);this.signal.onabort?.(n)}}};let t=ua.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,up("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 uS=t=>!ap.has(t),GC=Symbol("type"),Xt=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),lp=t=>Xt(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Yr:null:null,Yr=class extends Array{constructor(e){super(e),this.fill(0)}},la=class t{heap;length;static#u=!1;static create(e){let r=lp(e);if(!r)return[];t.#u=!0;let n=new t(e,r);return t.#u=!1,n}constructor(e,r){if(!t.#u)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]}},ca=class t{#u;#f;#g;#y;#R;#k;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#i;#b;#n;#r;#e;#l;#d;#a;#o;#m;#s;#_;#w;#h;#v;#x;#c;static unsafeExposeInternals(e){return{starts:e.#w,ttls:e.#h,sizes:e.#_,keyMap:e.#n,keyList:e.#r,valList:e.#e,next:e.#l,prev:e.#d,get head(){return e.#a},get tail(){return e.#o},free:e.#m,isBackgroundFetch:r=>e.#t(r),backgroundFetch:(r,n,i,s)=>e.#B(r,n,i,s),moveToTail:r=>e.#O(r),indexes:r=>e.#S(r),rindexes:r=>e.#E(r),isStale:r=>e.#p(r)}}get max(){return this.#u}get maxSize(){return this.#f}get calculatedSize(){return this.#b}get size(){return this.#i}get fetchMethod(){return this.#R}get memoMethod(){return this.#k}get dispose(){return this.#g}get disposeAfter(){return this.#y}constructor(e){let{max:r=0,ttl:n,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:u,allowStale:c,dispose:f,disposeAfter:d,noDisposeOnSet:h,noUpdateTTL:m,maxSize:g=0,maxEntrySize:I=0,sizeCalculation:S,fetchMethod:b,memoMethod:_,noDeleteOnFetchRejection:w,noDeleteOnStaleGet:R,allowStaleOnFetchRejection:A,allowStaleOnFetchAbort:y,ignoreFetchAbort:O}=e;if(r!==0&&!Xt(r))throw new TypeError("max option must be a nonnegative integer");let v=r?lp(r):Array;if(!v)throw new Error("invalid max value: "+r);if(this.#u=r,this.#f=g,this.maxEntrySize=I||this.#f,this.sizeCalculation=S,this.sizeCalculation){if(!this.#f&&!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(_!==void 0&&typeof _!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#k=_,b!==void 0&&typeof b!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#R=b,this.#x=!!b,this.#n=new Map,this.#r=new Array(r).fill(void 0),this.#e=new Array(r).fill(void 0),this.#l=new v(r),this.#d=new v(r),this.#a=0,this.#o=0,this.#m=la.create(r),this.#i=0,this.#b=0,typeof f=="function"&&(this.#g=f),typeof d=="function"?(this.#y=d,this.#s=[]):(this.#y=void 0,this.#s=void 0),this.#v=!!this.#g,this.#c=!!this.#y,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!w,this.allowStaleOnFetchRejection=!!A,this.allowStaleOnFetchAbort=!!y,this.ignoreFetchAbort=!!O,this.maxEntrySize!==0){if(this.#f!==0&&!Xt(this.#f))throw new TypeError("maxSize must be a positive integer if specified");if(!Xt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#j()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!R,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!u,this.ttlResolution=Xt(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!Xt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#N()}if(this.#u===0&&this.ttl===0&&this.#f===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#u&&!this.#f){let B="LRU_CACHE_UNBOUNDED";uS(B)&&(ap.add(B),up("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",B,t))}}getRemainingTTL(e){return this.#n.has(e)?1/0:0}#N(){let e=new Yr(this.#u),r=new Yr(this.#u);this.#h=e,this.#w=r,this.#L=(s,o,u=Kr.now())=>{if(r[s]=o!==0?u:0,e[s]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#p(s)&&this.#A(this.#r[s],"expire")},o+1);c.unref&&c.unref()}},this.#P=s=>{r[s]=e[s]!==0?Kr.now():0},this.#I=(s,o)=>{if(e[o]){let u=e[o],c=r[o];if(!u||!c)return;s.ttl=u,s.start=c,s.now=n||i();let f=s.now-c;s.remainingTTL=u-f}};let n=0,i=()=>{let s=Kr.now();if(this.ttlResolution>0){n=s;let o=setTimeout(()=>n=0,this.ttlResolution);o.unref&&o.unref()}return s};this.getRemainingTTL=s=>{let o=this.#n.get(s);if(o===void 0)return 0;let u=e[o],c=r[o];if(!u||!c)return 1/0;let f=(n||i())-c;return u-f},this.#p=s=>{let o=r[s],u=e[s];return!!u&&!!o&&(n||i())-o>u}}#P=()=>{};#I=()=>{};#L=()=>{};#p=()=>!1;#j(){let e=new Yr(this.#u);this.#b=0,this.#_=e,this.#T=r=>{this.#b-=e[r],e[r]=0},this.#q=(r,n,i,s)=>{if(this.#t(n))return 0;if(!Xt(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(n,r),!Xt(i))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 i},this.#C=(r,n,i)=>{if(e[r]=n,this.#f){let s=this.#f-e[r];for(;this.#b>s;)this.#M(!0)}this.#b+=e[r],i&&(i.entrySize=n,i.totalCalculatedSize=this.#b)}}#T=e=>{};#C=(e,r,n)=>{};#q=(e,r,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#S({allowStale:e=this.allowStale}={}){if(this.#i)for(let r=this.#o;!(!this.#D(r)||((e||!this.#p(r))&&(yield r),r===this.#a));)r=this.#d[r]}*#E({allowStale:e=this.allowStale}={}){if(this.#i)for(let r=this.#a;!(!this.#D(r)||((e||!this.#p(r))&&(yield r),r===this.#o));)r=this.#l[r]}#D(e){return e!==void 0&&this.#n.get(this.#r[e])===e}*entries(){for(let e of this.#S())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.#E())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.#S()){let r=this.#r[e];r!==void 0&&!this.#t(this.#e[e])&&(yield r)}}*rkeys(){for(let e of this.#E()){let r=this.#r[e];r!==void 0&&!this.#t(this.#e[e])&&(yield r)}}*values(){for(let e of this.#S())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e])}*rvalues(){for(let e of this.#E())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let n of this.#S()){let i=this.#e[n],s=this.#t(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#r[n],this))return this.get(this.#r[n],r)}}forEach(e,r=this){for(let n of this.#S()){let i=this.#e[n],s=this.#t(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(r,s,this.#r[n],this)}}rforEach(e,r=this){for(let n of this.#E()){let i=this.#e[n],s=this.#t(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(r,s,this.#r[n],this)}}purgeStale(){let e=!1;for(let r of this.#E({allowStale:!0}))this.#p(r)&&(this.#A(this.#r[r],"expire"),e=!0);return e}info(e){let r=this.#n.get(e);if(r===void 0)return;let n=this.#e[r],i=this.#t(n)?n.__staleWhileFetching:n;if(i===void 0)return;let s={value:i};if(this.#h&&this.#w){let o=this.#h[r],u=this.#w[r];if(o&&u){let c=o-(Kr.now()-u);s.ttl=c,s.start=Date.now()}}return this.#_&&(s.size=this.#_[r]),s}dump(){let e=[];for(let r of this.#S({allowStale:!0})){let n=this.#r[r],i=this.#e[r],s=this.#t(i)?i.__staleWhileFetching:i;if(s===void 0||n===void 0)continue;let o={value:s};if(this.#h&&this.#w){o.ttl=this.#h[r];let u=Kr.now()-this.#w[r];o.start=Math.floor(Date.now()-u)}this.#_&&(o.size=this.#_[r]),e.unshift([n,o])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let i=Date.now()-n.start;n.start=Kr.now()-i}this.set(r,n.value,n)}}set(e,r,n={}){if(r===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:c}=n,{noUpdateTTL:f=this.noUpdateTTL}=n,d=this.#q(e,r,n.size||0,u);if(this.maxEntrySize&&d>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#A(e,"set"),this;let h=this.#i===0?void 0:this.#n.get(e);if(h===void 0)h=this.#i===0?this.#o:this.#m.length!==0?this.#m.pop():this.#i===this.#u?this.#M(!1):this.#i,this.#r[h]=e,this.#e[h]=r,this.#n.set(e,h),this.#l[this.#o]=h,this.#d[h]=this.#o,this.#o=h,this.#i++,this.#C(h,d,c),c&&(c.set="add"),f=!1;else{this.#O(h);let m=this.#e[h];if(r!==m){if(this.#x&&this.#t(m)){m.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=m;g!==void 0&&!o&&(this.#v&&this.#g?.(g,e,"set"),this.#c&&this.#s?.push([g,e,"set"]))}else o||(this.#v&&this.#g?.(m,e,"set"),this.#c&&this.#s?.push([m,e,"set"]));if(this.#T(h),this.#C(h,d,c),this.#e[h]=r,c){c.set="replace";let g=m&&this.#t(m)?m.__staleWhileFetching:m;g!==void 0&&(c.oldValue=g)}}else c&&(c.set="update")}if(i!==0&&!this.#h&&this.#N(),this.#h&&(f||this.#L(h,i,s),c&&this.#I(c,h)),!o&&this.#c&&this.#s){let m=this.#s,g;for(;g=m?.shift();)this.#y?.(...g)}return this}pop(){try{for(;this.#i;){let e=this.#e[this.#a];if(this.#M(!0),this.#t(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#c&&this.#s){let e=this.#s,r;for(;r=e?.shift();)this.#y?.(...r)}}}#M(e){let r=this.#a,n=this.#r[r],i=this.#e[r];return this.#x&&this.#t(i)?i.__abortController.abort(new Error("evicted")):(this.#v||this.#c)&&(this.#v&&this.#g?.(i,n,"evict"),this.#c&&this.#s?.push([i,n,"evict"])),this.#T(r),e&&(this.#r[r]=void 0,this.#e[r]=void 0,this.#m.push(r)),this.#i===1?(this.#a=this.#o=0,this.#m.length=0):this.#a=this.#l[r],this.#n.delete(n),this.#i--,r}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=r,s=this.#n.get(e);if(s!==void 0){let o=this.#e[s];if(this.#t(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#p(s))i&&(i.has="stale",this.#I(i,s));else return n&&this.#P(s),i&&(i.has="hit",this.#I(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,i=this.#n.get(e);if(i===void 0||!n&&this.#p(i))return;let s=this.#e[i];return this.#t(s)?s.__staleWhileFetching:s}#B(e,r,n,i){let s=r===void 0?void 0:this.#e[r];if(this.#t(s))return s;let o=new Ji,{signal:u}=n;u?.addEventListener("abort",()=>o.abort(u.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:i},f=(S,b=!1)=>{let{aborted:_}=o.signal,w=n.ignoreFetchAbort&&S!==void 0;if(n.status&&(_&&!b?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,w&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),_&&!w&&!b)return h(o.signal.reason);let R=g;return this.#e[r]===g&&(S===void 0?R.__staleWhileFetching?this.#e[r]=R.__staleWhileFetching:this.#A(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,S,c.options))),S},d=S=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=S),h(S)),h=S=>{let{aborted:b}=o.signal,_=b&&n.allowStaleOnFetchAbort,w=_||n.allowStaleOnFetchRejection,R=w||n.noDeleteOnFetchRejection,A=g;if(this.#e[r]===g&&(!R||A.__staleWhileFetching===void 0?this.#A(e,"fetch"):_||(this.#e[r]=A.__staleWhileFetching)),w)return n.status&&A.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),A.__staleWhileFetching;if(A.__returned===A)throw S},m=(S,b)=>{let _=this.#R?.(e,s,c);_&&_ instanceof Promise&&_.then(w=>S(w===void 0?void 0:w),b),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(S(void 0),n.allowStaleOnFetchAbort&&(S=w=>f(w,!0)))})};n.status&&(n.status.fetchDispatched=!0);let g=new Promise(m).then(f,d),I=Object.assign(g,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.set(e,I,{...c.options,status:void 0}),r=this.#n.get(e)):this.#e[r]=I,I}#t(e){if(!this.#x)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof Ji}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:u=this.noDisposeOnSet,size:c=0,sizeCalculation:f=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:I=this.allowStaleOnFetchAbort,context:S,forceRefresh:b=!1,status:_,signal:w}=r;if(!this.#x)return _&&(_.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:_});let R={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:u,size:c,sizeCalculation:f,noUpdateTTL:d,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:I,ignoreFetchAbort:g,status:_,signal:w},A=this.#n.get(e);if(A===void 0){_&&(_.fetch="miss");let y=this.#B(e,A,R,S);return y.__returned=y}else{let y=this.#e[A];if(this.#t(y)){let q=n&&y.__staleWhileFetching!==void 0;return _&&(_.fetch="inflight",q&&(_.returnedStale=!0)),q?y.__staleWhileFetching:y.__returned=y}let O=this.#p(A);if(!b&&!O)return _&&(_.fetch="hit"),this.#O(A),i&&this.#P(A),_&&this.#I(_,A),y;let v=this.#B(e,A,R,S),D=v.__staleWhileFetching!==void 0&&n;return _&&(_.fetch=O?"stale":"refresh",D&&O&&(_.returnedStale=!0)),D?v.__staleWhileFetching:v.__returned=v}}async forceFetch(e,r={}){let n=await this.fetch(e,r);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,r={}){let n=this.#k;if(!n)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:s,...o}=r,u=this.get(e,o);if(!s&&u!==void 0)return u;let c=n(e,u,{options:o,context:i});return this.set(e,c,o),c}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=r,u=this.#n.get(e);if(u!==void 0){let c=this.#e[u],f=this.#t(c);return o&&this.#I(o,u),this.#p(u)?(o&&(o.get="stale"),f?(o&&n&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?c.__staleWhileFetching:void 0):(s||this.#A(e,"expire"),o&&n&&(o.returnedStale=!0),n?c:void 0)):(o&&(o.get="hit"),f?c.__staleWhileFetching:(this.#O(u),i&&this.#P(u),c))}else o&&(o.get="miss")}#U(e,r){this.#d[r]=e,this.#l[e]=r}#O(e){e!==this.#o&&(e===this.#a?this.#a=this.#l[e]:this.#U(this.#d[e],this.#l[e]),this.#U(this.#o,e),this.#o=e)}delete(e){return this.#A(e,"delete")}#A(e,r){let n=!1;if(this.#i!==0){let i=this.#n.get(e);if(i!==void 0)if(n=!0,this.#i===1)this.#F(r);else{this.#T(i);let s=this.#e[i];if(this.#t(s)?s.__abortController.abort(new Error("deleted")):(this.#v||this.#c)&&(this.#v&&this.#g?.(s,e,r),this.#c&&this.#s?.push([s,e,r])),this.#n.delete(e),this.#r[i]=void 0,this.#e[i]=void 0,i===this.#o)this.#o=this.#d[i];else if(i===this.#a)this.#a=this.#l[i];else{let o=this.#d[i];this.#l[o]=this.#l[i];let u=this.#l[i];this.#d[u]=this.#d[i]}this.#i--,this.#m.push(i)}}if(this.#c&&this.#s?.length){let i=this.#s,s;for(;s=i?.shift();)this.#y?.(...s)}return n}clear(){return this.#F("delete")}#F(e){for(let r of this.#E({allowStale:!0})){let n=this.#e[r];if(this.#t(n))n.__abortController.abort(new Error("deleted"));else{let i=this.#r[r];this.#v&&this.#g?.(n,i,e),this.#c&&this.#s?.push([n,i,e])}}if(this.#n.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#h&&this.#w&&(this.#h.fill(0),this.#w.fill(0)),this.#_&&this.#_.fill(0),this.#a=0,this.#o=0,this.#m.length=0,this.#b=0,this.#i=0,this.#c&&this.#s){let r=this.#s,n;for(;n=r?.shift();)this.#y?.(...n)}}};Xi.LRUCache=ca});var da=H(Zi=>{"use strict";x();T();P();Object.defineProperty(Zi,"__esModule",{value:!0});Zi.NumberAllocator=void 0;var fa=class{used;min;max;lowWaterMark;constructor(e,r){this.min=e,this.max=r,this.used=new Set,this.lowWaterMark=e}firstVacant(){if(this.used.size===this.max-this.min+1)return null;for(let e=this.lowWaterMark;e<=this.max;e++)if(!this.used.has(e))return e;return null}alloc(){if(this.used.size===this.max-this.min+1)return null;for(let e=this.lowWaterMark;e<=this.max;e++)if(!this.used.has(e))return this.used.add(e),this.lowWaterMark=e+1,e;return null}use(e){return e<this.min||e>this.max||this.used.has(e)?!1:(this.used.add(e),!0)}free(e){e<this.min||e>this.max||(this.used.delete(e),e<this.lowWaterMark&&(this.lowWaterMark=e))}clear(){this.used.clear(),this.lowWaterMark=this.min}};Zi.NumberAllocator=fa});var fp=H(pa=>{"use strict";x();T();P();Object.defineProperty(pa,"__esModule",{value:!0});var lS=cp(),cS=da(),ha=class{aliasToTopic;topicToAlias;max;numberAllocator;length;constructor(e){e>0&&(this.aliasToTopic=new lS.LRUCache({max:e}),this.topicToAlias={},this.numberAllocator=new cS.NumberAllocator(1,e),this.max=e,this.length=0)}put(e,r){if(r===0||r>this.max)return!1;let n=this.aliasToTopic.get(r);return n&&delete this.topicToAlias[n],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]}};pa.default=ha});var hp=H(Tn=>{"use strict";x();T();P();var fS=Tn&&Tn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Tn,"__esModule",{value:!0});var dS=Pn(),hS=fS(fp()),dp=Tt(),pS=(t,e,r)=>{t.log("_handleConnack");let{options:n}=t,s=n.protocolVersion===5?e.reasonCode:e.returnCode;if(t.connackReceived){let o=new dp.ErrorWithReasonCode("Protocol error: duplicate CONNACK on the same network connection",130);r?.discardParsedPackets(),t._cleanUp(!0),t.emit("error",o);return}if(t.connackReceived=!0,clearTimeout(t.connackTimer),delete t.topicAliasSend,t._serverProperties=e.properties,e.properties&&e.properties.topicAliasMaximum){if(e.properties.topicAliasMaximum>65535){r?.discardParsedPackets(),t._cleanUp(!0),t.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}e.properties.topicAliasMaximum>0&&(t.topicAliasSend=new hS.default(e.properties.topicAliasMaximum))}if(s===0)t.reconnecting=!1,t._onConnect(e);else if(s>0){t.log("_handleConnack :: connection refused with reason code %d",s);let o=new dp.ErrorWithReasonCode(`Connection refused: ${dS.ReasonCodes[s]}`,s);r?.discardParsedPackets(),t.reconnectSuppressed=!0,t._cleanUp(!0);try{t.emit("error",o)}finally{n.reconnectOnConnackError&&(t.reconnectSuppressed=!1,t._setupReconnect())}}};Tn.default=pS});var pp=H(ga=>{"use strict";x();T();P();Object.defineProperty(ga,"__esModule",{value:!0});var gS=(t,e,r)=>{t.log("handling pubrel packet");let n=typeof r<"u"?r:t.noop,{messageId:i}=e,s={cmd:"pubcomp",messageId:i};t.incomingStore.get(e,(o,u)=>{o?t._sendPacket(s,n):(t.emit("message",u.topic,u.payload,u),t.handleMessage(u,c=>{if(c)return n(c);t.incomingStore.del(u,t.noop),t._releaseIncomingQoS2Publish(i),t._sendPacket(s,n)}))})};ga.default=gS});var gp=H(On=>{"use strict";x();T();P();var Rn=On&&On.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(On,"__esModule",{value:!0});var yS=Rn(ip()),bS=Rn(op()),mS=Rn(hp()),_S=Rn(Pn()),wS=Rn(pp()),vS=Tt(),SS=t=>t<128?1:t<16384?2:t<2097152?3:4,ES=t=>1+SS(t)+t,AS=(t,e,r,n)=>{let{options:i}=t,s=i.properties?.maximumPacketSize,o=ES(e.length);if(i.protocolVersion===5&&s&&s<o)return t.log("_handlePacket :: %s packet of %d bytes exceeds the advertised maximumPacketSize %d",e.cmd,o,s),n?.discardParsedPackets(),t._cleanUp(!0),r(),t.emit("error",new vS.ErrorWithReasonCode(`exceeding packets size ${e.cmd}: ${o} bytes, maximumPacketSize is ${s}`,149)),t;switch(t.log("_handlePacket :: emitting packetreceive"),t.emit("packetreceive",e),e.cmd){case"publish":(0,yS.default)(t,e,r,n);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":t.reschedulePing();try{(0,_S.default)(t,e)}finally{r()}break;case"pubrel":t.reschedulePing(),(0,wS.default)(t,e,r);break;case"connack":try{(0,mS.default)(t,e,n)}finally{r()}break;case"auth":t.reschedulePing();try{(0,bS.default)(t,e,n)}finally{r()}break;case"pingresp":t.log("_handlePacket :: received pingresp"),t.reschedulePing(!0),r();break;case"disconnect":t.emit("disconnect",e),r();break;default:t.log("_handlePacket :: unknown command"),r();break}};On.default=AS});var ma=H(ba=>{"use strict";x();T();P();Object.defineProperty(ba,"__esModule",{value:!0});var ya=class{nextId;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(){}};ba.default=ya});var yp=H(wa=>{"use strict";x();T();P();Object.defineProperty(wa,"__esModule",{value:!0});var _a=class{aliasToTopic;max;length;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={}}};wa.default=_a});var bp=H(Jr=>{"use strict";x();T();P();var IS=Jr&&Jr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Jr,"__esModule",{value:!0});Jr.TypedEventEmitter=void 0;var xS=IS((Vt(),ge(Wt))),PS=Tt(),eo=class{};Jr.TypedEventEmitter=eo;(0,PS.applyMixin)(eo,xS.default)});var va=H((to,mp)=>{x();T();P();(function(t,e){typeof to=="object"&&typeof mp<"u"?e(to):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.fastUniqueNumbers={}))})(to,(function(t){"use strict";var e=function(m){return function(g){var I=m(g);return g.add(I),I}},r=function(m){return function(g,I){return m.set(g,I),I}},n=Number.MAX_SAFE_INTEGER===void 0?9007199254740991:Number.MAX_SAFE_INTEGER,i=536870912,s=i*2,o=function(m,g){return function(I){var S=g.get(I),b=S===void 0?I.size:S<s?S+1:0;if(!I.has(b))return m(I,b);if(I.size<i){for(;I.has(b);)b=Math.floor(Math.random()*s);return m(I,b)}if(I.size>n)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;I.has(b);)b=Math.floor(Math.random()*n);return m(I,b)}},u=new WeakMap,c=r(u),f=o(c,u),d=e(f);t.addUniqueNumber=d,t.generateUniqueNumber=f}))});var kn=H((l2,Rt)=>{x();T();P();function Sa(t){"@babel/helpers - typeof";return Rt.exports=Sa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rt.exports.__esModule=!0,Rt.exports.default=Rt.exports,Sa(t)}Rt.exports=Sa,Rt.exports.__esModule=!0,Rt.exports.default=Rt.exports});var wp=H((y2,Cn)=>{x();T();P();var _p=kn().default;function TS(t,e){if(_p(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(_p(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}Cn.exports=TS,Cn.exports.__esModule=!0,Cn.exports.default=Cn.exports});var vp=H((E2,Mn)=>{x();T();P();var OS=kn().default,RS=wp();function kS(t){var e=RS(t,"string");return OS(e)=="symbol"?e:e+""}Mn.exports=kS,Mn.exports.__esModule=!0,Mn.exports.default=Mn.exports});var Sp=H((R2,Bn)=>{x();T();P();var CS=vp();function MS(t,e,r){return(e=CS(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}Bn.exports=MS,Bn.exports.__esModule=!0,Bn.exports.default=Bn.exports});var Ep=H((q2,Nn)=>{x();T();P();function BS(t){if(Array.isArray(t))return t}Nn.exports=BS,Nn.exports.__esModule=!0,Nn.exports.default=Nn.exports});var Ap=H((V2,Ln)=>{x();T();P();function NS(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,o,u=[],c=!0,f=!1;try{if(s=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=s.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw i}}return u}}Ln.exports=NS,Ln.exports.__esModule=!0,Ln.exports.default=Ln.exports});var Ip=H((J2,qn)=>{x();T();P();function LS(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}qn.exports=LS,qn.exports.__esModule=!0,qn.exports.default=qn.exports});var Pp=H((iB,Dn)=>{x();T();P();var xp=Ip();function qS(t,e){if(t){if(typeof t=="string")return xp(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?xp(t,e):void 0}}Dn.exports=qS,Dn.exports.__esModule=!0,Dn.exports.default=Dn.exports});var Tp=H((fB,Un)=>{x();T();P();function DS(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}Un.exports=DS,Un.exports.__esModule=!0,Un.exports.default=Un.exports});var Op=H((mB,Fn)=>{x();T();P();var US=Ep(),FS=Ap(),jS=Pp(),$S=Tp();function WS(t,e){return US(t)||FS(t,e)||jS(t,e)||$S()}Fn.exports=WS,Fn.exports.__esModule=!0,Fn.exports.default=Fn.exports});var kp=H((IB,jn)=>{x();T();P();function Rp(t,e,r,n,i,s,o){try{var u=t[s](o),c=u.value}catch(f){return void r(f)}u.done?e(c):Promise.resolve(c).then(n,i)}function VS(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function o(c){Rp(s,n,i,o,u,"next",c)}function u(c){Rp(s,n,i,o,u,"throw",c)}o(void 0)})}}jn.exports=VS,jn.exports.__esModule=!0,jn.exports.default=jn.exports});var Ea=H((CB,$n)=>{x();T();P();function HS(t,e){this.v=t,this.k=e}$n.exports=HS,$n.exports.__esModule=!0,$n.exports.default=$n.exports});var Aa=H((UB,kt)=>{x();T();P();function ro(t,e,r,n){var i=Object.defineProperty;try{i({},"",{})}catch{i=0}kt.exports=ro=function(o,u,c,f){function d(h,m){ro(o,h,function(g){return this._invoke(h,m,g)})}u?i?i(o,u,{value:c,enumerable:!f,configurable:!f,writable:!f}):o[u]=c:(d("next",0),d("throw",1),d("return",2))},kt.exports.__esModule=!0,kt.exports.default=kt.exports,ro(t,e,r,n)}kt.exports=ro,kt.exports.__esModule=!0,kt.exports.default=kt.exports});var Ia=H((zB,Ct)=>{x();T();P();var bt=Aa();function Cp(){var t,e,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function s(g,I,S,b){var _=I&&I.prototype instanceof u?I:u,w=Object.create(_.prototype);return bt(w,"_invoke",(function(R,A,y){var O,v,B,D=0,q=y||[],K=!1,U={p:0,n:0,v:t,a:W,f:W.bind(t,4),d:function(J,ee){return O=J,v=0,B=t,U.n=ee,o}};function W(G,J){for(v=G,B=J,e=0;!K&&D&&!ee&&e<q.length;e++){var ee,z=q[e],V=U.p,te=z[2];G>3?(ee=te===J)&&(B=z[(v=z[4])?5:(v=3,3)],z[4]=z[5]=t):z[0]<=V&&((ee=G<2&&V<z[1])?(v=0,U.v=J,U.n=z[1]):V<te&&(ee=G<3||z[0]>J||J>te)&&(z[4]=G,z[5]=J,U.n=te,v=0))}if(ee||G>1)return o;throw K=!0,J}return function(G,J,ee){if(D>1)throw TypeError("Generator is already running");for(K&&J===1&&W(J,ee),v=J,B=ee;(e=v<2?t:B)||!K;){O||(v?v<3?(v>1&&(U.n=-1),W(v,B)):U.n=B:U.v=B);try{if(D=2,O){if(v||(G="next"),e=O[G]){if(!(e=e.call(O,B)))throw TypeError("iterator result is not an object");if(!e.done)return e;B=e.value,v<2&&(v=0)}else v===1&&(e=O.return)&&e.call(O),v<2&&(B=TypeError("The iterator does not provide a '"+G+"' method"),v=1);O=t}else if((e=(K=U.n<0)?B:R.call(A,U))!==o)break}catch(z){O=t,v=1,B=z}finally{D=1}}return{value:e,done:K}}})(g,S,b),!0),w}var o={};function u(){}function c(){}function f(){}e=Object.getPrototypeOf;var d=[][n]?e(e([][n]())):(bt(e={},n,function(){return this}),e),h=f.prototype=u.prototype=Object.create(d);function m(g){return Object.setPrototypeOf?Object.setPrototypeOf(g,f):(g.__proto__=f,bt(g,i,"GeneratorFunction")),g.prototype=Object.create(h),g}return c.prototype=f,bt(h,"constructor",f),bt(f,"constructor",c),c.displayName="GeneratorFunction",bt(f,i,"GeneratorFunction"),bt(h),bt(h,i,"Generator"),bt(h,n,function(){return this}),bt(h,"toString",function(){return"[object Generator]"}),(Ct.exports=Cp=function(){return{w:s,m}},Ct.exports.__esModule=!0,Ct.exports.default=Ct.exports)()}Ct.exports=Cp,Ct.exports.__esModule=!0,Ct.exports.default=Ct.exports});var Ta=H((ZB,Wn)=>{x();T();P();var zS=Ea(),xa=Aa();function Pa(t,e){function r(i,s,o,u){try{var c=t[i](s),f=c.value;return f instanceof zS?e.resolve(f.v).then(function(d){r("next",d,o,u)},function(d){r("throw",d,o,u)}):e.resolve(f).then(function(d){c.value=d,o(c)},function(d){return r("throw",d,o,u)})}catch(d){u(d)}}var n;this.next||(xa(Pa.prototype),xa(Pa.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),xa(this,"_invoke",function(i,s,o){function u(){return new e(function(c,f){r(i,o,c,f)})}return n=n?n.then(u,u):u()},!0)}Wn.exports=Pa,Wn.exports.__esModule=!0,Wn.exports.default=Wn.exports});var Oa=H((sN,Vn)=>{x();T();P();var GS=Ia(),QS=Ta();function KS(t,e,r,n,i){return new QS(GS().w(t,e,r,n),i||Promise)}Vn.exports=KS,Vn.exports.__esModule=!0,Vn.exports.default=Vn.exports});var Mp=H((hN,Hn)=>{x();T();P();var YS=Oa();function JS(t,e,r,n,i){var s=YS(t,e,r,n,i);return s.next().then(function(o){return o.done?o.value:s.next()})}Hn.exports=JS,Hn.exports.__esModule=!0,Hn.exports.default=Hn.exports});var Bp=H((wN,zn)=>{x();T();P();function XS(t){var e=Object(t),r=[];for(var n in e)r.unshift(n);return function i(){for(;r.length;)if((n=r.pop())in e)return i.value=n,i.done=!1,i;return i.done=!0,i}}zn.exports=XS,zn.exports.__esModule=!0,zn.exports.default=zn.exports});var Np=H((PN,Gn)=>{x();T();P();var ZS=kn().default;function eE(t){if(t!=null){var e=t[typeof Symbol=="function"&&Symbol.iterator||"@@iterator"],r=0;if(e)return e.call(t);if(typeof t.next=="function")return t;if(!isNaN(t.length))return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}throw new TypeError(ZS(t)+" is not iterable")}Gn.exports=eE,Gn.exports.__esModule=!0,Gn.exports.default=Gn.exports});var qp=H((BN,Mt)=>{x();T();P();var tE=Ea(),rE=Ia(),nE=Mp(),iE=Oa(),oE=Ta(),sE=Bp(),Lp=Np();function Ra(){"use strict";var t=rE(),e=t.m(Ra),r=(Object.getPrototypeOf?Object.getPrototypeOf(e):e.__proto__).constructor;function n(o){var u=typeof o=="function"&&o.constructor;return!!u&&(u===r||(u.displayName||u.name)==="GeneratorFunction")}var i={throw:1,return:2,break:3,continue:3};function s(o){var u,c;return function(f){u||(u={stop:function(){return c(f.a,2)},catch:function(){return f.v},abrupt:function(h,m){return c(f.a,i[h],m)},delegateYield:function(h,m,g){return u.resultName=m,c(f.d,Lp(h),g)},finish:function(h){return c(f.f,h)}},c=function(h,m,g){f.p=u.prev,f.n=u.next;try{return h(m,g)}finally{u.next=f.n}}),u.resultName&&(u[u.resultName]=f.v,u.resultName=void 0),u.sent=f.v,u.next=f.n;try{return o.call(this,u)}finally{f.p=u.prev,f.n=u.next}}}return(Mt.exports=Ra=function(){return{wrap:function(c,f,d,h){return t.w(s(c),f,d,h&&h.reverse())},isGeneratorFunction:n,mark:t.m,awrap:function(c,f){return new tE(c,f)},AsyncIterator:oE,async:function(c,f,d,h,m){return(n(f)?iE:nE)(s(c),f,d,h,m)},keys:sE,values:Lp}},Mt.exports.__esModule=!0,Mt.exports.default=Mt.exports)()}Mt.exports=Ra,Mt.exports.__esModule=!0,Mt.exports.default=Mt.exports});var Up=H((jN,Dp)=>{x();T();P();var no=qp()();Dp.exports=no;try{regeneratorRuntime=no}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=no:Function("r","regeneratorRuntime = r")(no)}});var jp=H((io,Fp)=>{x();T();P();(function(t,e){typeof io=="object"&&typeof Fp<"u"?e(io,va(),Sp(),Op(),kp(),Up()):typeof define=="function"&&define.amd?define(["exports","fast-unique-numbers","@babel/runtime/helpers/defineProperty","@babel/runtime/helpers/slicedToArray","@babel/runtime/helpers/asyncToGenerator","@babel/runtime/regenerator"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.brokerFactory={},t.fastUniqueNumbers,t._defineProperty,t._slicedToArray,t._asyncToGenerator,t._regeneratorRuntime))})(io,(function(t,e,r,n,i,s){"use strict";function o(S,b){var _=Object.keys(S);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(S);b&&(w=w.filter(function(R){return Object.getOwnPropertyDescriptor(S,R).enumerable})),_.push.apply(_,w)}return _}function u(S){for(var b=1;b<arguments.length;b++){var _=arguments[b]!=null?arguments[b]:{};b%2?o(Object(_),!0).forEach(function(w){r(S,w,_[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(S,Object.getOwnPropertyDescriptors(_)):o(Object(_)).forEach(function(w){Object.defineProperty(S,w,Object.getOwnPropertyDescriptor(_,w))})}return S}var c=function(b,_,w,R){return function(A){var y=_(A);return function(O){var v=b(O);O.addEventListener("message",function(ee){var z=ee.data,V=z.id;if(V!==null&&v.has(V)){var te=v.get(V),Y=te.reject,X=te.resolve;v.delete(V),z.error===void 0?X(z.result):Y(new Error(z.error.message))}}),R(O)&&O.start();for(var B=function(z){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return new Promise(function(Y,X){var ce=w(v);v.set(ce,{reject:X,resolve:Y}),V===null?O.postMessage({id:ce,method:z},te):O.postMessage({id:ce,method:z,params:V},te)})},D=function(z,V){var te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];O.postMessage({id:null,method:z,params:V},te)},q={},K=0,U=Object.entries(y);K<U.length;K++){var W=n(U[K],2),G=W[0],J=W[1];q=u(u({},q),{},r({},G,J({call:B,notify:D})))}return u({},q)}}},f=function(b){return function(_){if(b.has(_))return b.get(_);var w=new Map;return b.set(_,w),w}};function d(S,b){var _=Object.keys(S);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(S);b&&(w=w.filter(function(R){return Object.getOwnPropertyDescriptor(S,R).enumerable})),_.push.apply(_,w)}return _}function h(S){for(var b=1;b<arguments.length;b++){var _=arguments[b]!=null?arguments[b]:{};b%2?d(Object(_),!0).forEach(function(w){r(S,w,_[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(S,Object.getOwnPropertyDescriptors(_)):d(Object(_)).forEach(function(w){Object.defineProperty(S,w,Object.getOwnPropertyDescriptor(_,w))})}return S}var m=function(b){return function(_){return h(h({},_),{},{connect:function(R){var A=R.call;return i(s.mark(function y(){var O,v,B,D;return s.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return O=new MessageChannel,v=O.port1,B=O.port2,q.next=1,A("connect",{port:v},[v]);case 1:return D=q.sent,b.set(B,D),q.abrupt("return",B);case 2:case"end":return q.stop()}},y)}))},disconnect:function(R){var A=R.call;return(function(){var y=i(s.mark(function O(v){var B;return s.wrap(function(D){for(;;)switch(D.prev=D.next){case 0:if(B=b.get(v),B!==void 0){D.next=1;break}throw new Error("The given port is not connected.");case 1:return D.next=2,A("disconnect",{portId:B});case 2:case"end":return D.stop()}},O)}));return function(O){return y.apply(this,arguments)}})()},isSupported:function(R){var A=R.call;return function(){return A("isSupported")}}})}},g=function(b){return typeof b.start=="function"},I=c(f(new WeakMap),m(new WeakMap),e.generateUniqueNumber,g);t.createBroker=I}))});var Wp=H((oo,$p)=>{x();T();P();(function(t,e){typeof oo=="object"&&typeof $p<"u"?e(oo,jp(),va(),kn()):typeof define=="function"&&define.amd?define(["exports","broker-factory","fast-unique-numbers","@babel/runtime/helpers/typeof"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.workerTimersBroker={},t.brokerFactory,t.fastUniqueNumbers,t._typeof))})(oo,(function(t,e,r,n){"use strict";var i=function(_){return function(w){return function(R){n(_.get(R))==="symbol"&&(_.set(R,null),w(R).then(function(){_.delete(R)}))}}},s=function(_){return function(w){return function(R){n(_.get(R))==="symbol"&&(_.set(R,null),w(R).then(function(){_.delete(R)}))}}},o=function(_,w){return function(R){return function(A){for(var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,O=arguments.length,v=new Array(O>2?O-2:0),B=2;B<O;B++)v[B-2]=arguments[B];var D=Symbol(),q=_(w);w.set(q,D);var K=function(){return R(y,q).then(function(){var W=w.get(q);if(W===void 0)throw new Error("The timer is in an undefined state.");W===D&&(A.apply(void 0,v),w.get(q)===D&&K())})};return K(),q}}},u=function(_,w){return function(R){return function(A){for(var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,O=arguments.length,v=new Array(O>2?O-2:0),B=2;B<O;B++)v[B-2]=arguments[B];var D=Symbol(),q=_(w);return w.set(q,D),R(y,q).then(function(){var K=w.get(q);if(K===void 0)throw new Error("The timer is in an undefined state.");K===D&&(w.delete(q),A.apply(void 0,v))}),q}}},c=new Map([[0,null]]),f=new Map([[0,null]]),d=i(c),h=s(f),m=o(r.generateUniqueNumber,c),g=u(r.generateUniqueNumber,f),I=e.createBroker({clearInterval:function(_){var w=_.call;return d(function(R){return w("clear",{timerId:R,timerType:"interval"})})},clearTimeout:function(_){var w=_.call;return h(function(R){return w("clear",{timerId:R,timerType:"timeout"})})},setInterval:function(_){var w=_.call;return m(function(R,A){return w("set",{delay:R,now:performance.timeOrigin+performance.now(),timerId:A,timerType:"interval"})})},setTimeout:function(_){var w=_.call;return g(function(R,A){return w("set",{delay:R,now:performance.timeOrigin+performance.now(),timerId:A,timerType:"timeout"})})}}),S=function(_){var w=new Worker(_);return I(w)};t.load=S,t.wrap=I}))});var Hp=H((so,Vp)=>{x();T();P();(function(t,e){typeof so=="object"&&typeof Vp<"u"?e(so,Wp()):typeof define=="function"&&define.amd?define(["exports","worker-timers-broker"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.workerTimers={},t.workerTimersBroker))})(so,(function(t,e){"use strict";var r=function(d,h){var m=null;return function(){if(m!==null)return m;var g=new Blob([h],{type:"application/javascript; charset=utf-8"}),I=URL.createObjectURL(g);return m=d(I),setTimeout(function(){return URL.revokeObjectURL(I)}),m}},n=`(()=>{var e={389(e,t){!function(e){"use strict";var t=function(e){return function(t){var r=e(t);return t.add(r),r}},r=function(e){return function(t,r){return e.set(t,r),r}},n=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,o=536870912,u=2*o,a=function(e,t){return function(r){var a=t.get(r),i=void 0===a?r.size:a<u?a+1:0;if(!r.has(i))return e(r,i);if(r.size<o){for(;r.has(i);)i=Math.floor(Math.random()*u);return e(r,i)}if(r.size>n)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;r.has(i);)i=Math.floor(Math.random()*n);return e(r,i)}},i=new WeakMap,s=r(i),c=a(s,i),f=t(c);e.addUniqueNumber=f,e.generateUniqueNumber=c}(t)},623(e,t,r){!function(e,t,r,n,o){"use strict";var u={INTERNAL_ERROR:-32603,INVALID_PARAMS:-32602,METHOD_NOT_FOUND:-32601},a=function(e,t){return Object.assign(new Error(e),{status:t})},i=function(e){return a('The requested method called "'.concat(e,'" is not supported.'),u.METHOD_NOT_FOUND)},s=function(e){return a('The handler of the method called "'.concat(e,'" returned no required result.'),u.INTERNAL_ERROR)},c=function(e){return a('The handler of the method called "'.concat(e,'" returned an unexpected result.'),u.INTERNAL_ERROR)},f=function(e){return a('The specified parameter called "portId" with the given value "'.concat(e,'" does not identify a port connected to this worker.'),u.INVALID_PARAMS)},l=function(e,n){return function(){var o=t(r.mark(function t(o){var u,a,f,l,p,d,v,x,y,b,h,m,_,g,w;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(u=o.data,a=u.id,f=u.method,l=u.params,p=n[f],t.prev=1,void 0!==p){t.next=2;break}throw i(f);case 2:if(void 0!==(d=void 0===l?p():p(l))){t.next=3;break}throw s(f);case 3:if(!(d instanceof Promise)){t.next=5;break}return t.next=4,d;case 4:g=t.sent,t.next=6;break;case 5:g=d;case 6:if(v=g,null!==a){t.next=8;break}if(void 0===v.result){t.next=7;break}throw c(f);case 7:t.next=10;break;case 8:if(void 0!==v.result){t.next=9;break}throw c(f);case 9:x=v.result,y=v.transferables,b=void 0===y?[]:y,e.postMessage({id:a,result:x},b);case 10:t.next=12;break;case 11:t.prev=11,w=t.catch(1),h=w.message,m=w.status,_=void 0===m?-32603:m,e.postMessage({error:{code:_,message:h},id:a});case 12:case"end":return t.stop()}},t,null,[[1,11]])}));return function(e){return o.apply(this,arguments)}}()},p=function(){return new Promise(function(e){var t=new ArrayBuffer(0),r=new MessageChannel,n=r.port1,o=r.port2;n.onmessage=function(t){var r=t.data;return e(null!==r)},o.postMessage(t,[t])})};function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var x=new Map,y=function(e,n,u){return v(v({},n),{},{connect:function(t){var r=t.port;r.start();var u=e(r,n),a=o.generateUniqueNumber(x);return x.set(a,function(){u(),r.close(),x.delete(a)}),{result:a}},disconnect:function(e){var t=e.portId,r=x.get(t);if(void 0===r)throw f(t);return r(),{result:null}},isSupported:function(){var e=t(r.mark(function e(){var t,n,o;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,p();case 1:if(!e.sent){e.next=5;break}if(!((t=u())instanceof Promise)){e.next=3;break}return e.next=2,t;case 2:o=e.sent,e.next=4;break;case 3:o=t;case 4:return n=o,e.abrupt("return",{result:n});case 5:return e.abrupt("return",{result:!1});case 6:case"end":return e.stop()}},e)}));function n(){return e.apply(this,arguments)}return n}()})},b=function(e,t){var r=y(b,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0}),n=l(e,r);return e.addEventListener("message",n),function(){return e.removeEventListener("message",n)}};e.createWorker=b,e.isSupported=p}(t,r(293),r(756),r(693),r(389))},472(e,t,r){!function(e,t,r,n){"use strict";var o=function(e,t){return function(r){var o=t.get(r);if(void 0===o)return Promise.resolve(!1);var u=n(o,2),a=u[0],i=u[1];return e(a),t.delete(r),i(!1),Promise.resolve(!0)}},u=function(e,t){var r=function(n,o,u,a){var i=n-e.now();i>0?o.set(a,[t(r,i,n,o,u,a),u]):(o.delete(a),u(!0))};return r},a=function(e,t,r,n){return function(o,u,a){var i=o+u-t.timeOrigin,s=i-t.now();return new Promise(function(t){e.set(a,[r(n,s,i,e,t,a),t])})}},i=new Map,s=o(globalThis.clearTimeout,i),c=new Map,f=o(globalThis.clearTimeout,c),l=u(performance,globalThis.setTimeout),p=a(i,performance,globalThis.setTimeout,l),d=a(c,performance,globalThis.setTimeout,l);r.createWorker(self,{clear:function(){var r=e(t.mark(function e(r){var n,o,u;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.timerId,o=r.timerType,e.next=1,"interval"===o?s(n):f(n);case 1:return u=e.sent,e.abrupt("return",{result:u});case 2:case"end":return e.stop()}},e)}));function n(e){return r.apply(this,arguments)}return n}(),set:function(){var r=e(t.mark(function e(r){var n,o,u,a,i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.delay,o=r.now,u=r.timerId,a=r.timerType,e.next=1,("interval"===a?p:d)(n,o,u);case 1:return i=e.sent,e.abrupt("return",{result:i});case 2:case"end":return e.stop()}},e)}));function n(e){return r.apply(this,arguments)}return n}()})}(r(293),r(756),r(623),r(715))},172(e){e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},79(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n},e.exports.__esModule=!0,e.exports.default=e.exports},987(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},293(e){function t(e,t,r,n,o,u,a){try{var i=e[u](a),s=i.value}catch(e){return void r(e)}i.done?t(s):Promise.resolve(s).then(n,o)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise(function(o,u){var a=e.apply(r,n);function i(e){t(a,o,u,i,s,"next",e)}function s(e){t(a,o,u,i,s,"throw",e)}i(void 0)})}},e.exports.__esModule=!0,e.exports.default=e.exports},693(e,t,r){var n=r(736);e.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},156(e){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,u,a,i=[],s=!0,c=!1;try{if(u=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=u.call(r)).done)&&(i.push(n.value),i.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return i}},e.exports.__esModule=!0,e.exports.default=e.exports},752(e){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},993(e,t,r){var n=r(546);function o(){var t,r,u="function"==typeof Symbol?Symbol:{},a=u.iterator||"@@iterator",i=u.toStringTag||"@@toStringTag";function s(e,o,u,a){var i=o&&o.prototype instanceof f?o:f,s=Object.create(i.prototype);return n(s,"_invoke",function(e,n,o){var u,a,i,s=0,f=o||[],l=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return u=e,a=0,i=t,p.n=r,c}};function d(e,n){for(a=e,i=n,r=0;!l&&s&&!o&&r<f.length;r++){var o,u=f[r],d=p.p,v=u[2];e>3?(o=v===n)&&(i=u[(a=u[4])?5:(a=3,3)],u[4]=u[5]=t):u[0]<=d&&((o=e<2&&d<u[1])?(a=0,p.v=n,p.n=u[1]):d<v&&(o=e<3||u[0]>n||n>v)&&(u[4]=e,u[5]=n,p.n=v,a=0))}if(o||e>1)return c;throw l=!0,n}return function(o,f,v){if(s>1)throw TypeError("Generator is already running");for(l&&1===f&&d(f,v),a=f,i=v;(r=a<2?t:i)||!l;){u||(a?a<3?(a>1&&(p.n=-1),d(a,i)):p.n=i:p.v=i);try{if(s=2,u){if(a||(o="next"),r=u[o]){if(!(r=r.call(u,i)))throw TypeError("iterator result is not an object");if(!r.done)return r;i=r.value,a<2&&(a=0)}else 1===a&&(r=u.return)&&r.call(u),a<2&&(i=TypeError("The iterator does not provide a '"+o+"' method"),a=1);u=t}else if((r=(l=p.n<0)?i:e.call(n,p))!==c)break}catch(e){u=t,a=1,i=e}finally{s=1}}return{value:r,done:l}}}(e,u,a),!0),s}var c={};function f(){}function l(){}function p(){}r=Object.getPrototypeOf;var d=[][a]?r(r([][a]())):(n(r={},a,function(){return this}),r),v=p.prototype=f.prototype=Object.create(d);function x(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,n(e,i,"GeneratorFunction")),e.prototype=Object.create(v),e}return l.prototype=p,n(v,"constructor",p),n(p,"constructor",l),l.displayName="GeneratorFunction",n(p,i,"GeneratorFunction"),n(v),n(v,i,"Generator"),n(v,a,function(){return this}),n(v,"toString",function(){return"[object Generator]"}),(e.exports=o=function(){return{w:s,m:x}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},869(e,t,r){var n=r(887);e.exports=function(e,t,r,o,u){var a=n(e,t,r,o,u);return a.next().then(function(e){return e.done?e.value:a.next()})},e.exports.__esModule=!0,e.exports.default=e.exports},887(e,t,r){var n=r(993),o=r(791);e.exports=function(e,t,r,u,a){return new o(n().w(e,t,r,u),a||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},791(e,t,r){var n=r(172),o=r(546);e.exports=function e(t,r){function u(e,o,a,i){try{var s=t[e](o),c=s.value;return c instanceof n?r.resolve(c.v).then(function(e){u("next",e,a,i)},function(e){u("throw",e,a,i)}):r.resolve(c).then(function(e){s.value=e,a(s)},function(e){return u("throw",e,a,i)})}catch(e){i(e)}}var a;this.next||(o(e.prototype),o(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),o(this,"_invoke",function(e,t,n){function o(){return new r(function(t,r){u(e,n,t,r)})}return a=a?a.then(o,o):o()},!0)},e.exports.__esModule=!0,e.exports.default=e.exports},546(e){function t(r,n,o,u){var a=Object.defineProperty;try{a({},"",{})}catch(r){a=0}e.exports=t=function(e,r,n,o){function u(r,n){t(e,r,function(e){return this._invoke(r,n,e)})}r?a?a(e,r,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[r]=n:(u("next",0),u("throw",1),u("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n,o,u)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},373(e){e.exports=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},633(e,t,r){var n=r(172),o=r(993),u=r(869),a=r(887),i=r(791),s=r(373),c=r(579);function f(){"use strict";var t=o(),r=t.m(f),l=(Object.getPrototypeOf?Object.getPrototypeOf(r):r.__proto__).constructor;function p(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===l||"GeneratorFunction"===(t.displayName||t.name))}var d={throw:1,return:2,break:3,continue:3};function v(e){var t,r;return function(n){t||(t={stop:function(){return r(n.a,2)},catch:function(){return n.v},abrupt:function(e,t){return r(n.a,d[e],t)},delegateYield:function(e,o,u){return t.resultName=o,r(n.d,c(e),u)},finish:function(e){return r(n.f,e)}},r=function(e,r,o){n.p=t.prev,n.n=t.next;try{return e(r,o)}finally{t.next=n.n}}),t.resultName&&(t[t.resultName]=n.v,t.resultName=void 0),t.sent=n.v,t.next=n.n;try{return e.call(this,t)}finally{n.p=t.prev,n.n=t.next}}}return(e.exports=f=function(){return{wrap:function(e,r,n,o){return t.w(v(e),r,n,o&&o.reverse())},isGeneratorFunction:p,mark:t.m,awrap:function(e,t){return new n(e,t)},AsyncIterator:i,async:function(e,t,r,n,o){return(p(t)?a:u)(v(e),t,r,n,o)},keys:s,values:c}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=f,e.exports.__esModule=!0,e.exports.default=e.exports},579(e,t,r){var n=r(738).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(n(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},715(e,t,r){var n=r(987),o=r(156),u=r(122),a=r(752);e.exports=function(e,t){return n(e)||o(e,t)||u(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},45(e,t,r){var n=r(738).default;e.exports=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},736(e,t,r){var n=r(738).default,o=r(45);e.exports=function(e){var t=o(e,"string");return"symbol"==n(t)?t:t+""},e.exports.__esModule=!0,e.exports.default=e.exports},738(e){function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},122(e,t,r){var n=r(79);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},756(e,t,r){var n=r(633)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var u=t[n]={exports:{}};return e[n].call(u.exports,u,u.exports,r),u.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";r(472)})()})();`,i=r(e.load,n),s=function(d){return i().clearInterval(d)},o=function(d){return i().clearTimeout(d)},u=function(){var d;return(d=i()).setInterval.apply(d,arguments)},c=function(){var d;return(d=i()).setTimeout.apply(d,arguments)};t.clearInterval=s,t.clearTimeout=o,t.setInterval=u,t.setTimeout=c}))});var Qn=H(vr=>{"use strict";x();T();P();Object.defineProperty(vr,"__esModule",{value:!0});vr.isReactNativeBrowser=vr.isWebWorker=void 0;var aE=()=>typeof window<"u"?typeof navigator<"u"&&navigator.userAgent?.toLowerCase().indexOf(" electron/")>-1&&L?.versions?!Object.prototype.hasOwnProperty.call(L.versions,"electron"):typeof window.document<"u":!1,zp=()=>!!(typeof self=="object"&&self?.constructor?.name?.includes("WorkerGlobalScope")&&typeof Deno>"u"),Gp=()=>typeof navigator<"u"&&navigator.product==="ReactNative",uE=aE()||zp()||Gp();vr.isWebWorker=zp();vr.isReactNativeBrowser=Gp();vr.default=uE});var Jp=H(Bt=>{"use strict";x();T();P();var lE=Bt&&Bt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),cE=Bt&&Bt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),fE=Bt&&Bt.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&lE(r,e,n[i]);return cE(r,e),r}})();Object.defineProperty(Bt,"__esModule",{value:!0});var Qp=Hp(),ka=fE(Qn()),Kp={set:Qp.setInterval,clear:Qp.clearInterval},Yp={set:(t,e)=>setInterval(t,e),clear:t=>clearInterval(t)},dE=t=>{switch(t){case"native":return Yp;case"worker":return Kp;case"auto":default:return ka.default&&!ka.isWebWorker&&!ka.isReactNativeBrowser?Kp:Yp}};Bt.default=dE});var Ma=H(Kn=>{"use strict";x();T();P();var hE=Kn&&Kn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Kn,"__esModule",{value:!0});var pE=hE(Jp()),Ca=class{_keepalive;timerId;timer;destroyed=!1;counter;client;_keepaliveTimeoutTimestamp;_intervalEvery;get keepaliveTimeoutTimestamp(){return this._keepaliveTimeoutTimestamp}get intervalEvery(){return this._intervalEvery}get keepalive(){return this._keepalive}constructor(e,r){this.client=e,this.timer=typeof r=="object"&&"set"in r&&"clear"in r?r:(0,pE.default)(r),this.setKeepalive(e.keepalive)}clear(){this.timerId&&(this.timer.clear(this.timerId),this.timerId=null)}setKeepalive(e){if(e*=1e3,isNaN(e)||e<=0||e>2147483647)throw new Error(`Keepalive value must be an integer between 0 and 2147483647. Provided value is ${e}`);this._keepalive=e,this.reschedule(),this.client.log(`KeepaliveManager: set keepalive to ${e}ms`)}destroy(){this.clear(),this.destroyed=!0}reschedule(){if(this.destroyed)return;this.clear(),this.counter=0;let e=Math.ceil(this._keepalive*1.5);this._keepaliveTimeoutTimestamp=Date.now()+e,this._intervalEvery=Math.ceil(this._keepalive/2),this.timerId=this.timer.set(()=>{this.destroyed||(this.counter+=1,this.counter===2?this.client.sendPing():this.counter>2&&this.client.onKeepaliveTimeout())},this._intervalEvery)}};Kn.default=Ca});var co=H(lt=>{"use strict";x();T();P();var gE=lt&&lt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),yE=lt&&lt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),og=lt&&lt.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&gE(r,e,n[i]);return yE(r,e),r}})(),Zt=lt&&lt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(lt,"__esModule",{value:!0});var lo=Zt(Yh()),bE=Qt(),Xp=Zt(ep()),mE=Zt(Yt()),Zp=og(Zs()),Xr=Zt(ra()),_E=Zt(gp()),eg=Pn(),wE=Zt(ma()),vE=Zt(yp()),Nt=Tt(),SE=bp(),EE=Zt(Ma()),tg=og(Qn()),ao=globalThis.setImmediate||((...t)=>{let e=t.shift();(0,Nt.nextTick)(()=>{e(...t)})}),uo=65535,rg=147,Ba=129,AE=(t,e)=>{let r=0,n={write(i){return r+=typeof i=="string"?$.byteLength(i):i.length,!0},destroy(){}};return lo.default.writeToStream(t,n,e),r},Na=t=>t==null?0:typeof t=="string"||ArrayBuffer.isView(t)?$.byteLength(t):1/0,ng=(t,e)=>typeof e=="string"?5+$.byteLength(t)+$.byteLength(e):1/0,IE=t=>{let n=16+Na(t.topic)+Na(t.payload),i=t.properties;if(!i)return n;for(let s in i){let o=i[s];if(o!=null)if(typeof o=="number"||typeof o=="boolean")n+=5;else if(s==="userProperties")for(let u in o){let c=o[u];if(!Array.isArray(c))n+=ng(u,c);else for(let f of c)n+=ng(u,f)}else n+=3+Na(o)}return n},ig={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0,subscribeBatchSize:null,writeCache:!0,timerVariant:"auto"},La=class t extends SE.TypedEventEmitter{static VERSION=Nt.MQTTJS_VERSION;connected;disconnecting;disconnected;reconnecting;incomingStore;outgoingStore;options;queueQoSZero;_reconnectCount;log;messageIdProvider;outgoing;messageIdToTopic;noop;keepaliveManager;stream;queue;streamBuilder;_resubscribeTopics;connackTimer;reconnectTimer;_storeProcessing;_packetIdsDuringStoreProcessing;_storeProcessingQueue;_firstConnection;topicAliasRecv;topicAliasSend;_incomingQoS2Ids;_receiveMaximum;_deferredReconnect;_currentPump;connackReceived;reconnectSuppressed;_authenticationMethod;connackPacket;_serverProperties;static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}constructor(e,r){super(),this.options=r||{};for(let i in ig)typeof this.options[i]>"u"?this.options[i]=ig[i]:this.options[i]=r[i];this.log=this.options.log||(0,mE.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: version:",t.VERSION),tg.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",tg.default?"browser":"node"),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||(lo.default.writeToStream.cacheNumbers=!1),this.streamBuilder=e,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new wE.default:this.options.messageIdProvider,this.outgoingStore=r.outgoingStore||new Xr.default,this.incomingStore=r.incomingStore||new Xr.default,this._incomingQoS2Ids=new Set,this._receiveMaximum=uo;let n=r.properties?.receiveMaximum;n!==void 0&&(Number.isInteger(n)&&n>=1&&n<=uo?this._receiveMaximum=n:this.log("MqttClient :: options.properties.receiveMaximum %o is not an integer between 1 and %d, enforcing and advertising %d instead",n,uo,uo)),this.queueQoSZero=r.queueQoSZero===void 0?!0:r.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.keepaliveManager=null,this.connected=!1,this.disconnecting=!1,this.reconnecting=!1,this.queue=[],this.connackTimer=null,this.connackReceived=!1,this.reconnectSuppressed=!1,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,r.properties&&r.properties.topicAliasMaximum>0&&(r.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new vE.default(r.properties.topicAliasMaximum)),this.on("connect",()=>{let{queue:i}=this,s=()=>{let o=i.shift();this.log("deliver :: entry %o",o);let u=null;if(!o){this._resubscribe();return}u=o.packet,this.log("deliver :: call _sendPacket for %o",u);let c=!0;u.messageId&&u.messageId!==0&&(this.messageIdProvider.register(u.messageId)||(c=!1)),c?this._sendPacket(u,f=>{o.cb&&o.cb(f),s()}):(this.log("messageId: %d has already used. The message is skipped and removed.",u.messageId),s())};this.log("connect :: sending queued packets"),s()}),this.on("close",()=>{this.log("close :: connected set to `false`"),this.connected=!1,this.log("close :: clearing connackTimer"),clearTimeout(this.connackTimer),this._destroyKeepaliveManager(),this._serverProperties=void 0,this.topicAliasRecv&&this.topicAliasRecv.clear(),this.log("close :: calling _setupReconnect"),this._setupReconnect()}),this.options.manualConnect||(this.log("MqttClient :: setting up stream"),this.connect())}handleAuth(e,r){r()}handleMessage(e,r){r()}_nextId(){let e=[],r=null;for(let n=0;n<65535;n++){let i=this.messageIdProvider.allocate();if(i===null||!this.outgoing[i]){r=i;break}e.push(i)}for(let n of e)this.messageIdProvider.deallocate(n);return r}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}_trackIncomingQoS2Publish(e,r,n){return this._incomingQoS2Ids.has(e)?!0:this.options.protocolVersion===5&&this._incomingQoS2Ids.size>=this._receiveMaximum?(this.log("_trackIncomingQoS2Publish :: inbound QoS 2 messages exceeded receiveMaximum %d",this._receiveMaximum),n?.discardParsedPackets(),(!n||n.isCurrent())&&this._cleanUp(!0),r(),this.emit("error",new Nt.ErrorWithReasonCode(`${eg.ReasonCodes[rg]}: ${this._incomingQoS2Ids.size+1} inbound QoS 2 messages in flight, receiveMaximum is ${this._receiveMaximum}`,rg)),!1):(this._incomingQoS2Ids.add(e),!0)}_releaseIncomingQoS2Publish(e){this._incomingQoS2Ids.delete(e)}_discardIncomingQoS2State(){if(this._incomingQoS2Ids.size!==0){this.log("_discardIncomingQoS2State :: session not resumed, dropping %d inbound QoS 2 message(s)",this._incomingQoS2Ids.size);for(let e of this._incomingQoS2Ids)this.incomingStore.del({messageId:e},this.noop);this._incomingQoS2Ids.clear()}}connect(){let e=new bE.Writable,r=lo.default.parser(this.options),n=null,i=[],s={discardParsedPackets:()=>{i.length=0},isCurrent:()=>this._currentPump===s};this._currentPump=s,this.connackReceived=!1,this.reconnectSuppressed=!1,this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this._serverProperties=void 0,this.disconnected&&!this.reconnecting&&(this.incomingStore=this.options.incomingStore||new Xr.default,this.outgoingStore=this.options.outgoingStore||new Xr.default,this._incomingQoS2Ids.clear(),this.disconnecting=!1,this.disconnected=!1),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),r.on("packet",h=>{this.log("parser :: on packet push to packets array."),i.push(h)});let o=()=>{this.log("work :: getting next packet in queue"),this._currentPump!==s&&(this.log("work :: pump superseded, dropping %d queued packets",i.length),i.length=0);let h=i.shift();if(h)this.log("work :: packet pulled from queue"),(0,_E.default)(this,h,u,s);else{this.log("work :: no packets in queue");let m=n;n=null,this.log("work :: done flag is %s",!!m),m&&m()}},u=()=>{if(i.length)(0,Nt.nextTick)(o);else{let h=n;n=null,h&&h()}},c=!1;e._write=(h,m,g)=>{if(c){this.log("writable stream :: dropping chunk after a parser error"),g();return}n=g,this.log("writable stream :: parsing buffer"),r.parse(h),o()};let f=h=>{this.log("streamErrorHandler :: error",h.message),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(e),this.stream.on("error",f),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 d={cmd:"connect",protocolId:this.options.protocolId,protocolVersion:this.options.protocolVersion,clean:this.options.clean,clientId:this.options.clientId,keepalive:this.options.keepalive,username:this.options.username,password:this.options.password,properties:this.options.properties?{...this.options.properties}:void 0};if(d.properties?.receiveMaximum!==void 0&&(d.properties.receiveMaximum=this._receiveMaximum),this.options.will&&(d.will={...this.options.will,payload:this.options.will?.payload}),this.topicAliasRecv&&(d.properties||(d.properties={}),this.topicAliasRecv&&(d.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._authenticationMethod=d.properties?.authenticationMethod,this._writePacket(d),r.on("error",h=>{c=!0,this._onParserError(h,s)}),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={cmd:"auth",reasonCode:0,...this.options.authPacket};this._writePacket(h)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(()=>this._onConnackTimeout(),this.options.connectTimeout),this}_onParserError(e,r){if(r.discardParsedPackets(),r.isCurrent()){if(this.log("_onParserError :: malformed packet, closing: %s",e.message),this.options.protocolVersion===5&&!this.disconnecting&&this.stream.writable){this._writePacket({cmd:"disconnect",reasonCode:Ba});do this.stream.uncork();while(this.stream.writableCorked>0)}this._cleanUp(!0)}else this.log("_onParserError :: stale connection: %s",e.message);this.emit("error",new Nt.ErrorWithReasonCode(`${eg.ReasonCodes[Ba]}: ${e.message}`,Ba))}_onConnackTimeout(){this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this._cleanUp(!0),this.emit("error",new Error("connack timeout"))}publish(e,r,n,i){this.log("publish :: message `%s` to topic `%s`",r,e);let{options:s}=this;typeof n=="function"&&(i=n,n=null),n=n||{},n={...{qos:0,retain:!1,dup:!1},...n};let{qos:u,retain:c,dup:f,properties:d,cbStorePut:h}=n;if(this._checkDisconnecting(i))return this;let m=()=>{let g=0;if((u===1||u===2)&&(g=this._nextId(),g===null))return this.log("No messageId left"),!1;let I={cmd:"publish",topic:e,payload:r,qos:u,retain:c,messageId:g,dup:u===1||u===2?f:!1};switch(s.protocolVersion===5&&(I.properties=d),this.log("publish :: qos",u),u){case 1:case 2:this.outgoing[I.messageId]={volatile:!1,cmd:"publish",cb:i||this.noop},this.log("MqttClient:publish: packet cmd: %s",I.cmd),this._sendPacket(I,void 0,h);break;default:this.log("MqttClient:publish: packet cmd: %s",I.cmd),this._sendPacket(I,i,h);break}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!m())&&this._storeProcessingQueue.push({invoke:m,cbStorePut:n.cbStorePut,callback:i}),this}publishAsync(e,r,n){return new Promise((i,s)=>{this.publish(e,r,n,(o,u)=>{o?s(o):i(u)})})}subscribe(e,r,n){let i=this.options.protocolVersion;typeof r=="function"&&(n=r),n=n||this.noop;let s=!1,o=[];typeof e=="string"?(e=[e],o=e):Array.isArray(e)?o=e:typeof e=="object"&&(s=e.resubscribe,delete e.resubscribe,o=Object.keys(e));let u=Zp.validateTopics(o);if(u!==null)return ao(n,new Error(`Invalid topic ${u}`)),this;if(this._checkDisconnecting(n))return this.log("subscribe: discconecting true"),this;let c={qos:0};i===5&&(c.nl=!1,c.rap=!1,c.rh=0),r={...c,...r};let{properties:f}=r,d=[],h=(I,S)=>{if(S=S||r,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,I)||this._resubscribeTopics[I].qos<S.qos||s){let b={topic:I,qos:S.qos};i===5&&(b.nl=S.nl,b.rap=S.rap,b.rh=S.rh,b.properties=f),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",b.topic,b.qos),d.push(b)}};if(Array.isArray(e)?e.forEach(I=>{this.log("subscribe: array topic %s",I),h(I)}):Object.keys(e).forEach(I=>{this.log("subscribe: object topic %s, %o",I,e[I]),h(I,e[I])}),!d.length)return n(null,[]),this;let m=(I,S)=>{let b={cmd:"subscribe",subscriptions:I,messageId:S};if(f&&(b.properties=f),this.options.resubscribe){this.log("subscribe :: resubscribe true");let w=[];I.forEach(R=>{if(this.options.reconnectPeriod>0){let A={qos:R.qos};i===5&&(A.nl=R.nl||!1,A.rap=R.rap||!1,A.rh=R.rh||0,A.properties=R.properties),this._resubscribeTopics[R.topic]=A,w.push(R.topic)}}),this.messageIdToTopic[b.messageId]=w}let _=new Promise((w,R)=>{this.outgoing[b.messageId]={volatile:!0,cmd:"subscribe",cb:(A,y)=>{if(A){R(new Nt.ErrorWithSubackPacket(A.message,y));return}let{granted:O}=y;if(O.length!==I.length){R(new Nt.ErrorWithSubackPacket(`Protocol error: suback granted ${O.length} reason code(s) for ${I.length} subscription(s)`,y)),this._cleanUp(!0);return}for(let v=0;v<O.length;v+=1)I[v].qos=O[v];w(y)}}});return this.log("subscribe :: call _sendPacket"),this._sendPacket(b),_},g=()=>{let I=this.options.subscribeBatchSize??d.length,S=[];for(let b=0;b<d.length;b+=I){let _=d.slice(b,b+I),w=this._nextId();if(w===null)return this.log("No messageId left"),!1;S.push(m(_,w))}return Promise.all(S).then(b=>{n(null,d,b.at(-1))}).catch(b=>{n(b,d,b.packet)}),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!g())&&this._storeProcessingQueue.push({invoke:g,callback:n}),this}subscribeAsync(e,r){return new Promise((n,i)=>{this.subscribe(e,r,(s,o)=>{s?i(s):n(o)})})}unsubscribe(e,r,n){typeof e=="string"&&(e=[e]),typeof r=="function"&&(n=r),n=n||this.noop;let i=Zp.validateTopics(e);if(i!==null)return ao(n,new Error(`Invalid topic ${i}`)),this;if(this._checkDisconnecting(n))return this;let s=()=>{let o=this._nextId();if(o===null)return this.log("No messageId left"),!1;let u={cmd:"unsubscribe",messageId:o,unsubscriptions:[]};return typeof e=="string"?u.unsubscriptions=[e]:Array.isArray(e)&&(u.unsubscriptions=e),this.options.resubscribe&&u.unsubscriptions.forEach(c=>{delete this._resubscribeTopics[c]}),typeof r=="object"&&r.properties&&(u.properties=r.properties),this.outgoing[u.messageId]={volatile:!0,cmd:"unsubscribe",cb:n},this.log("unsubscribe: call _sendPacket"),this._sendPacket(u),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!s())&&this._storeProcessingQueue.push({invoke:s,callback:n}),this}unsubscribeAsync(e,r){return new Promise((n,i)=>{this.unsubscribe(e,r,(s,o)=>{s?i(s):n(o)})})}end(e,r,n){this.log("end :: (%s)",this.options.clientId),(e==null||typeof e!="boolean")&&(n=n||r,r=e,e=!1),typeof r!="object"&&(n=n||r,r=null),this.log("end :: cb? %s",!!n),(!n||typeof n!="function")&&(n=this.noop);let i=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this._incomingQoS2Ids.clear(),this.incomingStore.close(o=>{this.outgoingStore.close(u=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),n){let c=o||u;this.log("end :: closeStores: invoking callback with args"),n(c)}})}),this._deferredReconnect?this._deferredReconnect():(this.options.reconnectPeriod===0||this.options.manualConnect)&&(this.disconnecting=!1)},s=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,e),this._cleanUp(e,()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),(0,Nt.nextTick)(i)},r)};return this.disconnecting?(n(),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,s,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),s()),this)}endAsync(e,r){return new Promise((n,i)=>{this.end(e,r,s=>{s?i(s):n()})})}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 Xr.default,this.outgoingStore=this.options.outgoingStore||new Xr.default,this._incomingQoS2Ids.clear(),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 n=e.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",r,n),n.length===0){if(typeof r>"u")return new Error("Unregistered Topic Alias");if(n=this.topicAliasSend.getTopicByAlias(r),typeof n>"u")return new Error("Unregistered Topic Alias");e.topic=n}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.stream.destroyed?(this.end(()=>{this.connect()}),this.log("client already connected. disconnecting first.")):(this.log("_reconnect: calling connect"),this.connect())}_setupReconnect(){!this.disconnecting&&!this.reconnectSuppressed&&!this.reconnectTimer&&this.options.reconnectPeriod>0?(this.reconnecting||(this.log("_setupReconnect :: emit `offline` state"),this.emit("offline"),this.log("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),this.log("_setupReconnect :: setting reconnectTimer for %d ms",this.options.reconnectPeriod),this.reconnectTimer=setInterval(()=>{this.log("reconnectTimer :: reconnect triggered!"),this._reconnect()},this.options.reconnectPeriod)):this.log("_setupReconnect :: doing nothing...")}_clearReconnect(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)}_cleanUp(e,r,n={}){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 i={cmd:"disconnect",...n};this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(i,()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),ao(()=>{this.stream.end(()=>{this.log("_cleanUp :: (%s) :: stream destroyed",this.options.clientId)})})})}!this.disconnecting&&!this.reconnecting&&(this.log("_cleanUp :: client not disconnecting/reconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this._destroyKeepaliveManager(),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,n){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",e.cmd);let i=e,s;if(i.cmd==="publish"&&(i={...(0,Xp.default)(e),dup:!0},s=this._removeTopicAliasAndRecoverTopicName(i),s))return r&&r(s);this.outgoingStore.put(i,o=>{if(o)return r&&r(o);n(),this._writePacket(e,r)})}_applyTopicAlias(e){if(this.options.protocolVersion===5&&e.cmd==="publish"){let r;e.properties&&(r=e.properties.topicAlias);let n=e.topic.toString();if(r===0)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",n,r),new Error("Sending Topic Alias out of range");if(this.topicAliasSend)if(r){if(n.length!==0&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",n,r),!this.topicAliasSend.put(n,r)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",n,r),new Error("Sending Topic Alias out of range")}else n.length!==0&&(this.options.autoAssignTopicAlias?(r=this.topicAliasSend.getAliasByTopic(n),r?(e.topic="",e.properties={...e.properties,topicAlias:r},this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",n,r)):(r=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(n,r),e.properties={...e.properties,topicAlias:r},this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",n,r))):this.options.autoUseTopicAlias&&(r=this.topicAliasSend.getAliasByTopic(n),r&&(e.topic="",e.properties={...e.properties,topicAlias:r},this.log("applyTopicAlias :: auto use topic: %s - alias: %d",n,r))));else if(r)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",n,r),new Error("Sending Topic Alias out of range")}}_checkOutgoingPublish(e){if(this.options.protocolVersion!==5||e.cmd!=="publish")return;if(e.properties?.subscriptionIdentifier!==void 0)return new Error("Publish refused: a client must not send a Subscription Identifier");let r=this._serverProperties;if(!(!r||!this.connected)){if(r.maximumQoS!==void 0&&e.qos>r.maximumQoS)return new Error(`Publish refused: QoS ${e.qos} exceeds the server Maximum QoS ${r.maximumQoS}`);if(e.retain&&r.retainAvailable===!1)return new Error("Publish refused: the server does not support retained messages (Retain Available is 0)");if(r.maximumPacketSize&&IE(e)>r.maximumPacketSize){let n=AE(this._publishAsSent(e),this.options);if(n>r.maximumPacketSize)return new Error(`Publish refused: packet size ${n} exceeds the server Maximum Packet Size ${r.maximumPacketSize}`)}}}_publishAsSent(e){let r=e.topic.toString(),{autoAssignTopicAlias:n,autoUseTopicAlias:i}=this.options;if(!this.topicAliasSend||r.length===0||e.properties?.topicAlias||!(n||i))return e;let s=this.topicAliasSend.getAliasByTopic(r);return s?{...e,topic:"",properties:{...e.properties,topicAlias:s}}:n?{...e,properties:{...e.properties,topicAlias:1}}:e}_failPublish(e,r,n){this.log("_failPublish :: %s",r.message);let{messageId:i}=e,s=e.qos>0?this.outgoing[i]:void 0;if(!s){n(r);return}delete this.outgoing[i],this.outgoingStore.del({messageId:i},()=>{this.messageIdProvider.deallocate(i),ao(()=>{s.cb(r),this._invokeStoreProcessingQueue()})})}_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.log("_writePacket :: writing to stream");let n=lo.default.writeToStream(e,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",n),!n&&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,n,i){this.log("_sendPacket :: (%s) :: start",this.options.clientId),n=n||this.noop,r=r||this.noop;let s=this._checkOutgoingPublish(e)||this._applyTopicAlias(e);if(s){this._failPublish(e,s,r);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,n);return}if(i){this._writePacket(e,r);return}switch(e.cmd){case"publish":break;case"pubrel":this._storeAndSend(e,r,n);return;default:this._writePacket(e,r);return}switch(e.qos){case 2:case 1:this._storeAndSend(e,r,n);break;case 0:default:this._writePacket(e,r);break}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}_storePacket(e,r,n){this.log("_storePacket :: packet: %o",e),this.log("_storePacket :: cb? %s",!!r),n=n||this.noop;let i=e;if(i.cmd==="publish"){i=(0,Xp.default)(e);let o=this._removeTopicAliasAndRecoverTopicName(i);if(o)return r&&r(o)}let s=i.qos||0;s===0&&this.queueQoSZero||i.cmd!=="publish"?this.queue.push({packet:i,cb:r}):s>0?(r=this.outgoing[i.messageId]?this.outgoing[i.messageId].cb:null,this.outgoingStore.put(i,o=>{if(o)return r&&r(o);n()})):r&&r(new Error("No connection to broker"))}get serverProperties(){return this._serverProperties}get keepalive(){let e=this.connected?this._serverProperties?.serverKeepAlive:void 0;return e&&this.options.keepalive?e:this.options.keepalive}_setupKeepaliveManager(){this.log("_setupKeepaliveManager :: keepalive %d (seconds)",this.keepalive),!this.keepaliveManager&&this.keepalive&&(this.keepaliveManager=new EE.default(this,this.options.timerVariant))}_destroyKeepaliveManager(){this.keepaliveManager&&(this.log("_destroyKeepaliveManager :: destroying keepalive manager"),this.keepaliveManager.destroy(),this.keepaliveManager=null)}reschedulePing(e=!1){this.keepaliveManager&&this.keepalive&&(e||this.options.reschedulePings)&&this._reschedulePing()}_reschedulePing(){this.log("_reschedulePing :: rescheduling ping"),this.keepaliveManager.reschedule()}sendPing(){this.log("_sendPing :: sending pingreq"),this._sendPacket({cmd:"pingreq"})}onKeepaliveTimeout(){this.log("onKeepaliveTimeout :: calling _cleanUp with force true"),this._cleanUp(!0),this.emit("error",new Error("Keepalive timeout"))}_resubscribe(){this.log("_resubscribe");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 n={};n[e[r]]=this._resubscribeTopics[e[r]],n.resubscribe=!0,this.subscribe(n,{properties:n[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;let r=!this.options.clean&&(this.options.protocolVersion<4||e.sessionPresent===!0);r||this._discardIncomingQoS2State();let n=this.options.protocolVersion===5&&!this.options.clean&&!r;n&&this.log("_onConnect :: session not resumed, dropping sent messages from the outgoing store"),this.messageIdProvider.clear(),this.connected=!0,this._setupKeepaliveManager();let i=()=>{let s=this.outgoingStore.createStream(),o=()=>{s.destroy(),s=null,this._flushStoreProcessingQueue(),u()},u=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",o),s.on("error",f=>{u(),this._flushStoreProcessingQueue(),this.removeListener("close",o),this.emit("error",f)});let c=()=>{if(!s)return;let f=s.read(1),d;if(!f){s.once("readable",c);return}if(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[f.messageId]){c();return}let h=f.cmd==="publish"&&!f.dup;if(n&&!h){this._discardOutgoingSessionPacket(f,c);return}!this.disconnecting&&!this.reconnectTimer?(d=this.outgoing[f.messageId]?this.outgoing[f.messageId].cb:null,this.outgoing[f.messageId]={volatile:!1,cmd:f.cmd,cb(m,g){d&&d(m,g),c()}},this._packetIdsDuringStoreProcessing[f.messageId]=!0,this.messageIdProvider.register(f.messageId)?h?this._sendNeverSentPacket(f):this._sendPacket(f,void 0,void 0,!0):this.log("messageId: %d has already used.",f.messageId)):s.destroy&&s.destroy()};s.on("end",()=>{let f=!0;for(let d in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[d]){f=!1;break}this.removeListener("close",o),f?(u(),this._invokeAllStoreProcessingQueue(),this.emit("connect",e)):i()}),c()};i()}_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)}_sendNeverSentPacket(e){this.outgoingStore.put({...e,dup:!0},r=>{r&&this.log("_sendNeverSentPacket :: put error for messageId %d, sending anyway: %o",e.messageId,r),this._sendPacket(e,void 0,void 0,!0)})}_discardOutgoingSessionPacket(e,r){let{messageId:n}=e,i=this.outgoing[n];delete this.outgoing[n],this._packetIdsDuringStoreProcessing[n]=!0,this.log("_discardOutgoingSessionPacket :: session not resumed, dropping %s %d (topic %s, %s)",e.cmd,n,e.topic,i?"callback failed":"no pending callback"),this.outgoingStore.del({messageId:n},s=>{s&&this.log("_discardOutgoingSessionPacket :: del error for messageId %d: %o",n,s),i&&i.cb(new Error(e.cmd==="pubrel"?"Session lost (Session Present 0) before PUBCOMP: the delivery outcome of the QoS 2 message is unknown":"Session lost (Session Present 0): the message was sent but not acknowledged, and is not sent again")),(0,Nt.nextTick)(r)})}_removeOutgoingAndStoreMessage(e,r){delete this.outgoing[e],this.outgoingStore.del({messageId:e},(n,i)=>{r(n,i),this.messageIdProvider.deallocate(e),this._invokeStoreProcessingQueue()})}};lt.default=La});var sg=H(Da=>{"use strict";x();T();P();Object.defineProperty(Da,"__esModule",{value:!0});var xE=da(),qa=class{numberAllocator;lastId;constructor(){this.numberAllocator=new xE.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()}};Da.default=qa});function PE(){if(ag)return Ua;ag=!0;let t=2147483647,e=36,r=1,n=26,i=38,s=700,o=72,u=128,c="-",f=/^xn--/,d=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=e-r,I=Math.floor,S=String.fromCharCode;function b(W){throw new RangeError(m[W])}function _(W,G){let J=[],ee=W.length;for(;ee--;)J[ee]=G(W[ee]);return J}function w(W,G){let J=W.split("@"),ee="";J.length>1&&(ee=J[0]+"@",W=J[1]),W=W.replace(h,".");let z=W.split("."),V=_(z,G).join(".");return ee+V}function R(W){let G=[],J=0,ee=W.length;for(;J<ee;){let z=W.charCodeAt(J++);if(z>=55296&&z<=56319&&J<ee){let V=W.charCodeAt(J++);(V&64512)==56320?G.push(((z&1023)<<10)+(V&1023)+65536):(G.push(z),J--)}else G.push(z)}return G}let A=W=>String.fromCodePoint(...W),y=function(W){return W>=48&&W<58?26+(W-48):W>=65&&W<91?W-65:W>=97&&W<123?W-97:e},O=function(W,G){return W+22+75*(W<26)-((G!=0)<<5)},v=function(W,G,J){let ee=0;for(W=J?I(W/s):W>>1,W+=I(W/G);W>g*n>>1;ee+=e)W=I(W/g);return I(ee+(g+1)*W/(W+i))},B=function(W){let G=[],J=W.length,ee=0,z=u,V=o,te=W.lastIndexOf(c);te<0&&(te=0);for(let Y=0;Y<te;++Y)W.charCodeAt(Y)>=128&&b("not-basic"),G.push(W.charCodeAt(Y));for(let Y=te>0?te+1:0;Y<J;){let X=ee;for(let Z=1,ne=e;;ne+=e){Y>=J&&b("invalid-input");let de=y(W.charCodeAt(Y++));de>=e&&b("invalid-input"),de>I((t-ee)/Z)&&b("overflow"),ee+=de*Z;let me=ne<=V?r:ne>=V+n?n:ne-V;if(de<me)break;let ye=e-me;Z>I(t/ye)&&b("overflow"),Z*=ye}let ce=G.length+1;V=v(ee-X,ce,X==0),I(ee/ce)>t-z&&b("overflow"),z+=I(ee/ce),ee%=ce,G.splice(ee++,0,z)}return String.fromCodePoint(...G)},D=function(W){let G=[];W=R(W);let J=W.length,ee=u,z=0,V=o;for(let X of W)X<128&&G.push(S(X));let te=G.length,Y=te;for(te&&G.push(c);Y<J;){let X=t;for(let Z of W)Z>=ee&&Z<X&&(X=Z);let ce=Y+1;X-ee>I((t-z)/ce)&&b("overflow"),z+=(X-ee)*ce,ee=X;for(let Z of W)if(Z<ee&&++z>t&&b("overflow"),Z===ee){let ne=z;for(let de=e;;de+=e){let me=de<=V?r:de>=V+n?n:de-V;if(ne<me)break;let ye=ne-me,Ae=e-me;G.push(S(O(me+ye%Ae,0))),ne=I(ye/Ae)}G.push(S(O(ne,0))),V=v(z,ce,Y===te),z=0,++Y}++z,++ee}return G.join("")};return Ua={version:"2.3.1",ucs2:{decode:R,encode:A},decode:B,encode:D,toASCII:function(W){return w(W,function(G){return d.test(G)?"xn--"+D(G):G})},toUnicode:function(W){return w(W,function(G){return f.test(G)?B(G.slice(4).toLowerCase()):G})}},Ua}var Ua,ag,er,GL,QL,KL,YL,JL,XL,ug=je(()=>{x();T();P();Ua={},ag=!1;er=PE(),GL=er.decode,QL=er.encode,KL=er.toASCII,YL=er.toUnicode,JL=er.ucs2,XL=er.version});function TE(){return lg||(lg=!0,Fa=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,r);if(o.value!==i||o.enumerable!==!0)return!1}return!0}),Fa}function OE(){return cg||(cg=!0,ja=Error),ja}function RE(){return fg||(fg=!0,$a=EvalError),$a}function kE(){return dg||(dg=!0,Wa=RangeError),Wa}function CE(){return hg||(hg=!0,Va=ReferenceError),Va}function Rg(){return pg||(pg=!0,Ha=SyntaxError),Ha}function Zr(){return gg||(gg=!0,za=TypeError),za}function ME(){return yg||(yg=!0,Ga=URIError),Ga}function BE(){if(bg)return Qa;bg=!0;var t=typeof Symbol<"u"&&Symbol,e=TE();return Qa=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},Qa}function NE(){if(mg)return Ka;mg=!0;var t={__proto__:null,foo:{}},e=Object;return Ka=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof e)},Ka}function LE(){if(_g)return Ya;_g=!0;var t="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,r=Math.max,n="[object Function]",i=function(c,f){for(var d=[],h=0;h<c.length;h+=1)d[h]=c[h];for(var m=0;m<f.length;m+=1)d[m+c.length]=f[m];return d},s=function(c,f){for(var d=[],h=f,m=0;h<c.length;h+=1,m+=1)d[m]=c[h];return d},o=function(u,c){for(var f="",d=0;d<u.length;d+=1)f+=u[d],d+1<u.length&&(f+=c);return f};return Ya=function(c){var f=this;if(typeof f!="function"||e.apply(f)!==n)throw new TypeError(t+f);for(var d=s(arguments,1),h,m=function(){if(this instanceof h){var _=f.apply(this,i(d,arguments));return Object(_)===_?_:this}return f.apply(c,i(d,arguments))},g=r(0,f.length-d.length),I=[],S=0;S<g;S++)I[S]="$"+S;if(h=Function("binder","return function ("+o(I,",")+"){ return binder.apply(this,arguments); }")(m),f.prototype){var b=function(){};b.prototype=f.prototype,h.prototype=new b,b.prototype=null}return h},Ya}function su(){if(wg)return Ja;wg=!0;var t=LE();return Ja=Function.prototype.bind||t,Ja}function qE(){if(vg)return Xa;vg=!0;var t=Function.prototype.call,e=Object.prototype.hasOwnProperty,r=su();return Xa=r.call(t,e),Xa}function Sr(){if(Sg)return Za;Sg=!0;var t,e=OE(),r=RE(),n=kE(),i=CE(),s=Rg(),o=Zr(),u=ME(),c=Function,f=function(z){try{return c('"use strict"; return ('+z+").constructor;")()}catch{}},d=Object.getOwnPropertyDescriptor;if(d)try{d({},"")}catch{d=null}var h=function(){throw new o},m=d?(function(){try{return arguments.callee,h}catch{try{return d(arguments,"callee").get}catch{return h}}})():h,g=BE()(),I=NE()(),S=Object.getPrototypeOf||(I?function(z){return z.__proto__}:null),b={},_=typeof Uint8Array>"u"||!S?t:S(Uint8Array),w={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":g&&S?S([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":b,"%AsyncGenerator%":b,"%AsyncGeneratorFunction%":b,"%AsyncIteratorPrototype%":b,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":e,"%eval%":eval,"%EvalError%":r,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":c,"%GeneratorFunction%":b,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&S?S(S([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!g||!S?t:S(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":n,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!g||!S?t:S(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&S?S(""[Symbol.iterator]()):t,"%Symbol%":g?Symbol:t,"%SyntaxError%":s,"%ThrowTypeError%":m,"%TypedArray%":_,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet};if(S)try{null.error}catch(z){var R=S(S(z));w["%Error.prototype%"]=R}var A=function z(V){var te;if(V==="%AsyncFunction%")te=f("async function () {}");else if(V==="%GeneratorFunction%")te=f("function* () {}");else if(V==="%AsyncGeneratorFunction%")te=f("async function* () {}");else if(V==="%AsyncGenerator%"){var Y=z("%AsyncGeneratorFunction%");Y&&(te=Y.prototype)}else if(V==="%AsyncIteratorPrototype%"){var X=z("%AsyncGenerator%");X&&S&&(te=S(X.prototype))}return w[V]=te,te},y={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=su(),v=qE(),B=O.call(Function.call,Array.prototype.concat),D=O.call(Function.apply,Array.prototype.splice),q=O.call(Function.call,String.prototype.replace),K=O.call(Function.call,String.prototype.slice),U=O.call(Function.call,RegExp.prototype.exec),W=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,G=/\\(\\)?/g,J=function(V){var te=K(V,0,1),Y=K(V,-1);if(te==="%"&&Y!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(Y==="%"&&te!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var X=[];return q(V,W,function(ce,Z,ne,de){X[X.length]=ne?q(de,G,"$1"):Z||ce}),X},ee=function(V,te){var Y=V,X;if(v(y,Y)&&(X=y[Y],Y="%"+X[0]+"%"),v(w,Y)){var ce=w[Y];if(ce===b&&(ce=A(Y)),typeof ce>"u"&&!te)throw new o("intrinsic "+V+" exists, but is not available. Please file an issue!");return{alias:X,name:Y,value:ce}}throw new s("intrinsic "+V+" does not exist!")};return Za=function(V,te){if(typeof V!="string"||V.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof te!="boolean")throw new o('"allowMissing" argument must be a boolean');if(U(/^%?[^%]*%?$/,V)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Y=J(V),X=Y.length>0?Y[0]:"",ce=ee("%"+X+"%",te),Z=ce.name,ne=ce.value,de=!1,me=ce.alias;me&&(X=me[0],D(Y,B([0,1],me)));for(var ye=1,Ae=!0;ye<Y.length;ye+=1){var we=Y[ye],ve=K(we,0,1),Te=K(we,-1);if((ve==='"'||ve==="'"||ve==="`"||Te==='"'||Te==="'"||Te==="`")&&ve!==Te)throw new s("property names with quotes must have matching quotes");if((we==="constructor"||!Ae)&&(de=!0),X+="."+we,Z="%"+X+"%",v(w,Z))ne=w[Z];else if(ne!=null){if(!(we in ne)){if(!te)throw new o("base intrinsic for "+V+" exists, but the property is not available.");return}if(d&&ye+1>=Y.length){var xe=d(ne,we);Ae=!!xe,Ae&&"get"in xe&&!("originalValue"in xe.get)?ne=xe.get:ne=ne[we]}else Ae=v(ne,we),ne=ne[we];Ae&&!de&&(w[Z]=ne)}}return ne},Za}function au(){if(Eg)return eu;Eg=!0;var t=Sr(),e=t("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return eu=e,eu}function kg(){if(Ag)return tu;Ag=!0;var t=Sr(),e=t("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return tu=e,tu}function DE(){if(Ig)return ru;Ig=!0;var t=au(),e=Rg(),r=Zr(),n=kg();return ru=function(s,o,u){if(!s||typeof s!="object"&&typeof s!="function")throw new r("`obj` must be an object or a function`");if(typeof o!="string"&&typeof o!="symbol")throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new r("`loose`, if provided, must be a boolean");var c=arguments.length>3?arguments[3]:null,f=arguments.length>4?arguments[4]:null,d=arguments.length>5?arguments[5]:null,h=arguments.length>6?arguments[6]:!1,m=!!n&&n(s,o);if(t)t(s,o,{configurable:d===null&&m?m.configurable:!d,enumerable:c===null&&m?m.enumerable:!c,value:u,writable:f===null&&m?m.writable:!f});else if(h||!c&&!f&&!d)s[o]=u;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},ru}function UE(){if(xg)return nu;xg=!0;var t=au(),e=function(){return!!t};return e.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},nu=e,nu}function FE(){if(Pg)return iu;Pg=!0;var t=Sr(),e=DE(),r=UE()(),n=kg(),i=Zr(),s=t("%Math.floor%");return iu=function(u,c){if(typeof u!="function")throw new i("`fn` is not a function");if(typeof c!="number"||c<0||c>4294967295||s(c)!==c)throw new i("`length` must be a positive 32-bit integer");var f=arguments.length>2&&!!arguments[2],d=!0,h=!0;if("length"in u&&n){var m=n(u,"length");m&&!m.configurable&&(d=!1),m&&!m.writable&&(h=!1)}return(d||h||!f)&&(r?e(u,"length",c,!0,!0):e(u,"length",c)),u},iu}function jE(){if(Tg)return Yn;Tg=!0;var t=su(),e=Sr(),r=FE(),n=Zr(),i=e("%Function.prototype.apply%"),s=e("%Function.prototype.call%"),o=e("%Reflect.apply%",!0)||t.call(s,i),u=au(),c=e("%Math.max%");Yn=function(h){if(typeof h!="function")throw new n("a function is required");var m=o(t,s,arguments);return r(m,1+c(0,h.length-(arguments.length-1)),!0)};var f=function(){return o(t,i,arguments)};return u?u(Yn,"apply",{value:f}):Yn.apply=f,Yn}function Cg(){if(Og)return ou;Og=!0;var t=Sr(),e=jE(),r=e(t("String.prototype.indexOf"));return ou=function(i,s){var o=t(i,!!s);return typeof o=="function"&&r(i,".prototype.")>-1?e(o):o},ou}var Fa,lg,ja,cg,$a,fg,Wa,dg,Va,hg,Ha,pg,za,gg,Ga,yg,Qa,bg,Ka,mg,Ya,_g,Ja,wg,Xa,vg,Za,Sg,eu,Eg,tu,Ag,ru,Ig,nu,xg,iu,Pg,Yn,Tg,ou,Og,Mg=je(()=>{x();T();P();Fa={},lg=!1;ja={},cg=!1;$a={},fg=!1;Wa={},dg=!1;Va={},hg=!1;Ha={},pg=!1;za={},gg=!1;Ga={},yg=!1;Qa={},bg=!1;Ka={},mg=!1;Ya={},_g=!1;Ja={},wg=!1;Xa={},vg=!1;Za={},Sg=!1;eu={},Eg=!1;tu={},Ag=!1;ru={},Ig=!1;nu={},xg=!1;iu={},Pg=!1;Yn={},Tg=!1;ou={},Og=!1});function fu(t){throw new Error("Node.js process "+t+" is not supported by JSPM core outside of Node.js")}function $E(){!en||!Er||(en=!1,Er.length?Lt=Er.concat(Lt):fo=-1,Lt.length&&Bg())}function Bg(){if(!en){var t=setTimeout($E,0);en=!0;for(var e=Lt.length;e;){for(Er=Lt,Lt=[];++fo<e;)Er&&Er[fo].run();fo=-1,e=Lt.length}Er=null,en=!1,clearTimeout(t)}}function WE(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];Lt.push(new Ng(t,e)),Lt.length===1&&!en&&setTimeout(Bg,0)}function Ng(t,e){this.fun=t,this.array=e}function Fe(){}function s1(t){fu("_linkedBinding")}function c1(t){fu("dlopen")}function f1(){return[]}function d1(){return[]}function v1(t,e){if(!t)throw new Error(e||"assertion error")}function I1(){return!1}function $1(){return tr.now()/1e3}function cu(t){var e=Math.floor((Date.now()-tr.now())*.001),r=tr.now()*.001,n=Math.floor(r)+e,i=Math.floor(r%1*1e9);return t&&(n=n-t[0],i=i-t[1],i<0&&(n--,i+=lu)),[n,i]}function rr(){return hu}function eA(t){return[]}var Lt,en,Er,fo,VE,HE,zE,GE,QE,KE,YE,JE,XE,ZE,e1,t1,r1,n1,i1,o1,a1,u1,l1,h1,p1,du,g1,y1,b1,m1,_1,w1,S1,E1,A1,x1,P1,T1,O1,R1,k1,C1,M1,B1,N1,L1,q1,D1,U1,F1,j1,tr,uu,lu,W1,V1,H1,z1,G1,Q1,K1,Y1,J1,X1,Z1,hu,pu=je(()=>{x();T();P();Lt=[],en=!1,fo=-1;Ng.prototype.run=function(){this.fun.apply(null,this.array)};VE="browser",HE="x64",zE="browser",GE={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},QE=["/usr/bin/node"],KE=[],YE="v16.8.0",JE={},XE=function(t,e){console.warn((e?e+": ":"")+t)},ZE=function(t){fu("binding")},e1=function(t){return 0},t1=function(){return"/"},r1=function(t){},n1={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};i1=Fe,o1=[];a1={},u1=!1,l1={};h1=Fe,p1=Fe,du=function(){return{}},g1=du,y1=du,b1=Fe,m1=Fe,_1=Fe,w1={};S1={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},E1=Fe,A1=Fe;x1=Fe,P1=Fe,T1=Fe,O1=Fe,R1=Fe,k1=void 0,C1=void 0,M1=void 0,B1=Fe,N1=2,L1=1,q1="/bin/usr/node",D1=9229,U1="node",F1=[],j1=Fe,tr={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};tr.now===void 0&&(uu=Date.now(),tr.timing&&tr.timing.navigationStart&&(uu=tr.timing.navigationStart),tr.now=()=>Date.now()-uu);lu=1e9;cu.bigint=function(t){var e=cu(t);return typeof BigInt>"u"?e[0]*lu+e[1]:BigInt(e[0]*lu)+BigInt(e[1])};W1=10,V1={},H1=0;z1=rr,G1=rr,Q1=rr,K1=rr,Y1=rr,J1=Fe,X1=rr,Z1=rr;hu={version:YE,versions:JE,arch:HE,platform:zE,release:n1,_rawDebug:i1,moduleLoadList:o1,binding:ZE,_linkedBinding:s1,_events:V1,_eventsCount:H1,_maxListeners:W1,on:rr,addListener:z1,once:G1,off:Q1,removeListener:K1,removeAllListeners:Y1,emit:J1,prependListener:X1,prependOnceListener:Z1,listeners:eA,domain:a1,_exiting:u1,config:l1,dlopen:c1,uptime:$1,_getActiveRequests:f1,_getActiveHandles:d1,reallyExit:h1,_kill:p1,cpuUsage:du,resourceUsage:g1,memoryUsage:y1,kill:b1,exit:m1,openStdin:_1,allowedNodeEnvironmentFlags:w1,assert:v1,features:S1,_fatalExceptions:E1,setUncaughtExceptionCaptureCallback:A1,hasUncaughtExceptionCaptureCallback:I1,emitWarning:XE,nextTick:WE,_tickCallback:x1,_debugProcess:P1,_debugEnd:T1,_startProfilerIdleNotifier:O1,_stopProfilerIdleNotifier:R1,stdout:k1,stdin:M1,stderr:C1,abort:B1,umask:e1,chdir:r1,cwd:t1,env:GE,title:VE,argv:QE,execArgv:KE,pid:N1,ppid:L1,execPath:q1,debugPort:D1,hrtime:cu,argv0:U1,_preload_modules:F1,setSourceMapsEnabled:j1}});function tA(){if(Lg)return gu;Lg=!0;var t=hu;function e(s){if(typeof s!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(s))}function r(s,o){for(var u="",c=0,f=-1,d=0,h,m=0;m<=s.length;++m){if(m<s.length)h=s.charCodeAt(m);else{if(h===47)break;h=47}if(h===47){if(!(f===m-1||d===1))if(f!==m-1&&d===2){if(u.length<2||c!==2||u.charCodeAt(u.length-1)!==46||u.charCodeAt(u.length-2)!==46){if(u.length>2){var g=u.lastIndexOf("/");if(g!==u.length-1){g===-1?(u="",c=0):(u=u.slice(0,g),c=u.length-1-u.lastIndexOf("/")),f=m,d=0;continue}}else if(u.length===2||u.length===1){u="",c=0,f=m,d=0;continue}}o&&(u.length>0?u+="/..":u="..",c=2)}else u.length>0?u+="/"+s.slice(f+1,m):u=s.slice(f+1,m),c=m-f-1;f=m,d=0}else h===46&&d!==-1?++d:d=-1}return u}function n(s,o){var u=o.dir||o.root,c=o.base||(o.name||"")+(o.ext||"");return u?u===o.root?u+c:u+s+c:c}var i={resolve:function(){for(var o="",u=!1,c,f=arguments.length-1;f>=-1&&!u;f--){var d;f>=0?d=arguments[f]:(c===void 0&&(c=t.cwd()),d=c),e(d),d.length!==0&&(o=d+"/"+o,u=d.charCodeAt(0)===47)}return o=r(o,!u),u?o.length>0?"/"+o:"/":o.length>0?o:"."},normalize:function(o){if(e(o),o.length===0)return".";var u=o.charCodeAt(0)===47,c=o.charCodeAt(o.length-1)===47;return o=r(o,!u),o.length===0&&!u&&(o="."),o.length>0&&c&&(o+="/"),u?"/"+o:o},isAbsolute:function(o){return e(o),o.length>0&&o.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var o,u=0;u<arguments.length;++u){var c=arguments[u];e(c),c.length>0&&(o===void 0?o=c:o+="/"+c)}return o===void 0?".":i.normalize(o)},relative:function(o,u){if(e(o),e(u),o===u||(o=i.resolve(o),u=i.resolve(u),o===u))return"";for(var c=1;c<o.length&&o.charCodeAt(c)===47;++c);for(var f=o.length,d=f-c,h=1;h<u.length&&u.charCodeAt(h)===47;++h);for(var m=u.length,g=m-h,I=d<g?d:g,S=-1,b=0;b<=I;++b){if(b===I){if(g>I){if(u.charCodeAt(h+b)===47)return u.slice(h+b+1);if(b===0)return u.slice(h+b)}else d>I&&(o.charCodeAt(c+b)===47?S=b:b===0&&(S=0));break}var _=o.charCodeAt(c+b),w=u.charCodeAt(h+b);if(_!==w)break;_===47&&(S=b)}var R="";for(b=c+S+1;b<=f;++b)(b===f||o.charCodeAt(b)===47)&&(R.length===0?R+="..":R+="/..");return R.length>0?R+u.slice(h+S):(h+=S,u.charCodeAt(h)===47&&++h,u.slice(h))},_makeLong:function(o){return o},dirname:function(o){if(e(o),o.length===0)return".";for(var u=o.charCodeAt(0),c=u===47,f=-1,d=!0,h=o.length-1;h>=1;--h)if(u=o.charCodeAt(h),u===47){if(!d){f=h;break}}else d=!1;return f===-1?c?"/":".":c&&f===1?"//":o.slice(0,f)},basename:function(o,u){if(u!==void 0&&typeof u!="string")throw new TypeError('"ext" argument must be a string');e(o);var c=0,f=-1,d=!0,h;if(u!==void 0&&u.length>0&&u.length<=o.length){if(u.length===o.length&&u===o)return"";var m=u.length-1,g=-1;for(h=o.length-1;h>=0;--h){var I=o.charCodeAt(h);if(I===47){if(!d){c=h+1;break}}else g===-1&&(d=!1,g=h+1),m>=0&&(I===u.charCodeAt(m)?--m===-1&&(f=h):(m=-1,f=g))}return c===f?f=g:f===-1&&(f=o.length),o.slice(c,f)}else{for(h=o.length-1;h>=0;--h)if(o.charCodeAt(h)===47){if(!d){c=h+1;break}}else f===-1&&(d=!1,f=h+1);return f===-1?"":o.slice(c,f)}},extname:function(o){e(o);for(var u=-1,c=0,f=-1,d=!0,h=0,m=o.length-1;m>=0;--m){var g=o.charCodeAt(m);if(g===47){if(!d){c=m+1;break}continue}f===-1&&(d=!1,f=m+1),g===46?u===-1?u=m:h!==1&&(h=1):u!==-1&&(h=-1)}return u===-1||f===-1||h===0||h===1&&u===f-1&&u===c+1?"":o.slice(u,f)},format:function(o){if(o===null||typeof o!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof o);return n("/",o)},parse:function(o){e(o);var u={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return u;var c=o.charCodeAt(0),f=c===47,d;f?(u.root="/",d=1):d=0;for(var h=-1,m=0,g=-1,I=!0,S=o.length-1,b=0;S>=d;--S){if(c=o.charCodeAt(S),c===47){if(!I){m=S+1;break}continue}g===-1&&(I=!1,g=S+1),c===46?h===-1?h=S:b!==1&&(b=1):h!==-1&&(b=-1)}return h===-1||g===-1||b===0||b===1&&h===g-1&&h===m+1?g!==-1&&(m===0&&f?u.base=u.name=o.slice(1,g):u.base=u.name=o.slice(m,g)):(m===0&&f?(u.name=o.slice(1,h),u.base=o.slice(1,g)):(u.name=o.slice(m,h),u.base=o.slice(m,g)),u.ext=o.slice(h,g)),m>0?u.dir=o.slice(0,m-1):f&&(u.dir="/"),u},sep:"/",delimiter:":",win32:null,posix:null};return i.posix=i,gu=i,gu}var gu,Lg,yu,qg=je(()=>{x();T();P();pu();gu={},Lg=!1;yu=tA()});var Kg={};Tr(Kg,{URL:()=>gA,Url:()=>cA,default:()=>Ve,fileURLToPath:()=>Gg,format:()=>fA,parse:()=>pA,pathToFileURL:()=>Qg,resolve:()=>dA,resolveObject:()=>hA});function nA(){if(Dg)return bu;Dg=!0;var t=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&t?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=t&&e&&typeof e.get=="function"?e.get:null,n=t&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,s=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,o=i&&s&&typeof s.get=="function"?s.get:null,u=i&&Set.prototype.forEach,c=typeof WeakMap=="function"&&WeakMap.prototype,f=c?WeakMap.prototype.has:null,d=typeof WeakSet=="function"&&WeakSet.prototype,h=d?WeakSet.prototype.has:null,m=typeof WeakRef=="function"&&WeakRef.prototype,g=m?WeakRef.prototype.deref:null,I=Boolean.prototype.valueOf,S=Object.prototype.toString,b=Function.prototype.toString,_=String.prototype.match,w=String.prototype.slice,R=String.prototype.replace,A=String.prototype.toUpperCase,y=String.prototype.toLowerCase,O=RegExp.prototype.test,v=Array.prototype.concat,B=Array.prototype.join,D=Array.prototype.slice,q=Math.floor,K=typeof BigInt=="function"?BigInt.prototype.valueOf:null,U=Object.getOwnPropertySymbols,W=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,G=typeof Symbol=="function"&&typeof Symbol.iterator=="object",J=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===G||!0)?Symbol.toStringTag:null,ee=Object.prototype.propertyIsEnumerable,z=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(k){return k.__proto__}:null);function V(k,M){if(k===1/0||k===-1/0||k!==k||k&&k>-1e3&&k<1e3||O.call(/e/,M))return M;var re=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof k=="number"){var ie=k<0?-q(-k):q(k);if(ie!==k){var oe=String(ie),fe=w.call(M,oe.length+1);return R.call(oe,re,"$&_")+"."+R.call(R.call(fe,/([0-9]{3})/g,"$&_"),/_$/,"")}}return R.call(M,re,"$&_")}var te=rA,Y=te.custom,X=Te(Y)?Y:null;bu=function k(M,re,ie,oe){var fe=re||{};if(Oe(fe,"quoteStyle")&&fe.quoteStyle!=="single"&&fe.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Oe(fe,"maxStringLength")&&(typeof fe.maxStringLength=="number"?fe.maxStringLength<0&&fe.maxStringLength!==1/0:fe.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Ut=Oe(fe,"customInspect")?fe.customInspect:!0;if(typeof Ut!="boolean"&&Ut!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Oe(fe,"indent")&&fe.indent!==null&&fe.indent!==" "&&!(parseInt(fe.indent,10)===fe.indent&&fe.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Oe(fe,"numericSeparator")&&typeof fe.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var or=fe.numericSeparator;if(typeof M>"u")return"undefined";if(M===null)return"null";if(typeof M=="boolean")return M?"true":"false";if(typeof M=="string")return nt(M,fe);if(typeof M=="number"){if(M===0)return 1/0/M>0?"0":"-0";var Ge=String(M);return or?V(M,Ge):Ge}if(typeof M=="bigint"){var Ft=String(M)+"n";return or?V(M,Ft):Ft}var mo=typeof fe.depth>"u"?5:fe.depth;if(typeof ie>"u"&&(ie=0),ie>=mo&&mo>0&&typeof M=="object")return ne(M)?"[Array]":"[Object]";var xr=C(fe,ie);if(typeof oe>"u")oe=[];else if(wt(oe,M)>=0)return"[Circular]";function it(Pr,oi,my){if(oi&&(oe=D.call(oe),oe.push(oi)),my){var tl={depth:fe.depth};return Oe(fe,"quoteStyle")&&(tl.quoteStyle=fe.quoteStyle),k(Pr,tl,ie+1,oe)}return k(Pr,fe,ie+1,oe)}if(typeof M=="function"&&!me(M)){var Qu=_t(M),Ku=F(M,it);return"[Function"+(Qu?": "+Qu:" (anonymous)")+"]"+(Ku.length>0?" { "+B.call(Ku,", ")+" }":"")}if(Te(M)){var Yu=G?R.call(String(M),/^(Symbol\(.*\))_[^)]*$/,"$1"):W.call(M);return typeof M=="object"&&!G?p(Yu):Yu}if(yo(M)){for(var sn="<"+y.call(String(M.nodeName)),_o=M.attributes||[],ii=0;ii<_o.length;ii++)sn+=" "+_o[ii].name+"="+ce(Z(_o[ii].value),"double",fe);return sn+=">",M.childNodes&&M.childNodes.length&&(sn+="..."),sn+="</"+y.call(String(M.nodeName))+">",sn}if(ne(M)){if(M.length===0)return"[]";var wo=F(M,it);return xr&&!E(wo)?"["+N(wo,xr)+"]":"[ "+B.call(wo,", ")+" ]"}if(ye(M)){var vo=F(M,it);return!("cause"in Error.prototype)&&"cause"in M&&!ee.call(M,"cause")?"{ ["+String(M)+"] "+B.call(v.call("[cause]: "+it(M.cause),vo),", ")+" }":vo.length===0?"["+String(M)+"]":"{ ["+String(M)+"] "+B.call(vo,", ")+" }"}if(typeof M=="object"&&Ut){if(X&&typeof M[X]=="function"&&te)return te(M,{depth:mo-ie});if(Ut!=="symbol"&&typeof M.inspect=="function")return M.inspect()}if(nn(M)){var Ju=[];return n&&n.call(M,function(Pr,oi){Ju.push(it(oi,M,!0)+" => "+it(Pr,M))}),l("Map",r.call(M),Ju,xr)}if(Ye(M)){var Xu=[];return u&&u.call(M,function(Pr){Xu.push(it(Pr,M))}),l("Set",o.call(M),Xu,xr)}if(ni(M))return a("WeakMap");if(on(M))return a("WeakSet");if(Ir(M))return a("WeakRef");if(we(M))return p(it(Number(M)));if(xe(M))return p(it(K.call(M)));if(ve(M))return p(I.call(M));if(Ae(M))return p(it(String(M)));if(typeof window<"u"&&M===window)return"{ [object Window] }";if(typeof globalThis<"u"&&M===globalThis||typeof mu<"u"&&M===mu)return"{ [object globalThis] }";if(!de(M)&&!me(M)){var So=F(M,it),Zu=z?z(M)===Object.prototype:M instanceof Object||M.constructor===Object,Eo=M instanceof Object?"":"null prototype",el=!Zu&&J&&Object(M)===M&&J in M?w.call(Me(M),8,-1):Eo?"Object":"",by=Zu||typeof M.constructor!="function"?"":M.constructor.name?M.constructor.name+" ":"",Ao=by+(el||Eo?"["+B.call(v.call([],el||[],Eo||[]),": ")+"] ":"");return So.length===0?Ao+"{}":xr?Ao+"{"+N(So,xr)+"}":Ao+"{ "+B.call(So,", ")+" }"}return String(M)};function ce(k,M,re){var ie=(re.quoteStyle||M)==="double"?'"':"'";return ie+k+ie}function Z(k){return R.call(String(k),/"/g,"&quot;")}function ne(k){return Me(k)==="[object Array]"&&(!J||!(typeof k=="object"&&J in k))}function de(k){return Me(k)==="[object Date]"&&(!J||!(typeof k=="object"&&J in k))}function me(k){return Me(k)==="[object RegExp]"&&(!J||!(typeof k=="object"&&J in k))}function ye(k){return Me(k)==="[object Error]"&&(!J||!(typeof k=="object"&&J in k))}function Ae(k){return Me(k)==="[object String]"&&(!J||!(typeof k=="object"&&J in k))}function we(k){return Me(k)==="[object Number]"&&(!J||!(typeof k=="object"&&J in k))}function ve(k){return Me(k)==="[object Boolean]"&&(!J||!(typeof k=="object"&&J in k))}function Te(k){if(G)return k&&typeof k=="object"&&k instanceof Symbol;if(typeof k=="symbol")return!0;if(!k||typeof k!="object"||!W)return!1;try{return W.call(k),!0}catch{}return!1}function xe(k){if(!k||typeof k!="object"||!K)return!1;try{return K.call(k),!0}catch{}return!1}var rt=Object.prototype.hasOwnProperty||function(k){return k in(this||mu)};function Oe(k,M){return rt.call(k,M)}function Me(k){return S.call(k)}function _t(k){if(k.name)return k.name;var M=_.call(b.call(k),/^function\s*([\w$]+)/);return M?M[1]:null}function wt(k,M){if(k.indexOf)return k.indexOf(M);for(var re=0,ie=k.length;re<ie;re++)if(k[re]===M)return re;return-1}function nn(k){if(!r||!k||typeof k!="object")return!1;try{r.call(k);try{o.call(k)}catch{return!0}return k instanceof Map}catch{}return!1}function ni(k){if(!f||!k||typeof k!="object")return!1;try{f.call(k,f);try{h.call(k,h)}catch{return!0}return k instanceof WeakMap}catch{}return!1}function Ir(k){if(!g||!k||typeof k!="object")return!1;try{return g.call(k),!0}catch{}return!1}function Ye(k){if(!o||!k||typeof k!="object")return!1;try{o.call(k);try{r.call(k)}catch{return!0}return k instanceof Set}catch{}return!1}function on(k){if(!h||!k||typeof k!="object")return!1;try{h.call(k,h);try{f.call(k,f)}catch{return!0}return k instanceof WeakSet}catch{}return!1}function yo(k){return!k||typeof k!="object"?!1:typeof HTMLElement<"u"&&k instanceof HTMLElement?!0:typeof k.nodeName=="string"&&typeof k.getAttribute=="function"}function nt(k,M){if(k.length>M.maxStringLength){var re=k.length-M.maxStringLength,ie="... "+re+" more character"+(re>1?"s":"");return nt(w.call(k,0,M.maxStringLength),M)+ie}var oe=R.call(R.call(k,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,bo);return ce(oe,"single",M)}function bo(k){var M=k.charCodeAt(0),re={8:"b",9:"t",10:"n",12:"f",13:"r"}[M];return re?"\\"+re:"\\x"+(M<16?"0":"")+A.call(M.toString(16))}function p(k){return"Object("+k+")"}function a(k){return k+" { ? }"}function l(k,M,re,ie){var oe=ie?N(re,ie):B.call(re,", ");return k+" ("+M+") {"+oe+"}"}function E(k){for(var M=0;M<k.length;M++)if(wt(k[M],`
4
4
  `)>=0)return!1;return!0}function C(k,M){var re;if(k.indent===" ")re=" ";else if(typeof k.indent=="number"&&k.indent>0)re=B.call(Array(k.indent+1)," ");else return null;return{base:re,prev:B.call(Array(M+1),re)}}function N(k,M){if(k.length===0)return"";var re=`
5
5
  `+M.prev+M.base;return re+B.call(k,","+re)+`
6
- `+M.prev}function F(k,M){var re=ne(k),ie=[];if(re){ie.length=k.length;for(var oe=0;oe<k.length;oe++)ie[oe]=Oe(k,oe)?M(k[oe],k):""}var fe=typeof U=="function"?U(k):[],Lt;if(G){Lt={};for(var nr=0;nr<fe.length;nr++)Lt["$"+fe[nr]]=fe[nr]}for(var Qe in k)Oe(k,Qe)&&(re&&String(Number(Qe))===Qe&&Qe<k.length||G&&Lt["$"+Qe]instanceof Symbol||(O.call(/[^\w$]/,Qe)?ie.push(M(Qe,k)+": "+M(k[Qe],k)):ie.push(Qe+": "+M(k[Qe],k))));if(typeof U=="function")for(var qt=0;qt<fe.length;qt++)ee.call(k,fe[qt])&&ie.push("["+M(fe[qt])+"]: "+M(k[fe[qt]],k));return ie}return hu}function Y1(){if(Cg)return gu;Cg=!0;var t=vr(),e=Ig(),r=K1(),n=Xr(),i=t("%WeakMap%",!0),s=t("%Map%",!0),o=e("WeakMap.prototype.get",!0),u=e("WeakMap.prototype.set",!0),c=e("WeakMap.prototype.has",!0),f=e("Map.prototype.get",!0),d=e("Map.prototype.set",!0),h=e("Map.prototype.has",!0),_=function(b,m){for(var w=b,R;(R=w.next)!==null;w=R)if(R.key===m)return w.next=R.next,R.next=b.next,b.next=R,R},y=function(b,m){var w=_(b,m);return w&&w.value},I=function(b,m,w){var R=_(b,m);R?R.value=w:b.next={key:m,next:b.next,value:w}},S=function(b,m){return!!_(b,m)};return gu=function(){var m,w,R,A={assert:function(g){if(!A.has(g))throw new n("Side channel does not contain "+r(g))},get:function(g){if(i&&g&&(typeof g=="object"||typeof g=="function")){if(m)return o(m,g)}else if(s){if(w)return f(w,g)}else if(R)return y(R,g)},has:function(g){if(i&&g&&(typeof g=="object"||typeof g=="function")){if(m)return c(m,g)}else if(s){if(w)return h(w,g)}else if(R)return S(R,g);return!1},set:function(g,O){i&&g&&(typeof g=="object"||typeof g=="function")?(m||(m=new i),u(m,g,O)):s?(w||(w=new s),d(w,g,O)):(R||(R={key:{},next:null}),I(R,g,O))}};return A},gu}function Su(){if(Mg)return yu;Mg=!0;var t=String.prototype.replace,e=/%20/g,r={RFC1738:"RFC1738",RFC3986:"RFC3986"};return yu={default:r.RFC3986,formatters:{RFC1738:function(n){return t.call(n,e,"+")},RFC3986:function(n){return String(n)}},RFC1738:r.RFC1738,RFC3986:r.RFC3986},yu}function Ug(){if(Bg)return bu;Bg=!0;var t=Su(),e=Object.prototype.hasOwnProperty,r=Array.isArray,n=(function(){for(var b=[],m=0;m<256;++m)b.push("%"+((m<16?"0":"")+m.toString(16)).toUpperCase());return b})(),i=function(m){for(;m.length>1;){var w=m.pop(),R=w.obj[w.prop];if(r(R)){for(var A=[],g=0;g<R.length;++g)typeof R[g]<"u"&&A.push(R[g]);w.obj[w.prop]=A}}},s=function(m,w){for(var R=w&&w.plainObjects?Object.create(null):{},A=0;A<m.length;++A)typeof m[A]<"u"&&(R[A]=m[A]);return R},o=function b(m,w,R){if(!w)return m;if(typeof w!="object"){if(r(m))m.push(w);else if(m&&typeof m=="object")(R&&(R.plainObjects||R.allowPrototypes)||!e.call(Object.prototype,w))&&(m[w]=!0);else return[m,w];return m}if(!m||typeof m!="object")return[m].concat(w);var A=m;return r(m)&&!r(w)&&(A=s(m,R)),r(m)&&r(w)?(w.forEach(function(g,O){if(e.call(m,O)){var v=m[O];v&&typeof v=="object"&&g&&typeof g=="object"?m[O]=b(v,g,R):m.push(g)}else m[O]=g}),m):Object.keys(w).reduce(function(g,O){var v=w[O];return e.call(g,O)?g[O]=b(g[O],v,R):g[O]=v,g},A)},u=function(m,w){return Object.keys(w).reduce(function(R,A){return R[A]=w[A],R},m)},c=function(b,m,w){var R=b.replace(/\+/g," ");if(w==="iso-8859-1")return R.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(R)}catch{return R}},f=1024,d=function(m,w,R,A,g){if(m.length===0)return m;var O=m;if(typeof m=="symbol"?O=Symbol.prototype.toString.call(m):typeof m!="string"&&(O=String(m)),R==="iso-8859-1")return escape(O).replace(/%u[0-9a-f]{4}/gi,function($){return"%26%23"+parseInt($.slice(2),16)+"%3B"});for(var v="",B=0;B<O.length;B+=f){for(var D=O.length>=f?O.slice(B,B+f):O,q=[],K=0;K<D.length;++K){var U=D.charCodeAt(K);if(U===45||U===46||U===95||U===126||U>=48&&U<=57||U>=65&&U<=90||U>=97&&U<=122||g===t.RFC1738&&(U===40||U===41)){q[q.length]=D.charAt(K);continue}if(U<128){q[q.length]=n[U];continue}if(U<2048){q[q.length]=n[192|U>>6]+n[128|U&63];continue}if(U<55296||U>=57344){q[q.length]=n[224|U>>12]+n[128|U>>6&63]+n[128|U&63];continue}K+=1,U=65536+((U&1023)<<10|D.charCodeAt(K)&1023),q[q.length]=n[240|U>>18]+n[128|U>>12&63]+n[128|U>>6&63]+n[128|U&63]}v+=q.join("")}return v},h=function(m){for(var w=[{obj:{o:m},prop:"o"}],R=[],A=0;A<w.length;++A)for(var g=w[A],O=g.obj[g.prop],v=Object.keys(O),B=0;B<v.length;++B){var D=v[B],q=O[D];typeof q=="object"&&q!==null&&R.indexOf(q)===-1&&(w.push({obj:O,prop:D}),R.push(q))}return i(w),m},_=function(m){return Object.prototype.toString.call(m)==="[object RegExp]"},y=function(m){return!m||typeof m!="object"?!1:!!(m.constructor&&m.constructor.isBuffer&&m.constructor.isBuffer(m))},I=function(m,w){return[].concat(m,w)},S=function(m,w){if(r(m)){for(var R=[],A=0;A<m.length;A+=1)R.push(w(m[A]));return R}return w(m)};return bu={arrayToObject:s,assign:u,combine:I,compact:h,decode:c,encode:d,isBuffer:y,isRegExp:_,maybeMap:S,merge:o},bu}function J1(){if(Ng)return mu;Ng=!0;var t=Y1(),e=Ug(),r=Su(),n=Object.prototype.hasOwnProperty,i={brackets:function(b){return b+"[]"},comma:"comma",indices:function(b,m){return b+"["+m+"]"},repeat:function(b){return b}},s=Array.isArray,o=Array.prototype.push,u=function(S,b){o.apply(S,s(b)?b:[b])},c=Date.prototype.toISOString,f=r.default,d={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:e.encode,encodeValuesOnly:!1,format:f,formatter:r.formatters[f],indices:!1,serializeDate:function(b){return c.call(b)},skipNulls:!1,strictNullHandling:!1},h=function(b){return typeof b=="string"||typeof b=="number"||typeof b=="boolean"||typeof b=="symbol"||typeof b=="bigint"},_={},y=function S(b,m,w,R,A,g,O,v,B,D,q,K,U,$,G,J,ee,z){for(var W=b,te=z,Y=0,X=!1;(te=te.get(_))!==void 0&&!X;){var ce=te.get(b);if(Y+=1,typeof ce<"u"){if(ce===Y)throw new RangeError("Cyclic object value");X=!0}typeof te.get(_)>"u"&&(Y=0)}if(typeof D=="function"?W=D(m,W):W instanceof Date?W=U(W):w==="comma"&&s(W)&&(W=e.maybeMap(W,function(Be){return Be instanceof Date?U(Be):Be})),W===null){if(g)return B&&!J?B(m,d.encoder,ee,"key",$):m;W=""}if(h(W)||e.isBuffer(W)){if(B){var Z=J?m:B(m,d.encoder,ee,"key",$);return[G(Z)+"="+G(B(W,d.encoder,ee,"value",$))]}return[G(m)+"="+G(String(W))]}var ne=[];if(typeof W>"u")return ne;var de;if(w==="comma"&&s(W))J&&B&&(W=e.maybeMap(W,B)),de=[{value:W.length>0?W.join(",")||null:void 0}];else if(s(D))de=D;else{var me=Object.keys(W);de=q?me.sort(q):me}var ye=v?m.replace(/\./g,"%2E"):m,Ae=R&&s(W)&&W.length===1?ye+"[]":ye;if(A&&s(W)&&W.length===0)return Ae+"[]";for(var we=0;we<de.length;++we){var ve=de[we],Pe=typeof ve=="object"&&typeof ve.value<"u"?ve.value:W[ve];if(!(O&&Pe===null)){var xe=K&&v?ve.replace(/\./g,"%2E"):ve,nt=s(W)?typeof w=="function"?w(Ae,xe):Ae:Ae+(K?"."+xe:"["+xe+"]");z.set(b,Y);var Oe=t();Oe.set(_,z),u(ne,S(Pe,nt,w,R,A,g,O,v,w==="comma"&&J&&s(W)?null:B,D,q,K,U,$,G,J,ee,Oe))}}return ne},I=function(b){if(!b)return d;if(typeof b.allowEmptyArrays<"u"&&typeof b.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof b.encodeDotInKeys<"u"&&typeof b.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(b.encoder!==null&&typeof b.encoder<"u"&&typeof b.encoder!="function")throw new TypeError("Encoder has to be a function.");var m=b.charset||d.charset;if(typeof b.charset<"u"&&b.charset!=="utf-8"&&b.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var w=r.default;if(typeof b.format<"u"){if(!n.call(r.formatters,b.format))throw new TypeError("Unknown format option provided.");w=b.format}var R=r.formatters[w],A=d.filter;(typeof b.filter=="function"||s(b.filter))&&(A=b.filter);var g;if(b.arrayFormat in i?g=b.arrayFormat:"indices"in b?g=b.indices?"indices":"repeat":g=d.arrayFormat,"commaRoundTrip"in b&&typeof b.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var O=typeof b.allowDots>"u"?b.encodeDotInKeys===!0?!0:d.allowDots:!!b.allowDots;return{addQueryPrefix:typeof b.addQueryPrefix=="boolean"?b.addQueryPrefix:d.addQueryPrefix,allowDots:O,allowEmptyArrays:typeof b.allowEmptyArrays=="boolean"?!!b.allowEmptyArrays:d.allowEmptyArrays,arrayFormat:g,charset:m,charsetSentinel:typeof b.charsetSentinel=="boolean"?b.charsetSentinel:d.charsetSentinel,commaRoundTrip:b.commaRoundTrip,delimiter:typeof b.delimiter>"u"?d.delimiter:b.delimiter,encode:typeof b.encode=="boolean"?b.encode:d.encode,encodeDotInKeys:typeof b.encodeDotInKeys=="boolean"?b.encodeDotInKeys:d.encodeDotInKeys,encoder:typeof b.encoder=="function"?b.encoder:d.encoder,encodeValuesOnly:typeof b.encodeValuesOnly=="boolean"?b.encodeValuesOnly:d.encodeValuesOnly,filter:A,format:w,formatter:R,serializeDate:typeof b.serializeDate=="function"?b.serializeDate:d.serializeDate,skipNulls:typeof b.skipNulls=="boolean"?b.skipNulls:d.skipNulls,sort:typeof b.sort=="function"?b.sort:null,strictNullHandling:typeof b.strictNullHandling=="boolean"?b.strictNullHandling:d.strictNullHandling}};return mu=function(S,b){var m=S,w=I(b),R,A;typeof w.filter=="function"?(A=w.filter,m=A("",m)):s(w.filter)&&(A=w.filter,R=A);var g=[];if(typeof m!="object"||m===null)return"";var O=i[w.arrayFormat],v=O==="comma"&&w.commaRoundTrip;R||(R=Object.keys(m)),w.sort&&R.sort(w.sort);for(var B=t(),D=0;D<R.length;++D){var q=R[D];w.skipNulls&&m[q]===null||u(g,y(m[q],q,O,v,w.allowEmptyArrays,w.strictNullHandling,w.skipNulls,w.encodeDotInKeys,w.encode?w.encoder:null,w.filter,w.sort,w.allowDots,w.serializeDate,w.format,w.formatter,w.encodeValuesOnly,w.charset,B))}var K=g.join(w.delimiter),U=w.addQueryPrefix===!0?"?":"";return w.charsetSentinel&&(w.charset==="iso-8859-1"?U+="utf8=%26%2310003%3B&":U+="utf8=%E2%9C%93&"),K.length>0?U+K:""},mu}function X1(){if(Lg)return _u;Lg=!0;var t=Ug(),e=Object.prototype.hasOwnProperty,r=Array.isArray,n={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:t.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},i=function(_){return _.replace(/&#(\d+);/g,function(y,I){return String.fromCharCode(parseInt(I,10))})},s=function(_,y){return _&&typeof _=="string"&&y.comma&&_.indexOf(",")>-1?_.split(","):_},o="utf8=%26%2310003%3B",u="utf8=%E2%9C%93",c=function(y,I){var S={__proto__:null},b=I.ignoreQueryPrefix?y.replace(/^\?/,""):y;b=b.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var m=I.parameterLimit===1/0?void 0:I.parameterLimit,w=b.split(I.delimiter,m),R=-1,A,g=I.charset;if(I.charsetSentinel)for(A=0;A<w.length;++A)w[A].indexOf("utf8=")===0&&(w[A]===u?g="utf-8":w[A]===o&&(g="iso-8859-1"),R=A,A=w.length);for(A=0;A<w.length;++A)if(A!==R){var O=w[A],v=O.indexOf("]="),B=v===-1?O.indexOf("="):v+1,D,q;B===-1?(D=I.decoder(O,n.decoder,g,"key"),q=I.strictNullHandling?null:""):(D=I.decoder(O.slice(0,B),n.decoder,g,"key"),q=t.maybeMap(s(O.slice(B+1),I),function(U){return I.decoder(U,n.decoder,g,"value")})),q&&I.interpretNumericEntities&&g==="iso-8859-1"&&(q=i(q)),O.indexOf("[]=")>-1&&(q=r(q)?[q]:q);var K=e.call(S,D);K&&I.duplicates==="combine"?S[D]=t.combine(S[D],q):(!K||I.duplicates==="last")&&(S[D]=q)}return S},f=function(_,y,I,S){for(var b=S?y:s(y,I),m=_.length-1;m>=0;--m){var w,R=_[m];if(R==="[]"&&I.parseArrays)w=I.allowEmptyArrays&&(b===""||I.strictNullHandling&&b===null)?[]:[].concat(b);else{w=I.plainObjects?Object.create(null):{};var A=R.charAt(0)==="["&&R.charAt(R.length-1)==="]"?R.slice(1,-1):R,g=I.decodeDotInKeys?A.replace(/%2E/g,"."):A,O=parseInt(g,10);!I.parseArrays&&g===""?w={0:b}:!isNaN(O)&&R!==g&&String(O)===g&&O>=0&&I.parseArrays&&O<=I.arrayLimit?(w=[],w[O]=b):g!=="__proto__"&&(w[g]=b)}b=w}return b},d=function(y,I,S,b){if(y){var m=S.allowDots?y.replace(/\.([^.[]+)/g,"[$1]"):y,w=/(\[[^[\]]*])/,R=/(\[[^[\]]*])/g,A=S.depth>0&&w.exec(m),g=A?m.slice(0,A.index):m,O=[];if(g){if(!S.plainObjects&&e.call(Object.prototype,g)&&!S.allowPrototypes)return;O.push(g)}for(var v=0;S.depth>0&&(A=R.exec(m))!==null&&v<S.depth;){if(v+=1,!S.plainObjects&&e.call(Object.prototype,A[1].slice(1,-1))&&!S.allowPrototypes)return;O.push(A[1])}if(A){if(S.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+S.depth+" and strictDepth is true");O.push("["+m.slice(A.index)+"]")}return f(O,I,S,b)}},h=function(y){if(!y)return n;if(typeof y.allowEmptyArrays<"u"&&typeof y.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof y.decodeDotInKeys<"u"&&typeof y.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(y.decoder!==null&&typeof y.decoder<"u"&&typeof y.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof y.charset<"u"&&y.charset!=="utf-8"&&y.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var I=typeof y.charset>"u"?n.charset:y.charset,S=typeof y.duplicates>"u"?n.duplicates:y.duplicates;if(S!=="combine"&&S!=="first"&&S!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var b=typeof y.allowDots>"u"?y.decodeDotInKeys===!0?!0:n.allowDots:!!y.allowDots;return{allowDots:b,allowEmptyArrays:typeof y.allowEmptyArrays=="boolean"?!!y.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof y.allowPrototypes=="boolean"?y.allowPrototypes:n.allowPrototypes,allowSparse:typeof y.allowSparse=="boolean"?y.allowSparse:n.allowSparse,arrayLimit:typeof y.arrayLimit=="number"?y.arrayLimit:n.arrayLimit,charset:I,charsetSentinel:typeof y.charsetSentinel=="boolean"?y.charsetSentinel:n.charsetSentinel,comma:typeof y.comma=="boolean"?y.comma:n.comma,decodeDotInKeys:typeof y.decodeDotInKeys=="boolean"?y.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof y.decoder=="function"?y.decoder:n.decoder,delimiter:typeof y.delimiter=="string"||t.isRegExp(y.delimiter)?y.delimiter:n.delimiter,depth:typeof y.depth=="number"||y.depth===!1?+y.depth:n.depth,duplicates:S,ignoreQueryPrefix:y.ignoreQueryPrefix===!0,interpretNumericEntities:typeof y.interpretNumericEntities=="boolean"?y.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof y.parameterLimit=="number"?y.parameterLimit:n.parameterLimit,parseArrays:y.parseArrays!==!1,plainObjects:typeof y.plainObjects=="boolean"?y.plainObjects:n.plainObjects,strictDepth:typeof y.strictDepth=="boolean"?!!y.strictDepth:n.strictDepth,strictNullHandling:typeof y.strictNullHandling=="boolean"?y.strictNullHandling:n.strictNullHandling}};return _u=function(_,y){var I=h(y);if(_===""||_===null||typeof _>"u")return I.plainObjects?Object.create(null):{};for(var S=typeof _=="string"?c(_,I):_,b=I.plainObjects?Object.create(null):{},m=Object.keys(S),w=0;w<m.length;++w){var R=m[w],A=d(R,S[R],I,typeof _=="string");b=t.merge(b,A,I)}return I.allowSparse===!0?b:t.compact(b)},_u}function Z1(){if(qg)return wu;qg=!0;var t=J1(),e=X1(),r=Su();return wu={formats:r,parse:e,stringify:t},wu}function eA(){if(Dg)return Er;Dg=!0;var t=Xt;function e(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var r=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,s=["<",">",'"',"`"," ","\r",`
7
- `," "],o=["{","}","|","\\","^","`"].concat(s),u=["'"].concat(o),c=["%","/","?",";","#"].concat(u),f=["/","?","#"],d=255,h=/^[+a-z0-9A-Z_-]{0,63}$/,_=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,y={javascript:!0,"javascript:":!0},I={javascript:!0,"javascript:":!0},S={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=Z1();function m(g,O,v){if(g&&typeof g=="object"&&g instanceof e)return g;var B=new e;return B.parse(g,O,v),B}e.prototype.parse=function(g,O,v){if(typeof g!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof g);var B=g.indexOf("?"),D=B!==-1&&B<g.indexOf("#")?"?":"#",q=g.split(D),K=/\\/g;q[0]=q[0].replace(K,"/"),g=q.join(D);var U=g;if(U=U.trim(),!v&&g.split("#").length===1){var $=i.exec(U);if($)return this.path=U,this.href=U,this.pathname=$[1],$[2]?(this.search=$[2],O?this.query=b.parse(this.search.substr(1)):this.query=this.search.substr(1)):O&&(this.search="",this.query={}),this}var G=r.exec(U);if(G){G=G[0];var J=G.toLowerCase();this.protocol=J,U=U.substr(G.length)}if(v||G||U.match(/^\/\/[^@/]+@[^@/]+/)){var ee=U.substr(0,2)==="//";ee&&!(G&&I[G])&&(U=U.substr(2),this.slashes=!0)}if(!I[G]&&(ee||G&&!S[G])){for(var z=-1,W=0;W<f.length;W++){var te=U.indexOf(f[W]);te!==-1&&(z===-1||te<z)&&(z=te)}var Y,X;z===-1?X=U.lastIndexOf("@"):X=U.lastIndexOf("@",z),X!==-1&&(Y=U.slice(0,X),U=U.slice(X+1),this.auth=decodeURIComponent(Y)),z=-1;for(var W=0;W<c.length;W++){var te=U.indexOf(c[W]);te!==-1&&(z===-1||te<z)&&(z=te)}z===-1&&(z=U.length),this.host=U.slice(0,z),U=U.slice(z),this.parseHost(),this.hostname=this.hostname||"";var ce=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!ce)for(var Z=this.hostname.split(/\./),W=0,ne=Z.length;W<ne;W++){var de=Z[W];if(de&&!de.match(h)){for(var me="",ye=0,Ae=de.length;ye<Ae;ye++)de.charCodeAt(ye)>127?me+="x":me+=de[ye];if(!me.match(h)){var we=Z.slice(0,W),ve=Z.slice(W+1),Pe=de.match(_);Pe&&(we.push(Pe[1]),ve.unshift(Pe[2])),ve.length&&(U="/"+ve.join(".")+U),this.hostname=we.join(".");break}}}this.hostname.length>d?this.hostname="":this.hostname=this.hostname.toLowerCase(),ce||(this.hostname=t.toASCII(this.hostname));var xe=this.port?":"+this.port:"",nt=this.hostname||"";this.host=nt+xe,this.href+=this.host,ce&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),U[0]!=="/"&&(U="/"+U))}if(!y[J])for(var W=0,ne=u.length;W<ne;W++){var Oe=u[W];if(U.indexOf(Oe)!==-1){var Be=encodeURIComponent(Oe);Be===Oe&&(Be=escape(Oe)),U=U.split(Oe).join(Be)}}var _t=U.indexOf("#");_t!==-1&&(this.hash=U.substr(_t),U=U.slice(0,_t));var wt=U.indexOf("?");if(wt!==-1?(this.search=U.substr(wt),this.query=U.substr(wt+1),O&&(this.query=b.parse(this.query)),U=U.slice(0,wt)):O&&(this.search="",this.query={}),U&&(this.pathname=U),S[J]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var xe=this.pathname||"",rn=this.search||"";this.path=xe+rn}return this.href=this.format(),this};function w(g){return typeof g=="string"&&(g=m(g)),g instanceof e?g.format():e.prototype.format.call(g)}e.prototype.format=function(){var g=this.auth||"";g&&(g=encodeURIComponent(g),g=g.replace(/%3A/i,":"),g+="@");var O=this.protocol||"",v=this.pathname||"",B=this.hash||"",D=!1,q="";this.host?D=g+this.host:this.hostname&&(D=g+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(D+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(q=b.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var K=this.search||q&&"?"+q||"";return O&&O.substr(-1)!==":"&&(O+=":"),this.slashes||(!O||S[O])&&D!==!1?(D="//"+(D||""),v&&v.charAt(0)!=="/"&&(v="/"+v)):D||(D=""),B&&B.charAt(0)!=="#"&&(B="#"+B),K&&K.charAt(0)!=="?"&&(K="?"+K),v=v.replace(/[?#]/g,function(U){return encodeURIComponent(U)}),K=K.replace("#","%23"),O+D+v+K+B};function R(g,O){return m(g,!1,!0).resolve(O)}e.prototype.resolve=function(g){return this.resolveObject(m(g,!1,!0)).format()};function A(g,O){return g?m(g,!1,!0).resolveObject(O):O}return e.prototype.resolveObject=function(g){if(typeof g=="string"){var O=new e;O.parse(g,!1,!0),g=O}for(var v=new e,B=Object.keys(this),D=0;D<B.length;D++){var q=B[D];v[q]=this[q]}if(v.hash=g.hash,g.href==="")return v.href=v.format(),v;if(g.slashes&&!g.protocol){for(var K=Object.keys(g),U=0;U<K.length;U++){var $=K[U];$!=="protocol"&&(v[$]=g[$])}return S[v.protocol]&&v.hostname&&!v.pathname&&(v.pathname="/",v.path=v.pathname),v.href=v.format(),v}if(g.protocol&&g.protocol!==v.protocol){if(!S[g.protocol]){for(var G=Object.keys(g),J=0;J<G.length;J++){var ee=G[J];v[ee]=g[ee]}return v.href=v.format(),v}if(v.protocol=g.protocol,!g.host&&!I[g.protocol]){for(var ne=(g.pathname||"").split("/");ne.length&&!(g.host=ne.shift()););g.host||(g.host=""),g.hostname||(g.hostname=""),ne[0]!==""&&ne.unshift(""),ne.length<2&&ne.unshift(""),v.pathname=ne.join("/")}else v.pathname=g.pathname;if(v.search=g.search,v.query=g.query,v.host=g.host||"",v.auth=g.auth,v.hostname=g.hostname||g.host,v.port=g.port,v.pathname||v.search){var z=v.pathname||"",W=v.search||"";v.path=z+W}return v.slashes=v.slashes||g.slashes,v.href=v.format(),v}var te=v.pathname&&v.pathname.charAt(0)==="/",Y=g.host||g.pathname&&g.pathname.charAt(0)==="/",X=Y||te||v.host&&g.pathname,ce=X,Z=v.pathname&&v.pathname.split("/")||[],ne=g.pathname&&g.pathname.split("/")||[],de=v.protocol&&!S[v.protocol];if(de&&(v.hostname="",v.port=null,v.host&&(Z[0]===""?Z[0]=v.host:Z.unshift(v.host)),v.host="",g.protocol&&(g.hostname=null,g.port=null,g.host&&(ne[0]===""?ne[0]=g.host:ne.unshift(g.host)),g.host=null),X=X&&(ne[0]===""||Z[0]==="")),Y)v.host=g.host||g.host===""?g.host:v.host,v.hostname=g.hostname||g.hostname===""?g.hostname:v.hostname,v.search=g.search,v.query=g.query,Z=ne;else if(ne.length)Z||(Z=[]),Z.pop(),Z=Z.concat(ne),v.search=g.search,v.query=g.query;else if(g.search!=null){if(de){v.host=Z.shift(),v.hostname=v.host;var me=v.host&&v.host.indexOf("@")>0?v.host.split("@"):!1;me&&(v.auth=me.shift(),v.hostname=me.shift(),v.host=v.hostname)}return v.search=g.search,v.query=g.query,(v.pathname!==null||v.search!==null)&&(v.path=(v.pathname?v.pathname:"")+(v.search?v.search:"")),v.href=v.format(),v}if(!Z.length)return v.pathname=null,v.search?v.path="/"+v.search:v.path=null,v.href=v.format(),v;for(var ye=Z.slice(-1)[0],Ae=(v.host||g.host||Z.length>1)&&(ye==="."||ye==="..")||ye==="",we=0,ve=Z.length;ve>=0;ve--)ye=Z[ve],ye==="."?Z.splice(ve,1):ye===".."?(Z.splice(ve,1),we++):we&&(Z.splice(ve,1),we--);if(!X&&!ce)for(;we--;we)Z.unshift("..");X&&Z[0]!==""&&(!Z[0]||Z[0].charAt(0)!=="/")&&Z.unshift(""),Ae&&Z.join("/").substr(-1)!=="/"&&Z.push("");var Pe=Z[0]===""||Z[0]&&Z[0].charAt(0)==="/";if(de){v.hostname=Pe?"":Z.length?Z.shift():"",v.host=v.hostname;var me=v.host&&v.host.indexOf("@")>0?v.host.split("@"):!1;me&&(v.auth=me.shift(),v.hostname=me.shift(),v.host=v.hostname)}return X=X||v.host&&Z.length,X&&!Pe&&Z.unshift(""),Z.length>0?v.pathname=Z.join("/"):(v.pathname=null,v.path=null),(v.pathname!==null||v.search!==null)&&(v.path=(v.pathname?v.pathname:"")+(v.search?v.search:"")),v.auth=g.auth||v.auth,v.slashes=v.slashes||g.slashes,v.href=v.format(),v},e.prototype.parseHost=function(){var g=this.host,O=n.exec(g);O&&(O=O[0],O!==":"&&(this.port=O.substr(1)),g=g.substr(0,g.length-O.length)),g&&(this.hostname=g)},Er.parse=m,Er.resolve=R,Er.resolveObject=A,Er.format=w,Er.Url=e,Er}function Fg(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?mA(t):_A(t)}function mA(t){let e=t.hostname,r=t.pathname;for(let n=0;n<r.length;n++)if(r[n]==="%"){let i=r.codePointAt(n+2)||32;if(r[n+1]==="2"&&i===102||r[n+1]==="5"&&i===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(r=r.replace(dA,"\\"),r=decodeURIComponent(r),e!=="")return`\\\\${e}${r}`;{let n=r.codePointAt(1)|32,i=r[2];if(n<cA||n>fA||i!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return r.slice(1)}}function _A(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 n=e.codePointAt(r+2)||32;if(e[r+1]==="2"&&n===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(e)}function jg(t){let e=du.resolve(t),r=t.charCodeAt(t.length-1);(r===lA||vu&&r===uA)&&e[e.length-1]!==du.sep&&(e+="/");let n=new URL("file://");return e.includes("%")&&(e=e.replace(hA,"%25")),!vu&&e.includes("\\")&&(e=e.replace(pA,"%5C")),e.includes(`
8
- `)&&(e=e.replace(gA,"%0A")),e.includes("\r")&&(e=e.replace(yA,"%0D")),e.includes(" ")&&(e=e.replace(bA,"%09")),n.pathname=e,n}var Q1,hu,kg,pu,gu,Cg,yu,Mg,bu,Bg,mu,Ng,_u,Lg,wu,qg,Er,Dg,He,tA,rA,nA,iA,oA,sA,aA,uA,lA,cA,fA,vu,dA,hA,pA,gA,yA,bA,Wg=$e(()=>{x();P();T();tg();xg();Rg();cu();Q1=Object.freeze(Object.create(null)),hu={},kg=!1,pu=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;gu={},Cg=!1;yu={},Mg=!1;bu={},Bg=!1;mu={},Ng=!1;_u={},Lg=!1;wu={},qg=!1;Er={},Dg=!1;He=eA();He.parse;He.resolve;He.resolveObject;He.format;He.Url;tA=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;He.URL=typeof URL<"u"?URL:null;He.pathToFileURL=jg;He.fileURLToPath=Fg;rA=He.Url,nA=He.format,iA=He.resolve,oA=He.resolveObject,sA=He.parse,aA=He.URL,uA=92,lA=47,cA=97,fA=122,vu=tA==="win32",dA=/\//g,hA=/%/g,pA=/\\/g,gA=/\n/g,yA=/\r/g,bA=/\t/g});var Hg=H((Pq,Vg)=>{"use strict";x();P();T();Vg.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}});var lo=H(Yn=>{"use strict";x();P();T();Object.defineProperty(Yn,"__esModule",{value:!0});Yn.BufferedDuplex=void 0;Yn.writev=Gg;var wA=Ht(),zg=(Re(),ge(Ne));function Gg(t,e){let r=new Array(t.length);for(let n=0;n<t.length;n++)typeof t[n].chunk=="string"?r[n]=zg.Buffer.from(t[n].chunk,"utf8"):r[n]=t[n].chunk;this._write(zg.Buffer.concat(r),"binary",e)}var Eu=class extends wA.Duplex{socket;proxy;isSocketOpen;writeQueue;constructor(e,r,n){super({objectMode:!0}),this.proxy=r,this.socket=n,this.writeQueue=[],e.objectMode||(this._writev=Gg.bind(this)),this.isSocketOpen=!1,this.proxy.on("data",i=>{!this.destroyed&&this.readable&&this.push(i)})}_read(e){this.proxy.read(e)}_write(e,r,n){this.isSocketOpen?this.writeToProxy(e,r,n):this.writeQueue.push({chunk:e,encoding:r,cb:n})}_final(e){this.writeQueue=[],this.proxy.end(e)}_destroy(e,r){this.writeQueue=[],this.proxy.destroy(),r(e)}socketReady(){this.emit("connect"),this.isSocketOpen=!0,this.processWriteQueue()}writeToProxy(e,r,n){this.proxy.write(e,r)===!1?this.proxy.once("drain",n):n()}processWriteQueue(){for(;this.writeQueue.length>0;){let{chunk:e,encoding:r,cb:n}=this.writeQueue.shift();this.writeToProxy(e,r,n)}}};Yn.BufferedDuplex=Eu});var Jn=H(rr=>{"use strict";x();P();T();var Iu=rr&&rr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(rr,"__esModule",{value:!0});rr.streamBuilder=rr.browserStreamBuilder=void 0;var co=(Re(),ge(Ne)),Qg=Iu(Hg()),vA=Iu(Gt()),SA=Ht(),EA=Iu(Gn()),Au=lo(),tr=(0,vA.default)("mqttjs:ws"),AA=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function Kg(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 Yg(t){let e=t;return t.port||(t.protocol==="wss"?e.port=443:e.port=80),t.path||(e.path="/"),t.wsOptions||(e.wsOptions={}),!EA.default&&!t.forceNativeWebSocket&&t.protocol==="wss"&&AA.forEach(r=>{Object.prototype.hasOwnProperty.call(t,r)&&!Object.prototype.hasOwnProperty.call(t.wsOptions,r)&&(e.wsOptions[r]=t[r])}),e}function IA(t){let e=Yg(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 xA(t,e,r){tr("createWebSocket"),tr(`protocol: ${r.protocolId} ${r.protocolVersion}`);let n=r.protocolId==="MQIsdp"&&r.protocolVersion===3?"mqttv3.1":"mqtt";tr(`creating new Websocket for url: ${e} and protocol: ${n}`);let i;return r.createWebsocket?i=r.createWebsocket(e,[n],r):i=new Qg.default(e,[n],r.wsOptions),i}function TA(t,e){let r=e.protocolId==="MQIsdp"&&e.protocolVersion===3?"mqttv3.1":"mqtt",n=Kg(e,t),i;return e.createWebsocket?i=e.createWebsocket(n,[r],e):i=new WebSocket(n,[r]),i.binaryType="arraybuffer",i}var PA=(t,e)=>{tr("streamBuilder");let r=Yg(e);r.hostname=r.hostname||r.host||"localhost";let n=Kg(r,t),i=xA(t,n,r),s=Qg.default.createWebSocketStream(i,r.wsOptions);return s.url=n,i.on("close",()=>{s.destroy()}),s};rr.streamBuilder=PA;var OA=(t,e)=>{tr("browserStreamBuilder");let r,i=IA(e).browserBufferSize||1024*512,s=e.browserBufferTimeout||1e3,o=!e.objectMode,u=TA(t,e),c=d(e,S,b);e.objectMode||(c._writev=Au.writev.bind(c)),c.on("close",()=>{u.close()});let f=typeof u.addEventListener<"u";u.readyState===u.OPEN?(r=c,r.socket=u):(r=new Au.BufferedDuplex(e,c,u),f?u.addEventListener("open",h):u.onopen=h),f?(u.addEventListener("close",_),u.addEventListener("error",y),u.addEventListener("message",I)):(u.onclose=_,u.onerror=y,u.onmessage=I);function d(m,w,R){let A=new SA.Transform({objectMode:m.objectMode});return A._write=w,A._flush=R,A}function h(){tr("WebSocket onOpen"),r instanceof Au.BufferedDuplex&&r.socketReady()}function _(m){tr("WebSocket onClose",m),r.end(),r.destroy()}function y(m){tr("WebSocket onError",m);let w=new Error("WebSocket error");w.event=m,r.destroy(w)}async function I(m){if(!c||!c.readable||!c.writable)return;let{data:w}=m;w instanceof ArrayBuffer?w=co.Buffer.from(w):w instanceof Blob?w=co.Buffer.from(await new Response(w).arrayBuffer()):w=co.Buffer.from(w,"utf8"),c.push(w)}function S(m,w,R){if(u.bufferedAmount>i){setTimeout(S,s,m,w,R);return}o&&typeof m=="string"&&(m=co.Buffer.from(m,"utf8"));try{u.send(m)}catch(A){return R(A)}R()}function b(m){u.close(),m()}return r};rr.browserStreamBuilder=OA});var xu={};Tr(xu,{Server:()=>Ke,Socket:()=>Ke,Stream:()=>Ke,_createServerHandle:()=>Ke,_normalizeArgs:()=>Ke,_setSimultaneousAccepts:()=>Ke,connect:()=>Ke,createConnection:()=>Ke,createServer:()=>Ke,default:()=>RA,isIP:()=>Ke,isIPv4:()=>Ke,isIPv6:()=>Ke});function Ke(){throw new Error("Node.js net module is not supported by JSPM core outside of Node.js")}var RA,Tu=$e(()=>{x();P();T();RA={_createServerHandle:Ke,_normalizeArgs:Ke,_setSimultaneousAccepts:Ke,connect:Ke,createConnection:Ke,createServer:Ke,isIP:Ke,isIPv4:Ke,isIPv6:Ke,Server:Ke,Socket:Ke,Stream:Ke}});var Pu=H((tD,Jg)=>{x();P();T();Jg.exports={}});var Ru=H(Xn=>{"use strict";x();P();T();var Ou=Xn&&Xn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Xn,"__esModule",{value:!0});var kA=Ou((Tu(),ge(xu))),CA=Ou(Gt()),MA=Ou(Pu()),BA=(0,CA.default)("mqttjs:tcp"),NA=(t,e)=>{if(e.port=e.port||1883,e.hostname=e.hostname||e.host||"localhost",e.socksProxy)return(0,MA.default)(e.hostname,e.port,e.socksProxy,{timeout:e.socksTimeout});let{port:r,path:n}=e,i=e.hostname;return BA("port %d and host %s",r,i),kA.default.createConnection({port:r,host:i,path:n})};Xn.default=NA});var Xg={};Tr(Xg,{default:()=>LA});var LA,Zg=$e(()=>{x();P();T();LA={}});var Cu=H(Zn=>{"use strict";x();P();T();var ku=Zn&&Zn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Zn,"__esModule",{value:!0});var ey=(Zg(),ge(Xg)),qA=ku((Tu(),ge(xu))),DA=ku(Gt()),UA=ku(Pu()),FA=(0,DA.default)("mqttjs:tls");function jA(t){let{host:e,port:r,socksProxy:n,...i}=t;if(n!==void 0){let s=(0,UA.default)(e,r,n,{timeout:t.socksTimeout});return(0,ey.connect)({...i,socket:s})}return(0,ey.connect)(t)}var $A=(t,e)=>{e.port=e.port||8883,e.host=e.hostname||e.host||"localhost",qA.default.isIP(e.host)===0&&!e.servername&&(e.servername=e.host),e.rejectUnauthorized=e.rejectUnauthorized!==!1,delete e.path,FA("port %d host %s rejectUnauthorized %b",e.port,e.host,e.rejectUnauthorized);let r=jA(e);r.on("secureConnect",()=>{e.rejectUnauthorized&&!r.authorized?r.emit("error",new Error("TLS not authorized")):r.removeListener("error",n)});function n(i){e.rejectUnauthorized&&t.emit("error",i),r.end()}return r.on("error",n),r};Zn.default=$A});var Nu=H(Bu=>{"use strict";x();P();T();Object.defineProperty(Bu,"__esModule",{value:!0});var ty=(Re(),ge(Ne)),WA=Ht(),VA=lo(),mt,Mu,Ye;function HA(){let t=new WA.Transform;return t._write=(e,r,n)=>{mt.send({data:e.buffer,success(){n()},fail(i){n(new Error(i))}})},t._flush=e=>{mt.close({success(){e()}})},t}function zA(t){t.hostname||(t.hostname="localhost"),t.path||(t.path="/"),t.wsOptions||(t.wsOptions={})}function GA(t,e){let r=t.protocol==="wxs"?"wss":"ws",n=`${r}://${t.hostname}${t.path}`;return t.port&&t.port!==80&&t.port!==443&&(n=`${r}://${t.hostname}:${t.port}${t.path}`),typeof t.transformWsUrl=="function"&&(n=t.transformWsUrl(n,t,e)),n}function QA(){mt.onOpen(()=>{Ye.socketReady()}),mt.onMessage(t=>{let{data:e}=t;e instanceof ArrayBuffer?e=ty.Buffer.from(e):e=ty.Buffer.from(e,"utf8"),Mu.push(e)}),mt.onClose(()=>{Ye.emit("close"),Ye.end(),Ye.destroy()}),mt.onError(t=>{let e=new Error(t.errMsg);Ye.destroy(e)})}var KA=(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";zA(e);let n=GA(e,t);mt=wx.connectSocket({url:n,protocols:[r]}),Mu=HA(),Ye=new VA.BufferedDuplex(e,Mu,mt),Ye._destroy=(s,o)=>{mt.close({success(){o&&o(s)}})};let i=Ye.destroy;return Ye.destroy=(s,o)=>(Ye.destroy=i,setTimeout(()=>{mt.close({fail(){Ye._destroy(s,o)}})},0),Ye),QA(),Ye};Bu.default=KA});var Du=H(qu=>{"use strict";x();P();T();Object.defineProperty(qu,"__esModule",{value:!0});var Lu=(Re(),ge(Ne)),YA=Ht(),JA=lo(),Nt,ei,en,ry=!1;function XA(){let t=new YA.Transform;return t._write=(e,r,n)=>{Nt.sendSocketMessage({data:e.buffer,success(){n()},fail(){n(new Error)}})},t._flush=e=>{Nt.closeSocket({success(){e()}})},t}function ZA(t){t.hostname||(t.hostname="localhost"),t.path||(t.path="/"),t.wsOptions||(t.wsOptions={})}function eI(t,e){let r=t.protocol==="alis"?"wss":"ws",n=`${r}://${t.hostname}${t.path}`;return t.port&&t.port!==80&&t.port!==443&&(n=`${r}://${t.hostname}:${t.port}${t.path}`),typeof t.transformWsUrl=="function"&&(n=t.transformWsUrl(n,t,e)),n}function tI(){ry||(ry=!0,Nt.onSocketOpen(()=>{en.socketReady()}),Nt.onSocketMessage(t=>{if(typeof t.data=="string"){let e=Lu.Buffer.from(t.data,"base64");ei.push(e)}else{let e=new FileReader;e.addEventListener("load",()=>{if(e.result instanceof ArrayBuffer){ei.push(Lu.Buffer.from(e.result));return}ei.push(Lu.Buffer.from(e.result,"utf-8"))}),e.readAsArrayBuffer(t.data)}}),Nt.onSocketClose(()=>{en.end(),en.destroy()}),Nt.onSocketError(t=>{en.destroy(t)}))}var rI=(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";ZA(e);let n=eI(e,t);return Nt=e.my,Nt.connectSocket({url:n,protocols:r}),ei=XA(),en=new JA.BufferedDuplex(e,ei,Nt),tI(),en};qu.default=rI});var oy=H(tn=>{"use strict";x();P();T();var fo=tn&&tn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(tn,"__esModule",{value:!0});tn.connectAsync=uI;var nI=fo(Gt()),iI=fo((Wg(),ge($g))),oI=fo(ao()),Uu=fo(Gn());typeof L?.nextTick!="function"&&(L.nextTick=setImmediate);var ny=(0,nI.default)("mqttjs"),Me=null;function sI(){return typeof location<"u"?location.protocol==="https:"?"wss":"ws":typeof document<"u"&&new URL(document.URL).protocol==="https:"?"wss":"ws"}function aI(t){let e;if(t.auth)if(e=t.auth.match(/^(.+):(.+)$/),e){let[,r,n]=e;t.username=r,t.password=n}else t.username=t.auth}function iy(t,e){if(ny("connecting to an MQTT broker..."),typeof t=="object"&&!e&&(e=t,t=""),e=e||{},t&&typeof t=="string"){let i=iI.default.parse(t,!0),s={},o=!i.protocol&&!i.hostname&&i.path?.startsWith("/")&&(Uu.default||e.forceNativeWebSocket);if(i.port!=null&&(s.port=Number(i.port)),s.host=i.hostname,s.query=i.query,s.auth=i.auth,s.protocol=i.protocol,s.path=i.path,e={...s,...e},!e.protocol&&!o)throw new Error("Missing protocol");e.protocol=(e.protocol||sI()).replace(/:$/,"")}if(e.unixSocket=e.unixSocket||e.protocol?.includes("+unix"),e.unixSocket?e.protocol=e.protocol.replace("+unix",""):!e.protocol?.startsWith("ws")&&!e.protocol?.startsWith("wx")&&delete e.path,aI(e),e.query&&typeof e.query.clientId=="string"&&(e.clientId=e.query.clientId),Uu.default||e.unixSocket?e.socksProxy=void 0:e.socksProxy===void 0&&typeof L<"u"&&(e.socksProxy=L.env.MQTTJS_SOCKS_PROXY),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||(Me={},!Uu.default&&!e.forceNativeWebSocket?(Me.ws=Jn().streamBuilder,Me.wss=Jn().streamBuilder,Me.mqtt=Ru().default,Me.tcp=Ru().default,Me.ssl=Cu().default,Me.tls=Me.ssl,Me.mqtts=Cu().default):(Me.ws=Jn().browserStreamBuilder,Me.wss=Jn().browserStreamBuilder,Me.wx=Nu().default,Me.wxs=Nu().default,Me.ali=Du().default,Me.alis=Du().default)),!Me[e.protocol]){let i=["mqtts","wss"].indexOf(e.protocol)!==-1;e.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((s,o)=>i&&o%2===0?!1:typeof Me[s]=="function")[0]}if(e.clean===!1&&!e.clientId)throw new Error("Missing clientId for unclean clients");e.protocol&&(e.defaultProtocol=e.protocol);function r(i){return e.servers&&((!i._reconnectCount||i._reconnectCount===e.servers.length)&&(i._reconnectCount=0),e.host=e.servers[i._reconnectCount].host,e.port=e.servers[i._reconnectCount].port,e.protocol=e.servers[i._reconnectCount].protocol?e.servers[i._reconnectCount].protocol:e.defaultProtocol,e.hostname=e.host,i._reconnectCount++),ny("calling streambuilder for",e.protocol),Me[e.protocol](i,e)}let n=new oI.default(r,e);return n.on("error",()=>{}),n}function uI(t,e,r=!0){return new Promise((n,i)=>{let s=iy(t,e),o={connect:c=>{u(),n(s)},end:()=>{u(),n(s)},error:c=>{u(),s.end(),i(c)}};r===!1&&(o.close=()=>{o.error(new Error("Couldn't connect to server"))});function u(){Object.keys(o).forEach(c=>{s.off(c,o[c])})}Object.keys(o).forEach(c=>{s.on(c,o[c])})})}tn.default=iy});var ju=H(be=>{"use strict";x();P();T();var sy=be&&be.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),lI=be&&be.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),cI=be&&be.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&sy(r,e,n[i]);return lI(r,e),r}})(),Fu=be&&be.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&sy(e,t,r)},ti=be&&be.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(be,"__esModule",{value:!0});be.ReasonCodes=be.KeepaliveManager=be.UniqueMessageIdProvider=be.DefaultMessageIdProvider=be.Store=be.MqttClient=be.connectAsync=be.connect=be.Client=void 0;var ay=ti(ao());be.MqttClient=ay.default;var fI=ti(pa());be.DefaultMessageIdProvider=fI.default;var dI=ti(Zp());be.UniqueMessageIdProvider=dI.default;var hI=ti(Zs());be.Store=hI.default;var uy=cI(oy());be.connect=uy.default;Object.defineProperty(be,"connectAsync",{enumerable:!0,get:function(){return uy.connectAsync}});var pI=ti(Oa());be.KeepaliveManager=pI.default;be.Client=ay.default;Fu(ao(),be);Fu(Pt(),be);Fu(Ys(),be);var gI=xn();Object.defineProperty(be,"ReasonCodes",{enumerable:!0,get:function(){return gI.ReasonCodes}})});var wI=H(rt=>{x();P();T();var ly=rt&&rt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),yI=rt&&rt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),bI=rt&&rt.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&ly(r,e,n[i]);return yI(r,e),r}})(),mI=rt&&rt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ly(e,t,r)};Object.defineProperty(rt,"__esModule",{value:!0});var _I=bI(ju());rt.default=_I;mI(ju(),rt)});return wI();})();
6
+ `+M.prev}function F(k,M){var re=ne(k),ie=[];if(re){ie.length=k.length;for(var oe=0;oe<k.length;oe++)ie[oe]=Oe(k,oe)?M(k[oe],k):""}var fe=typeof U=="function"?U(k):[],Ut;if(G){Ut={};for(var or=0;or<fe.length;or++)Ut["$"+fe[or]]=fe[or]}for(var Ge in k)Oe(k,Ge)&&(re&&String(Number(Ge))===Ge&&Ge<k.length||G&&Ut["$"+Ge]instanceof Symbol||(O.call(/[^\w$]/,Ge)?ie.push(M(Ge,k)+": "+M(k[Ge],k)):ie.push(Ge+": "+M(k[Ge],k))));if(typeof U=="function")for(var Ft=0;Ft<fe.length;Ft++)ee.call(k,fe[Ft])&&ie.push("["+M(fe[Ft])+"]: "+M(k[fe[Ft]],k));return ie}return bu}function iA(){if(Ug)return _u;Ug=!0;var t=Sr(),e=Cg(),r=nA(),n=Zr(),i=t("%WeakMap%",!0),s=t("%Map%",!0),o=e("WeakMap.prototype.get",!0),u=e("WeakMap.prototype.set",!0),c=e("WeakMap.prototype.has",!0),f=e("Map.prototype.get",!0),d=e("Map.prototype.set",!0),h=e("Map.prototype.has",!0),m=function(b,_){for(var w=b,R;(R=w.next)!==null;w=R)if(R.key===_)return w.next=R.next,R.next=b.next,b.next=R,R},g=function(b,_){var w=m(b,_);return w&&w.value},I=function(b,_,w){var R=m(b,_);R?R.value=w:b.next={key:_,next:b.next,value:w}},S=function(b,_){return!!m(b,_)};return _u=function(){var _,w,R,A={assert:function(y){if(!A.has(y))throw new n("Side channel does not contain "+r(y))},get:function(y){if(i&&y&&(typeof y=="object"||typeof y=="function")){if(_)return o(_,y)}else if(s){if(w)return f(w,y)}else if(R)return g(R,y)},has:function(y){if(i&&y&&(typeof y=="object"||typeof y=="function")){if(_)return c(_,y)}else if(s){if(w)return h(w,y)}else if(R)return S(R,y);return!1},set:function(y,O){i&&y&&(typeof y=="object"||typeof y=="function")?(_||(_=new i),u(_,y,O)):s?(w||(w=new s),d(w,y,O)):(R||(R={key:{},next:null}),I(R,y,O))}};return A},_u}function xu(){if(Fg)return wu;Fg=!0;var t=String.prototype.replace,e=/%20/g,r={RFC1738:"RFC1738",RFC3986:"RFC3986"};return wu={default:r.RFC3986,formatters:{RFC1738:function(n){return t.call(n,e,"+")},RFC3986:function(n){return String(n)}},RFC1738:r.RFC1738,RFC3986:r.RFC3986},wu}function zg(){if(jg)return vu;jg=!0;var t=xu(),e=Object.prototype.hasOwnProperty,r=Array.isArray,n=(function(){for(var b=[],_=0;_<256;++_)b.push("%"+((_<16?"0":"")+_.toString(16)).toUpperCase());return b})(),i=function(_){for(;_.length>1;){var w=_.pop(),R=w.obj[w.prop];if(r(R)){for(var A=[],y=0;y<R.length;++y)typeof R[y]<"u"&&A.push(R[y]);w.obj[w.prop]=A}}},s=function(_,w){for(var R=w&&w.plainObjects?Object.create(null):{},A=0;A<_.length;++A)typeof _[A]<"u"&&(R[A]=_[A]);return R},o=function b(_,w,R){if(!w)return _;if(typeof w!="object"){if(r(_))_.push(w);else if(_&&typeof _=="object")(R&&(R.plainObjects||R.allowPrototypes)||!e.call(Object.prototype,w))&&(_[w]=!0);else return[_,w];return _}if(!_||typeof _!="object")return[_].concat(w);var A=_;return r(_)&&!r(w)&&(A=s(_,R)),r(_)&&r(w)?(w.forEach(function(y,O){if(e.call(_,O)){var v=_[O];v&&typeof v=="object"&&y&&typeof y=="object"?_[O]=b(v,y,R):_.push(y)}else _[O]=y}),_):Object.keys(w).reduce(function(y,O){var v=w[O];return e.call(y,O)?y[O]=b(y[O],v,R):y[O]=v,y},A)},u=function(_,w){return Object.keys(w).reduce(function(R,A){return R[A]=w[A],R},_)},c=function(b,_,w){var R=b.replace(/\+/g," ");if(w==="iso-8859-1")return R.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(R)}catch{return R}},f=1024,d=function(_,w,R,A,y){if(_.length===0)return _;var O=_;if(typeof _=="symbol"?O=Symbol.prototype.toString.call(_):typeof _!="string"&&(O=String(_)),R==="iso-8859-1")return escape(O).replace(/%u[0-9a-f]{4}/gi,function(W){return"%26%23"+parseInt(W.slice(2),16)+"%3B"});for(var v="",B=0;B<O.length;B+=f){for(var D=O.length>=f?O.slice(B,B+f):O,q=[],K=0;K<D.length;++K){var U=D.charCodeAt(K);if(U===45||U===46||U===95||U===126||U>=48&&U<=57||U>=65&&U<=90||U>=97&&U<=122||y===t.RFC1738&&(U===40||U===41)){q[q.length]=D.charAt(K);continue}if(U<128){q[q.length]=n[U];continue}if(U<2048){q[q.length]=n[192|U>>6]+n[128|U&63];continue}if(U<55296||U>=57344){q[q.length]=n[224|U>>12]+n[128|U>>6&63]+n[128|U&63];continue}K+=1,U=65536+((U&1023)<<10|D.charCodeAt(K)&1023),q[q.length]=n[240|U>>18]+n[128|U>>12&63]+n[128|U>>6&63]+n[128|U&63]}v+=q.join("")}return v},h=function(_){for(var w=[{obj:{o:_},prop:"o"}],R=[],A=0;A<w.length;++A)for(var y=w[A],O=y.obj[y.prop],v=Object.keys(O),B=0;B<v.length;++B){var D=v[B],q=O[D];typeof q=="object"&&q!==null&&R.indexOf(q)===-1&&(w.push({obj:O,prop:D}),R.push(q))}return i(w),_},m=function(_){return Object.prototype.toString.call(_)==="[object RegExp]"},g=function(_){return!_||typeof _!="object"?!1:!!(_.constructor&&_.constructor.isBuffer&&_.constructor.isBuffer(_))},I=function(_,w){return[].concat(_,w)},S=function(_,w){if(r(_)){for(var R=[],A=0;A<_.length;A+=1)R.push(w(_[A]));return R}return w(_)};return vu={arrayToObject:s,assign:u,combine:I,compact:h,decode:c,encode:d,isBuffer:g,isRegExp:m,maybeMap:S,merge:o},vu}function oA(){if($g)return Su;$g=!0;var t=iA(),e=zg(),r=xu(),n=Object.prototype.hasOwnProperty,i={brackets:function(b){return b+"[]"},comma:"comma",indices:function(b,_){return b+"["+_+"]"},repeat:function(b){return b}},s=Array.isArray,o=Array.prototype.push,u=function(S,b){o.apply(S,s(b)?b:[b])},c=Date.prototype.toISOString,f=r.default,d={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:e.encode,encodeValuesOnly:!1,format:f,formatter:r.formatters[f],indices:!1,serializeDate:function(b){return c.call(b)},skipNulls:!1,strictNullHandling:!1},h=function(b){return typeof b=="string"||typeof b=="number"||typeof b=="boolean"||typeof b=="symbol"||typeof b=="bigint"},m={},g=function S(b,_,w,R,A,y,O,v,B,D,q,K,U,W,G,J,ee,z){for(var V=b,te=z,Y=0,X=!1;(te=te.get(m))!==void 0&&!X;){var ce=te.get(b);if(Y+=1,typeof ce<"u"){if(ce===Y)throw new RangeError("Cyclic object value");X=!0}typeof te.get(m)>"u"&&(Y=0)}if(typeof D=="function"?V=D(_,V):V instanceof Date?V=U(V):w==="comma"&&s(V)&&(V=e.maybeMap(V,function(Me){return Me instanceof Date?U(Me):Me})),V===null){if(y)return B&&!J?B(_,d.encoder,ee,"key",W):_;V=""}if(h(V)||e.isBuffer(V)){if(B){var Z=J?_:B(_,d.encoder,ee,"key",W);return[G(Z)+"="+G(B(V,d.encoder,ee,"value",W))]}return[G(_)+"="+G(String(V))]}var ne=[];if(typeof V>"u")return ne;var de;if(w==="comma"&&s(V))J&&B&&(V=e.maybeMap(V,B)),de=[{value:V.length>0?V.join(",")||null:void 0}];else if(s(D))de=D;else{var me=Object.keys(V);de=q?me.sort(q):me}var ye=v?_.replace(/\./g,"%2E"):_,Ae=R&&s(V)&&V.length===1?ye+"[]":ye;if(A&&s(V)&&V.length===0)return Ae+"[]";for(var we=0;we<de.length;++we){var ve=de[we],Te=typeof ve=="object"&&typeof ve.value<"u"?ve.value:V[ve];if(!(O&&Te===null)){var xe=K&&v?ve.replace(/\./g,"%2E"):ve,rt=s(V)?typeof w=="function"?w(Ae,xe):Ae:Ae+(K?"."+xe:"["+xe+"]");z.set(b,Y);var Oe=t();Oe.set(m,z),u(ne,S(Te,rt,w,R,A,y,O,v,w==="comma"&&J&&s(V)?null:B,D,q,K,U,W,G,J,ee,Oe))}}return ne},I=function(b){if(!b)return d;if(typeof b.allowEmptyArrays<"u"&&typeof b.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof b.encodeDotInKeys<"u"&&typeof b.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(b.encoder!==null&&typeof b.encoder<"u"&&typeof b.encoder!="function")throw new TypeError("Encoder has to be a function.");var _=b.charset||d.charset;if(typeof b.charset<"u"&&b.charset!=="utf-8"&&b.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var w=r.default;if(typeof b.format<"u"){if(!n.call(r.formatters,b.format))throw new TypeError("Unknown format option provided.");w=b.format}var R=r.formatters[w],A=d.filter;(typeof b.filter=="function"||s(b.filter))&&(A=b.filter);var y;if(b.arrayFormat in i?y=b.arrayFormat:"indices"in b?y=b.indices?"indices":"repeat":y=d.arrayFormat,"commaRoundTrip"in b&&typeof b.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var O=typeof b.allowDots>"u"?b.encodeDotInKeys===!0?!0:d.allowDots:!!b.allowDots;return{addQueryPrefix:typeof b.addQueryPrefix=="boolean"?b.addQueryPrefix:d.addQueryPrefix,allowDots:O,allowEmptyArrays:typeof b.allowEmptyArrays=="boolean"?!!b.allowEmptyArrays:d.allowEmptyArrays,arrayFormat:y,charset:_,charsetSentinel:typeof b.charsetSentinel=="boolean"?b.charsetSentinel:d.charsetSentinel,commaRoundTrip:b.commaRoundTrip,delimiter:typeof b.delimiter>"u"?d.delimiter:b.delimiter,encode:typeof b.encode=="boolean"?b.encode:d.encode,encodeDotInKeys:typeof b.encodeDotInKeys=="boolean"?b.encodeDotInKeys:d.encodeDotInKeys,encoder:typeof b.encoder=="function"?b.encoder:d.encoder,encodeValuesOnly:typeof b.encodeValuesOnly=="boolean"?b.encodeValuesOnly:d.encodeValuesOnly,filter:A,format:w,formatter:R,serializeDate:typeof b.serializeDate=="function"?b.serializeDate:d.serializeDate,skipNulls:typeof b.skipNulls=="boolean"?b.skipNulls:d.skipNulls,sort:typeof b.sort=="function"?b.sort:null,strictNullHandling:typeof b.strictNullHandling=="boolean"?b.strictNullHandling:d.strictNullHandling}};return Su=function(S,b){var _=S,w=I(b),R,A;typeof w.filter=="function"?(A=w.filter,_=A("",_)):s(w.filter)&&(A=w.filter,R=A);var y=[];if(typeof _!="object"||_===null)return"";var O=i[w.arrayFormat],v=O==="comma"&&w.commaRoundTrip;R||(R=Object.keys(_)),w.sort&&R.sort(w.sort);for(var B=t(),D=0;D<R.length;++D){var q=R[D];w.skipNulls&&_[q]===null||u(y,g(_[q],q,O,v,w.allowEmptyArrays,w.strictNullHandling,w.skipNulls,w.encodeDotInKeys,w.encode?w.encoder:null,w.filter,w.sort,w.allowDots,w.serializeDate,w.format,w.formatter,w.encodeValuesOnly,w.charset,B))}var K=y.join(w.delimiter),U=w.addQueryPrefix===!0?"?":"";return w.charsetSentinel&&(w.charset==="iso-8859-1"?U+="utf8=%26%2310003%3B&":U+="utf8=%E2%9C%93&"),K.length>0?U+K:""},Su}function sA(){if(Wg)return Eu;Wg=!0;var t=zg(),e=Object.prototype.hasOwnProperty,r=Array.isArray,n={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:t.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},i=function(m){return m.replace(/&#(\d+);/g,function(g,I){return String.fromCharCode(parseInt(I,10))})},s=function(m,g){return m&&typeof m=="string"&&g.comma&&m.indexOf(",")>-1?m.split(","):m},o="utf8=%26%2310003%3B",u="utf8=%E2%9C%93",c=function(g,I){var S={__proto__:null},b=I.ignoreQueryPrefix?g.replace(/^\?/,""):g;b=b.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var _=I.parameterLimit===1/0?void 0:I.parameterLimit,w=b.split(I.delimiter,_),R=-1,A,y=I.charset;if(I.charsetSentinel)for(A=0;A<w.length;++A)w[A].indexOf("utf8=")===0&&(w[A]===u?y="utf-8":w[A]===o&&(y="iso-8859-1"),R=A,A=w.length);for(A=0;A<w.length;++A)if(A!==R){var O=w[A],v=O.indexOf("]="),B=v===-1?O.indexOf("="):v+1,D,q;B===-1?(D=I.decoder(O,n.decoder,y,"key"),q=I.strictNullHandling?null:""):(D=I.decoder(O.slice(0,B),n.decoder,y,"key"),q=t.maybeMap(s(O.slice(B+1),I),function(U){return I.decoder(U,n.decoder,y,"value")})),q&&I.interpretNumericEntities&&y==="iso-8859-1"&&(q=i(q)),O.indexOf("[]=")>-1&&(q=r(q)?[q]:q);var K=e.call(S,D);K&&I.duplicates==="combine"?S[D]=t.combine(S[D],q):(!K||I.duplicates==="last")&&(S[D]=q)}return S},f=function(m,g,I,S){for(var b=S?g:s(g,I),_=m.length-1;_>=0;--_){var w,R=m[_];if(R==="[]"&&I.parseArrays)w=I.allowEmptyArrays&&(b===""||I.strictNullHandling&&b===null)?[]:[].concat(b);else{w=I.plainObjects?Object.create(null):{};var A=R.charAt(0)==="["&&R.charAt(R.length-1)==="]"?R.slice(1,-1):R,y=I.decodeDotInKeys?A.replace(/%2E/g,"."):A,O=parseInt(y,10);!I.parseArrays&&y===""?w={0:b}:!isNaN(O)&&R!==y&&String(O)===y&&O>=0&&I.parseArrays&&O<=I.arrayLimit?(w=[],w[O]=b):y!=="__proto__"&&(w[y]=b)}b=w}return b},d=function(g,I,S,b){if(g){var _=S.allowDots?g.replace(/\.([^.[]+)/g,"[$1]"):g,w=/(\[[^[\]]*])/,R=/(\[[^[\]]*])/g,A=S.depth>0&&w.exec(_),y=A?_.slice(0,A.index):_,O=[];if(y){if(!S.plainObjects&&e.call(Object.prototype,y)&&!S.allowPrototypes)return;O.push(y)}for(var v=0;S.depth>0&&(A=R.exec(_))!==null&&v<S.depth;){if(v+=1,!S.plainObjects&&e.call(Object.prototype,A[1].slice(1,-1))&&!S.allowPrototypes)return;O.push(A[1])}if(A){if(S.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+S.depth+" and strictDepth is true");O.push("["+_.slice(A.index)+"]")}return f(O,I,S,b)}},h=function(g){if(!g)return n;if(typeof g.allowEmptyArrays<"u"&&typeof g.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof g.decodeDotInKeys<"u"&&typeof g.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(g.decoder!==null&&typeof g.decoder<"u"&&typeof g.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof g.charset<"u"&&g.charset!=="utf-8"&&g.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var I=typeof g.charset>"u"?n.charset:g.charset,S=typeof g.duplicates>"u"?n.duplicates:g.duplicates;if(S!=="combine"&&S!=="first"&&S!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var b=typeof g.allowDots>"u"?g.decodeDotInKeys===!0?!0:n.allowDots:!!g.allowDots;return{allowDots:b,allowEmptyArrays:typeof g.allowEmptyArrays=="boolean"?!!g.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof g.allowPrototypes=="boolean"?g.allowPrototypes:n.allowPrototypes,allowSparse:typeof g.allowSparse=="boolean"?g.allowSparse:n.allowSparse,arrayLimit:typeof g.arrayLimit=="number"?g.arrayLimit:n.arrayLimit,charset:I,charsetSentinel:typeof g.charsetSentinel=="boolean"?g.charsetSentinel:n.charsetSentinel,comma:typeof g.comma=="boolean"?g.comma:n.comma,decodeDotInKeys:typeof g.decodeDotInKeys=="boolean"?g.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof g.decoder=="function"?g.decoder:n.decoder,delimiter:typeof g.delimiter=="string"||t.isRegExp(g.delimiter)?g.delimiter:n.delimiter,depth:typeof g.depth=="number"||g.depth===!1?+g.depth:n.depth,duplicates:S,ignoreQueryPrefix:g.ignoreQueryPrefix===!0,interpretNumericEntities:typeof g.interpretNumericEntities=="boolean"?g.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof g.parameterLimit=="number"?g.parameterLimit:n.parameterLimit,parseArrays:g.parseArrays!==!1,plainObjects:typeof g.plainObjects=="boolean"?g.plainObjects:n.plainObjects,strictDepth:typeof g.strictDepth=="boolean"?!!g.strictDepth:n.strictDepth,strictNullHandling:typeof g.strictNullHandling=="boolean"?g.strictNullHandling:n.strictNullHandling}};return Eu=function(m,g){var I=h(g);if(m===""||m===null||typeof m>"u")return I.plainObjects?Object.create(null):{};for(var S=typeof m=="string"?c(m,I):m,b=I.plainObjects?Object.create(null):{},_=Object.keys(S),w=0;w<_.length;++w){var R=_[w],A=d(R,S[R],I,typeof m=="string");b=t.merge(b,A,I)}return I.allowSparse===!0?b:t.compact(b)},Eu}function aA(){if(Vg)return Au;Vg=!0;var t=oA(),e=sA(),r=xu();return Au={formats:r,parse:e,stringify:t},Au}function uA(){if(Hg)return Ar;Hg=!0;var t=er;function e(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var r=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,s=["<",">",'"',"`"," ","\r",`
7
+ `," "],o=["{","}","|","\\","^","`"].concat(s),u=["'"].concat(o),c=["%","/","?",";","#"].concat(u),f=["/","?","#"],d=255,h=/^[+a-z0-9A-Z_-]{0,63}$/,m=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},I={javascript:!0,"javascript:":!0},S={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=aA();function _(y,O,v){if(y&&typeof y=="object"&&y instanceof e)return y;var B=new e;return B.parse(y,O,v),B}e.prototype.parse=function(y,O,v){if(typeof y!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof y);var B=y.indexOf("?"),D=B!==-1&&B<y.indexOf("#")?"?":"#",q=y.split(D),K=/\\/g;q[0]=q[0].replace(K,"/"),y=q.join(D);var U=y;if(U=U.trim(),!v&&y.split("#").length===1){var W=i.exec(U);if(W)return this.path=U,this.href=U,this.pathname=W[1],W[2]?(this.search=W[2],O?this.query=b.parse(this.search.substr(1)):this.query=this.search.substr(1)):O&&(this.search="",this.query={}),this}var G=r.exec(U);if(G){G=G[0];var J=G.toLowerCase();this.protocol=J,U=U.substr(G.length)}if(v||G||U.match(/^\/\/[^@/]+@[^@/]+/)){var ee=U.substr(0,2)==="//";ee&&!(G&&I[G])&&(U=U.substr(2),this.slashes=!0)}if(!I[G]&&(ee||G&&!S[G])){for(var z=-1,V=0;V<f.length;V++){var te=U.indexOf(f[V]);te!==-1&&(z===-1||te<z)&&(z=te)}var Y,X;z===-1?X=U.lastIndexOf("@"):X=U.lastIndexOf("@",z),X!==-1&&(Y=U.slice(0,X),U=U.slice(X+1),this.auth=decodeURIComponent(Y)),z=-1;for(var V=0;V<c.length;V++){var te=U.indexOf(c[V]);te!==-1&&(z===-1||te<z)&&(z=te)}z===-1&&(z=U.length),this.host=U.slice(0,z),U=U.slice(z),this.parseHost(),this.hostname=this.hostname||"";var ce=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!ce)for(var Z=this.hostname.split(/\./),V=0,ne=Z.length;V<ne;V++){var de=Z[V];if(de&&!de.match(h)){for(var me="",ye=0,Ae=de.length;ye<Ae;ye++)de.charCodeAt(ye)>127?me+="x":me+=de[ye];if(!me.match(h)){var we=Z.slice(0,V),ve=Z.slice(V+1),Te=de.match(m);Te&&(we.push(Te[1]),ve.unshift(Te[2])),ve.length&&(U="/"+ve.join(".")+U),this.hostname=we.join(".");break}}}this.hostname.length>d?this.hostname="":this.hostname=this.hostname.toLowerCase(),ce||(this.hostname=t.toASCII(this.hostname));var xe=this.port?":"+this.port:"",rt=this.hostname||"";this.host=rt+xe,this.href+=this.host,ce&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),U[0]!=="/"&&(U="/"+U))}if(!g[J])for(var V=0,ne=u.length;V<ne;V++){var Oe=u[V];if(U.indexOf(Oe)!==-1){var Me=encodeURIComponent(Oe);Me===Oe&&(Me=escape(Oe)),U=U.split(Oe).join(Me)}}var _t=U.indexOf("#");_t!==-1&&(this.hash=U.substr(_t),U=U.slice(0,_t));var wt=U.indexOf("?");if(wt!==-1?(this.search=U.substr(wt),this.query=U.substr(wt+1),O&&(this.query=b.parse(this.query)),U=U.slice(0,wt)):O&&(this.search="",this.query={}),U&&(this.pathname=U),S[J]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var xe=this.pathname||"",nn=this.search||"";this.path=xe+nn}return this.href=this.format(),this};function w(y){return typeof y=="string"&&(y=_(y)),y instanceof e?y.format():e.prototype.format.call(y)}e.prototype.format=function(){var y=this.auth||"";y&&(y=encodeURIComponent(y),y=y.replace(/%3A/i,":"),y+="@");var O=this.protocol||"",v=this.pathname||"",B=this.hash||"",D=!1,q="";this.host?D=y+this.host:this.hostname&&(D=y+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(D+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(q=b.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var K=this.search||q&&"?"+q||"";return O&&O.substr(-1)!==":"&&(O+=":"),this.slashes||(!O||S[O])&&D!==!1?(D="//"+(D||""),v&&v.charAt(0)!=="/"&&(v="/"+v)):D||(D=""),B&&B.charAt(0)!=="#"&&(B="#"+B),K&&K.charAt(0)!=="?"&&(K="?"+K),v=v.replace(/[?#]/g,function(U){return encodeURIComponent(U)}),K=K.replace("#","%23"),O+D+v+K+B};function R(y,O){return _(y,!1,!0).resolve(O)}e.prototype.resolve=function(y){return this.resolveObject(_(y,!1,!0)).format()};function A(y,O){return y?_(y,!1,!0).resolveObject(O):O}return e.prototype.resolveObject=function(y){if(typeof y=="string"){var O=new e;O.parse(y,!1,!0),y=O}for(var v=new e,B=Object.keys(this),D=0;D<B.length;D++){var q=B[D];v[q]=this[q]}if(v.hash=y.hash,y.href==="")return v.href=v.format(),v;if(y.slashes&&!y.protocol){for(var K=Object.keys(y),U=0;U<K.length;U++){var W=K[U];W!=="protocol"&&(v[W]=y[W])}return S[v.protocol]&&v.hostname&&!v.pathname&&(v.pathname="/",v.path=v.pathname),v.href=v.format(),v}if(y.protocol&&y.protocol!==v.protocol){if(!S[y.protocol]){for(var G=Object.keys(y),J=0;J<G.length;J++){var ee=G[J];v[ee]=y[ee]}return v.href=v.format(),v}if(v.protocol=y.protocol,!y.host&&!I[y.protocol]){for(var ne=(y.pathname||"").split("/");ne.length&&!(y.host=ne.shift()););y.host||(y.host=""),y.hostname||(y.hostname=""),ne[0]!==""&&ne.unshift(""),ne.length<2&&ne.unshift(""),v.pathname=ne.join("/")}else v.pathname=y.pathname;if(v.search=y.search,v.query=y.query,v.host=y.host||"",v.auth=y.auth,v.hostname=y.hostname||y.host,v.port=y.port,v.pathname||v.search){var z=v.pathname||"",V=v.search||"";v.path=z+V}return v.slashes=v.slashes||y.slashes,v.href=v.format(),v}var te=v.pathname&&v.pathname.charAt(0)==="/",Y=y.host||y.pathname&&y.pathname.charAt(0)==="/",X=Y||te||v.host&&y.pathname,ce=X,Z=v.pathname&&v.pathname.split("/")||[],ne=y.pathname&&y.pathname.split("/")||[],de=v.protocol&&!S[v.protocol];if(de&&(v.hostname="",v.port=null,v.host&&(Z[0]===""?Z[0]=v.host:Z.unshift(v.host)),v.host="",y.protocol&&(y.hostname=null,y.port=null,y.host&&(ne[0]===""?ne[0]=y.host:ne.unshift(y.host)),y.host=null),X=X&&(ne[0]===""||Z[0]==="")),Y)v.host=y.host||y.host===""?y.host:v.host,v.hostname=y.hostname||y.hostname===""?y.hostname:v.hostname,v.search=y.search,v.query=y.query,Z=ne;else if(ne.length)Z||(Z=[]),Z.pop(),Z=Z.concat(ne),v.search=y.search,v.query=y.query;else if(y.search!=null){if(de){v.host=Z.shift(),v.hostname=v.host;var me=v.host&&v.host.indexOf("@")>0?v.host.split("@"):!1;me&&(v.auth=me.shift(),v.hostname=me.shift(),v.host=v.hostname)}return v.search=y.search,v.query=y.query,(v.pathname!==null||v.search!==null)&&(v.path=(v.pathname?v.pathname:"")+(v.search?v.search:"")),v.href=v.format(),v}if(!Z.length)return v.pathname=null,v.search?v.path="/"+v.search:v.path=null,v.href=v.format(),v;for(var ye=Z.slice(-1)[0],Ae=(v.host||y.host||Z.length>1)&&(ye==="."||ye==="..")||ye==="",we=0,ve=Z.length;ve>=0;ve--)ye=Z[ve],ye==="."?Z.splice(ve,1):ye===".."?(Z.splice(ve,1),we++):we&&(Z.splice(ve,1),we--);if(!X&&!ce)for(;we--;we)Z.unshift("..");X&&Z[0]!==""&&(!Z[0]||Z[0].charAt(0)!=="/")&&Z.unshift(""),Ae&&Z.join("/").substr(-1)!=="/"&&Z.push("");var Te=Z[0]===""||Z[0]&&Z[0].charAt(0)==="/";if(de){v.hostname=Te?"":Z.length?Z.shift():"",v.host=v.hostname;var me=v.host&&v.host.indexOf("@")>0?v.host.split("@"):!1;me&&(v.auth=me.shift(),v.hostname=me.shift(),v.host=v.hostname)}return X=X||v.host&&Z.length,X&&!Te&&Z.unshift(""),Z.length>0?v.pathname=Z.join("/"):(v.pathname=null,v.path=null),(v.pathname!==null||v.search!==null)&&(v.path=(v.pathname?v.pathname:"")+(v.search?v.search:"")),v.auth=y.auth||v.auth,v.slashes=v.slashes||y.slashes,v.href=v.format(),v},e.prototype.parseHost=function(){var y=this.host,O=n.exec(y);O&&(O=O[0],O!==":"&&(this.port=O.substr(1)),y=y.substr(0,y.length-O.length)),y&&(this.hostname=y)},Ar.parse=_,Ar.resolve=R,Ar.resolveObject=A,Ar.format=w,Ar.Url=e,Ar}function Gg(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 Iu?xA(t):PA(t)}function xA(t){let e=t.hostname,r=t.pathname;for(let n=0;n<r.length;n++)if(r[n]==="%"){let i=r.codePointAt(n+2)||32;if(r[n+1]==="2"&&i===102||r[n+1]==="5"&&i===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(r=r.replace(wA,"\\"),r=decodeURIComponent(r),e!=="")return`\\\\${e}${r}`;{let n=r.codePointAt(1)|32,i=r[2];if(n<mA||n>_A||i!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return r.slice(1)}}function PA(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 n=e.codePointAt(r+2)||32;if(e[r+1]==="2"&&n===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(e)}function Qg(t){let e=yu.resolve(t),r=t.charCodeAt(t.length-1);(r===bA||Iu&&r===yA)&&e[e.length-1]!==yu.sep&&(e+="/");let n=new URL("file://");return e.includes("%")&&(e=e.replace(vA,"%25")),!Iu&&e.includes("\\")&&(e=e.replace(SA,"%5C")),e.includes(`
8
+ `)&&(e=e.replace(EA,"%0A")),e.includes("\r")&&(e=e.replace(AA,"%0D")),e.includes(" ")&&(e=e.replace(IA,"%09")),n.pathname=e,n}var rA,bu,Dg,mu,_u,Ug,wu,Fg,vu,jg,Su,$g,Eu,Wg,Au,Vg,Ar,Hg,Ve,lA,cA,fA,dA,hA,pA,gA,yA,bA,mA,_A,Iu,wA,vA,SA,EA,AA,IA,Yg=je(()=>{x();T();P();ug();Mg();qg();pu();rA=Object.freeze(Object.create(null)),bu={},Dg=!1,mu=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;_u={},Ug=!1;wu={},Fg=!1;vu={},jg=!1;Su={},$g=!1;Eu={},Wg=!1;Au={},Vg=!1;Ar={},Hg=!1;Ve=uA();Ve.parse;Ve.resolve;Ve.resolveObject;Ve.format;Ve.Url;lA=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;Ve.URL=typeof URL<"u"?URL:null;Ve.pathToFileURL=Qg;Ve.fileURLToPath=Gg;cA=Ve.Url,fA=Ve.format,dA=Ve.resolve,hA=Ve.resolveObject,pA=Ve.parse,gA=Ve.URL,yA=92,bA=47,mA=97,_A=122,Iu=lA==="win32",wA=/\//g,vA=/%/g,SA=/\\/g,EA=/\n/g,AA=/\r/g,IA=/\t/g});var Xg=H((Dq,Jg)=>{"use strict";x();T();P();Jg.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}});var ho=H(Jn=>{"use strict";x();T();P();Object.defineProperty(Jn,"__esModule",{value:!0});Jn.BufferedDuplex=void 0;Jn.writev=ey;var TA=Qt(),Zg=(Re(),ge(Be));function ey(t,e){let r=new Array(t.length);for(let n=0;n<t.length;n++)typeof t[n].chunk=="string"?r[n]=Zg.Buffer.from(t[n].chunk,"utf8"):r[n]=t[n].chunk;this._write(Zg.Buffer.concat(r),"binary",e)}var Pu=class extends TA.Duplex{socket;proxy;isSocketOpen;writeQueue;constructor(e,r,n){super({objectMode:!0}),this.proxy=r,this.socket=n,this.writeQueue=[],e.objectMode||(this._writev=ey.bind(this)),this.isSocketOpen=!1,this.proxy.on("data",i=>{!this.destroyed&&this.readable&&this.push(i)})}_read(e){this.proxy.read(e)}_write(e,r,n){this.isSocketOpen?this.writeToProxy(e,r,n):this.writeQueue.push({chunk:e,encoding:r,cb:n})}_final(e){this.writeQueue=[],this.proxy.end(e)}_destroy(e,r){this.writeQueue=[],this.proxy.destroy(),r(e)}socketReady(){this.emit("connect"),this.isSocketOpen=!0,this.processWriteQueue()}writeToProxy(e,r,n){this.proxy.write(e,r)===!1?this.proxy.once("drain",n):n()}processWriteQueue(){for(;this.writeQueue.length>0;){let{chunk:e,encoding:r,cb:n}=this.writeQueue.shift();this.writeToProxy(e,r,n)}}};Jn.BufferedDuplex=Pu});var Xn=H(ir=>{"use strict";x();T();P();var Ou=ir&&ir.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ir,"__esModule",{value:!0});ir.streamBuilder=ir.browserStreamBuilder=void 0;var po=(Re(),ge(Be)),ty=Ou(Xg()),OA=Ou(Yt()),RA=Qt(),kA=Ou(Qn()),Tu=ho(),nr=(0,OA.default)("mqttjs:ws"),CA=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function ry(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 ny(t){let e=t;return t.port||(t.protocol==="wss"?e.port=443:e.port=80),t.path||(e.path="/"),t.wsOptions||(e.wsOptions={}),!kA.default&&!t.forceNativeWebSocket&&t.protocol==="wss"&&CA.forEach(r=>{Object.prototype.hasOwnProperty.call(t,r)&&!Object.prototype.hasOwnProperty.call(t.wsOptions,r)&&(e.wsOptions[r]=t[r])}),e}function MA(t){let e=ny(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 BA(t,e,r){nr("createWebSocket"),nr(`protocol: ${r.protocolId} ${r.protocolVersion}`);let n=r.protocolId==="MQIsdp"&&r.protocolVersion===3?"mqttv3.1":"mqtt";nr(`creating new Websocket for url: ${e} and protocol: ${n}`);let i;return r.createWebsocket?i=r.createWebsocket(e,[n],r):i=new ty.default(e,[n],r.wsOptions),i}function NA(t,e){let r=e.protocolId==="MQIsdp"&&e.protocolVersion===3?"mqttv3.1":"mqtt",n=ry(e,t),i;return e.createWebsocket?i=e.createWebsocket(n,[r],e):i=new WebSocket(n,[r]),i.binaryType="arraybuffer",i}var LA=(t,e)=>{nr("streamBuilder");let r=ny(e);r.hostname=r.hostname||r.host||"localhost";let n=ry(r,t),i=BA(t,n,r),s=ty.default.createWebSocketStream(i,r.wsOptions);return s.url=n,i.on("close",()=>{s.destroy()}),s};ir.streamBuilder=LA;var qA=(t,e)=>{nr("browserStreamBuilder");let r,i=MA(e).browserBufferSize||1024*512,s=e.browserBufferTimeout||1e3,o=!e.objectMode,u=NA(t,e),c=d(e,S,b);e.objectMode||(c._writev=Tu.writev.bind(c)),c.on("close",()=>{u.close()});let f=typeof u.addEventListener<"u";u.readyState===u.OPEN?(r=c,r.socket=u):(r=new Tu.BufferedDuplex(e,c,u),f?u.addEventListener("open",h):u.onopen=h),f?(u.addEventListener("close",m),u.addEventListener("error",g),u.addEventListener("message",I)):(u.onclose=m,u.onerror=g,u.onmessage=I);function d(_,w,R){let A=new RA.Transform({objectMode:_.objectMode});return A._write=w,A._flush=R,A}function h(){nr("WebSocket onOpen"),r instanceof Tu.BufferedDuplex&&r.socketReady()}function m(_){nr("WebSocket onClose",_),r.end(),r.destroy()}function g(_){nr("WebSocket onError",_);let w=new Error("WebSocket error");w.event=_,r.destroy(w)}async function I(_){if(!c||!c.readable||!c.writable)return;let{data:w}=_;w instanceof ArrayBuffer?w=po.Buffer.from(w):w instanceof Blob?w=po.Buffer.from(await new Response(w).arrayBuffer()):w=po.Buffer.from(w,"utf8"),c.push(w)}function S(_,w,R){if(u.bufferedAmount>i){setTimeout(S,s,_,w,R);return}o&&typeof _=="string"&&(_=po.Buffer.from(_,"utf8"));try{u.send(_)}catch(A){return R(A)}R()}function b(_){u.close(),_()}return r};ir.browserStreamBuilder=qA});var Ru={};Tr(Ru,{Server:()=>Qe,Socket:()=>Qe,Stream:()=>Qe,_createServerHandle:()=>Qe,_normalizeArgs:()=>Qe,_setSimultaneousAccepts:()=>Qe,connect:()=>Qe,createConnection:()=>Qe,createServer:()=>Qe,default:()=>DA,isIP:()=>Qe,isIPv4:()=>Qe,isIPv6:()=>Qe});function Qe(){throw new Error("Node.js net module is not supported by JSPM core outside of Node.js")}var DA,ku=je(()=>{x();T();P();DA={_createServerHandle:Qe,_normalizeArgs:Qe,_setSimultaneousAccepts:Qe,connect:Qe,createConnection:Qe,createServer:Qe,isIP:Qe,isIPv4:Qe,isIPv6:Qe,Server:Qe,Socket:Qe,Stream:Qe}});var Cu=H((fD,iy)=>{x();T();P();iy.exports={}});var Bu=H(Zn=>{"use strict";x();T();P();var Mu=Zn&&Zn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Zn,"__esModule",{value:!0});var UA=Mu((ku(),ge(Ru))),FA=Mu(Yt()),jA=Mu(Cu()),$A=(0,FA.default)("mqttjs:tcp"),WA=(t,e)=>{if(e.port=e.port||1883,e.hostname=e.hostname||e.host||"localhost",e.socksProxy)return(0,jA.default)(e.hostname,e.port,e.socksProxy,{timeout:e.socksTimeout});let{port:r,path:n}=e,i=e.hostname;return $A("port %d and host %s",r,i),UA.default.createConnection({port:r,host:i,path:n})};Zn.default=WA});var oy={};Tr(oy,{default:()=>VA});var VA,sy=je(()=>{x();T();P();VA={}});var Lu=H(ei=>{"use strict";x();T();P();var Nu=ei&&ei.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ei,"__esModule",{value:!0});var ay=(sy(),ge(oy)),HA=Nu((ku(),ge(Ru))),zA=Nu(Yt()),GA=Nu(Cu()),QA=(0,zA.default)("mqttjs:tls");function KA(t){let{host:e,port:r,socksProxy:n,...i}=t;if(n!==void 0){let s=(0,GA.default)(e,r,n,{timeout:t.socksTimeout});return(0,ay.connect)({...i,socket:s})}return(0,ay.connect)(t)}var YA=(t,e)=>{e.port=e.port||8883,e.host=e.hostname||e.host||"localhost",e.rejectUnauthorized=e.rejectUnauthorized!==!1,delete e.path,QA("port %d host %s rejectUnauthorized %b",e.port,e.host,e.rejectUnauthorized);let r=e.servername||(HA.default.isIP(e.host)===0?e.host:void 0),n=KA({...e,servername:r});n.on("secureConnect",()=>{e.rejectUnauthorized&&!n.authorized?n.emit("error",new Error("TLS not authorized")):n.removeListener("error",i)});function i(s){e.rejectUnauthorized&&t.emit("error",s),n.end()}return n.on("error",i),n};ei.default=YA});var Uu=H(Du=>{"use strict";x();T();P();Object.defineProperty(Du,"__esModule",{value:!0});var uy=(Re(),ge(Be)),JA=Qt(),XA=ho(),mt,qu,Ke;function ZA(){let t=new JA.Transform;return t._write=(e,r,n)=>{mt.send({data:e.buffer,success(){n()},fail(i){n(new Error(i))}})},t._flush=e=>{mt.close({success(){e()}})},t}function eI(t){t.hostname||(t.hostname="localhost"),t.path||(t.path="/"),t.wsOptions||(t.wsOptions={})}function tI(t,e){let r=t.protocol==="wxs"?"wss":"ws",n=`${r}://${t.hostname}${t.path}`;return t.port&&t.port!==80&&t.port!==443&&(n=`${r}://${t.hostname}:${t.port}${t.path}`),typeof t.transformWsUrl=="function"&&(n=t.transformWsUrl(n,t,e)),n}function rI(){mt.onOpen(()=>{Ke.socketReady()}),mt.onMessage(t=>{let{data:e}=t;e instanceof ArrayBuffer?e=uy.Buffer.from(e):e=uy.Buffer.from(e,"utf8"),qu.push(e)}),mt.onClose(()=>{Ke.emit("close"),Ke.end(),Ke.destroy()}),mt.onError(t=>{let e=new Error(t.errMsg);Ke.destroy(e)})}var nI=(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";eI(e);let n=tI(e,t);mt=wx.connectSocket({url:n,protocols:[r]}),qu=ZA(),Ke=new XA.BufferedDuplex(e,qu,mt),Ke._destroy=(s,o)=>{mt.close({success(){o&&o(s)}})};let i=Ke.destroy;return Ke.destroy=(s,o)=>(Ke.destroy=i,setTimeout(()=>{mt.close({fail(){Ke._destroy(s,o)}})},0),Ke),rI(),Ke};Du.default=nI});var $u=H(ju=>{"use strict";x();T();P();Object.defineProperty(ju,"__esModule",{value:!0});var Fu=(Re(),ge(Be)),iI=Qt(),oI=ho(),qt,ti,tn,ly=!1;function sI(){let t=new iI.Transform;return t._write=(e,r,n)=>{qt.sendSocketMessage({data:e.buffer,success(){n()},fail(){n(new Error)}})},t._flush=e=>{qt.closeSocket({success(){e()}})},t}function aI(t){t.hostname||(t.hostname="localhost"),t.path||(t.path="/"),t.wsOptions||(t.wsOptions={})}function uI(t,e){let r=t.protocol==="alis"?"wss":"ws",n=`${r}://${t.hostname}${t.path}`;return t.port&&t.port!==80&&t.port!==443&&(n=`${r}://${t.hostname}:${t.port}${t.path}`),typeof t.transformWsUrl=="function"&&(n=t.transformWsUrl(n,t,e)),n}function lI(){ly||(ly=!0,qt.onSocketOpen(()=>{tn.socketReady()}),qt.onSocketMessage(t=>{if(typeof t.data=="string"){let e=Fu.Buffer.from(t.data,"base64");ti.push(e)}else{let e=new FileReader;e.addEventListener("load",()=>{if(e.result instanceof ArrayBuffer){ti.push(Fu.Buffer.from(e.result));return}ti.push(Fu.Buffer.from(e.result,"utf-8"))}),e.readAsArrayBuffer(t.data)}}),qt.onSocketClose(()=>{tn.end(),tn.destroy()}),qt.onSocketError(t=>{tn.destroy(t)}))}var cI=(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";aI(e);let n=uI(e,t);return qt=e.my,qt.connectSocket({url:n,protocols:r}),ti=sI(),tn=new oI.BufferedDuplex(e,ti,qt),lI(),tn};ju.default=cI});var dy=H(rn=>{"use strict";x();T();P();var go=rn&&rn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(rn,"__esModule",{value:!0});rn.connectAsync=mI;var fI=go(Yt()),dI=go((Yg(),ge(Kg))),hI=go(co()),Wu=go(Qn());typeof L?.nextTick!="function"&&(L.nextTick=setImmediate);var Vu=(0,fI.default)("mqttjs"),ct=null,Dt=null;function pI(){return ct||(ct={},ct.ws=Xn().streamBuilder,ct.wss=Xn().streamBuilder,ct.mqtt=Bu().default,ct.tcp=Bu().default,ct.ssl=Lu().default,ct.tls=ct.ssl,ct.mqtts=Lu().default),ct}function gI(){return Dt||(Dt={},Dt.ws=Xn().browserStreamBuilder,Dt.wss=Xn().browserStreamBuilder,Dt.wx=Uu().default,Dt.wxs=Uu().default,Dt.ali=$u().default,Dt.alis=$u().default),Dt}var Hu=["mqtts","tls","ssl","wss","wxs","alis"];function yI(){return typeof location<"u"?location.protocol==="https:"?"wss":"ws":typeof document<"u"&&new URL(document.URL).protocol==="https:"?"wss":"ws"}function bI(t){if(t.auth){let e=t.auth.indexOf(":");e!==-1?(t.username=t.auth.slice(0,e),t.password=t.auth.slice(e+1)):t.username=t.auth}}function cy(t){return t?.replace(/:$/,"").toLowerCase()}function fy(t,e){if(Vu("connecting to an MQTT broker..."),typeof t=="object"&&!e&&(e=t,t=""),e=e||{},t&&typeof t=="string"){let s=dI.default.parse(t,!0),o={},u=!s.protocol&&!s.hostname&&s.path?.startsWith("/")&&(Wu.default||e.forceNativeWebSocket);if(s.port!=null&&(o.port=Number(s.port)),o.host=s.hostname,o.query=s.query,o.auth=s.auth,o.protocol=s.protocol,o.path=s.path,e={...o,...e},!e.protocol&&!u)throw new Error("Missing protocol");e.protocol=e.protocol||yI()}if(e.protocol=cy(e.protocol),e.unixSocket=e.unixSocket||e.protocol?.includes("+unix"),e.unixSocket?e.protocol=e.protocol.replace("+unix",""):!e.protocol?.startsWith("ws")&&!e.protocol?.startsWith("wx")&&delete e.path,bI(e),e.query&&typeof e.query.clientId=="string"&&(e.clientId=e.query.clientId),Wu.default||e.unixSocket?e.socksProxy=void 0:e.socksProxy===void 0&&typeof L<"u"&&(e.socksProxy=L.env.MQTTJS_SOCKS_PROXY),e.cert&&e.key)if(e.protocol){if(!Hu.includes(e.protocol))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");let r=Wu.default||e.forceNativeWebSocket?gI():pI();if(!r[e.protocol]){let s=e.protocol,o=Hu.includes(s);if(e.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter(u=>o&&!Hu.includes(u)?!1:typeof r[u]=="function")[0],o&&!e.protocol)throw new Error(`No secure transport available for protocol "${s}"`);Vu("no transport for %s, falling back to %s",s,e.protocol)}if(e.clean===!1&&!e.clientId)throw new Error("Missing clientId for unclean clients");e.protocol&&(e.defaultProtocol=e.protocol);function n(s){return e.servers&&((!s._reconnectCount||s._reconnectCount===e.servers.length)&&(s._reconnectCount=0),e.host=e.servers[s._reconnectCount].host,e.port=e.servers[s._reconnectCount].port,e.protocol=e.servers[s._reconnectCount].protocol?cy(e.servers[s._reconnectCount].protocol):e.defaultProtocol,e.hostname=e.host,s._reconnectCount++),Vu("calling streambuilder for",e.protocol),r[e.protocol](s,e)}let i=new hI.default(n,e);return i.on("error",()=>{}),i}function mI(t,e,r=!0){return new Promise((n,i)=>{let s=fy(t,e),o={connect:c=>{u(),n(s)},end:()=>{u(),n(s)},error:c=>{u(),s.end(),i(c)}};r===!1&&(o.close=()=>{o.error(new Error("Couldn't connect to server"))});function u(){Object.keys(o).forEach(c=>{s.off(c,o[c])})}Object.keys(o).forEach(c=>{s.on(c,o[c])})})}rn.default=fy});var Gu=H(be=>{"use strict";x();T();P();var hy=be&&be.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_I=be&&be.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),wI=be&&be.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&hy(r,e,n[i]);return _I(r,e),r}})(),zu=be&&be.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hy(e,t,r)},ri=be&&be.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(be,"__esModule",{value:!0});be.ReasonCodes=be.KeepaliveManager=be.UniqueMessageIdProvider=be.DefaultMessageIdProvider=be.Store=be.MqttClient=be.connectAsync=be.connect=be.Client=void 0;var py=ri(co());be.MqttClient=py.default;var vI=ri(ma());be.DefaultMessageIdProvider=vI.default;var SI=ri(sg());be.UniqueMessageIdProvider=SI.default;var EI=ri(ra());be.Store=EI.default;var gy=wI(dy());be.connect=gy.default;Object.defineProperty(be,"connectAsync",{enumerable:!0,get:function(){return gy.connectAsync}});var AI=ri(Ma());be.KeepaliveManager=AI.default;be.Client=py.default;zu(co(),be);zu(Tt(),be);zu(Zs(),be);var II=Pn();Object.defineProperty(be,"ReasonCodes",{enumerable:!0,get:function(){return II.ReasonCodes}})});var RI=H(tt=>{x();T();P();var yy=tt&&tt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),xI=tt&&tt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),PI=tt&&tt.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&yy(r,e,n[i]);return xI(r,e),r}})(),TI=tt&&tt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&yy(e,t,r)};Object.defineProperty(tt,"__esModule",{value:!0});var OI=PI(Gu());tt.default=OI;TI(Gu(),tt)});return RI();})();
9
9
  /*! Bundled license information:
10
10
 
11
11
  @jspm/core/nodelibs/browser/chunk-DtuTasat.js: