1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[31900],{91310:function(e,t,r){var n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,a=(e,t)=>()=>(e&&(t=e(e=0)),t),l=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),u=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},c=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))s.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=i(t,l))||a.enumerable});return e},h=e=>c(n({},"__esModule",{value:!0}),e),f=a(()=>{}),p={};function d(e){throw Error("Node.js process "+e+" is not supported by JSPM core outside of Node.js")}function y(){R&&C&&(R=!1,C.length?T=C.concat(T):j=-1,T.length&&g())}function g(){if(!R){var e=setTimeout(y,0);R=!0;for(var t=T.length;t;){for(C=T,T=[];++j<t;)C&&C[j].run();j=-1,t=T.length}C=null,R=!1,clearTimeout(e)}}function b(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];T.push(new m(e,t)),1!==T.length||R||setTimeout(g,0)}function m(e,t){this.fun=e,this.array=t}function _(){}function v(e){d("_linkedBinding")}function w(e){d("dlopen")}function S(){return[]}function E(){return[]}function A(e,t){if(!e)throw Error(t||"assertion error")}function I(){return!1}function k(){return ex.now()/1e3}function O(e){var t=Math.floor((Date.now()-ex.now())*.001),r=.001*ex.now(),n=Math.floor(r)+t,i=Math.floor(r%1*1e9);return e&&(n-=e[0],(i-=e[1])<0&&(n--,i+=eT)),[n,i]}function x(){return eq}function P(e){return[]}u(p,{_debugEnd:()=>ed,_debugProcess:()=>ep,_events:()=>eC,_eventsCount:()=>ej,_exiting:()=>X,_fatalExceptions:()=>ec,_getActiveHandles:()=>E,_getActiveRequests:()=>S,_kill:()=>et,_linkedBinding:()=>v,_maxListeners:()=>eR,_preload_modules:()=>ek,_rawDebug:()=>Q,_startProfilerIdleNotifier:()=>ey,_stopProfilerIdleNotifier:()=>eg,_tickCallback:()=>ef,abort:()=>ev,addListener:()=>eM,allowedNodeEnvironmentFlags:()=>el,arch:()=>B,argv:()=>L,argv0:()=>eI,assert:()=>A,binding:()=>$,browser:()=>G,chdir:()=>z,config:()=>Z,cpuUsage:()=>er,cwd:()=>V,debugPort:()=>eA,default:()=>eq,dlopen:()=>w,domain:()=>J,emit:()=>eD,emitWarning:()=>q,env:()=>U,execArgv:()=>D,execPath:()=>eE,exit:()=>es,features:()=>eu,hasUncaughtExceptionCaptureCallback:()=>I,hrtime:()=>O,kill:()=>eo,listeners:()=>P,memoryUsage:()=>ei,moduleLoadList:()=>Y,nextTick:()=>b,off:()=>eN,on:()=>x,once:()=>eB,openStdin:()=>ea,pid:()=>ew,platform:()=>N,ppid:()=>eS,prependListener:()=>eF,prependOnceListener:()=>eW,reallyExit:()=>ee,release:()=>K,removeAllListeners:()=>eL,removeListener:()=>eU,resourceUsage:()=>en,setSourceMapsEnabled:()=>eO,setUncaughtExceptionCaptureCallback:()=>eh,stderr:()=>em,stdin:()=>e_,stdout:()=>eb,title:()=>M,umask:()=>H,uptime:()=>k,version:()=>F,versions:()=>W});var T,R,C,j,M,B,N,U,L,D,F,W,q,$,H,V,z,K,G,Q,Y,J,X,Z,ee,et,er,en,ei,eo,es,ea,el,eu,ec,eh,ef,ep,ed,ey,eg,eb,em,e_,ev,ew,eS,eE,eA,eI,ek,eO,ex,eP,eT,eR,eC,ej,eM,eB,eN,eU,eL,eD,eF,eW,eq,e$,eH,eV,ez,eK,eG,eQ=a(()=>{f(),e6(),eY(),T=[],R=!1,j=-1,m.prototype.run=function(){this.fun.apply(null,this.array)},M="browser",B="x64",N="browser",U={PATH:"/usr/bin",LANG:"u">typeof navigator?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},L=["/usr/bin/node"],D=[],F="v16.8.0",W={},q=function(e,t){console.warn((t?t+": ":"")+e)},$=function(e){d("binding")},H=function(e){return 0},V=function(){return"/"},z=function(e){},K={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},G=!0,Q=_,Y=[],J={},X=!1,Z={},ee=_,et=_,en=er=function(){return{}},ei=er,eo=_,es=_,ea=_,el={},eu={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},ec=_,eh=_,ef=_,ep=_,ed=_,ey=_,eg=_,eb=void 0,em=void 0,e_=void 0,ev=_,ew=2,eS=1,eE="/bin/usr/node",eA=9229,eI="node",ek=[],eO=_,void 0===(ex={now:"u">typeof performance?performance.now.bind(performance):void 0,timing:"u">typeof performance?performance.timing:void 0}).now&&(eP=Date.now(),ex.timing&&ex.timing.navigationStart&&(eP=ex.timing.navigationStart),ex.now=()=>Date.now()-eP),eT=1e9,O.bigint=function(e){var t=O(e);return typeof BigInt>"u"?t[0]*eT+t[1]:BigInt(t[0]*eT)+BigInt(t[1])},eR=10,eC={},ej=0,eM=x,eB=x,eN=x,eU=x,eL=x,eD=_,eF=x,eW=x,eq={version:F,versions:W,arch:B,platform:N,browser:G,release:K,_rawDebug:Q,moduleLoadList:Y,binding:$,_linkedBinding:v,_events:eC,_eventsCount:ej,_maxListeners:eR,on:x,addListener:eM,once:eB,off:eN,removeListener:eU,removeAllListeners:eL,emit:eD,prependListener:eF,prependOnceListener:eW,listeners:P,domain:J,_exiting:X,config:Z,dlopen:w,uptime:k,_getActiveRequests:S,_getActiveHandles:E,reallyExit:ee,_kill:et,cpuUsage:er,resourceUsage:en,memoryUsage:ei,kill:eo,exit:es,openStdin:ea,allowedNodeEnvironmentFlags:el,assert:A,features:eu,_fatalExceptions:ec,setUncaughtExceptionCaptureCallback:eh,hasUncaughtExceptionCaptureCallback:I,emitWarning:q,nextTick:b,_tickCallback:ef,_debugProcess:ep,_debugEnd:ed,_startProfilerIdleNotifier:ey,_stopProfilerIdleNotifier:eg,stdout:eb,stdin:e_,stderr:em,abort:ev,umask:H,chdir:z,cwd:V,env:U,title:M,argv:L,execArgv:D,pid:ew,ppid:eS,execPath:eE,debugPort:eA,hrtime:O,argv0:eI,_preload_modules:ek,setSourceMapsEnabled:eO}}),eY=a(()=>{eQ()}),eJ=a(()=>{f(),e6(),eY(),e$={},eH=!1,eV={},ez=!1,eK={},eG=!1}),eX={};u(eX,{Buffer:()=>e0,INSPECT_MAX_BYTES:()=>e1,default:()=>eZ,kMaxLength:()=>e2});var eZ,e0,e1,e2,e3=a(()=>{f(),e6(),eY(),eJ(),(eZ=function(){if(eG)return eK;eG=!0;let e=function(){if(eH)return e$;eH=!0,e$.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return(r+n)*3/4-n},e$.toByteArray=function(e){var n,i,o=s(e),a=o[0],l=o[1],u=new r((a+l)*3/4-l),c=0,h=l>0?a-4:a;for(i=0;i<h;i+=4)n=t[e.charCodeAt(i)]<<18|t[e.charCodeAt(i+1)]<<12|t[e.charCodeAt(i+2)]<<6|t[e.charCodeAt(i+3)],u[c++]=n>>16&255,u[c++]=n>>8&255,u[c++]=255&n;return 2===l&&(n=t[e.charCodeAt(i)]<<2|t[e.charCodeAt(i+1)]>>4,u[c++]=255&n),1===l&&(n=t[e.charCodeAt(i)]<<10|t[e.charCodeAt(i+1)]<<4|t[e.charCodeAt(i+2)]>>2,u[c++]=n>>8&255,u[c++]=255&n),u},e$.fromByteArray=function(t){for(var r,n=t.length,i=n%3,o=[],s=0,a=n-i;s<a;s+=16383)o.push(function(t,r,n){for(var i,o=[],s=r;s<n;s+=3)o.push(e[(i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]))>>18&63]+e[i>>12&63]+e[i>>6&63]+e[63&i]);return o.join("")}(t,s,s+16383>a?a:s+16383));return 1===i?o.push(e[(r=t[n-1])>>2]+e[r<<4&63]+"=="):2===i&&o.push(e[(r=(t[n-2]<<8)+t[n-1])>>10]+e[r>>4&63]+e[r<<2&63]+"="),o.join("")};for(var e=[],t=[],r="u">typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
1+/",i=0,o=n.length;i<o;++i)e[i]=n[i],t[n.charCodeAt(i)]=i;function s(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}return t[45]=62,t[95]=63,e$}(),t=(ez||(ez=!0,eV.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,l=(1<<a)-1,u=l>>1,c=-7,h=r?i-1:0,f=r?-1:1,p=e[t+h];for(h+=f,o=p&(1<<-c)-1,p>>=-c,c+=a;c>0;o=256*o+e[t+h],h+=f,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+e[t+h],h+=f,c-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=u}return(p?-1:1)*s*Math.pow(2,o-n)},eV.write=function(e,t,r,n,i,o){var s,a,l,u=8*o-i-1,c=(1<<u)-1,h=c>>1,f=23===i?5960464477539062e-23:0,p=n?0:o-1,d=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(isNaN(t=Math.abs(t))||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+h>=1?t+=f/l:t+=f*Math.pow(2,1-h),t*l>=2&&(s++,l/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(t*l-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[r+p]=255&s,p+=d,s/=256,u-=8);e[r+p-d]|=128*y}),eV),r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function n(e){if(e>2147483647)throw RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,i.prototype),t}function i(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return a(e)}return o(e,t,r)}function o(e,t,r){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!i.isEncoding(t))throw TypeError("Unknown encoding: "+t);let r=0|h(e,t),o=n(r),s=o.write(e,t);return s!==r&&(o=o.slice(0,s)),o}(e,t);if(ArrayBuffer.isView(e))return function(e){if(M(e,Uint8Array)){let t=new Uint8Array(e);return u(t.buffer,t.byteOffset,t.byteLength)}return l(e)}(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(M(e,ArrayBuffer)||e&&M(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(M(e,SharedArrayBuffer)||e&&M(e.buffer,SharedArrayBuffer)))return u(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');let o=e.valueOf&&e.valueOf();if(null!=o&&o!==e)return i.from(o,t,r);let s=function(e){var t;if(i.isBuffer(e)){let t=0|c(e.length),r=n(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||(t=e.length)!=t?n(0):l(e):"Buffer"===e.type&&Array.isArray(e.data)?l(e.data):void 0}(e);if(s)return s;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return i.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function s(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function a(e){return s(e),n(e<0?0:0|c(e))}function l(e){let t=e.length<0?0:0|c(e.length),r=n(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function u(e,t,r){let n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),i.prototype),n}function c(e){if(e>=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function h(e,t){if(i.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||M(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return R(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return C(e).length;default:if(o)return n?-1:R(e).length;t=(""+t).toLowerCase(),o=!0}}function f(t,r,n){let i=!1;if((void 0===r||r<0)&&(r=0),r>this.length||((void 0===n||n>this.length)&&(n=this.length),n<=0)||(n>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(e,t,r){let n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=B[e[n]];return i}(this,r,n);case"utf8":case"utf-8":return g(this,r,n);case"ascii":return function(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}(this,r,n);case"latin1":case"binary":return function(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}(this,r,n);case"base64":var o,s;return o=r,s=n,0===o&&s===this.length?e.fromByteArray(this):e.fromByteArray(this.slice(o,s));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){let n=e.slice(t,r),i="";for(let e=0;e<n.length-1;
vendor: 17,026 bytes, line 1
1e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}(this,r,n);default:if(i)throw TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function p(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function d(e,t,r,n,o){var s;if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),(s=r=+r)!=s&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return -1;r=e.length-1}else if(r<0){if(!o)return -1;r=0}if("string"==typeof t&&(t=i.from(t,n)),i.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,o);throw TypeError("val must be string, number or Buffer")}function y(e,t,r,n,i){let o,s=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;s=2,a/=2,l/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(u(e,o)===u(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===l)return n*s}else -1!==n&&(o-=o-n),n=-1}else for(r+l>a&&(r=a-l),o=r;o>=0;o--){let r=!0;for(let n=0;n<l;n++)if(u(e,o+n)!==u(t,n)){r=!1;break}if(r)return o}return -1}function g(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i<r;){let t=e[i],o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,l;switch(s){case 1:t<128&&(o=t);break;case 2:(192&(r=e[i+1]))==128&&(l=(31&t)<<6|63&r)>127&&(o=l);break;case 3:r=e[i+1],n=e[i+2],(192&r)==128&&(192&n)==128&&(l=(15&t)<<12|(63&r)<<6|63&n)>2047&&(l<55296||l>57343)&&(o=l);break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],(192&r)==128&&(192&n)==128&&(192&a)==128&&(l=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a)>65535&&l<1114112&&(o=l)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){let t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}(n)}function b(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function m(e,t,r,n,o,s){if(!i.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<s)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function _(e,t,r,n,i){O(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function v(e,t,r,n,i){O(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function w(e,t,r,n,i,o){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function S(e,r,n,i,o){return r=+r,n>>>=0,o||w(e,r,n,4),t.write(e,r,n,i,23,4),n+4}function E(e,r,n,i,o){return r=+r,n>>>=0,o||w(e,r,n,8),t.write(e,r,n,i,52,8),n+8}eK.Buffer=i,eK.SlowBuffer=function(e){return+e!=e&&(e=0),i.alloc(+e)},eK.INSPECT_MAX_BYTES=50,eK.kMaxLength=2147483647,i.TYPED_ARRAY_SUPPORT=function(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch{return!1}}(),!i.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}}),i.poolSize=8192,i.from=function(e,t,r){return o(e,t,r)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array),i.alloc=function(e,t,r){return s(e),e<=0?n(e):void 0!==t?"string"==typeof r?n(e).fill(t,r):n(e).fill(t):n(e)},i.allocUnsafe=function(e){return a(e)},i.allocUnsafeSlow=function(e){return a(e)},i.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==i.prototype},i.compare=function(e,t){if(M(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),M(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(e)||!i.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},i.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(e,t){let r;if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return i.alloc(0);if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;let n=i.allocUnsafe(t),o=0;for(r=0;r<e.length;++r){let t=e[r];if(M(t,Uint8Array))o+t.length>n.length?(i.isBuffer(t)||(t=i.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else if(i.isBuffer(t))t.copy(n,o);else throw TypeError('"list" argument must be an Array of Buffers');o+=t.length}return n},i.byteLength=h,i.prototype._isBuffer=!0,i.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)p(this,t,t+1);return this},i.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)p(this,t,t+3),p(this,t+1,t+2);return this},i.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)p(this,t,t+7),p(this,t+1,t+6),p(this,t+2,t+5),p(this,t+3,t+4);return this},i.prototype.toString=function(){let e=this.length;return 0===e?"":0==arguments.length?g(this,0,e):f.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(e){if(!i.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===i.compare(this,e)},i.prototype.inspect=function(){let e="",t=eK.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},r&&(i.prototype[r]=i.prototype.inspect),i.prototype.compare=function(e,t,r,n,o){if(M(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,o>>>=0,this===e)return 0;let s=o-n,a=r-t,l=Math.min(s,a),u=this.slice(n,o),c=e.slice(t,r);for(let e=0;e<l;++e)if(u[e]!==c[e]){s=u[e],a=c[e];break}return s<a?-1:a<s?1:0},i.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},i.prototype.indexOf=function(e,t,r){return d(this,e,t,r,!0)},i.prototype.lastIndexOf=function(e,t,r){return d(this,e,t,r,!1)},i.prototype.write=function(e,t,r,n){var i,o,s,a,l,u,c,h;if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let f=this.length-t;if((void 0===r||r>f)&&(r=f),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let p=!1;for(;;)switch(n){case"hex":return function(e,t,r,n){let i;r=Number(r)||0;let o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;let s=t.length;for(n>s/2&&(n=s/2),i=0;i<n;++i){let n=parseInt(t.substr(2*i,2),16);if(n!=n)break;e[r+i]=n}return i}(this,e,t,r);case"utf8":case"utf-8":return i=t,o=r,j(R(e,this.length-i),this,i,o);case"ascii":case"latin1":case"binary":return s=t,a=r,j(function(e){let t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(e),this,s,a);case"base64":return l=t,u=r,j(C(e),this,l,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=t,h=r,j(function(e,t){let r,n,i=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)n=(r=e.charCodeAt(o))>>8,i.push(r%256),i.push(n);return i}(e,this.length-c),this,c,h);default:if(p)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},i.prototype.slice=function(e,t){let r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);let n=this.subarray(e,t);return Object.setPrototypeOf(n,i.prototype),n},i.prototype.readUintLE=i.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},i.prototype.readUintBE=i.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},i.prototype.readUint8=i.prototype.readUInt8=function(e,t){return e>>>=0,t||b(e,1,this.length),this[e]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(e,t){return e>>>=0,t||b(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(e,t){return e>>>=0,t||b(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readBigUInt64LE=N(function(e){x(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&P(e,this.length-8);let n=t+256*this[++e]+65536*this[++e]+16777216*this[++e],i=this[++e]+256*this[++e]+65536*this[++e]+16777216*r;return BigInt(n)+(BigInt(i)<<BigInt(32))}),i.prototype.readBigUInt64BE=N(function(e){x(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&P(e,this.length-8);let n=16777216*t+65536*this[++e]+256*this[++e]+this[++e],i=16777216*this[++e]+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)}),i.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},i.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},i.prototype.readInt8=function(e,t){return e>>>=0,t||b(e,1,this.length),128&this[e]?-((255-this[e]+1)*1):this[e]},i.prototype.readInt16LE=function(e,t){e>>>=0,t||b(e,2,this.length);let r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(e,t){e>>>=0,t||b(e,2,this.length);let r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(e,t){return e>>>=0,t||b(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,t){return e>>>=0,t||b(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readBigInt64LE=N(function(e){x(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&P(e,this.length-8),(BigInt(this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24))<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+16777216*this[++e])}),i.prototype.readBigInt64BE=N(function(e){x(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&P(e,this.length-8),(BigInt((t<<24)+65536*this[++e]+256*this[++e]+this[++e])<<BigInt(32))+BigInt(16777216*this[++e]+65536*this[++e]+256*this[++e]+r)}),i.prototype.readFloatLE=function(e,r){return e>>>=0,r||b(e,4,this.length),t.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,r){return e>>>=0,r||b(e,4,this.length),t.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,r){return e>>>=0,r||b(e,8,this.length),t.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,r){return e>>>=0,r||b(e,8,this.length),t.read(this,e,!1,52,8)},i.prototype.writeUintLE=i.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;m(this,e,t,r,n,0)}let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},i.prototype.writeUintBE=i.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;m(this,e,t,r,n,0)}let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},i.prototype.writeUint8=i.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,1,255,0),this[t]=255&e,t+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},i.prototype.writeBigUInt64LE=N(function(e,t=0){return _(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeBigUInt64BE=N(function(e,t=0){return v(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){let n=Math.pow(2,8*r-1);m(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},i.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){let n=Math.pow(2,8*r-1);m(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},i.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},i.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},i.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||m(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},i.prototype.writeBigInt64LE=N(function(e,t=0){return _(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),i.prototype.writeBigInt64BE=N(function(e,t=0){return v(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),i.prototype.writeFloatLE=function(e,t,r){return S(this,e,t,!0,r)},i.prototype.writeFloatBE=function(e,t,r){return S(this,e,t,!1,r)},i.prototype.writeDoubleLE=function(e,t,r){return E(this,e,t,!0,r)},i.prototype.writeDoubleBE=function(e,t,r){return E(this,e,t,!1,r)},i.prototype.copy=function(e,t,r,n){if(!i.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);let o=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},i.prototype.fill=function(e,t,r,n){let o;if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!i.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){let t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{let s=i.isBuffer(e)?e:i.from(e,n),a=s.length;
1if(0===a)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=s[o%a]}return this};let A={};function I(e,t,r){A[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function k(e){let t="",r=e.length,n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function O(e,t,r,n,i,o){if(e>r||e<t){let r="bigint"==typeof t?"n":"",n;throw n=0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${(o+1)*8}${r}`:`>= -(2${r} ** ${(o+1)*8-1}${r}) and < 2 ** ${(o+1)*8-1}${r}`,new A.ERR_OUT_OF_RANGE("value",n,e)}x(i,"offset"),(void 0===n[i]||void 0===n[i+o])&&P(i,n.length-(o+1))}function x(e,t){if("number"!=typeof e)throw new A.ERR_INVALID_ARG_TYPE(t,"number",e)}function P(e,t,r){throw Math.floor(e)!==e?(x(e,r),new A.ERR_OUT_OF_RANGE("offset","an integer",e)):t<0?new A.ERR_BUFFER_OUT_OF_BOUNDS:new A.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${t}`,e)}I("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),I("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),I("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>4294967296?i=k(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=k(i)),i+="n"),n+=` It must be ${t}. Received ${i}`},RangeError);let T=/[^+/0-9A-Za-z-_]/g;function R(e,t){t=t||1/0;let r,n=e.length,i=null,o=[];for(let s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319||s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return o}function C(t){return e.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(T,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(t))}function j(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function M(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}let B=function(){let e="0123456789abcdef",t=Array(256);for(let r=0;r<16;++r){let n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function N(e){return typeof BigInt>"u"?U:e}function U(){throw Error("BigInt not supported")}return eK}()).Buffer,eZ.SlowBuffer,eZ.INSPECT_MAX_BYTES,eZ.kMaxLength,e0=eZ.Buffer,e1=eZ.INSPECT_MAX_BYTES,e2=eZ.kMaxLength}),e6=a(()=>{e3()}),e5=l((e,t)=>{f(),e6(),eY();var r=class extends Error{constructor(e){if(!Array.isArray(e))throw TypeError(`Expected input to be an Array, got ${typeof e}`);let t="";for(let r=0;r<e.length;r++)t+=` ${e[r].stack} 2`;super(t),this.name="AggregateError",this.errors=e}};t.exports={AggregateError:r,ArrayIsArray:e=>Array.isArray(e),ArrayPrototypeIncludes:(e,t)=>e.includes(t),ArrayPrototypeIndexOf:(e,t)=>e.indexOf(t),ArrayPrototypeJoin:(e,t)=>e.join(t),ArrayPrototypeMap:(e,t)=>e.map(t),ArrayPrototypePop:(e,t)=>e.pop(t),ArrayPrototypePush:(e,t)=>e.push(t),ArrayPrototypeSlice:(e,t,r)=>e.slice(t,r),Error,FunctionPrototypeCall:(e,t,...r)=>e.call(t,...r),FunctionPrototypeSymbolHasInstance:(e,t)=>Function.prototype[Symbol.hasInstance].call(e,t),MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties:(e,t)=>Object.defineProperties(e,t),ObjectDefineProperty:(e,t,r)=>Object.defineProperty(e,t,r),ObjectGetOwnPropertyDescriptor:(e,t)=>
2Object.getOwnPropertyDescriptor(e,t),ObjectKeys:e=>Object.keys(e),ObjectSetPrototypeOf:(e,t)=>Object.setPrototypeOf(e,t),Promise,PromisePrototypeCatch:(e,t)=>e.catch(t),PromisePrototypeThen:(e,t,r)=>e.then(t,r),PromiseReject:e=>Promise.reject(e),PromiseResolve:e=>Promise.resolve(e),ReflectApply:Reflect.apply,RegExpPrototypeTest:(e,t)=>e.test(t),SafeSet:Set,String,StringPrototypeSlice:(e,t,r)=>e.slice(t,r),StringPrototypeToLowerCase:e=>e.toLowerCase(),StringPrototypeToUpperCase:e=>e.toUpperCase(),StringPrototypeTrim:e=>e.trim(),Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet:(e,t,r)=>e.set(t,r),Boolean,Uint8Array}}),e4=l((e,t)=>{f(),e6(),eY(),t.exports={format:(e,...t)=>e.replace(/%([sdifj])/g,function(...[e,r]){let n=t.shift();return"f"===r?n.toFixed(6):"j"===r?JSON.stringify(n):"s"===r&&"object"==typeof n?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()}),inspect(e){switch(typeof e){case"string":if(e.includes("'")){if(!e.includes('"'))return`"${e}"`;if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}}}}),e8=l((e,t)=>{f(),e6(),eY();var{format:r,inspect:n}=e4(),{AggregateError:i}=e5(),o=globalThis.AggregateError||i,s=Symbol("kIsNodeError"),a=["string","function","number","object","Function","Object","boolean","bigint","symbol"],l=/^([A-Z][a-z0-9]*)+$/,u={};function c(e,t){if(!e)throw new u.ERR_INTERNAL_ASSERTION(t)}function h(e){let t="",r=e.length,n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function p(e,t,n){n||(n=Error);class i extends n{constructor(...n){super(function(e,t,n){if("function"==typeof t)return c(t.length<=n.length,`Code: ${e}; The provided arguments length (${n.length}) does not match the required ones (${t.length}).`),t(...n);let i=(t.match(/%[dfijoOs]/g)||[]).length;return c(i===n.length,`Code: ${e}; The provided arguments length (${n.length}) does not match the required ones (${i}).`),0===n.length?t:r(t,...n)}(e,t,n))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(i.prototype,{name:{value:n.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=e,i.prototype[s]=!0,u[e]=i}function d(e){let t="__node_internal_"+e.name;return Object.defineProperty(e,"name",{value:t}),e}var y=class extends Error{constructor(e="The operation was aborted",t){if(void 0!==t&&"object"!=typeof t)throw new u.ERR_INVALID_ARG_TYPE("options","Object",t);super(e,t),this.code="ABORT_ERR",this.name="AbortError"}};p("ERR_ASSERTION","%s",Error),p("ERR_INVALID_ARG_TYPE",(e,t,r)=>{c("string"==typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);let i="The ";e.endsWith(" argument")?i+=`${e} `:i+=`"${e}" ${e.includes(".")?"property":"argument"} `,i+="must be ";let o=[],s=[],u=[];for(let e of t)c("string"==typeof e,"All expected entries have to be of type string"),a.includes(e)?o.push(e.toLowerCase()):l.test(e)?s.push(e):(c("object"!==e,'The value "object" should be written as "Object"'),u.push(e));if(s.length>0){let e=o.indexOf("object");-1!==e&&(o.splice(o,e,1),s.push("Object"))}if(o.length>0){switch(o.length){case 1:i+=`of type ${o[0]}`;break;case 2:i+=`one of type ${o[0]} or ${o[1]}`;break;default:{let e=o.pop();i+=`one of type ${o.join(", ")}, or ${e}`}}(s.length>0||u.length>0)&&(i+=" or ")}if(s.length>0){switch(s.length){case 1:i+=`an instance of ${s[0]}`;break;case 2:i+=`an instance of ${s[0]} or ${s[1]}`;break;default:{let e=s.pop();i+=`an instance of ${s.join(", ")}, or ${e}`}}u.length>0&&(i+=" or ")}switch(u.length){case 0:break;case 1:u[0].toLowerCase()!==u[0]&&(i+="an "),i+=`${u[0]}`;break;case 2:i+=`one of ${u[0]} or ${u[1]}`;break;default:{let e=u.pop();i+=`one of ${u.join(", ")}, or ${e}`}}if(null==r)i+=`. Received ${r}`;else if("function"==typeof r&&r.name)i+=`. Received function ${r.name}`;else if("object"==typeof r){var h;if(null!==(h=r.constructor)&&void 0!==h&&h.name)i+=`. Received an instance of ${r.constructor.name}`;else{let e=n(r,{depth:-1});i+=`. Received ${e}`}}else{let e=n(r,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),i+=`. Received type ${typeof r} (${e})`}return i}
2,TypeError),p("ERR_INVALID_ARG_VALUE",(e,t,r="is invalid")=>{let i=n(t);return i.length>128&&(i=i.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${i}`},TypeError),p("ERR_INVALID_RETURN_VALUE",(e,t,r)=>{var n;let i=null!=r&&null!==(n=r.constructor)&&void 0!==n&&n.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${e} to be returned from the "${t}" function but got ${i}.`},TypeError),p("ERR_MISSING_ARGS",(...e)=>{c(e.length>0,"At least one arg needs to be specified");let t,r=e.length;switch(e=(Array.isArray(e)?e:[e]).map(e=>`"${e}"`).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{let r=e.pop();t+=`The ${e.join(", ")}, and ${r} arguments`}}return`${t} must be specified`},TypeError),p("ERR_OUT_OF_RANGE",(e,t,r)=>{let i;if(c(t,'Missing "range" argument'),Number.isInteger(r)&&Math.abs(r)>4294967296)i=h(String(r));else if("bigint"==typeof r){i=String(r);let e=BigInt(2)**BigInt(32);(r>e||r<-e)&&(i=h(i)),i+="n"}else i=n(r);return`The value of "${e}" is out of range. It must be ${t}. Received ${i}`},RangeError),p("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),p("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),p("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),p("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),p("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),p("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),p("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),p("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),p("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),p("ERR_STREAM_WRITE_AFTER_END","write after end",Error),p("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),t.exp
2orts={AbortError:y,aggregateTwoErrors:d(function(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;let r=new o([t,e],t.message);return r.code=t.code,r}return e||t}),hideStackFrames:d,codes:u}}),e9=l((e,t)=>{f(),e6(),eY();var{AbortController:r,AbortSignal:n}="u">typeof self?self:"u">typeof window?window:void 0;t.exports=r,t.exports.AbortSignal=n,t.exports.default=r}),e7={};u(e7,{EventEmitter:()=>tn,default:()=>tr,defaultMaxListeners:()=>ti,init:()=>to,listenerCount:()=>ts,on:()=>ta,once:()=>tl});var te,tt,tr,tn,ti,to,ts,ta,tl,tu,tc,th,tf=a(()=>{f(),e6(),eY(),te={},tt=!1,(tr=function(){if(tt)return te;tt=!0;var e,t="object"==typeof Reflect?Reflect:null,r=t&&"function"==typeof t.apply?t.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};e=t&&"function"==typeof t.ownKeys?t.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var n=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}(te=i).once=function(e,t){return new Promise(function(r,n){var i;function o(r){e.removeListener(t,s),n(r)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}d(e,t,s,{once:!0}),"error"!==t&&(i={once:!0},"function"==typeof e.on&&d(e,"error",o,i))})},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var o=10;function s(e){if("function"!=typeof e)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function a(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function l(e,t,r,n){var i,o,l;if(s(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),l=o[t]),void 0===l)l=o[t]=r,++e._eventsCount;else if("function"==typeof l?l=o[t]=n?[r,l]:[l,r]:n?l.unshift(r):l.push(r),(i=a(e))>0&&l.length>i&&!l.warned){l.warned=!0;var u=Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=l.length,console&&console.warn&&console.warn(u)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=u.bind(n);return i.listener=r,n.wrapFn=i,i}function h(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):p(i,i.length)}function f(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=Array(t),n=0;n<t;++n)r[n]=e[n];return r}function d(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else if("function"==typeof e.addEventListener)e.addEventListener(t,function i(o){n.once&&e.removeEventListener(t,i),r(o)});else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}return Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||n(e))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),i.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||n(e))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return a(this)},i.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var s,a=Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=o[e];if(void 0===l)return!1;if("function"==typeof l)r(l,this,t);else for(var u=l.length,c=p(l,u),n=0;n<u;++n)r(c[n],this,t);return!0},i.prototype.addListener=function(e,t){return l(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return l(this,e,t,!0)},i.prototype.once=function(e,t){return s(t),this.on(e,c(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,c(this,e,t)),this},i.prototype.removeListener=function(e,t){var r,n,i,o,a;if(s(t),void 0===(n=this._events)||void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit
2("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0==arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0==arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},i.prototype.listeners=function(e){return h(this,e,!0)},i.prototype.rawListeners=function(e){return h(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},i.prototype.listenerCount=f,i.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]},te}()).once,tr.once=function(e,t){return new Promise((r,n)=>{let i;function o(...t){void 0!==i&&e.removeListener("error",i),r(t)}"error"!==t&&(i=t=>{e.removeListener(name,o),n(t)},e.once("error",i)),e.once(t,o)})},tr.on=function(e,t){let r=[],n=[],i=null,o=!1,s={async next(){let e=r.shift();if(e)return createIterResult(e,!1);if(i){let e=Promise.reject(i);return i=null,e}return o?createIterResult(void 0,!0):new Promise((e,t)=>n.push({resolve:e,reject:t}))},async return(){for(let r of(e.removeListener(t,a),e.removeListener("error",l),o=!0,n))r.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(r){i=r,e.removeListener(t,a),e.removeListener("error",l)},[Symbol.asyncIterator](){return this}};return e.on(t,a),e.on("error",l),s;function a(...e){let t=n.shift();t?t.resolve(createIterResult(e,!1)):r.push(e)}function l(e){o=!0;let t=n.shift();t?t.reject(e):i=e,s.return()}},{EventEmitter:tn,defaultMaxListeners:ti,init:to,listenerCount:ts,on:ta,once:tl}=tr}),tp=l((e,t)=>
2{f(),e6(),eY();var r=(e3(),h(eX)),{format:n,inspect:i}=e4(),{codes:{ERR_INVALID_ARG_TYPE:o}}=e8(),{kResistStopPropagation:s,AggregateError:a,SymbolDispose:l}=e5(),u=globalThis.AbortSignal||e9().AbortSignal,c=globalThis.AbortController||e9().AbortController,p=Object.getPrototypeOf(async function(){}).constructor,d=globalThis.Blob||r.Blob,y=(e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new o(t,"AbortSignal",e)},g=(e,t)=>{if("function"!=typeof e)throw new o(t,"Function",e)};t.exports={AggregateError:a,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(...r){t||(t=!0,e.apply(this,r))}},createDeferredPromise:function(){let e,t;return{promise:new Promise((r,n)=>{e=r,t=n}),resolve:e,reject:t}},promisify:e=>new Promise((t,r)=>{e((e,...n)=>e?r(e):t(...n))}),debuglog:()=>function(){},format:n,inspect:i,types:{isAsyncFunction:e=>e instanceof p,isArrayBufferView:e=>ArrayBuffer.isView(e)},isBlob:"u">typeof d?function(e){return e instanceof d}:function(e){return!1},deprecate:(e,t)=>e,addAbortListener:(tf(),h(e7)).addAbortListener||function(e,t){let r;if(void 0===e)throw new o("signal","AbortSignal",e);return y(e,"signal"),g(t,"listener"),e.aborted?queueMicrotask(()=>t()):(e.addEventListener("abort",t,{__proto__:null,once:!0,[s]:!0}),r=()=>{e.removeEventListener("abort",t)}),{__proto__:null,[l](){var e;null===(e=r)||void 0===e||e()}}},AbortSignalAny:u.any||function(e){if(1===e.length)return e[0];let t=new c,r=()=>t.abort();return e.forEach(e=>{y(e,"signals"),e.addEventListener("abort",r,{once:!0})}),t.signal.addEventListener("abort",()=>{e.forEach(e=>e.removeEventListener("abort",r))},{once:!0}),t.signal}},t.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),td=l((e,t)=>{f(),e6(),eY();var{ArrayIsArray:r,ArrayPrototypeIncludes:n,ArrayPrototypeJoin:i,ArrayPrototypeMap:o,NumberIsInteger:s,NumberIsNaN:a,NumberMAX_SAFE_INTEGER:l,NumberMIN_SAFE_INTEGER:u,NumberParseInt:c,ObjectPrototypeHasOwnProperty:h,RegExpPrototypeExec:p,String:d,StringPrototypeToUpperCase:y,StringPrototypeTrim:g}=e5(),{hideStackFrames:b,codes:{ERR_SOCKET_BAD_PORT:m,ERR_INVALID_ARG_TYPE:_,ERR_INVALID_ARG_VALUE:v,ERR_OUT_OF_RANGE:w,ERR_UNKNOWN_SIGNAL:S}}=e8(),{normalizeEncoding:E}=tp(),{isAsyncFunction:A,isArrayBufferView:I}=tp().types,k={},O=/^[0-7]+$/,x=b((e,t,r=u,n=l)=>{if("number"!=typeof e)throw new _(t,"number",e);if(!s(e))throw new w(t,"an integer",e);if(e<r||e>n)throw new w(t,`>= ${r} && <= ${n}`,e)}),P=b((e,t,r=-2147483648,n=2147483647)=>{if("number"!=typeof e)throw new _(t,"number",e);if(!s(e))throw new w(t,"an integer",e);if(e<r||e>n)throw new w(t,`>= ${r} && <= ${n}`,e)}),T=b((e,t,r=!1)=>{if("number"!=typeof e)throw new _(t,"number",e);if(!s(e))throw new w(t,"an integer",e);let n=r?1:0;if(e<n||e>4294967295)throw new w(t,`>= ${n} && <= 4294967295`,e)});function R(e,t){if("string"!=typeof e)throw new _(t,"string",e)}var C=b((e,t,r)=>{if(!n(r,e))throw new v(t,e,"must be one of: "+i(o(r,e=>"string"==typeof e?`'${e}'`:d(e)),", "))});function j(e,t){if("boolean"!=typeof e)throw new _(t,"boolean",e)}function M(e,t,r){return null!=e&&h(e,t)?e[t]:r}var B=b((e,t,n=null)=>{let i=M(n,"allowArray",!1),o=M(n,"allowFunction",!1);if(!M(n,"nullable",!1)&&null===e||!i&&r(e)||"object"!=typeof e&&(!o||"function"!=typeof e))throw new _(t,"Object",e)}),N=b((e,t)=>{if(null!=e&&"object"!=typeof e&&"function"!=typeof e)throw new _(t,"a dictionary",e)}),U=b((e,t,n=0)=>
2{if(!r(e))throw new _(t,"Array",e);if(e.length<n)throw new v(t,e,`must be longer than ${n}`)}),L=b((e,t="buffer")=>{if(!I(e))throw new _(t,["Buffer","TypedArray","DataView"],e)}),D=b((e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new _(t,"AbortSignal",e)}),F=b((e,t)=>{if("function"!=typeof e)throw new _(t,"Function",e)}),W=b((e,t)=>{if("function"!=typeof e||A(e))throw new _(t,"Function",e)}),q=b((e,t)=>{if(void 0!==e)throw new _(t,"undefined",e)}),$=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function H(e,t){if(typeof e>"u"||!p($,e))throw new v(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}t.exports={isInt32:function(e){return e===(0|e)},isUint32:function(e){return e===e>>>0},parseFileMode:function(e,t,r){if(typeof e>"u"&&(e=r),"string"==typeof e){if(null===p(O,e))throw new v(t,e,"must be a 32-bit unsigned integer or an octal string");e=c(e,8)}return T(e,t),e},validateArray:U,validateStringArray:function(e,t){U(e,t);for(let r=0;r<e.length;r++)R(e[r],`${t}[${r}]`)},validateBooleanArray:function(e,t){U(e,t);for(let r=0;r<e.length;r++)j(e[r],`${t}[${r}]`)},validateAbortSignalArray:function(e,t){U(e,t);for(let r=0;r<e.length;r++){let n=e[r],i=`${t}[${r}]`;if(null==n)throw new _(i,"AbortSignal",n);D(n,i)}},validateBoolean:j,validateBuffer:L,validateDictionary:N,validateEncoding:function(e,t){let r=E(t),n=e.length;if("hex"===r&&n%2!=0)throw new v("encoding",t,`is invalid for data of length ${n}`)},validateFunction:F,validateInt32:P,validateInteger:x,validateNumber:function(e,t,r,n){if("number"!=typeof e)throw new _(t,"number",e);if(null!=r&&e<r||null!=n&&e>n||(null!=r||null!=n)&&a(e))throw new w(t,`${null!=r?`>= ${r}`:""}${null!=r&&null!=n?" && ":""}${null!=n?`<= ${n}`:""}`,e)},validateObject:B,validateOneOf:C,validatePlainFunction:W,validatePort:function(e,t="Port",r=!0){if("number"!=typeof e&&"string"!=typeof e||"string"==typeof e&&0===g(e).length||+e!=+e>>>0||e>65535||0===e&&!r)throw new m(t,e,r);return 0|e},validateSignalName:function(e,t="signal"){if(R(e,t),void 0===k[e])throw new S(void 0!==k[y(e)]?e+" (signals must use all capital letters)":e)},validateString:R,validateUint32:T,validateUndefined:q,validateUnion:function(e,t,r){if(!n(r,e))throw new _(t,`('${i(r,"|")}')`,e)},validateAbortSignal:D,validateLinkHeaderValue:function(e){if("string"==typeof e)return H(e,"hints"),e;if(r(e)){let t=e.length,r="";if(0===t)return r;for(let n=0;n<t;n++){let i=e[n];H(i,"hints"),r+=i,n!==t-1&&(r+=", ")}return r}throw new v("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}}}),ty=l((e,t)=>{f(),e6(),eY();var r,n,i=t.exports={};function o(){throw Error("setTimeout has not been defined")}function s(){throw Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch{try{return r.call(null,e,0)}catch{return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch{r=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch{n=s}}();var l,u=[],c=!1,h=-1;function p(){c&&l&&(c=!1,l.length?u=l.concat(u):h=-1,u.length&&d())}function d(){if(!c){var e=a(p);c=!0;for(var t=u.length;t;){for(l=u,u=[];++h<t;)l&&l[h].run();h=-1,t=u.length}l=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch{try{return n.call(null,e)}catch{return n.call(this,e)}}}(e)}}function y(e,t){this.fun=e,this.array=t}function g(){}i.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new y(e,t)),1!==u.length||c||a(d)},y.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(e){return[]},i.binding=function(e){throw Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw Error("process.chdir is not supported")},i.umask=function(){return 0}}),tg=l((e,t)=>
2{f(),e6(),eY();var{SymbolAsyncIterator:r,SymbolIterator:n,SymbolFor:i}=e5(),o=i("nodejs.stream.destroyed"),s=i("nodejs.stream.errored"),a=i("nodejs.stream.readable"),l=i("nodejs.stream.writable"),u=i("nodejs.stream.disturbed"),c=i("nodejs.webstream.isClosedPromise"),h=i("nodejs.webstream.controllerErrorFunction");function p(e,t=!1){var r;return!!(e&&"function"==typeof e.pipe&&"function"==typeof e.on&&(!t||"function"==typeof e.pause&&"function"==typeof e.resume)&&(!e._writableState||(null===(r=e._readableState)||void 0===r?void 0:r.readable)!==!1)&&(!e._writableState||e._readableState))}function d(e){var t;return!!(e&&"function"==typeof e.write&&"function"==typeof e.on&&(!e._readableState||(null===(t=e._writableState)||void 0===t?void 0:t.writable)!==!1))}function y(e){return e&&(e._readableState||e._writableState||"function"==typeof e.write&&"function"==typeof e.on||"function"==typeof e.pipe&&"function"==typeof e.on)}function g(e){return!!(e&&!y(e)&&"function"==typeof e.pipeThrough&&"function"==typeof e.getReader&&"function"==typeof e.cancel)}function b(e){return!!(e&&!y(e)&&"function"==typeof e.getWriter&&"function"==typeof e.abort)}function m(e){return!!(e&&!y(e)&&"object"==typeof e.readable&&"object"==typeof e.writable)}function _(e){if(!y(e))return null;let t=e._writableState,r=e._readableState,n=t||r;return!!(e.destroyed||e[o]||null!=n&&n.destroyed)}function v(e){if(!d(e))return null;if(!0===e.writableEnded)return!0;let t=e._writableState;return(null==t||!t.errored)&&("boolean"!=typeof t?.ended?null:t.ended)}function w(e,t){if(!p(e))return null;let r=e._readableState;return(null==r||!r.errored)&&("boolean"!=typeof r?.endEmitted?null:!!(r.endEmitted||!1===t&&!0===r.ended&&0===r.length))}function S(e){return e&&null!=e[a]?e[a]:"boolean"!=typeof e?.readable?null:!_(e)&&p(e)&&e.readable&&!w(e)}function E(e){return e&&null!=e[l]?e[l]:"boolean"!=typeof e?.writable?null:!_(e)&&d(e)&&e.writable&&!v(e)}function A(e){return"boolean"==typeof e._closed&&"boolean"==typeof e._defaultKeepAlive&&"boolean"==typeof e._removedConnection&&"boolean"==typeof e._removedContLen}function I(e){return"boolean"==typeof e._sent100&&A(e)}t.exports={isDestroyed:_,kIsDestroyed:o,isDisturbed:function(e){var t;return!!(e&&(null!==(t=e[u])&&void 0!==t?t:e.readableDidRead||e.readableAborted))},kIsDisturbed:u,isErrored:function(e){var t,r,n,i,o,a,l,u,c,h;return!!(e&&(null!==(t=null!==(r=null!==(n=null!==(i=null!==(o=null!==(a=e[s])&&void 0!==a?a:e.readableErrored)&&void 0!==o?o:e.writableErrored)&&void 0!==i?i:null===(l=e._readableState)||void 0===l?void 0:l.errorEmitted)&&void 0!==n?n:null===(u=e._writableState)||void 0===u?void 0:u.errorEmitted)&&void 0!==r?r:null===(c=e._readableState)||void 0===c?void 0:c.errored)&&void 0!==t?t:!(null===(h=e._writableState)||void 0===h)&&h.errored))},kIsErrored:s,isReadable:S,kIsReadable:a,kIsClosedPromise:c,kControllerErrorFunction:h,kIsWritable:l,isClosed:function(e){if(!y(e))return null;if("boolean"==typeof e.closed)return e.closed;let t=e._writableState,r=e._readableState;return"boolean"==typeof t?.closed||"boolean"==typeof r?.closed?t?.closed||r?.closed:"boolean"==typeof e._closed&&A(e)?e._closed:null},isDuplexNodeStream:function(e){return!!(e&&"function"==typeof e.pipe&&e._readableState&&"function"==typeof e.on&&"function"==typeof e.write)},isFinished:function(e,t){return y(e)?!!_(e)||!(t?.readable!==!1&&S(e)||t?.writable!==!1&&E(e)):null},isIterable:function(e,t){return null!=e&&(!0===t?"function"==typeof e[r]:!1===t?"function"==typeof e[n]:"function"==typeof e[r]||"function"==typeof e[n])},isReadableNodeStream:p,isReadableStream:g,isReadableEnded:function(e){if(!p(e))return null;if(!0===e.readableEnded)return!0;let t=e._readableState;return!!t&&!t.errored&&("boolean"!=typeof t?.ended?null:t.ended)},isReadableFinished:w,isReadableErrored:function(e){var t,r;return y(e)?e.readableErrored?e.readableErrored:null!==(t=null===(r=e._readableState)||void 0===r?void 0:r.errored)&&void 0!==t?t:null:null},isNodeStream:y,isWebStream:function(e){return g(e)||b(e)||m(e)}
2,isWritable:E,isWritableNodeStream:d,isWritableStream:b,isWritableEnded:v,isWritableFinished:function(e,t){if(!d(e))return null;if(!0===e.writableFinished)return!0;let r=e._writableState;return(null==r||!r.errored)&&("boolean"!=typeof r?.finished?null:!!(r.finished||!1===t&&!0===r.ended&&0===r.length))},isWritableErrored:function(e){var t,r;return y(e)?e.writableErrored?e.writableErrored:null!==(t=null===(r=e._writableState)||void 0===r?void 0:r.errored)&&void 0!==t?t:null:null},isServerRequest:function(e){var t;return"boolean"==typeof e._consuming&&"boolean"==typeof e._dumped&&(null===(t=e.req)||void 0===t?void 0:t.upgradeOrConnect)===void 0},isServerResponse:I,willEmitClose:function(e){if(!y(e))return null;let t=e._writableState,r=e._readableState,n=t||r;return!n&&I(e)||!!(n&&n.autoDestroy&&n.emitClose&&!1===n.closed)},isTransformStream:m}}),tb=l((e,t)=>{f(),e6(),eY();var r,n=ty(),{AbortError:i,codes:o}=e8(),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_PREMATURE_CLOSE:a}=o,{kEmptyObject:l,once:u}=tp(),{validateAbortSignal:c,validateFunction:h,validateObject:p,validateBoolean:d}=td(),{Promise:y,PromisePrototypeThen:g,SymbolDispose:b}=e5(),{isClosed:m,isReadable:_,isReadableNodeStream:v,isReadableStream:w,isReadableFinished:S,isReadableErrored:E,isWritable:A,isWritableNodeStream:I,isWritableStream:k,isWritableFinished:O,isWritableErrored:x,isNodeStream:P,willEmitClose:T,kIsClosedPromise:R}=tg(),C=()=>{};function j(e,t,o){var f,d;if(2==arguments.length?(o=t,t=l):null==t?t=l:p(t,"options"),h(o,"callback"),
2c(t.signal,"options.signal"),o=u(o),w(e)||k(e))return function(e,t,o){let s=!1,a=C;if(t.signal){if(a=()=>{s=!0,o.call(e,new i(void 0,{cause:t.signal.reason}))},t.signal.aborted)n.nextTick(a);else{let n=(r=r||tp().addAbortListener)(t.signal,a),i=o;o=u((...t)=>{n[b](),i.apply(e,t)})}}let l=(...t)=>{s||n.nextTick(()=>o.apply(e,t))};return g(e[R].promise,l,l),C}(e,t,o);if(!P(e))throw new s("stream",["ReadableStream","WritableStream","Stream"],e);let y=null!==(f=t.readable)&&void 0!==f?f:v(e),j=null!==(d=t.writable)&&void 0!==d?d:I(e),M=e._writableState,B=e._readableState,N=()=>{e.writable||D()},U=T(e)&&v(e)===y&&I(e)===j,L=O(e,!1),D=()=>{L=!0,e.destroyed&&(U=!1),U&&(!e.readable||y)||y&&!F||o.call(e)},F=S(e,!1),W=()=>{F=!0,e.destroyed&&(U=!1),U&&(!e.writable||j)||j&&!L||o.call(e)},q=t=>{o.call(e,t)},$=m(e),H=()=>{$=!0;let t=x(e)||E(e);return t&&"boolean"!=typeof t?o.call(e,t):y&&!F&&v(e,!0)&&!S(e,!1)||j&&!L&&!O(e,!1)?o.call(e,new a):void o.call(e)},V=()=>{$=!0;let t=x(e)||E(e);if(t&&"boolean"!=typeof t)return o.call(e,t);o.call(e)},z=()=>{e.req.on("finish",D)};e.setHeader&&"function"==typeof e.abort?(e.on("complete",D),U||e.on("abort",H),e.req?z():e.on("request",z)):j&&!M&&(e.on("end",N),e.on("close",N)),U||"boolean"!=typeof e.aborted||e.on("aborted",H),e.on("end",W),e.on("finish",D),!1!==t.error&&e.on("error",q),e.on("close",H),$?n.nextTick(H):null!=M&&M.errorEmitted||null!=B&&B.errorEmitted?U||n.nextTick(V):(!y&&(!U||_(e))&&(L||!1===A(e))||!j&&(!U||A(e))&&(F||!1===_(e))||B&&e.req&&e.aborted)&&n.nextTick(V);let K=()=>{o=C,e.removeListener("aborted",H),e.removeListener("complete",D),e.removeListener("abort",H),e.removeListener("request",z),e.req&&e.req.removeListener("finish",D),e.removeListener("end",N),e.removeListener("close",N),e.removeListener("finish",D),e.removeListener("end",W),e.removeListener("error",q),e.removeListener("close",H)};if(t.signal&&!$){let s=()=>{let r=o;K(),r.call(e,new i(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)n.nextTick(s);else{let n=(r=r||tp().addAbortListener)(t.signal,s),i=o;o=u((...t)=>{n[b](),i.apply(e,t)})}}return K}t.exports=j,t.exports.finished=function(e,t){var r;let n=!1;return null===t&&(t=l),null!==(r=t)&&void 0!==r&&r.cleanup&&(d(t.cleanup,"cleanup"),n=t.cleanup),new y((r,i)=>{let o=j(e,t,e=>{n&&o(),e?i(e):r()})})}}),tm=l((e,t)=>{f(),e6(),eY();var r=ty(),{aggregateTwoErrors:n,codes:{ERR_MULTIPLE_CALLBACK:i},AbortError:o}=e8(),{Symbol:s}=e5(),{kIsDestroyed:a,isDestroyed:l,isFinished:u,isServerRequest:c}=tg(),h=s("kDestroy"),p=s("kConstruct");function d(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function y(e,t,n){let i=!1;function o(t){if(i)return;i=!0;let o=e._readableState,s=e._writableState;d(t,s,o),s&&(s.closed=!0),o&&(o.closed=!0),"function"==typeof n&&n(t),t?r.nextTick(g,e,t):r.nextTick(b,e)}try{e._destroy(t||null,o)}catch(e){o(e)}}function g(e,t){m(e,t),b(e)}function b(e){let t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(null!=r&&r.emitClose||null!=t&&t.emitClose)&&e.emit("close")}function m(e,t){let r=e._readableState,n=e._writableState;null!=n&&n.errorEmitted||null!=r&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function _(e,t,n){let i=e._readableState,o=e._writableState;if(null!=o&&o.destroyed||null!=i&&i.destroyed)return this;null!=i&&i.autoDestroy||null!=o&&o.autoDestroy?e.destroy(t):t&&(t.stack,o&&!o.errored&&(o.errored=t),i&&!i.errored&&(i.errored=t),n?r.nextTick(m,e,t):m(e,t))}function v(e){let t=!1;
2function n(n){if(t){_(e,n??new i);return}t=!0;let o=e._readableState,s=e._writableState,a=s||o;o&&(o.constructed=!0),s&&(s.constructed=!0),a.destroyed?e.emit(h,n):n?_(e,n,!0):r.nextTick(w,e)}try{e._construct(e=>{r.nextTick(n,e)})}catch(e){r.nextTick(n,e)}}function w(e){e.emit(p)}function S(e){return e?.setHeader&&"function"==typeof e.abort}function E(e){e.emit("close")}function A(e,t){e.emit("error",t),r.nextTick(E,e)}t.exports={construct:function(e,t){if("function"!=typeof e._construct)return;let n=e._readableState,i=e._writableState;n&&(n.constructed=!1),i&&(i.constructed=!1),e.once(p,t),e.listenerCount(p)>1||r.nextTick(v,e)},destroyer:function(e,t){!e||l(e)||(t||u(e)||(t=new o),c(e)?(e.socket=null,e.destroy(t)):S(e)?e.abort():S(e.req)?e.req.abort():"function"==typeof e.destroy?e.destroy(t):"function"==typeof e.close?e.close():t?r.nextTick(A,e,t):r.nextTick(E,e),e.destroyed||(e[a]=!0))},destroy:function(e,t){let r=this._readableState,i=this._writableState,o=i||r;return null!=i&&i.destroyed||null!=r&&r.destroyed?"function"==typeof t&&t():(d(e,i,r),i&&(i.destroyed=!0),r&&(r.destroyed=!0),o.constructed?y(this,e,t):this.once(h,function(r){y(this,n(r,e),t)})),this},undestroy:function(){let e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=!1===e.readable,e.endEmitted=!1===e.readable),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=!1===t.writable,t.ending=!1===t.writable,t.finished=!1===t.writable)},errorOrDestroy:_}}),t_=l((e,t)=>{f(),e6(),eY();var{ArrayIsArray:r,ObjectSetPrototypeOf:n}=e5(),{EventEmitter:i}=(tf(),h(e7));function o(e){i.call(this,e)}function s(e,t,n){if("function"==typeof e.prependListener)return e.prepe
2ndListener(t,n);e._events&&e._events[t]?r(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}n(o.prototype,i.prototype),n(o,i),o.prototype.pipe=function(e,t){let r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",l),r.on("close",u));let a=!1;function l(){a||(a=!0,e.end())}function u(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){h(),0===i.listenerCount(this,"error")&&this.emit("error",e)}function h(){r.removeListener("data",n),e.removeListener("drain",o),r.removeListener("end",l),r.removeListener("close",u),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",h),r.removeListener("close",h),e.removeListener("close",h)}return s(r,"error",c),s(e,"error",c),r.on("end",h),r.on("close",h),e.on("close",h),e.emit("pipe",r),e},t.exports={Stream:o,prependListener:s}}),tv=l((e,t)=>{f(),e6(),eY();var r,{SymbolDispose:n}=e5(),{AbortError:i,codes:o}=e8(),{isNodeStream:s,isWebStream:a,kControllerErrorFunction:l}=tg(),u=tb(),{ERR_INVALID_ARG_TYPE:c}=o,h=(e,t)=>{if("object"!=typeof e||!("aborted"in e))throw new c(t,"AbortSignal",e)};t.exports.addAbortSignal=function(e,r){if(h(e,"signal"),!s(r)&&!a(r))throw new c("stream",["ReadableStream","WritableStream","Stream"],r);return t.exports.addAbortSignalNoValidate(e,r)},t.exports.addAbortSignalNoValidate=function(e,t){if("object"!=typeof e||!("aborted"in e))return t;let o=s(t)?()=>{t.destroy(new i(void 0,{cause:e.reason}))}:()=>{t[l](new i(void 0,{cause:e.reason}))};return e.aborted?o():u(t,(r=r||tp().addAbortListener)(e,o)[n]),t}}),tw=l((e,t)=>{f(),e6(),eY();var{StringPrototypeSlice:r,SymbolIterator:n,TypedArrayPrototypeSet:i,Uint8Array:o}=e5(),{Buffer:s}=(e3(),h(eX)),{inspect:a}=tp();t.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){let t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}shift(){if(0===this.length)return;let e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(0===this.length)return"";let t=this.head,r=""+t.data;for(;null!==(t=t.next);)r+=e+t.data;return r}concat(e){if(0===this.length)return s.alloc(0);let t=s.allocUnsafe(e>>>0),r=this.head,n=0;for(;r;)i(t,r.data,n),n+=r.data.length,r=r.next;return t}consume(e,t){let r=this.head.data;if(e<r.length){let t=r.slice(0,e);return this.head.data=r.slice(e),t}return e===r.length?this.shift():t?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[n](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t="",n=this.head,i=0;do{let o=n.data;if(e>o.length)t+=o,e-=o.length;else{e===o.length?(t+=o,++i,n.next?this.head=n.next:this.head=this.tail=null):(t+=r(o,0,e),this.head=n,n.data=r(o,e));break}++i}while(null!==(n=n.next));return this.length-=i,t}_getBuffer(e){let t=s.allocUnsafe(e),r=e,n=this.head,a=0;do{let s=n.data;if(e>s.length)i(t,s,r-e),e-=s.length;else{e===s.length?(i(t,s,r-e),++a,n.next?this.head=n.next:this.head=this.tail=null):(i(t,new o(s.buffer,s.byteOffset,e),r-e),this.head=n,n.data=s.slice(e));break}++a}while(null!==(n=n.next));return this.length-=a,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return a(this,{...t,depth:0,customInspect:!1})}}}),tS=l((e,t)=>{f(),e6(),eY();var{MathFloor:r,NumberIsInteger:n}=e5(),{validateInteger:i}=td(),{ERR_INVALID_ARG_VALUE:o}=e8().codes,s=16384,a=16;function l(e){return e?a:s}t.exports={getHighWaterMark:function(e,t,i,s){let a=null!=t.highWaterMark?t.highWaterMark:s?t[i]:null;if(null!=a){if(!n(a)||a<0)throw new o(s?`options.${i}`:"options.highWaterMark",a);return r(a)}return l(e.objectMode)},getDefaultHighWaterMark:l,setDefaultHighWaterMark:function(e,t){i(t,"value",0),e?a=t:s=t}}}),tE=l((e,t)=>{f(),e6(),eY();var r=(e3(),h(eX)),n=r.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=o),o.prototype=Object.create(n.prototype),i(n,o),o.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return n(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var i=n(e);return void 0!==t?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},o.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return n(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return r.SlowBuffer(e)}}),tA=l(e=>{f(),e6(),eY();var t=tE().Buffer,r=t.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function n(e){var n;switch(this.encoding=function(e){var n=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";
2case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof n&&(t.isEncoding===r||!r(e)))throw Error("Unknown encoding: "+e);return n||e}(e),this.encoding){case"utf16le":this.text=s,this.end=a,n=4;break;case"utf8":this.fillLast=o,n=4;break;case"base64":this.text=l,this.end=u,n=3;break;default:this.write=c,this.end=h;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(n)}function i(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function o(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if((192&t[0])!=128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((192&t[1])!=128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(192&t[2])!=128)return e.lastNeed=2,"�"}}(this,e,0);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length)}function s(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function a(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function u(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function c(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}e.StringDecoder=n,n.prototype.write=function(e){var t,r;if(0===e.length)return"";if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},n.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},n.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var o=i(t[n]);return o>=0?(o>0&&(e.lastNeed=o-1),o):--n<r||-2===o?0:(o=i(t[n]))>=0?(o>0&&(e.lastNeed=o-2),o):--n<r||-2===o?0:(o=i(t[n]))>=0?(o>0&&(2===o?o=0:e.lastNeed=o-3),o):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},n.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}}),tI=l((e,t)=>{f(),e6(),eY();var r=ty(),{PromisePrototypeThen:n,SymbolAsyncIterator:i,SymbolIterator:o}=e5(),{Buffer:s}=(e3(),h(eX)),{ERR_INVALID_ARG_TYPE:a,ERR_STREAM_NULL_VALUES:l}=e8().codes;t.exports=function(e,t,u){let c,h;if("string"==typeof t||t instanceof s)return new e({objectMode:!0,...u,read(){this.push(t),this.push(null)}});if(t&&t[i])h=!0,c=t[i]();else if(t&&t[o])h=!1,c=t[o]();else throw new a("iterable",["Iterable"],t);let f=new e({objectMode:!0,highWaterMark:1,...u}),p=!1;async function d(e){let t=null!=e,r="function"==typeof c.throw;if(t&&r){let{value:t,done:r}=await c.throw(e);if(await t,r)return}if("function"==typeof c.return){let{value:e}=await c.return();await e}}async function y(){for(;;){try{let{value:e,done:t}=h?await c.next():c.next();if(t)f.push(null);else{let t=e&&"function"==typeof e.then?await e:e;if(null===t)throw p=!1,new l;if(f.push(t))continue;p=!1}}catch(e){f.destroy(e)}break}}return f._read=function(){p||(p=!0,y())},f._destroy=function(e,t){n(d(e),()=>r.nextTick(t,e),n=>r.nextTick(t,n||e))},f}}),tk=l((e,t)=>
2{f(),e6(),eY();var r,n=ty(),{ArrayPrototypeIndexOf:i,NumberIsInteger:o,NumberIsNaN:s,NumberParseInt:a,ObjectDefineProperties:l,ObjectKeys:u,ObjectSetPrototypeOf:c,Promise:p,SafeSet:d,SymbolAsyncDispose:y,SymbolAsyncIterator:g,Symbol:b}=e5();t.exports=H,H.ReadableState=$;var{EventEmitter:m}=(tf(),h(e7)),{Stream:_,prependListener:v}=t_(),{Buffer:w}=(e3(),h(eX)),{addAbortSignal:S}=tv(),E=tb(),A=tp().debuglog("stream",e=>{A=e}),I=tw(),k=tm(),{getHighWaterMark:O,getDefaultHighWaterMark:x}=tS(),{aggregateTwoErrors:P,codes:{ERR_INVALID_ARG_TYPE:T,ERR_METHOD_NOT_IMPLEMENTED:R,ERR_OUT_OF_RANGE:C,ERR_STREAM_PUSH_AFTER_EOF:j,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:M},AbortError:B}=e8(),{validateObject:N}=td(),U=b("kPaused"),{StringDecoder:L}=tA(),D=tI();c(H.prototype,_.prototype),c(H,_);var F=()=>{},{errorOrDestroy:W}=k;function q(e){return{enumerable:!1,get(){return(this.state&e)!=0},set(t){t?this.state|=e:this.state&=~e}}}function $(e,t,r){"boolean"!=typeof r&&(r=t instanceof tP()),this.state=6192,e&&e.objectMode&&(this.state|=1),r&&e&&e.readableObjectMode&&(this.state|=1),this.highWaterMark=e?O(this,e,"readableHighWaterMark",r):x(!1),this.buffer=new I,this.length=0,this.pipes=[],this.flowing=null,this[U]=null,e&&!1===e.emitClose&&(this.state&=-2049),e&&!1===e.autoDestroy&&(this.state&=-4097),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new L(e.encoding),this.encoding=e.encoding)}function H(e){if(!(this instanceof H))return new H(e);let t=this instanceof tP();this._readableState=new $(e,this,t),e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&!t&&S(e.signal,this)),_.call(this,e),k.construct(this,()=>{this._readableState.needReadable&&Y(this,this._readableState)})}function V(e,t,r,n){A("readableAddChunk",t);let i=e._readableState,o;if((1&i.state)==0&&("string"==typeof t?(r=r||i.defaultEncoding,i.encoding!==r&&(n&&i.encoding?t=w.from(t,r).toString(i.encoding):(t=w.from(t,r),r=""))):t instanceof w?r="":_._isUint8Array(t)?(t=_._uint8ArrayToBuffer(t),r=""):null!=t&&(o=new T("chunk",["string","Buffer","Uint8Array"],t))),o)W(e,o);else if(null===t)i.state&=-9,function(e,t){if(A("onEofChunk"),!t.ended){if(t.decoder){let e=t.decoder.end();e&&e.length&&(t.buffer.push(e),t.length+=t.objectMode?1:e.length)}t.ended=!0,t.sync?G(e):(t.needReadable=!1,t.emittedReadable=!0,Q(e))}}(e,i);else if((1&i.state)!=0||t&&t.length>0){if(n){if((4&i.state)!=0)W(e,new M);else{if(i.destroyed||i.errored)return!1;z(e,i,t,!0)}}else if(i.ended)W(e,new j);else{if(i.destroyed||i.errored)return!1;i.state&=-9,i.decoder&&!r?(t=i.decoder.write(t),i.objectMode||0!==t.length?z(e,i,t,!1):Y(e,i)):z(e,i,t,!1)}}else n||(i.state&=-9,Y(e,i));return!i.ended&&(i.length<i.highWaterMark||0===i.length)}function z(e,t,r,n){t.flowing&&0===t.length&&!t.sync&&e.listenerCount("data")>0?((65536&t.state)!=0?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),(64&t.state)!=0&&G(e)),Y(e,t)}function K(e,t){return e<=0||0===t.length&&t.ended?0:(1&t.state)!=0?1:s(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}function G(e){let t=e._readableState;A("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(A("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(Q,e))}function Q(e){let t=e._readableState;A("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&!t.errored&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,et(e)}function Y(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,n.nextTick(J,e,t))}function J(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){let r=t.length;if(A("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function X(e){let t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!1===t[U]?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function Z(e){A("readable nexttick read 0"),e.read(0)}function ee(e,t){A("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),et(e),t.flowing&&!t.reading&&e.read(0)}function et(e){let t=e._readableState;for(A("flow",t.flowing);t.flowing&&null!==e.read(););}function er(e,t){"function"!=typeof e.read&&(e=H.wrap(e,{objectMode:!0}));let r=en(e,t);return r.stream=e,r}async function*en(e,t){let r=F;function n(t){this===e?(r(),r=F):r=t}e.on("readable",n);let i,o=E(e,{writable:!1},e=>{i=e?P(i,e):null,r(),r=F});try{for(;;){let t=e.destroyed?null:e.read();if(null!==t)yield t;else{if(i)throw i;if(null===i)return;await new p(n)}}}catch(e){throw i=P(i,e)}finally{(i||t?.destroyOnReturn!==!1)&&(void 0===i||e._readableState.autoDestroy)?k.destroyer(e,null):(e.off("readable",n),o())}}function ei(e,t){let r;return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r)}function eo(e){let t=e._readableState;A("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(es,t,e))}function es(e,t){if(A("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&0===e.length){if(e.endEmitted=!0,t.emit("end"),t.writable&&!1===t.allowHalfOpen)n.nextTick(ea,t);else if(e.autoDestroy){let e=t._writableState;(!e||e.autoDestroy&&(e.finished||!1===e.writable))&&t.destroy()}}}function ea(e){!e.writable||e.writableEnded||e.destroyed||e.end()}function el(){return void 0===r&&(r={}),r}l($.prototype,{objectMode:q(1),ended:q(2),endEmitted:q(4),reading:q(8),constructed:q(16),sync:q(32),needReadable:q(64),emittedReadable:q(128),readableListening:q(256),resumeScheduled:q(512),errorEmitted:q(1024),emitClose:q(2048),autoDestroy:q(4096),destroyed:q(8192),closed:q(16384),closeEmitted:q(32768),multiAwaitDrain:q(65536),readingMore:q(131072),dataEmitted:q(262144)}),H.prototype.destroy=k.destroy,H.prototype._undestroy=k.undestroy,H.prototype._destroy=function(e,t){t(e)},H.prototype[m.captureRejectionSymbol]=function(e){this.destroy(e)},H.prototype[y]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new B,this.destroy(e)),new p((t,r)=>E(this,n=>n&&n!==e?r(n):t(null)))},H.prototype.push=function(e,t){return V(this,e,t,!1)},H.prototype.unshift=function(e,t){return V(this,e,t,!0)},H.prototype.isPaused=function(){let e=this._readableState;return!0===e[U]||!1===e.flowing},H.prototype.setEncoding=function(e){let t=new L(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,n="";for(let e of r)n+=t.write(e);return r.clear(),""!==n&&r.push(n),this._readableState.length=n.length,this},H.prototype.read=function(e){let t;A("read",e),void 0===e?e=NaN:o(e)||(e=a(e,10));let r=this._readableState,n=e;if(e>r.highWaterMark&&(r.highWaterMark=function(e){if(e>1073741824)throw new C("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,++e}
2(e)),0!==e&&(r.state&=-129),0===e&&r.needReadable&&((0!==r.highWaterMark?r.length>=r.highWaterMark:r.length>0)||r.ended))return A("read: emitReadable",r.length,r.ended),0===r.length&&r.ended?eo(this):G(this),null;if(0===(e=K(e,r))&&r.ended)return 0===r.length&&eo(this),null;let i=(64&r.state)!=0;if(A("need readable",i),(0===r.length||r.length-e<r.highWaterMark)&&A("length less than watermark",i=!0),r.ended||r.reading||r.destroyed||r.errored||!r.constructed)A("reading, ended or constructing",i=!1);else if(i){A("do read"),r.state|=40,0===r.length&&(r.state|=64);try{this._read(r.highWaterMark)}catch(e){W(this,e)}r.state&=-33,r.reading||(e=K(n,r))}return null===(t=e>0?ei(e,r):null)?(r.needReadable=r.length<=r.highWaterMark,e=0):(r.length-=e,r.multiAwaitDrain?r.awaitDrainWriters.clear():r.awaitDrainWriters=null),0===r.length&&(r.ended||(r.needReadable=!0),n!==e&&r.ended&&eo(this)),null===t||r.errorEmitted||r.closeEmitted||(r.dataEmitted=!0,this.emit("data",t)),t},H.prototype._read=function(e){throw new R("_read()")},H.prototype.pipe=function(e,t){let r=this,i=this._readableState;1===i.pipes.length&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new d(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(e),A("pipe count=%d opts=%j",i.pipes.length,t);let o=t&&!1===t.end||e===n.stdout||e===n.stderr?y:s;function s(){A("onend"),e.end()}i.endEmitted?n.nextTick(o):r.once("end",o),e.on("unpipe",function t(n,o){A("onunpipe"),n===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,A("cleanup"),e.removeListener("close",f),e.removeListener("finish",p),a&&e.removeListener("drain",a),e.removeListener("error",h),e.removeListener("unpipe",t),r.removeListener("end",s),r.removeListener("end",y),r.removeListener("data",c),l=!0,a&&i.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&a())});let a,l=!1;function u(){l||(1===i.pipes.length&&i.pipes[0]===e?(A("false write response, pause",0),i.awaitDrainWriters=e,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(e)&&(A("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(e)),r.pause()),a||(a=function(){let t=r._readableState;t.awaitDrainWriters===e?(A("pipeOnDrain",1),t.awaitDrainWriters=null):t.multiAwaitDrain&&(A("pipeOnDrain",t.awaitDrainWriters.size),t.awaitDrainWriters.delete(e)),(!t.awaitDrainWriters||0===t.awaitDrainWriters.size)&&r.listenerCount("data")&&r.resume()},e.on("drain",a))}function c(t){A("ondata");let r=e.write(t);A("dest.write",r),!1===r&&u()}function h(t){if(A("onerror",t),y(),e.removeListener("error",h),0===e.listenerCount("error")){let r=e._writableState||e._readableState;r&&!r.errorEmitted?W(e,t):e.emit("error",t)}}function f(){e.removeListener("finish",p),y()}function p(){A("onfinish"),e.removeListener("close",f),y()}function y(){A("unpipe"),r.unpipe(e)}return r.on("data",c),v(e,"error",h),e.once("close",f),e.once("finish",p),e.emit("pipe",r),!0===e.writableNeedDrain?u():i.flowing||(A("pipe resume"),r.resume()),e},H.prototype.unpipe=function(e){let t=this._readableState;if(0===t.pipes.length)return this;if(!e){let e=t.pipes;t.pipes=[],this.pause();for(let t=0;t<e.length;t++)e[t].emit("unpipe",this,{hasUnpiped:!1});return this}let r=i(t.pipes,e);return -1===r||(t.pipes.splice(r,1),0===t.pipes.length&&this.pause(),e.emit("unpipe",this,{hasUnpiped:!1})),this},H.prototype.on=function(e,t){let r=_.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"!==e||i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,A("on readable",i.length,i.reading),i.length?G(this):i.reading||n.nextTick(Z,this)),r},H.prototype.addListener=H.prototype.on,H.prototype.removeListener=function(e,t){let r=_.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(X,this),r},H.prototype.off=H.prototype.removeListener,H.prototype.removeAllListeners=function(e){let t=_.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&n.nextTick(X,this),t},H.prototype.resume=function(){let e=this._readableState;return e.flowing||(A("resume"),e.flowing=!e.readableListening,e.resumeScheduled||(e.resumeScheduled=!0,n.nextTick(ee,this,e))),e[U]=!1,this},H.prototype.pause=function(){return A("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(A("pause"),this._readableState.flowing=!1,this.emit
2("pause")),this._readableState[U]=!0,this},H.prototype.wrap=function(e){let t=!1;e.on("data",r=>{!this.push(r)&&e.pause&&(t=!0,e.pause())}),e.on("end",()=>{this.push(null)}),e.on("error",e=>{W(this,e)}),e.on("close",()=>{this.destroy()}),e.on("destroy",()=>{this.destroy()}),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};let r=u(e);for(let t=1;t<r.length;t++){let n=r[t];void 0===this[n]&&"function"==typeof e[n]&&(this[n]=e[n].bind(e))}return this},H.prototype[g]=function(){return er(this)},H.prototype.iterator=function(e){return void 0!==e&&N(e,"options"),er(this,e)},l(H.prototype,{readable:{__proto__:null,get(){let e=this._readableState;return!!e&&!1!==e.readable&&!e.destroyed&&!e.errorEmitted&&!e.endEmitted},set(e){this._readableState&&(this._readableState.readable=!!e)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(!1!==this._readableState.readable&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.objectMode}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return!!this._readableState&&this._readableState.closed}},destroyed:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.destroyed},set(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.endEmitted}}}),l($.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return!1!==this[U]},set(e){this[U]=!!e}}}),H._fromList=ei,H.from=function(e,t){return D(H,e,t)},H.fromWeb=function(e,t){return el().newStreamReadableFromReadableStream(e,t)},H.toWeb=function(e,t){return el().newReadableStreamFromStreamReadable(e,t)},H.wrap=function(e,t){var r,n;return new H({objectMode:null===(r=null!==(n=e.readableObjectMode)&&void 0!==n?n:e.objectMode)||void 0===r||r,...t,destroy(t,r){k.destroyer(e,t),r(t)}}).wrap(e)}}),tO=l((e,t)=>{f(),e6(),eY();var r,n=ty(),{ArrayPrototypeSlice:i,Error:o,FunctionPrototypeSymbolHasInstance:s,ObjectDefineProperty:a,ObjectDefineProperties:l,ObjectSetPrototypeOf:u,StringPrototypeToLowerCase:c,Symbol:p,SymbolHasInstance:d}=e5();t.exports=N,N.WritableState=M;var{EventEmitter:y}=(tf(),h(e7)),g=t_().Stream,{Buffer:b}=(e3(),h(eX)),m=tm(),{addAbortSignal:_}=tv(),{getHighWaterMark:v,getDefaultHighWaterMark:w}=tS(),{ERR_INVALID_ARG_TYPE:S,ERR_METHOD_NOT_IMPLEMENTED:E,ERR_MULTIPLE_CALLBACK:A,ERR_STREAM_CANNOT_PIPE:I,ERR_STREAM_DESTROYED:k,ERR_STREAM_ALREADY_FINISHED:O,ERR_STREAM_NULL_VALUES:x,ERR_STREAM_WRITE_AFTER_END:P,ERR_UNKNOWN_ENCODING:T}=e8().codes,{errorOrDestroy:R}=m;function C(){}u(N.prototype,g.prototype),u(N,g);var j=p("kOnFinished");function M(e,t,r){"boolean"!=typeof r&&(r=t instanceof tP()),this.objectMode=!!(e&&e.objectMode),r&&(this.objectMode=this.objectMode||!!(e&&e.writableObjectMode)),this.highWaterMark=e?v(this,e,"writableHighWaterMark",r):w(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!!(e&&!1===e.decodeStrings);this.decodeStrings=!n,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=F.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,B(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||!1!==e.emitClose,this.autoDestroy=!e||!1!==e.autoDestroy,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[j]=[]}function B(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}function N(e){let t=this instanceof tP();if(!t&&!s(N,this))return new N(e);this._writableState=new M(e,this,t),e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&_(e.signal,this)),g.call(this,e),m.construct(this,()=>{let e=this._writableState;
2e.writing||H(this,e),z(this,e)})}function U(e,t,r,i){var o,s,a;let l,u,c,h=e._writableState;if("function"==typeof r)i=r,r=h.defaultEncoding;else{if(r){if("buffer"!==r&&!b.isEncoding(r))throw new T(r)}else r=h.defaultEncoding;"function"!=typeof i&&(i=C)}if(null===t)throw new x;if(!h.objectMode){if("string"==typeof t)!1!==h.decodeStrings&&(t=b.from(t,r),r="buffer");else if(t instanceof b)r="buffer";else if(g._isUint8Array(t))t=g._uint8ArrayToBuffer(t),r="buffer";else throw new S("chunk",["string","Buffer","Uint8Array"],t)}return h.ending?c=new P:h.destroyed&&(c=new k("write")),c?(n.nextTick(i,c),R(e,c,!0),c):(h.pendingcb++,o=t,s=r,a=i,l=h.objectMode?1:o.length,h.length+=l,(u=h.length<h.highWaterMark)||(h.needDrain=!0),h.writing||h.corked||h.errored||!h.constructed?(h.buffered.push({chunk:o,encoding:s,callback:a}),h.allBuffers&&"buffer"!==s&&(h.allBuffers=!1),h.allNoop&&a!==C&&(h.allNoop=!1)):(h.writelen=l,h.writecb=a,h.writing=!0,h.sync=!0,e._write(o,s,h.onwrite),h.sync=!1),u&&!h.errored&&!h.destroyed)}function L(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new k("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function D(e,t,r,n){--t.pendingcb,n(r),$(t),R(e,r)}function F(e,t){let r=e._writableState,i=r.sync,o=r.writecb;if("function"!=typeof o){R(e,new A);return}r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t?(t.stack,r.errored||(r.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),i?n.nextTick(D,e,r,t,o):D(e,r,t,o)):(r.buffered.length>r.bufferedIndex&&H(e,r),i?null!==r.afterWriteTickInfo&&r.afterWriteTickInfo.cb===o?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:o,stream:e,state:r},n.nextTick(W,r.afterWriteTickInfo)):q(e,r,1,o))}function W({stream:e,state:t,count:r,cb:n}){return t.afterWriteTickInfo=null,q(e,t,r,n)}function q(e,t,r,n){for(t.ending||e.destroyed||0!==t.length||!t.needDrain||(t.needDrain=!1,e.emit("drain"));r-- >0;)t.pendingcb--,n();t.destroyed&&$(t),z(e,t)}function $(e){var t,r;if(e.writing)return;for(let r=e.bufferedIndex;r<e.buffered.length;++r){let{chunk:n,callback:i}=e.buffered[r],o=e.objectMode?1:n.length;e.length-=o,i(null!==(t=e.errored)&&void 0!==t?t:new k("write"))}let n=e[j].splice(0);for(let t=0;t<n.length;t++)n[t](null!==(r=e.errored)&&void 0!==r?r:new k("end"));B(e)}function H(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;let{buffered:r,bufferedIndex:n,objectMode:o}=t,s=r.length-n;if(!s)return;let a=n;if(t.bufferProcessing=!0,s>1&&e._writev){t.pendingcb-=s-1;let n=t.allNoop?C:e=>{for(let t=a;t<r.length;++t)r[t].callback(e)},o=t.allNoop&&0===a?r:i(r,a);o.allBuffers=t.allBuffers,L(e,t,!0,t.length,o,"",n),B(t)}else{do{let{chunk:n,encoding:i,callback:s}=r[a];r[a++]=null,L(e,t,!1,o?1:n.length,n,i,s)}while(a<r.length&&!t.writing);a===r.length?B(t):a>256?(r.splice(0,a),t.bufferedIndex=0):t.bufferedIndex=a}t.bufferProcessing=!1}function V(e){return e.ending&&!e.destroyed&&e.constructed&&0===e.length&&!e.errored&&0===e.buffered.length&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function z(e,t,r){V(t)&&(t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.finalCalled=!0,function(e,t){let r=!1;function i(i){if(r){R(e,i??A());return}if(r=!0,t.pendingcb--,i){let r=t[j].splice(0);for(let e=0;e<r.length;e++)r[e](i);R(e,i,t.sync)}else V(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,n.nextTick(K,e,t))}t.sync=!0,t.pendingcb++;try{e._final(i)}catch(e){i(e)}t.sync=!1}(e,t))),0===t.pendingcb&&(r?(t.pendingcb++,n.nextTick((e,t)=>{V(t)?K(e,t):t.pendingcb--},e,t)):V(t)&&(t.pendingcb++,K(e,t))))}function K(e,t){t.pendingcb--,t.finished=!0;let r=t[j].splice(0);for(let e=0;e<r.length;e++)r[e]();if(e.emit("finish"),t.autoDestroy){let t=e._readableState;(!t||t.autoDestroy&&(t.endEmitted||!1===t.readable))&&e.destroy()}}M.prototype.getBuffer=function(){return i(this.buffered,this.bufferedIndex)},a(M.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}}),a(N,d,{__proto__:null,value:function(e){return!!s(this,e)||this===N&&e&&e._writableState instanceof M}}),N.prototype.pipe=function(){R(this,new I)},N.prototype.write=function(e,t,r){return!0===U(this,e,t,r)},N.prototype.cork=function(){this._writableState.corked++},N.prototype.uncork=function(){let e=this._writableState;e.corked&&(e.corked--,e.writing||H(this,e))},N.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=c(e)),!b.isEncoding(e))throw new T(e);return this._writableState.defaultEncoding=e,this},N.prototype._write=function(e,t,r){if(this._writev)this._writev([{chunk:e,encoding:t}],r);else throw new E("_write()")},N.prototype._writev=null,N.prototype.end=function(e,t,r){let i,s=this._writableState;if("function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e){let r=U(this,e,t);r instanceof o&&(i=r)}return s.corked&&(s.corked=1,this.uncork()),i||(s.errored||s.ending?s.finished?i=new O("end"):s.destroyed&&(i=new k("end")):(s.ending=!0,z(this,s,!0),s.ended=!0)),"function"==typeof r&&(i||s.finished?n.nextTick(r,i):s[j].push(r)),this},l(N.prototype,{closed:{__proto__:null,get(){return!!this._writableState&&this._writableState.closed}},destroyed:{__proto__:null,get(){return!!this._writableState&&this._writableState.destroyed},set(e){this._writableState&&(this._writableState.destroyed=e)}},writable:{__proto__:null,get(){let e=this._writableState;return!!e&&!1!==e.writable&&!e.destroyed&&!e.errored&&!e.ending&&!e.ended},set(e){this._writableState&&(this._writableState.writable=!!e)}},writableFinished:{__proto__:null,get(){return!!this._writableState&&this._writableState.finished}},writableObjectMode:{__proto__:null,get(){return!!this._writableState&&this._writableState.objectMode}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return!!this._writableState&&this._writableState.ending}},writableNeedDrain:{__proto__:null,get(){let e=this._writableState;return!!e&&!e.destroyed&&!e.ending&&e.needDrain}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(!1!==this._writableState.writable&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var G=m.destroy;function Q(){return void 0===r&&(r={}),r}N.prototype.destroy=function(e,t){let r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[j].length)&&n.nextTick($,r),G.call(this,e,t),this},N.prototype._undestroy=m.undestroy,N.prototype._destroy=function(e,t){t(e)},N.prototype[y.captureRejectionSymbol]=function(e){this.destroy(e)},N.fromWeb=function(e,t){return Q().newStreamWritableFromWritableStream(e,t)},N.toWeb=function(e){return Q().newWritableStreamFromStreamWritable(e)}}),tx=l((e,t)=>
2{f(),e6(),eY();var r=ty(),n=(e3(),h(eX)),{isReadable:i,isWritable:o,isIterable:s,isNodeStream:a,isReadableNodeStream:l,isWritableNodeStream:u,isDuplexNodeStream:c,isReadableStream:p,isWritableStream:d}=tg(),y=tb(),{AbortError:g,codes:{ERR_INVALID_ARG_TYPE:b,ERR_INVALID_RETURN_VALUE:m}}=e8(),{destroyer:_}=tm(),v=tP(),w=tk(),S=tO(),{createDeferredPromise:E}=tp(),A=tI(),I=globalThis.Blob||n.Blob,k="u">typeof I?function(e){return e instanceof I}:function(e){return!1},O=globalThis.AbortController||e9().AbortController,{FunctionPrototypeCall:x}=e5(),P=class extends v{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)}};function T(e){let t=e.readable&&"function"!=typeof e.readable.read?w.wrap(e.readable):e.readable,r=e.writable,n=!!i(t),s=!!o(r),a,l,u,c,h;function f(e){let t=c;c=null,t?t(e):e&&h.destroy(e)}return h=new P({readableObjectMode:!!(null!=t&&t.readableObjectMode),writableObjectMode:!!(null!=r&&r.writableObjectMode),readable:n,writable:s}),s&&(y(r,e=>{s=!1,e&&_(t,e),f(e)}),h._write=function(e,t,n){r.write(e,t)?n():a=n},h._final=function(e){r.end(),l=e},r.on("drain",function(){if(a){let e=a;a=null,e()}}),r.on("finish",function(){if(l){let e=l;l=null,e()}})),n&&(y(t,e=>{n=!1,e&&_(t,e),f(e)}),t.on("readable",function(){if(u){let e=u;u=null,e()}}),t.on("end",function(){h.push(null)}),h._read=function(){for(;;){let e=t.read();if(null===e){u=h._read;return}if(!h.push(e))return}}),h._destroy=function(e,n){e||null===c||(e=new g),u=null,a=null,l=null,null===c?n(e):(c=n,_(r,e),_(t,e))},h}t.exports=function e(t,n){if(c(t))return t;if(l(t))return T({readable:t});if(u(t))return T({writable:t});if(a(t))return T({writable:!1,readable:!1});if(p(t))return T({readable:w.fromWeb(t)});if(d(t))return T({writable:S.fromWeb(t)});if("function"==typeof t){let{value:e,write:i,final:o,destroy:a}=function(e){let{promise:t,resolve:n}=E(),i=new O,o=i.signal;return{value:e(async function*(){for(;;){let e=t;t=null;let{chunk:i,done:s,cb:a}=await e;if(r.nextTick(a),s)return;if(o.aborted)throw new g(void 0,{cause:o.reason});({promise:t,resolve:n}=E()),yield i}}(),{signal:o}),write(e,t,r){let i=n;n=null,i({chunk:e,done:!1,cb:r})},final(e){let t=n;n=null,t({done:!0,cb:e})},destroy(e,t){i.abort(),t(e)}}}(t);if(s(e))return A(P,e,{objectMode:!0,write:i,final:o,destroy:a});let l=e?.then;if("function"==typeof l){let t,n=x(l,e,e=>{if(null!=e)throw new m("nully","body",e)},e=>{_(t,e)});return t=new P({objectMode:!0,readable:!1,write:i,final(e){o(async()=>{try{await n,r.nextTick(e,null)}catch(t){r.nextTick(e,t)}})},destroy:a})}throw new m("Iterable, AsyncIterable or AsyncFunction",n,e)}if(k(t))return e(t.arrayBuffer());if(s(t))return A(P,t,{objectMode:!0,writable:!1});if(p(t?.readable)&&d(t?.writable))return P.fromWeb(t);if("object"==typeof t?.writable||"object"==typeof t?.readable)return T({readable:null!=t&&t.readable?l(t?.readable)?t?.readable:e(t.readable):void 0,writable:null!=t&&t.writable?u(t?.writable)?t?.writable:e(t.writable):void 0});let i=t?.then;if("function"==typeof i){let e;return x(i,t,t=>{null!=t&&e.push(t),e.push(null)},t=>{_(e,t)}),e=new P({objectMode:!0,writable:!1,read(){}})}throw new b(n,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)}}),tP=l((e,t)=>{f(),e6(),eY();var r,n,{ObjectDefineProperties:i,ObjectGetOwnPropertyDescriptor:o,ObjectKeys:s,ObjectSetPrototypeOf:a}=e5();t.exports=c;var l=tk(),u=tO();a(c.prototype,l.prototype),a(c,l);{let e=s(u.prototype);for(let t=0;t<e.length;t++){let r=e[t];c.prototype[r]||(c.prototype[r]=u.prototype[r])}}function c(e){if(!(this instanceof c))return new c(e);l.call(this,e),u.call(this,e),e?(this.allowHalfOpen=!1!==e.allowHalfOpen,!1===e.readable&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===e.writable&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}function h(){return void 0===r&&(r={}),r}i(c.prototype,{writable:{__proto__:null,...o(u.prototype,"writable")},writableHighWaterMark:{__proto__:null,...o(u.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...o(u.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...o(u.prototype,"writableBuffer")},writableLength:{__proto__:null,...o(u.prototype,"writableLength")},writableFinished:{__proto__:null,...o(u.prototype,"writableFinished")},writableCorked:{__proto__:null,...o(u.prototype,"writableCorked")},writableEnded:{__proto__:null,...o(u.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...o(u.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}}),c.fromWeb=function(e,t){return h().newStreamDuplexFromReadableWritablePair(e,t)},c.toWeb=function(e){return h().newReadableWritablePairFromDuplex(e)},c.from=function(e){return n||(n=tx()),n(e,"body")}}),tT=l((e,t)=>
2{f(),e6(),eY();var{ObjectSetPrototypeOf:r,Symbol:n}=e5();t.exports=l;var{ERR_METHOD_NOT_IMPLEMENTED:i}=e8().codes,o=tP(),{getHighWaterMark:s}=tS();r(l.prototype,o.prototype),r(l,o);var a=n("kCallback");function l(e){if(!(this instanceof l))return new l(e);let t=e?s(this,e,"readableHighWaterMark",!0):null;0===t&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),o.call(this,e),this._readableState.sync=!1,this[a]=null,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",c)}function u(e){"function"!=typeof this._flush||this.destroyed?(this.push(null),e&&e()):this._flush((t,r)=>{if(t){e?e(t):this.destroy(t);return}null!=r&&this.push(r),this.push(null),e&&e()})}function c(){this._final!==u&&u.call(this)}l.prototype._final=u,l.prototype._transform=function(e,t,r){throw new i("_transform()")},l.prototype._write=function(e,t,r){let n=this._readableState,i=this._writableState,o=n.length;this._transform(e,t,(e,t)=>{if(e){r(e);return}null!=t&&this.push(t),i.ended||o===n.length||n.length<n.highWaterMark?r():this[a]=r})},l.prototype._read=function(){if(this[a]){let e=this[a];this[a]=null,e()}}}),tR=l((e,t)=>{f(),e6(),eY();var{ObjectSetPrototypeOf:r}=e5();t.exports=i;var n=tT();function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(i.prototype,n.prototype),r(i,n),i.prototype._transform=function(e,t,r){r(null,e)}}),tC=l((e,t)=>{f(),e6(),eY();var r,n,i,o=ty(),{ArrayIsArray:s,Promise:a,SymbolAsyncIterator:l,SymbolDispose:u}=e5(),c=tb(),{once:h}=tp(),p=tm(),d=tP(),{aggregateTwoErrors:y,codes:{ERR_INVALID_ARG_TYPE:g,ERR_INVALID_RETURN_VALUE:b,ERR_MISSING_ARGS:m,ERR_STREAM_DESTROYED:_,ERR_STREAM_PREMATURE_CLOSE:v},AbortError:w}=e8(),{validateFunction:S,validateAbortSignal:E}=td(),{isIterable:A,isReadable:I,isReadableNodeStream:k,isNodeStream:O,isTransformStream:x,isWebStream:P,isReadableStream:T,isReadableFinished:R}=tg(),C=globalThis.AbortController||e9().AbortController;function j(e,t,r){let n=!1;return e.on("close",()=>{n=!0}),{destroy:t=>{n||(n=!0,p.destroyer(e,t||new _("pipe")))},cleanup:c(e,{readable:t,writable:r},e=>{n=!e})}}function M(e){if(A(e))return e;if(k(e))return B(e);throw new g("val",["Readable","Iterable","AsyncIterable"],e)}async function*B(e){n||(n=tk()),yield*n.prototype[l].call(e)}async function N(e,t,r,{end:n}){let i,o=null,s=e=>{if(e&&(i=e),o){let e=o;o=null,e()}},l=()=>new a((e,t)=>{i?t(i):o=()=>{i?t(i):e()}});t.on("drain",s);let u=c(t,{readable:!1},s);try{for await(let r of(t.writableNeedDrain&&await l(),e))t.write(r)||await l();n&&(t.end(),await l()),r()}catch(e){r(i!==e?y(i,e):e)}finally{u(),t.off("drain",s)}}async function U(e,t,r,{end:n}){x(t)&&(t=t.writable);let i=t.getWriter();try{for await(let t of e)await i.ready,i.write(t).catch(()=>{});await i.ready,n&&await i.close(),r()}catch(e){try{await i.abort(e),r(e)}catch(e){r(e)}}}function L(e,t,n){let a,l;if(1===e.length&&s(e[0])&&(e=e[0]),e.length<2)throw new m("streams");let h=new C,f=h.signal,p=n?.signal,y=[];function _(){W(new w)}E(p,"options.signal"),i=i||tp().addAbortListener,p&&(a=i(p,_));let S,B,L=[],D=0;function F(e){W(e,0==--D)}function W(e,r){var n;if(e&&(!S||"ERR_STREAM_PREMATURE_CLOSE"===S.code)&&(S=e),!(!S&&!r)){for(;L.length;)L.shift()(S);
2null===(n=a)||void 0===n||n[u](),h.abort(),r&&(S||y.forEach(e=>e()),o.nextTick(t,S,B))}}for(let t=0;t<e.length;t++){let i=e[t],s=t<e.length-1,a=t>0,u=s||n?.end!==!1,h=t===e.length-1;if(O(i)){let e=function(e){e&&"AbortError"!==e.name&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code&&F(e)};if(u){let{destroy:e,cleanup:t}=j(i,s,a);L.push(e),I(i)&&h&&y.push(t)}i.on("error",e),I(i)&&h&&y.push(()=>{i.removeListener("error",e)})}if(0===t){if("function"==typeof i){if(!A(l=i({signal:f})))throw new b("Iterable, AsyncIterable or Stream","source",l)}else l=A(i)||k(i)||x(i)?i:d.from(i)}else if("function"==typeof i){var q,$;if(l=i(l=x(l)?M(null===(q=l)||void 0===q?void 0:q.readable):M(l),{signal:f}),s){if(!A(l,!0))throw new b("AsyncIterable",`transform[${t-1}]`,l)}else{r||(r=tR());let e=new r({objectMode:!0}),t=null===($=l)||void 0===$?void 0:$.then;if("function"==typeof t)D++,t.call(l,t=>{B=t,null!=t&&e.write(t),u&&e.end(),o.nextTick(F)},t=>{e.destroy(t),o.nextTick(F,t)});else if(A(l,!0))D++,N(l,e,F,{end:u});else if(T(l)||x(l)){let t=l.readable||l;D++,N(t,e,F,{end:u})}else throw new b("AsyncIterable or Promise","destination",l);let{destroy:n,cleanup:i}=j(l=e,!1,!0);L.push(n),h&&y.push(i)}}else if(O(i)){if(k(l)){D+=2;let e=function(e,t,r,{end:n}){let i=!1;if(t.on("close",()=>{i||r(new v)}),e.pipe(t,{end:!1}),n){let r=function(){i=!0,t.end()};R(e)?o.nextTick(r):e.once("end",r)}else r();return c(e,{readable:!0,writable:!1},t=>{let n=e._readableState;t&&"ERR_STREAM_PREMATURE_CLOSE"===t.code&&n&&n.ended&&!n.errored&&!n.errorEmitted?e.once("end",r).once("error",r):r(t)}),c(t,{readable:!1,writable:!0},r)}(l,i,F,{end:u});I(i)&&h&&y.push(e)}else if(x(l)||T(l)){let e=l.readable||l;D++,N(e,i,F,{end:u})}else if(A(l))D++,N(l,i,F,{end:u});else throw new g("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],l);l=i}else if(P(i)){if(k(l))D++,U(M(l),i,F,{end:u});else if(T(l)||A(l))D++,U(l,i,F,{end:u});else if(x(l))D++,U(l.readable,i,F,{end:u});else throw new g("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],l);l=i}else l=d.from(i)}return(null!=f&&f.aborted||null!=p&&p.aborted)&&o.nextTick(_),l}t.exports={pipelineImpl:L,pipeline:function(...e){return L(e,h((S(e[e.length-1],"streams[stream.length - 1]"),e.pop())))}}}),tj=l((e,t)=>{f(),e6(),eY();var{pipeline:r}=tC(),n=tP(),{destroyer:i}=tm(),{isNodeStream:o,isReadable:s,isWritable:a,isWebStream:l,isTransformStream:u,isWritableStream:c,isReadableStream:h}=tg(),{AbortError:p,codes:{ERR_INVALID_ARG_VALUE:d,ERR_MISSING_ARGS:y}}=e8(),g=tb();t.exports=function(...e){let t,f,b,m,_;if(0===e.length)throw new y("streams");if(1===e.length)return n.from(e[0]);let v=[...e];if("function"==typeof e[0]&&(e[0]=n.from(e[0])),"function"==typeof e[e.length-1]){let t=e.length-1;e[t]=n.from(e[t])}for(let t=0;t<e.length;++t)if(!(!o(e[t])&&!l(e[t]))){if(t<e.length-1&&!(s(e[t])||h(e[t])||u(e[t])))throw new d(`streams[${t}]`,v[t],"must be readable");if(t>0&&!(a(e[t])||c(e[t])||u(e[t])))throw new d(`streams[${t}]`,v[t],"must be writable")}let w=e[0],S=r(e,function(e){let t=m;m=null,t?t(e):e?_.destroy(e):A||E||_.destroy()}),E=!!(a(w)||c(w)||u(w)),A=!!(s(S)||h(S)||u(S));if(_=new n({writableObjectMode:!!(null!=w&&w.writableObjectMode),readableObjectMode:!!(null!=S&&S.readableObjectMode),writable:E,readable:A}),E){if(o(w))_._write=function(e,r,n){w.write(e,r)?n():t=n},_._final=function(e){w.end(),f=e},w.on("drain",function(){if(t){let e=t;t=null,e()}});else if(l(w)){let e=(u(w)?w.writable:w).getWriter();_._write=async function(t,r,n){try{await e.ready,e.write(t).catch(()=>{}),n()}catch(e){n(e)}},_._final=async function(t){try{await e.ready,e.close().catch(()=>{}),f=t}catch(e){t(e)}}}g(u(S)?S.readable:S,()=>{if(f){let e=f;f=null,e()}})}if(A){if(o(S))S.on("readable",function(){if(b){let e=b;b=null,e()}}),S.on("end",function(){_.push(null)}),_._read=function(){for(;;){let e=S.read();if(null===e){b=_._read;return}if(!_.push(e))return}};else if(l(S)){let e=(u(S)?S.readable:S).getReader();_._read=async function(){for(;;)try{let{value:t,done:r}=await e.read();if(!_.push(t))return;if(r){_.push(null);return}}catch{return}}}}return _._destroy=function(e,r){e||null===m||(e=new p),b=null,t=null,f=null,null===m?r(e):(m=r,o(S)&&i(S,e))},_}}),tM=l((e,t)=>
2{f(),e6(),eY();var r=globalThis.AbortController||e9().AbortController,{codes:{ERR_INVALID_ARG_VALUE:n,ERR_INVALID_ARG_TYPE:i,ERR_MISSING_ARGS:o,ERR_OUT_OF_RANGE:s},AbortError:a}=e8(),{validateAbortSignal:l,validateInteger:u,validateObject:c}=td(),h=e5().Symbol("kWeak"),p=e5().Symbol("kResistStopPropagation"),{finished:d}=tb(),y=tj(),{addAbortSignalNoValidate:g}=tv(),{isWritable:b,isNodeStream:m}=tg(),{deprecate:_}=tp(),{ArrayPrototypePush:v,Boolean:w,MathFloor:S,Number:E,NumberIsNaN:A,Promise:I,PromiseReject:k,PromiseResolve:O,PromisePrototypeThen:x,Symbol:P}=e5(),T=P("kEmpty"),R=P("kEof");function C(e,t){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);null!=t&&c(t,"options"),t?.signal!=null&&l(t.signal,"options.signal");let r=1;t?.concurrency!=null&&(r=S(t.concurrency));let n=r-1;return t?.highWaterMark!=null&&(n=S(t.highWaterMark)),u(r,"options.concurrency",1),u(n,"options.highWaterMark",0),n+=r,(async function*(){let i=tp().AbortSignalAny([t?.signal].filter(w)),o=this,s=[],l={signal:i},u,c,h=!1,f=0;function p(){h=!0,d()}function d(){f-=1,y()}function y(){c&&!h&&f<r&&s.length<n&&(c(),c=null)}(async function(){try{for await(let t of o){if(h)return;if(i.aborted)throw new a;try{if((t=e(t,l))===T)continue;t=O(t)}catch(e){t=k(e)}f+=1,x(t,d,p),s.push(t),u&&(u(),u=null),!h&&(s.length>=n||f>=r)&&await new I(e=>{c=e})}s.push(R)}catch(t){let e=k(t);x(e,d,p),s.push(e)}finally{h=!0,u&&(u(),u=null)}})();try{for(;;){for(;s.length>0;){let e=await s[0];if(e===R)return;if(i.aborted)throw new a;e!==T&&(yield e),s.shift(),y()}await new I(e=>{u=e})}}finally{h=!0,c&&(c(),c=null)}}).call(this)}async function j(e,t){for await(let r of U.call(this,e,t))return!0;return!1}async function M(e,t){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);return!await j.call(this,async(...t)=>!await e(...t),t)}async function B(e,t){for await(let r of U.call(this,e,t))return r}async function N(e,t){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);async function r(t,r){return await e(t,r),T}for await(let e of C.call(this,r,t));}function U(e,t){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);async function r(t,r){return await e(t,r)?t:T}return C.call(this,r,t)}var L=class extends o{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function D(e,t,n){var o,s;if("function"!=typeof e)throw new i("reducer",["Function","AsyncFunction"],e);null!=n&&c(n,"options"),n?.signal!=null&&l(n.signal,"options.signal");let u=arguments.length>1;if(null!=n&&null!==(o=n.signal)&&void 0!==o&&o.aborted){let e=new a(void 0,{cause:n.signal.reason});throw this.once("error",()=>{}),await d(this.destroy(e)),e}let f=new r,y=f.signal;null!=n&&n.signal&&n.signal.addEventListener("abort",()=>f.abort(),{once:!0,[h]:this,[p]:!0});let g=!1;try{for await(let r of this){if(g=!0,null!=n&&null!==(s=n.signal)&&void 0!==s&&s.aborted)throw new a;u?t=await e(t,r,{signal:y}):(t=r,u=!0)}if(!g&&!u)throw new L}finally{f.abort()}return t}async function F(e){null!=e&&c(e,"options"),e?.signal!=null&&l(e.signal,"options.signal");let t=[];for await(let n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new a(void 0,{cause:e.signal.reason});v(t,n)}return t}function W(e){if(A(e=E(e)))return 0;if(e<0)throw new s("number",">= 0",e);return e}t.exports.streamReturningOperators={asIndexedPairs:_(function(e){return null!=e&&c(e,"options"),e?.signal!=null&&l(e.signal,"options.signal"),(async function*(){let t=0;for await(let n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new a({cause:e.signal.reason});yield[t++,n]}}).call(this)},"readable.asIndexedPairs will be removed in a future version."),drop:function(e,t){return null!=t&&c(t,"options"),t?.signal!=null&&l(t.signal,"options.signal"),e=W(e),(async function*(){var r,n;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new a;for await(let r of this){if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new a;e--<=0&&(yield r)}}).call(this)},filter:U,flatMap:function(e,t){let r=C.call(this,e,t);return(async function*(){for await(let e of r)yield*e}).call(this)},map:C,take:function(e,t){return null!=t&&c(t,"options"),t?.signal!=null&&l(t.signal,"options.signal"),e=W(e),(async function*(){var r,n;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new a;for await(let r of this){if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new a;if(e-- >0&&(yield r),e<=0)return}}).call(this)},compose:function(e,t){if(null!=t&&c(t,"options"),t?.signal!=null&&l(t.signal,"options.signal"),m(e)&&!b(e))throw new n("stream",e,"must be writable");let r=y(this,e);return null!=t&&t.signal&&g(t.signal,r),r}}
2,t.exports.promiseReturningOperators={every:M,forEach:N,reduce:D,toArray:F,some:j,find:B}}),tB=l((e,t)=>{f(),e6(),eY();var{ArrayPrototypePop:r,Promise:n}=e5(),{isIterable:i,isNodeStream:o,isWebStream:s}=tg(),{pipelineImpl:a}=tC(),{finished:l}=tb();tN(),t.exports={finished:l,pipeline:function(...e){return new n((t,n)=>{let l,u,c=e[e.length-1];if(c&&"object"==typeof c&&!o(c)&&!i(c)&&!s(c)){let t=r(e);l=t.signal,u=t.end}a(e,(e,r)=>{e?n(e):t(r)},{signal:l,end:u})})}}}),tN=l((e,t)=>{f(),e6(),eY();var{Buffer:r}=(e3(),h(eX)),{ObjectDefineProperty:n,ObjectKeys:i,ReflectApply:o}=e5(),{promisify:{custom:s}}=tp(),{streamReturningOperators:a,promiseReturningOperators:l}=tM(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:u}}=e8(),c=tj(),{setDefaultHighWaterMark:p,getDefaultHighWaterMark:d}=tS(),{pipeline:y}=tC(),{destroyer:g}=tm(),b=tb(),m=tB(),_=tg(),v=t.exports=t_().Stream;for(let e of(v.isDestroyed=_.isDestroyed,v.isDisturbed=_.isDisturbed,v.isErrored=_.isErrored,v.isReadable=_.isReadable,v.isWritable=_.isWritable,v.Readable=tk(),i(a))){let t=function(...e){if(new.target)throw u();return v.Readable.from(o(r,this,e))},r=a[e];n(t,"name",{__proto__:null,value:r.name}),n(t,"length",{__proto__:null,value:r.length}),n(v.Readable.prototype,e,{__proto__:null,value:t,enumerable:!1,configurable:!0,writable:!0})}for(let e of i(l)){let t=function(...e){if(new.target)throw u();return o(r,this,e)},r=l[e];n(t,"name",{__proto__:null,value:r.name}),n(t,"length",{__proto__:null,value:r.length}),n(v.Readable.prototype,e,{__proto__:null,value:t,enumerable:!1,configurable:!0,writable:!0})}v.Writable=tO(),v.Duplex=tP(),v.Transform=tT(),v.PassThrough=tR(),v.pipeline=y;var{addAbortSignal:w}=tv();v.addAbortSignal=w,v.finished=b,v.destroy=g,v.compose=c,v.setDefaultHighWaterMark=p,v.getDefaultHighWaterMark=d,n(v,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>m}),n(y,s,{__proto__:null,enumerable:!0,get:()=>m.pipeline}),n(b,s,{__proto__:null,enumerable:!0,get:()=>m.finished}),v.Stream=v,v._isUint8Array=function(e){return e instanceof Uint8Array},v._uint8ArrayToBuffer=function(e){return r.from(e.buffer,e.byteOffset,e.byteLength)}}),tU=l((e,t)=>{f(),e6(),eY();var r=tN(),n=tB(),i=r.Readable.destroy;t.exports=r.Readable,t.exports._uint8ArrayToBuffer=r._uint8ArrayToBuffer,t.exports._isUint8Array=r._isUint8Array,t.exports.isDisturbed=r.isDisturbed,t.exports.isErrored=r.isErrored,t.exports.isReadable=r.isReadable,t.exports.Readable=r.Readable,t.exports.Writable=r.Writable,t.exports.Duplex=r.Duplex,t.exports.Transform=r.Transform,t.exports.PassThrough=r.PassThrough,t.exports.addAbortSignal=r.addAbortSignal,t.exports.finished=r.finished,t.exports.destroy=r.destroy,t.exports.destroy=i,t.exports.pipeline=r.pipeline,t.exports.compose=r.compose,Object.defineProperty(r,"promises",{configurable:!0,enumerable:!0,get:()=>n}),t.exports.Stream=r.Stream,t.exports.default=t.exports}),tL=l((e,t)=>{f(),e6(),eY(),"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}}),tD=l((e,t)=>{f(),e6(),eY();var{Buffer:r}=(e3(),h(eX)),n=Symbol.for("BufferList");function i(e){if(!(this instanceof i))return new i(e);i._init.call(this,e)}i._init=function(e){Object.defineProperty(this,n,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)},i.prototype._new=function(e){return new i(e)},i.prototype._offset=function(e){if(0===e)return[0,0];let t=0;for(let r=0;r<this._bufs.length;r++){let n=t+this._bufs[r].length;if(e<n||r===this._bufs.length-1)return[r,e-t];t=n}},i.prototype._reverseOffset=function(e){let t=e[0],r=e[1];for(let e=0;e<t;e++)r+=this._bufs[e].length;return r},i.prototype.getBuffers=function(){return this._bufs},i.prototype.get=function(e){if(e>this.length||e<0)return;let t=this._offset(e);return this._bufs[t[0]][t[1]]},i.prototype.slice=function(e,t){return"number"==typeof e&&e<0&&(e+=this.length),"number"==typeof t&&t<0&&(t+=this.length),this.copy(null,0,e,t)},i.prototype.copy=function(e,t,n,i){if(("number"!=typeof n||n<0)&&(n=0),("number"!=typeof i||i>this.length)&&(i=this.length),n>=this.length||i<=0)return e||r.alloc(0);let o=!!e,s=this._offset(n),a=i-n,l=a,u=o&&t||0,c=s[1];if(0===n&&i===this.length){if(!o)return 1===this._bufs.length?this._bufs[0]:r.concat(this._bufs,this.length);for(let t=0;t<this._bufs.length;t++)this._bufs[t].copy(e,u),u+=this._bufs[t].length;return e}if(l<=this._bufs[s[0]].length-c)return o?this._bufs[s[0]].copy(e,t,c,c+l):this._bufs[s[0]].slice(c,c+l);o||(e=r.allocUnsafe(a));for(let t=s[0];t<this._bufs.length;t++){let r=this._bufs[t].length-c;if(l>r)this._bufs[t].copy(e,u,c),u+=r;else{this._bufs[t].copy(e,u,c,c+l),u+=r;break}l-=r,c&&(c=0)}return e.length>u?e.slice(0,u):e},i.prototype.shallowSlice=function(e,t){if(e=e||0,t="number"!=typeof t?this.length:t,e<0&&(e+=this.length),t<0&&(t+=this.length),e===t)return this._new();let r=this._offset(e),n=this._offset(t),i=this._bufs.slice(r[0],n[0]+1);return 0===n[1]?i.pop():i[i.length-1]=i[i.length-1].slice(0,n[1]),0!==r[1]&&(i[0]=i[0].slice(r[1])),this._new(i)},i.prototype.toString=function(e,t,r){return this.slice(t,r).toString(e)},i.prototype.consume=function(e){if(Number.isNaN(e=Math.trunc(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},i.prototype.duplicate=function(){let e=this._new();for(let t=0;t<this._bufs.length;t++)e.append(this._bufs[t]);return e},i.prototype.append=function(e){return this._attach(e,i.prototype._appendBuffer)},i.prototype.prepend=function(e){return this._attach(e,i.prototype._prependBuffer,!0)},i.prototype._attach=function(e,t,n){if(null==e)return this;if(e.buffer)t.call(this,r.from(e.buffer,e.byteOffset,e.byteLength));else if(Array.isArray(e)){let[r,i]=n?[e.length-1,-1]:[0,1];for(let o=r;o>=0&&o<e.length;o+=i)this._attach(e[o],t,n)}else if(this._isBufferList(e)){let[r,i]=n?[e._bufs.length-1,-1]:[0,1];for(let o=r;o>=0&&o<e._bufs.length;o+=i)this._attach(e._bufs[o],t,n)}else"number"==typeof e&&(e=e.toString()),t.call(this,r.from(e));return this},i.prototype._appendBuffer=function(e){this._bufs.push(e),this.length+=e.length},i.prototype._prependBuffer=function(e){this._bufs.unshift(e),this.length+=e.length},i.prototype.indexOf=function(e,t,n){if(void 0===n&&"string"==typeof t&&(n=t,t=void 0),"function"==typeof e||Array.isArray(e))throw TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if("number"==typeof e?e=r.from([e]):"string"==typeof e?e=r.from(e,n):this._isBufferList(e)?e=e.slice():Array.isArray(e.buffer)?e=r.from(e.buffer,e.byteOffset,e.byteLength):r.isBuffer(e)||(e=r.from(e)),isNaN(t=Number(t||0))&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),0===e.length)return t>this.length?this.length:t;let i=this._offset(t),o=i[0],s=i[1];for(;o<this._bufs.length;o++){let t=this._bufs[o];for(;s<t.length;)if(t.length-s>=e.length){let r=t.indexOf(e,s);if(-1!==r)return this._reverseOffset([o,r]);s=t.length-e.length+1}else{let t=this._reverseOffset([o,s]);if(this._match(t,e))return t;s++}s=0}return -1},i.prototype._match=function(e,t){if(this.length-e<t.length)return!1;for(let r=0;r<t.length;r++)if(this.get(e+r)!==t[r])return!1;return!0},function(){let e={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readBigInt64BE:8,readBigInt64LE:8,readBigUInt64BE:8,readBigUInt64LE:8,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(let t in e)!function(t){null===e[t]?i.prototype[t]=function(e,r){return this.slice(e,e+r)[t](0,r)}:i.prototype[t]=function(r=0){return this.slice(r,r+e[t])[t](0)}}(t)}(),i.prototype._isBufferList=function(e){return e instanceof i||i.isBufferList(e)},i.isBufferList=function(e){return null!=e&&e[n]},t.exports=i}),tF=l((e,t)=>
2{f(),e6(),eY();var r=tU().Duplex,n=tL(),i=tD();function o(e){if(!(this instanceof o))return new o(e);if("function"==typeof e){this._callback=e;let t=(function(e){this._callback&&(this._callback(e),this._callback=null)}).bind(this);this.on("pipe",function(e){e.on("error",t)}),this.on("unpipe",function(e){e.removeListener("error",t)}),e=null}i._init.call(this,e),r.call(this)}n(o,r),Object.assign(o.prototype,i.prototype),o.prototype._new=function(e){return new o(e)},o.prototype._write=function(e,t,r){this._appendBuffer(e),"function"==typeof r&&r()},o.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)},o.prototype.end=function(e){r.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)},o.prototype._destroy=function(e,t){this._bufs.length=0,this.length=0,t(e)},o.prototype._isBufferList=function(e){return e instanceof o||e instanceof i||o.isBufferList(e)},o.isBufferList=i.isBufferList,t.exports=o,t.exports.BufferListStream=o,t.exports.BufferList=i}),tW=l((e,t)=>{f(),e6(),eY(),t.exports=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}}}),tq=l((e,t)=>{f(),e6(),eY();var r=t.exports,{Buffer:n}=(e3(),h(eX));for(let e in r.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"},r.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},r.requiredHeaderFlagsErrors={},r.requiredHeaderFlags){let t=r.requiredHeaderFlags[e];r.requiredHeaderFlagsErrors[e]="Invalid header flag bits, must be 0x"+t.toString(16)+" for "+r.types[e]+" packet"}for(let e in r.codes={},r.types){let t=r.types[e];r.codes[t]=e}for(let e in r.CMD_SHIFT=4,r.CMD_MASK=240,r.DUP_MASK=8,r.QOS_MASK=3,r.QOS_SHIFT=1,r.RETAIN_MASK=1,r.VARBYTEINT_MASK=127,r.VARBYTEINT_FIN_MASK=128,r.VARBYTEINT_MAX=268435455,r.SESSIONPRESENT_MASK=1,r.SESSIONPRESENT_HEADER=n.from([r.SESSIONPRESENT_MASK]),r.CONNACK_HEADER=n.from([r.codes.connack<<r.CMD_SHIFT]),r.USERNAME_MASK=128,r.PASSWORD_MASK=64,r.WILL_RETAIN_MASK=32,r.WILL_QOS_MASK=24,r.WILL_QOS_SHIFT=3,r.WILL_FLAG_MASK=4,r.CLEAN_SESSION_MASK=2,r.CONNECT_HEADER=n.from([r.codes.connect<<r.CMD_SHIFT]),r.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},r.propertiesCodes={},r.properties){let t=r.properties[e];r.propertiesCodes[t]=e}function i(e){return[0,1,2].map(t=>[0,1].map(i=>[0,1].map(o=>{let s=n.alloc(1);return s.writeUInt8(r.codes[e]<<r.CMD_SHIFT|(i?r.DUP_MASK:0)|t<<r.QOS_SHIFT|o,0,!0),s})))}r.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"},r.PUBLISH_HEADER=i("publish"),r.SUBSCRIBE_HEADER=i("subscribe"),r.SUBSCRIBE_OPTIONS_QOS_MASK=3,r.SUBSCRIBE_OPTIONS_NL_MASK=1,r.SUBSCRIBE_OPTIONS_NL_SHIFT=2,r.SUBSCRIBE_OPTIONS_RAP_MASK=1,r.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,r.SUBSCRIBE_OPTIONS_RH_MASK=3,r.SUBSCRIBE_OPTIONS_RH_SHIFT=4,r.SUBSCRIBE_OPTIONS_RH=[0,16,32],r.SUBSCRIBE_OPTIONS_NL=4,r.SUBSCRIBE_OPTIONS_RAP=8,r.SUBSCRIBE_OPTIONS_QOS=[0,1,2],r.UNSUBSCRIBE_HEADER=i("unsubscribe"),r.ACKS={unsuback:i("unsuback"),puback:i("puback"),pubcomp:i("pubcomp"),pubrel:i("pubrel"),pubrec:i("pubrec")}
2,r.SUBACK_HEADER=n.from([r.codes.suback<<r.CMD_SHIFT]),r.VERSION3=n.from([3]),r.VERSION4=n.from([4]),r.VERSION5=n.from([5]),r.VERSION131=n.from([131]),r.VERSION132=n.from([132]),r.QOS=[0,1,2].map(e=>n.from([e])),r.EMPTY={pingreq:n.from([r.codes.pingreq<<4,0]),pingresp:n.from([r.codes.pingresp<<4,0]),disconnect:n.from([r.codes.disconnect<<4,0])},r.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"},r.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"},r.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"},r.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"},r.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 invali
2d",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"},r.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}}),t$=l((e,t)=>{function r(e,t,r,n){return Math.round(e/r)+" "+n+(t>=1.5*r?"s":"")}f(),e6(),eY(),t.exports=function(e,t){t=t||{};var n,i,o=typeof e;if("string"===o&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"weeks":case"week":case"w":return 6048e5*r;case"days":case"day":case"d":return 864e5*r;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*r;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*r;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}(e);if("number"===o&&isFinite(e))return t.long?(n=Math.abs(e))>=864e5?r(e,n,864e5,"day"):n>=36e5?r(e,n,36e5,"hour"):n>=6e4?r(e,n,6e4,"minute"):n>=1e3?r(e,n,1e3,"second"):e+" ms":(i=Math.abs(e))>=864e5?Math.round(e/864e5)+"d":i>=36e5?Math.round(e/36e5)+"h":i>=6e4?Math.round(e/6e4)+"m":i>=1e3?Math.round(e/1e3)+"s":e+"ms";throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}}),tH=l((e,t)=>
2{f(),e6(),eY(),t.exports=function(e){function t(e){let n,i=null,o,s;function a(...e){if(!a.enabled)return;let r=Number(new Date),i=r-(n||r);a.diff=i,a.prev=n,a.curr=r,n=r,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let o=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,n)=>{if("%%"===r)return"%";o++;let i=t.formatters[n];if("function"==typeof i){let t=e[o];r=i.call(a,t),e.splice(o,1),o--}return r}),t.formatArgs.call(a,e),(a.log||t.log).apply(a,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(o!==t.namespaces&&(o=t.namespaces,s=t.enabled(e)),s),set:e=>{i=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,r){let n=t(this.namespace+(typeof r>"u"?":":r)+e);return n.log=this.log,n}function n(e,t){let r=0,n=0,i=-1,o=0;for(;r<e.length;)if(n<t.length&&(t[n]===e[r]||"*"===t[n]))"*"===t[n]?(i=n,o=r):r++,n++;else{if(-1===i)return!1;n=i+1,r=++o}for(;n<t.length&&"*"===t[n];)n++;return n===t.length}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){let e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){for(let r of(t.save(e),t.namespaces=e,t.names=[],t.skips=[],("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean)))"-"===r[0]?t.skips.push(r.slice(1)):t.names.push(r)},t.enabled=function(e){for(let r of t.skips)if(n(e,r))return!1;for(let r of t.names)if(n(e,r))return!0;return!1},t.humanize=t$(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(r=>{t[r]=e[r]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t)|0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}}),tV=l((e,t)=>{let r;f(),e6(),eY(),e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;let r="color: "+this.color;e.splice(1,0,r,"color: inherit");let n=0,i=0;e[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))}),e.splice(i,0,r)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch{}},e.load=function(){let t;try{t=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch{}return!t&&"u">typeof p&&"env"in p&&(t=p.env.DEBUG),t},e.useColors=function(){let e;return"u">typeof window&&!!window.process&&("renderer"===window.process.type||!!window.process.__nwjs)||!("u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("u">typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"u">typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"u">typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},e.storage=function(){try{return localStorage}catch{}}(),e.destroy=(r=!1,()=>{r||(r=!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`."))}),e.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","#F
2F6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=tH()(e);var{formatters:n}=t.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}),tz=l((e,t)=>{f(),e6(),eY();var r=tF(),{EventEmitter:n}=(tf(),h(e7)),i=tW(),o=tq(),s=tV()("mqtt-packet:parser"),a=class e extends n{constructor(){super(),this.parser=this.constructor.parser}static parser(t){return this instanceof e?(this.settings=t||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new e().parser(t)}_resetState(){s("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new i,this.error=null,this._list=r(),this._stateCounter=0}parse(e){for(this.error&&this._resetState(),this._list.append(e),s("parse: current state: %s",this._states[this._stateCounter]);(-1!==this.packet.length||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,s("parse: state complete. _stateCounter is now: %d",this._stateCounter),s("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);
2return s("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),t=e>>o.CMD_SHIFT;this.packet.cmd=o.types[t];let r=o.requiredHeaderFlags[t];return null!=r&&(15&e)!==r?this._emitError(Error(o.requiredHeaderFlagsErrors[t])):(this.packet.retain=(e&o.RETAIN_MASK)!=0,this.packet.qos=e>>o.QOS_SHIFT&o.QOS_MASK,this.packet.qos>2?this._emitError(Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=(e&o.DUP_MASK)!=0,s("_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)),s("_parseLength %d",e.value),!!e}_parsePayload(){s("_parsePayload: payload %O",this._list);let e=!1;if(0===this.packet.length||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(Error("Not supported"))}e=!0}return s("_parsePayload complete result: %s",e),e}_parseConnect(){s("_parseConnect");let e,t,r,n,i={},a=this.packet,l=this._parseString();if(null===l)return this._emitError(Error("Cannot parse protocolId"));if("MQTT"!==l&&"MQIsdp"!==l)return this._emitError(Error("Invalid protocolId"));if(a.protocolId=l,this._pos>=this._list.length)return this._emitError(Error("Packet too short"));if(a.protocolVersion=this._list.readUInt8(this._pos),a.protocolVersion>=128&&(a.bridgeMode=!0,a.protocolVersion=a.protocolVersion-128),3!==a.protocolVersion&&4!==a.protocolVersion&&5!==a.protocolVersion)return this._emitError(Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(Error("Packet too short"));if(1&this._list.readUInt8(this._pos))return this._emitError(Error("Connect flag bit 0 must be 0, but got 1"));i.username=this._list.readUInt8(this._pos)&o.USERNAME_MASK,i.password=this._list.readUInt8(this._pos)&o.PASSWORD_MASK,i.will=this._list.readUInt8(this._pos)&o.WILL_FLAG_MASK;let u=!!(this._list.readUInt8(this._pos)&o.WILL_RETAIN_MASK),c=(this._list.readUInt8(this._pos)&o.WILL_QOS_MASK)>>o.WILL_QOS_SHIFT;if(i.will)a.will={},a.will.retain=u,a.will.qos=c;else{if(u)return this._emitError(Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(c)return this._emitError(Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(a.clean=(this._list.readUInt8(this._pos)&o.CLEAN_SESSION_MASK)!=0,this._pos++,a.keepalive=this._parseNum(),-1===a.keepalive)return this._emitError(Error("Packet too short"));if(5===a.protocolVersion){let e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(a.properties=e)}let h=this._parseString();if(null===h)return this._emitError(Error("Packet too short"));if(a.clientId=h,s("_parseConnect: packet.clientId: %s",a.clientId),i.will){if(5===a.protocolVersion){let e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(a.will.properties=e)}if(null===(e=this._parseString()))return this._emitError(Error("Cannot parse will topic"));if(a.will.topic=e,s("_parseConnect: packet.will.topic: %s",a.will.topic),null===(t=this._parseBuffer()))return this._emitError(Error("Cannot parse will payload"));a.will.payload=t,s("_parseConnect: packet.will.paylaod: %s",a.will.payload)}if(i.username){if(null===(n=this._parseString()))return this._emitError(Error("Cannot parse username"));a.username=n,s("_parseConnect: packet.username: %s",a.username)}if(i.password){if(null===(r=this._parseBuffer()))return this._emitError(Error("Cannot parse password"));a.password=r}return this.settings=a,s("_parseConnect: complete"),a}_parseConnack(){s("_parseConnack");let e=this.packet;if(this._list.length<1)return null;let t=this._list.readUInt8(this._pos++);if(t>1)return this._emitError(Error("Invalid connack flags, bits 7-1 must be set to 0"));if(e.sessionPresent=!!(t&o.SESSIONPRESENT_MASK),5===this.settings.protocolVersion)this._list.length>=2?e.reasonCode=this._list.readUInt8(this._pos++):e.reasonCode=0;else{if(this._list.length<2)return null;e.returnCode=this._list.readUInt8(this._pos++)}if(-1===e.returnCode||-1===e.reasonCode)return this._emitError(Error("Cannot parse return code"));if(5===this.settings.protocolVersion){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}s("_parseConnack: complete")}_parsePublish(){s("_parsePublish");let e=this.packet;if(e.topic=this._parseString(),null===e.topic)return this._emitError(Error("Cannot parse topic"));if(!(e.qos>0&&!this._parseMessageId())){if(5===this.settings.protocolVersion){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}e.payload=this._list.slice(this._pos,e.length),s("_parsePublish: payload from buffer list: %o",e.payload)}}_parseSubscribe(){s("_parseSubscribe");let e=this.packet,t,r,n,i,a,l,u;if(e.subscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}if(e.length<=0)return this._emitError(Error("Malformed subscribe, no payload specified"));for(;this._pos<e.length;){if(null===(t=this._parseString()))return this._emitError(Error("Cannot parse topic"));if(this._pos>=e.length)return this._emitError(Error("Malformed Subscribe Payload"));if(r=this._parseByte(),5===this.settings.protocolVersion){if(192&r)return this._emitError(Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(252&r)return this._emitError(Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if((n=r&o.SUBSCRIBE_OPTIONS_QOS_MASK)>2)return this._emitError(Error("Invalid subscribe QoS, must be <= 2"));if(l=(r>>o.SUBSCRIBE_OPTIONS_NL_SHIFT&o.SUBSCRIBE_OPTIONS_NL_MASK)!=0,a=(r>>o.SUBSCRIBE_OPTIONS_RAP_SHIFT&o.SUBSCRIBE_OPTIONS_RAP_MASK)!=0,(i=r>>o.SUBSCRIBE_OPTIONS_RH_SHIFT&o.SUBSCRIBE_OPTIONS_RH_MASK)>2)return this._emitError(Error("Invalid retain handling, must be <= 2"));u={topic:t,qos:n},5===this.settings.protocolVersion?(u.nl=l,u.rap=a,u.rh=i):this.settings.bridgeMode&&(u.rh=0,u.rap=!0,u.nl=!0),s("_parseSubscribe: push subscription `%s` to subscription",u),e.subscriptions.push(u)}}}_parseSuback(){s("_parseSuback");let e=this.packet;if(this.packet.granted=[],this._parseMessageId()){if(5===this.settings.protocolVersion){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}if(e.length<=0)return this._emitError(Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){let e=this._list.readUInt8(this._pos++);if(5===this.settings.protocolVersion){if(!o.MQTT5_SUBACK_CODES[e])return this._emitError(Error("Invalid suback code"))}else if(e>2&&128!==e)return this._emitError(Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(e)}}}_parseUnsubscribe(){s("_parseUnsubscribe");let e=this.packet;if(e.unsubscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}if(e.length<=0)return this._emitError(Error("Malformed unsubscribe, no payload specified"));for(;this._pos<e.length;){let t=this._parseString();if(null===t)return this._emitError(Error("Cannot parse topic"));s("_parseUnsubscribe: push topic `%s` to unsubscriptions",t),e.unsubscriptions.push(t)}}}_parseUnsuback(){s("_parseUnsuback");let e=this.packet;if(!this._parseMessageId())return this._emitError(Error("Cannot parse messageId"));if((3===this.settings.protocolVersion||4===this.settings.protocolVersion)&&2!==e.length)return this._emitError(Error("Malformed unsuback, payload length must be 2"));if(e.length<=0)return this._emitError(Error("Malformed unsuback, no payload specified"));if(5===this.settings.protocolVersion){let t=this._parseProperties();for(Object.getOwnPropertyNames(t).length&&(e.properties=t),e.granted=[];this._pos<this.packet.length;){let e=this._list.readUInt8(this._pos++);if(!o.MQTT5_UNSUBACK_CODES[e])return this._emitError(Error("Invalid unsuback code"));this.packet.granted.push(e)}}}_parseConfirmation(){s("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);let e=this.packet;if(this._parseMessageId(),5===this.settings.protocolVersion){if(e.length>2){switch(e.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!o.MQTT5_PUBACK_PUBREC_CODES[e.reasonCode])return this._emitError(Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!o.MQTT5_PUBREL_PUBCOMP_CODES[e.reasonCode])return this._emitError(Error("Invalid "+this.packet.cmd+" reason code"))}s("_parseConfirmation: packet.reasonCode `%d`",e.reasonCode)}else e.reasonCode=0;if(e.length>3){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}}return!0}_parseDisconnect(){let e=this.packet;if(s("_parseDisconnect"),5===this.settings.protocolVersion){this._list.length>0?(e.reasonCode=this._parseByte(),o.MQTT5_DISCONNECT_CODES[e.reasonCode]||this._emitError(Error("Invalid disconnect reason code"))):e.reasonCode=0;let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}return s("_parseDisconnect result: true"),!0}_parseAuth(){s("_parseAuth");let e=this.packet;if(5!==this.settings.protocolVersion)return this._emitError(Error("Not supported auth packet for this version MQTT"));if(e.reasonCode=this._parseByte(),!o.MQTT5_AUTH_CODES[e.reasonCode])return this._emitError(Error("Invalid auth reason code"));let t=this._parseProperties();return Object.getOwnPropertyNames(t).length&&(e.properties=t),s("_parseAuth: result: true"),!0}_parseMessageId(){let e=this.packet;return e.messageId=this._parseNum(),null===e.messageId?(this._emitError(Error("Cannot parse messageId")),!1):(s("_parseMessageId: packet.messageId %d",e.messageId),!0)}_parseString(e){let t=this._parseNum(),r=t+this._pos;if(-1===t||r>this._list.length||r>this.packet.length)return null;let n=this._list.toString("utf8",this._pos,r);
2return this._pos+=t,s("_parseString: result: %s",n),n}_parseStringPair(){return s("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){let e=this._parseNum(),t=e+this._pos;if(-1===e||t>this._list.length||t>this.packet.length)return null;let r=this._list.slice(this._pos,t);return this._pos+=e,s("_parseBuffer: result: %o",r),r}_parseNum(){if(this._list.length-this._pos<2)return -1;let e=this._list.readUInt16BE(this._pos);return this._pos+=2,s("_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,s("_parse4ByteNum: result: %s",e),e}_parseVarByteNum(e){s("_parseVarByteNum");let t=0,r=1,n=0,i=!1,a,l=this._pos?this._pos:0;for(;t<4&&l+t<this._list.length;){if(n+=r*((a=this._list.readUInt8(l+t++))&o.VARBYTEINT_MASK),r*=128,(a&o.VARBYTEINT_FIN_MASK)==0){i=!0;break}if(this._list.length<=t)break}return!i&&4===t&&this._list.length>=t&&this._emitError(Error("Invalid variable byte integer")),l&&(this._pos+=t),s("_parseVarByteNum: result: %o",i=!!i&&(e?{bytes:t,value:n}:n)),i}_parseByte(){let e;return this._pos<this._list.length&&(e=this._list.readUInt8(this._pos),this._pos++),s("_parseByte: result: %o",e),e}_parseByType(e){switch(s("_parseByType: type: %s",e),e){case"byte":return 0!==this._parseByte();case"int8":return this._parseByte();case"int16":return this._parseNum();case"int32":return this._parse4ByteNum();case"var":return this._parseVarByteNum();case"string":return this._parseString();case"pair":return this._parseStringPair();case"binary":return this._parseBuffer()}}_parseProperties(){s("_parseProperties");let e=this._parseVarByteNum(),t=this._pos+e,r={};for(;this._pos<t;){let e=this._parseByte();if(!e)return this._emitError(Error("Cannot parse property code type")),!1;let t=o.propertiesCodes[e];if(!t)return this._emitError(Error("Unknown property")),!1;if("userProperties"===t){r[t]||(r[t]=Object.create(null));let e=this._parseByType(o.propertiesTypes[t]);if(r[t][e.name]){if(Array.isArray(r[t][e.name]))r[t][e.name].push(e.value);else{let n=r[t][e.name];r[t][e.name]=[n],r[t][e.name].push(e.value)}}else r[t][e.name]=e.value;continue}r[t]?(Array.isArray(r[t])||(r[t]=[r[t]]),r[t].push(this._parseByType(o.propertiesTypes[t]))):r[t]=this._parseByType(o.propertiesTypes[t])}return r}_newPacket(){return s("_newPacket"),this.packet&&(this._list.consume(this.packet.length),s("_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)),s("_newPacket: new packet"),this.packet=new i,this._pos=0,!0}_emitError(e){s("_emitError",e),this.error=e,this.emit("error",e)}};t.exports=a}),tK=l((e,t)=>{f(),e6(),eY();var{Buffer:r}=(e3(),h(eX)),n={},i=r.isBuffer(r.from([1,2]).subarray(0,1));function o(e){let t=r.allocUnsafe(2);return t.writeUInt8(e>>8,0),t.writeUInt8(255&e,1),t}t.exports={cache:n,generateCache:function(){for(let e=0;e<65536;e++)n[e]=o(e)},generateNumber:o,genBufVariableByteInt:function(e){let t=0,n=0,o=r.allocUnsafe(4);do t=e%128|0,(e=e/128|0)>0&&(t|=128),o.writeUInt8(t,n++);while(e>0&&n<4);return e>0&&(n=0),i?o.subarray(0,n):o.slice(0,n)},generate4ByteBuffer:function(e){let t=r.allocUnsafe(4);return t.writeUInt32BE(e,0),t}}}),tG=l((e,t)=>{f(),e6(),eY(),typeof p>"u"||!p.version||0===p.version.indexOf("v0.")||0===p.version.indexOf("v1.")&&0!==p.version.indexOf("v1.8.")?t.exports={nextTick:function(e,t,r,n){if("function"!=typeof e)throw TypeError('"callback" argument must be a function');var i,o,s=arguments.length;switch(s){case 0:case 1:return p.nextTick(e);case 2:return p.nextTick(function(){e.call(null,t)});case 3:return p.nextTick(function(){e.call(null,t,r)});case 4:return p.nextTick(function(){e.call(null,t,r,n)});default:for(i=Array(s-1),o=0;o<i.length;)i[o++]=arguments[o];return p.nextTick(function(){e.apply(null,i)})}}}:t.exports=p}),tQ=l((e,t)=>{f(),e6(),eY();var r=tq(),{Buffer:n}=(e3(),h(eX)),i=n.allocUnsafe(0),o=n.from([0]),s=tK(),a=tG().nextTick,l=tV()("mqtt-packet:writeToStream"),u=s.cache,c=s.generateNumber,p=s.generateCache,d=s.genBufVariableByteInt,y=s.generate4ByteBuffer,g=E,b=!0;
2function m(e,t,s){switch(l("generate called"),t.cork&&(t.cork(),a(_,t)),b&&(b=!1,p()),l("generate: packet.cmd: %s",e.cmd),e.cmd){case"connect":return function(e,t,i){let o,s,a,l=e||{},u=l.protocolId||"MQTT",c=l.protocolVersion||4,h=l.will,f=l.clean,p=l.keepalive||0,d=l.clientId||"",y=l.username,b=l.password,m=l.properties;void 0===f&&(f=!0);let _=0;if(!u||"string"!=typeof u&&!n.isBuffer(u))return t.destroy(Error("Invalid protocolId")),!1;if(_+=u.length+2,3!==c&&4!==c&&5!==c)return t.destroy(Error("Invalid protocol version")),!1;if(_+=1,("string"==typeof d||n.isBuffer(d))&&(d||c>=4)&&(d||f))_+=n.byteLength(d)+2;else{if(c<4)return t.destroy(Error("clientId must be supplied before 3.1.1")),!1;if(1*f==0)return t.destroy(Error("clientId must be given if cleanSession set to 0")),!1}if("number"!=typeof p||p<0||p>65535||p%1!=0)return t.destroy(Error("Invalid keepalive")),!1;if(_+=3,5===c){if(!(s=k(t,m)))return!1;_+=s.length}if(h){if("object"!=typeof h)return t.destroy(Error("Invalid will")),!1;if(!h.topic||"string"!=typeof h.topic)return t.destroy(Error("Invalid will topic")),!1;if(_+=n.byteLength(h.topic)+2+2,h.payload){if(!(h.payload.length>=0))return t.destroy(Error("Invalid will payload")),!1;"string"==typeof h.payload?_+=n.byteLength(h.payload):_+=h.payload.length}if(a={},5===c){if(!(a=k(t,h.properties)))return!1;_+=a.length}}let v=!1;if(null!=y){if(!R(y))return t.destroy(Error("Invalid username")),!1;v=!0,_+=n.byteLength(y)+2}if(null!=b){if(!v)return t.destroy(Error("Username is required to use password")),!1;if(!R(b))return t.destroy(Error("Invalid password")),!1;_+=T(b)+2}return t.write(r.CONNECT_HEADER),w(t,_),I(t,u),l.bridgeMode&&(c+=128),t.write(131===c?r.VERSION131:132===c?r.VERSION132:4===c?r.VERSION4:5===c?r.VERSION5:r.VERSION3),o=0|(null!=y?r.USERNAME_MASK:0)|(null!=b?r.PASSWORD_MASK:0)|(h&&h.retain?r.WILL_RETAIN_MASK:0)|(h&&h.qos?h.qos<<r.WILL_QOS_SHIFT:0)|(h?r.WILL_FLAG_MASK:0)|(f?r.CLEAN_SESSION_MASK:0),t.write(n.from([o])),g(t,p),5===c&&s.write(),I(t,d),h&&(5===c&&a.write(),S(t,h.topic),I(t,h.payload)),null!=y&&I(t,y),null!=b&&I(t,b),!0}(e,t,0);case"connack":return function(e,t,i){let s=i?i.protocolVersion:4,a=e||{},l=5===s?a.reasonCode:a.returnCode,u=a.properties,c=2;if("number"!=typeof l)return t.destroy(Error("Invalid return code")),!1;let h=null;if(5===s){if(!(h=k(t,u)))return!1;c+=h.length}return t.write(r.CONNACK_HEADER),w(t,c),t.write(a.sessionPresent?r.SESSIONPRESENT_HEADER:o),t.write(n.from([l])),h?.write(),!0}(e,t,s);case"publish":return function(e,t,o){l("publish: packet: %o",e);let s=o?o.protocolVersion:4,a=e||{},u=a.qos||0,c=a.retain?r.RETAIN_MASK:0,h=a.topic,f=a.payload||i,p=a.messageId,d=a.properties,y=0;if("string"==typeof h)y+=n.byteLength(h)+2;else{if(!n.isBuffer(h))return t.destroy(Error("Invalid topic")),!1;y+=h.length+2}if(n.isBuffer(f)?y+=f.length:y+=n.byteLength(f),u&&"number"!=typeof p)return t.destroy(Error("Invalid messageId")),!1;u&&(y+=2);let b=null;if(5===s){if(!(b=k(t,d)))return!1;y+=b.length}return t.write(r.PUBLISH_HEADER[u][a.dup?1:0][c?1:0]),w(t,y),g(t,T(h)),t.write(h),u>0&&g(t,p),b?.write(),l("publish: payload: %o",f),t.write(f)}(e,t,s);case"puback":case"pubrec":case"pubrel":case"pubcomp":return function(e,t,i){let o=i?i.protocolVersion:4,s=e||{},a=s.cmd||"puback",l=s.messageId,u=s.dup&&"pubrel"===a?r.DUP_MASK:0,c=0,h=s.reasonCode,f=s.properties,p=5===o?3:2;if("pubrel"===a&&(c=1),"number"!=typeof l)return t.destroy(Error("Invalid messageId")),!1;let d=null;if(5===o&&"object"==typeof f){if(!(d=O(t,f,i,p)))return!1;p+=d.length}return t.write(r.ACKS[a][c][u][0]),3===p&&(p+=0!==h?1:-1),w(t,p),g(t,l),5===o&&2!==p&&t.write(n.from([h])),null!==d?d.write():4===p&&t.write(n.from([0])),!0}(e,t,s);case"subscribe":return function(e,t,i){l("subscribe: packet: ");let o=i?i.protocolVersion:4,s=e||{},a=s.dup?r.DUP_MASK:0,u=s.messageId,c=s.subscriptions,h=s.properties,f=0;if("number"!=typeof u)return t.destroy(Error("Invalid messageId")),!1;f+=2;let p=null;if(5===o){if(!(p=k(t,h)))return!1;f+=p.length}if("object"!=typeof c||!c.length)return t.destroy(Error("Invalid subscriptions")),!1;for(let e=0;e<c.length;e+=1){let r=c[e].topic,i=c[e].qos;if("string"!=typeof r)return t.destroy(Error("Invalid subscriptions - invalid topic")),!1;if("number"!=typeof i)return t.destroy(Error("Invalid subscriptions - invalid qos")),!1;if(5===o){if("boolean"!=typeof(c[e].nl||!1))return t.destroy(Error("Invalid subscriptions - invalid No Local")),!1;if("boolean"!=typeof(c[e].rap||!1))return t.destroy(Error("Invalid subscriptions - invalid Retain as Published")),!1;let r=c[e].rh||0;if("number"!=typeof r||r>2)return t.destroy(Error("Invalid subscriptions - invalid Retain Handling")),!1}f+=n.byteLength(r)+2+1}
2l("subscribe: writing to stream: %o",r.SUBSCRIBE_HEADER),t.write(r.SUBSCRIBE_HEADER[1][a?1:0][0]),w(t,f),g(t,u),null!==p&&p.write();let d=!0;for(let e of c){let i=e.topic,s=e.qos,a=+e.nl,l=+e.rap,u=e.rh,c;S(t,i),c=r.SUBSCRIBE_OPTIONS_QOS[s],5===o&&(c|=a?r.SUBSCRIBE_OPTIONS_NL:0,c|=l?r.SUBSCRIBE_OPTIONS_RAP:0,c|=u?r.SUBSCRIBE_OPTIONS_RH[u]:0),d=t.write(n.from([c]))}return d}(e,t,s);case"suback":return function(e,t,i){let o=i?i.protocolVersion:4,s=e||{},a=s.messageId,l=s.granted,u=s.properties,c=0;if("number"!=typeof a)return t.destroy(Error("Invalid messageId")),!1;if(c+=2,"object"!=typeof l||!l.length)return t.destroy(Error("Invalid qos vector")),!1;for(let e=0;e<l.length;e+=1){if("number"!=typeof l[e])return t.destroy(Error("Invalid qos vector")),!1;c+=1}let h=null;if(5===o){if(!(h=O(t,u,i,c)))return!1;c+=h.length}return t.write(r.SUBACK_HEADER),w(t,c),g(t,a),null!==h&&h.write(),t.write(n.from(l))}(e,t,s);case"unsubscribe":return function(e,t,i){let o=i?i.protocolVersion:4,s=e||{},a=s.messageId,l=s.dup?r.DUP_MASK:0,u=s.unsubscriptions,c=s.properties,h=0;if("number"!=typeof a)return t.destroy(Error("Invalid messageId")),!1;if(h+=2,"object"!=typeof u||!u.length)return t.destroy(Error("Invalid unsubscriptions")),!1;for(let e=0;e<u.length;e+=1){if("string"!=typeof u[e])return t.destroy(Error("Invalid unsubscriptions")),!1;h+=n.byteLength(u[e])+2}let f=null;if(5===o){if(!(f=k(t,c)))return!1;h+=f.length}t.write(r.UNSUBSCRIBE_HEADER[1][l?1:0][0]),w(t,h),g(t,a),null!==f&&f.write();let p=!0;for(let e=0;e<u.length;e++)p=S(t,u[e]);return p}(e,t,s);case"unsuback":return function(e,t,i){let o=i?i.protocolVersion:4,s=e||{},a=s.messageId,l=s.dup?r.DUP_MASK:0,u=s.granted,c=s.properties,h=s.cmd,f=2;if("number"!=typeof a)return t.destroy(Error("Invalid messageId")),!1;if(5===o){if("object"!=typeof u||!u.length)return t.destroy(Error("Invalid qos vector")),!1;for(let e=0;e<u.length;e+=1){if("number"!=typeof u[e])return t.destroy(Error("Invalid qos vector")),!1;f+=1}}let p=null;if(5===o){if(!(p=O(t,c,i,f)))return!1;f+=p.length}return t.write(r.ACKS[h][0][l][0]),w(t,f),g(t,a),null!==p&&p.write(),5===o&&t.write(n.from(u)),!0}(e,t,s);case"pingreq":case"pingresp":return t.write(r.EMPTY[e.cmd]);case"disconnect":return function(e,t,i){let o=i?i.protocolVersion:4,s=e||{},a=s.reasonCode,l=s.properties,u=5===o?1:0,c=null;if(5===o){if(!(c=O(t,l,i,u)))return!1;u+=c.length}return t.write(n.from([r.codes.disconnect<<4])),w(t,u),5===o&&t.write(n.from([a])),null!==c&&c.write(),!0}(e,t,s);case"auth":let u,c,h,f,d,y;return u=s?s.protocolVersion:4,h=(c=e||{}).reasonCode,f=c.properties,d=5===u?1:0,5!==u&&t.destroy(Error("Invalid mqtt version for auth packet")),!!(y=O(t,f,s,d))&&(d+=y.length,t.write(n.from([r.codes.auth<<4])),w(t,d),t.write(n.from([h])),null!==y&&y.write(),!0);default:return t.destroy(Error("Unknown command")),!1}}function _(e){e.uncork()}Object.defineProperty(m,"cacheNumbers",{get:()=>g===E,set(e){e?(u&&0!==Object.keys(u).length||(b=!0),g=E):(b=!1,g=A)}});var v={};function w(e,t){if(t>r.VARBYTEINT_MAX)return e.destroy(Error(`Invalid variable byte integer: ${t}`)),!1;let n=v[t];return n||(n=d(t),t<16384&&(v[t]=n)),l("writeVarByteInt: writing to stream: %o",n),e.write(n)}function S(e,t){let r=n.byteLength(t);return g(e,r),l("writeString: %s",t),e.write(t,"utf8")}function E(e,t){return l("writeNumberCached: number: %d",t),l("writeNumberCached: %o",u[t]),e.write(u[t])}function A(e,t){let r=c(t);return l("writeNumberGenerated: %o",r),e.write(r)}function I(e,t){"string"==typeof t?S(e,t):t?(g(e,t.length),e.write(t)):g(e,0)}function k(e,t){if("object"!=typeof t||null!=t.length)return{length:1,write(){P(e,{},0)}};let i=0;function o(t,i){let o=r.propertiesTypes[t],s=0;switch(o){case"byte":if("boolean"!=typeof i)return e.destroy(Error(`Invalid ${t}: ${i}`)),!1;s+=2;break;case"int8":if("number"!=typeof i||i<0||i>255)return e.destroy(Error(`Invalid ${t}: ${i}`)),!1;s+=2;break;case"binary":if(i&&null===i)return e.destroy(Error(`Invalid ${t}: ${i}`)),!1;s+=1+n.byteLength(i)+2;break;case"int16":if("number"!=typeof i||i<0||i>65535)return e.destroy(Error(`Invalid ${t}: ${i}`)),!1;s+=3;break;case"int32":if("number"!=typeof i||i<0||i>4294967295)return e.destroy(Error(`Invalid ${t}: ${i}`)),!1;s+=5;break;case"var":if("number"!=typeof i||i<0||i>268435455)return e.destroy(Error(`Invalid ${t}: ${i}`)),!1;s+=1+n.byteLength(d(i));break;case"string":if("string"!=typeof i)return e.destroy(Error(`Invalid ${t}: ${i}`)),!1;s+=3+n.byteLength(i.toString());break;case"pair":if("object"!=typeof i)return e.destroy(Error(`Invalid ${t}: ${i}`)),!1;s+=Object.getOwnPropertyNames(i).reduce((e,t)=>
2{let r=i[t];return Array.isArray(r)?e+=r.reduce((e,r)=>e+=3+n.byteLength(t.toString())+2+n.byteLength(r.toString()),0):e+=3+n.byteLength(t.toString())+2+n.byteLength(i[t].toString()),e},0);break;default:return e.destroy(Error(`Invalid property ${t}: ${i}`)),!1}return s}if(t)for(let e in t){let r=0,n=0,s=t[e];if(void 0!==s){if(Array.isArray(s))for(let t=0;t<s.length;t++){if(!(n=o(e,s[t])))return!1;r+=n}else{if(!(n=o(e,s)))return!1;r=n}if(!r)return!1;i+=r}}return{length:n.byteLength(d(i))+i,write(){P(e,t,i)}}}function O(e,t,r,n){let i=["reasonString","userProperties"],o=r&&r.properties&&r.properties.maximumPacketSize?r.properties.maximumPacketSize:0,s=k(e,t);if(o)for(;n+s.length>o;){let r=i.shift();if(!r||!t[r])return!1;delete t[r],s=k(e,t)}return s}function x(e,t,i){switch(r.propertiesTypes[t]){case"byte":e.write(n.from([r.properties[t]])),e.write(n.from([+i]));break;case"int8":e.write(n.from([r.properties[t]])),e.write(n.from([i]));break;case"binary":e.write(n.from([r.properties[t]])),I(e,i);break;case"int16":e.write(n.from([r.properties[t]])),g(e,i);break;case"int32":let o;e.write(n.from([r.properties[t]])),l("write4ByteNumber: %o",o=y(i)),e.write(o);break;case"var":e.write(n.from([r.properties[t]])),w(e,i);break;case"string":e.write(n.from([r.properties[t]])),S(e,i);break;case"pair":Object.getOwnPropertyNames(i).forEach(o=>{var s,a;let l=i[o];Array.isArray(l)?l.forEach(i=>{var s,a;e.write(n.from([r.properties[t]])),s=o.toString(),a=i.toString(),S(e,s),S(e,a)}):(e.write(n.from([r.properties[t]])),s=o.toString(),a=l.toString(),S(e,s),S(e,a))});break;default:return e.destroy(Error(`Invalid property ${t} value: ${i}`)),!1}}function P(e,t,r){for(let n in w(e,r),t)if(Object.prototype.hasOwnProperty.call(t,n)&&null!=t[n]){let r=t[n];if(Array.isArray(r))for(let t=0;t<r.length;t++)x(e,n,r[t]);else x(e,n,r)}}function T(e){return e?e instanceof n?e.length:n.byteLength(e):0}function R(e){return"string"==typeof e||e instanceof n}t.exports=m}),tY=l((e,t)=>{f(),e6(),eY();var r=tQ(),{EventEmitter:n}=(tf(),h(e7)),{Buffer:i}=(e3(),h(eX)),o=class extends n{constructor(){super(),this._array=Array(20),this._i=0}write(e){return this._array[this._i++]=e,!0}concat(){let e=0,t=Array(this._array.length),r=this._array,n=0,o;for(o=0;o<r.length&&void 0!==r[o];o++)"string"!=typeof r[o]?t[o]=r[o].length:t[o]=i.byteLength(r[o]),e+=t[o];let s=i.allocUnsafe(e);for(o=0;o<r.length&&void 0!==r[o];o++)"string"!=typeof r[o]?r[o].copy(s,n):s.write(r[o],n),n+=t[o];return s}destroy(e){e&&this.emit("error",e)}};t.exports=function(e,t){let n=new o;return r(e,n,t),n.concat()}}),tJ=l(e=>{f(),e6(),eY(),e.parser=tz().parser,e.generate=tY(),e.writeToStream=tQ()}),tX=l((e,t)=>{function r(e){return e instanceof e0?e0.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}f(),e6(),eY(),t.exports=function(e){if((e=e||{}).circles)return function(e){let t=[],n=[],i=new Map;if(i.set(Date,e=>new Date(e)),i.set(Map,(e,t)=>new Map(s(Array.from(e),t))),i.set(Set,(e,t)=>new Set(s(Array.from(e),t))),e.constructorHandlers)for(let t of e.constructorHandlers)i.set(t[0],t[1]);let o=null;return e.proto?function e(a){if("object"!=typeof a||null===a)return a;if(Array.isArray(a))return s(a,e);if(a.constructor!==Object&&(o=i.get(a.constructor)))return o(a,e);let l={};for(let s in t.push(a),n.push(l),a){let u=a[s];if("object"!=typeof u||null===u)l[s]=u;else if(u.constructor!==Object&&(o=i.get(u.constructor)))l[s]=o(u,e);else if(ArrayBuffer.isView(u))l[s]=r(u);else{let r=t.indexOf(u);-1!==r?l[s]=n[r]:l[s]=e(u)}}return t.pop(),n.pop(),l}:function e(a){if("object"!=typeof a||null===a)return a;if(Array.isArray(a))return s(a,e);if(a.constructor!==Object&&(o=i.get(a.constructor)))return o(a,e);let l={};for(let s in t.push(a),n.push(l),a){if(!1===Object.hasOwnProperty.call(a,s))continue;let u=a[s];if("object"!=typeof u||null===u)l[s]=u;else if(u.constructor!==Object&&(o=i.get(u.constructor)))l[s]=o(u,e);else if(ArrayBuffer.isView(u))l[s]=r(u);else{let r=t.indexOf(u);-1!==r?l[s]=n[r]:l[s]=e(u)}}return t.pop(),n.pop(),l};function s(e,s){let a=Object.keys(e),l=Array(a.length);for(let u=0;u<a.length;u++){let c=a[u],h=e[c];if("object"!=typeof h||null===h)l[c]=h;else if(h.constructor!==Object&&(o=i.get(h.constructor)))l[c]=o(h,s);
2else if(ArrayBuffer.isView(h))l[c]=r(h);else{let e=t.indexOf(h);-1!==e?l[c]=n[e]:l[c]=s(h)}}return l}}(e);let t=new Map;if(t.set(Date,e=>new Date(e)),t.set(Map,(e,t)=>new Map(i(Array.from(e),t))),t.set(Set,(e,t)=>new Set(i(Array.from(e),t))),e.constructorHandlers)for(let r of e.constructorHandlers)t.set(r[0],r[1]);let n=null;return e.proto?function e(o){if("object"!=typeof o||null===o)return o;if(Array.isArray(o))return i(o,e);if(o.constructor!==Object&&(n=t.get(o.constructor)))return n(o,e);let s={};for(let i in o){let a=o[i];"object"!=typeof a||null===a?s[i]=a:a.constructor!==Object&&(n=t.get(a.constructor))?s[i]=n(a,e):ArrayBuffer.isView(a)?s[i]=r(a):s[i]=e(a)}return s}:function e(o){if("object"!=typeof o||null===o)return o;if(Array.isArray(o))return i(o,e);if(o.constructor!==Object&&(n=t.get(o.constructor)))return n(o,e);let s={};for(let i in o){if(!1===Object.hasOwnProperty.call(o,i))continue;let a=o[i];"object"!=typeof a||null===a?s[i]=a:a.constructor!==Object&&(n=t.get(a.constructor))?s[i]=n(a,e):ArrayBuffer.isView(a)?s[i]=r(a):s[i]=e(a)}return s};function i(e,i){let o=Object.keys(e),s=Array(o.length);for(let a=0;a<o.length;a++){let l=o[a],u=e[l];"object"!=typeof u||null===u?s[l]=u:u.constructor!==Object&&(n=t.get(u.constructor))?s[l]=n(u,i):ArrayBuffer.isView(u)?s[l]=r(u):s[l]=i(u)}return s}}}),tZ=l((e,t)=>
2{f(),e6(),eY(),t.exports=tX()()}),t0=l(e=>{function t(e){let t=e.split("/");for(let e=0;e<t.length;e++)if("+"!==t[e]){if("#"===t[e])return e===t.length-1;if(-1!==t[e].indexOf("+")||-1!==t[e].indexOf("#"))return!1}return!0}f(),e6(),eY(),Object.defineProperty(e,"__esModule",{value:!0}),e.validateTopic=t,e.validateTopics=function(e){if(0===e.length)return"empty_topic_list";for(let r=0;r<e.length;r++)if(!t(e[r]))return e[r];return null}}),t1=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"__esModule",{value:!0});var t=tU(),r={objectMode:!0},n={clean:!0},i=class{options;_inflights;constructor(e){this.options=e||{},this.options={...n,...e},this._inflights=new Map}put(e,t){return this._inflights.set(e.messageId,e),t&&t(),this}createStream(){let e=new t.Readable(r),n=[],i=!1,o=0;return this._inflights.forEach((e,t)=>{n.push(e)}),e._read=()=>{!i&&o<n.length?e.push(n[o++]):e.push(null)},e.destroy=t=>{if(!i)return i=!0,setTimeout(()=>{e.emit("close")},0),e},e}del(e,t){let r=this._inflights.get(e.messageId);return r?(this._inflights.delete(e.messageId),t(null,r)):t&&t(Error("missing packet")),this}get(e,t){let r=this._inflights.get(e.messageId);return r?t(null,r):t&&t(Error("missing packet")),this}close(e){this.options.clean&&(this._inflights=null),e&&e()}};e.default=i}),t2=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"__esModule",{value:!0});var t=[0,16,128,131,135,144,145,151,153];e.default=(e,r,n)=>{e.log("handlePublish: packet %o",r),n="u">typeof n?n:e.noop;let i=r.topic.toString(),o=r.payload,{qos:s}=r,{messageId:a}=r,{options:l}=e;if(5===e.options.protocolVersion){let t;if(r.properties&&(t=r.properties.topicAlias),"u">typeof t){if(0===i.length){if(t>0&&t<=65535){let r=e.topicAliasRecv.getTopicByAlias(t);if(r)i=r,e.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",i,t);else{e.log("handlePublish :: unregistered topic alias. alias: %d",t),e.emit("error",Error("Received unregistered Topic Alias"));return}}else{e.log("handlePublish :: topic alias out of range. alias: %d",t),e.emit("error",Error("Received Topic Alias is out of range"));return}}else if(e.topicAliasRecv.put(i,t))e.log("handlePublish :: registered topic: %s - alias: %d",i,t);else{e.log("handlePublish :: topic alias out of range. alias: %d",t),e.emit("error",Error("Received Topic Alias is out of range"));return}}}switch(e.log("handlePublish: qos %d",s),s){case 2:l.customHandleAcks(i,o,r,(i,o)=>("number"==typeof i&&(o=i,i=null),i)?e.emit("error",i):-1===t.indexOf(o)?e.emit("error",Error("Wrong reason code for pubrec")):void(o?e._sendPacket({cmd:"pubrec",messageId:a,reasonCode:o},n):e.incomingStore.put(r,()=>{e._sendPacket({cmd:"pubrec",messageId:a},n)})));break;case 1:l.customHandleAcks(i,o,r,(s,l)=>("number"==typeof s&&(l=s,s=null),s)?e.emit("error",s):-1===t.indexOf(l)?e.emit("error",Error("Wrong reason code for puback")):void(l||e.emit("message",i,o,r),e.handleMessage(r,t=>{if(t)return n&&n(t);e._sendPacket({cmd:"puback",messageId:a,reasonCode:l},n)})));break;case 0:e.emit("message",i,o,r),e.handleMessage(r,n);break;default:e.log("handlePublish: unknown QoS. Doing nothing.")}}}),t3=l((e,t)=>{t.exports={version:"5.15.1"}}),t6=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"__esModule",{value:!0}),e.MQTTJS_VERSION=e.nextTick=e.ErrorWithSubackPacket=e.ErrorWithReasonCode=void 0,e.applyMixin=function(e,t,r=!1){let n=[t];for(;;){let e=Object.getPrototypeOf(n[0]);if(e?.prototype)n.unshift(e);else break}for(let t of n)for(let n of Object.getOwnPropertyNames(t.prototype))(r||"constructor"!==n)&&Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(t.prototype,n)??Object.create(null))};var t=class e extends Error{code;constructor(t,r){super(t),this.code=r,Object.setPrototypeOf(this,e.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}};e.ErrorWithReasonCode=t;var r=class e extends Error{packet;constructor(t,r){super(t),this.packet=r,Object.setPrototypeOf(this,e.prototype),Object.getPrototypeOf(this).name="ErrorWithSubackPacket"}};e.ErrorWithSubackPacket=r,e.nextTick="function"==typeof p?.nextTick?p.nextTick:e=>{setTimeout(e,0)},e.MQTTJS_VERSION=t3().version}),t5=l(e=>
2{f(),e6(),eY(),Object.defineProperty(e,"__esModule",{value:!0}),e.ReasonCodes=void 0;var t=t6();e.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"},e.default=(r,n)=>{let{messageId:i}=n,o=n.cmd,s=null,a=r.outgoing[i]?r.outgoing[i].cb:null,l=null;if(!a){r.log("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(r.log("_handleAck :: packet type",o),o){case"pubcomp":case"puback":{let o=n.reasonCode;o&&o>0&&16!==o?(l=new t.ErrorWithReasonCode(`Publish error: ${e.ReasonCodes[o]}`,o),r._removeOutgoingAndStoreMessage(i,()=>{a(l,n)})):r._removeOutgoingAndStoreMessage(i,a);break}case"pubrec":{s={cmd:"pubrel",qos:2,messageId:i};let o=n.reasonCode;o&&o>0&&16!==o?(l=new t.ErrorWithReasonCode(`Publish error: ${e.ReasonCodes[o]}`,o),r._removeOutgoingAndStoreMessage(i,()=>{a(l,n)})):r._sendPacket(s);break}case"suback":{delete r.outgoing[i],r.messageIdProvider.deallocate(i);let t=n.granted;for(let n=0;n<t.length;n++){let o=t[n];if((128&o)!=0){(l=Error(`Subscribe error: ${e.ReasonCodes[o]}`)).code=o;let t=r.messageIdToTopic[i];t&&t.forEach(e=>{delete r._resubscribeTopics[e]})}}delete r.messageIdToTopic[i],r._invokeStoreProcessingQueue(),a(l,n);break}case"unsuback":delete r.outgoing[i],r.messageIdProvider.deallocate(i),r._invokeStoreProcessingQueue(),a(null,n);break;default:r.emit("error",Error("unrecognized packet type"))}r.disconnecting&&0===Object.keys(r.outgoing).length&&r.emit("outgoingEmpty")}}),t4=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"__esModule",{value:!0});var t=t6(),r=t5();e.default=(e,n)=>{let{options:i}=e,o=i.protocolVersion,s=5===o?n.reasonCode:n.returnCode;if(5!==o){let r=new t.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${o}`,s);e.emit("error",r);return}e.handleAuth(n,(n,i)=>{if(n){e.emit("error",n);return}if(24===s)e.reconnecting=!1,e._sendPacket(i);else{let n=new t.ErrorWithReasonCode(`Connection refused: ${r.ReasonCodes[s]}`,s);e.emit("error",n)}})}}),t8=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=void 0;var t="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,r=new Set,n="object"==typeof p&&p?p:{},i=(e,t,r,i)=>{"function"==typeof n.emitWarning?n.emitWarning(e,t,r,i):console.error(`[${r}] ${t}: ${e}`)},o=globalThis.AbortController,s=globalThis.AbortSignal;if(typeof o>"u"){s=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},o=class{constructor(){t()}signal=new s;abort(e){if(!this.signal.aborted){for(let t of(this.signal.reason=e,this.signal.aborted=!0,this.signal._onabort))t(e);this.signal.onabort?.(e)}}};let e=n.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{e&&(e=!1,i("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}var a=e=>!r.has(e),l=(Symbol("type"),e=>e&&e===Math.floor(e)&&e>0&&isFinite(e)),u=e=>l(e)?e<=256?Uint8Array:e<=65536?Uint16Array:e<=4294967296?Uint32Array:e<=Number.MAX_SAFE_INTEGER?c:null:null,c=class extends Array{constructor(e){super(e),this.fill(0)}},h=class e{heap;length;static #e=!1;static create(t){let r=u(t);if(!r)return[];e.#e=!0;let n=new e(t,r);return e.#e=!1,n}constructor(t,r){if(!e.#e)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(t),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},d=class e{#e;#t;#r;#n;#i;#o;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#s;#a;#l;#u;#c;#h;#f;#p;#d;#y;#g;#b;#m;#_;#v;#w;#S;static unsafeExposeInternals(e){return{starts:e.#m,ttls:e.#_,sizes:e.#b,keyMap:e.#l,keyList:e.#u,valList:e.#c,next:e.#h,prev:e.#f,get head(){return e.#p},get tail(){return e.#d}
2,free:e.#y,isBackgroundFetch:t=>e.#E(t),backgroundFetch:(t,r,n,i)=>e.#A(t,r,n,i),moveToTail:t=>e.#I(t),indexes:t=>e.#k(t),rindexes:t=>e.#O(t),isStale:t=>e.#x(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#a}get size(){return this.#s}get fetchMethod(){return this.#i}get memoMethod(){return this.#o}get dispose(){return this.#r}get disposeAfter(){return this.#n}constructor(t){let{max:n=0,ttl:o,ttlResolution:s=1,ttlAutopurge:c,updateAgeOnGet:f,updateAgeOnHas:p,allowStale:d,dispose:y,disposeAfter:g,noDisposeOnSet:b,noUpdateTTL:m,maxSize:_=0,maxEntrySize:v=0,sizeCalculation:w,fetchMethod:S,memoMethod:E,noDeleteOnFetchRejection:A,noDeleteOnStaleGet:I,allowStaleOnFetchRejection:k,allowStaleOnFetchAbort:O,ignoreFetchAbort:x}=t;if(0!==n&&!l(n))throw TypeError("max option must be a nonnegative integer");let P=n?u(n):Array;if(!P)throw Error("invalid max value: "+n);if(this.#e=n,this.#t=_,this.maxEntrySize=v||this.#t,this.sizeCalculation=w,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw TypeError("sizeCalculation set to non-function")}if(void 0!==E&&"function"!=typeof E)throw TypeError("memoMethod must be a function if defined");if(this.#o=E,void 0!==S&&"function"!=typeof S)throw TypeError("fetchMethod must be a function if specified");if(this.#i=S,this.#w=!!S,this.#l=new Map,this.#u=Array(n).fill(void 0),this.#c=Array(n).fill(void 0),this.#h=new P(n),this.#f=new P(n),this.#p=0,this.#d=0,this.#y=h.create(n),this.#s=0,this.#a=0,"function"==typeof y&&(this.#r=y),"function"==typeof g?(this.#n=g,this.#g=[]):(this.#n=void 0,this.#g=void 0),this.#v=!!this.#r,this.#S=!!this.#n,this.noDisposeOnSet=!!b,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!A,this.allowStaleOnFetchRejection=!!k,this.allowStaleOnFetchAbort=!!O,this.ignoreFetchAbort=!!x,0!==this.maxEntrySize){if(0!==this.#t&&!l(this.#t))throw TypeError("maxSize must be a positive integer if specified");if(!l(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#P()}if(this.allowStale=!!d,this.noDeleteOnStaleGet=!!I,this.updateAgeOnGet=!!f,this.updateAgeOnHas=!!p,this.ttlResolution=l(s)||0===s?s:1,this.ttlAutopurge=!!c,this.ttl=o||0,this.ttl){if(!l(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#T()}if(0===this.#e&&0===this.ttl&&0===this.#t)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let t="LRU_CACHE_UNBOUNDED";a(t)&&(r.add(t),i("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,e))}}getRemainingTTL(e){return this.#l.has(e)?1/0:0}#T(){let e=new c(this.#e),r=new c(this.#e);this.#_=e,this.#m=r,this.#R=(n,i,o=t.now())=>{if(r[n]=0!==i?o:0,e[n]=i,0!==i&&this.ttlAutopurge){let e=setTimeout(()=>{this.#x(n)&&this.#C(this.#u[n],"expire")},i+1);e.unref&&e.unref()}},this.#j=n=>{r[n]=0!==e[n]?t.now():0},this.#M=(t,o)=>{if(e[o]){let s=e[o],a=r[o];if(!s||!a)return;t.ttl=s,t.start=a,t.now=n||i();let l=t.now-a;t.remainingTTL=s-l}};let n=0,i=()=>{let e=t.now();if(this.ttlResolution>0){n=e;let t=setTimeout(()=>n=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=t=>{let o=this.#l.get(t);if(void 0===o)return 0;let s=e[o],a=r[o];return s&&a?s-((n||i())-a):1/0},this.#x=t=>{let o=r[t],s=e[t];return!!s&&!!o&&(n||i())-o>s}}#j=()=>{};#M=()=>{};#R=()=>{};#x=()=>!1;#P(){let e=new c(this.#e);this.#a=0,this.#b=e,this.#B=t=>{this.#a-=e[t],e[t]=0},this.#N=(e,t,r,n)=>{if(this.#E(t))return 0;if(!l(r)){if(n){if("function"!=typeof n)throw TypeError("sizeCalculation must be a function");if(!l(r=n(t,e)))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return r},this.#U=(t,r,n)=>{if(e[t]=r,this.#t){let r=this.#t-e[t];for(;this.#a>r;)this.#L(!0)}this.#a+=e[t],n&&(n.entrySize=r,n.totalCalculatedSize=this.#a)}}#B=e=>{};#U=(e,t,r)=>{};#N=(e,t,r,n)=>{if(r||n)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#k({allowStale:e=this.allowStale}={}){if(this.#s)for(let t=this.#d;!(!this.#D(t)||((e||!this.#x(t))&&(yield t),t===this.#p));)t=this.#f[t]}*#O({allowStale:e=this.allowStale}={}){if(this.#s)for(let t=this.#p;!(!this.#D(t)||((e||!this.#x(t))&&(yield t),t===this.#d));)t=this.#h[t]}#D(e){return void 0!==e&&this.#l.get(this.#u[e])===e}*entries(){for(let e of this.#k())void 0===this.#c[e]||void 0===this.#u[e]||this.#E(this.#c[e])||(yield[this.#u[e],this.#c[e]])}*rentries(){for(let e of this.#O())void 0===this.#c[e]||void 0===this.#u[e]||this.#E(this.#c[e])||(yield[this.#u[e],this.#c[e]])}*keys(){for(let e of this.#k()){let t=this.#u[e];void 0===t||this.#E(this.#c[e])||(yield t)}}*rkeys(){for(let e of this.#O()){let t=this.#u[e];void 0===t||this.#E(this.#c[e])||(yield t)}}*values(){for(let e of this.#k())void 0===this.#c[e]||this.#E(this.#c[e])||(yield this.#c[e])}*rvalues(){for(let e of this.#O())void 0===this.#c[e]||this.#E(this.#c[e])||(yield this.#c[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#k()){let n=this.#c[r],i=this.#E(n)?n.__staleWhileFetching:n;if(void 0!==i&&e(i,this.#u[r],this))return this.get(this.#u[r],t)}}forEach(e,t=this){for(let r of this.#k()){let n=this.#c[r],i=this.#E(n)?n.__staleWhileFetching:n;void 0!==i&&e.call(t,i,this.#u[r],this)}}
2rforEach(e,t=this){for(let r of this.#O()){let n=this.#c[r],i=this.#E(n)?n.__staleWhileFetching:n;void 0!==i&&e.call(t,i,this.#u[r],this)}}purgeStale(){let e=!1;for(let t of this.#O({allowStale:!0}))this.#x(t)&&(this.#C(this.#u[t],"expire"),e=!0);return e}info(e){let r=this.#l.get(e);if(void 0===r)return;let n=this.#c[r],i=this.#E(n)?n.__staleWhileFetching:n;if(void 0===i)return;let o={value:i};if(this.#_&&this.#m){let e=this.#_[r],n=this.#m[r];if(e&&n){let r=e-(t.now()-n);o.ttl=r,o.start=Date.now()}}return this.#b&&(o.size=this.#b[r]),o}dump(){let e=[];for(let r of this.#k({allowStale:!0})){let n=this.#u[r],i=this.#c[r],o=this.#E(i)?i.__staleWhileFetching:i;if(void 0===o||void 0===n)continue;let s={value:o};if(this.#_&&this.#m){s.ttl=this.#_[r];let e=t.now()-this.#m[r];s.start=Math.floor(Date.now()-e)}this.#b&&(s.size=this.#b[r]),e.unshift([n,s])}return e}load(e){for(let[r,n]of(this.clear(),e)){if(n.start){let e=Date.now()-n.start;n.start=t.now()-e}this.set(r,n.value,n)}}set(e,t,r={}){if(void 0===t)return this.delete(e),this;let{ttl:n=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:a}=r,{noUpdateTTL:l=this.noUpdateTTL}=r,u=this.#N(e,t,r.size||0,s);if(this.maxEntrySize&&u>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#C(e,"set"),this;let c=0===this.#s?void 0:this.#l.get(e);if(void 0===c)c=0===this.#s?this.#d:0!==this.#y.length?this.#y.pop():this.#s===this.#e?this.#L(!1):this.#s,this.#u[c]=e,this.#c[c]=t,this.#l.set(e,c),this.#h[this.#d]=c,this.#f[c]=this.#d,this.#d=c,this.#s++,this.#U(c,u,a),a&&(a.set="add"),l=!1;else{this.#I(c);let r=this.#c[c];if(t!==r){if(this.#w&&this.#E(r)){r.__abortController.abort(Error("replaced"));let{__staleWhileFetching:t}=r;void 0!==t&&!o&&(this.#v&&this.#r?.(t,e,"set"),this.#S&&this.#g?.push([t,e,"set"]))}else o||(this.#v&&this.#r?.(r,e,"set"),this.#S&&this.#g?.push([r,e,"set"]));if(this.#B(c),this.#U(c,u,a),this.#c[c]=t,a){a.set="replace";let e=r&&this.#E(r)?r.__staleWhileFetching:r;void 0!==e&&(a.oldValue=e)}}else a&&(a.set="update")}if(0===n||this.#_||this.#T(),this.#_&&(l||this.#R(c,n,i),a&&this.#M(a,c)),!o&&this.#S&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#n?.(...t)}return this}pop(){try{for(;this.#s;){let e=this.#c[this.#p];if(this.#L(!0),this.#E(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(this.#S&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#n?.(...t)}}}#L(e){let t=this.#p,r=this.#u[t],n=this.#c[t];return this.#w&&this.#E(n)?n.__abortController.abort(Error("evicted")):(this.#v||this.#S)&&(this.#v&&this.#r?.(n,r,"evict"),this.#S&&this.#g?.push([n,r,"evict"])),this.#B(t),e&&(this.#u[t]=void 0,this.#c[t]=void 0,this.#y.push(t)),1===this.#s?(this.#p=this.#d=0,this.#y.length=0):this.#p=this.#h[t],this.#l.delete(r),this.#s--,t}has(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:n}=t,i=this.#l.get(e);if(void 0!==i){let e=this.#c[i];if(this.#E(e)&&void 0===e.__staleWhileFetching)return!1;if(!this.#x(i))return r&&this.#j(i),n&&(n.has="hit",this.#M(n,i)),!0;n&&(n.has="stale",this.#M(n,i))}else n&&(n.has="miss");return!1}peek(e,t={}){let{allowStale:r=this.allowStale}=t,n=this.#l.get(e);if(void 0===n||!r&&this.#x(n))return;let i=this.#c[n];return this.#E(i)?i.__staleWhileFetching:i}#A(e,t,r,n){let i=void 0===t?void 0:this.#c[t];if(this.#E(i))return i;let s=new o,{signal:a}=r;a?.addEventListener("abort",()=>s.abort(a.reason),{signal:s.signal});let l={signal:s.signal,options:r,context:n},u=(n,i=!1)=>{let{aborted:o}=s.signal,a=r.ignoreFetchAbort&&void 0!==n;return(r.status&&(o&&!i?(r.status.fetchAborted=!0,r.status.fetchError=s.signal.reason,a&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),!o||a||i)?(this.#c[t]===h&&(void 0===n?h.__staleWhileFetching?this.#c[t]=h.__staleWhileFetching:this.#C(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,n,l.options))),n):c(s.signal.reason)},c=n=>{let{aborted:i}=s.signal,o=i&&r.allowStaleOnFetchAbort,a=o||r.allowStaleOnFetchRejection,l=a||r.noDeleteOnFetchRejection;if(this.#c[t]===h&&(l&&void 0!==h.__staleWhileFetching?o||(this.#c[t]=h.__staleWhileFetching):this.#C(e,"fetch")),a)return r.status&&void 0!==h.__staleWhileFetching&&(r.status.returnedStale=!0),h.__staleWhileFetching;if(h.__returned===h)throw n};
2r.status&&(r.status.fetchDispatched=!0);let h=new Promise((t,n)=>{let o=this.#i?.(e,i,l);o&&o instanceof Promise&&o.then(e=>t(void 0===e?void 0:e),n),s.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(t(void 0),r.allowStaleOnFetchAbort&&(t=e=>u(e,!0)))})}).then(u,e=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=e),c(e))),f=Object.assign(h,{__abortController:s,__staleWhileFetching:i,__returned:void 0});return void 0===t?(this.set(e,f,{...l.options,status:void 0}),t=this.#l.get(e)):this.#c[t]=f,f}#E(e){return!!this.#w&&!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof o}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:d,forceRefresh:y=!1,status:g,signal:b}=t;if(!this.#w)return g&&(g.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,status:g});let m={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:s,size:a,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:g,signal:b},_=this.#l.get(e);if(void 0===_){g&&(g.fetch="miss");let t=this.#A(e,_,m,d);return t.__returned=t}{let t=this.#c[_];if(this.#E(t)){let e=r&&void 0!==t.__staleWhileFetching;return g&&(g.fetch="inflight",e&&(g.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}let i=this.#x(_);if(!y&&!i)return g&&(g.fetch="hit"),this.#I(_),n&&this.#j(_),g&&this.#M(g,_),t;let o=this.#A(e,_,m,d),s=void 0!==o.__staleWhileFetching&&r;return g&&(g.fetch=i?"stale":"refresh",s&&i&&(g.returnedStale=!0)),s?o.__staleWhileFetching:o.__returned=o}}async forceFetch(e,t={}){let r=await this.fetch(e,t);if(void 0===r)throw Error("fetch() returned undefined");return r}memo(e,t={}){let r=this.#o;if(!r)throw Error("no memoMethod provided to constructor");let{context:n,forceRefresh:i,...o}=t,s=this.get(e,o);if(!i&&void 0!==s)return s;let a=r(e,s,{options:o,context:n});return this.set(e,a,o),a}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=t,s=this.#l.get(e);if(void 0!==s){let t=this.#c[s],a=this.#E(t);return o&&this.#M(o,s),this.#x(s)?(o&&(o.get="stale"),a?(o&&r&&void 0!==t.__staleWhileFetching&&(o.returnedStale=!0),r?t.__staleWhileFetching:void 0):(i||this.#C(e,"expire"),o&&r&&(o.returnedStale=!0),r?t:void 0)):(o&&(o.get="hit"),a?t.__staleWhileFetching:(this.#I(s),n&&this.#j(s),t))}o&&(o.get="miss")}#F(e,t){this.#f[t]=e,this.#h[e]=t}#I(e){e!==this.#d&&(e===this.#p?this.#p=this.#h[e]:this.#F(this.#f[e],this.#h[e]),this.#F(this.#d,e),this.#d=e)}delete(e){return this.#C(e,"delete")}#C(e,t){let r=!1;if(0!==this.#s){let n=this.#l.get(e);if(void 0!==n){if(r=!0,1===this.#s)this.#W(t);else{this.#B(n);let r=this.#c[n];if(this.#E(r)?r.__abortController.abort(Error("deleted")):(this.#v||this.#S)&&(this.#v&&this.#r?.(r,e,t),this.#S&&this.#g?.push([r,e,t])),this.#l.delete(e),this.#u[n]=void 0,this.#c[n]=void 0,n===this.#d)this.#d=this.#f[n];else if(n===this.#p)this.#p=this.#h[n];else{let e=this.#f[n];this.#h[e]=this.#h[n];let t=this.#h[n];this.#f[t]=this.#f[n]}this.#s--,this.#y.push(n)}}}if(this.#S&&this.#g?.length){let e=this.#g,t;for(;t=e?.shift();)this.#n?.(...t)}return r}clear(){return this.#W("delete")}#W(e){for(let t of this.#O({allowStale:!0})){let r=this.#c[t];if(this.#E(r))r.__abortController.abort(Error("deleted"));else{let n=this.#u[t];this.#v&&this.#r?.(r,n,e),this.#S&&this.#g?.push([r,n,e])}}if(this.#l.clear(),this.#c.fill(void 0),this.#u.fill(void 0),this.#_&&this.#m&&(this.#_.fill(0),this.#m.fill(0)),this.#b&&this.#b.fill(0),this.#p=0,this.#d=0,this.#y.length=0,this.#a=0,this.#s=0,this.#S&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#n?.(...t)}}};e.LRUCache=d}),t9=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"t",{value:!0}),e.ContainerIterator=e.Container=e.Base=void 0,e.ContainerIterator=class{constructor(e=0){this.iteratorType=e}equals(e){return this.o===e.o}};var t=class{constructor(){this.i=0}get length(){return this.i}size(){return this.i}empty(){return 0===this.i}};e.Base=t;var r=class extends t{};e.Container=r}),t7=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=t9(),r=class extends t.Base{constructor(e=[]){super(),this.S=[];let t=this;e.forEach(function(e){t.push(e)})}clear(){this.i=0,this.S=[]}push(e){return this.S.push(e),this.i+=1,this.i}pop(){if(0!==this.i)return this.i-=1,this.S.pop()}top(){return this.S[this.i-1]}};e.default=r}),re=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=t9(),r=class extends t.Base{constructor(e=[]){super(),this.j=0,this.q=[];let t=this;e.forEach(function(e){t.push(e)})}clear(){this.q=[],this.i=this.j=0}push(e){let t=this.q.length;if(this.j/t>.5&&this.j+this.i>=t&&t>4096){let t=this.i;for(let e=0;e<t;++e)this.q[e]=this.q[this.j+e];this.j=0,this.q[this.i]=e}else this.q[this.j+this.i]=e;return++this.i}pop(){if(0===this.i)return;let e=this.q[this.j++];return this.i-=1,e}front(){if(0!==this.i)return this.q[this.j]}};e.default=r}),rt=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=t9(),r=class extends t.Base{constructor(e=[],t=function(e,t){return e>t?-1:e<t?1:0},r=!0){if(super(),this.v=t,Array.isArray(e))this.C=r?[...e]:e;else{this.C=[];let t=this;e.forEach(function(e){t.C.push(e)})}this.i=this.C.length;let n=this.i>>1;for(let e=this.i-1>>1;e>=0;--e)this.k(e,n)}m(e){let t=this.C[e];for(;e>0;){let r=e-1>>1,n=this.C[r];if(0>=this.v(n,t))break;this.C[e]=n,e=r}this.C[e]=t}k(e,t){let r=this.C[e];for(;e<t;){let t=e<<1|1,n=t+1,i=this.C[t];
2if(n<this.i&&this.v(i,this.C[n])>0&&(t=n,i=this.C[n]),this.v(i,r)>=0)break;this.C[e]=i,e=t}this.C[e]=r}clear(){this.i=0,this.C.length=0}push(e){this.C.push(e),this.m(this.i),this.i+=1}pop(){if(0===this.i)return;let e=this.C[0],t=this.C.pop();return this.i-=1,this.i&&(this.C[0]=t,this.k(0,this.i>>1)),e}top(){return this.C[0]}find(e){return this.C.indexOf(e)>=0}remove(e){let t=this.C.indexOf(e);return!(t<0)&&(0===t?this.pop():t===this.i-1?(this.C.pop(),this.i-=1):(this.C.splice(t,1,this.C.pop()),this.i-=1,this.m(t),this.k(t,this.i>>1)),!0)}updateItem(e){let t=this.C.indexOf(e);return!(t<0)&&(this.m(t),this.k(t,this.i>>1),!0)}toArray(){return[...this.C]}};e.default=r}),rr=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=t9(),r=class extends t.Container{};e.default=r}),rn=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"t",{value:!0}),e.throwIteratorAccessError=function(){throw RangeError("Iterator access denied!")}}),ri=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"t",{value:!0}),e.RandomIterator=void 0;var t=t9(),r=rn(),n=class extends t.ContainerIterator{constructor(e,t){super(t),this.o=e,0===this.iteratorType?(this.pre=function(){return 0===this.o&&(0,r.throwIteratorAcce
2ssError)(),this.o-=1,this},this.next=function(){return this.o===this.container.size()&&(0,r.throwIteratorAccessError)(),this.o+=1,this}):(this.pre=function(){return this.o===this.container.size()-1&&(0,r.throwIteratorAccessError)(),this.o+=1,this},this.next=function(){return -1===this.o&&(0,r.throwIteratorAccessError)(),this.o-=1,this})}get pointer(){return this.container.getElementByPos(this.o)}set pointer(e){this.container.setElementByPos(this.o,e)}};e.RandomIterator=n}),ro=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t,r=(t=rr())&&t.t?t:{default:t},n=ri(),i=class e extends n.RandomIterator{constructor(e,t,r){super(e,r),this.container=t}copy(){return new e(this.o,this.container,this.iteratorType)}},o=class extends r.default{constructor(e=[],t=!0){if(super(),Array.isArray(e))this.J=t?[...e]:e,this.i=e.length;else{this.J=[];let t=this;e.forEach(function(e){t.pushBack(e)})}}clear(){this.i=0,this.J.length=0}begin(){return new i(0,this)}end(){return new i(this.i,this)}rBegin(){return new i(this.i-1,this,1)}rEnd(){return new i(-1,this,1)}front(){return this.J[0]}back(){return this.J[this.i-1]}getElementByPos(e){if(e<0||e>this.i-1)throw RangeError();return this.J[e]}eraseElementByPos(e){if(e<0||e>this.i-1)throw RangeError();return this.J.splice(e,1),this.i-=1,this.i}eraseElementByValue(e){let t=0;for(let r=0;r<this.i;++r)this.J[r]!==e&&(this.J[t++]=this.J[r]);return this.i=this.J.length=t,this.i}eraseElementByIterator(e){let t=e.o;return e=e.next(),this.eraseElementByPos(t),e}pushBack(e){return this.J.push(e),this.i+=1,this.i}popBack(){if(0!==this.i)return this.i-=1,this.J.pop()}setElementByPos(e,t){if(e<0||e>this.i-1)throw RangeError();this.J[e]=t}insert(e,t,r=1){if(e<0||e>this.i)throw RangeError();return this.J.splice(e,0,...Array(r).fill(t)),this.i+=r,this.i}find(e){for(let t=0;t<this.i;++t)if(this.J[t]===e)return new i(t,this);return this.end()}reverse(){this.J.reverse()}unique(){let e=1;for(let t=1;t<this.i;++t)this.J[t]!==this.J[t-1]&&(this.J[e++]=this.J[t]);return this.i=this.J.length=e,this.i}sort(e){this.J.sort(e)}forEach(e){for(let t=0;t<this.i;++t)e(this.J[t],t,this)}[Symbol.iterator](){return(function*(){yield*this.J}).bind(this)()}};e.default=o}),rs=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t,r=(t=rr())&&t.t?t:{default:t},n=t9(),i=rn(),o=class e extends n.ContainerIterator{constructor(e,t,r,n){super(n),this.o=e,this.h=t,this.container=r,0===this.iteratorType?(this.pre=function(){return this.o.L===this.h&&(0,i.throwIteratorAcce
2ssError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.L,this})}get pointer(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o.l}set pointer(e){this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o.l=e}copy(){return new e(this.o,this.h,this.container,this.iteratorType)}},s=class extends r.default{constructor(e=[]){super(),this.h={},this.p=this._=this.h.L=this.h.B=this.h;let t=this;e.forEach(function(e){t.pushBack(e)})}V(e){let{L:t,B:r}=e;t.B=r,r.L=t,e===this.p&&(this.p=r),e===this._&&(this._=t),this.i-=1}G(e,t){let r=t.B,n={l:e,L:t,B:r};t.B=n,r.L=n,t===this.h&&(this.p=n),r===this.h&&(this._=n),this.i+=1}clear(){this.i=0,this.p=this._=this.h.L=this.h.B=this.h}begin(){return new o(this.p,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this._,this.h,this,1)}rEnd(){return new o(this.h,this.h,this,1)}front(){return this.p.l}back(){return this._.l}getElementByPos(e){if(e<0||e>this.i-1)throw RangeError();let t=this.p;for(;e--;)t=t.B;return t.l}eraseElementByPos(e){if(e<0||e>this.i-1)throw RangeError();let t=this.p;for(;e--;)t=t.B;return this.V(t),this.i}eraseElementByValue(e){let t=this.p;for(;t!==this.h;)t.l===e&&this.V(t),t=t.B;return this.i}eraseElementByIterator(e){let t=e.o;
2return t===this.h&&(0,i.throwIteratorAccessError)(),e=e.next(),this.V(t),e}pushBack(e){return this.G(e,this._),this.i}popBack(){if(0===this.i)return;let e=this._.l;return this.V(this._),e}pushFront(e){return this.G(e,this.h),this.i}popFront(){if(0===this.i)return;let e=this.p.l;return this.V(this.p),e}setElementByPos(e,t){if(e<0||e>this.i-1)throw RangeError();let r=this.p;for(;e--;)r=r.B;r.l=t}insert(e,t,r=1){if(e<0||e>this.i)throw RangeError();if(r<=0)return this.i;if(0===e)for(;r--;)this.pushFront(t);else if(e===this.i)for(;r--;)this.pushBack(t);else{let n=this.p;for(let t=1;t<e;++t)n=n.B;let i=n.B;for(this.i+=r;r--;)n.B={l:t,L:n},n.B.L=n,n=n.B;n.B=i,i.L=n}return this.i}find(e){let t=this.p;for(;t!==this.h;){if(t.l===e)return new o(t,this.h,this);t=t.B}return this.end()}reverse(){if(this.i<=1)return;let e=this.p,t=this._,r=0;for(;r<<1<this.i;){let n=e.l;e.l=t.l,t.l=n,e=e.B,t=t.L,r+=1}}unique(){if(this.i<=1)return this.i;let e=this.p;for(;e!==this.h;){let t=e;for(;t.B!==this.h&&t.l===t.B.l;)t=t.B,this.i-=1;e.B=t.B,e.B.L=e,e=e.B}return this.i}sort(e){if(this.i<=1)return;let t=[];this.forEach(function(e){t.push(e)}),t.sort(e);let r=this.p;t.forEach(function(e){r.l=e,r=r.B})}merge(e){let t=this;if(0===this.i)e.forEach(function(e){t.pushBack(e)});else{let r=this.p;e.forEach(function(e){for(;r!==t.h&&r.l<=e;)r=r.B;t.G(e,r.L)})}return this.i}forEach(e){let t=this.p,r=0;for(;t!==this.h;)e(t.l,r++,this),t=t.B}[Symbol.iterator](){return(function*(){if(0===this.i)return;let e=this.p;for(;e!==this.h;)yield e.l,e=e.B}).bind(this)()}};e.default=s}),ra=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t,r=(t=rr())&&t.t?t:{default:t},n=ri(),i=class e extends n.RandomIterator{constructor(e,t,r){super(e,r),this.container=t}copy(){return new e(this.o,this.container,this.iteratorType)}},o=class extends r.default{constructor(e=[],t=4096){super(),this.j=0,this.D=0,this.R=0,this.N=0,this.P=0,this.A=[];let r=(()=>{if("number"==typeof e.length)return e.length;if("number"==typeof e.size)return e.size;if("function"==typeof e.size)return e.size();throw TypeError("Cannot get the length or size of the container")})();this.F=t,this.P=Math.max(Math.ceil(r/this.F),1);for(let e=0;e<this.P;++e)this.A.push(Array(this.F));let n=Math.ceil(r/this.F);this.j=this.R=(this.P>>1)-(n>>1),this.D=this.N=this.F-r%this.F>>1;let i=this;e.forEach(function(e){i.pushBack(e)})}T(){let e=[],t=Math.max(this.P>>1,1);for(let r=0;r<t;++r)e[r]=Array(this.F);for(let t=this.j;t<this.P;++t)e[e.length]=this.A[t];for(let t=0;t<this.R;++t)e[e.length]=this.A[t];e[e.length]=[...this.A[this.R]],this.j=t,this.R=e.length-1;for(let r=0;r<t;++r)e[e.length]=Array(this.F);this.A=e,this.P=e.length}O(e){let t=this.D+e+1,r=t%this.F,n=r-1,i=this.j+(t-r)/this.F;return 0===r&&(i-=1),i%=this.P,n<0&&(n+=this.F),{curNodeBucketIndex:i,curNodePointerIndex:n}}clear(){this.A=[Array(this.F)],this.P=1,this.j=this.R=this.i=0,this.D=this.N=this.F>>1}begin(){return new i(0,this)}end(){return new i(this.i,this)}rBegin(){return new i(this.i-1,this,1)}rEnd(){return new i(-1,this,1)}front(){if(0!==this.i)return this.A[this.j][this.D]}back(){if(0!==this.i)return this.A[this.R][this.N]}pushBack(e){return this.i&&(this.N<this.F-1?this.N+=1:(this.R<this.P-1?this.R+=1:this.R=0,this.N=0),this.R===this.j&&this.N===this.D&&this.T()),this.i+=1,this.A[this.R][this.N]=e,this.i}popBack(){if(0===this.i)return;let e=this.A[this.R][this.N];return 1!==this.i&&(this.N>0?this.N-=1:(this.R>0?this.R-=1:this.R=this.P-1,this.N=this.F-1)),this.i-=1,e}pushFront(e){return this.i&&(this.D>0?this.D-=1:(this.j>0?this.j-=1:this.j=this.P-1,this.D=this.F-1),this.j===this.R&&this.D===this.N&&this.T()),this.i+=1,this.A[this.j][this.D]=e,this.i}popFront(){if(0===this.i)return;let e=this.A[this.j][this.D];return 1!==this.i&&(this.D<this.F-1?this.D+=1:(this.j<this.P-1?this.j+=1:this.j=0,this.D=0)),this.i-=1,e}getElementByPos(e){if(e<0||e>this.i-1)throw RangeError();let{curNodeBucketIndex:t,curNodePointerIndex:r}=this.O(e);return this.A[t][r]}setElementByPos(e,t){if(e<0||e>this.i-1)throw RangeError();let{curNodeBucketIndex:r,curNodePointerIndex:n}=this.O(e);this.A[r][n]=t}insert(e,t,r=1){if(e<0||e>this.i)throw RangeError();if(0===e)for(;r--;)this.pushFront(t);else if(e===this.i)for(;r--;)this.pushBack(t);else{let n=[];for(let t=e;t<this.i;++t)n.push(this.getElementByPos(t));this.cut(e-1);for(let e=0;e<r;++e)this.pushBack(t);for(let e=0;e<n.length;++e)this.pushBack(n[e])}return this.i}cut(e){if(e<0)return this.clear(),0;let{curNodeBucketIndex:t,curNodePointerIndex:r}=this.O(e);return this.R=t,this.N=r,this.i=e+1,this.i}eraseElementByPos(e){if(e<0||e>this.i-1)throw RangeError();if(0===e)this.popFront();else if(e===this.i-1)this.popBack();else{let t=[];for(let r=e+1;r<this.i;++r)t.push(this.getElementByPos(r));this.cut(e),this.popBack();let r=this;t.forEach(function(e){r.pushBack(e)})}return this.i}eraseElementByValue(e){if(0===this.i)return 0;let t=[];for(let r=0;r<this.i;++r){let n=this.getElementByPos(r);n!==e&&t.push(n)}let r=t.length;for(let e=0;e<r;++e)this.setElementByPos(e,t[e]);return this.cut(r-1)}eraseElementByIterator(e){let t=e.o;return this.eraseElementByPos(t),e=e.next()}find(e){for(let t=0;t<this.i;++t)if(this.getElementByPos(t)===e)return new i(t,this);return this.end()}reverse(){let e=0,t=this.i-1;for(;e<t;){let r=this.getElementByPos(e);this.setElementByPos(e,this.getElementByPos(t)),this.setElementByPos(t,r),e+=1,t-=1}}unique(){if(this.i<=1)return this.i;let e=1,t=this.getElementByPos(0);for(let r=1;r<this.i;++r){let n=this.getElementByPos(r);n!==t&&(t=n,this.setElementByPos(e++,n))}for(;this.i>e;)this.popBack();return this.i}sort(e){let t=[];for(let e=0;e<this.i;++e)t.push(this.getElementByPos(e));
2t.sort(e);for(let e=0;e<this.i;++e)this.setElementByPos(e,t[e])}shrinkToFit(){if(0===this.i)return;let e=[];this.forEach(function(t){e.push(t)}),this.P=Math.max(Math.ceil(this.i/this.F),1),this.i=this.j=this.R=this.D=this.N=0,this.A=[];for(let e=0;e<this.P;++e)this.A.push(Array(this.F));for(let t=0;t<e.length;++t)this.pushBack(e[t])}forEach(e){for(let t=0;t<this.i;++t)e(this.getElementByPos(t),t,this)}[Symbol.iterator](){return(function*(){for(let e=0;e<this.i;++e)yield this.getElementByPos(e)}).bind(this)()}};e.default=o}),rl=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"t",{value:!0}),e.TreeNodeEnableIndex=e.TreeNode=void 0;var t=class{constructor(e,t){this.ee=1,this.u=void 0,this.l=void 0,this.U=void 0,this.W=void 0,this.tt=void 0,this.u=e,this.l=t}L(){let e=this;if(1===e.ee&&e.tt.tt===e)e=e.W;else if(e.U)for(e=e.U;e.W;)e=e.W;else{let t=e.tt;for(;t.U===e;)t=(e=t).tt;e=t}return e}B(){let e=this;if(e.W){for(e=e.W;e.U;)e=e.U;return e}{let t=e.tt;for(;t.W===e;)t=(e=t).tt;return e.W!==t?t:e}}te(){let e=this.tt,t=this.W,r=t.U;return e.tt===this?e.tt=t:e.U===this?e.U=t:e.W=t,t.tt=e,t.U=this,this.tt=t,this.W=r,r&&(r.tt=this),t}se(){let e=this.tt,t=this.U,r=t.W;return e.tt===this?e.tt=t:e.U===this?e.U=t:e.W=t,t.tt=e,t.W=this,this.tt=t,this.U=r,r&&(r.tt=this),t}};e.TreeNode=t;var r=class extends t{constructor(){super(...arguments),this.rt=1}te(){let e=super.te();return this.ie(),e.ie(),e}se(){let e=super.se();return this.ie(),e.ie(),e}ie(){this.rt=1,this.U&&(this.rt+=this.U.rt),this.W&&(this.rt+=this.W.rt)}};e.TreeNodeEnableIndex=r}),ru=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=rl(),r=t9(),n=rn(),i=class extends r.Container{constructor(e=function(e,t){return e<t?-1:e>t?1:0},r=!1){super(),this.Y=void 0,this.v=e,r?(this.re=t.TreeNodeEnableIndex,this.M=function(e,t,r){let n=this.ne(e,t,r);if(n){let e=n.tt;for(;e!==this.h;)e.rt+=1,e=e.tt;let t=this.he(n);if(t){let{parentNode:e,grandParent:r,curNode:n}=t;e.ie(),r.ie(),n.ie()}}return this.i},this.V=function(e){let t=this.fe(e);for(;t!==this.h;)t.rt-=1,t=t.tt}):(this.re=t.TreeNode,this.M=function(e,t,r){let n=this.ne(e,t,r);return n&&this.he(n),this.i},this.V=this.fe),this.h=new this.re}X(e,t){let r=this.h;for(;e;){let n=this.v(e.u,t);if(n<0)e=e.W;else{if(!(n>0))return e;r=e,e=e.U}}return r}Z(e,t){let r=this.h;for(;e;)0>=this.v(e.u,t)?e=e.W:(r=e,e=e.U);return r}$(e,t){let r=this.h;for(;e;){let n=this.v(e.u,t);if(n<0)r=e,e=e.W;else{if(!(n>0))return e;e=e.U}}return r}rr(e,t){let r=this.h;for(;e;)0>this.v(e.u,t)?(r=e,e=e.W):e=e.U;return r}ue(e){for(;;){let t=e.tt;if(t===this.h)return;if(1===e.ee){e.ee=0;return}if(e===t.U){let r=t.W;if(1===r.ee)r.ee=0,t.ee=1,t===this.Y?this.Y=t.te():t.te();else if(r.W&&1===r.W.ee){r.ee=t.ee,t.ee=0,r.W.ee=0,t===this.Y?this.Y=t.te():t.te();return}else r.U&&1===r.U.ee?(r.ee=1,r.U.ee=0,r.se()):(r.ee=1,e=t)}else{let r=t.U;if(1===r.ee)r.ee=0,t.ee=1,t===this.Y?this.Y=t.se():t.se();else if(r.U&&1===r.U.ee){r.ee=t.ee,t.ee=0,r.U.ee=0,t===this.Y?this.Y=t.se():t.se();return}else r.W&&1===r.W.ee?(r.ee=1,r.W.ee=0,r.te()):(r.ee=1,e=t)}}}fe(e){if(1===this.i)return this.clear(),this.h;let t=e;for(;t.U||t.W;){if(t.W)for(t=t.W;t.U;)t=t.U;else t=t.U;[e.u,t.u]=[t.u,e.u],[e.l,t.l]=[t.l,e.l],e=t}this.h.U===t?this.h.U=t.tt:this.h.W===t&&(this.h.W=t.tt),this.ue(t);let r=t.tt;return t===r.U?r.U=void 0:r.W=void 0,this.i-=1,this.Y.ee=0,r}oe(e,t){return void 0!==e&&(!!(this.oe(e.U,t)||t(e))||this.oe(e.W,t))}he(e){for(;;){let t=e.tt;if(0===t.ee)return;let r=t.tt;if(t===r.U){let n=r.W;if(n&&1===n.ee){if(n.ee=t.ee=0,r===this.Y)return;r.ee=1,e=r;continue}if(e===t.W){if(e.ee=0,e.U&&(e.U.tt=t),e.W&&(e.W.tt=r),t.W=e.U,r.U=e.W,e.U=t,e.W=r,r===this.Y)this.Y=e,this.h.tt=e;else{let t=r.tt;t.U===r?t.U=e:t.W=e}return e.tt=r.tt,t.tt=e,r.tt=e,r.ee=1,{parentNode:t,grandParent:r,curNode:e}}t.ee=0,r===this.Y?this.Y=r.se():r.se(),r.ee=1}else{let n=r.U;if(n&&1===n.ee){if(n.ee=t.ee=0,r===this.Y)return;r.ee=1,e=r;continue}if(e===t.U){if(e.ee=0,e.U&&(e.U.tt=r),e.W&&(e.W.tt=t),r.W=e.U,t.U=e.W,e.U=r,e.W=t,r===this.Y)this.Y=e,this.h.tt=e;else{let t=r.tt;t.U===r?t.U=e:t.W=e}return e.tt=r.tt,t.tt=e,r.tt=e,r.ee=1,{parentNode:t,grandParent:r,curNode:e}}t.ee=0,r===this.Y?this.Y=r.te():r.te(),r.ee=1}return}}ne(e,t,r){if(void 0===this.Y){this.i+=1,this.Y=new this.re(e,t),this.Y.ee=0,this.Y.tt=this.h,this.h.tt=this.Y,this.h.U=this.Y,this.h.W=this.Y;return}let n,i=this.h.U,o=this.v(i.u,e);if(0===o){i.l=t;return}if(o>0)i.U=new this.re(e,t),i.U.tt=i,n=i.U,this.h.U=n;else{let i=this.h.W,o=this.v(i.u,e);if(0===o){i.l=t;return}if(o<0)i.W=new this.re(e,t),i.W.tt=i,n=i.W,this.h.W=n;else{if(void 0!==r){let i=r.o;if(i!==this.h){let r=this.v(i.u,e);if(0===r){i.l=t;return}if(r>0){let r=i.L(),o=this.v(r.u,e);if(0===o){r.l=t;return}o<0&&(n=new this.re(e,t),void 0===r.W?(r.W=n,n.tt=r):(i.U=n,n.tt=i))}}}if(void 0===n)for(n=this.Y;;){let r=this.v(n.u,e);if(r>0){if(void 0===n.U){n.U=new this.re(e,t),n.U.tt=n,n=n.U;break}n=n.U}
2else if(r<0){if(void 0===n.W){n.W=new this.re(e,t),n.W.tt=n,n=n.W;break}n=n.W}else{n.l=t;return}}}}return this.i+=1,n}I(e,t){for(;e;){let r=this.v(e.u,t);if(r<0)e=e.W;else{if(!(r>0))return e;e=e.U}}return e||this.h}clear(){this.i=0,this.Y=void 0,this.h.tt=void 0,this.h.U=this.h.W=void 0}updateKeyByIterator(e,t){let r=e.o;if(r===this.h&&(0,n.throwIteratorAccessError)(),1===this.i)return r.u=t,!0;if(r===this.h.U)return this.v(r.B().u,t)>0&&(r.u=t,!0);if(r===this.h.W)return 0>this.v(r.L().u,t)&&(r.u=t,!0);let i=r.L().u;if(this.v(i,t)>=0)return!1;let o=r.B().u;return!(0>=this.v(o,t))&&(r.u=t,!0)}eraseElementByPos(e){if(e<0||e>this.i-1)throw RangeError();let t=0,r=this;return this.oe(this.Y,function(n){return e===t?(r.V(n),!0):(t+=1,!1)}),this.i}eraseElementByKey(e){if(0===this.i)return!1;let t=this.I(this.Y,e);return t!==this.h&&(this.V(t),!0)}eraseElementByIterator(e){let t=e.o;t===this.h&&(0,n.throwIteratorAccessError)();let r=void 0===t.W;return 0===e.iteratorType?r&&e.next():r&&void 0!==t.U||e.next(),this.V(t),e}forEach(e){let t=0;for(let r of this)e(r,t++,this)}getElementByPos(e){if(e<0||e>this.i-1)throw RangeError();let t,r=0;for(let n of this){if(r===e){t=n;break}r+=1}return t}getHeight(){if(0===this.i)return 0;let e=function(t){return t?Math.max(e(t.U),e(t.W))+1:0};return e(this.Y)}};e.default=i}),rc=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=t9(),r=rn(),n=class extends t.ContainerIterator{constructor(e,t,n){super(n),this.o=e,this.h=t,0===this.iteratorType?(this.pre=function(){return this.o===this.h.U&&(0,r.throwIteratorAcce
2ssError)(),this.o=this.o.L(),this},this.next=function(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.B(),this}):(this.pre=function(){return this.o===this.h.W&&(0,r.throwIteratorAccessError)(),this.o=this.o.B(),this},this.next=function(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.L(),this})}get index(){let e=this.o,t=this.h.tt;if(e===this.h)return t?t.rt-1:0;let r=0;for(e.U&&(r+=e.U.rt);e!==t;){let t=e.tt;e===t.W&&(r+=1,t.U&&(r+=t.U.rt)),e=t}return r}};e.default=n}),rh=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=i(ru()),r=i(rc()),n=rn();function i(e){return e&&e.t?e:{default:e}}var o=class e extends r.default{constructor(e,t,r,n){super(e,t,n),this.container=r}get pointer(){return this.o===this.h&&(0,n.throwIteratorAccessError)(),this.o.u}copy(){return new e(this.o,this.h,this.container,this.iteratorType)}},s=class extends t.default{constructor(e=[],t,r){super(t,r);let n=this;e.forEach(function(e){n.insert(e)})}*K(e){void 0!==e&&(yield*this.K(e.U),yield e.u,yield*this.K(e.W))}begin(){return new o(this.h.U||this.h,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this.h.W||this.h,this.h,this,1)}rEnd(){return new o(this.h,this.h,this,1)}front(){return this.h.U?this.h.U.u:void 0}back(){return this.h.W?this.h.W.u:void 0}insert(e,t){return this.M(e,void 0,t)}find(e){return new o(this.I(this.Y,e),this.h,this)}lowerBound(e){return new o(this.X(this.Y,e),this.h,this)}upperBound(e){return new o(this.Z(this.Y,e),this.h,this)}reverseLowerBound(e){return new o(this.$(this.Y,e),this.h,this)}reverseUpperBound(e){return new o(this.rr(this.Y,e),this.h,this)}union(e){let t=this;return e.forEach(function(e){t.insert(e)}),this.i}[Symbol.iterator](){return this.K(this.Y)}};e.default=s}),rf=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=i(ru()),r=i(rc()),n=rn();function i(e){return e&&e.t?e:{default:e}}var o=class e extends r.default{constructor(e,t,r,n){super(e,t,n),this.container=r}
2get pointer(){this.o===this.h&&(0,n.throwIteratorAccessError)();let e=this;return new Proxy([],{get:(t,r)=>"0"===r?e.o.u:"1"===r?e.o.l:void 0,set(t,r,n){if("1"!==r)throw TypeError("props must be 1");return e.o.l=n,!0}})}copy(){return new e(this.o,this.h,this.container,this.iteratorType)}},s=class extends t.default{constructor(e=[],t,r){super(t,r);let n=this;e.forEach(function(e){n.setElement(e[0],e[1])})}*K(e){void 0!==e&&(yield*this.K(e.U),yield[e.u,e.l],yield*this.K(e.W))}begin(){return new o(this.h.U||this.h,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this.h.W||this.h,this.h,this,1)}rEnd(){return new o(this.h,this.h,this,1)}front(){if(0===this.i)return;let e=this.h.U;return[e.u,e.l]}back(){if(0===this.i)return;let e=this.h.W;return[e.u,e.l]}lowerBound(e){return new o(this.X(this.Y,e),this.h,this)}upperBound(e){return new o(this.Z(this.Y,e),this.h,this)}reverseLowerBound(e){return new o(this.$(this.Y,e),this.h,this)}reverseUpperBound(e){return new o(this.rr(this.Y,e),this.h,this)}setElement(e,t,r){return this.M(e,t,r)}find(e){return new o(this.I(this.Y,e),this.h,this)}getElementByKey(e){return this.I(this.Y,e).l}union(e){let t=this;return e.forEach(function(e){t.setElement(e[0],e[1])}),this.i}[Symbol.iterator](){return this.K(this.Y)}};e.default=s}),rp=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"t",{value:!0}),e.default=function(e){let t=typeof e;return"object"===t&&null!==e||"function"===t}}),rd=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"t",{value:!0}),e.HashContainerIterator=e.HashContainer=void 0;var t,r=t9(),n=(t=rp())&&t.t?t:{default:t},i=rn(),o=class extends r.ContainerIterator{constructor(e,t,r){super(r),this.o=e,this.h=t,0===this.iteratorType?(this.pre=function(){return this.o.L===this.h&&(0,i.throwIteratorAcce
2ssError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.L,this})}};e.HashContainerIterator=o;var s=class extends r.Container{constructor(){super(),this.H=[],this.g={},this.HASH_TAG=Symbol("@@HASH_TAG"),Object.setPrototypeOf(this.g,null),this.h={},this.h.L=this.h.B=this.p=this._=this.h}V(e){let{L:t,B:r}=e;t.B=r,r.L=t,e===this.p&&(this.p=r),e===this._&&(this._=t),this.i-=1}M(e,t,r){let i;if(void 0===r&&(r=(0,n.default)(e)),r){let r=e[this.HASH_TAG];if(void 0!==r)return this.H[r].l=t,this.i;Object.defineProperty(e,this.HASH_TAG,{value:this.H.length,configurable:!0}),i={u:e,l:t,L:this._,B:this.h},this.H.push(i)}else{let r=this.g[e];if(r)return r.l=t,this.i;i={u:e,l:t,L:this._,B:this.h},this.g[e]=i}return 0===this.i?(this.p=i,this.h.B=i):this._.B=i,this._=i,this.h.L=i,++this.i}I(e,t){if(void 0===t&&(t=(0,n.default)(e)),!t)return this.g[e]||this.h;{let t=e[this.HASH_TAG];return void 0===t?this.h:this.H[t]}}clear(){let e=this.HASH_TAG;this.H.forEach(function(t){delete t.u[e]}),this.H=[],this.g={},Object.setPrototypeOf(this.g,null),this.i=0,this.p=this._=this.h.L=this.h.B=this.h}eraseElementByKey(e,t){let r;if(void 0===t&&(t=(0,n.default)(e)),t){let t=e[this.HASH_TAG];if(void 0===t)return!1;delete e[this.HASH_TAG],r=this.H[t],delete this.H[t]}else{if(void 0===(r=this.g[e]))return!1;delete this.g[e]}return this.V(r),!0}eraseElementByIterator(e){let t=e.o;
2return t===this.h&&(0,i.throwIteratorAccessError)(),this.V(t),e.next()}eraseElementByPos(e){if(e<0||e>this.i-1)throw RangeError();let t=this.p;for(;e--;)t=t.B;return this.V(t),this.i}};e.HashContainer=s}),ry=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=rd(),r=rn(),n=class e extends t.HashContainerIterator{constructor(e,t,r,n){super(e,t,n),this.container=r}get pointer(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o.u}copy(){return new e(this.o,this.h,this.container,this.iteratorType)}},i=class extends t.HashContainer{constructor(e=[]){super();let t=this;e.forEach(function(e){t.insert(e)})}begin(){return new n(this.p,this.h,this)}end(){return new n(this.h,this.h,this)}rBegin(){return new n(this._,this.h,this,1)}rEnd(){return new n(this.h,this.h,this,1)}front(){return this.p.u}back(){return this._.u}insert(e,t){return this.M(e,void 0,t)}getElementByPos(e){if(e<0||e>this.i-1)throw RangeError();let t=this.p;for(;e--;)t=t.B;return t.u}find(e,t){return new n(this.I(e,t),this.h,this)}forEach(e){let t=0,r=this.p;for(;r!==this.h;)e(r.u,t++,this),r=r.B}[Symbol.iterator](){return(function*(){let e=this.p;for(;e!==this.h;)yield e.u,e=e.B}).bind(this)()}};e.default=i}),rg=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t,r=rd(),n=(t=rp())&&t.t?t:{default:t},i=rn(),o=class e extends r.HashContainerIterator{constructor(e,t,r,n){super(e,t,n),this.container=r}
2get pointer(){this.o===this.h&&(0,i.throwIteratorAccessError)();let e=this;return new Proxy([],{get:(t,r)=>"0"===r?e.o.u:"1"===r?e.o.l:void 0,set(t,r,n){if("1"!==r)throw TypeError("props must be 1");return e.o.l=n,!0}})}copy(){return new e(this.o,this.h,this.container,this.iteratorType)}},s=class extends r.HashContainer{constructor(e=[]){super();let t=this;e.forEach(function(e){t.setElement(e[0],e[1])})}begin(){return new o(this.p,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this._,this.h,this,1)}rEnd(){return new o(this.h,this.h,this,1)}front(){if(0!==this.i)return[this.p.u,this.p.l]}back(){if(0!==this.i)return[this._.u,this._.l]}setElement(e,t,r){return this.M(e,t,r)}getElementByKey(e,t){if(void 0===t&&(t=(0,n.default)(e)),t){let t=e[this.HASH_TAG];return void 0!==t?this.H[t].l:void 0}let r=this.g[e];return r?r.l:void 0}getElementByPos(e){if(e<0||e>this.i-1)throw RangeError();let t=this.p;for(;e--;)t=t.B;return[t.u,t.l]}find(e,t){return new o(this.I(e,t),this.h,this)}forEach(e){let t=0,r=this.p;for(;r!==this.h;)e([r.u,r.l],t++,this),r=r.B}[Symbol.iterator](){return(function*(){let e=this.p;for(;e!==this.h;)yield[e.u,e.l],e=e.B}).bind(this)()}};e.default=s}),rb=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"t",{value:!0}),Object.defineProperty(e,"Deque",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"HashMap",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"HashSet",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"LinkList",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"OrderedMap",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"OrderedSet",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"PriorityQueue",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"Queue",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"Stack",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"Vector",{enumerable:!0,get:function(){return i.default}});var t=h(t7()),r=h(re()),n=h(rt()),i=h(ro()),o=h(rs()),s=h(ra()),a=h(rh()),l=h(rf()),u=h(ry()),c=h(rg());function h(e){return e&&e.t?e:{default:e}}}),rm=l((e,t)=>{f(),e6(),eY();var r=rb().OrderedSet,n=tV()("number-allocator:trace"),i=tV()("number-allocator:error");function o(e,t){this.low=e,this.high=t}function s(e,t){if(!(this instanceof s))return new s(e,t);this.min=e,this.max=t,this.ss=new r([],(e,t)=>e.compare(t)),n("Create"),this.clear()}o.prototype.equals=function(e){return this.low===e.low&&this.high===e.high},o.prototype.compare=function(e){return this.low<e.low&&this.high<e.low?-1:e.low<this.low&&e.high<this.low?1:0},s.prototype.firstVacant=function(){return 0===this.ss.size()?null:this.ss.front().low},s.prototype.alloc=function(){if(0===this.ss.size())return n("alloc():empty"),null;let e=this.ss.begin(),t=e.pointer.low,r=e.pointer.high;return t+1<=r?this.ss.updateKeyByIterator(e,new o(t+1,r)):this.ss.eraseElementByPos(0),n("alloc():"+t),t},s.prototype.use=function(e){let t=new o(e,e),r=this.ss.lowerBound(t);if(!r.equals(this.ss.end())){let i=r.pointer.low,s=r.pointer.high;return r.pointer.equals(t)?(this.ss.eraseElementByIterator(r),n("use():"+e),!0):!(i>e)&&(i===e?this.ss.updateKeyByIterator(r,new o(i+1,s)):s===e?this.ss.updateKeyByIterator(r,new o(i,s-1)):(this.ss.updateKeyByIterator(r,new o(e+1,s)),this.ss.insert(new o(i,e-1))),n("use():"+e),!0)}return n("use():failed"),!1},s.prototype.free=function(e){if(e<this.min||e>this.max){i("free():"+e+" is out of range");return}let t=new o(e,e),r=this.ss.upperBound(t);if(r.equals(this.ss.end())){if(r.equals(this.ss.begin())){this.ss.insert(t);return}r.pre();let n=r.pointer.high;r.pointer.high+1===e?this.ss.updateKeyByIterator(r,new o(n,e)):this.ss.insert(t)}else if(r.equals(this.ss.begin())){if(e+1===r.pointer.low){let t=r.pointer.high;this.ss.updateKeyByIterator(r,new o(e,t))}else this.ss.insert(t)}else{let n=r.pointer.low,i=r.pointer.high;r.pre();let s=r.pointer.low;r.pointer.high+1===e?e+1===n?(this.ss.eraseElementByIterator(r),this.ss.updateKeyByIterator(r,new o(s,i))):this.ss.updateKeyByIterator(r,new o(s,e)):e+1===n?(this.ss.eraseElementByIterator(r.next()),this.ss.insert(new o(e,i))):this.ss.insert(t)}
2n("free():"+e)},s.prototype.clear=function(){n("clear()"),this.ss.clear(),this.ss.insert(new o(this.min,this.max))},s.prototype.intervalCount=function(){return this.ss.size()},s.prototype.dump=function(){for(let e of(console.log("length:"+this.ss.size()),this.ss))console.log(e)},t.exports=s}),r_=l((e,t)=>{f(),e6(),eY();var r=rm();t.exports.NumberAllocator=r}),rv=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"__esModule",{value:!0});var t=t8(),r=r_(),n=class{aliasToTopic;topicToAlias;max;numberAllocator;length;constructor(e){e>0&&(this.aliasToTopic=new t.LRUCache({max:e}),this.topicToAlias={},this.numberAllocator=new r.NumberAllocator(1,e),this.max=e,this.length=0)}put(e,t){if(0===t||t>this.max)return!1;let r=this.aliasToTopic.get(t);return r&&delete this.topicToAlias[r],this.aliasToTopic.set(t,e),this.topicToAlias[e]=t,this.numberAllocator.use(t),this.length=this.aliasToTopic.size,!0}getTopicByAlias(e){return this.aliasToTopic.get(e)}getAliasByTopic(e){let t=this.topicToAlias[e];return"u">typeof t&&this.aliasToTopic.get(t),t}clear(){this.aliasToTopic.clear(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0}getLruAlias(){return this.numberAllocator.firstVacant()||[...this.aliasToTopic.keys()][this.aliasToTopic.size-1]}};e.default=n}),rw=l(e=>{f(),e6(),eY();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=t5(),n=t(rv()),i=t6();e.default=(e,t)=>{e.log("_handleConnack");let{options:o}=e,s=5===o.protocolVersion?t.reasonCode:t.returnCode;if(clearTimeout(e.connackTimer),delete e.topicAliasSend,t.properties){if(t.properties.topicAliasMaximum){if(t.properties.topicAliasMaximum>65535){e.emit("error",Error("topicAliasMaximum from broker is out of range"));return}t.properties.topicAliasMaximum>0&&(e.topicAliasSend=new n.default(t.properties.topicAliasMaximum))}t.properties.serverKeepAlive&&o.keepalive&&(o.keepalive=t.properties.serverKeepAlive),t.properties.maximumPacketSize&&(o.properties||(o.properties={}),o.properties.maximumPacketSize=t.properties.maximumPacketSize)}if(0===s)e.reconnecting=!1,e._onConnect(t);else if(s>0){let t=new i.ErrorWithReasonCode(`Connection refused: ${r.ReasonCodes[s]}`,s);e.emit("error",t),e.options.reconnectOnConnackError&&e._cleanUp(!0)}}}),rS=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=(e,t,r)=>{e.log("handling pubrel packet");let n="u">typeof r?r:e.noop,{messageId:i}=t,o={cmd:"pubcomp",messageId:i};e.incomingStore.get(t,(t,r)=>{t?e._sendPacket(o,n):(e.emit("message",r.topic,r.payload,r),e.handleMessage(r,t=>{if(t)return n(t);e.incomingStore.del(r,e.noop),e._sendPacket(o,n)}))})}}),rE=l(e=>{f(),e6(),eY();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=t(t2()),n=t(t4()),i=t(rw()),o=t(t5()),s=t(rS());e.default=(e,t,a)=>{let{options:l}=e;if(5===l.protocolVersion&&l.properties&&l.properties.maximumPacketSize&&l.properties.maximumPacketSize<t.length)return e.emit("error",Error(`exceeding packets size ${t.cmd}`)),e.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),e;switch(e.log("_handlePacket :: emitting packetreceive"),e.emit("packetreceive",t),t.cmd){case"publish":(0,r.default)(e,t,a);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":e.reschedulePing(),(0,o.default)(e,t),a();break;case"pubrel":e.reschedulePing(),(0,s.default)(e,t,a);break;case"connack":(0,i.default)(e,t),a();break;case"auth":e.reschedulePing(),(0,n.default)(e,t),a();break;case"pingresp":e.log("_handlePacket :: received pingresp"),e.reschedulePing(!0),a();break;case"disconnect":e.emit("disconnect",t),a();break;default:e.log("_handlePacket :: unknown command"),a()}}}),rA=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=class{nextId;constructor(){this.nextId=Math.max(1,Math.floor(65535*Math.random()))}allocate(){let e=this.nextId++;return 65536===this.nextId&&(this.nextId=1),e}getLastAllocated(){return 1===this.nextId?65535:this.nextId-1}register(e){return!0}deallocate(e){}clear(){}}}),rI=l(e=>
2{f(),e6(),eY(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=class{aliasToTopic;max;length;constructor(e){this.aliasToTopic={},this.max=e}put(e,t){return 0!==t&&!(t>this.max)&&(this.aliasToTopic[t]=e,this.length=Object.keys(this.aliasToTopic).length,!0)}getTopicByAlias(e){return this.aliasToTopic[e]}clear(){this.aliasToTopic={}}}}),rk=l(e=>{f(),e6(),eY();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.TypedEventEmitter=void 0;var r=t((tf(),h(e7))),n=t6(),i=class{};e.TypedEventEmitter=i,(0,n.applyMixin)(i,r.default)}),rO=l((e,t)=>{var n,i;f(),e6(),eY(),n=e,i=function(e){var t,r=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,n=new WeakMap,i=(t=function(e,t){return n.set(e,t),t},function(e){var i=n.get(e),o=void 0===i?e.size:i<1073741824?i+1:0;if(!e.has(o))return t(e,o);if(e.size<536870912){for(;e.has(o);)o=Math.floor(1073741824*Math.random());return t(e,o)}if(e.size>r)throw Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;e.has(o);)o=Math.floor(Math.random()*r);return t(e,o)});e.addUniqueNumber=function(e){var t=i(e);return e.add(t),t},e.generateUniqueNumber=i},"object"==typeof e&&"u">typeof t?i(e):"function"==typeof define&&r.amdO?define(["exports"],i):i((n="u">typeof globalThis?globalThis:n||self).fastUniqueNumbers={})}),rx=l((e,t)=>{function r(e){return t.exports=r="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},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}f(),e6(),eY(),t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),rP=l((e,t)=>{f(),e6(),eY();var r=rx().default;t.exports=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=r(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},t.exports.__esModule=!0,t.exports.default=t.exports}),rT=l((e,t)=>{f(),e6(),eY();var r=rx().default,n=rP();t.exports=function(e){var t=n(e,"string");return"symbol"==r(t)?t:t+""},t.exports.__esModule=!0,t.exports.default=t.exports}),rR=l((e,t)=>{f(),e6(),eY();var r=rT();t.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},t.exports.__esModule=!0,t.exports.default=t.exports}),rC=l((e,t)=>{f(),e6(),eY(),t.exports=function(e){if(Array.isArray(e))return e},t.exports.__esModule=!0,t.exports.default=t.exports}),rj=l((e,t)=>{f(),e6(),eY(),t.exports=function(e,t){var r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,s,a=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}},t.exports.__esModule=!0,t.exports.default=t.exports}),rM=l((e,t)=>{f(),e6(),eY(),t.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},t.exports.__esModule=!0,t.exports.default=t.exports}),rB=l((e,t)=>{f(),e6(),eY();var r=rM();t.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=({}).toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},t.exports.__esModule=!0,t.exports.default=t.exports}),rN=l((e,t)=>{f(),e6(),eY(),t.exports=function(){throw TypeError(`Invalid attempt to destructure non-iterable instance. 3In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)},t.exports.__esModule=!0,t.exports.default=t.exports}),rU=l((e,t)=>{f(),e6(),eY();var r=rC(),n=rj(),i=rB(),o=rN();t.exports=function(e,t){return r(e)||n(e,t)||i(e,t)||o()}
3,t.exports.__esModule=!0,t.exports.default=t.exports}),rL=l((e,t)=>{function r(e,t,r,n,i,o,s){try{var a=e[o](s),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(n,i)}f(),e6(),eY(),t.exports=function(e){return function(){var t=this,n=arguments;return new Promise(function(i,o){var s=e.apply(t,n);function a(e){r(s,i,o,a,l,"next",e)}function l(e){r(s,i,o,a,l,"throw",e)}a(void 0)})}},t.exports.__esModule=!0,t.exports.default=t.exports}),rD=l((e,t)=>{f(),e6(),eY(),t.exports=function(e,t){this.v=e,this.k=t},t.exports.__esModule=!0,t.exports.default=t.exports}),rF=l((e,t)=>{function r(e,n,i,o){var s=Object.defineProperty;try{s({},"",{})}catch{s=0}t.exports=r=function(e,t,n,i){function o(t,n){r(e,t,function(e){return this._invoke(t,n,e)})}t?s?s(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},t.exports.__esModule=!0,t.exports.default=t.exports,r(e,n,i,o)}f(),e6(),eY(),t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),rW=l((e,t)=>{f(),e6(),eY();var r=rF();function n(){var e,i,o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.toStringTag||"@@toStringTag";function l(t,n,o,s){var a=Object.create((n&&n.prototype instanceof c?n:c).prototype);return r(a,"_invoke",function(t,r,n){var o,s,a,l=0,c=n||[],h=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,r){return o=t,s=0,a=e,f.n=r,u}};function p(t,r){for(s=t,a=r,i=0;!h&&l&&!n&&i<c.length;i++){var n,o=c[i],p=f.p,d=o[2];t>3?(n=d===r)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=p&&((n=t<2&&p<o[1])?(s=0,f.v=r,f.n=o[1]):p<d&&(n=t<3||o[0]>r||r>d)&&(o[4]=t,o[5]=r,f.n=d,s=0))}if(n||t>1)return u;throw h=!0,r}return function(n,c,d){if(l>1)throw TypeError("Generator is already running");for(h&&1===c&&p(c,d),s=c,a=d;(i=s<2?e:a)||!h;){o||(s?s<3?(s>1&&(f.n=-1),p(s,a)):f.n=a:f.v=a);try{if(l=2,o){if(s||(n="next"),i=o[n]){if(!(i=i.call(o,a)))throw TypeError("iterator result is not an object");if(!i.done)return i;a=i.value,s<2&&(s=0)}else 1===s&&(i=o.return)&&i.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+n+"' method"),s=1);o=e}else if((i=(h=f.n<0)?a:t.call(r,f))!==u)break}catch(t){o=e,s=1,a=t}finally{l=1}}return{value:i,done:h}}}(t,o,s),!0),a}var u={};function c(){}function h(){}function f(){}i=Object.getPrototypeOf;
3var p=[][s]?i(i([][s]())):(r(i={},s,function(){return this}),i),d=f.prototype=c.prototype=Object.create(p);function y(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,r(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return h.prototype=f,r(d,"constructor",f),r(f,"constructor",h),h.displayName="GeneratorFunction",r(f,a,"GeneratorFunction"),r(d),r(d,a,"Generator"),r(d,s,function(){return this}),r(d,"toString",function(){return"[object Generator]"}),(t.exports=n=function(){return{w:l,m:y}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}),rq=l((e,t)=>{f(),e6(),eY();var r=rD(),n=rF();t.exports=function e(t,i){var o;this.next||(n(e.prototype),n(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),n(this,"_invoke",function(e,n,s){function a(){return new i(function(n,o){(function e(n,o,s,a){try{var l=t[n](o),u=l.value;return u instanceof r?i.resolve(u.v).then(function(t){e("next",t,s,a)},function(t){e("throw",t,s,a)}):i.resolve(u).then(function(e){l.value=e,s(l)},function(t){return e("throw",t,s,a)})}catch(e){a(e)}})(e,s,n,o)})}return o=o?o.then(a,a):a()},!0)},t.exports.__esModule=!0,t.exports.default=t.exports}),r$=l((e,t)=>{f(),e6(),eY();var r=rW(),n=rq();t.exports=function(e,t,i,o,s){return new n(r().w(e,t,i,o),s||Promise)},t.exports.__esModule=!0,t.exports.default=t.exports}),rH=l((e,t)=>{f(),e6(),eY();var r=r$();t.exports=function(e,t,n,i,o){var s=r(e,t,n,i,o);return s.next().then(function(e){return e.done?e.value:s.next()})},t.exports.__esModule=!0,t.exports.default=t.exports}),rV=l((e,t)=>{f(),e6(),eY(),t.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}},t.exports.__esModule=!0,t.exports.default=t.exports}),rz=l((e,t)=>{f(),e6(),eY();var r=rx().default;t.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw TypeError(r(e)+" is not iterable")},t.exports.__esModule=!0,t.exports.default=t.exports}),rK=l((e,t)=>{f(),e6(),eY();var r=rD(),n=rW(),i=rH(),o=r$(),s=rq(),a=rV(),l=rz();function u(){var e=n(),c=e.m(u),h=(Object.getPrototypeOf?Object.getPrototypeOf(c):c.__proto__).constructor;function f(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))}var p={throw:1,return:2,break:3,continue:3};function d(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,p[e],t)},delegateYield:function(e,i,o){return t.resultName=i,r(n.d,l(e),o)},finish:function(e){return r(n.f,e)}},r=function(e,r,i){n.p=t.prev,n.n=t.next;try{return e(r,i)}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(t.exports=u=function(){return{wrap:function(t,r,n,i){return e.w(d(t),r,n,i&&i.reverse())},isGeneratorFunction:f,mark:e.m,awrap:function(e,t){return new r(e,t)},AsyncIterator:s,async:function(e,t,r,n,s){return(f(t)?o:i)(d(e),t,r,n,s)},keys:a,values:l}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=u,t.exports.__esModule=!0,t.exports.default=t.exports}),rG=l((e,t)=>{f(),e6(),eY();var r=rK()();t.exports=r;try{regeneratorRuntime=r}catch{"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}),rQ=l((e,t)=>
3{var n,i;f(),e6(),eY(),n=e,i=function(e,t,r,n,i,o){function s(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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function l(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 u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var c,h,f,p,d,y,g=(c=new WeakMap,f=function(e){if(c.has(e))return c.get(e);var t=new Map;return c.set(e,t),t},h=new WeakMap,p=function(e){return u(u({},e),{},{connect:function(e){var t=e.call;return i(o.mark(function e(){var r,n,i,s;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=(r=new MessageChannel).port1,i=r.port2,e.next=1,t("connect",{port:n},[n]);case 1:return s=e.sent,h.set(i,s),e.abrupt("return",i);case 2:case"end":return e.stop()}},e)}))},disconnect:function(e){var t,r=e.call;return t=i(o.mark(function e(t){var n;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==(n=h.get(t))){e.next=1;break}throw Error("The given port is not connected.");case 1:return e.next=2,r("disconnect",{portId:n});case 2:case"end":return e.stop()}},e)})),function(e){return t.apply(this,arguments)}},isSupported:function(e){var t=e.call;return function(){return t("isSupported")}}})},d=t.generateUniqueNumber,y=function(e){return"function"==typeof e.start},function(e){var t=p(e);return function(e){var i=f(e);e.addEventListener("message",function(e){var t=e.data,r=t.id;if(null!==r&&i.has(r)){var n=i.get(r),o=n.reject,s=n.resolve;i.delete(r),void 0===t.error?s(t.result):o(Error(t.error.message))}}),y(e)&&e.start();for(var o=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return new Promise(function(o,s){var a=d(i);i.set(a,{reject:s,resolve:o}),null===r?e.postMessage({id:a,method:t},n):e.postMessage({id:a,method:t,params:r},n)})},s=function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];e.postMessage({id:null,method:t,params:r},n)},l={},u=0,c=Object.entries(t);u<c.length;u++){var h=n(c[u],2),p=h[0],g=h[1];l=a(a({},l),{},r({},p,g({call:o,notify:s})))}return a({},l)}});e.createBroker=g},"object"==typeof e&&"u">typeof t?i(e,rO(),rR(),rU(),rL(),rG()):"function"==typeof define&&r.amdO?define(["exports","fast-unique-numbers","@babel/runtime/helpers/defineProperty","@babel/runtime/helpers/slicedToArray","@babel/runtime/helpers/asyncToGenerator","@babel/runtime/regenerator"],i):i((n="u">typeof globalThis?globalThis:n||self).brokerFactory={},n.fastUniqueNumbers,n._defineProperty,n._slicedToArray,n._asyncToGenerator,n._regeneratorRuntime)}),rY=l((e,t)=>{var n,i;f(),e6(),eY(),n=e,i=function(e,t,r,n){var i,o,s=new Map([[0,null]]),a=new Map([[0,null]]),l=(i=r.generateUniqueNumber,function(e){return function(t){for(var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length,o=Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];var l=Symbol(),u=i(s);s.set(u,l);var c=function(){return e(r,u).then(function(){var e=s.get(u);if(void 0===e)throw Error("The timer is in an undefined state.");e===l&&(t.apply(void 0,o),s.get(u)===l&&c())})};return c(),u}}),u=(o=r.generateUniqueNumber,function(e){return function(t){for(var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length,i=Array(n>2?n-2:0),s=2;s<n;s++)i[s-2]=arguments[s];var l=Symbol(),u=o(a);return a.set(u,l),e(r,u).then(function(){var e=a.get(u);if(void 0===e)throw Error("The timer is in an undefined state.");e===l&&(a.delete(u),t.apply(void 0,i))}),u}}),c=t.createBroker({clearInterval:function(e){var t,r=e.call;return t=function(e){return r("clear",{timerId:e,timerType:"interval"})},function(e){"symbol"===n(s.get(e))&&(s.set(e,null),t(e).then(function(){s.delete(e)}))}},clearTimeout:function(e){var t,r=e.call;return t=function(e){return r("clear",{timerId:e,timerType:"timeout"})},function(e){"symbol"===n(a.get(e))&&(a.set(e,null),t(e).then(function(){a.delete(e)}))}},setInterval:function(e){var t=e.call;return l(function(e,r){return t("set",{delay:e,now:performance.timeOrigin+performance.now(),timerId:r,timerType:"interval"})})},setTimeout:function(e){var t=e.call;return u(function(e,r){return t("set",{delay:e,now:performance.timeOrigin+performance.now(),timerId:r,timerType:"timeout"})})}});e.load=function(e){return c(new Worker(e))}
3,e.wrap=c},"object"==typeof e&&"u">typeof t?i(e,rQ(),rO(),rx()):"function"==typeof define&&r.amdO?define(["exports","broker-factory","fast-unique-numbers","@babel/runtime/helpers/typeof"],i):i((n="u">typeof globalThis?globalThis:n||self).workerTimersBroker={},n.brokerFactory,n.fastUniqueNumbers,n._typeof)}),rJ=l((e,t)=>{var n,i;f(),e6(),eY(),n=e,i=function(e,t){var r,n,i=`(()=>{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}
vendor: 5,314 bytes, line 3
3finally{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);
3if("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)})()})();`,o=(r=t.load,n=null,function(){if(null!==n)return n;var e=new Blob([i],{type:"application/javascript; charset=utf-8"}),t=URL.createObjectURL(e);return n=r(t),setTimeout(function(){return URL.revokeObjectURL(t)}),n});e.clearInterval=function(e){return o().clearInterval(e)},e.clearTimeout=function(e){return o().clearTimeout(e)},e.setInterval=function(){var e;return(e=o()).setInterval.apply(e,arguments)},e.setTimeout=function(){var e;return(e=o()).setTimeout.apply(e,arguments)}},"object"==typeof e&&"u">typeof t?i(e,rY()):"function"==typeof define&&r.amdO?define(["exports","worker-timers-broker"],i):i((n="u">typeof globalThis?globalThis:n||self).workerTimers={},n.workerTimersBroker)}),rX=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"__esModule",{value:!0}),e.isReactNativeBrowser=e.isWebWorker=void 0;var t=()=>!!("object"==typeof self&&self?.constructor?.name?.includes("WorkerGlobalScope")&&typeof Deno>"u"),r="u">typeof window&&("u">typeof navigator&&navigator.userAgent?.toLowerCase().indexOf(" electron/")>-1&&p?.versions?!Object.prototype.hasOwnProperty.call(p.versions,"electron"):"u">typeof window.document)||t()||"u">typeof navigator&&"ReactNative"===navigator.product;e.isWebWorker=t(),e.isReactNativeBrowser="u">typeof navigator&&"ReactNative"===navigator.product,e.default=r}),rZ=l(e=>{f(),e6(),eY();var t,r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=e&&e.__importStar||(t=function(e){return(t=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t})(e)}
3,function(e){if(e&&e.__esModule)return e;var i={};if(null!=e)for(var o=t(e),s=0;s<o.length;s++)"default"!==o[s]&&r(i,e,o[s]);return n(i,e),i});Object.defineProperty(e,"__esModule",{value:!0});var o=rJ(),s=i(rX()),a={set:o.setInterval,clear:o.clearInterval},l={set:(e,t)=>setInterval(e,t),clear:e=>clearInterval(e)};e.default=e=>{switch(e){case"native":return l;case"worker":return a;default:return!s.default||s.isWebWorker||s.isReactNativeBrowser?l:a}}}),r0=l(e=>{f(),e6(),eY();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=t(rZ()),n=class{_keepalive;timerId;timer;destroyed=!1;counter;client;_keepaliveTimeoutTimestamp;_intervalEvery;get keepaliveTimeoutTimestamp(){return this._keepaliveTimeoutTimestamp}get intervalEvery(){return this._intervalEvery}get keepalive(){return this._keepalive}constructor(e,t){this.client=e,this.timer="object"==typeof t&&"set"in t&&"clear"in t?t:(0,r.default)(t),this.setKeepalive(e.options.keepalive)}clear(){this.timerId&&(this.timer.clear(this.timerId),this.timerId=null)}setKeepalive(e){if(isNaN(e*=1e3)||e<=0||e>2147483647)throw 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(1.5*this._keepalive);this._keepaliveTimeoutTimestamp=Date.now()+e,this._intervalEvery=Math.ceil(this._keepalive/2),this.timerId=this.timer.set(()=>{this.destroyed||(this.counter+=1,2===this.counter?this.client.sendPing():this.counter>2&&this.client.onKeepaliveTimeout())},this._intervalEvery)}};e.default=n}),r1=l(e=>{f(),e6(),eY();var t,r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=e&&e.__importStar||(t=function(e){return(t=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t})(e)},function(e){if(e&&e.__esModule)return e;var i={};if(null!=e)for(var o=t(e),s=0;s<o.length;s++)"default"!==o[s]&&r(i,e,o[s]);return n(i,e),i}),o=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var s=o(tJ()),a=tU(),l=o(tZ()),u=o(tV()),c=i(t0()),h=o(t1()),p=o(rE()),d=o(rA()),y=o(rI()),g=t6(),b=rk(),m=o(r0()),_=i(rX()),v=globalThis.setImmediate||((...e)=>{let t=e.shift();(0,g.nextTick)(()=>{t(...e)})}),w={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:3e4,clean:!0,resubscribe:!0,subscribeBatchSize:null,writeCache:!0,timerVariant:"auto"},S=class e extends b.TypedEventEmitter{static VERSION=g.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;_deferredReconnect;connackPacket;static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}constructor(t,r){for(let e in super(),this.options=r||{},w)typeof this.options[e]>"u"?this.options[e]=w[e]:this.options[e]=r[e];this.log=this.options.log||(0,u.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: version:",e.VERSION),_.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",_.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="string"==typeof r.clientId?r.clientId:e.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=5===r.protocolVersion&&r.customHandleAcks?r.customHandleAcks:(...e)=>{e[3](null,0)},this.options.writeCache||(s.default.writeToStream.cacheNumbers=!1),this.streamBuilder=t,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new d.default:this.options.messageIdProvider,this.outgoingStore=r.outgoingStore||new h.default,this.incomingStore=r.
3incomingStore||new h.default,this.queueQoSZero=void 0===r.queueQoSZero||r.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.keepaliveManager=null,this.connected=!1,this.disconnecting=!1,this.reconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,r.properties&&r.properties.topicAliasMaximum>0&&(r.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new y.default(r.properties.topicAliasMaximum)),this.on("connect",()=>{let{queue:e}=this,t=()=>{let r=e.shift();this.log("deliver :: entry %o",r);let n=null;if(!r){this._resubscribe();return}n=r.packet,this.log("deliver :: call _sendPacket for %o",n);let i=!0;n.messageId&&0!==n.messageId&&(this.messageIdProvider.register(n.messageId)||(i=!1)),i?this._sendPacket(n,e=>{r.cb&&r.cb(e),t()}):(this.log("messageId: %d has already used. The message is skipped and removed.",n.messageId),t())};this.log("connect :: sending queued packets"),t()}),this.on("close",()=>{this.log("close :: connected set to `false`"),this.connected=!1,this.log("close :: clearing connackTimer"),clearTimeout(this.connackTimer),this._destroyKeepaliveManager(),this.topicAliasRecv&&this.topicAliasRecv.clear(),this.log("close :: calling _setupReconnect"),this._setupReconnect()}),this.options.manualConnect||(this.log("MqttClient :: setting up stream"),this.connect())}handleAuth(e,t){t()}handleMessage(e,t){t()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}connect(){let e=new a.Writable,t=s.default.parser(this.options),r=null,n=[];this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this.disconnected&&!this.reconnecting&&(this.incomingStore=this.options.incomingStore||new h.default,this.outgoingStore=this.options.outgoingStore||new h.default,this.disconnecting=!1,this.disconnected=!1),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),t.on("packet",e=>{this.log("parser :: on packet push to packets array."),n.push(e)});let i=()=>{this.log("work :: getting next packet in queue");let e=n.shift();if(e)this.log("work :: packet pulled from queue"),(0,p.default)(this,e,o);else{this.log("work :: no packets in queue");let e=r;r=null,this.log("work :: done flag is %s",!!e),e&&e()}},o=()=>{if(n.length)(0,g.nextTick)(i);else{let e=r;r=null,e()}};e._write=(e,n,o)=>{r=o,this.log("writable stream :: parsing buffer"),t.parse(e),i()},this.log("connect :: pipe stream to writable stream"),this.stream.pipe(e),this.stream.on("error",e=>{this.log("streamErrorHandler :: error",e.message),e.code?(this.log("streamErrorHandler :: emitting error"),this.emit("error",e)):this.noop(e)}),this.stream.on("close",()=>{this.log("(%s)stream :: on close",this.options.clientId),this._flushVolatile(),this.log("stream: emit close to MqttClient"),this.emit("close")}),this.log("connect: sending packet `connect`");let l={cmd:"connect",protocolId:this.options.protocolId,protocolVersion:this.options.protocolVersion,clean:this.options.clean,clientId:this.options.clientId,keepalive:this.options.keepalive,username:this.options.username,password:this.options.password,properties:this.options.properties};if(this.options.will&&(l.will={...this.options.will,payload:this.options.will?.payload}),this.topicAliasRecv&&(l.properties||(l.properties={}),this.topicAliasRecv&&(l.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket(l),t.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return this.end(()=>
3this.emit("error",Error("Packet has no Authentication Method"))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&"object"==typeof this.options.authPacket){let e={cmd:"auth",reasonCode:0,...this.options.authPacket};this._writePacket(e)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(()=>{this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this.emit("error",Error("connack timeout")),this._cleanUp(!0)},this.options.connectTimeout),this}publish(e,t,r,n){this.log("publish :: message `%s` to topic `%s`",t,e);let{options:i}=this;"function"==typeof r&&(n=r,r=null);let{qos:o,retain:s,dup:a,properties:l,cbStorePut:u}=r={qos:0,retain:!1,dup:!1,...r=r||{}};if(this._checkDisconnecting(n))return this;let c=()=>{let r=0;if((1===o||2===o)&&null===(r=this._nextId()))return this.log("No messageId left"),!1;let c={cmd:"publish",topic:e,payload:t,qos:o,retain:s,messageId:r,dup:a};switch(5===i.protocolVersion&&(c.properties=l),this.log("publish :: qos",o),o){case 1:case 2:this.outgoing[c.messageId]={volatile:!1,cb:n||this.noop},this.log("MqttClient:publish: packet cmd: %s",c.cmd),this._sendPacket(c,void 0,u);break;default:this.log("MqttClient:publish: packet cmd: %s",c.cmd),this._sendPacket(c,n,u)}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!c())&&this._storeProcessingQueue.push({invoke:c,cbStorePut:r.cbStorePut,callback:n}),this}publishAsync(e,t,r){return new Promise((n,i)=>{this.publish(e,t,r,(e,t)=>{e?i(e):n(t)})})}subscribe(e,t,r){let n=this.options.protocolVersion;"function"==typeof t&&(r=t),r=r||this.noop;let i=!1,o=[];"string"==typeof e?o=e=[e]:Array.isArray(e)?o=e:"object"==typeof e&&(i=e.resubscribe,delete e.resubscribe,o=Object.keys(e));let s=c.validateTopics(o);if(null!==s)return v(r,Error(`Invalid topic ${s}`)),this;if(this._checkDisconnecting(r))return this.log("subscribe: discconecting true"),this;let a={qos:0};5===n&&(a.nl=!1,a.rap=!1,a.rh=0);let{properties:l}=t={...a,...t},u=[],h=(e,r)=>{if(r=r||t,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,e)||this._resubscribeTopics[e].qos<r.qos||i){let t={topic:e,qos:r.qos};5===n&&(t.nl=r.nl,t.rap=r.rap,t.rh=r.rh,t.properties=l),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",t.topic,t.qos),u.push(t)}};if(Array.isArray(e)?e.forEach(e=>{this.log("subscribe: array topic %s",e),h(e)}):Object.keys(e).forEach(t=>{this.log("subscribe: object topic %s, %o",t,e[t]),h(t,e[t])}),!u.length)return r(null,[]),this;let f=(e,t)=>{let r={cmd:"subscribe",subscriptions:e,messageId:t};if(l&&(r.properties=l),this.options.resubscribe){this.log("subscribe :: resubscribe true");let t=[];e.forEach(e=>{if(this.options.reconnectPeriod>0){let r={qos:e.qos};5===n&&(r.nl=e.nl||!1,r.rap=e.rap||!1,r.rh=e.rh||0,r.properties=e.properties),this._resubscribeTopics[e.topic]=r,t.push(e.topic)}}),this.messageIdToTopic[r.messageId]=t}let i=new Promise((t,n)=>{this.outgoing[r.messageId]={volatile:!0,cb(r,i){if(!r){let{granted:t}=i;for(let r=0;r<t.length;r+=1)e[r].qos=t[r]}r?n(new g.ErrorWithSubackPacket(r.message,i)):t(i)}}});return this.log("subscribe :: call _sendPacket"),this._sendPacket(r),i},p=()=>{let e=this.options.subscribeBatchSize??u.length,t=[];for(let r=0;r<u.length;r+=e){let n=u.slice(r,r+e),i=this._nextId();if(null===i)return this.log("No messageId left"),!1;t.push(f(n,i))}return Promise.all(t).then(e=>{r(null,u,e.at(-1))}).catch(e=>{r(e,u,e.packet)}),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!p())&&this._storeProcessingQueue.push({invoke:p,callback:r}),this}subscribeAsync(e,t){return new Promise((r,n)=>{this.subscribe(e,t,(e,t)=>{e?n(e):r(t)})})}unsubscribe(e,t,r){"string"==typeof e&&(e=[e]),"function"==typeof t&&(r=t),r=r||this.noop;let n=c.validateTopics(e);if(null!==n)return v(r,Error(`Invalid topic ${n}`)),this;if(this._checkDisconnecting(r))return this;let i=()=>{let n=this._nextId();if(null===n)return this.log("No messageId left"),!1;let i={cmd:"unsubscribe",messageId:n,unsubscriptions:[]};return"string"==typeof e?i.unsubscriptions=[e]:Array.isArray(e)&&(i.unsubscriptions=e),this.options.resubscribe&&i.unsubscriptions.forEach(e
3=>{delete this._resubscribeTopics[e]}),"object"==typeof t&&t.properties&&(i.properties=t.properties),this.outgoing[i.messageId]={volatile:!0,cb:r},this.log("unsubscribe: call _sendPacket"),this._sendPacket(i),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!i())&&this._storeProcessingQueue.push({invoke:i,callback:r}),this}unsubscribeAsync(e,t){return new Promise((r,n)=>{this.unsubscribe(e,t,(e,t)=>{e?n(e):r(t)})})}end(e,t,r){this.log("end :: (%s)",this.options.clientId),(null==e||"boolean"!=typeof e)&&(r=r||t,t=e,e=!1),"object"!=typeof t&&(r=r||t,t=null),this.log("end :: cb? %s",!!r),r&&"function"==typeof r||(r=this.noop);let n=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this.incomingStore.close(e=>{this.outgoingStore.close(t=>{this.log("end :: closeStores: emitting end"),this.emit("end"),r&&(this.log("end :: closeStores: invoking callback with args"),r(e||t))})}),this._deferredReconnect?this._deferredReconnect():(0===this.options.reconnectPeriod||this.options.manualConnect)&&(this.disconnecting=!1)},i=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,e),this._cleanUp(e,()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),(0,g.nextTick)(n)},t)};return this.disconnecting?r():(this._clearReconnect(),this.disconnecting=!0,!e&&Object.keys(this.outgoing).length>0?(this.log("end :: (%s) :: calling finish in 10ms once outgoing is empty",this.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,i,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),i())),this}endAsync(e,t){return new Promise((r,n)=>{this.end(e,t,e=>{e?n(e):r()})})}removeOutgoingMessage(e){if(this.outgoing[e]){let{cb:t}=this.outgoing[e];this._removeOutgoingAndStoreMessage(e,()=>{t(Error("Message removed"))})}return this}reconnect(e){this.log("client reconnect");let t=()=>{e?(this.options.incomingStore=e.incomingStore,this.options.outgoingStore=e.outgoingStore):(this.options.incomingStore=null,this.options.outgoingStore=null),this.incomingStore=this.options.incomingStore||new h.default,this.outgoingStore=this.options.outgoingStore||new h.default,this.disconnecting=!1,this.disconnected=!1,this._deferredReconnect=null,this._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=t:t(),this}_flushVolatile(){this.outgoing&&(this.log("_flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(this.outgoing).forEach(e=>{this.outgoing[e].volatile&&"function"==typeof this.outgoing[e].cb&&(this.outgoing[e].cb(Error("Connection closed")),delete this.outgoing[e])}))}_flush(){this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach(e=>{"function"==typeof this.outgoing[e].cb&&(this.outgoing[e].cb(Error("Connection closed")),delete this.outgoing[e])}))}_removeTopicAliasAndRecoverTopicName(e){let t;e.properties&&(t=e.properties.topicAlias);let r=e.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",t,r),0===r.length){if(typeof t>"u"||typeof(r=this.topicAliasSend.getTopicByAlias(t))>"u")return Error("Unregistered Topic Alias");e.topic=r}t&&delete e.properties.topicAlias}_checkDisconnecting(e){return this.disconnecting&&(e&&e!==this.noop?e(Error("client disconnecting")):this.emit("error",Error("client disconnecting"))),this.disconnecting}_reconnect(){this.log("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this.connect()}),this.log("client already connected. disconnecting first.")):(this.log("_reconnect: calling connect"),this.connect())}_setupReconnect(){this.disconnecting||this.reconnectTimer||!(this.options.reconnectPeriod>0)?this.log("_setupReconnect :: doing nothing..."):(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))}_clearReconnect(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)}_cleanUp(e,t,r={}){if(t&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",t)),this.log("_cleanUp :: forced? %s",e),e)0===this.options.reconnectPeriod&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{let e={cmd:"disconnect",...r};this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(e,()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),v(()=>{this.stream.end(()=>{this.log("_cleanUp :: (%s) :: stream destroyed",this.options.clientId)})})})}this.disconnecting||this.reconnecting||(this.log("_cleanUp :: client not disconnecting/reconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this._destroyKeepaliveManager(),t&&!this.connected&&(this.log("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",t),t())}_storeAndSend(e,t,r){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",e.cmd);let n=e,i;if("publish"===n.cmd&&(n=(0,l.default)(e),i=this._removeTopicAliasAndRecoverTopicName(n)))return t&&t(i);this.outgoingStore.put(n,n=>
3{if(n)return t&&t(n);r(),this._writePacket(e,t)})}_applyTopicAlias(e){if(5===this.options.protocolVersion&&"publish"===e.cmd){let t;e.properties&&(t=e.properties.topicAlias);let r=e.topic.toString();if(this.topicAliasSend){if(t){if(0!==r.length&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",r,t),!this.topicAliasSend.put(r,t)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",r,t),Error("Sending Topic Alias out of range")}else 0!==r.length&&(this.options.autoAssignTopicAlias?(t=this.topicAliasSend.getAliasByTopic(r))?(e.topic="",e.properties={...e.properties,topicAlias:t},this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",r,t)):(t=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(r,t),e.properties={...e.properties,topicAlias:t},this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",r,t)):this.options.autoUseTopicAlias&&(t=this.topicAliasSend.getAliasByTopic(r))&&(e.topic="",e.properties={...e.properties,topicAlias:t},this.log("applyTopicAlias :: auto use topic: %s - alias: %d",r,t)))}else if(t)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",r,t),Error("Sending Topic Alias out of range")}}_noop(e){this.log("noop ::",e)}_writePacket(e,t){this.log("_writePacket :: packet: %O",e),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",e),this.log("_writePacket :: writing to stream");let r=s.default.writeToStream(e,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",r),!r&&t&&t!==this.noop?(this.log("_writePacket :: handle events on `drain` once through callback."),this.stream.once("drain",t)):t&&(this.log("_writePacket :: invoking cb"),t())}_sendPacket(e,t,r,n){this.log("_sendPacket :: (%s) :: start",this.options.clientId),r=r||this.noop,t=t||this.noop;let i=this._applyTopicAlias(e);if(i){t(i);return}if(!this.connected){if("auth"===e.cmd){this._writePacket(e,t);return}this.log("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(e,t,r);return}if(n){this._writePacket(e,t);return}switch(e.cmd){case"publish":break;case"pubrel":this._storeAndSend(e,t,r);return;default:this._writePacket(e,t);return}switch(e.qos){case 2:case 1:this._storeAndSend(e,t,r);break;default:this._writePacket(e,t)}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}_storePacket(e,t,r){this.log("_storePacket :: packet: %o",e),this.log("_storePacket :: cb? %s",!!t),r=r||this.noop;let n=e;if("publish"===n.cmd){n=(0,l.default)(e);let r=this._removeTopicAliasAndRecoverTopicName(n);if(r)return t&&t(r)}let i=n.qos||0;0===i&&this.queueQoSZero||"publish"!==n.cmd?this.queue.push({packet:n,cb:t}):i>0?(t=this.outgoing[n.messageId]?this.outgoing[n.messageId].cb:null,this.outgoingStore.put(n,e=>{if(e)return t&&t(e);r()})):t&&t(Error("No connection to broker"))}_setupKeepaliveManager(){this.log("_setupKeepaliveManager :: keepalive %d (seconds)",this.options.keepalive),!this.keepaliveManager&&this.options.keepalive&&(this.keepaliveManager=new m.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.options.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.emit("error",Error("Keepalive timeout")),this.log("onKeepaliveTimeout :: calling _cleanUp with force true"),this._cleanUp(!0)}_resubscribe(){this.log("_resubscribe");let e=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion>=4&&!this.connackPacket.sessionPresent)&&e.length>0){if(this.options.resubscribe){if(5===this.options.protocolVersion){this.log("_resubscribe: protocolVersion 5");for(let t=0;t<e.length;t++){let r={};r[e[t]]=this._resubscribeTopics[e[t]],r.resubscribe=!0,this.subscribe(r,{properties:r[e[t]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics)}else this._resubscribeTopics={}}this._firstConnection=!1}
3_onConnect(e){if(this.disconnected){this.emit("connect",e);return}this.connackPacket=e,this.messageIdProvider.clear(),this._setupKeepaliveManager(),this.connected=!0;let t=()=>{let r=this.outgoingStore.createStream(),n=()=>{r.destroy(),r=null,this._flushStoreProcessingQueue(),i()},i=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",n),r.on("error",e=>{i(),this._flushStoreProcessingQueue(),this.removeListener("close",n),this.emit("error",e)});let o=()=>{if(!r)return;let e=r.read(1),t;if(!e){r.once("readable",o);return}if(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[e.messageId]){o();return}this.disconnecting||this.reconnectTimer?r.destroy&&r.destroy():(t=this.outgoing[e.messageId]?this.outgoing[e.messageId].cb:null,this.outgoing[e.messageId]={volatile:!1,cb(e,r){t&&t(e,r),o()}},this._packetIdsDuringStoreProcessing[e.messageId]=!0,this.messageIdProvider.register(e.messageId)?this._sendPacket(e,void 0,void 0,!0):this.log("messageId: %d has already used.",e.messageId))};r.on("end",()=>{let r=!0;for(let e in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[e]){r=!1;break}this.removeListener("close",n),r?(i(),this._invokeAllStoreProcessingQueue(),this.emit("connect",e)):t()}),o()};t()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){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(Error("Connection closed")),e.callback&&e.callback(Error("Connection closed"));this._storeProcessingQueue.splice(0)}_removeOutgoingAndStoreMessage(e,t){delete this.outgoing[e],this.outgoingStore.del({messageId:e},(r,n)=>{t(r,n),this.messageIdProvider.deallocate(e),this._invokeStoreProcessingQueue()})}};e.default=S}),r2=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"__esModule",{value:!0});var t=r_(),r=class{numberAllocator;lastId;constructor(){this.numberAllocator=new t.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()}};e.default=r}),r3=a(()=>{f(),e6(),eY(),tu={},tc=!1,(th=function(){if(tc)return tu;tc=!0;let e=/^xn--/,t=/[^\0-\x7F]/,r=/[\x2E\u3002\uFF0E\uFF61]/g,n={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},i=Math.floor,o=String.fromCharCode;function s(e){throw RangeError(n[e])}function a(e,t){let n=e.split("@"),i="";return n.length>1&&(i=n[0]+"@",e=n[1]),i+(function(e,t){let r=[],n=e.length;for(;n--;)r[n]=t(e[n]);return r})((e=e.replace(r,".")).split("."),t).join(".")}function l(e){let t=[],r=0,n=e.length;for(;r<n;){let i=e.charCodeAt(r++);if(i>=55296&&i<=56319&&r<n){let n=e.charCodeAt(r++);(64512&n)==56320?t.push(((1023&i)<<10)+(1023&n)+65536):(t.push(i),r--)}else t.push(i)}return t}let u=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},c=function(e,t,r){let n=0;for(e=r?i(e/700):e>>1,e+=i(e/t);e>455;n+=36)e=i(e/35);return i(n+36*e/(e+38))},h=function(e){let t=[],r=e.length,n=0,o=128,a=72,l=e.lastIndexOf("-");l<0&&(l=0);for(let r=0;r<l;++r)e.charCodeAt(r)>=128&&s("not-basic"),t.push(e.charCodeAt(r));for(let h=l>0?l+1:0;h<r;){let l=n;for(let t=1,o=36;;o+=36){var u;h>=r&&s("invalid-input");let l=(u=e.charCodeAt(h++))>=48&&u<58?26+(u-48):u>=65&&u<91?u-65:u>=97&&u<123?u-97:36;l>=36&&s("invalid-input"),l>i((2147483647-n)/t)&&s("overflow"),n+=l*t;let c=o<=a?1:o>=a+26?26:o-a;if(l<c)break;let f=36-c;t>i(2147483647/f)&&s("overflow"),t*=f}let f=t.length+1;a=c(n-l,f,0==l),i(n/f)>2147483647-o&&s("overflow"),o+=i(n/f),n%=f,t.splice(n++,0,o)}return String.fromCodePoint(...t)},f=function(e){let t=[],r=(e=l(e)).length,n=128,a=0,h=72;for(let r of e)r<128&&t.push(o(r));let f=t.length,p=f;for(f&&t.push("-");p<r;){let r=2147483647;for(let t of e)t>=n&&t<r&&(r=t);let l=p+1;for(let d of(r-n>i((2147483647-a)/l)&&s("overflow"),a+=(r-n)*l,n=r,e))if(d<n&&++a>2147483647&&s("overflow"),d===n){let e=a;for(let r=36;;r+=36){let n=r<=h?1:r>=h+26?26:r-h;if(e<n)break;let s=e-n,a=36-n;t.push(o(u(n+s%a,0))),e=i(s/a)}t.push(o(u(e,0))),h=c(a,l,p===f),a=0,++p}
3++a,++n}return t.join("")};return tu={version:"2.3.1",ucs2:{decode:l,encode:e=>String.fromCodePoint(...e)},decode:h,encode:f,toASCII:function(e){return a(e,function(e){return t.test(e)?"xn--"+f(e):e})},toUnicode:function(t){return a(t,function(t){return e.test(t)?h(t.slice(4).toLowerCase()):t})}}}()).decode,th.encode,th.toASCII,th.toUnicode,th.ucs2,th.version});function r6(){return nh||(nh=!0,nc=SyntaxError),nc}function r5(){return np||(np=!0,nf=TypeError),nf}function r4(){if(nE)return nS;nE=!0;var e=function(){if(nw)return nv;nw=!0;var e=Object.prototype.toString,t=Math.max,r=function(e,t){for(var r=[],n=0;n<e.length;n+=1)r[n]=e[n];for(var i=0;i<t.length;i+=1)r[i+e.length]=t[i];return r},n=function(e,t){for(var r=[],n=t,i=0;n<e.length;n+=1,i+=1)r[i]=e[n];return r},i=function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r};return nv=function(o){var s=this;if("function"!=typeof s||"[object Function]"!==e.apply(s))throw TypeError("Function.prototype.bind called on incompatible "+s);for(var a,l=n(arguments,1),u=t(0,s.length-l.length),c=[],h=0;h<u;h++)c[h]="$"+h;if(a=Function("binder","return function ("+i(c,",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof a){var e=s.apply(this,r(l,arguments));return Object(e)===e?e:this}return s.apply(o,r(l,arguments))}),s.prototype){var f=function(){};f.prototype=s.prototype,a.prototype=new f,f.prototype=null}return a}}();return nS=Function.prototype.bind||e}function r8(){if(nO)return nk;nO=!0;var e,t=(nn||(nn=!0,nr=Error),nr),r=(no||(no=!0,ni=EvalError),ni),n=(na||(na=!0,ns=RangeError),ns),i=(nu||(nu=!0,nl=ReferenceError),nl),o=r6(),s=r5(),a=(ny||(ny=!0,nd=URIError),nd),l=Function,u=function(e){try{return l('"use strict"; return ('+e+").constructor;")()}catch{}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch{c=null}var h=function(){throw new s},f=c?function(){try{return arguments.callee,h}catch{try{return c(arguments,"callee").get}catch{return h}}}():h,p=(function(){if(nb)return ng;nb=!0;var e="u">typeof Symbol&&Symbol,t=(nt||(nt=!0,ne=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t||"[object Symbol]"!==Object.prototype.toString.call(t)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}),ne);return ng=function(){return"function"==typeof e&&"function"==typeof Symbol&&"symbol"==typeof e("foo")&&"symbol"==typeof Symbol("bar")&&t()}})()(),d=(function(){if(n_)return nm;n_=!0;var e={__proto__:null,foo:{}},t=Object;return nm=function(){return({__proto__:e}).foo===e.foo&&!(e instanceof t)}})()(),y=Object.getPrototypeOf||(d?function(e){return e.__proto__}:null),g={},b=typeof Uint8Array>"u"||!y?e:y(Uint8Array),m={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":p&&y?y([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":g,"%AsyncGenerator%":g,"%AsyncGeneratorFunction%":g,"%AsyncIteratorPrototype%":g,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":r,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":l,"%GeneratorFunction%":g,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>
3"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":p&&y?y(y([][Symbol.iterator]())):e,"%JSON%":"object"==typeof JSON?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":!(typeof Map>"u")&&p&&y?y(new Map()[Symbol.iterator]()):e,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":n,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":!(typeof Set>"u")&&p&&y?y(new Set()[Symbol.iterator]()):e,"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":p&&y?y(""[Symbol.iterator]()):e,"%Symbol%":p?Symbol:e,"%SyntaxError%":o,"%ThrowTypeError%":f,"%TypedArray%":b,"%TypeError%":s,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":a,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet};if(y)try{null.error}catch(e){var _=y(y(e));m["%Error.prototype%"]=_}var v=function e(t){var r;if("%AsyncFunction%"===t)r=u("async function () {}");else if("%GeneratorFunction%"===t)r=u("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=u("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&y&&(r=y(i.prototype))}return m[t]=r,r},w={__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"]},S=r4(),E=function(){if(nI)return nA;nI=!0;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty;return nA=r4().call(e,t)}(),A=S.call(Function.call,Array.prototype.concat),I=S.call(Function.apply,Array.prototype.splice),k=S.call(Function.call,String.prototype.replace),O=S.call(Function.call,String.prototype.slice),x=S.call(Function.call,RegExp.prototype.exec),P=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,T=/\\(\\)?/g,R=function(e){var t=O(e,0,1
3),r=O(e,-1);if("%"===t&&"%"!==r)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new o("invalid intrinsic syntax, expected opening `%`");var n=[];return k(e,P,function(e,t,r,i){n[n.length]=r?k(i,T,"$1"):t||e}),n},C=function(e,t){var r,n=e;if(E(w,n)&&(n="%"+(r=w[n])[0]+"%"),E(m,n)){var i=m[n];if(i===g&&(i=v(n)),typeof i>"u"&&!t)throw new s("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new o("intrinsic "+e+" does not exist!")};return nk=function(e,t){if("string"!=typeof e||0===e.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new s('"allowMissing" argument must be a boolean');if(null===x(/^%?[^%]*%?$/,e))throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=R(e),n=r.length>0?r[0]:"",i=C("%"+n+"%",t),a=i.name,l=i.value,u=!1,h=i.alias;h&&(n=h[0],I(r,A([0,1],h)));for(var f=1,p=!0;f<r.length;f+=1){var d=r[f],y=O(d,0,1),g=O(d,-1);if(('"'===y||"'"===y||"`"===y||'"'===g||"'"===g||"`"===g)&&y!==g)throw new o("property names with quotes must have matching quotes");if("constructor"!==d&&p||(u=!0),n+="."+d,E(m,a="%"+n+"%"))l=m[a];else if(null!=l){if(!(d in l)){if(!t)throw new s("base intrinsic for "+e+" exists, but the property is not available.");return}if(c&&f+1>=r.length){var b=c(l,d);l=(p=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:l[d]}else p=E(l,d),l=l[d];p&&!u&&(m[a]=l)}}return l}}function r9(){if(nP)return nx;nP=!0;var e=r8()("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return nx=e}function r7(){if(nR)return nT;nR=!0;var e=r8()("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return nT=e}var ne,nt,nr,nn,ni,no,ns,na,nl,nu,nc,nh,nf,np,nd,ny,ng,nb,nm,n_,nv,nw,nS,nE,nA,nI,nk,nO,nx,nP,nT,nR,nC,nj,nM,nB,nN,nU,nL,nD,nF,nW,nq=a(()=>{f(),e6(),eY(),ne={},nt=!1,nr={},nn=!1,ni={},no=!1,ns={},na=!1,nl={},nu=!1,nc={},nh=!1,nf={},np=!1,nd={},ny=!1,ng={},nb=!1,nm={},n_=!1,nv={},nw=!1,nS={},nE=!1,nA={},nI=!1,nk={},nO=!1,nx={},nP=!1,nT={},nR=!1,nC={},nj=!1,nM={},nB=!1,nN={},nU=!1,nL={},nD=!1,nF={},nW=!1});function n$(e){throw Error("Node.js process "+e+" is not supported by JSPM core outside of Node.js")}function nH(){n4&&n8&&(n4=!1,n8.length?n5=n8.concat(n5):n9=-1,n5.length&&nV())}function nV(){if(!n4){var e=setTimeout(nH,0);n4=!0;for(var t=n5.length;t;){for(n8=n5,n5=[];++n9<t;)n8&&n8[n9].run();n9=-1,t=n5.length}n8=null,n4=!1,clearTimeout(e)}}function nz(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];n5.push(new nK(e,t)),1!==n5.length||n4||setTimeout(nV,0)}function nK(e,t){this.fun=e,this.array=t}function nG(){}function nQ(e){n$("_linkedBinding")}function nY(e){n$("dlopen")}function nJ(){return[]}function nX(){return[]}function nZ(e,t){if(!e)throw Error(t||"assertion error")}function n0(){return!1}function n1(){return i$.now()/1e3}function n2(e){var t=Math.floor((Date.now()-i$.now())*.001),r=.001*i$.now(),n=Math.floor(r)+t,i=Math.floor(r%1*1e9);return e&&(n-=e[0],(i-=e[1])<0&&(n--,i+=iV)),[n,i]}function n3(){return i1}function n6(e){return[]}var n5,n4,n8,n9,n7,ie,it,ir,ii,io,is,ia,il,iu,ic,ih,ip,id,iy,ig,ib,im,i_,iv,iw,iS,iE,iA,iI,ik,iO,ix,iP,iT,iR,iC,ij,iM,iB,iN,iU,iL,iD,iF,iW,iq,i$,iH,iV,iz,iK,iG,iQ,iY,iJ,iX,iZ,i0,i1,i2,i3,i6,i5=a(()=>{f(),e6(),eY(),n5=[],n4=!1,n9=-1,nK.prototype.run=function(){this.fun.apply(null,this.array)},n7="browser",ie="browser",it={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},ir=["/usr/bin/node"],ii=[],io="v16.8.0",is={},ia=function(e,t){console.warn((t?t+": ":"")+e)},il=function(e){n$("binding")},iu=function(e){return 0},ic=function(){return"/"},ih=function(e){},ip={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},id=nG,iy=[],ig={},ib={},im=nG,i_=nG,iw=iv=function(){return{}},iS=iv,iE=nG,iA=nG,iI=nG,ik={},iO={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},ix=nG,iP=nG,iT=nG,iR=nG,iC=nG,ij=nG,iM=nG,iB=void 0,iN=void 0,iU=void 0,iL=nG,iD="/bin/usr/node",iF="node",iW=[],iq=nG,void 0===(i$={now:"u">typeof performance?performance.now.bind(performance):void 0,timing:"u">typeof performance?performance.timing:void 0}).now&&(iH=Date.now(),i$.timing&&i$.timing.navigationStart&&(iH=i$.timing.navigationStart),i$.now=()=>Date.now()-iH),iV=1e9,n2.bigint=function(e){var t=n2(e);return typeof BigInt>"u"?t[0]*iV+t[1]:BigInt(t[0]*iV)+BigInt(t[1])},iz={},iK=n3,iG=n3,iQ=n3,iY=n3,iJ=n3,iX=nG,iZ=n3,i0=n3,i1={version:io,versions:is,arch:"x64",platform:ie,release:ip,_rawDebug:id,moduleLoadList:iy,binding:il,_linkedBinding:nQ,_events:iz,_eventsCount:0,_maxListeners:10,on:n3,addListener:iK,once:iG,off:iQ,removeListener:iY,removeAllListeners:iJ,emit:iX,prependListener:iZ,prependOnceListener:i0,listeners:n6,domain:ig,_exiting:!1,config:ib,dlopen:nY,uptime:n1,_getActiveRequests:nJ,_getActiveHandles:nX,reallyExit:im,_kill:i_,cpuUsage:iv,resourceUsage:iw,memoryUsage:iS,kill:iE,exit:iA,openStdin:iI,allowedNodeEnvironmentFlags:ik,assert:nZ,features:iO,_fatalExceptions:ix,setUncaughtExceptionCaptureCallback:iP,hasUncaughtExceptionCaptureCallback:n0,emitWarning:ia,nextTick:nz,_tickCallback:iT,_debugProcess:iR,_debugEnd:iC,_startProfilerIdleNotifier:ij,_stopProfilerIdleNotifier:iM,stdout:iB,stdin:iU,stderr:iN,abort:iL,umask:iu,chdir:ih,cwd:ic,env:it,title:n7,argv:ir,execArgv:ii,pid:2,ppid:1,execPath:iD,debugPort:9229,hrtime:n2,argv0:iF,_preload_modules:iW,setSourceMapsEnabled:iq}}),i4=a(()=>{f(),e6(),eY(),i5(),i2={},i3=!1,i6=function(){if(i3)return i2;i3=!0;var e=i1;function t(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,n="",i=0,o=-1,s=0,a=0;a<=e.length;++a){if(a<e.length)r=e.charCodeAt(a);else{if(47===r)break;r=47}if(47===r){if(!(o===a-1||1===s)){if(o!==a-1&&2===s){if(n.length<2||2!==i||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2)){if(n.length>2){var l=n.lastIndexOf("/");if(l!==n.length-1){-1===l?(n="",i=0):i=(n=n.slice(0,l)).length-1-n.lastIndexOf("/"),o=a,s=0;continue}}else if(2===n.length||1===n.length){n="",i=0,o=a,s=0;continue}}t&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+e.slice(o+1,a):n=e.slice(o+1,a),i=a-o-1}o=a,s=0}else 46===r&&-1!==s?++s:s=-1}return n}var n={resolve:function(){for(var n,i,o="",s=!1,a=arguments.length-1;a>=-1&&!s;a--)a>=0?n=arguments[a]:(void 0===i&&(i=e.cwd()),n=i),t(n),0!==n.length&&(o=n+"/"+o,s=47===n.charCodeAt(0));return o=r(o,!s),s?o.length>0?"/"+o:"/":o.length>0?o:"."},normalize:function(e){if(t(e),0===e.length)return".";var n=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=r(e,!n)).length||n||(e="."),e.length>0&&i&&(e+="/"),n?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0==arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];t(i),i.length>0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":n.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r||(e=n.resolve(e))===(r=n.resolve(r)))return"";for(var i=1;i<e.length&&47===e.charCodeAt(i);++i);for(var o=e.length,s=o-i,a=1;a<r.length&&47===r.charCodeAt(a);++a);for(var l=r.length,u=l-a,c=s<u?s:u,h=-1,f=0;f<=c;++f){if(f===c){if(u>c){if(47===r.charCodeAt(a+f))return r.slice(a+f+1);if(0===f)return r.slice(a+f)}else s>c&&(47===e.charCodeAt(i+f)?h=f:0===f&&(h=0));break}var p=e.charCodeAt(i+f);if(p!==r.charCodeAt(a+f))break;47===p&&(h=f)}var d="";for(f=i+h+1;f<=o;++f)(f===o||47===e.charCodeAt(f))&&(0===d.length?d+="..":d+="/..");return d.length>0?d+r.slice(a+h):(a+=h,47===r.charCodeAt(a)&&++a,r.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),n=47===r,i=-1,o=!0,s=e.length-1;s>=1;--s)if(47===(r=e.charCodeAt(s))){if(!o){i=s;break}}else o=!1;
3return -1===i?n?"/":".":n&&1===i?"//":e.slice(0,i)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw TypeError('"ext" argument must be a string');t(e);var n,i=0,o=-1,s=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var a=r.length-1,l=-1;for(n=e.length-1;n>=0;--n){var u=e.charCodeAt(n);if(47===u){if(!s){i=n+1;break}}else -1===l&&(s=!1,l=n+1),a>=0&&(u===r.charCodeAt(a)?-1==--a&&(o=n):(a=-1,o=l))}return i===o?o=l:-1===o&&(o=e.length),e.slice(i,o)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!s){i=n+1;break}}else -1===o&&(s=!1,o=n+1);return -1===o?"":e.slice(i,o)},extname:function(e){t(e);for(var r=-1,n=0,i=-1,o=!0,s=0,a=e.length-1;a>=0;--a){var l=e.charCodeAt(a);if(47===l){if(!o){n=a+1;break}continue}-1===i&&(o=!1,i=a+1),46===l?-1===r?r=a:1!==s&&(s=1):-1!==r&&(s=-1)}return -1===r||-1===i||0===s||1===s&&r===i-1&&r===n+1?"":e.slice(r,i)},format:function(e){var t,r;if(null===e||"object"!=typeof e)throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return t=e.dir||e.root,r=e.base||(e.name||"")+(e.ext||""),t?t===e.root?t+r:t+"/"+r:r},parse:function(e){t(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return r;var n,i=e.charCodeAt(0),o=47===i;o?(r.root="/",n=1):n=0;for(var s=-1,a=0,l=-1,u=!0,c=e.length-1,h=0;c>=n;--c){if(47===(i=e.charCodeAt(c))){if(!u){a=c+1;break}continue}-1===l&&(u=!1,l=c+1),46===i?-1===s?s=c:1!==h&&(h=1):-1!==s&&(h=-1)}return -1===s||-1===l||0===h||1===h&&s===l-1&&s===a+1?-1!==l&&(0===a&&o?r.base=r.name=e.slice(1,l):r.base=r.name=e.slice(a,l)):(0===a&&o?(r.name=e.slice(1,s),r.base=e.slice(1,l)):(r.name=e.slice(a,s),r.base=e.slice(a,l)),r.ext=e.slice(s,l)),a>0?r.dir=e.slice(0,a-1):o&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return n.posix=n,i2=n}()}),i8={};function i9(){if(ou)return ol;ou=!0;var e=String.prototype.replace,t=/%20/g,r={RFC1738:"RFC1738",RFC3986:"RFC3986"};return ol={default:r.RFC3986,formatters:{RFC1738:function(r){return e.call(r,t,"+")},RFC3986:function(e){return String(e)}},RFC1738:r.RFC1738,RFC3986:r.RFC3986}}function i7(){if(oh)return oc;oh=!0;var e=i9(),t=Object.prototype.hasOwnProperty,r=Array.isArray,n=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),i=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(r(n)){for(var i=[],o=0;o<n.length;++o)"u">typeof n[o]&&i.push(n[o]);t.obj[t.prop]=i}}},o=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n<e.length;++n)"u">typeof e[n]&&(r[n]=e[n]);return r};return oc={arrayToObject:o,assign:function(e,t){return Object.keys(t).reduce(function(e,r){return e[r]=t[r],e},e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n<t.length;++n)for(var o=t[n],s=o.obj[o.prop],a=Object.keys(s),l=0;l<a.length;++l){var u=a[l],c=s[u];"object"==typeof c&&null!==c&&-1===r.indexOf(c)&&(t.push({obj:s,prop:u}),r.push(c))}return i(t),e},decode:function(e,t,r){var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},encode:function(t,r,i,o,s){if(0===t.length)return t;var a=t;if("symbol"==typeof t?a=Symbol.prototype.toString.call(t):"string"!=typeof t&&(a=String(t)),"iso-8859-1"===i)return escape(a).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});for(var l="",u=0;u<a.length;u+=1024){for(var c=a.length>=1024?a.slice(u,u+1024):a,h=[],f=0;f<c.length;++f){var p=c.charCodeAt(f);if(45===p||46===p||95===p||126===p||p>=48&&p<=57||p>=65&&p<=90||p>=97&&p<=122||s===e.RFC1738&&(40===p||41===p)){h[h.length]=c.charAt(f);continue}if(p<128){h[h.length]=n[p];continue}if(p<2048){h[h.length]=n[192|p>>6]+n[128|63&p];continue}if(p<55296||p>=57344){h[h.length]=n[224|p>>12]+n[128|p>>6&63]+n[128|63&p];continue}f+=1,p=65536+((1023&p)<<10|1023&c.charCodeAt(f)),h[h.length]=n[240|p>>18]+n[128|p>>12&63]+n[128|p>>6&63]+n[128|63&p]}l+=h.join("")}return l},isBuffer:function(e){return!!e&&"object"==typeof e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(r(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(t(e[i]));return n}return t(e)},merge:function e(n,i,s){if(!i)return n;if("object"!=typeof i){if(r(n))n.push(i);else{if(!n||"object"!=typeof n)return[n,i];(s&&(s.plainObjects||s.allowPrototypes)||!t.call(Object.prototype,i
3))&&(n[i]=!0)}return n}if(!n||"object"!=typeof n)return[n].concat(i);var a=n;return r(n)&&!r(i)&&(a=o(n,s)),r(n)&&r(i)?(i.forEach(function(r,i){if(t.call(n,i)){var o=n[i];o&&"object"==typeof o&&r&&"object"==typeof r?n[i]=e(o,r,s):n.push(r)}else n[i]=r}),n):Object.keys(i).reduce(function(r,n){var o=i[n];return t.call(r,n)?r[n]=e(r[n],o,s):r[n]=o,r},a)}}}function oe(e){if("string"==typeof e)e=new URL(e);else if(!(e instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if("file:"!==e.protocol)throw new Deno.errors.InvalidData("invalid url scheme");return oC?function(e){let t=e.hostname,r=e.pathname;for(let e=0;e<r.length;e++)if("%"===r[e]){let t=r.codePointAt(e+2)||32;if("2"===r[e+1]&&102===t||"5"===r[e+1]&&99===t)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(r=decodeURIComponent(r=r.replace(oj,"\\")),""!==t)return`\\\\${t}${r}`;{let e=32|r.codePointAt(1),t=r[2];if(e<oT||e>oR||":"!==t)throw new Deno.errors.InvalidData("file url path must be absolute");return r.slice(1)}}(e):function(e){if(""!==e.hostname)throw new Deno.errors.InvalidData("invalid file url hostname");let t=e.pathname;for(let e=0;e<t.length;e++)if("%"===t[e]){let r=t.codePointAt(e+2)||32;if("2"===t[e+1]&&102===r)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(t)}(e)}function ot(e){let t=i6.resolve(e),r=e.charCodeAt(e.length-1);(r===oP||oC&&r===ox)&&t[t.length-1]!==i6.sep&&(t+="/");let n=new URL("file://");return t.includes("%")&&(t=t.replace(oM,"%25")),!oC&&t.includes("\\")&&(t=t.replace(oB,"%5C")),t.includes(` 4`)&&(t=t.replace(oN,"%0A")),t.includes("\r")&&(t=t.replace(oU,"%0D")),t.includes(" ")&&(t=t.replace(oL,"%09")),n.pathname=t,n}u(i8,{URL:()=>oO,Url:()=>oS,default:()=>ov,fileURLToPath:()=>oe,format:()=>oE,parse:()=>ok,pathToFileURL:()=>ot,resolve:()=>oA,resolveObject:()=>oI});var or,on,oi,oo,os,oa,ol,ou,oc,oh,of,op,od,oy,og,ob,om,o_,ov,ow,oS,oE,oA,oI,ok,oO,ox,oP,oT,oR,oC,oj,oM,oB,oN,oU,oL,oD=a(()=>{f(),e6(),eY(),r3(),nq(),i4(),i5(),or=Object.freeze(Object.create(null)),on={},oi=!1,oo="u">typeof globalThis?globalThis:"u">typeof self?self:r.g,os={},oa=!1,ol={},ou=!1,oc={},oh=!1,of={},op=!1,od={},oy=!1,og={},ob=!1,om={},o_=!1,(ov=function(){if(o_)return om;o_=!0;var e=th;function t(){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]*)?$/,o=["'"].concat(["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",` 5`," "])),s=["%","/","?",";","#"].concat(o),a=["/","?","#"],l=/^[+a-z0-9A-Z_-]{0,63}$/,u=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,c={javascript:!0,"javascript:":!0},h={javascript:!0,"javascript:":!0},f={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},p=function(){if(ob)return og;ob=!0;var e=function(){if(op)return of;op=!0;var e=function(){if(oa)return os;oa=!0;var e=r8(),t=function(){if(nW)return nF;nW=!0;var e=r8(),t=function(){if(nD)return nL;nD=!0;var e=r4(),t=r8(),r=function(){if(nU)return nN;nU=!0;var e=r8(),t=function(){if(nj)return nC;nj=!0;var e=r9(),t=r6(),r=r5(),n=r7();return nC=function(i,o,s){if(!i||"object"!=typeof i&&"function"!=typeof i)throw new r("`obj` must be an object or a function`");if("string"!=typeof o&&"symbol"!=typeof o)throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new r("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],h=!!n&&n(i,o);if(e)e(i,o,{configurable:null===u&&h?h.configurable:!u,enumerable:null===a&&h?h.enumerable:!a,value:s,writable:null===l&&h?h.writable:!l});else if(!c&&(a||l||u))throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");else i[o]=s}}(),r=(function(){if(nB)return nM;nB=!0;var e=r9(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return 1!==e([],"length",{value:1}).length}catch{return!0}},nM=t})()(),n=r7(),i=r5(),o=e("%Math.floor%");return nN=function(e,s){if("function"!=typeof e)throw new i("`fn` is not a function");if("number"!=typeof s||s<0||s>4294967295||o(s)!==s)throw new i("`length` must be a positive 32-bit integer");var a=arguments.length>2&&!!arguments[2],l=!0,u=!0;if("length"in e&&n){var c=n(e,"length");c&&!c.configurable&&(l=!1),c&&!c.writable&&(u=!1)}
5return(l||u||!a)&&(r?t(e,"length",s,!0,!0):t(e,"length",s)),e}}(),n=r5(),i=t("%Function.prototype.apply%"),o=t("%Function.prototype.call%"),s=t("%Reflect.apply%",!0)||e.call(o,i),a=r9(),l=t("%Math.max%");nL=function(t){if("function"!=typeof t)throw new n("a function is required");var i=s(e,o,arguments);return r(i,1+l(0,t.length-(arguments.length-1)),!0)};var u=function(){return s(e,i,arguments)};return a?a(nL,"apply",{value:u}):nL.apply=u,nL}(),r=t(e("String.prototype.indexOf"));return nF=function(n,i){var o=e(n,!!i);return"function"==typeof o&&r(n,".prototype.")>-1?t(o):o}}(),r=function(){if(oi)return on;oi=!0;var e="function"==typeof Map&&Map.prototype,t=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=e&&t&&"function"==typeof t.get?t.get:null,n=e&&Map.prototype.forEach,i="function"==typeof Set&&Set.prototype,o=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=i&&o&&"function"==typeof o.get?o.get:null,a=i&&Set.prototype.forEach,l="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,u="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,c="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,f=Object.prototype.toString,p=Function.prototype.toString,d=String.prototype.match,y=String.prototype.slice,g=String.prototype.replace,b=String.prototype.toUpperCase,m=String.prototype.toLowerCase,_=RegExp.prototype.test,v=Array.prototype.concat,w=Array.prototype.join,S=Array.prototype.slice,E=Math.floor,A="function"==typeof BigInt?BigInt.prototype.valueOf:null,I=Object.getOwnPropertySymbols,k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,O="function"==typeof Symbol&&"object"==typeof Symbol.iterator,x="function"==typeof Symbol&&Symbol.toStringTag?Symbol.toStringTag:null,P=Object.prototype.propertyIsEnumerable,T=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function R(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||_.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var n=e<0?-E(-e):E(e);if(n!==e){var i=String(n),o=y.call(t,i.length+1);return g.call(i,r,"$&_")+"."+g.call(g.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return g.call(t,r,"$&_")}var C=or.custom,j=U(C)?C:null;function M(e,t,r){var n="double"===(r.quoteStyle||t)?'"':"'";return n+e+n}function B(e){return"[object Array]"===F(e)&&(!x||!("object"==typeof e&&x in e))}function N(e){return"[object RegExp]"===F(e)&&(!x||!("object"==typeof e&&x in e))}function U(e){if(O)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!k)return!1;try{return k.call(e),!0}catch{}return!1}on=function e(t,i,o,f){var b=i||{};if(D(b,"quoteStyle")&&"single"!==b.quoteStyle&&"double"!==b.quoteStyle)throw TypeError('option "quoteStyle" must be "single" or "double"');if(D(b,"maxStringLength")&&("number"==typeof b.maxStringLength?b.maxStringLength<0&&b.maxStringLength!==1/0:null!==b.maxStringLength))throw TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var _=!D(b,"customInspect")||b.customInspect;if("boolean"!=typeof _&&"symbol"!==_)throw TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(D(b,"indent")&&null!==b.indent&&" "!==b.indent&&!(parseInt(b.indent,10)===b.indent&&b.indent>0))throw TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
5if(D(b,"numericSeparator")&&"boolean"!=typeof b.numericSeparator)throw TypeError('option "numericSeparator", if provided, must be `true` or `false`');var E=b.numericSeparator;if(typeof t>"u")return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return function e(t,r){if(t.length>r.maxStringLength){var n=t.length-r.maxStringLength;return e(y.call(t,0,r.maxStringLength),r)+"... "+n+" more character"+(n>1?"s":"")}return M(g.call(g.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,q),"single",r)}(t,b);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var I=String(t);return E?R(t,I):I}if("bigint"==typeof t){var C=String(t)+"n";return E?R(t,C):C}var L=typeof b.depth>"u"?5:b.depth;if(typeof o>"u"&&(o=0),o>=L&&L>0&&"object"==typeof t)return B(t)?"[Array]":"[Object]";var G=function(e,t){var r;if(" "===e.indent)r=" ";else{if("number"!=typeof e.indent||!(e.indent>0))return null;r=w.call(Array(e.indent+1)," ")}return{base:r,prev:w.call(Array(t+1),r)}}(b,o);if(typeof f>"u")f=[];else if(W(f,t)>=0)return"[Circular]";function Q(t,r,n){if(r&&(f=S.call(f)).push(r),n){var i={depth:b.depth};return D(b,"quoteStyle")&&(i.quoteStyle=b.quoteStyle),e(t,i,o+1,f)}return e(t,b,o+1,f)}if("function"==typeof t&&!N(t)){var Y=function(e){if(e.name)return e.name;var t=d.call(p.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),J=K(t,Q);return"[Function"+(Y?": "+Y:" (anonymous)")+"]"+(J.length>0?" { "+w.call(J,", ")+" }":"")}if(U(t)){var X=O?g.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):k.call(t);return"object"!=typeof t||O?X:$(X)}if(t&&"object"==typeof t&&("u">typeof HTMLElement&&t instanceof HTMLElement||"string"==typeof t.nodeName&&"function"==typeof t.getAttribute)){for(var Z,ee="<"+m.call(String(t.nodeName)),et=t.attributes||[],er=0;er<et.length;er++)ee+=" "+et[er].name+"="+M((Z=et[er].value,g.call(String(Z),/"/g,""")),"double",b);return ee+=">",t.childNodes&&t.childNodes.length&&(ee+="..."),ee+="</"+m.call(String(t.nodeName))+">"}if(B(t)){if(0===t.length)return"[]";var en=K(t,Q);return G&&!function(e){for(var t=0;t<e.length;t++)if(W(e[t],` 6`)>=0)return!1;return!0}(en)?"["+z(en,G)+"]":"[ "+w.call(en,", ")+" ]"}if("[object Error]"===F(t)&&(!x||!("object"==typeof t&&x in t))){var ei=K(t,Q);return"cause"in Error.prototype||!("cause"in t)||P.call(t,"cause")?0===ei.length?"["+String(t)+"]":"{ ["+String(t)+"] "+w.call(ei,", ")+" }":"{ ["+String(t)+"] "+w.call(v.call("[cause]: "+Q(t.cause),ei),", ")+" }"}if("object"==typeof t&&_){if(j&&"function"==typeof t[j]&&or)return or(t,{depth:L-o});if("symbol"!==_&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!r||!e||"object"!=typeof e)return!1;try{r.call(e);try{s.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}(t)){var eo=[];return n&&n.call(t,function(e,r){eo.push(Q(r,t,!0)+" => "+Q(e,t))}),V("Map",r.call(t),eo,G)}if(function(e){if(!s||!e||"object"!=typeof e)return!1;try{s.call(e);try{r.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}(t)){var es=[];return a&&a.call(t,function(e){es.push(Q(e,t))}),V("Set",s.call(t),es,G)}if(function(e){if(!l||!e||"object"!=typeof e)return!1;try{l.call(e,l);try{u.call(e,u)}catch{return!0}return e instanceof WeakMap}catch{}return!1}(t))return H("WeakMap");if(function(e){if(!u||!e||"object"!=typeof e)return!1;try{u.call(e,u);try{l.call(e,l)}catch{return!0}return e instanceof WeakSet}catch{}return!1}(t))return H("WeakSet");if(function(e){if(!c||!e||"object"!=typeof e)return!1;try{return c.call(e),!0}catch{}return!1}(t))return H("WeakRef");if("[object Number]"===F(t)&&(!x||!("object"==typeof t&&x in t)))return $(Q(Number(t)));if(function(e){if(!e||"object"!=typeof e||!A)return!1;try{return A.call(e),!0}catch{}return!1}(t))return $(Q(A.call(t)));if("[object Boolean]"===F(t)&&(!x||!("object"==typeof t&&x in t)))return $(h.call(t));if("[object String]"===F(t)&&(!x||!("object"==typeof t&&x in t)))return $(Q(String(t)));if("u">typeof window&&t===window)return"{ [object Window] }";if("u">typeof globalThis&&t===globalThis||"u">typeof oo&&t===oo)return"{ [object globalThis] }";if(!("[object Date]"===F(t)&&(!x||!("object"==typeof t&&x in t)))&&!N(t)){var ea=K(t,Q),el=T?T(t)===Object.prototype:t instanceof Object||t.constructor===Object,eu=t instanceof Object?"":"null prototype",ec=!el&&x&&Object(t)===t&&x in t?y.call(F(t),8,-1):eu?"Object":"",eh=(el||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(ec||eu?"["+w.call(v.call([],ec||[],eu||[]),": ")+"] ":"");return 0===ea.length?eh+"{}":G?eh+"{"+z(ea,G)+"}":eh+"{ "+w.call(ea,", ")+" }"}return String(t)};var L=Object.prototype.hasOwnProperty||function(e){return e in(this||oo)};function D(e,t){return L.call(e,t)}function F(e){return f.call(e)}function W(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return -1}function q(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+b.call(t.toString(16))}function $(e){return"Object("+e+")"}function H(e){return e+" { ? }"}function V(e,t,r,n){return e+" ("+t+") {"+(n?z(r,n):w.call(r,", "))+"}"}function z(e,t){if(0===e.length)return"";var r=` 7`+t.prev+t.base;return r+w.call(e,","+r)+` 8`+t.prev}function K(e,t){var r=B(e),n=[];if(r){n.length=e.length;for(var i=0;i<e.length;i++)n[i]=D(e,i)?t(e[i],e):""}var o,s="function"==typeof I?I(e):[];if(O){o={};for(var a=0;a<s.length;a++)o["$"+s[a]]=s[a]}for(var l in e)D(e,l)&&(r&&String(Number(l))===l&&l<e.length||O&&o["$"+l]instanceof Symbol||(_.call(/[^\w$]/,l)?n.push(t(l,e)+": "+t(e[l],e)):n.push(l+": "+t(e[l],e))));if("function"==typeof I)for(var u=0;u<s.length;u++)P.call(e,s[u])&&n.push("["+t(s[u])+"]: "+t(e[s[u]],e));return n}return on}(),n=r5(),i=e("%WeakMap%",!0),o=e("%Map%",!0),s=t("WeakMap.prototype.get",!0),a=t("WeakMap.prototype.set",!0),l=t("WeakMap.prototype.has",!0),u=t("Map.prototype.get",!0),c=t("Map.prototype.set",!0),h=t("Map.prototype.has",!0),f=function(e,t){for(var r,n=e;null!==(r=n.next);n=r)if(r.key===t)return n.next=r.next,r.next=e.next,e.next=r,r},p=function(e,t){var r=f(e,t);return r&&r.value},d=function(e,t,r){var n=f(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}};return os=function(){var e,t,y,g={assert:function(e){if(!g.has(e))throw new n("Side channel does not contain "+r(e))},get:function(r){if(i&&r&&("object"==typeof r||"function"==typeof r)){if(e)return s(e,r)}else if(o){if(t)return u(t,r)}else if(y)return p(y,r)},has:function(r){if(i&&r&&("object"==typeof r||"function"==typeof r)){if(e)return l(e,r)}else if(o){if(t)return h(t,r)}else if(y)return!!f(y,r);return!1},set:function(r,n){i&&r&&("object"==typeof r||"function"==typeof r)?(e||(e=new i),a(e,r,n)):o?(t||(t=new o),c(t,r,n)):(y||(y={key:{},next:null}),d(y,r,n))}};return g}}(),t=i7(),r=i9(),n=Object.prototype.hasOwnProperty,i={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},o=Array.isArray,s=Array.prototype.push,a=function(e,t){s.apply(e,o(t)?t:[t])},l=Date.prototype.toISOString,u=r.default,c={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset
8:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:t.encode,encodeValuesOnly:!1,format:u,formatter:r.formatters[u],indices:!1,serializeDate:function(e){return l.call(e)},skipNulls:!1,strictNullHandling:!1},h={},f=function r(n,i,s,l,u,f,p,d,y,g,b,m,_,v,w,S,E,A){for(var I,k,O=n,x=A,P=0,T=!1;void 0!==(x=x.get(h))&&!T;){var R=x.get(n);if(P+=1,"u">typeof R){if(R===P)throw RangeError("Cyclic object value");T=!0}typeof x.get(h)>"u"&&(P=0)}if("function"==typeof g?O=g(i,O):O instanceof Date?O=_(O):"comma"===s&&o(O)&&(O=t.maybeMap(O,function(e){return e instanceof Date?_(e):e})),null===O){if(f)return y&&!S?y(i,c.encoder,E,"key",v):i;O=""}if("string"==typeof(I=O)||"number"==typeof I||"boolean"==typeof I||"symbol"==typeof I||"bigint"==typeof I||t.isBuffer(O))return y?[w(S?i:y(i,c.encoder,E,"key",v))+"="+w(y(O,c.encoder,E,"value",v))]:[w(i)+"="+w(String(O))];var C=[];if(typeof O>"u")return C;if("comma"===s&&o(O))S&&y&&(O=t.maybeMap(O,y)),k=[{value:O.length>0?O.join(",")||null:void 0}];else if(o(g))k=g;else{var j=Object.keys(O);k=b?j.sort(b):j}var M=d?i.replace(/\./g,"%2E"):i,B=l&&o(O)&&1===O.length?M+"[]":M;if(u&&o(O)&&0===O.length)return B+"[]";for(var N=0;N<k.length;++N){var U=k[N],L="object"==typeof U&&"u">typeof U.value?U.value:O[U];if(!(p&&null===L)){var D=m&&d?U.replace(/\./g,"%2E"):U,F=o(O)?"function"==typeof s?s(B,D):B:B+(m?"."+D:"["+D+"]");A.set(n,P);var W=e();W.set(h,A),a(C,r(L,F,s,l,u,f,p,d,"comma"===s&&S&&o(O)?null:y,g,b,m,_,v,w,S,E,W))}}return C},p=function(e){if(!e)return c;if("u">typeof e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if("u">typeof e.encodeDotInKeys&&"boolean"!=typeof e.encodeDotInKeys)throw TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.encoder&&"u">typeof e.encoder&&"function"!=typeof e.encoder)throw TypeError("Encoder has to be a function.");var t,s=e.charset||c.charset;if("u">typeof e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var a=r.default;if("u">typeof e.format){if(!n.call(r.formatters,e.format))throw TypeError("Unknown format option provided.");a=e.format}var l=r.formatters[a],u=c.filter;if(("function"==typeof e.filter||o(e.filter))&&(u=e.filter),t=e.arrayFormat in i?e.arrayFormat:"indices"in e?e.indices?"indices":"repeat":c.arrayFormat,"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw TypeError("`commaRoundTrip` must be a boolean, or absent");var h=typeof e.allowDots>"u"?!0===e.encodeDotInKeys||c.allowDots:!!e.allowDots;return{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:c.addQueryPrefix,allowDots:h,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:c.allowEmptyArrays,arrayFormat:t,charset:s,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:c.charsetSentinel,commaRoundTrip:e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?c.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:c.encode,encodeDotInKeys:"boolean"==typeof e.encodeDotInKeys?e.encodeDotInKeys:c.encodeDotInKeys,encoder:"function"==typeof e.encoder?e.encoder:c.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:c.encodeValuesOnly,filter:u,format:a,formatter:l,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:c.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:c.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:c.strictNullHandling}};return of=function(t,r){var n,s=t,l=p(r);"function"==typeof l.filter?s=(0,l.filter)("",s):o(l.filter)&&(n=l.filter);var u=[];if("object"!=typeof s||null===s)return"";var c=i[l.arrayFormat],h="comma"===c&&l.commaRoundTrip;n||(n=Object.keys(s)),l.sort&&n.sort(l.sort);for(var d=e(),y=0;y<n.length;++y){var g=n[y];l.skipNulls&&null===s[g]||a(u,f(s[g],g,c,h,l.allowEmptyArrays,l.strictNullHandling,l.skipNulls,l.encodeDotInKeys,l.encode?l.encoder:null,l.filter,l.sort,l.allowDots,l.serializeDate,l.format,l.formatter,l.encodeValuesOnly,l.charset,d))}var b=u.join(l.delimiter),m=!0===l.addQueryPrefix?"?":"";return l.charsetSentinel&&("iso-8859-1"===l.charset?m+="utf8=%26%2310003%3B&":m+="utf8=%E2%9C%93&"),b.length>0?m+b:""}}(),t=function(){if(oy)return od;oy=!0;var e=i7(),t=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:e.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},i=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},o=function(o,s){var a={__proto__:null},l=s.ignoreQueryPrefix?o.replace(/^\?/,""):o;l=l.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var u,c=s.parameterLimit===1/0?void 0:s.parameterLimit,h=l.split(s.delimiter,c),f=-1,p=s.charset;if(s.charsetSentinel)for(u=0;
8u<h.length;++u)0===h[u].indexOf("utf8=")&&("utf8=%E2%9C%93"===h[u]?p="utf-8":"utf8=%26%2310003%3B"===h[u]&&(p="iso-8859-1"),f=u,u=h.length);for(u=0;u<h.length;++u)if(u!==f){var d,y,g=h[u],b=g.indexOf("]="),m=-1===b?g.indexOf("="):b+1;-1===m?(d=s.decoder(g,n.decoder,p,"key"),y=s.strictNullHandling?null:""):(d=s.decoder(g.slice(0,m),n.decoder,p,"key"),y=e.maybeMap(i(g.slice(m+1),s),function(e){return s.decoder(e,n.decoder,p,"value")})),y&&s.interpretNumericEntities&&"iso-8859-1"===p&&(y=y.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})),g.indexOf("[]=")>-1&&(y=r(y)?[y]:y);var _=t.call(a,d);_&&"combine"===s.duplicates?a[d]=e.combine(a[d],y):_&&"last"!==s.duplicates||(a[d]=y)}return a},s=function(e,t,r,n){for(var o=n?t:i(t,r),s=e.length-1;s>=0;--s){var a,l=e[s];if("[]"===l&&r.parseArrays)a=r.allowEmptyArrays&&(""===o||r.strictNullHandling&&null===o)?[]:[].concat(o);else{a=r.plainObjects?Object.create(null):{};var u="["===l.charAt(0)&&"]"===l.charAt(l.length-1)?l.slice(1,-1):l,c=r.decodeDotInKeys?u.replace(/%2E/g,"."):u,h=parseInt(c,10);r.parseArrays||""!==c?!isNaN(h)&&l!==c&&String(h)===c&&h>=0&&r.parseArrays&&h<=r.arrayLimit?(a=[])[h]=o:"__proto__"!==c&&(a[c]=o):a={0:o}}o=a}return o},a=function(e,r,n,i){if(e){var o=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,l=n.depth>0&&/(\[[^[\]]*])/.exec(o),u=l?o.slice(0,l.index):o,c=[];if(u){if(!n.plainObjects&&t.call(Object.prototype,u)&&!n.allowPrototypes)return;c.push(u)}for(var h=0;n.depth>0&&null!==(l=a.exec(o))&&h<n.depth;){if(h+=1,!n.plainObjects&&t.call(Object.prototype,l[1].slice(1,-1))&&!n.allowPrototypes)return;c.push(l[1])}if(l){if(!0===n.strictDepth)throw RangeError("Input depth exceeded depth option of "+n.depth+" and strictDepth is true");c.push("["+o.slice(l.index)+"]")}return s(c,r,n,i)}},l=function(t){if(!t)return n;if("u">typeof t.allowEmptyArrays&&"boolean"!=typeof t.allowEmptyArrays)throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if("u">typeof t.decodeDotInKeys&&"boolean"!=typeof t.decodeDotInKeys)throw TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==t.decoder&&"u">typeof t.decoder&&"function"!=typeof t.decoder)throw TypeError("Decoder has to be a function.");if("u">typeof t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=typeof t.charset>"u"?n.charset:t.charset,i=typeof t.duplicates>"u"?n.duplicates:t.duplicates;if("combine"!==i&&"first"!==i&&"last"!==i)throw TypeError("The duplicates option must be either combine, first, or last");return{allowDots:typeof t.allowDots>"u"?!0===t.decodeDotInKeys||n.allowDots:!!t.allowDots,allowEmptyArrays:"boolean"==typeof t.allowEmptyArrays?!!t.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:n.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:n.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:n.arrayLimit,charset:r,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:n.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:n.comma,decodeDotInKeys:"boolean"==typeof t.decodeDotInKeys?t.decodeDotInKeys:n.decodeDotInKeys,decoder:"function"==typeof t.decoder?t.decoder:n.decoder,delimiter:"string"==typeof t.delimiter||e.isRegExp(t.delimiter)?t.delimiter:n.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:n.depth,duplicates:i,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:n.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:n.plainObjects,strictDepth:"boolean"==typeof t.strictDepth?!!t.strictDepth:n.strictDepth,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:n.strictNullHandling}};return od=function(t,r){var n=l(r);if(""===t||null===t||typeof t>"u")return n.plainObjects?Object.create(null):{};for(var i="string"==typeof t?o(t,n):t,s=n.plainObjects?Object.create(null):{},u=Object.keys(i),c=0;c<u.length;++c){var h=u[c],f=a(h,i[h],n,"string"==typeof t);s=e.merge(s,f,n)}return!0===n.allowSparse?s:e.compact(s)}}();return og={formats:i9(),parse:t,stringify:e}}();function d(e,r,n){if(e&&"object"==typeof e&&e instanceof t)return e;var i=new t;return i.parse(e,r,n),i}return t.prototype.parse=function(t,n,d){if("string"!=typeof t)throw TypeError("Parameter 'url' must be a string, not "+typeof t);var y=t.indexOf("?"),g=-1!==y&&y<t.indexOf("#")?"?":"#",b=t.split(g);b[0]=b[0].replace(/\\/g,"/");var m=t=b.join(g);if(m=m.trim(),!d&&1===t.split("#").length){var _=i.exec(m);if(_)return this.path=m,this.href=m,this.pathname=_[1],_[2]?(this.search=_[2],n?this.query=p.parse(this.search.substr(1)):this.query=this.search.substr(1)):n&&(this.search="",this.query={}),this}var v=r.exec(m);if(v){var w=(v=v[0]).toLowerCase();this.protocol=w,m=m.substr(v.length)}if(d||v||m.match(/^\/\/[^@/]+@[^@/]+/)){var S="//"===m.substr(0,2);S&&!(v&&h[v])&&(m=m.substr(2),this.slashes=!0)}if(!h[v]&&(S||v&&!f[v])){for(var E,A,I=-1,k=0;k<a.length;k++){var O=m.indexOf(a[k]);-1!==O&&(-1===I||O<I)&&(I=O)}-1!==(A=-1===I?m.lastIndexOf("@"):m.lastIndexOf("@",I))&&(E=m.slice(0,A),m=m.slice(A+1),this.auth=decodeURIComponent(E)),I=-1;for(var k=0;k<s.length;
8k++){var O=m.indexOf(s[k]);-1!==O&&(-1===I||O<I)&&(I=O)}-1===I&&(I=m.length),this.host=m.slice(0,I),m=m.slice(I),this.parseHost(),this.hostname=this.hostname||"";var x="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!x)for(var P=this.hostname.split(/\./),k=0,T=P.length;k<T;k++){var R=P[k];if(R&&!R.match(l)){for(var C="",j=0,M=R.length;j<M;j++)R.charCodeAt(j)>127?C+="x":C+=R[j];if(!C.match(l)){var B=P.slice(0,k),N=P.slice(k+1),U=R.match(u);U&&(B.push(U[1]),N.unshift(U[2])),N.length&&(m="/"+N.join(".")+m),this.hostname=B.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),x||(this.hostname=e.toASCII(this.hostname));var L=this.port?":"+this.port:"",D=this.hostname||"";this.host=D+L,this.href+=this.host,x&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==m[0]&&(m="/"+m))}if(!c[w])for(var k=0,T=o.length;k<T;k++){var F=o[k];if(-1!==m.indexOf(F)){var W=encodeURIComponent(F);W===F&&(W=escape(F)),m=m.split(F).join(W)}}var q=m.indexOf("#");-1!==q&&(this.hash=m.substr(q),m=m.slice(0,q));var $=m.indexOf("?");if(-1!==$?(this.search=m.substr($),this.query=m.substr($+1),n&&(this.query=p.parse(this.query)),m=m.slice(0,$)):n&&(this.search="",this.query={}),m&&(this.pathname=m),f[w]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var L=this.pathname||"",H=this.search||"";this.path=L+H}return this.href=this.format(),this},t.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":")+"@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,o="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&"object"==typeof this.query&&Object.keys(this.query).length&&(o=p.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var s=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||f[t])&&!1!==i?(i="//"+(i||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):i||(i=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),t+i+(r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(s=s.replace("#","%23"))+n},t.prototype.resolve=function(e){return this.resolveObject(d(e,!1,!0)).format()},t.prototype.resolveObject=function(e){if("string"==typeof e){var r=new t;r.parse(e,!1,!0),e=r}for(var n=new t,i=Object.keys(this),o=0;o<i.length;o++){var s=i[o];n[s]=this[s]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var a=Object.keys(e),l=0;l<a.length;l++){var u=a[l];"protocol"!==u&&(n[u]=e[u])}return f[n.protocol]&&n.hostname&&!n.pathname&&(n.pathname="/",n.path=n.pathname),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!f[e.protocol]){for(var c=Object.keys(e),p=0;p<c.length;p++){var d=c[p];n[d]=e[d]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||h[e.protocol])n.pathname=e.pathname;else{for(var y=(e.pathname||"").split("/");y.length&&!(e.host=y.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==y[0]&&y.unshift(""),y.length<2&&y.unshift(""),n.pathname=y.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var g=n.pathname||"",b=n.search||"";n.path=g+b}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var m=n.pathname&&"/"===n.pathname.charAt(0),_=e.host||e.pathname&&"/"===e.pathname.charAt(0),v=_||m||n.host&&e.pathname,w=v,S=n.pathname&&n.pathname.split("/")||[],y=e.pathname&&e.pathname.split("/")||[],E=n.protocol&&!f[n.protocol];if(E&&(n.hostname="",n.port=null,n.host&&(""===S[0]?S[0]=n.host:S.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===y[0]?y[0]=e.host:y.unshift(e.host)),e.host=null),v=v&&(""===y[0]||""===S[0])),_)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,S=y;else if(y.length)S||(S=[]),S.pop(),S=S.concat(y),n.search=e.search,n.query=e.query;else if(null!=e.search){if(E){n.host=S.shift(),n.hostname=n.host;var A=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");A&&(n.auth=A.shift(),n.hostname=A.shift(),n.host=n.hostname)}return n.search=e.search,n.query=e.query,(null!==n.pathname||null!==n.search)&&(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!S.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var I=S.slice(-1)[0],k=(n.host||e.host||S.length>1)&&("."===I||".."===I)||""===I,O=0,x=S.length;x>=0;
8x--)"."===(I=S[x])?S.splice(x,1):".."===I?(S.splice(x,1),O++):O&&(S.splice(x,1),O--);if(!v&&!w)for(;O--;O)S.unshift("..");v&&""!==S[0]&&(!S[0]||"/"!==S[0].charAt(0))&&S.unshift(""),k&&"/"!==S.join("/").substr(-1)&&S.push("");var P=""===S[0]||S[0]&&"/"===S[0].charAt(0);if(E){n.hostname=P?"":S.length?S.shift():"",n.host=n.hostname;var A=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");A&&(n.auth=A.shift(),n.hostname=A.shift(),n.host=n.hostname)}return(v=v||n.host&&S.length)&&!P&&S.unshift(""),S.length>0?n.pathname=S.join("/"):(n.pathname=null,n.path=null),(null!==n.pathname||null!==n.search)&&(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},t.prototype.parseHost=function(){var e=this.host,t=n.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},om.parse=d,om.resolve=function(e,t){return d(e,!1,!0).resolve(t)},om.resolveObject=function(e,t){return e?d(e,!1,!0).resolveObject(t):t},om.format=function(e){return"string"==typeof e&&(e=d(e)),e instanceof t?e.format():t.prototype.format.call(e)},om.Url=t,om}()).parse,ov.resolve,ov.resolveObject,ov.format,ov.Url,ow="u">typeof Deno?"windows"===Deno.build.os?"win32":Deno.build.os:void 0,ov.URL="u">typeof URL?URL:null,ov.pathToFileURL=ot,ov.fileURLToPath=oe,oS=ov.Url,oE=ov.format,oA=ov.resolve,oI=ov.resolveObject,ok=ov.parse,oO=ov.URL,ox=92,oP=47,oT=97,oR=122,oC="win32"===ow,oj=/\//g,oM=/%/g,oB=/\\/g,oN=/\n/g,oU=/\r/g,oL=/\t/g}),oF=l((e,t)=>{f(),e6(),eY(),t.exports=function(){throw Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}}),oW=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"__esModule",{value:!0}),e.BufferedDuplex=void 0,e.writev=n;var t=tU(),r=(e3(),h(eX));function n(e,t){let n=Array(e.length);for(let t=0;t<e.length;t++)"string"==typeof e[t].chunk?n[t]=r.Buffer.from(e[t].chunk,"utf8"):n[t]=e[t].chunk;this._write(r.Buffer.concat(n),"binary",t)}var i=class extends t.Duplex{socket;proxy;isSocketOpen;writeQueue;constructor(e,t,r){super({objectMode:!0}),this.proxy=t,this.socket=r,this.writeQueue=[],e.objectMode||(this._writev=n.bind(this)),this.isSocketOpen=!1,this.proxy.on("data",e=>{!this.destroyed&&this.readable&&this.push(e)})}_read(e){this.proxy.read(e)}_write(e,t,r){this.isSocketOpen?this.writeToProxy(e,t,r):this.writeQueue.push({chunk:e,encoding:t,cb:r})}_final(e){this.writeQueue=[],this.proxy.end(e)}_destroy(e,t){this.writeQueue=[],this.proxy.destroy(),t(e)}socketReady(){this.emit("connect"),this.isSocketOpen=!0,this.processWriteQueue()}writeToProxy(e,t,r){!1===this.proxy.write(e,t)?this.proxy.once("drain",r):r()}processWriteQueue(){for(;this.writeQueue.length>0;){let{chunk:e,encoding:t,cb:r}=this.writeQueue.shift();this.writeToProxy(e,t,r)}}};e.BufferedDuplex=i}),oq=l(e=>{f(),e6(),eY();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.streamBuilder=e.browserStreamBuilder=void 0;var r=(e3(),h(eX)),n=t(oF()),i=t(tV()),o=tU(),s=t(rX()),a=oW(),l=(0,i.default)("mqttjs:ws"),u=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function c(e,t){let r=`${e.protocol}://${e.hostname}:${e.port}${e.path}`;return"function"==typeof e.transformWsUrl&&(r=e.transformWsUrl(r,e,t)),r}function p(e){return e.port||("wss"===e.protocol?e.port=443:e.port=80),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={}),s.default||e.forceNativeWebSocket||"wss"!==e.protocol||u.forEach(t=>{Object.prototype.hasOwnProperty.call(e,t)&&!Object.prototype.hasOwnProperty.call(e.wsOptions,t)&&(e.wsOptions[t]=e[t])}),e}e.streamBuilder=(e,t)=>{let r;l("streamBuilder");let i=p(t);i.hostname=i.hostname||i.host||"localhost";let o=c(i,e),s=(l("createWebSocket"),l(`protocol: ${i.protocolId} ${i.protocolVersion}`),r="MQIsdp"===i.protocolId&&3===i.protocolVersion?"mqttv3.1":"mqtt",l(`creating new Websocket for url: ${o} and protocol: ${r}`),i.createWebsocket?i.createWebsocket(o,[r],i):new n.default(o,[r],i.wsOptions)),a=n.default.createWebSocketStream(s,i.wsOptions);return a.url=o,s.on("close",()=>{a.destroy()}),a},e.browserStreamBuilder=(e,t)=>{var n,i;let s,u,h,f;l("browserStreamBuilder");let d,y=function(e){let t=p(e);if(t.hostname||(t.hostname=t.host),!t.hostname){if(typeof document>"u")throw Error("Could not determine host. Specify host manually.");let e=new URL(document.URL);t.hostname=e.hostname,t.port||(t.port=Number(e.port))}return void 0===t.objectMode&&(t.objectMode=!(!0===t.binary||void 0===t.binary)),t}(t).browserBufferSize||524288,g=t.browserBufferTimeout||1e3,b=!t.objectMode,m=(s="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt",u=c(t,e),(h=t.createWebsocket?t.createWebsocket(u,[s],t):new WebSocket(u,[s])).binaryType="arraybuffer",h),_=(n=function e(t,n,i){if(m.bufferedAmount>y){setTimeout(e,g,t,n,i);return}b&&"string"==typeof t&&(t=r.Buffer.from(t,"utf8"));try{m.send(t)}catch(e){return i(e)}i()},i=function(e){m.close(),e()},(f=new o.Transform({objectMode:t.objectMode}))._write=n,f._flush=i,f);t.objectMode||(_._writev=a.writev.bind(_)),_.on("close",()=>{m.close()});let v="u">typeof m.addEventListener;function w(){l("WebSocket onOpen"),d instanceof a.BufferedDuplex&&d.socketReady()}function S(e){l("WebSocket onClose",e),d.end(),d.destroy()}function E(e){l("WebSocket onError",e);let t=Error("WebSocket error");t.event=e,d.destroy(t)}async function A(e){if(!_||!_.readable||!_.writable)return;let{data:t}=e;t instanceof ArrayBuffer?t=r.Buffer.from(t):t instanceof Blob?t=r.Buffer.from(await new Response(t).arrayBuffer()):t=r.Buffer.from(t,"utf8"),_.push(t)}return m.readyState===m.OPEN?(d=_).socket=m:(d=new a.BufferedDuplex(t,_,m),v?m.addEventListener("open",w):m.onopen=w),v?(m.addEventListener("close",S),m.addEventListener("error",E
8),m.addEventListener("message",A)):(m.onclose=S,m.onerror=E,m.onmessage=A),d}}),o$={};function oH(){throw Error("Node.js net module is not supported by JSPM core outside of Node.js")}u(o$,{Server:()=>oH,Socket:()=>oH,Stream:()=>oH,_createServerHandle:()=>oH,_normalizeArgs:()=>oH,_setSimultaneousAccepts:()=>oH,connect:()=>oH,createConnection:()=>oH,createServer:()=>oH,default:()=>oV,isIP:()=>oH,isIPv4:()=>oH,isIPv6:()=>oH});var oV,oz=a(()=>{f(),e6(),eY(),oV={_createServerHandle:oH,_normalizeArgs:oH,_setSimultaneousAccepts:oH,connect:oH,createConnection:oH,createServer:oH,isIP:oH,isIPv4:oH,isIPv6:oH,Server:oH,Socket:oH,Stream:oH}}),oK=l((e,t)=>{f(),e6(),eY(),t.exports={}}),oG=l(e=>{f(),e6(),eY();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=t((oz(),h(o$))),n=t(tV()),i=t(oK()),o=(0,n.default)("mqttjs:tcp");e.default=(e,t)=>{if(t.port=t.port||1883,t.hostname=t.hostname||t.host||"localhost",t.socksProxy)return(0,i.default)(t.hostname,t.port,t.s
8ocksProxy,{timeout:t.socksTimeout});let{port:n,path:s}=t,a=t.hostname;return o("port %d and host %s",n,a),r.default.createConnection({port:n,host:a,path:s})}}),oQ={};u(oQ,{default:()=>oY});var oY,oJ=a(()=>{f(),e6(),eY(),oY={}}),oX=l(e=>{f(),e6(),eY();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=(oJ(),h(oQ)),n=t((oz(),h(o$))),i=t(tV()),o=t(oK()),s=(0,i.default)("mqttjs:tls");e.default=(e,t)=>{t.port=t.port||8883,t.host=t.hostname||t.host||"localhost",0===n.default.isIP(t.host)&&(t.servername=t.host),t.rejectUnauthorized=!1!==t.rejectUnauthorized,delete t.path,s("port %d host %s rejectUnauthorized %b",t.port,t.host,t.rejectUnauthorized);let i=function(e){let{host:t,port:n,socksProxy:i,...s}=e;if(void 0!==i){let a=(0,o.default)(t,n,i,{timeout:e.socksTimeout});return(0,r.connect)({...s,socket:a})}return(0,r.connect)(e)}(t);function a(r){t.rejectUnauthorized&&e.emit("error",r),i.end()}return i.on("secureConnect",()=>{t.rejectUnauthorized&&!i.authorized?i.emit("error",Error("TLS not authorized")):i.removeListener("error",a)}),i.on("error",a),i}}),oZ=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"__esModule",{value:!0});var t,r,n,i=(e3(),h(eX)),o=tU(),s=oW();e.default=(e,a)=>{let l,u,c;if(a.hostname=a.hostname||a.host,!a.hostname)throw Error("Could not determine host. Specify host manually.");let h="MQIsdp"===a.protocolId&&3===a.protocolVersion?"mqttv3.1":"mqtt";a.hostname||(a.hostname="localhost"),a.path||(a.path="/"),a.wsOptions||(a.wsOptions={});let f=(l="wxs"===a.protocol?"wss":"ws",u=`${l}://${a.hostname}${a.path}`,a.port&&80!==a.port&&443!==a.port&&(u=`${l}://${a.hostname}:${a.port}${a.path}`),"function"==typeof a.transformWsUrl&&(u=a.transformWsUrl(u,a,e)),u);t=wx.connectSocket({url:f,protocols:[h]}),(c=new o.Transform)._write=(e,r,n)=>{t.send({data:e.buffer,success(){n()},fail(e){n(Error(e))}})},c._flush=e=>{t.close({success(){e()}})},r=c,(n=new s.BufferedDuplex(a,r,t))._destroy=(e,r)=>{t.close({success(){r&&r(e)}})};let p=n.destroy;return n.destroy=(e,r)=>(n.destroy=p,setTimeout(()=>{t.close({fail(){n._destroy(e,r)}})},0),n),t.onOpen(()=>{n.socketReady()}),t.onMessage(e=>{let{data:t}=e;t=t instanceof ArrayBuffer?i.Buffer.from(t):i.Buffer.from(t,"utf8"),r.push(t)}),t.onClose(()=>{n.emit("close"),n.end(),n.destroy()}),t.onError(e=>{let t=Error(e.errMsg);n.destroy(t)}),n}}),o0=l(e=>{f(),e6(),eY(),Object.defineProperty(e,"__esModule",{value:!0});var t,r,n,i=(e3(),h(eX)),o=tU(),s=oW(),a=!1;e.default=(e,l)=>{let u,c,h;if(l.hostname=l.hostname||l.host,!l.hostname)throw Error("Could not determine host. Specify host manually.");let f="MQIsdp"===l.protocolId&&3===l.protocolVersion?"mqttv3.1":"mqtt";l.hostname||(l.hostname="localhost"),l.path||(l.path="/"),l.wsOptions||(l.wsOptions={});let p=(u="alis"===l.protocol?"wss":"ws",c=`${u}://${l.hostname}${l.path}`,l.port&&80!==l.port&&443!==l.port&&(c=`${u}://${l.hostname}:${l.port}${l.path}`),"function"==typeof l.transformWsUrl&&(c=l.transformWsUrl(c,l,e)),c);return(t=l.my).connectSocket({url:p,protocols:f}),(h=new o.Transform)._write=(e,r,n)=>{t.sendSocketMessage({data:e.buffer,success(){n()},fail(){n(Error())}})},h._flush=e=>{t.closeSocket({success(){e()}})},r=h,n=new s.BufferedDuplex(l,r,t),a||(a=!0,t.onSocketOpen(()=>{n.socketReady()}),t.onSocketMessage(e=>{if("string"==typeof e.data){let t=i.Buffer.from(e.data,"base64");r.push(t)}else{let t=new FileReader;t.addEventListener("load",()=>{if(t.result instanceof ArrayBuffer){r.push(i.Buffer.from(t.result));return}r.push(i.Buffer.from(t.result,"utf-8"))}),t.readAsArrayBuffer(e.data)}}),t.onSocketClose(()=>{n.end(),n.destroy()}),t.onSocketError(e=>{n.destroy(e)})),n}}),o1=l(e=>{f(),e6(),eY();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.connectAsync=function(e,t,r=!0){return new Promise((n,i)=>{let o=l(e,t),s={connect:e=>{a(),n(o)},end:()=>{a(),n(o)},error:e=>{a(),o.end(),i(e)}};function a(){Object.keys(s).forEach(e=>{o.off(e,s[e])})}!1===r&&(s.close=()=>{s.error(Error("Couldn't connect to server"))}
8),Object.keys(s).forEach(e=>{o.on(e,s[e])})})};var r=t(tV()),n=t((oD(),h(i8))),i=t(r1()),o=t(rX());"function"!=typeof p?.nextTick&&(p.nextTick=setImmediate);var s=(0,r.default)("mqttjs"),a=null;function l(e,t){if(s("connecting to an MQTT broker..."),"object"!=typeof e||t||(t=e,e=""),t=t||{},e&&"string"==typeof e){let r=n.default.parse(e,!0),i={};if(null!=r.port&&(i.port=Number(r.port)),i.host=r.hostname,i.query=r.query,i.auth=r.auth,i.protocol=r.protocol,i.path=r.path,!(t={...i,...t}).protocol)throw Error("Missing protocol");t.protocol=t.protocol.replace(/:$/,"")}if(t.unixSocket=t.unixSocket||t.protocol?.includes("+unix"),t.unixSocket?t.protocol=t.protocol.replace("+unix",""):t.protocol?.startsWith("ws")||t.protocol?.startsWith("wx")||delete t.path,function(e){let t;if(e.auth){if(t=e.auth.match(/^(.+):(.+)$/)){let[,r,n]=t;e.username=r,e.password=n}else e.username=e.auth}}(t),t.query&&"string"==typeof t.query.clientId&&(t.clientId=t.query.clientId),o.default||t.unixSocket?t.socksProxy=void 0:void 0===t.socksProxy&&"u">typeof p&&(t.socksProxy=p.env.MQTTJS_SOCKS_PROXY),t.cert&&t.key){if(t.protocol){if(-1===["mqtts","wss","wxs","alis"].indexOf(t.protocol))switch(t.protocol){case"mqtt":t.protocol="mqtts";break;case"ws":t.protocol="wss";break;case"wx":t.protocol="wxs";break;case"ali":t.protocol="alis";break;default:throw Error(`Unknown protocol for secure connection: "${t.protocol}"!`)}}else throw Error("Missing secure protocol key")}if(a||(a={},o.default||t.forceNativeWebSocket?(a.ws=oq().browserStreamBuilder,a.wss=oq().browserStreamBuilder,a.wx=oZ().default,a.wxs=oZ().default,a.ali=o0().default,a.alis=o0().default):(a.ws=oq().streamBuilder,a.wss=oq().streamBuilder,a.mqtt=oG().default,a.tcp=oG().default,a.ssl=oX().default,a.tls=a.ssl,a.mqtts=oX().default)),!a[t.protocol]){let e=-1!==["mqtts","wss"].indexOf(t.protocol);t.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((t,r)=>(!e||r%2!=0)&&"function"==typeof a[t])[0]}if(!1===t.clean&&!t.clientId)throw Error("Missing clientId for unclean clients");t.protocol&&(t.defaultProtocol=t.protocol);let r=new i.default(function(e){return t.servers&&(e._reconnectCount&&e._reconnectCount!==t.servers.length||(e._reconnectCount=0),t.host=t.servers[e._reconnectCount].host,t.port=t.servers[e._reconnectCount].port,t.protocol=t.servers[e._reconnectCount].protocol?t.servers[e._reconnectCount].protocol:t.defaultProtocol,t.hostname=t.host,e._reconnectCount++),s("calling streambuilder for",t.protocol),a[t.protocol](e,t)},t);return r.on("error",()=>{}),r}e.default=l}),o2=l(e=>{f(),e6(),eY();var t,r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=e&&e.__importStar||(t=function(e){return(t=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t})(e)},function(e){if(e&&e.__esModule)return e;var i={};if(null!=e)for(var o=t(e),s=0;s<o.length;s++)"default"!==o[s]&&r(i,e,o[s]);return n(i,e),i}),o=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)},s=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.ReasonCodes=e.KeepaliveManager=e.UniqueMessageIdProvider=e.DefaultMessageIdProvider=e.Store=e.MqttClient=e.connectAsync=e.connect=e.Client=void 0;var a=s(r1());e.MqttClient=a.default;var l=s(rA());e.DefaultMessageIdProvider=l.default;var u=s(r2());e.UniqueMessageIdProvider=u.default;var c=s(t1());e.Store=c.default;var h=i(o1());e.connect=h.default,Object.defineProperty(e,"connectAsync",{enumerable:!0,get:function(){return h.connectAsync}});var p=s(r0());e.KeepaliveManager=p.default,e.Client=a.default,o(r1(),e),o(t6(),e),o(t0(),e);var d=t5();Object.defineProperty(e,"ReasonCodes",{enumerable:!0,get:function(){return d.ReasonCodes}})}),o3=l(e=>{f(),e6(),eY();var t,r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);
8(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=e&&e.__importStar||(t=function(e){return(t=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t})(e)},function(e){if(e&&e.__esModule)return e;var i={};if(null!=e)for(var o=t(e),s=0;s<o.length;s++)"default"!==o[s]&&r(i,e,o[s]);return n(i,e),i}),o=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(e,"__esModule",{value:!0});var s=i(o2());e.default=s,o(o2(),e)});t.Z=o3()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.