@stonecrop/beam 0.2.51 → 0.2.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index.css +1 -1
- package/dist/beam.d.ts +12 -0
- package/dist/beam.js +1775 -1659
- package/dist/beam.js.map +1 -1
- package/dist/beam.umd.cjs +7 -7
- package/dist/beam.umd.cjs.map +1 -1
- package/dist/index.js +9 -1
- package/dist/src/index.d.ts +5 -1
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/BeamArrow.vue +4 -3
- package/src/components/BeamBtn.vue +0 -1
- package/src/components/BeamFilter.vue +74 -0
- package/src/components/BeamFilterOption.vue +139 -0
- package/src/components/BeamProgress.vue +12 -18
- package/src/components/FixedTop.vue +13 -0
- package/src/components/SplitColumn.vue +7 -3
- package/src/components/ToggleArrow.vue +35 -0
- package/src/index.ts +12 -0
package/dist/beam.umd.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
`,document.head.appendChild($e);const Gt={class:"beam_action-footer"},Fr={class:"footer-action-wrapper"},Di=$.defineComponent({__name:"ActionFooter",emits:["click"],setup(e,{emit:i}){const t=i,a=()=>{t("click")};return(h,n)=>($.openBlock(),$.createElementBlock("footer",Gt,[$.createElementVNode("span",Fr,[$.createElementVNode("button",{class:"beam_btn",onClick:a},[$.renderSlot(h.$slots,"default")])])]))}}),La={class:"beam_metadata_arrow"},Ua={class:"beam_metadata_arrow-head"},Na={id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 6.74 7.78"},ja=$.defineComponent({__name:"BeamArrow",props:{color:String},setup(e){return(i,t)=>($.openBlock(),$.createElementBlock("div",La,[$.createElementVNode("div",{class:"beam_metadata_arrow-body",style:$.normalizeStyle({background:e.color||"#c4c4c4"})},null,4),$.createElementVNode("div",Ua,[($.openBlock(),$.createElementBlock("svg",Na,[$.createElementVNode("polygon",{points:"6.74 3.89 0 0 0 7.78 6.74 3.89",style:$.normalizeStyle([{fill:"#c4c4c4"},{fill:e.color||"#c4c4c4"}])},null,4)]))])]))}}),Jt=(e,i)=>{const t=e.__vccOpts||e;for(const[a,h]of i)t[a]=h;return t},Fi=Jt(ja,[["__scopeId","data-v-e3223427"]]),Da={},Fa={class:"beam_btn"};function Wa(e,i){return $.openBlock(),$.createElementBlock("button",Fa,[$.renderSlot(e.$slots,"default",{},()=>[i[0]||(i[0]=$.createTextVNode("Action"))])])}const Wi=Jt(Da,[["render",Wa]]),$a={},Va={class:"beam_header"};function qa(e,i){return $.openBlock(),$.createElementBlock("h1",Va,[$.renderSlot(e.$slots,"default")])}const $i=Jt($a,[["render",qa]]),Ha={class:"beam_metadata"},za={class:"beam_metadata_content"},Ka={class:"beam_metadata_block"},Ya={class:"beam_metadata_heading"},Vi=$.defineComponent({__name:"BeamMetadata",props:{order:{}},setup(e){return(i,t)=>($.openBlock(),$.createElementBlock("div",Ha,[$.createElementVNode("div",za,[$.renderSlot(i.$slots,"default",{},()=>[t[1]||(t[1]=$.createElementVNode("div",{class:"beam_metadata_header beam_metadata--two-column"},null,-1)),$.createElementVNode("div",Ka,[$.createElementVNode("p",Ya,[t[0]||(t[0]=$.createTextVNode(" Status: ")),$.createElementVNode("span",{class:$.normalizeClass([{alert:!i.order.complete},"beam_metadata--normal"])},$.toDisplayString(i.order.complete?"Complete":"In Progress"),3)])]),t[2]||(t[2]=$.createStaticVNode('<div class="beam_metadata_shipping beam_metadata_block"><div class="beam_metadata_source"><p class="beam_metadata_heading">Source</p></div><div class="beam_metadata_source"><p class="beam_metadata_heading">Receiving</p></div></div>',1))])])]))}}),Qa={class:"beam_modal"},qi=$.defineComponent({__name:"BeamModal",props:{showModal:{type:Boolean}},setup(e){return(i,t)=>{const a=$.resolveComponent("portal");return $.openBlock(),$.createBlock(a,{to:"beam_modal_outlet"},{default:$.withCtx(()=>[$.withDirectives($.createElementVNode("div",Qa,[$.createElementVNode("button",{class:"beam_btn",onClick:t[0]||(t[0]=h=>i.$emit("closemodal"))},"Close Modal"),$.renderSlot(i.$slots,"default",{onClosemodal:t[1]||(t[1]=h=>i.$emit("closemodal")),onConfirmmodal:t[2]||(t[2]=h=>i.$emit("confirmmodal"))})],512),[[$.vShow,i.showModal]])]),_:3})}}}),Hi=$.defineComponent({__name:"BeamModalOutlet",emits:["confirmmodal","closemodal"],setup(e){return(i,t)=>{const a=$.resolveComponent("portal-target");return $.openBlock(),$.createBlock(a,{name:"beam_modal_outlet"})}}}),Ga={class:"beam_metadata_heading"},zi=$.defineComponent({__name:"BeamProgress",props:{label:{type:String,default:"Status"},progressMessage:{type:String,default:"In Progress"},completeMessage:{type:String,default:"Complete"},complete:Boolean},setup(e){const i=e,t=$.computed(()=>i.complete?i.completeMessage:i.progressMessage);return(a,h)=>($.openBlock(),$.createElementBlock("p",Ga,[$.createTextVNode($.toDisplayString(e.label)+": ",1),$.createElementVNode("span",{class:$.normalizeClass([{"beam--alert":!e.complete},"beam--normal"])},$.toDisplayString(t.value),3)]))}}),Ja={},Za={class:"beam_modal-confirm"};function Xa(e,i){return $.openBlock(),$.createElementBlock("div",Za,[i[2]||(i[2]=$.createElementVNode("h2",null,"Would you like to continue?",-1)),$.createElementVNode("button",{class:"beam_btn",onClick:i[0]||(i[0]=t=>e.$emit("confirmmodal"))},"Yes"),$.createElementVNode("button",{class:"beam_btn",onClick:i[1]||(i[1]=t=>e.$emit("closemodal"))},"No")])}const Ki=Jt(Ja,[["render",Xa]]),el={class:"container"},Wr=Jt($.defineComponent({__name:"ItemCheck",props:{modelValue:{type:Boolean,default:!1},modelModifiers:{}},emits:["update:modelValue"],setup(e){const i=$.useModel(e,"modelValue");return(t,a)=>($.openBlock(),$.createElementBlock("label",el,[$.withDirectives($.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":a[0]||(a[0]=h=>i.value=h),tabindex:"-1"},null,512),[[$.vModelCheckbox,i.value]]),a[1]||(a[1]=$.createElementVNode("div",{class:"checkmark",tabindex:"0"},null,-1))]))}}),[["__scopeId","data-v-f44a510e"]]),tl={class:"beam_item-count"},rl=["contenteditable"],nl={key:0},$r=$.defineComponent({__name:"ItemCount",props:$.mergeModels({denominator:{},uom:{default:""},editable:{type:Boolean,default:!0}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const i=$.useModel(e,"modelValue"),t=$.computed(()=>i.value===e.denominator),a=h=>{h.preventDefault(),h.stopPropagation();const n=Number(h.target.innerHTML)||0;i.value=Math.min(n,e.denominator)};return(h,n)=>($.openBlock(),$.createElementBlock("div",tl,[$.createElementVNode("span",{contenteditable:h.editable,class:$.normalizeClass({"beam--alert":!t.value}),onInput:a,onClick:a},$.toDisplayString(i.value),43,rl),$.createElementVNode("span",null,"/"+$.toDisplayString(h.denominator),1),h.uom?($.openBlock(),$.createElementBlock("span",nl," "+$.toDisplayString(h.uom),1)):$.createCommentVNode("",!0)]))}}),il=["href"],Yi=$.defineComponent({__name:"ListAnchor",props:{to:{default:""}},setup(e){return(i,t)=>($.openBlock(),$.createElementBlock("a",{href:i.to,class:"beam_list-anchor"},[$.renderSlot(i.$slots,"default")],8,il))}}),ol={tabindex:"0",class:"beam_list-item"},sl={class:"beam_list-text"},al={class:"beam--bold"},dr=$.defineComponent({__name:"ListItem",props:{item:{}},setup(e){const i=$.ref(e.item);return(t,a)=>($.openBlock(),$.createElementBlock("li",ol,[$.createElementVNode("div",sl,[$.createElementVNode("label",al,$.toDisplayString(i.value.label),1),$.createElementVNode("p",null,$.toDisplayString(i.value.description),1)]),i.value.count?($.openBlock(),$.createBlock($r,{key:0,modelValue:i.value.count.count,"onUpdate:modelValue":a[0]||(a[0]=h=>i.value.count.count=h),denominator:i.value.count.of,uom:i.value.count.uom,editable:!0},null,8,["modelValue","denominator","uom"])):$.createCommentVNode("",!0),i.value.hasOwnProperty("checked")?($.openBlock(),$.createBlock(Wr,{key:1,modelValue:i.value.checked,"onUpdate:modelValue":a[1]||(a[1]=h=>i.value.checked=h)},null,8,["modelValue"])):$.createCommentVNode("",!0)]))}}),ll={class:"beam_list-view"},Qi=$.defineComponent({__name:"ListView",props:{items:{}},emits:["scrollbottom"],setup(e,{emit:i}){const t=i;$.onMounted(()=>{window.addEventListener("scroll",a)}),$.onUnmounted(()=>{window.removeEventListener("scroll",a)});const a=()=>{const h=document.documentElement.scrollHeight-window.innerHeight,n=document.documentElement.scrollTop;h-n<=2&&t("scrollbottom")};return(h,n)=>($.openBlock(),$.createElementBlock("ul",ll,[($.openBlock(!0),$.createElementBlock($.Fragment,null,$.renderList(h.items,r=>($.openBlock(),$.createElementBlock("li",{key:r.label},[r.linkComponent?($.openBlock(),$.createBlock($.resolveDynamicComponent(r.linkComponent),{key:0,to:r.route,tabindex:"-1"},{default:$.withCtx(()=>[$.createVNode(dr,{item:r},null,8,["item"])]),_:2},1032,["to"])):($.openBlock(),$.createBlock(dr,{key:1,item:r},null,8,["item"]))]))),128))]))}}),hl={class:"beam_navbar"},Gi=$.defineComponent({__name:"Navbar",emits:["click"],setup(e,{emit:i}){const t=i,a=()=>{t("click")};return(h,n)=>{const r=$.resolveComponent("BeamHeading");return $.openBlock(),$.createElementBlock("nav",hl,[$.renderSlot(h.$slots,"title",{},()=>[$.createVNode(r,null,{default:$.withCtx(()=>n[0]||(n[0]=[$.createTextVNode("TITLE")])),_:1})]),$.createElementVNode("button",{class:"navbar-action beam_btn",onClick:a},[$.renderSlot(h.$slots,"navbaraction",{},()=>[n[1]||(n[1]=$.createTextVNode("Action"))])])])}}});var ul=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function cl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ji={exports:{}};(function(e,i){(function(t,a){e.exports=a()})(ul,function(){var t={attachTo:function(a,h){if(a.scannerDetectionData!==void 0)throw new Error("onScan.js is already initialized for DOM element "+a);var n={onScan:function(r,s){},onScanError:function(r){},onKeyProcess:function(r,s){},onKeyDetect:function(r,s){},onPaste:function(r,s){},keyCodeMapper:function(r){return t.decodeKeyEvent(r)},onScanButtonLongPress:function(){},scanButtonKeyCode:!1,scanButtonLongPressTime:500,timeBeforeScanTest:100,avgTimeByChar:30,minLength:6,suffixKeyCodes:[9,13],prefixKeyCodes:[],ignoreIfFocusOn:!1,stopPropagation:!1,preventDefault:!1,captureEvents:!1,reactToKeydown:!0,reactToPaste:!1,singleScanQty:1};return h=this._mergeOptions(n,h),a.scannerDetectionData={options:h,vars:{firstCharTime:0,lastCharTime:0,accumulatedString:"",testTimer:!1,longPressTimeStart:0,longPressed:!1}},h.reactToPaste===!0&&a.addEventListener("paste",this._handlePaste,h.captureEvents),h.scanButtonKeyCode!==!1&&a.addEventListener("keyup",this._handleKeyUp,h.captureEvents),(h.reactToKeydown===!0||h.scanButtonKeyCode!==!1)&&a.addEventListener("keydown",this._handleKeyDown,h.captureEvents),this},detachFrom:function(a){a.scannerDetectionData.options.reactToPaste&&a.removeEventListener("paste",this._handlePaste),a.scannerDetectionData.options.scanButtonKeyCode!==!1&&a.removeEventListener("keyup",this._handleKeyUp),a.removeEventListener("keydown",this._handleKeyDown),a.scannerDetectionData=void 0},getOptions:function(a){return a.scannerDetectionData.options},setOptions:function(a,h){switch(a.scannerDetectionData.options.reactToPaste){case!0:h.reactToPaste===!1&&a.removeEventListener("paste",this._handlePaste);break;case!1:h.reactToPaste===!0&&a.addEventListener("paste",this._handlePaste);break}switch(a.scannerDetectionData.options.scanButtonKeyCode){case!1:h.scanButtonKeyCode!==!1&&a.addEventListener("keyup",this._handleKeyUp);break;default:h.scanButtonKeyCode===!1&&a.removeEventListener("keyup",this._handleKeyUp);break}return a.scannerDetectionData.options=this._mergeOptions(a.scannerDetectionData.options,h),this._reinitialize(a),this},decodeKeyEvent:function(a){var h=this._getNormalizedKeyNum(a);switch(!0){case(h>=48&&h<=90):case(h>=106&&h<=111):if(a.key!==void 0&&a.key!=="")return a.key;var n=String.fromCharCode(h);switch(a.shiftKey){case!1:n=n.toLowerCase();break;case!0:n=n.toUpperCase();break}return n;case(h>=96&&h<=105):return 0+(h-96)}return""},simulate:function(a,h){return this._reinitialize(a),Array.isArray(h)?h.forEach(function(n){var r={};(typeof n=="object"||typeof n=="function")&&n!==null?r=n:r.keyCode=parseInt(n);var s=new KeyboardEvent("keydown",r);document.dispatchEvent(s)}):this._validateScanCode(a,h),this},_reinitialize:function(a){var h=a.scannerDetectionData.vars;h.firstCharTime=0,h.lastCharTime=0,h.accumulatedString=""},_isFocusOnIgnoredElement:function(a){var h=a.scannerDetectionData.options.ignoreIfFocusOn;if(!h)return!1;var n=document.activeElement;if(Array.isArray(h)){for(var r=0;r<h.length;r++)if(n.matches(h[r])===!0)return!0}else if(n.matches(h))return!0;return!1},_validateScanCode:function(a,h){var n=a.scannerDetectionData,r=n.options,s=n.options.singleScanQty,o=n.vars.firstCharTime,l=n.vars.lastCharTime,f={},p;switch(!0){case h.length<r.minLength:f={message:"Receieved code is shorter then minimal length"};break;case l-o>h.length*r.avgTimeByChar:f={message:"Receieved code was not entered in time"};break;default:return r.onScan.call(a,h,s),p=new CustomEvent("scan",{detail:{scanCode:h,qty:s}}),a.dispatchEvent(p),t._reinitialize(a),!0}return f.scanCode=h,f.scanDuration=l-o,f.avgTimeByChar=r.avgTimeByChar,f.minLength=r.minLength,r.onScanError.call(a,f),p=new CustomEvent("scanError",{detail:f}),a.dispatchEvent(p),t._reinitialize(a),!1},_mergeOptions:function(a,h){var n={},r;for(r in a)Object.prototype.hasOwnProperty.call(a,r)&&(n[r]=a[r]);for(r in h)Object.prototype.hasOwnProperty.call(h,r)&&(n[r]=h[r]);return n},_getNormalizedKeyNum:function(a){return a.which||a.keyCode},_handleKeyDown:function(a){var h=t._getNormalizedKeyNum(a),n=this.scannerDetectionData.options,r=this.scannerDetectionData.vars,s=!1;if(n.onKeyDetect.call(this,h,a)!==!1&&!t._isFocusOnIgnoredElement(this)){if(n.scanButtonKeyCode!==!1&&h==n.scanButtonKeyCode){r.longPressed||(r.longPressTimer=setTimeout(n.onScanButtonLongPress,n.scanButtonLongPressTime,this),r.longPressed=!0);return}switch(!0){case(r.firstCharTime&&n.suffixKeyCodes.indexOf(h)!==-1):a.preventDefault(),a.stopImmediatePropagation(),s=!0;break;case(!r.firstCharTime&&n.prefixKeyCodes.indexOf(h)!==-1):a.preventDefault(),a.stopImmediatePropagation(),s=!1;break;default:var o=n.keyCodeMapper.call(this,a);if(o===null)return;r.accumulatedString+=o,n.preventDefault&&a.preventDefault(),n.stopPropagation&&a.stopImmediatePropagation(),s=!1;break}r.firstCharTime||(r.firstCharTime=Date.now()),r.lastCharTime=Date.now(),r.testTimer&&clearTimeout(r.testTimer),s?(t._validateScanCode(this,r.accumulatedString),r.testTimer=!1):r.testTimer=setTimeout(t._validateScanCode,n.timeBeforeScanTest,this,r.accumulatedString),n.onKeyProcess.call(this,o,a)}},_handlePaste:function(a){var h=this.scannerDetectionData.options,n=this.scannerDetectionData.vars,r=(event.clipboardData||window.clipboardData).getData("text");t._isFocusOnIgnoredElement(this)||(a.preventDefault(),h.stopPropagation&&a.stopImmediatePropagation(),h.onPaste.call(this,r,event),n.firstCharTime=0,n.lastCharTime=0,t._validateScanCode(this,r))},_handleKeyUp:function(a){if(!t._isFocusOnIgnoredElement(this)){var h=t._getNormalizedKeyNum(a);h==this.scannerDetectionData.options.scanButtonKeyCode&&(clearTimeout(this.scannerDetectionData.vars.longPressTimer),this.scannerDetectionData.vars.longPressed=!1)}},isScanInProgressFor:function(a){return a.scannerDetectionData.vars.firstCharTime>0},isAttachedTo:function(a){return a.scannerDetectionData!==void 0}};return t})})(Ji);var fl=Ji.exports;const Zi=cl(fl),dl={id:"scan_input"},Xi=$.defineComponent({__name:"ScanInput",props:{scanHandler:{type:Function}},emits:["scanInstance"],setup(e,{emit:i}){const t=i,a=e;return $.onMounted(()=>{const h=Zi.attachTo(window,{onScan:a.scanHandler});t("scanInstance",h)}),$.onUnmounted(()=>{Zi.detachFrom(window)}),(h,n)=>($.openBlock(),$.createElementBlock("div",dl))}}),pl={class:"column column-left"},gl={class:"column column-right"},eo=Jt($.defineComponent({__name:"SplitColumn",props:{justifyContent:{},alignItems:{}},setup(e){return(i,t)=>($.openBlock(),$.createElementBlock("div",{class:"two-column",style:$.normalizeStyle({justifyContent:i.justifyContent||"space-between",alignItems:i.alignItems||"flex-start"})},[$.createElementVNode("div",pl,[$.renderSlot(i.$slots,"left",{},void 0,!0)]),$.createElementVNode("div",gl,[$.renderSlot(i.$slots,"right",{},void 0,!0)])],4))}}),[["__scopeId","data-v-5d4573e9"]]);var Vr=Object.defineProperty,ml=Object.getOwnPropertyDescriptor,bl=Object.getOwnPropertyNames,yl=Object.prototype.hasOwnProperty,Qe=(e,i)=>()=>(e&&(i=e(e=0)),i),be=(e,i)=>()=>(i||e((i={exports:{}}).exports,i),i.exports),xt=(e,i)=>{for(var t in i)Vr(e,t,{get:i[t],enumerable:!0})},wl=(e,i,t,a)=>{if(i&&typeof i=="object"||typeof i=="function")for(let h of bl(i))!yl.call(e,h)&&h!==t&&Vr(e,h,{get:()=>i[h],enumerable:!(a=ml(i,h))||a.enumerable});return e},Le=e=>wl(Vr({},"__esModule",{value:!0}),e),ae=Qe(()=>{}),Re={};xt(Re,{_debugEnd:()=>An,_debugProcess:()=>Sn,_events:()=>Fn,_eventsCount:()=>Wn,_exiting:()=>hn,_fatalExceptions:()=>_n,_getActiveHandles:()=>ao,_getActiveRequests:()=>so,_kill:()=>fn,_linkedBinding:()=>io,_maxListeners:()=>Dn,_preload_modules:()=>Un,_rawDebug:()=>sn,_startProfilerIdleNotifier:()=>kn,_stopProfilerIdleNotifier:()=>In,_tickCallback:()=>En,abort:()=>Bn,addListener:()=>$n,allowedNodeEnvironmentFlags:()=>yn,arch:()=>zr,argv:()=>Qr,argv0:()=>Ln,assert:()=>lo,binding:()=>en,chdir:()=>nn,config:()=>un,cpuUsage:()=>or,cwd:()=>rn,debugPort:()=>Mn,default:()=>Gn,dlopen:()=>oo,domain:()=>ln,emit:()=>Kn,emitWarning:()=>Xr,env:()=>Yr,execArgv:()=>Gr,execPath:()=>xn,exit:()=>mn,features:()=>wn,hasUncaughtExceptionCaptureCallback:()=>ho,hrtime:()=>pr,kill:()=>gn,listeners:()=>co,memoryUsage:()=>pn,moduleLoadList:()=>an,nextTick:()=>ro,off:()=>qn,on:()=>pt,once:()=>Vn,openStdin:()=>bn,pid:()=>On,platform:()=>Kr,ppid:()=>Rn,prependListener:()=>Yn,prependOnceListener:()=>Qn,reallyExit:()=>cn,release:()=>on,removeAllListeners:()=>zn,removeListener:()=>Hn,resourceUsage:()=>dn,setSourceMapsEnabled:()=>Nn,setUncaughtExceptionCaptureCallback:()=>vn,stderr:()=>Cn,stdin:()=>Pn,stdout:()=>Tn,title:()=>Hr,umask:()=>tn,uptime:()=>uo,version:()=>Jr,versions:()=>Zr});function qr(e){throw new Error("Node.js process "+e+" is not supported by JSPM core outside of Node.js")}function _l(){!Mt||!Lt||(Mt=!1,Lt.length?ut=Lt.concat(ut):ir=-1,ut.length&&to())}function to(){if(!Mt){var e=setTimeout(_l,0);Mt=!0;for(var i=ut.length;i;){for(Lt=ut,ut=[];++ir<i;)Lt&&Lt[ir].run();ir=-1,i=ut.length}Lt=null,Mt=!1,clearTimeout(e)}}function ro(e){var i=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)i[t-1]=arguments[t];ut.push(new no(e,i)),ut.length===1&&!Mt&&setTimeout(to,0)}function no(e,i){this.fun=e,this.array=i}function Xe(){}function io(e){qr("_linkedBinding")}function oo(e){qr("dlopen")}function so(){return[]}function ao(){return[]}function lo(e,i){if(!e)throw new Error(i||"assertion error")}function ho(){return!1}function uo(){return gt.now()/1e3}function pr(e){var i=Math.floor((Date.now()-gt.now())*.001),t=gt.now()*.001,a=Math.floor(t)+i,h=Math.floor(t%1*1e9);return e&&(a=a-e[0],h=h-e[1],h<0&&(a--,h+=gr)),[a,h]}function pt(){return Gn}function co(e){return[]}var ut,Mt,Lt,ir,Hr,zr,Kr,Yr,Qr,Gr,Jr,Zr,Xr,en,tn,rn,nn,on,sn,an,ln,hn,un,cn,fn,or,dn,pn,gn,mn,bn,yn,wn,_n,vn,En,Sn,An,kn,In,Tn,Cn,Pn,Bn,On,Rn,xn,Mn,Ln,Un,Nn,gt,jn,gr,Dn,Fn,Wn,$n,Vn,qn,Hn,zn,Kn,Yn,Qn,Gn,vl=Qe(()=>{ae(),he(),le(),ut=[],Mt=!1,ir=-1,no.prototype.run=function(){this.fun.apply(null,this.array)},Hr="browser",zr="x64",Kr="browser",Yr={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},Qr=["/usr/bin/node"],Gr=[],Jr="v16.8.0",Zr={},Xr=function(e,i){console.warn((i?i+": ":"")+e)},en=function(e){qr("binding")},tn=function(e){return 0},rn=function(){return"/"},nn=function(e){},on={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},sn=Xe,an=[],ln={},hn=!1,un={},cn=Xe,fn=Xe,or=function(){return{}},dn=or,pn=or,gn=Xe,mn=Xe,bn=Xe,yn={},wn={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},_n=Xe,vn=Xe,En=Xe,Sn=Xe,An=Xe,kn=Xe,In=Xe,Tn=void 0,Cn=void 0,Pn=void 0,Bn=Xe,On=2,Rn=1,xn="/bin/usr/node",Mn=9229,Ln="node",Un=[],Nn=Xe,gt={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0},gt.now===void 0&&(jn=Date.now(),gt.timing&>.timing.navigationStart&&(jn=gt.timing.navigationStart),gt.now=()=>Date.now()-jn),gr=1e9,pr.bigint=function(e){var i=pr(e);return typeof BigInt>"u"?i[0]*gr+i[1]:BigInt(i[0]*gr)+BigInt(i[1])},Dn=10,Fn={},Wn=0,$n=pt,Vn=pt,qn=pt,Hn=pt,zn=pt,Kn=Xe,Yn=pt,Qn=pt,Gn={version:Jr,versions:Zr,arch:zr,platform:Kr,release:on,_rawDebug:sn,moduleLoadList:an,binding:en,_linkedBinding:io,_events:Fn,_eventsCount:Wn,_maxListeners:Dn,on:pt,addListener:$n,once:Vn,off:qn,removeListener:Hn,removeAllListeners:zn,emit:Kn,prependListener:Yn,prependOnceListener:Qn,listeners:co,domain:ln,_exiting:hn,config:un,dlopen:oo,uptime:uo,_getActiveRequests:so,_getActiveHandles:ao,reallyExit:cn,_kill:fn,cpuUsage:or,resourceUsage:dn,memoryUsage:pn,kill:gn,exit:mn,openStdin:bn,allowedNodeEnvironmentFlags:yn,assert:lo,features:wn,_fatalExceptions:_n,setUncaughtExceptionCaptureCallback:vn,hasUncaughtExceptionCaptureCallback:ho,emitWarning:Xr,nextTick:ro,_tickCallback:En,_debugProcess:Sn,_debugEnd:An,_startProfilerIdleNotifier:kn,_stopProfilerIdleNotifier:In,stdout:Tn,stdin:Pn,stderr:Cn,abort:Bn,umask:tn,chdir:nn,cwd:rn,env:Yr,title:Hr,argv:Qr,execArgv:Gr,pid:On,ppid:Rn,execPath:xn,debugPort:Mn,hrtime:pr,argv0:Ln,_preload_modules:Un,setSourceMapsEnabled:Nn}}),le=Qe(()=>{vl()}),Ge={};xt(Ge,{Buffer:()=>mr,INSPECT_MAX_BYTES:()=>fo,default:()=>mt,kMaxLength:()=>po});function El(){if(Jn)return Zt;Jn=!0,Zt.byteLength=s,Zt.toByteArray=l,Zt.fromByteArray=g;for(var e=[],i=[],t=typeof Uint8Array<"u"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,n=a.length;h<n;++h)e[h]=a[h],i[a.charCodeAt(h)]=h;i[45]=62,i[95]=63;function r(m){var b=m.length;if(b%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var y=m.indexOf("=");y===-1&&(y=b);var A=y===b?0:4-y%4;return[y,A]}function s(m){var b=r(m),y=b[0],A=b[1];return(y+A)*3/4-A}function o(m,b,y){return(b+y)*3/4-y}function l(m){var b,y=r(m),A=y[0],M=y[1],k=new t(o(m,A,M)),v=0,U=M>0?A-4:A,j;for(j=0;j<U;j+=4)b=i[m.charCodeAt(j)]<<18|i[m.charCodeAt(j+1)]<<12|i[m.charCodeAt(j+2)]<<6|i[m.charCodeAt(j+3)],k[v++]=b>>16&255,k[v++]=b>>8&255,k[v++]=b&255;return M===2&&(b=i[m.charCodeAt(j)]<<2|i[m.charCodeAt(j+1)]>>4,k[v++]=b&255),M===1&&(b=i[m.charCodeAt(j)]<<10|i[m.charCodeAt(j+1)]<<4|i[m.charCodeAt(j+2)]>>2,k[v++]=b>>8&255,k[v++]=b&255),k}function f(m){return e[m>>18&63]+e[m>>12&63]+e[m>>6&63]+e[m&63]}function p(m,b,y){for(var A,M=[],k=b;k<y;k+=3)A=(m[k]<<16&16711680)+(m[k+1]<<8&65280)+(m[k+2]&255),M.push(f(A));return M.join("")}function g(m){for(var b,y=m.length,A=y%3,M=[],k=16383,v=0,U=y-A;v<U;v+=k)M.push(p(m,v,v+k>U?U:v+k));return A===1?(b=m[y-1],M.push(e[b>>2]+e[b<<4&63]+"==")):A===2&&(b=(m[y-2]<<8)+m[y-1],M.push(e[b>>10]+e[b>>4&63]+e[b<<2&63]+"=")),M.join("")}return Zt}function Sl(){return Zn?sr:(Zn=!0,sr.read=function(e,i,t,a,h){var n,r,s=h*8-a-1,o=(1<<s)-1,l=o>>1,f=-7,p=t?h-1:0,g=t?-1:1,m=e[i+p];for(p+=g,n=m&(1<<-f)-1,m>>=-f,f+=s;f>0;n=n*256+e[i+p],p+=g,f-=8);for(r=n&(1<<-f)-1,n>>=-f,f+=a;f>0;r=r*256+e[i+p],p+=g,f-=8);if(n===0)n=1-l;else{if(n===o)return r?NaN:(m?-1:1)*(1/0);r=r+Math.pow(2,a),n=n-l}return(m?-1:1)*r*Math.pow(2,n-a)},sr.write=function(e,i,t,a,h,n){var r,s,o,l=n*8-h-1,f=(1<<l)-1,p=f>>1,g=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=a?0:n-1,b=a?1:-1,y=i<0||i===0&&1/i<0?1:0;for(i=Math.abs(i),isNaN(i)||i===1/0?(s=isNaN(i)?1:0,r=f):(r=Math.floor(Math.log(i)/Math.LN2),i*(o=Math.pow(2,-r))<1&&(r--,o*=2),r+p>=1?i+=g/o:i+=g*Math.pow(2,1-p),i*o>=2&&(r++,o/=2),r+p>=f?(s=0,r=f):r+p>=1?(s=(i*o-1)*Math.pow(2,h),r=r+p):(s=i*Math.pow(2,p-1)*Math.pow(2,h),r=0));h>=8;e[t+m]=s&255,m+=b,s/=256,h-=8);for(r=r<<h|s,l+=h;l>0;e[t+m]=r&255,m+=b,r/=256,l-=8);e[t+m-b]|=y*128},sr)}function Al(){if(Xn)return Ct;Xn=!0;let e=El(),i=Sl(),t=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Ct.Buffer=r,Ct.SlowBuffer=M,Ct.INSPECT_MAX_BYTES=50;let a=2147483647;Ct.kMaxLength=a,r.TYPED_ARRAY_SUPPORT=h(),!r.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function h(){try{let c=new Uint8Array(1),u={foo:function(){return 42}};return Object.setPrototypeOf(u,Uint8Array.prototype),Object.setPrototypeOf(c,u),c.foo()===42}catch{return!1}}Object.defineProperty(r.prototype,"parent",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.buffer}}),Object.defineProperty(r.prototype,"offset",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.byteOffset}});function n(c){if(c>a)throw new RangeError('The value "'+c+'" is invalid for option "size"');let u=new Uint8Array(c);return Object.setPrototypeOf(u,r.prototype),u}function r(c,u,d){if(typeof c=="number"){if(typeof u=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return f(c)}return s(c,u,d)}r.poolSize=8192;function s(c,u,d){if(typeof c=="string")return p(c,u);if(ArrayBuffer.isView(c))return m(c);if(c==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof c);if(K(c,ArrayBuffer)||c&&K(c.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(K(c,SharedArrayBuffer)||c&&K(c.buffer,SharedArrayBuffer)))return b(c,u,d);if(typeof c=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let w=c.valueOf&&c.valueOf();if(w!=null&&w!==c)return r.from(w,u,d);let I=y(c);if(I)return I;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof c[Symbol.toPrimitive]=="function")return r.from(c[Symbol.toPrimitive]("string"),u,d);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof c)}r.from=function(c,u,d){return s(c,u,d)},Object.setPrototypeOf(r.prototype,Uint8Array.prototype),Object.setPrototypeOf(r,Uint8Array);function o(c){if(typeof c!="number")throw new TypeError('"size" argument must be of type number');if(c<0)throw new RangeError('The value "'+c+'" is invalid for option "size"')}function l(c,u,d){return o(c),c<=0?n(c):u!==void 0?typeof d=="string"?n(c).fill(u,d):n(c).fill(u):n(c)}r.alloc=function(c,u,d){return l(c,u,d)};function f(c){return o(c),n(c<0?0:A(c)|0)}r.allocUnsafe=function(c){return f(c)},r.allocUnsafeSlow=function(c){return f(c)};function p(c,u){if((typeof u!="string"||u==="")&&(u="utf8"),!r.isEncoding(u))throw new TypeError("Unknown encoding: "+u);let d=k(c,u)|0,w=n(d),I=w.write(c,u);return I!==d&&(w=w.slice(0,I)),w}function g(c){let u=c.length<0?0:A(c.length)|0,d=n(u);for(let w=0;w<u;w+=1)d[w]=c[w]&255;return d}function m(c){if(K(c,Uint8Array)){let u=new Uint8Array(c);return b(u.buffer,u.byteOffset,u.byteLength)}return g(c)}function b(c,u,d){if(u<0||c.byteLength<u)throw new RangeError('"offset" is outside of buffer bounds');if(c.byteLength<u+(d||0))throw new RangeError('"length" is outside of buffer bounds');let w;return u===void 0&&d===void 0?w=new Uint8Array(c):d===void 0?w=new Uint8Array(c,u):w=new Uint8Array(c,u,d),Object.setPrototypeOf(w,r.prototype),w}function y(c){if(r.isBuffer(c)){let u=A(c.length)|0,d=n(u);return d.length===0||c.copy(d,0,0,u),d}if(c.length!==void 0)return typeof c.length!="number"||P(c.length)?n(0):g(c);if(c.type==="Buffer"&&Array.isArray(c.data))return g(c.data)}function A(c){if(c>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return c|0}function M(c){return+c!=c&&(c=0),r.alloc(+c)}r.isBuffer=function(c){return c!=null&&c._isBuffer===!0&&c!==r.prototype},r.compare=function(c,u){if(K(c,Uint8Array)&&(c=r.from(c,c.offset,c.byteLength)),K(u,Uint8Array)&&(u=r.from(u,u.offset,u.byteLength)),!r.isBuffer(c)||!r.isBuffer(u))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(c===u)return 0;let d=c.length,w=u.length;for(let I=0,W=Math.min(d,w);I<W;++I)if(c[I]!==u[I]){d=c[I],w=u[I];break}return d<w?-1:w<d?1:0},r.isEncoding=function(c){switch(String(c).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}},r.concat=function(c,u){if(!Array.isArray(c))throw new TypeError('"list" argument must be an Array of Buffers');if(c.length===0)return r.alloc(0);let d;if(u===void 0)for(u=0,d=0;d<c.length;++d)u+=c[d].length;let w=r.allocUnsafe(u),I=0;for(d=0;d<c.length;++d){let W=c[d];if(K(W,Uint8Array))I+W.length>w.length?(r.isBuffer(W)||(W=r.from(W)),W.copy(w,I)):Uint8Array.prototype.set.call(w,W,I);else if(r.isBuffer(W))W.copy(w,I);else throw new TypeError('"list" argument must be an Array of Buffers');I+=W.length}return w};function k(c,u){if(r.isBuffer(c))return c.length;if(ArrayBuffer.isView(c)||K(c,ArrayBuffer))return c.byteLength;if(typeof c!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof c);let d=c.length,w=arguments.length>2&&arguments[2]===!0;if(!w&&d===0)return 0;let I=!1;for(;;)switch(u){case"ascii":case"latin1":case"binary":return d;case"utf8":case"utf-8":return D(c).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return d*2;case"hex":return d>>>1;case"base64":return Z(c).length;default:if(I)return w?-1:D(c).length;u=(""+u).toLowerCase(),I=!0}}r.byteLength=k;function v(c,u,d){let w=!1;if((u===void 0||u<0)&&(u=0),u>this.length||((d===void 0||d>this.length)&&(d=this.length),d<=0)||(d>>>=0,u>>>=0,d<=u))return"";for(c||(c="utf8");;)switch(c){case"hex":return H(this,u,d);case"utf8":case"utf-8":return z(this,u,d);case"ascii":return me(this,u,d);case"latin1":case"binary":return se(this,u,d);case"base64":return S(this,u,d);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ye(this,u,d);default:if(w)throw new TypeError("Unknown encoding: "+c);c=(c+"").toLowerCase(),w=!0}}r.prototype._isBuffer=!0;function U(c,u,d){let w=c[u];c[u]=c[d],c[d]=w}r.prototype.swap16=function(){let c=this.length;if(c%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let u=0;u<c;u+=2)U(this,u,u+1);return this},r.prototype.swap32=function(){let c=this.length;if(c%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let u=0;u<c;u+=4)U(this,u,u+3),U(this,u+1,u+2);return this},r.prototype.swap64=function(){let c=this.length;if(c%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let u=0;u<c;u+=8)U(this,u,u+7),U(this,u+1,u+6),U(this,u+2,u+5),U(this,u+3,u+4);return this},r.prototype.toString=function(){let c=this.length;return c===0?"":arguments.length===0?z(this,0,c):v.apply(this,arguments)},r.prototype.toLocaleString=r.prototype.toString,r.prototype.equals=function(c){if(!r.isBuffer(c))throw new TypeError("Argument must be a Buffer");return this===c?!0:r.compare(this,c)===0},r.prototype.inspect=function(){let c="",u=Ct.INSPECT_MAX_BYTES;return c=this.toString("hex",0,u).replace(/(.{2})/g,"$1 ").trim(),this.length>u&&(c+=" ... "),"<Buffer "+c+">"},t&&(r.prototype[t]=r.prototype.inspect),r.prototype.compare=function(c,u,d,w,I){if(K(c,Uint8Array)&&(c=r.from(c,c.offset,c.byteLength)),!r.isBuffer(c))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof c);if(u===void 0&&(u=0),d===void 0&&(d=c?c.length:0),w===void 0&&(w=0),I===void 0&&(I=this.length),u<0||d>c.length||w<0||I>this.length)throw new RangeError("out of range index");if(w>=I&&u>=d)return 0;if(w>=I)return-1;if(u>=d)return 1;if(u>>>=0,d>>>=0,w>>>=0,I>>>=0,this===c)return 0;let W=I-w,ee=d-u,Ie=Math.min(W,ee),Pe=this.slice(w,I),Be=c.slice(u,d);for(let Ae=0;Ae<Ie;++Ae)if(Pe[Ae]!==Be[Ae]){W=Pe[Ae],ee=Be[Ae];break}return W<ee?-1:ee<W?1:0};function j(c,u,d,w,I){if(c.length===0)return-1;if(typeof d=="string"?(w=d,d=0):d>2147483647?d=2147483647:d<-2147483648&&(d=-2147483648),d=+d,P(d)&&(d=I?0:c.length-1),d<0&&(d=c.length+d),d>=c.length){if(I)return-1;d=c.length-1}else if(d<0)if(I)d=0;else return-1;if(typeof u=="string"&&(u=r.from(u,w)),r.isBuffer(u))return u.length===0?-1:C(c,u,d,w,I);if(typeof u=="number")return u=u&255,typeof Uint8Array.prototype.indexOf=="function"?I?Uint8Array.prototype.indexOf.call(c,u,d):Uint8Array.prototype.lastIndexOf.call(c,u,d):C(c,[u],d,w,I);throw new TypeError("val must be string, number or Buffer")}function C(c,u,d,w,I){let W=1,ee=c.length,Ie=u.length;if(w!==void 0&&(w=String(w).toLowerCase(),w==="ucs2"||w==="ucs-2"||w==="utf16le"||w==="utf-16le")){if(c.length<2||u.length<2)return-1;W=2,ee/=2,Ie/=2,d/=2}function Pe(Ae,Ce){return W===1?Ae[Ce]:Ae.readUInt16BE(Ce*W)}let Be;if(I){let Ae=-1;for(Be=d;Be<ee;Be++)if(Pe(c,Be)===Pe(u,Ae===-1?0:Be-Ae)){if(Ae===-1&&(Ae=Be),Be-Ae+1===Ie)return Ae*W}else Ae!==-1&&(Be-=Be-Ae),Ae=-1}else for(d+Ie>ee&&(d=ee-Ie),Be=d;Be>=0;Be--){let Ae=!0;for(let Ce=0;Ce<Ie;Ce++)if(Pe(c,Be+Ce)!==Pe(u,Ce)){Ae=!1;break}if(Ae)return Be}return-1}r.prototype.includes=function(c,u,d){return this.indexOf(c,u,d)!==-1},r.prototype.indexOf=function(c,u,d){return j(this,c,u,d,!0)},r.prototype.lastIndexOf=function(c,u,d){return j(this,c,u,d,!1)};function T(c,u,d,w){d=Number(d)||0;let I=c.length-d;w?(w=Number(w),w>I&&(w=I)):w=I;let W=u.length;w>W/2&&(w=W/2);let ee;for(ee=0;ee<w;++ee){let Ie=parseInt(u.substr(ee*2,2),16);if(P(Ie))return ee;c[d+ee]=Ie}return ee}function x(c,u,d,w){return L(D(u,c.length-d),c,d,w)}function V(c,u,d,w){return L(F(u),c,d,w)}function J(c,u,d,w){return L(Z(u),c,d,w)}function ne(c,u,d,w){return L(ie(u,c.length-d),c,d,w)}r.prototype.write=function(c,u,d,w){if(u===void 0)w="utf8",d=this.length,u=0;else if(d===void 0&&typeof u=="string")w=u,d=this.length,u=0;else if(isFinite(u))u=u>>>0,isFinite(d)?(d=d>>>0,w===void 0&&(w="utf8")):(w=d,d=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let I=this.length-u;if((d===void 0||d>I)&&(d=I),c.length>0&&(d<0||u<0)||u>this.length)throw new RangeError("Attempt to write outside buffer bounds");w||(w="utf8");let W=!1;for(;;)switch(w){case"hex":return T(this,c,u,d);case"utf8":case"utf-8":return x(this,c,u,d);case"ascii":case"latin1":case"binary":return V(this,c,u,d);case"base64":return J(this,c,u,d);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ne(this,c,u,d);default:if(W)throw new TypeError("Unknown encoding: "+w);w=(""+w).toLowerCase(),W=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function S(c,u,d){return u===0&&d===c.length?e.fromByteArray(c):e.fromByteArray(c.slice(u,d))}function z(c,u,d){d=Math.min(c.length,d);let w=[],I=u;for(;I<d;){let W=c[I],ee=null,Ie=W>239?4:W>223?3:W>191?2:1;if(I+Ie<=d){let Pe,Be,Ae,Ce;switch(Ie){case 1:W<128&&(ee=W);break;case 2:Pe=c[I+1],(Pe&192)===128&&(Ce=(W&31)<<6|Pe&63,Ce>127&&(ee=Ce));break;case 3:Pe=c[I+1],Be=c[I+2],(Pe&192)===128&&(Be&192)===128&&(Ce=(W&15)<<12|(Pe&63)<<6|Be&63,Ce>2047&&(Ce<55296||Ce>57343)&&(ee=Ce));break;case 4:Pe=c[I+1],Be=c[I+2],Ae=c[I+3],(Pe&192)===128&&(Be&192)===128&&(Ae&192)===128&&(Ce=(W&15)<<18|(Pe&63)<<12|(Be&63)<<6|Ae&63,Ce>65535&&Ce<1114112&&(ee=Ce))}}ee===null?(ee=65533,Ie=1):ee>65535&&(ee-=65536,w.push(ee>>>10&1023|55296),ee=56320|ee&1023),w.push(ee),I+=Ie}return Q(w)}let re=4096;function Q(c){let u=c.length;if(u<=re)return String.fromCharCode.apply(String,c);let d="",w=0;for(;w<u;)d+=String.fromCharCode.apply(String,c.slice(w,w+=re));return d}function me(c,u,d){let w="";d=Math.min(c.length,d);for(let I=u;I<d;++I)w+=String.fromCharCode(c[I]&127);return w}function se(c,u,d){let w="";d=Math.min(c.length,d);for(let I=u;I<d;++I)w+=String.fromCharCode(c[I]);return w}function H(c,u,d){let w=c.length;(!u||u<0)&&(u=0),(!d||d<0||d>w)&&(d=w);let I="";for(let W=u;W<d;++W)I+=N[c[W]];return I}function ye(c,u,d){let w=c.slice(u,d),I="";for(let W=0;W<w.length-1;W+=2)I+=String.fromCharCode(w[W]+w[W+1]*256);return I}r.prototype.slice=function(c,u){let d=this.length;c=~~c,u=u===void 0?d:~~u,c<0?(c+=d,c<0&&(c=0)):c>d&&(c=d),u<0?(u+=d,u<0&&(u=0)):u>d&&(u=d),u<c&&(u=c);let w=this.subarray(c,u);return Object.setPrototypeOf(w,r.prototype),w};function oe(c,u,d){if(c%1!==0||c<0)throw new RangeError("offset is not uint");if(c+u>d)throw new RangeError("Trying to access beyond buffer length")}r.prototype.readUintLE=r.prototype.readUIntLE=function(c,u,d){c=c>>>0,u=u>>>0,d||oe(c,u,this.length);let w=this[c],I=1,W=0;for(;++W<u&&(I*=256);)w+=this[c+W]*I;return w},r.prototype.readUintBE=r.prototype.readUIntBE=function(c,u,d){c=c>>>0,u=u>>>0,d||oe(c,u,this.length);let w=this[c+--u],I=1;for(;u>0&&(I*=256);)w+=this[c+--u]*I;return w},r.prototype.readUint8=r.prototype.readUInt8=function(c,u){return c=c>>>0,u||oe(c,1,this.length),this[c]},r.prototype.readUint16LE=r.prototype.readUInt16LE=function(c,u){return c=c>>>0,u||oe(c,2,this.length),this[c]|this[c+1]<<8},r.prototype.readUint16BE=r.prototype.readUInt16BE=function(c,u){return c=c>>>0,u||oe(c,2,this.length),this[c]<<8|this[c+1]},r.prototype.readUint32LE=r.prototype.readUInt32LE=function(c,u){return c=c>>>0,u||oe(c,4,this.length),(this[c]|this[c+1]<<8|this[c+2]<<16)+this[c+3]*16777216},r.prototype.readUint32BE=r.prototype.readUInt32BE=function(c,u){return c=c>>>0,u||oe(c,4,this.length),this[c]*16777216+(this[c+1]<<16|this[c+2]<<8|this[c+3])},r.prototype.readBigUInt64LE=q(function(c){c=c>>>0,X(c,"offset");let u=this[c],d=this[c+7];(u===void 0||d===void 0)&&we(c,this.length-8);let w=u+this[++c]*2**8+this[++c]*2**16+this[++c]*2**24,I=this[++c]+this[++c]*2**8+this[++c]*2**16+d*2**24;return BigInt(w)+(BigInt(I)<<BigInt(32))}),r.prototype.readBigUInt64BE=q(function(c){c=c>>>0,X(c,"offset");let u=this[c],d=this[c+7];(u===void 0||d===void 0)&&we(c,this.length-8);let w=u*2**24+this[++c]*2**16+this[++c]*2**8+this[++c],I=this[++c]*2**24+this[++c]*2**16+this[++c]*2**8+d;return(BigInt(w)<<BigInt(32))+BigInt(I)}),r.prototype.readIntLE=function(c,u,d){c=c>>>0,u=u>>>0,d||oe(c,u,this.length);let w=this[c],I=1,W=0;for(;++W<u&&(I*=256);)w+=this[c+W]*I;return I*=128,w>=I&&(w-=Math.pow(2,8*u)),w},r.prototype.readIntBE=function(c,u,d){c=c>>>0,u=u>>>0,d||oe(c,u,this.length);let w=u,I=1,W=this[c+--w];for(;w>0&&(I*=256);)W+=this[c+--w]*I;return I*=128,W>=I&&(W-=Math.pow(2,8*u)),W},r.prototype.readInt8=function(c,u){return c=c>>>0,u||oe(c,1,this.length),this[c]&128?(255-this[c]+1)*-1:this[c]},r.prototype.readInt16LE=function(c,u){c=c>>>0,u||oe(c,2,this.length);let d=this[c]|this[c+1]<<8;return d&32768?d|4294901760:d},r.prototype.readInt16BE=function(c,u){c=c>>>0,u||oe(c,2,this.length);let d=this[c+1]|this[c]<<8;return d&32768?d|4294901760:d},r.prototype.readInt32LE=function(c,u){return c=c>>>0,u||oe(c,4,this.length),this[c]|this[c+1]<<8|this[c+2]<<16|this[c+3]<<24},r.prototype.readInt32BE=function(c,u){return c=c>>>0,u||oe(c,4,this.length),this[c]<<24|this[c+1]<<16|this[c+2]<<8|this[c+3]},r.prototype.readBigInt64LE=q(function(c){c=c>>>0,X(c,"offset");let u=this[c],d=this[c+7];(u===void 0||d===void 0)&&we(c,this.length-8);let w=this[c+4]+this[c+5]*2**8+this[c+6]*2**16+(d<<24);return(BigInt(w)<<BigInt(32))+BigInt(u+this[++c]*2**8+this[++c]*2**16+this[++c]*2**24)}),r.prototype.readBigInt64BE=q(function(c){c=c>>>0,X(c,"offset");let u=this[c],d=this[c+7];(u===void 0||d===void 0)&&we(c,this.length-8);let w=(u<<24)+this[++c]*2**16+this[++c]*2**8+this[++c];return(BigInt(w)<<BigInt(32))+BigInt(this[++c]*2**24+this[++c]*2**16+this[++c]*2**8+d)}),r.prototype.readFloatLE=function(c,u){return c=c>>>0,u||oe(c,4,this.length),i.read(this,c,!0,23,4)},r.prototype.readFloatBE=function(c,u){return c=c>>>0,u||oe(c,4,this.length),i.read(this,c,!1,23,4)},r.prototype.readDoubleLE=function(c,u){return c=c>>>0,u||oe(c,8,this.length),i.read(this,c,!0,52,8)},r.prototype.readDoubleBE=function(c,u){return c=c>>>0,u||oe(c,8,this.length),i.read(this,c,!1,52,8)};function _e(c,u,d,w,I,W){if(!r.isBuffer(c))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>I||u<W)throw new RangeError('"value" argument is out of bounds');if(d+w>c.length)throw new RangeError("Index out of range")}r.prototype.writeUintLE=r.prototype.writeUIntLE=function(c,u,d,w){if(c=+c,u=u>>>0,d=d>>>0,!w){let ee=Math.pow(2,8*d)-1;_e(this,c,u,d,ee,0)}let I=1,W=0;for(this[u]=c&255;++W<d&&(I*=256);)this[u+W]=c/I&255;return u+d},r.prototype.writeUintBE=r.prototype.writeUIntBE=function(c,u,d,w){if(c=+c,u=u>>>0,d=d>>>0,!w){let ee=Math.pow(2,8*d)-1;_e(this,c,u,d,ee,0)}let I=d-1,W=1;for(this[u+I]=c&255;--I>=0&&(W*=256);)this[u+I]=c/W&255;return u+d},r.prototype.writeUint8=r.prototype.writeUInt8=function(c,u,d){return c=+c,u=u>>>0,d||_e(this,c,u,1,255,0),this[u]=c&255,u+1},r.prototype.writeUint16LE=r.prototype.writeUInt16LE=function(c,u,d){return c=+c,u=u>>>0,d||_e(this,c,u,2,65535,0),this[u]=c&255,this[u+1]=c>>>8,u+2},r.prototype.writeUint16BE=r.prototype.writeUInt16BE=function(c,u,d){return c=+c,u=u>>>0,d||_e(this,c,u,2,65535,0),this[u]=c>>>8,this[u+1]=c&255,u+2},r.prototype.writeUint32LE=r.prototype.writeUInt32LE=function(c,u,d){return c=+c,u=u>>>0,d||_e(this,c,u,4,4294967295,0),this[u+3]=c>>>24,this[u+2]=c>>>16,this[u+1]=c>>>8,this[u]=c&255,u+4},r.prototype.writeUint32BE=r.prototype.writeUInt32BE=function(c,u,d){return c=+c,u=u>>>0,d||_e(this,c,u,4,4294967295,0),this[u]=c>>>24,this[u+1]=c>>>16,this[u+2]=c>>>8,this[u+3]=c&255,u+4};function _(c,u,d,w,I){te(u,w,I,c,d,7);let W=Number(u&BigInt(4294967295));c[d++]=W,W=W>>8,c[d++]=W,W=W>>8,c[d++]=W,W=W>>8,c[d++]=W;let ee=Number(u>>BigInt(32)&BigInt(4294967295));return c[d++]=ee,ee=ee>>8,c[d++]=ee,ee=ee>>8,c[d++]=ee,ee=ee>>8,c[d++]=ee,d}function G(c,u,d,w,I){te(u,w,I,c,d,7);let W=Number(u&BigInt(4294967295));c[d+7]=W,W=W>>8,c[d+6]=W,W=W>>8,c[d+5]=W,W=W>>8,c[d+4]=W;let ee=Number(u>>BigInt(32)&BigInt(4294967295));return c[d+3]=ee,ee=ee>>8,c[d+2]=ee,ee=ee>>8,c[d+1]=ee,ee=ee>>8,c[d]=ee,d+8}r.prototype.writeBigUInt64LE=q(function(c,u=0){return _(this,c,u,BigInt(0),BigInt("0xffffffffffffffff"))}),r.prototype.writeBigUInt64BE=q(function(c,u=0){return G(this,c,u,BigInt(0),BigInt("0xffffffffffffffff"))}),r.prototype.writeIntLE=function(c,u,d,w){if(c=+c,u=u>>>0,!w){let Ie=Math.pow(2,8*d-1);_e(this,c,u,d,Ie-1,-Ie)}let I=0,W=1,ee=0;for(this[u]=c&255;++I<d&&(W*=256);)c<0&&ee===0&&this[u+I-1]!==0&&(ee=1),this[u+I]=(c/W>>0)-ee&255;return u+d},r.prototype.writeIntBE=function(c,u,d,w){if(c=+c,u=u>>>0,!w){let Ie=Math.pow(2,8*d-1);_e(this,c,u,d,Ie-1,-Ie)}let I=d-1,W=1,ee=0;for(this[u+I]=c&255;--I>=0&&(W*=256);)c<0&&ee===0&&this[u+I+1]!==0&&(ee=1),this[u+I]=(c/W>>0)-ee&255;return u+d},r.prototype.writeInt8=function(c,u,d){return c=+c,u=u>>>0,d||_e(this,c,u,1,127,-128),c<0&&(c=255+c+1),this[u]=c&255,u+1},r.prototype.writeInt16LE=function(c,u,d){return c=+c,u=u>>>0,d||_e(this,c,u,2,32767,-32768),this[u]=c&255,this[u+1]=c>>>8,u+2},r.prototype.writeInt16BE=function(c,u,d){return c=+c,u=u>>>0,d||_e(this,c,u,2,32767,-32768),this[u]=c>>>8,this[u+1]=c&255,u+2},r.prototype.writeInt32LE=function(c,u,d){return c=+c,u=u>>>0,d||_e(this,c,u,4,2147483647,-2147483648),this[u]=c&255,this[u+1]=c>>>8,this[u+2]=c>>>16,this[u+3]=c>>>24,u+4},r.prototype.writeInt32BE=function(c,u,d){return c=+c,u=u>>>0,d||_e(this,c,u,4,2147483647,-2147483648),c<0&&(c=4294967295+c+1),this[u]=c>>>24,this[u+1]=c>>>16,this[u+2]=c>>>8,this[u+3]=c&255,u+4},r.prototype.writeBigInt64LE=q(function(c,u=0){return _(this,c,u,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),r.prototype.writeBigInt64BE=q(function(c,u=0){return G(this,c,u,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function de(c,u,d,w,I,W){if(d+w>c.length)throw new RangeError("Index out of range");if(d<0)throw new RangeError("Index out of range")}function ve(c,u,d,w,I){return u=+u,d=d>>>0,I||de(c,u,d,4),i.write(c,u,d,w,23,4),d+4}r.prototype.writeFloatLE=function(c,u,d){return ve(this,c,u,!0,d)},r.prototype.writeFloatBE=function(c,u,d){return ve(this,c,u,!1,d)};function ce(c,u,d,w,I){return u=+u,d=d>>>0,I||de(c,u,d,8),i.write(c,u,d,w,52,8),d+8}r.prototype.writeDoubleLE=function(c,u,d){return ce(this,c,u,!0,d)},r.prototype.writeDoubleBE=function(c,u,d){return ce(this,c,u,!1,d)},r.prototype.copy=function(c,u,d,w){if(!r.isBuffer(c))throw new TypeError("argument should be a Buffer");if(d||(d=0),!w&&w!==0&&(w=this.length),u>=c.length&&(u=c.length),u||(u=0),w>0&&w<d&&(w=d),w===d||c.length===0||this.length===0)return 0;if(u<0)throw new RangeError("targetStart out of bounds");if(d<0||d>=this.length)throw new RangeError("Index out of range");if(w<0)throw new RangeError("sourceEnd out of bounds");w>this.length&&(w=this.length),c.length-u<w-d&&(w=c.length-u+d);let I=w-d;return this===c&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(u,d,w):Uint8Array.prototype.set.call(c,this.subarray(d,w),u),I},r.prototype.fill=function(c,u,d,w){if(typeof c=="string"){if(typeof u=="string"?(w=u,u=0,d=this.length):typeof d=="string"&&(w=d,d=this.length),w!==void 0&&typeof w!="string")throw new TypeError("encoding must be a string");if(typeof w=="string"&&!r.isEncoding(w))throw new TypeError("Unknown encoding: "+w);if(c.length===1){let W=c.charCodeAt(0);(w==="utf8"&&W<128||w==="latin1")&&(c=W)}}else typeof c=="number"?c=c&255:typeof c=="boolean"&&(c=Number(c));if(u<0||this.length<u||this.length<d)throw new RangeError("Out of range index");if(d<=u)return this;u=u>>>0,d=d===void 0?this.length:d>>>0,c||(c=0);let I;if(typeof c=="number")for(I=u;I<d;++I)this[I]=c;else{let W=r.isBuffer(c)?c:r.from(c,w),ee=W.length;if(ee===0)throw new TypeError('The value "'+c+'" is invalid for argument "value"');for(I=0;I<d-u;++I)this[I+u]=W[I%ee]}return this};let R={};function E(c,u,d){R[c]=class extends d{constructor(){super(),Object.defineProperty(this,"message",{value:u.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${c}]`,this.stack,delete this.name}get code(){return c}set code(w){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:w,writable:!0})}toString(){return`${this.name} [${c}]: ${this.message}`}}}E("ERR_BUFFER_OUT_OF_BOUNDS",function(c){return c?`${c} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),E("ERR_INVALID_ARG_TYPE",function(c,u){return`The "${c}" argument must be of type number. Received type ${typeof u}`},TypeError),E("ERR_OUT_OF_RANGE",function(c,u,d){let w=`The value of "${c}" is out of range.`,I=d;return Number.isInteger(d)&&Math.abs(d)>2**32?I=Y(String(d)):typeof d=="bigint"&&(I=String(d),(d>BigInt(2)**BigInt(32)||d<-(BigInt(2)**BigInt(32)))&&(I=Y(I)),I+="n"),w+=` It must be ${u}. Received ${I}`,w},RangeError);function Y(c){let u="",d=c.length,w=c[0]==="-"?1:0;for(;d>=w+4;d-=3)u=`_${c.slice(d-3,d)}${u}`;return`${c.slice(0,d)}${u}`}function fe(c,u,d){X(u,"offset"),(c[u]===void 0||c[u+d]===void 0)&&we(u,c.length-(d+1))}function te(c,u,d,w,I,W){if(c>d||c<u){let ee=typeof u=="bigint"?"n":"",Ie;throw u===0||u===BigInt(0)?Ie=`>= 0${ee} and < 2${ee} ** ${(W+1)*8}${ee}`:Ie=`>= -(2${ee} ** ${(W+1)*8-1}${ee}) and < 2 ** ${(W+1)*8-1}${ee}`,new R.ERR_OUT_OF_RANGE("value",Ie,c)}fe(w,I,W)}function X(c,u){if(typeof c!="number")throw new R.ERR_INVALID_ARG_TYPE(u,"number",c)}function we(c,u,d){throw Math.floor(c)!==c?(X(c,d),new R.ERR_OUT_OF_RANGE("offset","an integer",c)):u<0?new R.ERR_BUFFER_OUT_OF_BOUNDS:new R.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${u}`,c)}let ge=/[^+/0-9A-Za-z-_]/g;function B(c){if(c=c.split("=")[0],c=c.trim().replace(ge,""),c.length<2)return"";for(;c.length%4!==0;)c=c+"=";return c}function D(c,u){u=u||1/0;let d,w=c.length,I=null,W=[];for(let ee=0;ee<w;++ee){if(d=c.charCodeAt(ee),d>55295&&d<57344){if(!I){if(d>56319){(u-=3)>-1&&W.push(239,191,189);continue}else if(ee+1===w){(u-=3)>-1&&W.push(239,191,189);continue}I=d;continue}if(d<56320){(u-=3)>-1&&W.push(239,191,189),I=d;continue}d=(I-55296<<10|d-56320)+65536}else I&&(u-=3)>-1&&W.push(239,191,189);if(I=null,d<128){if((u-=1)<0)break;W.push(d)}else if(d<2048){if((u-=2)<0)break;W.push(d>>6|192,d&63|128)}else if(d<65536){if((u-=3)<0)break;W.push(d>>12|224,d>>6&63|128,d&63|128)}else if(d<1114112){if((u-=4)<0)break;W.push(d>>18|240,d>>12&63|128,d>>6&63|128,d&63|128)}else throw new Error("Invalid code point")}return W}function F(c){let u=[];for(let d=0;d<c.length;++d)u.push(c.charCodeAt(d)&255);return u}function ie(c,u){let d,w,I,W=[];for(let ee=0;ee<c.length&&!((u-=2)<0);++ee)d=c.charCodeAt(ee),w=d>>8,I=d%256,W.push(I),W.push(w);return W}function Z(c){return e.toByteArray(B(c))}function L(c,u,d,w){let I;for(I=0;I<w&&!(I+d>=u.length||I>=c.length);++I)u[I+d]=c[I];return I}function K(c,u){return c instanceof u||c!=null&&c.constructor!=null&&c.constructor.name!=null&&c.constructor.name===u.name}function P(c){return c!==c}let N=function(){let c="0123456789abcdef",u=new Array(256);for(let d=0;d<16;++d){let w=d*16;for(let I=0;I<16;++I)u[w+I]=c[d]+c[I]}return u}();function q(c){return typeof BigInt>"u"?ue:c}function ue(){throw new Error("BigInt not supported")}return Ct}var Zt,Jn,sr,Zn,Ct,Xn,mt,mr,fo,po,Je=Qe(()=>{ae(),he(),le(),Zt={},Jn=!1,sr={},Zn=!1,Ct={},Xn=!1,mt=Al(),mt.Buffer,mt.SlowBuffer,mt.INSPECT_MAX_BYTES,mt.kMaxLength,mr=mt.Buffer,fo=mt.INSPECT_MAX_BYTES,po=mt.kMaxLength}),he=Qe(()=>{Je()}),kl=be(e=>{ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0});var i=class{constructor(t){this.aliasToTopic={},this.max=t}put(t,a){return a===0||a>this.max?!1:(this.aliasToTopic[a]=t,this.length=Object.keys(this.aliasToTopic).length,!0)}getTopicByAlias(t){return this.aliasToTopic[t]}clear(){this.aliasToTopic={}}};e.default=i}),He=be((e,i)=>{ae(),he(),le(),i.exports={ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,a){return t.includes(a)},ArrayPrototypeIndexOf(t,a){return t.indexOf(a)},ArrayPrototypeJoin(t,a){return t.join(a)},ArrayPrototypeMap(t,a){return t.map(a)},ArrayPrototypePop(t,a){return t.pop(a)},ArrayPrototypePush(t,a){return t.push(a)},ArrayPrototypeSlice(t,a,h){return t.slice(a,h)},Error,FunctionPrototypeCall(t,a,...h){return t.call(a,...h)},FunctionPrototypeSymbolHasInstance(t,a){return Function.prototype[Symbol.hasInstance].call(t,a)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,a){return Object.defineProperties(t,a)},ObjectDefineProperty(t,a,h){return Object.defineProperty(t,a,h)},ObjectGetOwnPropertyDescriptor(t,a){return Object.getOwnPropertyDescriptor(t,a)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,a){return Object.setPrototypeOf(t,a)},Promise,PromisePrototypeCatch(t,a){return t.catch(a)},PromisePrototypeThen(t,a,h){return t.then(a,h)},PromiseReject(t){return Promise.reject(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,a){return t.test(a)},SafeSet:Set,String,StringPrototypeSlice(t,a,h){return t.slice(a,h)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,TypedArrayPrototypeSet(t,a,h){return t.set(a,h)},Uint8Array}}),bt=be((e,i)=>{ae(),he(),le();var t=(Je(),Le(Ge)),a=Object.getPrototypeOf(async function(){}).constructor,h=globalThis.Blob||t.Blob,n=typeof h<"u"?function(s){return s instanceof h}:function(s){return!1},r=class extends Error{constructor(s){if(!Array.isArray(s))throw new TypeError(`Expected input to be an Array, got ${typeof s}`);let o="";for(let l=0;l<s.length;l++)o+=` ${s[l].stack}
|
|
3
|
-
`;super(o),this.name="AggregateError",this.errors=s}};i.exports={AggregateError:r,kEmptyObject:Object.freeze({}),once(s){let o=!1;return function(...l){o||(o=!0,s.apply(this,l))}},createDeferredPromise:function(){let s,o;return{promise:new Promise((l,f)=>{s=l,o=f}),resolve:s,reject:o}},promisify(s){return new Promise((o,l)=>{s((f,...p)=>f?l(f):o(...p))})},debuglog(){return function(){}},format(s,...o){return s.replace(/%([sdifj])/g,function(...[l,f]){let p=o.shift();return f==="f"?p.toFixed(6):f==="j"?JSON.stringify(p):f==="s"&&typeof p=="object"?`${p.constructor!==Object?p.constructor.name:""} {}`.trim():p.toString()})},inspect(s){switch(typeof s){case"string":if(s.includes("'"))if(s.includes('"')){if(!s.includes("`")&&!s.includes("${"))return`\`${s}\``}else return`"${s}"`;return`'${s}'`;case"number":return isNaN(s)?"NaN":Object.is(s,-0)?String(s):s;case"bigint":return`${String(s)}n`;case"boolean":case"undefined":return String(s);case"object":return"{}"}},types:{isAsyncFunction(s){return s instanceof a},isArrayBufferView(s){return ArrayBuffer.isView(s)}},isBlob:n},i.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),ei=be((e,i)=>{ae(),he(),le();var{AbortController:t,AbortSignal:a}=typeof self<"u"?self:typeof window<"u"?window:void 0;i.exports=t,i.exports.AbortSignal=a,i.exports.default=t}),tt=be((e,i)=>{ae(),he(),le();var{format:t,inspect:a,AggregateError:h}=bt(),n=globalThis.AggregateError||h,r=Symbol("kIsNodeError"),s=["string","function","number","object","Function","Object","boolean","bigint","symbol"],o=/^([A-Z][a-z0-9]*)+$/,l="__node_internal_",f={};function p(k,v){if(!k)throw new f.ERR_INTERNAL_ASSERTION(v)}function g(k){let v="",U=k.length,j=k[0]==="-"?1:0;for(;U>=j+4;U-=3)v=`_${k.slice(U-3,U)}${v}`;return`${k.slice(0,U)}${v}`}function m(k,v,U){if(typeof v=="function")return p(v.length<=U.length,`Code: ${k}; The provided arguments length (${U.length}) does not match the required ones (${v.length}).`),v(...U);let j=(v.match(/%[dfijoOs]/g)||[]).length;return p(j===U.length,`Code: ${k}; The provided arguments length (${U.length}) does not match the required ones (${j}).`),U.length===0?v:t(v,...U)}function b(k,v,U){U||(U=Error);class j extends U{constructor(...T){super(m(k,v,T))}toString(){return`${this.name} [${k}]: ${this.message}`}}Object.defineProperties(j.prototype,{name:{value:U.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${k}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),j.prototype.code=k,j.prototype[r]=!0,f[k]=j}function y(k){let v=l+k.name;return Object.defineProperty(k,"name",{value:v}),k}function A(k,v){if(k&&v&&k!==v){if(Array.isArray(v.errors))return v.errors.push(k),v;let U=new n([v,k],v.message);return U.code=v.code,U}return k||v}var M=class extends Error{constructor(k="The operation was aborted",v=void 0){if(v!==void 0&&typeof v!="object")throw new f.ERR_INVALID_ARG_TYPE("options","Object",v);super(k,v),this.code="ABORT_ERR",this.name="AbortError"}};b("ERR_ASSERTION","%s",Error),b("ERR_INVALID_ARG_TYPE",(k,v,U)=>{p(typeof k=="string","'name' must be a string"),Array.isArray(v)||(v=[v]);let j="The ";k.endsWith(" argument")?j+=`${k} `:j+=`"${k}" ${k.includes(".")?"property":"argument"} `,j+="must be ";let C=[],T=[],x=[];for(let J of v)p(typeof J=="string","All expected entries have to be of type string"),s.includes(J)?C.push(J.toLowerCase()):o.test(J)?T.push(J):(p(J!=="object",'The value "object" should be written as "Object"'),x.push(J));if(T.length>0){let J=C.indexOf("object");J!==-1&&(C.splice(C,J,1),T.push("Object"))}if(C.length>0){switch(C.length){case 1:j+=`of type ${C[0]}`;break;case 2:j+=`one of type ${C[0]} or ${C[1]}`;break;default:{let J=C.pop();j+=`one of type ${C.join(", ")}, or ${J}`}}(T.length>0||x.length>0)&&(j+=" or ")}if(T.length>0){switch(T.length){case 1:j+=`an instance of ${T[0]}`;break;case 2:j+=`an instance of ${T[0]} or ${T[1]}`;break;default:{let J=T.pop();j+=`an instance of ${T.join(", ")}, or ${J}`}}x.length>0&&(j+=" or ")}switch(x.length){case 0:break;case 1:x[0].toLowerCase()!==x[0]&&(j+="an "),j+=`${x[0]}`;break;case 2:j+=`one of ${x[0]} or ${x[1]}`;break;default:{let J=x.pop();j+=`one of ${x.join(", ")}, or ${J}`}}if(U==null)j+=`. Received ${U}`;else if(typeof U=="function"&&U.name)j+=`. Received function ${U.name}`;else if(typeof U=="object"){var V;if((V=U.constructor)!==null&&V!==void 0&&V.name)j+=`. Received an instance of ${U.constructor.name}`;else{let J=a(U,{depth:-1});j+=`. Received ${J}`}}else{let J=a(U,{colors:!1});J.length>25&&(J=`${J.slice(0,25)}...`),j+=`. Received type ${typeof U} (${J})`}return j},TypeError),b("ERR_INVALID_ARG_VALUE",(k,v,U="is invalid")=>{let j=a(v);return j.length>128&&(j=j.slice(0,128)+"..."),`The ${k.includes(".")?"property":"argument"} '${k}' ${U}. Received ${j}`},TypeError),b("ERR_INVALID_RETURN_VALUE",(k,v,U)=>{var j;let C=U!=null&&(j=U.constructor)!==null&&j!==void 0&&j.name?`instance of ${U.constructor.name}`:`type ${typeof U}`;return`Expected ${k} to be returned from the "${v}" function but got ${C}.`},TypeError),b("ERR_MISSING_ARGS",(...k)=>{p(k.length>0,"At least one arg needs to be specified");let v,U=k.length;switch(k=(Array.isArray(k)?k:[k]).map(j=>`"${j}"`).join(" or "),U){case 1:v+=`The ${k[0]} argument`;break;case 2:v+=`The ${k[0]} and ${k[1]} arguments`;break;default:{let j=k.pop();v+=`The ${k.join(", ")}, and ${j} arguments`}break}return`${v} must be specified`},TypeError),b("ERR_OUT_OF_RANGE",(k,v,U)=>{p(v,'Missing "range" argument');let j;return Number.isInteger(U)&&Math.abs(U)>2**32?j=g(String(U)):typeof U=="bigint"?(j=String(U),(U>2n**32n||U<-(2n**32n))&&(j=g(j)),j+="n"):j=a(U),`The value of "${k}" is out of range. It must be ${v}. Received ${j}`},RangeError),b("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),b("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),b("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),b("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),b("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),b("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),b("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),b("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),b("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),b("ERR_STREAM_WRITE_AFTER_END","write after end",Error),b("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),i.exports={AbortError:M,aggregateTwoErrors:y(A),hideStackFrames:y,codes:f}}),br=be((e,i)=>{ae(),he(),le();var{ArrayIsArray:t,ArrayPrototypeIncludes:a,ArrayPrototypeJoin:h,ArrayPrototypeMap:n,NumberIsInteger:r,NumberIsNaN:s,NumberMAX_SAFE_INTEGER:o,NumberMIN_SAFE_INTEGER:l,NumberParseInt:f,ObjectPrototypeHasOwnProperty:p,RegExpPrototypeExec:g,String:m,StringPrototypeToUpperCase:b,StringPrototypeTrim:y}=He(),{hideStackFrames:A,codes:{ERR_SOCKET_BAD_PORT:M,ERR_INVALID_ARG_TYPE:k,ERR_INVALID_ARG_VALUE:v,ERR_OUT_OF_RANGE:U,ERR_UNKNOWN_SIGNAL:j}}=tt(),{normalizeEncoding:C}=bt(),{isAsyncFunction:T,isArrayBufferView:x}=bt().types,V={};function J(L){return L===(L|0)}function ne(L){return L===L>>>0}var S=/^[0-7]+$/,z="must be a 32-bit unsigned integer or an octal string";function re(L,K,P){if(typeof L>"u"&&(L=P),typeof L=="string"){if(g(S,L)===null)throw new v(K,L,z);L=f(L,8)}return se(L,K),L}var Q=A((L,K,P=l,N=o)=>{if(typeof L!="number")throw new k(K,"number",L);if(!r(L))throw new U(K,"an integer",L);if(L<P||L>N)throw new U(K,`>= ${P} && <= ${N}`,L)}),me=A((L,K,P=-2147483648,N=2147483647)=>{if(typeof L!="number")throw new k(K,"number",L);if(!r(L))throw new U(K,"an integer",L);if(L<P||L>N)throw new U(K,`>= ${P} && <= ${N}`,L)}),se=A((L,K,P=!1)=>{if(typeof L!="number")throw new k(K,"number",L);if(!r(L))throw new U(K,"an integer",L);let N=P?1:0,q=4294967295;if(L<N||L>q)throw new U(K,`>= ${N} && <= ${q}`,L)});function H(L,K){if(typeof L!="string")throw new k(K,"string",L)}function ye(L,K,P=void 0,N){if(typeof L!="number")throw new k(K,"number",L);if(P!=null&&L<P||N!=null&&L>N||(P!=null||N!=null)&&s(L))throw new U(K,`${P!=null?`>= ${P}`:""}${P!=null&&N!=null?" && ":""}${N!=null?`<= ${N}`:""}`,L)}var oe=A((L,K,P)=>{if(!a(P,L)){let N="must be one of: "+h(n(P,q=>typeof q=="string"?`'${q}'`:m(q)),", ");throw new v(K,L,N)}});function _e(L,K){if(typeof L!="boolean")throw new k(K,"boolean",L)}function _(L,K,P){return L==null||!p(L,K)?P:L[K]}var G=A((L,K,P=null)=>{let N=_(P,"allowArray",!1),q=_(P,"allowFunction",!1);if(!_(P,"nullable",!1)&&L===null||!N&&t(L)||typeof L!="object"&&(!q||typeof L!="function"))throw new k(K,"Object",L)}),de=A((L,K)=>{if(L!=null&&typeof L!="object"&&typeof L!="function")throw new k(K,"a dictionary",L)}),ve=A((L,K,P=0)=>{if(!t(L))throw new k(K,"Array",L);if(L.length<P){let N=`must be longer than ${P}`;throw new v(K,L,N)}});function ce(L,K){ve(L,K);for(let P=0;P<L.length;P++)H(L[P],`${K}[${P}]`)}function R(L,K){ve(L,K);for(let P=0;P<L.length;P++)_e(L[P],`${K}[${P}]`)}function E(L,K="signal"){if(H(L,K),V[L]===void 0)throw V[b(L)]!==void 0?new j(L+" (signals must use all capital letters)"):new j(L)}var Y=A((L,K="buffer")=>{if(!x(L))throw new k(K,["Buffer","TypedArray","DataView"],L)});function fe(L,K){let P=C(K),N=L.length;if(P==="hex"&&N%2!==0)throw new v("encoding",K,`is invalid for data of length ${N}`)}function te(L,K="Port",P=!0){if(typeof L!="number"&&typeof L!="string"||typeof L=="string"&&y(L).length===0||+L!==+L>>>0||L>65535||L===0&&!P)throw new M(K,L,P);return L|0}var X=A((L,K)=>{if(L!==void 0&&(L===null||typeof L!="object"||!("aborted"in L)))throw new k(K,"AbortSignal",L)}),we=A((L,K)=>{if(typeof L!="function")throw new k(K,"Function",L)}),ge=A((L,K)=>{if(typeof L!="function"||T(L))throw new k(K,"Function",L)}),B=A((L,K)=>{if(L!==void 0)throw new k(K,"undefined",L)});function D(L,K,P){if(!a(P,L))throw new k(K,`('${h(P,"|")}')`,L)}var F=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function ie(L,K){if(typeof L>"u"||!g(F,L))throw new v(K,L,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function Z(L){if(typeof L=="string")return ie(L,"hints"),L;if(t(L)){let K=L.length,P="";if(K===0)return P;for(let N=0;N<K;N++){let q=L[N];ie(q,"hints"),P+=q,N!==K-1&&(P+=", ")}return P}throw new v("hints",L,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}i.exports={isInt32:J,isUint32:ne,parseFileMode:re,validateArray:ve,validateStringArray:ce,validateBooleanArray:R,validateBoolean:_e,validateBuffer:Y,validateDictionary:de,validateEncoding:fe,validateFunction:we,validateInt32:me,validateInteger:Q,validateNumber:ye,validateObject:G,validateOneOf:oe,validatePlainFunction:ge,validatePort:te,validateSignalName:E,validateString:H,validateUint32:se,validateUndefined:B,validateUnion:D,validateAbortSignal:X,validateLinkHeaderValue:Z}}),Ut=be((e,i)=>{ae(),he(),le();var t=i.exports={},a,h;function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?a=setTimeout:a=n}catch{a=n}try{typeof clearTimeout=="function"?h=clearTimeout:h=r}catch{h=r}})();function s(M){if(a===setTimeout)return setTimeout(M,0);if((a===n||!a)&&setTimeout)return a=setTimeout,setTimeout(M,0);try{return a(M,0)}catch{try{return a.call(null,M,0)}catch{return a.call(this,M,0)}}}function o(M){if(h===clearTimeout)return clearTimeout(M);if((h===r||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(M);try{return h(M)}catch{try{return h.call(null,M)}catch{return h.call(this,M)}}}var l=[],f=!1,p,g=-1;function m(){!f||!p||(f=!1,p.length?l=p.concat(l):g=-1,l.length&&b())}function b(){if(!f){var M=s(m);f=!0;for(var k=l.length;k;){for(p=l,l=[];++g<k;)p&&p[g].run();g=-1,k=l.length}p=null,f=!1,o(M)}}t.nextTick=function(M){var k=new Array(arguments.length-1);if(arguments.length>1)for(var v=1;v<arguments.length;v++)k[v-1]=arguments[v];l.push(new y(M,k)),l.length===1&&!f&&s(b)};function y(M,k){this.fun=M,this.array=k}y.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function A(){}t.on=A,t.addListener=A,t.once=A,t.off=A,t.removeListener=A,t.removeAllListeners=A,t.emit=A,t.prependListener=A,t.prependOnceListener=A,t.listeners=function(M){return[]},t.binding=function(M){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(M){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}}),yt=be((e,i)=>{ae(),he(),le();var{Symbol:t,SymbolAsyncIterator:a,SymbolIterator:h,SymbolFor:n}=He(),r=t("kDestroyed"),s=t("kIsErrored"),o=t("kIsReadable"),l=t("kIsDisturbed"),f=n("nodejs.webstream.isClosedPromise"),p=n("nodejs.webstream.controllerErrorFunction");function g(_,G=!1){var de;return!!(_&&typeof _.pipe=="function"&&typeof _.on=="function"&&(!G||typeof _.pause=="function"&&typeof _.resume=="function")&&(!_._writableState||((de=_._readableState)===null||de===void 0?void 0:de.readable)!==!1)&&(!_._writableState||_._readableState))}function m(_){var G;return!!(_&&typeof _.write=="function"&&typeof _.on=="function"&&(!_._readableState||((G=_._writableState)===null||G===void 0?void 0:G.writable)!==!1))}function b(_){return!!(_&&typeof _.pipe=="function"&&_._readableState&&typeof _.on=="function"&&typeof _.write=="function")}function y(_){return _&&(_._readableState||_._writableState||typeof _.write=="function"&&typeof _.on=="function"||typeof _.pipe=="function"&&typeof _.on=="function")}function A(_){return!!(_&&!y(_)&&typeof _.pipeThrough=="function"&&typeof _.getReader=="function"&&typeof _.cancel=="function")}function M(_){return!!(_&&!y(_)&&typeof _.getWriter=="function"&&typeof _.abort=="function")}function k(_){return!!(_&&!y(_)&&typeof _.readable=="object"&&typeof _.writable=="object")}function v(_){return A(_)||M(_)||k(_)}function U(_,G){return _==null?!1:G===!0?typeof _[a]=="function":G===!1?typeof _[h]=="function":typeof _[a]=="function"||typeof _[h]=="function"}function j(_){if(!y(_))return null;let G=_._writableState,de=_._readableState,ve=G||de;return!!(_.destroyed||_[r]||ve!=null&&ve.destroyed)}function C(_){if(!m(_))return null;if(_.writableEnded===!0)return!0;let G=_._writableState;return G!=null&&G.errored?!1:typeof(G==null?void 0:G.ended)!="boolean"?null:G.ended}function T(_,G){if(!m(_))return null;if(_.writableFinished===!0)return!0;let de=_._writableState;return de!=null&&de.errored?!1:typeof(de==null?void 0:de.finished)!="boolean"?null:!!(de.finished||G===!1&&de.ended===!0&&de.length===0)}function x(_){if(!g(_))return null;if(_.readableEnded===!0)return!0;let G=_._readableState;return!G||G.errored?!1:typeof(G==null?void 0:G.ended)!="boolean"?null:G.ended}function V(_,G){if(!g(_))return null;let de=_._readableState;return de!=null&&de.errored?!1:typeof(de==null?void 0:de.endEmitted)!="boolean"?null:!!(de.endEmitted||G===!1&&de.ended===!0&&de.length===0)}function J(_){return _&&_[o]!=null?_[o]:typeof(_==null?void 0:_.readable)!="boolean"?null:j(_)?!1:g(_)&&_.readable&&!V(_)}function ne(_){return typeof(_==null?void 0:_.writable)!="boolean"?null:j(_)?!1:m(_)&&_.writable&&!C(_)}function S(_,G){return y(_)?j(_)?!0:!((G==null?void 0:G.readable)!==!1&&J(_)||(G==null?void 0:G.writable)!==!1&&ne(_)):null}function z(_){var G,de;return y(_)?_.writableErrored?_.writableErrored:(G=(de=_._writableState)===null||de===void 0?void 0:de.errored)!==null&&G!==void 0?G:null:null}function re(_){var G,de;return y(_)?_.readableErrored?_.readableErrored:(G=(de=_._readableState)===null||de===void 0?void 0:de.errored)!==null&&G!==void 0?G:null:null}function Q(_){if(!y(_))return null;if(typeof _.closed=="boolean")return _.closed;let G=_._writableState,de=_._readableState;return typeof(G==null?void 0:G.closed)=="boolean"||typeof(de==null?void 0:de.closed)=="boolean"?(G==null?void 0:G.closed)||(de==null?void 0:de.closed):typeof _._closed=="boolean"&&me(_)?_._closed:null}function me(_){return typeof _._closed=="boolean"&&typeof _._defaultKeepAlive=="boolean"&&typeof _._removedConnection=="boolean"&&typeof _._removedContLen=="boolean"}function se(_){return typeof _._sent100=="boolean"&&me(_)}function H(_){var G;return typeof _._consuming=="boolean"&&typeof _._dumped=="boolean"&&((G=_.req)===null||G===void 0?void 0:G.upgradeOrConnect)===void 0}function ye(_){if(!y(_))return null;let G=_._writableState,de=_._readableState,ve=G||de;return!ve&&se(_)||!!(ve&&ve.autoDestroy&&ve.emitClose&&ve.closed===!1)}function oe(_){var G;return!!(_&&((G=_[l])!==null&&G!==void 0?G:_.readableDidRead||_.readableAborted))}function _e(_){var G,de,ve,ce,R,E,Y,fe,te,X;return!!(_&&((G=(de=(ve=(ce=(R=(E=_[s])!==null&&E!==void 0?E:_.readableErrored)!==null&&R!==void 0?R:_.writableErrored)!==null&&ce!==void 0?ce:(Y=_._readableState)===null||Y===void 0?void 0:Y.errorEmitted)!==null&&ve!==void 0?ve:(fe=_._writableState)===null||fe===void 0?void 0:fe.errorEmitted)!==null&&de!==void 0?de:(te=_._readableState)===null||te===void 0?void 0:te.errored)!==null&&G!==void 0?G:!((X=_._writableState)===null||X===void 0)&&X.errored))}i.exports={kDestroyed:r,isDisturbed:oe,kIsDisturbed:l,isErrored:_e,kIsErrored:s,isReadable:J,kIsReadable:o,kIsClosedPromise:f,kControllerErrorFunction:p,isClosed:Q,isDestroyed:j,isDuplexNodeStream:b,isFinished:S,isIterable:U,isReadableNodeStream:g,isReadableStream:A,isReadableEnded:x,isReadableFinished:V,isReadableErrored:re,isNodeStream:y,isWebStream:v,isWritable:ne,isWritableNodeStream:m,isWritableStream:M,isWritableEnded:C,isWritableFinished:T,isWritableErrored:z,isServerRequest:H,isServerResponse:se,willEmitClose:ye,isTransformStream:k}}),Pt=be((e,i)=>{ae(),he(),le();var t=Ut(),{AbortError:a,codes:h}=tt(),{ERR_INVALID_ARG_TYPE:n,ERR_STREAM_PREMATURE_CLOSE:r}=h,{kEmptyObject:s,once:o}=bt(),{validateAbortSignal:l,validateFunction:f,validateObject:p,validateBoolean:g}=br(),{Promise:m,PromisePrototypeThen:b}=He(),{isClosed:y,isReadable:A,isReadableNodeStream:M,isReadableStream:k,isReadableFinished:v,isReadableErrored:U,isWritable:j,isWritableNodeStream:C,isWritableStream:T,isWritableFinished:x,isWritableErrored:V,isNodeStream:J,willEmitClose:ne,kIsClosedPromise:S}=yt();function z(H){return H.setHeader&&typeof H.abort=="function"}var re=()=>{};function Q(H,ye,oe){var _e,_;if(arguments.length===2?(oe=ye,ye=s):ye==null?ye=s:p(ye,"options"),f(oe,"callback"),l(ye.signal,"options.signal"),oe=o(oe),k(H)||T(H))return me(H,ye,oe);if(!J(H))throw new n("stream",["ReadableStream","WritableStream","Stream"],H);let G=(_e=ye.readable)!==null&&_e!==void 0?_e:M(H),de=(_=ye.writable)!==null&&_!==void 0?_:C(H),ve=H._writableState,ce=H._readableState,R=()=>{H.writable||fe()},E=ne(H)&&M(H)===G&&C(H)===de,Y=x(H,!1),fe=()=>{Y=!0,H.destroyed&&(E=!1),!(E&&(!H.readable||G))&&(!G||te)&&oe.call(H)},te=v(H,!1),X=()=>{te=!0,H.destroyed&&(E=!1),!(E&&(!H.writable||de))&&(!de||Y)&&oe.call(H)},we=Z=>{oe.call(H,Z)},ge=y(H),B=()=>{ge=!0;let Z=V(H)||U(H);if(Z&&typeof Z!="boolean")return oe.call(H,Z);if(G&&!te&&M(H,!0)&&!v(H,!1))return oe.call(H,new r);if(de&&!Y&&!x(H,!1))return oe.call(H,new r);oe.call(H)},D=()=>{ge=!0;let Z=V(H)||U(H);if(Z&&typeof Z!="boolean")return oe.call(H,Z);oe.call(H)},F=()=>{H.req.on("finish",fe)};z(H)?(H.on("complete",fe),E||H.on("abort",B),H.req?F():H.on("request",F)):de&&!ve&&(H.on("end",R),H.on("close",R)),!E&&typeof H.aborted=="boolean"&&H.on("aborted",B),H.on("end",X),H.on("finish",fe),ye.error!==!1&&H.on("error",we),H.on("close",B),ge?t.nextTick(B):ve!=null&&ve.errorEmitted||ce!=null&&ce.errorEmitted?E||t.nextTick(D):(!G&&(!E||A(H))&&(Y||j(H)===!1)||!de&&(!E||j(H))&&(te||A(H)===!1)||ce&&H.req&&H.aborted)&&t.nextTick(D);let ie=()=>{oe=re,H.removeListener("aborted",B),H.removeListener("complete",fe),H.removeListener("abort",B),H.removeListener("request",F),H.req&&H.req.removeListener("finish",fe),H.removeListener("end",R),H.removeListener("close",R),H.removeListener("finish",fe),H.removeListener("end",X),H.removeListener("error",we),H.removeListener("close",B)};if(ye.signal&&!ge){let Z=()=>{let L=oe;ie(),L.call(H,new a(void 0,{cause:ye.signal.reason}))};if(ye.signal.aborted)t.nextTick(Z);else{let L=oe;oe=o((...K)=>{ye.signal.removeEventListener("abort",Z),L.apply(H,K)}),ye.signal.addEventListener("abort",Z)}}return ie}function me(H,ye,oe){let _e=!1,_=re;if(ye.signal)if(_=()=>{_e=!0,oe.call(H,new a(void 0,{cause:ye.signal.reason}))},ye.signal.aborted)t.nextTick(_);else{let de=oe;oe=o((...ve)=>{ye.signal.removeEventListener("abort",_),de.apply(H,ve)}),ye.signal.addEventListener("abort",_)}let G=(...de)=>{_e||t.nextTick(()=>oe.apply(H,de))};return b(H[S].promise,G,G),re}function se(H,ye){var oe;let _e=!1;return ye===null&&(ye=s),(oe=ye)!==null&&oe!==void 0&&oe.cleanup&&(g(ye.cleanup,"cleanup"),_e=ye.cleanup),new m((_,G)=>{let de=Q(H,ye,ve=>{_e&&de(),ve?G(ve):_()})})}i.exports=Q,i.exports.finished=se}),Xt=be((e,i)=>{ae(),he(),le();var t=Ut(),{aggregateTwoErrors:a,codes:{ERR_MULTIPLE_CALLBACK:h},AbortError:n}=tt(),{Symbol:r}=He(),{kDestroyed:s,isDestroyed:o,isFinished:l,isServerRequest:f}=yt(),p=r("kDestroy"),g=r("kConstruct");function m(S,z,re){S&&(S.stack,z&&!z.errored&&(z.errored=S),re&&!re.errored&&(re.errored=S))}function b(S,z){let re=this._readableState,Q=this._writableState,me=Q||re;return Q!=null&&Q.destroyed||re!=null&&re.destroyed?(typeof z=="function"&&z(),this):(m(S,Q,re),Q&&(Q.destroyed=!0),re&&(re.destroyed=!0),me.constructed?y(this,S,z):this.once(p,function(se){y(this,a(se,S),z)}),this)}function y(S,z,re){let Q=!1;function me(se){if(Q)return;Q=!0;let H=S._readableState,ye=S._writableState;m(se,ye,H),ye&&(ye.closed=!0),H&&(H.closed=!0),typeof re=="function"&&re(se),se?t.nextTick(A,S,se):t.nextTick(M,S)}try{S._destroy(z||null,me)}catch(se){me(se)}}function A(S,z){k(S,z),M(S)}function M(S){let z=S._readableState,re=S._writableState;re&&(re.closeEmitted=!0),z&&(z.closeEmitted=!0),(re!=null&&re.emitClose||z!=null&&z.emitClose)&&S.emit("close")}function k(S,z){let re=S._readableState,Q=S._writableState;Q!=null&&Q.errorEmitted||re!=null&&re.errorEmitted||(Q&&(Q.errorEmitted=!0),re&&(re.errorEmitted=!0),S.emit("error",z))}function v(){let S=this._readableState,z=this._writableState;S&&(S.constructed=!0,S.closed=!1,S.closeEmitted=!1,S.destroyed=!1,S.errored=null,S.errorEmitted=!1,S.reading=!1,S.ended=S.readable===!1,S.endEmitted=S.readable===!1),z&&(z.constructed=!0,z.destroyed=!1,z.closed=!1,z.closeEmitted=!1,z.errored=null,z.errorEmitted=!1,z.finalCalled=!1,z.prefinished=!1,z.ended=z.writable===!1,z.ending=z.writable===!1,z.finished=z.writable===!1)}function U(S,z,re){let Q=S._readableState,me=S._writableState;if(me!=null&&me.destroyed||Q!=null&&Q.destroyed)return this;Q!=null&&Q.autoDestroy||me!=null&&me.autoDestroy?S.destroy(z):z&&(z.stack,me&&!me.errored&&(me.errored=z),Q&&!Q.errored&&(Q.errored=z),re?t.nextTick(k,S,z):k(S,z))}function j(S,z){if(typeof S._construct!="function")return;let re=S._readableState,Q=S._writableState;re&&(re.constructed=!1),Q&&(Q.constructed=!1),S.once(g,z),!(S.listenerCount(g)>1)&&t.nextTick(C,S)}function C(S){let z=!1;function re(Q){if(z){U(S,Q??new h);return}z=!0;let me=S._readableState,se=S._writableState,H=se||me;me&&(me.constructed=!0),se&&(se.constructed=!0),H.destroyed?S.emit(p,Q):Q?U(S,Q,!0):t.nextTick(T,S)}try{S._construct(Q=>{t.nextTick(re,Q)})}catch(Q){t.nextTick(re,Q)}}function T(S){S.emit(g)}function x(S){return(S==null?void 0:S.setHeader)&&typeof S.abort=="function"}function V(S){S.emit("close")}function J(S,z){S.emit("error",z),t.nextTick(V,S)}function ne(S,z){!S||o(S)||(!z&&!l(S)&&(z=new n),f(S)?(S.socket=null,S.destroy(z)):x(S)?S.abort():x(S.req)?S.req.abort():typeof S.destroy=="function"?S.destroy(z):typeof S.close=="function"?S.close():z?t.nextTick(J,S,z):t.nextTick(V,S),S.destroyed||(S[s]=!0))}i.exports={construct:j,destroyer:ne,destroy:b,undestroy:v,errorOrDestroy:U}});function xe(){xe.init.call(this)}function yr(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function go(e){return e._maxListeners===void 0?xe.defaultMaxListeners:e._maxListeners}function mo(e,i,t,a){var h,n,r,s;if(yr(t),(n=e._events)===void 0?(n=e._events=Object.create(null),e._eventsCount=0):(n.newListener!==void 0&&(e.emit("newListener",i,t.listener?t.listener:t),n=e._events),r=n[i]),r===void 0)r=n[i]=t,++e._eventsCount;else if(typeof r=="function"?r=n[i]=a?[t,r]:[r,t]:a?r.unshift(t):r.push(t),(h=go(e))>0&&r.length>h&&!r.warned){r.warned=!0;var o=new Error("Possible EventEmitter memory leak detected. "+r.length+" "+String(i)+" listeners added. Use emitter.setMaxListeners() to increase limit");o.name="MaxListenersExceededWarning",o.emitter=e,o.type=i,o.count=r.length,s=o,console&&console.warn&&console.warn(s)}return e}function Il(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function bo(e,i,t){var a={fired:!1,wrapFn:void 0,target:e,type:i,listener:t},h=Il.bind(a);return h.listener=t,a.wrapFn=h,h}function yo(e,i,t){var a=e._events;if(a===void 0)return[];var h=a[i];return h===void 0?[]:typeof h=="function"?t?[h.listener||h]:[h]:t?function(n){for(var r=new Array(n.length),s=0;s<r.length;++s)r[s]=n[s].listener||n[s];return r}(h):_o(h,h.length)}function wo(e){var i=this._events;if(i!==void 0){var t=i[e];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}function _o(e,i){for(var t=new Array(i),a=0;a<i;++a)t[a]=e[a];return t}var vo,Eo,Nt,ti,ri,ni,nt,So=Qe(()=>{ae(),he(),le(),Nt=typeof Reflect=="object"?Reflect:null,ti=Nt&&typeof Nt.apply=="function"?Nt.apply:function(e,i,t){return Function.prototype.apply.call(e,i,t)},Eo=Nt&&typeof Nt.ownKeys=="function"?Nt.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)},ri=Number.isNaN||function(e){return e!=e},vo=xe,xe.EventEmitter=xe,xe.prototype._events=void 0,xe.prototype._eventsCount=0,xe.prototype._maxListeners=void 0,ni=10,Object.defineProperty(xe,"defaultMaxListeners",{enumerable:!0,get:function(){return ni},set:function(e){if(typeof e!="number"||e<0||ri(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");ni=e}}),xe.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},xe.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||ri(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},xe.prototype.getMaxListeners=function(){return go(this)},xe.prototype.emit=function(e){for(var i=[],t=1;t<arguments.length;t++)i.push(arguments[t]);var a=e==="error",h=this._events;if(h!==void 0)a=a&&h.error===void 0;else if(!a)return!1;if(a){var n;if(i.length>0&&(n=i[0]),n instanceof Error)throw n;var r=new Error("Unhandled error."+(n?" ("+n.message+")":""));throw r.context=n,r}var s=h[e];if(s===void 0)return!1;if(typeof s=="function")ti(s,this,i);else{var o=s.length,l=_o(s,o);for(t=0;t<o;++t)ti(l[t],this,i)}return!0},xe.prototype.addListener=function(e,i){return mo(this,e,i,!1)},xe.prototype.on=xe.prototype.addListener,xe.prototype.prependListener=function(e,i){return mo(this,e,i,!0)},xe.prototype.once=function(e,i){return yr(i),this.on(e,bo(this,e,i)),this},xe.prototype.prependOnceListener=function(e,i){return yr(i),this.prependListener(e,bo(this,e,i)),this},xe.prototype.removeListener=function(e,i){var t,a,h,n,r;if(yr(i),(a=this._events)===void 0)return this;if((t=a[e])===void 0)return this;if(t===i||t.listener===i)--this._eventsCount==0?this._events=Object.create(null):(delete a[e],a.removeListener&&this.emit("removeListener",e,t.listener||i));else if(typeof t!="function"){for(h=-1,n=t.length-1;n>=0;n--)if(t[n]===i||t[n].listener===i){r=t[n].listener,h=n;break}if(h<0)return this;h===0?t.shift():function(s,o){for(;o+1<s.length;o++)s[o]=s[o+1];s.pop()}(t,h),t.length===1&&(a[e]=t[0]),a.removeListener!==void 0&&this.emit("removeListener",e,r||i)}return this},xe.prototype.off=xe.prototype.removeListener,xe.prototype.removeAllListeners=function(e){var i,t,a;if((t=this._events)===void 0)return this;if(t.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):t[e]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete t[e]),this;if(arguments.length===0){var h,n=Object.keys(t);for(a=0;a<n.length;++a)(h=n[a])!=="removeListener"&&this.removeAllListeners(h);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(i=t[e])=="function")this.removeListener(e,i);else if(i!==void 0)for(a=i.length-1;a>=0;a--)this.removeListener(e,i[a]);return this},xe.prototype.listeners=function(e){return yo(this,e,!0)},xe.prototype.rawListeners=function(e){return yo(this,e,!1)},xe.listenerCount=function(e,i){return typeof e.listenerCount=="function"?e.listenerCount(i):wo.call(e,i)},xe.prototype.listenerCount=wo,xe.prototype.eventNames=function(){return this._eventsCount>0?Eo(this._events):[]},nt=vo,nt.EventEmitter,nt.defaultMaxListeners,nt.init,nt.listenerCount,nt.EventEmitter,nt.defaultMaxListeners,nt.init,nt.listenerCount}),jt={};xt(jt,{EventEmitter:()=>Ao,default:()=>nt,defaultMaxListeners:()=>ko,init:()=>Io,listenerCount:()=>To,on:()=>Co,once:()=>Po});var Ao,ko,Io,To,Co,Po,er=Qe(()=>{ae(),he(),le(),So(),So(),nt.once=function(e,i){return new Promise((t,a)=>{function h(...r){n!==void 0&&e.removeListener("error",n),t(r)}let n;i!=="error"&&(n=r=>{e.removeListener(name,h),a(r)},e.once("error",n)),e.once(i,h)})},nt.on=function(e,i){let t=[],a=[],h=null,n=!1,r={async next(){let l=t.shift();if(l)return createIterResult(l,!1);if(h){let f=Promise.reject(h);return h=null,f}return n?createIterResult(void 0,!0):new Promise((f,p)=>a.push({resolve:f,reject:p}))},async return(){e.removeListener(i,s),e.removeListener("error",o),n=!0;for(let l of a)l.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(l){h=l,e.removeListener(i,s),e.removeListener("error",o)},[Symbol.asyncIterator](){return this}};return e.on(i,s),e.on("error",o),r;function s(...l){let f=a.shift();f?f.resolve(createIterResult(l,!1)):t.push(l)}function o(l){n=!0;let f=a.shift();f?f.reject(l):h=l,r.return()}},{EventEmitter:Ao,defaultMaxListeners:ko,init:Io,listenerCount:To,on:Co,once:Po}=nt}),ii=be((e,i)=>{ae(),he(),le();var{ArrayIsArray:t,ObjectSetPrototypeOf:a}=He(),{EventEmitter:h}=(er(),Le(jt));function n(s){h.call(this,s)}a(n.prototype,h.prototype),a(n,h),n.prototype.pipe=function(s,o){let l=this;function f(M){s.writable&&s.write(M)===!1&&l.pause&&l.pause()}l.on("data",f);function p(){l.readable&&l.resume&&l.resume()}s.on("drain",p),!s._isStdio&&(!o||o.end!==!1)&&(l.on("end",m),l.on("close",b));let g=!1;function m(){g||(g=!0,s.end())}function b(){g||(g=!0,typeof s.destroy=="function"&&s.destroy())}function y(M){A(),h.listenerCount(this,"error")===0&&this.emit("error",M)}r(l,"error",y),r(s,"error",y);function A(){l.removeListener("data",f),s.removeListener("drain",p),l.removeListener("end",m),l.removeListener("close",b),l.removeListener("error",y),s.removeListener("error",y),l.removeListener("end",A),l.removeListener("close",A),s.removeListener("close",A)}return l.on("end",A),l.on("close",A),s.on("close",A),s.emit("pipe",l),s};function r(s,o,l){if(typeof s.prependListener=="function")return s.prependListener(o,l);!s._events||!s._events[o]?s.on(o,l):t(s._events[o])?s._events[o].unshift(l):s._events[o]=[l,s._events[o]]}i.exports={Stream:n,prependListener:r}}),wr=be((e,i)=>{ae(),he(),le();var{AbortError:t,codes:a}=tt(),{isNodeStream:h,isWebStream:n,kControllerErrorFunction:r}=yt(),s=Pt(),{ERR_INVALID_ARG_TYPE:o}=a,l=(f,p)=>{if(typeof f!="object"||!("aborted"in f))throw new o(p,"AbortSignal",f)};i.exports.addAbortSignal=function(f,p){if(l(f,"signal"),!h(p)&&!n(p))throw new o("stream",["ReadableStream","WritableStream","Stream"],p);return i.exports.addAbortSignalNoValidate(f,p)},i.exports.addAbortSignalNoValidate=function(f,p){if(typeof f!="object"||!("aborted"in f))return p;let g=h(p)?()=>{p.destroy(new t(void 0,{cause:f.reason}))}:()=>{p[r](new t(void 0,{cause:f.reason}))};return f.aborted?g():(f.addEventListener("abort",g),s(p,()=>f.removeEventListener("abort",g))),p}}),Tl=be((e,i)=>{ae(),he(),le();var{StringPrototypeSlice:t,SymbolIterator:a,TypedArrayPrototypeSet:h,Uint8Array:n}=He(),{Buffer:r}=(Je(),Le(Ge)),{inspect:s}=bt();i.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(o){let l={data:o,next:null};this.length>0?this.tail.next=l:this.head=l,this.tail=l,++this.length}unshift(o){let l={data:o,next:this.head};this.length===0&&(this.tail=l),this.head=l,++this.length}shift(){if(this.length===0)return;let o=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,o}clear(){this.head=this.tail=null,this.length=0}join(o){if(this.length===0)return"";let l=this.head,f=""+l.data;for(;(l=l.next)!==null;)f+=o+l.data;return f}concat(o){if(this.length===0)return r.alloc(0);let l=r.allocUnsafe(o>>>0),f=this.head,p=0;for(;f;)h(l,f.data,p),p+=f.data.length,f=f.next;return l}consume(o,l){let f=this.head.data;if(o<f.length){let p=f.slice(0,o);return this.head.data=f.slice(o),p}return o===f.length?this.shift():l?this._getString(o):this._getBuffer(o)}first(){return this.head.data}*[a](){for(let o=this.head;o;o=o.next)yield o.data}_getString(o){let l="",f=this.head,p=0;do{let g=f.data;if(o>g.length)l+=g,o-=g.length;else{o===g.length?(l+=g,++p,f.next?this.head=f.next:this.head=this.tail=null):(l+=t(g,0,o),this.head=f,f.data=t(g,o));break}++p}while((f=f.next)!==null);return this.length-=p,l}_getBuffer(o){let l=r.allocUnsafe(o),f=o,p=this.head,g=0;do{let m=p.data;if(o>m.length)h(l,m,f-o),o-=m.length;else{o===m.length?(h(l,m,f-o),++g,p.next?this.head=p.next:this.head=this.tail=null):(h(l,new n(m.buffer,m.byteOffset,o),f-o),this.head=p,p.data=m.slice(o));break}++g}while((p=p.next)!==null);return this.length-=g,l}[Symbol.for("nodejs.util.inspect.custom")](o,l){return s(this,{...l,depth:0,customInspect:!1})}}}),oi=be((e,i)=>{ae(),he(),le();var{MathFloor:t,NumberIsInteger:a}=He(),{ERR_INVALID_ARG_VALUE:h}=tt().codes;function n(o,l,f){return o.highWaterMark!=null?o.highWaterMark:l?o[f]:null}function r(o){return o?16:16*1024}function s(o,l,f,p){let g=n(l,p,f);if(g!=null){if(!a(g)||g<0){let m=p?`options.${f}`:"options.highWaterMark";throw new h(m,g)}return t(g)}return r(o.objectMode)}i.exports={getHighWaterMark:s,getDefaultHighWaterMark:r}});function Bo(e){var i=e.length;if(i%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=e.indexOf("=");return t===-1&&(t=i),[t,t===i?0:4-t%4]}function Cl(e,i,t){for(var a,h,n=[],r=i;r<t;r+=3)a=(e[r]<<16&16711680)+(e[r+1]<<8&65280)+(255&e[r+2]),n.push(st[(h=a)>>18&63]+st[h>>12&63]+st[h>>6&63]+st[63&h]);return n.join("")}function wt(e){if(e>2147483647)throw new RangeError('The value "'+e+'" is invalid for option "size"');var i=new Uint8Array(e);return Object.setPrototypeOf(i,pe.prototype),i}function pe(e,i,t){if(typeof e=="number"){if(typeof i=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return si(e)}return Oo(e,i,t)}function Oo(e,i,t){if(typeof e=="string")return function(n,r){if(typeof r=="string"&&r!==""||(r="utf8"),!pe.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var s=0|xo(n,r),o=wt(s),l=o.write(n,r);return l!==s&&(o=o.slice(0,l)),o}(e,i);if(ArrayBuffer.isView(e))return ai(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(_t(e,ArrayBuffer)||e&&_t(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(_t(e,SharedArrayBuffer)||e&&_t(e.buffer,SharedArrayBuffer)))return Pl(e,i,t);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var a=e.valueOf&&e.valueOf();if(a!=null&&a!==e)return pe.from(a,i,t);var h=function(n){if(pe.isBuffer(n)){var r=0|li(n.length),s=wt(r);return s.length===0||n.copy(s,0,0,r),s}if(n.length!==void 0)return typeof n.length!="number"||ui(n.length)?wt(0):ai(n);if(n.type==="Buffer"&&Array.isArray(n.data))return ai(n.data)}(e);if(h)return h;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return pe.from(e[Symbol.toPrimitive]("string"),i,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function Ro(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function si(e){return Ro(e),wt(e<0?0:0|li(e))}function ai(e){for(var i=e.length<0?0:0|li(e.length),t=wt(i),a=0;a<i;a+=1)t[a]=255&e[a];return t}function Pl(e,i,t){if(i<0||e.byteLength<i)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<i+(t||0))throw new RangeError('"length" is outside of buffer bounds');var a;return a=i===void 0&&t===void 0?new Uint8Array(e):t===void 0?new Uint8Array(e,i):new Uint8Array(e,i,t),Object.setPrototypeOf(a,pe.prototype),a}function li(e){if(e>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function xo(e,i){if(pe.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||_t(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var t=e.length,a=arguments.length>2&&arguments[2]===!0;if(!a&&t===0)return 0;for(var h=!1;;)switch(i){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return hi(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*t;case"hex":return t>>>1;case"base64":return Wo(e).length;default:if(h)return a?-1:hi(e).length;i=(""+i).toLowerCase(),h=!0}}function Bl(e,i,t){var a=!1;if((i===void 0||i<0)&&(i=0),i>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0)<=(i>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return Dl(this,i,t);case"utf8":case"utf-8":return No(this,i,t);case"ascii":return Nl(this,i,t);case"latin1":case"binary":return jl(this,i,t);case"base64":return Ul(this,i,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Fl(this,i,t);default:if(a)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function Dt(e,i,t){var a=e[i];e[i]=e[t],e[t]=a}function Mo(e,i,t,a,h){if(e.length===0)return-1;if(typeof t=="string"?(a=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),ui(t=+t)&&(t=h?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(h)return-1;t=e.length-1}else if(t<0){if(!h)return-1;t=0}if(typeof i=="string"&&(i=pe.from(i,a)),pe.isBuffer(i))return i.length===0?-1:Lo(e,i,t,a,h);if(typeof i=="number")return i&=255,typeof Uint8Array.prototype.indexOf=="function"?h?Uint8Array.prototype.indexOf.call(e,i,t):Uint8Array.prototype.lastIndexOf.call(e,i,t):Lo(e,[i],t,a,h);throw new TypeError("val must be string, number or Buffer")}function Lo(e,i,t,a,h){var n,r=1,s=e.length,o=i.length;if(a!==void 0&&((a=String(a).toLowerCase())==="ucs2"||a==="ucs-2"||a==="utf16le"||a==="utf-16le")){if(e.length<2||i.length<2)return-1;r=2,s/=2,o/=2,t/=2}function l(m,b){return r===1?m[b]:m.readUInt16BE(b*r)}if(h){var f=-1;for(n=t;n<s;n++)if(l(e,n)===l(i,f===-1?0:n-f)){if(f===-1&&(f=n),n-f+1===o)return f*r}else f!==-1&&(n-=n-f),f=-1}else for(t+o>s&&(t=s-o),n=t;n>=0;n--){for(var p=!0,g=0;g<o;g++)if(l(e,n+g)!==l(i,g)){p=!1;break}if(p)return n}return-1}function Ol(e,i,t,a){t=Number(t)||0;var h=e.length-t;a?(a=Number(a))>h&&(a=h):a=h;var n=i.length;a>n/2&&(a=n/2);for(var r=0;r<a;++r){var s=parseInt(i.substr(2*r,2),16);if(ui(s))return r;e[t+r]=s}return r}function Rl(e,i,t,a){return _r(hi(i,e.length-t),e,t,a)}function Uo(e,i,t,a){return _r(function(h){for(var n=[],r=0;r<h.length;++r)n.push(255&h.charCodeAt(r));return n}(i),e,t,a)}function xl(e,i,t,a){return Uo(e,i,t,a)}function Ml(e,i,t,a){return _r(Wo(i),e,t,a)}function Ll(e,i,t,a){return _r(function(h,n){for(var r,s,o,l=[],f=0;f<h.length&&!((n-=2)<0);++f)r=h.charCodeAt(f),s=r>>8,o=r%256,l.push(o),l.push(s);return l}(i,e.length-t),e,t,a)}function Ul(e,i,t){return i===0&&t===e.length?Er.fromByteArray(e):Er.fromByteArray(e.slice(i,t))}function No(e,i,t){t=Math.min(e.length,t);for(var a=[],h=i;h<t;){var n,r,s,o,l=e[h],f=null,p=l>239?4:l>223?3:l>191?2:1;if(h+p<=t)switch(p){case 1:l<128&&(f=l);break;case 2:(192&(n=e[h+1]))==128&&(o=(31&l)<<6|63&n)>127&&(f=o);break;case 3:n=e[h+1],r=e[h+2],(192&n)==128&&(192&r)==128&&(o=(15&l)<<12|(63&n)<<6|63&r)>2047&&(o<55296||o>57343)&&(f=o);break;case 4:n=e[h+1],r=e[h+2],s=e[h+3],(192&n)==128&&(192&r)==128&&(192&s)==128&&(o=(15&l)<<18|(63&n)<<12|(63&r)<<6|63&s)>65535&&o<1114112&&(f=o)}f===null?(f=65533,p=1):f>65535&&(f-=65536,a.push(f>>>10&1023|55296),f=56320|1023&f),a.push(f),h+=p}return function(g){var m=g.length;if(m<=4096)return String.fromCharCode.apply(String,g);for(var b="",y=0;y<m;)b+=String.fromCharCode.apply(String,g.slice(y,y+=4096));return b}(a)}function Nl(e,i,t){var a="";t=Math.min(e.length,t);for(var h=i;h<t;++h)a+=String.fromCharCode(127&e[h]);return a}function jl(e,i,t){var a="";t=Math.min(e.length,t);for(var h=i;h<t;++h)a+=String.fromCharCode(e[h]);return a}function Dl(e,i,t){var a=e.length;(!i||i<0)&&(i=0),(!t||t<0||t>a)&&(t=a);for(var h="",n=i;n<t;++n)h+=Yo[e[n]];return h}function Fl(e,i,t){for(var a=e.slice(i,t),h="",n=0;n<a.length;n+=2)h+=String.fromCharCode(a[n]+256*a[n+1]);return h}function ze(e,i,t){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+i>t)throw new RangeError("Trying to access beyond buffer length")}function rt(e,i,t,a,h,n){if(!pe.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(i>h||i<n)throw new RangeError('"value" argument is out of bounds');if(t+a>e.length)throw new RangeError("Index out of range")}function jo(e,i,t,a,h,n){if(t+a>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function Do(e,i,t,a,h){return i=+i,t>>>=0,h||jo(e,0,t,4),$t.write(e,i,t,a,23,4),t+4}function Fo(e,i,t,a,h){return i=+i,t>>>=0,h||jo(e,0,t,8),$t.write(e,i,t,a,52,8),t+8}function hi(e,i){var t;i=i||1/0;for(var a=e.length,h=null,n=[],r=0;r<a;++r){if((t=e.charCodeAt(r))>55295&&t<57344){if(!h){if(t>56319){(i-=3)>-1&&n.push(239,191,189);continue}if(r+1===a){(i-=3)>-1&&n.push(239,191,189);continue}h=t;continue}if(t<56320){(i-=3)>-1&&n.push(239,191,189),h=t;continue}t=65536+(h-55296<<10|t-56320)}else h&&(i-=3)>-1&&n.push(239,191,189);if(h=null,t<128){if((i-=1)<0)break;n.push(t)}else if(t<2048){if((i-=2)<0)break;n.push(t>>6|192,63&t|128)}else if(t<65536){if((i-=3)<0)break;n.push(t>>12|224,t>>6&63|128,63&t|128)}else{if(!(t<1114112))throw new Error("Invalid code point");if((i-=4)<0)break;n.push(t>>18|240,t>>12&63|128,t>>6&63|128,63&t|128)}}return n}function Wo(e){return Er.toByteArray(function(i){if((i=(i=i.split("=")[0]).trim().replace(Ko,"")).length<2)return"";for(;i.length%4!=0;)i+="=";return i}(e))}function _r(e,i,t,a){for(var h=0;h<a&&!(h+t>=i.length||h>=e.length);++h)i[h+t]=e[h];return h}function _t(e,i){return e instanceof i||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===i.name}function ui(e){return e!=e}function $o(e,i){for(var t in e)i[t]=e[t]}function Ft(e,i,t){return at(e,i,t)}function ar(e){var i;switch(this.encoding=function(t){var a=function(h){if(!h)return"utf8";for(var n;;)switch(h){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return h;default:if(n)return;h=(""+h).toLowerCase(),n=!0}}(t);if(typeof a!="string"&&(Sr.isEncoding===di||!di(t)))throw new Error("Unknown encoding: "+t);return a||t}(e),this.encoding){case"utf16le":this.text=$l,this.end=Vl,i=4;break;case"utf8":this.fillLast=Wl,i=4;break;case"base64":this.text=ql,this.end=Hl,i=3;break;default:return this.write=zl,this.end=Kl,void 0}this.lastNeed=0,this.lastTotal=0,this.lastChar=Sr.allocUnsafe(i)}function ci(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function Wl(e){var i=this.lastTotal-this.lastNeed,t=function(a,h,n){if((192&h[0])!=128)return a.lastNeed=0,"�";if(a.lastNeed>1&&h.length>1){if((192&h[1])!=128)return a.lastNeed=1,"�";if(a.lastNeed>2&&h.length>2&&(192&h[2])!=128)return a.lastNeed=2,"�"}}(this,e);return t!==void 0?t:this.lastNeed<=e.length?(e.copy(this.lastChar,i,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,i,0,e.length),this.lastNeed-=e.length,void 0)}function $l(e,i){if((e.length-i)%2==0){var t=e.toString("utf16le",i);if(t){var a=t.charCodeAt(t.length-1);if(a>=55296&&a<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",i,e.length-1)}function Vl(e){var i=e&&e.length?this.write(e):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return i+this.lastChar.toString("utf16le",0,t)}return i}function ql(e,i){var t=(e.length-i)%3;return t===0?e.toString("base64",i):(this.lastNeed=3-t,this.lastTotal=3,t===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",i,e.length-t))}function Hl(e){var i=e&&e.length?this.write(e):"";return this.lastNeed?i+this.lastChar.toString("base64",0,3-this.lastNeed):i}function zl(e){return e.toString(this.encoding)}function Kl(e){return e&&e.length?this.write(e):""}var Vo,st,it,qo,vr,Wt,Ho,zo,ct,Er,$t,fi,Ko,Yo,lr,hr,at,Qo,tr,Sr,di,Go=Qe(()=>{for(ae(),he(),le(),Vo={byteLength:function(e){var i=Bo(e),t=i[0],a=i[1];return 3*(t+a)/4-a},toByteArray:function(e){var i,t,a=Bo(e),h=a[0],n=a[1],r=new qo(function(l,f,p){return 3*(f+p)/4-p}(0,h,n)),s=0,o=n>0?h-4:h;for(t=0;t<o;t+=4)i=it[e.charCodeAt(t)]<<18|it[e.charCodeAt(t+1)]<<12|it[e.charCodeAt(t+2)]<<6|it[e.charCodeAt(t+3)],r[s++]=i>>16&255,r[s++]=i>>8&255,r[s++]=255&i;return n===2&&(i=it[e.charCodeAt(t)]<<2|it[e.charCodeAt(t+1)]>>4,r[s++]=255&i),n===1&&(i=it[e.charCodeAt(t)]<<10|it[e.charCodeAt(t+1)]<<4|it[e.charCodeAt(t+2)]>>2,r[s++]=i>>8&255,r[s++]=255&i),r},fromByteArray:function(e){for(var i,t=e.length,a=t%3,h=[],n=0,r=t-a;n<r;n+=16383)h.push(Cl(e,n,n+16383>r?r:n+16383));return a===1?(i=e[t-1],h.push(st[i>>2]+st[i<<4&63]+"==")):a===2&&(i=(e[t-2]<<8)+e[t-1],h.push(st[i>>10]+st[i>>4&63]+st[i<<2&63]+"=")),h.join("")}},st=[],it=[],qo=typeof Uint8Array<"u"?Uint8Array:Array,vr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Wt=0,Ho=vr.length;Wt<Ho;++Wt)st[Wt]=vr[Wt],it[vr.charCodeAt(Wt)]=Wt;it[45]=62,it[95]=63,zo={read:function(e,i,t,a,h){var n,r,s=8*h-a-1,o=(1<<s)-1,l=o>>1,f=-7,p=t?h-1:0,g=t?-1:1,m=e[i+p];for(p+=g,n=m&(1<<-f)-1,m>>=-f,f+=s;f>0;n=256*n+e[i+p],p+=g,f-=8);for(r=n&(1<<-f)-1,n>>=-f,f+=a;f>0;r=256*r+e[i+p],p+=g,f-=8);if(n===0)n=1-l;else{if(n===o)return r?NaN:1/0*(m?-1:1);r+=Math.pow(2,a),n-=l}return(m?-1:1)*r*Math.pow(2,n-a)},write:function(e,i,t,a,h,n){var r,s,o,l=8*n-h-1,f=(1<<l)-1,p=f>>1,g=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=a?0:n-1,b=a?1:-1,y=i<0||i===0&&1/i<0?1:0;for(i=Math.abs(i),isNaN(i)||i===1/0?(s=isNaN(i)?1:0,r=f):(r=Math.floor(Math.log(i)/Math.LN2),i*(o=Math.pow(2,-r))<1&&(r--,o*=2),(i+=r+p>=1?g/o:g*Math.pow(2,1-p))*o>=2&&(r++,o/=2),r+p>=f?(s=0,r=f):r+p>=1?(s=(i*o-1)*Math.pow(2,h),r+=p):(s=i*Math.pow(2,p-1)*Math.pow(2,h),r=0));h>=8;e[t+m]=255&s,m+=b,s/=256,h-=8);for(r=r<<h|s,l+=h;l>0;e[t+m]=255&r,m+=b,r/=256,l-=8);e[t+m-b]|=128*y}},ct={},Er=Vo,$t=zo,fi=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null,ct.Buffer=pe,ct.SlowBuffer=function(e){return+e!=e&&(e=0),pe.alloc(+e)},ct.INSPECT_MAX_BYTES=50,ct.kMaxLength=2147483647,pe.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),i={foo:function(){return 42}};return Object.setPrototypeOf(i,Uint8Array.prototype),Object.setPrototypeOf(e,i),e.foo()===42}catch{return!1}}(),pe.TYPED_ARRAY_SUPPORT||typeof console>"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(pe.prototype,"parent",{enumerable:!0,get:function(){if(pe.isBuffer(this))return this.buffer}}),Object.defineProperty(pe.prototype,"offset",{enumerable:!0,get:function(){if(pe.isBuffer(this))return this.byteOffset}}),pe.poolSize=8192,pe.from=function(e,i,t){return Oo(e,i,t)},Object.setPrototypeOf(pe.prototype,Uint8Array.prototype),Object.setPrototypeOf(pe,Uint8Array),pe.alloc=function(e,i,t){return function(a,h,n){return Ro(a),a<=0?wt(a):h!==void 0?typeof n=="string"?wt(a).fill(h,n):wt(a).fill(h):wt(a)}(e,i,t)},pe.allocUnsafe=function(e){return si(e)},pe.allocUnsafeSlow=function(e){return si(e)},pe.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==pe.prototype},pe.compare=function(e,i){if(_t(e,Uint8Array)&&(e=pe.from(e,e.offset,e.byteLength)),_t(i,Uint8Array)&&(i=pe.from(i,i.offset,i.byteLength)),!pe.isBuffer(e)||!pe.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===i)return 0;for(var t=e.length,a=i.length,h=0,n=Math.min(t,a);h<n;++h)if(e[h]!==i[h]){t=e[h],a=i[h];break}return t<a?-1:a<t?1:0},pe.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}},pe.concat=function(e,i){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return pe.alloc(0);var t;if(i===void 0)for(i=0,t=0;t<e.length;++t)i+=e[t].length;var a=pe.allocUnsafe(i),h=0;for(t=0;t<e.length;++t){var n=e[t];if(_t(n,Uint8Array)&&(n=pe.from(n)),!pe.isBuffer(n))throw new TypeError('"list" argument must be an Array of Buffers');n.copy(a,h),h+=n.length}return a},pe.byteLength=xo,pe.prototype._isBuffer=!0,pe.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var i=0;i<e;i+=2)Dt(this,i,i+1);return this},pe.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var i=0;i<e;i+=4)Dt(this,i,i+3),Dt(this,i+1,i+2);return this},pe.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var i=0;i<e;i+=8)Dt(this,i,i+7),Dt(this,i+1,i+6),Dt(this,i+2,i+5),Dt(this,i+3,i+4);return this},pe.prototype.toString=function(){var e=this.length;return e===0?"":arguments.length===0?No(this,0,e):Bl.apply(this,arguments)},pe.prototype.toLocaleString=pe.prototype.toString,pe.prototype.equals=function(e){if(!pe.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||pe.compare(this,e)===0},pe.prototype.inspect=function(){var e="",i=ct.INSPECT_MAX_BYTES;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},fi&&(pe.prototype[fi]=pe.prototype.inspect),pe.prototype.compare=function(e,i,t,a,h){if(_t(e,Uint8Array)&&(e=pe.from(e,e.offset,e.byteLength)),!pe.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(i===void 0&&(i=0),t===void 0&&(t=e?e.length:0),a===void 0&&(a=0),h===void 0&&(h=this.length),i<0||t>e.length||a<0||h>this.length)throw new RangeError("out of range index");if(a>=h&&i>=t)return 0;if(a>=h)return-1;if(i>=t)return 1;if(this===e)return 0;for(var n=(h>>>=0)-(a>>>=0),r=(t>>>=0)-(i>>>=0),s=Math.min(n,r),o=this.slice(a,h),l=e.slice(i,t),f=0;f<s;++f)if(o[f]!==l[f]){n=o[f],r=l[f];break}return n<r?-1:r<n?1:0},pe.prototype.includes=function(e,i,t){return this.indexOf(e,i,t)!==-1},pe.prototype.indexOf=function(e,i,t){return Mo(this,e,i,t,!0)},pe.prototype.lastIndexOf=function(e,i,t){return Mo(this,e,i,t,!1)},pe.prototype.write=function(e,i,t,a){if(i===void 0)a="utf8",t=this.length,i=0;else if(t===void 0&&typeof i=="string")a=i,t=this.length,i=0;else{if(!isFinite(i))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");i>>>=0,isFinite(t)?(t>>>=0,a===void 0&&(a="utf8")):(a=t,t=void 0)}var h=this.length-i;if((t===void 0||t>h)&&(t=h),e.length>0&&(t<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var n=!1;;)switch(a){case"hex":return Ol(this,e,i,t);case"utf8":case"utf-8":return Rl(this,e,i,t);case"ascii":return Uo(this,e,i,t);case"latin1":case"binary":return xl(this,e,i,t);case"base64":return Ml(this,e,i,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ll(this,e,i,t);default:if(n)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),n=!0}},pe.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},pe.prototype.slice=function(e,i){var t=this.length;(e=~~e)<0?(e+=t)<0&&(e=0):e>t&&(e=t),(i=i===void 0?t:~~i)<0?(i+=t)<0&&(i=0):i>t&&(i=t),i<e&&(i=e);var a=this.subarray(e,i);return Object.setPrototypeOf(a,pe.prototype),a},pe.prototype.readUIntLE=function(e,i,t){e>>>=0,i>>>=0,t||ze(e,i,this.length);for(var a=this[e],h=1,n=0;++n<i&&(h*=256);)a+=this[e+n]*h;return a},pe.prototype.readUIntBE=function(e,i,t){e>>>=0,i>>>=0,t||ze(e,i,this.length);for(var a=this[e+--i],h=1;i>0&&(h*=256);)a+=this[e+--i]*h;return a},pe.prototype.readUInt8=function(e,i){return e>>>=0,i||ze(e,1,this.length),this[e]},pe.prototype.readUInt16LE=function(e,i){return e>>>=0,i||ze(e,2,this.length),this[e]|this[e+1]<<8},pe.prototype.readUInt16BE=function(e,i){return e>>>=0,i||ze(e,2,this.length),this[e]<<8|this[e+1]},pe.prototype.readUInt32LE=function(e,i){return e>>>=0,i||ze(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},pe.prototype.readUInt32BE=function(e,i){return e>>>=0,i||ze(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},pe.prototype.readIntLE=function(e,i,t){e>>>=0,i>>>=0,t||ze(e,i,this.length);for(var a=this[e],h=1,n=0;++n<i&&(h*=256);)a+=this[e+n]*h;return a>=(h*=128)&&(a-=Math.pow(2,8*i)),a},pe.prototype.readIntBE=function(e,i,t){e>>>=0,i>>>=0,t||ze(e,i,this.length);for(var a=i,h=1,n=this[e+--a];a>0&&(h*=256);)n+=this[e+--a]*h;return n>=(h*=128)&&(n-=Math.pow(2,8*i)),n},pe.prototype.readInt8=function(e,i){return e>>>=0,i||ze(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},pe.prototype.readInt16LE=function(e,i){e>>>=0,i||ze(e,2,this.length);var t=this[e]|this[e+1]<<8;return 32768&t?4294901760|t:t},pe.prototype.readInt16BE=function(e,i){e>>>=0,i||ze(e,2,this.length);var t=this[e+1]|this[e]<<8;return 32768&t?4294901760|t:t},pe.prototype.readInt32LE=function(e,i){return e>>>=0,i||ze(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},pe.prototype.readInt32BE=function(e,i){return e>>>=0,i||ze(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},pe.prototype.readFloatLE=function(e,i){return e>>>=0,i||ze(e,4,this.length),$t.read(this,e,!0,23,4)},pe.prototype.readFloatBE=function(e,i){return e>>>=0,i||ze(e,4,this.length),$t.read(this,e,!1,23,4)},pe.prototype.readDoubleLE=function(e,i){return e>>>=0,i||ze(e,8,this.length),$t.read(this,e,!0,52,8)},pe.prototype.readDoubleBE=function(e,i){return e>>>=0,i||ze(e,8,this.length),$t.read(this,e,!1,52,8)},pe.prototype.writeUIntLE=function(e,i,t,a){e=+e,i>>>=0,t>>>=0,a||rt(this,e,i,t,Math.pow(2,8*t)-1,0);var h=1,n=0;for(this[i]=255&e;++n<t&&(h*=256);)this[i+n]=e/h&255;return i+t},pe.prototype.writeUIntBE=function(e,i,t,a){e=+e,i>>>=0,t>>>=0,a||rt(this,e,i,t,Math.pow(2,8*t)-1,0);var h=t-1,n=1;for(this[i+h]=255&e;--h>=0&&(n*=256);)this[i+h]=e/n&255;return i+t},pe.prototype.writeUInt8=function(e,i,t){return e=+e,i>>>=0,t||rt(this,e,i,1,255,0),this[i]=255&e,i+1},pe.prototype.writeUInt16LE=function(e,i,t){return e=+e,i>>>=0,t||rt(this,e,i,2,65535,0),this[i]=255&e,this[i+1]=e>>>8,i+2},pe.prototype.writeUInt16BE=function(e,i,t){return e=+e,i>>>=0,t||rt(this,e,i,2,65535,0),this[i]=e>>>8,this[i+1]=255&e,i+2},pe.prototype.writeUInt32LE=function(e,i,t){return e=+e,i>>>=0,t||rt(this,e,i,4,4294967295,0),this[i+3]=e>>>24,this[i+2]=e>>>16,this[i+1]=e>>>8,this[i]=255&e,i+4},pe.prototype.writeUInt32BE=function(e,i,t){return e=+e,i>>>=0,t||rt(this,e,i,4,4294967295,0),this[i]=e>>>24,this[i+1]=e>>>16,this[i+2]=e>>>8,this[i+3]=255&e,i+4},pe.prototype.writeIntLE=function(e,i,t,a){if(e=+e,i>>>=0,!a){var h=Math.pow(2,8*t-1);rt(this,e,i,t,h-1,-h)}var n=0,r=1,s=0;for(this[i]=255&e;++n<t&&(r*=256);)e<0&&s===0&&this[i+n-1]!==0&&(s=1),this[i+n]=(e/r>>0)-s&255;return i+t},pe.prototype.writeIntBE=function(e,i,t,a){if(e=+e,i>>>=0,!a){var h=Math.pow(2,8*t-1);rt(this,e,i,t,h-1,-h)}var n=t-1,r=1,s=0;for(this[i+n]=255&e;--n>=0&&(r*=256);)e<0&&s===0&&this[i+n+1]!==0&&(s=1),this[i+n]=(e/r>>0)-s&255;return i+t},pe.prototype.writeInt8=function(e,i,t){return e=+e,i>>>=0,t||rt(this,e,i,1,127,-128),e<0&&(e=255+e+1),this[i]=255&e,i+1},pe.prototype.writeInt16LE=function(e,i,t){return e=+e,i>>>=0,t||rt(this,e,i,2,32767,-32768),this[i]=255&e,this[i+1]=e>>>8,i+2},pe.prototype.writeInt16BE=function(e,i,t){return e=+e,i>>>=0,t||rt(this,e,i,2,32767,-32768),this[i]=e>>>8,this[i+1]=255&e,i+2},pe.prototype.writeInt32LE=function(e,i,t){return e=+e,i>>>=0,t||rt(this,e,i,4,2147483647,-2147483648),this[i]=255&e,this[i+1]=e>>>8,this[i+2]=e>>>16,this[i+3]=e>>>24,i+4},pe.prototype.writeInt32BE=function(e,i,t){return e=+e,i>>>=0,t||rt(this,e,i,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[i]=e>>>24,this[i+1]=e>>>16,this[i+2]=e>>>8,this[i+3]=255&e,i+4},pe.prototype.writeFloatLE=function(e,i,t){return Do(this,e,i,!0,t)},pe.prototype.writeFloatBE=function(e,i,t){return Do(this,e,i,!1,t)},pe.prototype.writeDoubleLE=function(e,i,t){return Fo(this,e,i,!0,t)},pe.prototype.writeDoubleBE=function(e,i,t){return Fo(this,e,i,!1,t)},pe.prototype.copy=function(e,i,t,a){if(!pe.isBuffer(e))throw new TypeError("argument should be a Buffer");if(t||(t=0),a||a===0||(a=this.length),i>=e.length&&(i=e.length),i||(i=0),a>0&&a<t&&(a=t),a===t||e.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(t<0||t>=this.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-i<a-t&&(a=e.length-i+t);var h=a-t;if(this===e&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin(i,t,a);else if(this===e&&t<i&&i<a)for(var n=h-1;n>=0;--n)e[n+i]=this[n+t];else Uint8Array.prototype.set.call(e,this.subarray(t,a),i);return h},pe.prototype.fill=function(e,i,t,a){if(typeof e=="string"){if(typeof i=="string"?(a=i,i=0,t=this.length):typeof t=="string"&&(a=t,t=this.length),a!==void 0&&typeof a!="string")throw new TypeError("encoding must be a string");if(typeof a=="string"&&!pe.isEncoding(a))throw new TypeError("Unknown encoding: "+a);if(e.length===1){var h=e.charCodeAt(0);(a==="utf8"&&h<128||a==="latin1")&&(e=h)}}else typeof e=="number"?e&=255:typeof e=="boolean"&&(e=Number(e));if(i<0||this.length<i||this.length<t)throw new RangeError("Out of range index");if(t<=i)return this;var n;if(i>>>=0,t=t===void 0?this.length:t>>>0,e||(e=0),typeof e=="number")for(n=i;n<t;++n)this[n]=e;else{var r=pe.isBuffer(e)?e:pe.from(e,a),s=r.length;if(s===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(n=0;n<t-i;++n)this[n+i]=r[n%s]}return this},Ko=/[^+/0-9A-Za-z-_]/g,Yo=function(){for(var e=new Array(256),i=0;i<16;++i)for(var t=16*i,a=0;a<16;++a)e[t+a]="0123456789abcdef"[i]+"0123456789abcdef"[a];return e}(),ct.Buffer,ct.INSPECT_MAX_BYTES,ct.kMaxLength,lr={},hr=ct,at=hr.Buffer,at.from&&at.alloc&&at.allocUnsafe&&at.allocUnsafeSlow?lr=hr:($o(hr,lr),lr.Buffer=Ft),Ft.prototype=Object.create(at.prototype),$o(at,Ft),Ft.from=function(e,i,t){if(typeof e=="number")throw new TypeError("Argument must not be a number");return at(e,i,t)},Ft.alloc=function(e,i,t){if(typeof e!="number")throw new TypeError("Argument must be a number");var a=at(e);return i!==void 0?typeof t=="string"?a.fill(i,t):a.fill(i):a.fill(0),a},Ft.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return at(e)},Ft.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return hr.SlowBuffer(e)},Qo=lr,tr={},Sr=Qo.Buffer,di=Sr.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}},tr.StringDecoder=ar,ar.prototype.write=function(e){if(e.length===0)return"";var i,t;if(this.lastNeed){if((i=this.fillLast(e))===void 0)return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t<e.length?i?i+this.text(e,t):this.text(e,t):i||""},ar.prototype.end=function(e){var i=e&&e.length?this.write(e):"";return this.lastNeed?i+"�":i},ar.prototype.text=function(e,i){var t=function(h,n,r){var s=n.length-1;if(s<r)return 0;var o=ci(n[s]);return o>=0?(o>0&&(h.lastNeed=o-1),o):--s<r||o===-2?0:(o=ci(n[s]))>=0?(o>0&&(h.lastNeed=o-2),o):--s<r||o===-2?0:(o=ci(n[s]))>=0?(o>0&&(o===2?o=0:h.lastNeed=o-3),o):0}(this,e,i);if(!this.lastNeed)return e.toString("utf8",i);this.lastTotal=t;var a=e.length-(t-this.lastNeed);return e.copy(this.lastChar,0,a),e.toString("utf8",i,a)},ar.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},tr.StringDecoder,tr.StringDecoder}),Jo={};xt(Jo,{StringDecoder:()=>Zo,default:()=>tr});var Zo,Yl=Qe(()=>{ae(),he(),le(),Go(),Go(),Zo=tr.StringDecoder}),Xo=be((e,i)=>{ae(),he(),le();var t=Ut(),{PromisePrototypeThen:a,SymbolAsyncIterator:h,SymbolIterator:n}=He(),{Buffer:r}=(Je(),Le(Ge)),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_NULL_VALUES:o}=tt().codes;function l(f,p,g){let m;if(typeof p=="string"||p instanceof r)return new f({objectMode:!0,...g,read(){this.push(p),this.push(null)}});let b;if(p&&p[h])b=!0,m=p[h]();else if(p&&p[n])b=!1,m=p[n]();else throw new s("iterable",["Iterable"],p);let y=new f({objectMode:!0,highWaterMark:1,...g}),A=!1;y._read=function(){A||(A=!0,k())},y._destroy=function(v,U){a(M(v),()=>t.nextTick(U,v),j=>t.nextTick(U,j||v))};async function M(v){let U=v!=null,j=typeof m.throw=="function";if(U&&j){let{value:C,done:T}=await m.throw(v);if(await C,T)return}if(typeof m.return=="function"){let{value:C}=await m.return();await C}}async function k(){for(;;){try{let{value:v,done:U}=b?await m.next():m.next();if(U)y.push(null);else{let j=v&&typeof v.then=="function"?await v:v;if(j===null)throw A=!1,new o;if(y.push(j))continue;A=!1}}catch(v){y.destroy(v)}break}}return y}i.exports=l}),Ar=be((e,i)=>{ae(),he(),le();var t=Ut(),{ArrayPrototypeIndexOf:a,NumberIsInteger:h,NumberIsNaN:n,NumberParseInt:r,ObjectDefineProperties:s,ObjectKeys:o,ObjectSetPrototypeOf:l,Promise:f,SafeSet:p,SymbolAsyncIterator:g,Symbol:m}=He();i.exports=_,_.ReadableState=_e;var{EventEmitter:b}=(er(),Le(jt)),{Stream:y,prependListener:A}=ii(),{Buffer:M}=(Je(),Le(Ge)),{addAbortSignal:k}=wr(),v=Pt(),U=bt().debuglog("stream",u=>{U=u}),j=Tl(),C=Xt(),{getHighWaterMark:T,getDefaultHighWaterMark:x}=oi(),{aggregateTwoErrors:V,codes:{ERR_INVALID_ARG_TYPE:J,ERR_METHOD_NOT_IMPLEMENTED:ne,ERR_OUT_OF_RANGE:S,ERR_STREAM_PUSH_AFTER_EOF:z,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:re}}=tt(),{validateObject:Q}=br(),me=m("kPaused"),{StringDecoder:se}=(Yl(),Le(Jo)),H=Xo();l(_.prototype,y.prototype),l(_,y);var ye=()=>{},{errorOrDestroy:oe}=C;function _e(u,d,w){typeof w!="boolean"&&(w=d instanceof vt()),this.objectMode=!!(u&&u.objectMode),w&&(this.objectMode=this.objectMode||!!(u&&u.readableObjectMode)),this.highWaterMark=u?T(this,u,"readableHighWaterMark",w):x(!1),this.buffer=new j,this.length=0,this.pipes=[],this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.constructed=!0,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this[me]=null,this.errorEmitted=!1,this.emitClose=!u||u.emitClose!==!1,this.autoDestroy=!u||u.autoDestroy!==!1,this.destroyed=!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this.defaultEncoding=u&&u.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.multiAwaitDrain=!1,this.readingMore=!1,this.dataEmitted=!1,this.decoder=null,this.encoding=null,u&&u.encoding&&(this.decoder=new se(u.encoding),this.encoding=u.encoding)}function _(u){if(!(this instanceof _))return new _(u);let d=this instanceof vt();this._readableState=new _e(u,this,d),u&&(typeof u.read=="function"&&(this._read=u.read),typeof u.destroy=="function"&&(this._destroy=u.destroy),typeof u.construct=="function"&&(this._construct=u.construct),u.signal&&!d&&k(u.signal,this)),y.call(this,u),C.construct(this,()=>{this._readableState.needReadable&&te(this,this._readableState)})}_.prototype.destroy=C.destroy,_.prototype._undestroy=C.undestroy,_.prototype._destroy=function(u,d){d(u)},_.prototype[b.captureRejectionSymbol]=function(u){this.destroy(u)},_.prototype.push=function(u,d){return G(this,u,d,!1)},_.prototype.unshift=function(u,d){return G(this,u,d,!0)};function G(u,d,w,I){U("readableAddChunk",d);let W=u._readableState,ee;if(W.objectMode||(typeof d=="string"?(w=w||W.defaultEncoding,W.encoding!==w&&(I&&W.encoding?d=M.from(d,w).toString(W.encoding):(d=M.from(d,w),w=""))):d instanceof M?w="":y._isUint8Array(d)?(d=y._uint8ArrayToBuffer(d),w=""):d!=null&&(ee=new J("chunk",["string","Buffer","Uint8Array"],d))),ee)oe(u,ee);else if(d===null)W.reading=!1,E(u,W);else if(W.objectMode||d&&d.length>0)if(I)if(W.endEmitted)oe(u,new re);else{if(W.destroyed||W.errored)return!1;de(u,W,d,!0)}else if(W.ended)oe(u,new z);else{if(W.destroyed||W.errored)return!1;W.reading=!1,W.decoder&&!w?(d=W.decoder.write(d),W.objectMode||d.length!==0?de(u,W,d,!1):te(u,W)):de(u,W,d,!1)}else I||(W.reading=!1,te(u,W));return!W.ended&&(W.length<W.highWaterMark||W.length===0)}function de(u,d,w,I){d.flowing&&d.length===0&&!d.sync&&u.listenerCount("data")>0?(d.multiAwaitDrain?d.awaitDrainWriters.clear():d.awaitDrainWriters=null,d.dataEmitted=!0,u.emit("data",w)):(d.length+=d.objectMode?1:w.length,I?d.buffer.unshift(w):d.buffer.push(w),d.needReadable&&Y(u)),te(u,d)}_.prototype.isPaused=function(){let u=this._readableState;return u[me]===!0||u.flowing===!1},_.prototype.setEncoding=function(u){let d=new se(u);this._readableState.decoder=d,this._readableState.encoding=this._readableState.decoder.encoding;let w=this._readableState.buffer,I="";for(let W of w)I+=d.write(W);return w.clear(),I!==""&&w.push(I),this._readableState.length=I.length,this};var ve=1073741824;function ce(u){if(u>ve)throw new S("size","<= 1GiB",u);return u--,u|=u>>>1,u|=u>>>2,u|=u>>>4,u|=u>>>8,u|=u>>>16,u++,u}function R(u,d){return u<=0||d.length===0&&d.ended?0:d.objectMode?1:n(u)?d.flowing&&d.length?d.buffer.first().length:d.length:u<=d.length?u:d.ended?d.length:0}_.prototype.read=function(u){U("read",u),u===void 0?u=NaN:h(u)||(u=r(u,10));let d=this._readableState,w=u;if(u>d.highWaterMark&&(d.highWaterMark=ce(u)),u!==0&&(d.emittedReadable=!1),u===0&&d.needReadable&&((d.highWaterMark!==0?d.length>=d.highWaterMark:d.length>0)||d.ended))return U("read: emitReadable",d.length,d.ended),d.length===0&&d.ended?P(this):Y(this),null;if(u=R(u,d),u===0&&d.ended)return d.length===0&&P(this),null;let I=d.needReadable;if(U("need readable",I),(d.length===0||d.length-u<d.highWaterMark)&&(I=!0,U("length less than watermark",I)),d.ended||d.reading||d.destroyed||d.errored||!d.constructed)I=!1,U("reading, ended or constructing",I);else if(I){U("do read"),d.reading=!0,d.sync=!0,d.length===0&&(d.needReadable=!0);try{this._read(d.highWaterMark)}catch(ee){oe(this,ee)}d.sync=!1,d.reading||(u=R(w,d))}let W;return u>0?W=K(u,d):W=null,W===null?(d.needReadable=d.length<=d.highWaterMark,u=0):(d.length-=u,d.multiAwaitDrain?d.awaitDrainWriters.clear():d.awaitDrainWriters=null),d.length===0&&(d.ended||(d.needReadable=!0),w!==u&&d.ended&&P(this)),W!==null&&!d.errorEmitted&&!d.closeEmitted&&(d.dataEmitted=!0,this.emit("data",W)),W};function E(u,d){if(U("onEofChunk"),!d.ended){if(d.decoder){let w=d.decoder.end();w&&w.length&&(d.buffer.push(w),d.length+=d.objectMode?1:w.length)}d.ended=!0,d.sync?Y(u):(d.needReadable=!1,d.emittedReadable=!0,fe(u))}}function Y(u){let d=u._readableState;U("emitReadable",d.needReadable,d.emittedReadable),d.needReadable=!1,d.emittedReadable||(U("emitReadable",d.flowing),d.emittedReadable=!0,t.nextTick(fe,u))}function fe(u){let d=u._readableState;U("emitReadable_",d.destroyed,d.length,d.ended),!d.destroyed&&!d.errored&&(d.length||d.ended)&&(u.emit("readable"),d.emittedReadable=!1),d.needReadable=!d.flowing&&!d.ended&&d.length<=d.highWaterMark,ie(u)}function te(u,d){!d.readingMore&&d.constructed&&(d.readingMore=!0,t.nextTick(X,u,d))}function X(u,d){for(;!d.reading&&!d.ended&&(d.length<d.highWaterMark||d.flowing&&d.length===0);){let w=d.length;if(U("maybeReadMore read 0"),u.read(0),w===d.length)break}d.readingMore=!1}_.prototype._read=function(u){throw new ne("_read()")},_.prototype.pipe=function(u,d){let w=this,I=this._readableState;I.pipes.length===1&&(I.multiAwaitDrain||(I.multiAwaitDrain=!0,I.awaitDrainWriters=new p(I.awaitDrainWriters?[I.awaitDrainWriters]:[]))),I.pipes.push(u),U("pipe count=%d opts=%j",I.pipes.length,d);let W=(!d||d.end!==!1)&&u!==t.stdout&&u!==t.stderr?Ie:Ze;I.endEmitted?t.nextTick(W):w.once("end",W),u.on("unpipe",ee);function ee(et,Ye){U("onunpipe"),et===w&&Ye&&Ye.hasUnpiped===!1&&(Ye.hasUnpiped=!0,Ae())}function Ie(){U("onend"),u.end()}let Pe,Be=!1;function Ae(){U("cleanup"),u.removeListener("close",Ke),u.removeListener("finish",qe),Pe&&u.removeListener("drain",Pe),u.removeListener("error",Ue),u.removeListener("unpipe",ee),w.removeListener("end",Ie),w.removeListener("end",Ze),w.removeListener("data",Te),Be=!0,Pe&&I.awaitDrainWriters&&(!u._writableState||u._writableState.needDrain)&&Pe()}function Ce(){Be||(I.pipes.length===1&&I.pipes[0]===u?(U("false write response, pause",0),I.awaitDrainWriters=u,I.multiAwaitDrain=!1):I.pipes.length>1&&I.pipes.includes(u)&&(U("false write response, pause",I.awaitDrainWriters.size),I.awaitDrainWriters.add(u)),w.pause()),Pe||(Pe=we(w,u),u.on("drain",Pe))}w.on("data",Te);function Te(et){U("ondata");let Ye=u.write(et);U("dest.write",Ye),Ye===!1&&Ce()}function Ue(et){if(U("onerror",et),Ze(),u.removeListener("error",Ue),u.listenerCount("error")===0){let Ye=u._writableState||u._readableState;Ye&&!Ye.errorEmitted?oe(u,et):u.emit("error",et)}}A(u,"error",Ue);function Ke(){u.removeListener("finish",qe),Ze()}u.once("close",Ke);function qe(){U("onfinish"),u.removeListener("close",Ke),Ze()}u.once("finish",qe);function Ze(){U("unpipe"),w.unpipe(u)}return u.emit("pipe",w),u.writableNeedDrain===!0?I.flowing&&Ce():I.flowing||(U("pipe resume"),w.resume()),u};function we(u,d){return function(){let w=u._readableState;w.awaitDrainWriters===d?(U("pipeOnDrain",1),w.awaitDrainWriters=null):w.multiAwaitDrain&&(U("pipeOnDrain",w.awaitDrainWriters.size),w.awaitDrainWriters.delete(d)),(!w.awaitDrainWriters||w.awaitDrainWriters.size===0)&&u.listenerCount("data")&&u.resume()}}_.prototype.unpipe=function(u){let d=this._readableState,w={hasUnpiped:!1};if(d.pipes.length===0)return this;if(!u){let W=d.pipes;d.pipes=[],this.pause();for(let ee=0;ee<W.length;ee++)W[ee].emit("unpipe",this,{hasUnpiped:!1});return this}let I=a(d.pipes,u);return I===-1?this:(d.pipes.splice(I,1),d.pipes.length===0&&this.pause(),u.emit("unpipe",this,w),this)},_.prototype.on=function(u,d){let w=y.prototype.on.call(this,u,d),I=this._readableState;return u==="data"?(I.readableListening=this.listenerCount("readable")>0,I.flowing!==!1&&this.resume()):u==="readable"&&!I.endEmitted&&!I.readableListening&&(I.readableListening=I.needReadable=!0,I.flowing=!1,I.emittedReadable=!1,U("on readable",I.length,I.reading),I.length?Y(this):I.reading||t.nextTick(B,this)),w},_.prototype.addListener=_.prototype.on,_.prototype.removeListener=function(u,d){let w=y.prototype.removeListener.call(this,u,d);return u==="readable"&&t.nextTick(ge,this),w},_.prototype.off=_.prototype.removeListener,_.prototype.removeAllListeners=function(u){let d=y.prototype.removeAllListeners.apply(this,arguments);return(u==="readable"||u===void 0)&&t.nextTick(ge,this),d};function ge(u){let d=u._readableState;d.readableListening=u.listenerCount("readable")>0,d.resumeScheduled&&d[me]===!1?d.flowing=!0:u.listenerCount("data")>0?u.resume():d.readableListening||(d.flowing=null)}function B(u){U("readable nexttick read 0"),u.read(0)}_.prototype.resume=function(){let u=this._readableState;return u.flowing||(U("resume"),u.flowing=!u.readableListening,D(this,u)),u[me]=!1,this};function D(u,d){d.resumeScheduled||(d.resumeScheduled=!0,t.nextTick(F,u,d))}function F(u,d){U("resume",d.reading),d.reading||u.read(0),d.resumeScheduled=!1,u.emit("resume"),ie(u),d.flowing&&!d.reading&&u.read(0)}_.prototype.pause=function(){return U("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(U("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[me]=!0,this};function ie(u){let d=u._readableState;for(U("flow",d.flowing);d.flowing&&u.read()!==null;);}_.prototype.wrap=function(u){let d=!1;u.on("data",I=>{!this.push(I)&&u.pause&&(d=!0,u.pause())}),u.on("end",()=>{this.push(null)}),u.on("error",I=>{oe(this,I)}),u.on("close",()=>{this.destroy()}),u.on("destroy",()=>{this.destroy()}),this._read=()=>{d&&u.resume&&(d=!1,u.resume())};let w=o(u);for(let I=1;I<w.length;I++){let W=w[I];this[W]===void 0&&typeof u[W]=="function"&&(this[W]=u[W].bind(u))}return this},_.prototype[g]=function(){return Z(this)},_.prototype.iterator=function(u){return u!==void 0&&Q(u,"options"),Z(this,u)};function Z(u,d){typeof u.read!="function"&&(u=_.wrap(u,{objectMode:!0}));let w=L(u,d);return w.stream=u,w}async function*L(u,d){let w=ye;function I(Ie){this===u?(w(),w=ye):w=Ie}u.on("readable",I);let W,ee=v(u,{writable:!1},Ie=>{W=Ie?V(W,Ie):null,w(),w=ye});try{for(;;){let Ie=u.destroyed?null:u.read();if(Ie!==null)yield Ie;else{if(W)throw W;if(W===null)return;await new f(I)}}}catch(Ie){throw W=V(W,Ie),W}finally{(W||(d==null?void 0:d.destroyOnReturn)!==!1)&&(W===void 0||u._readableState.autoDestroy)?C.destroyer(u,null):(u.off("readable",I),ee())}}s(_.prototype,{readable:{__proto__:null,get(){let u=this._readableState;return!!u&&u.readable!==!1&&!u.destroyed&&!u.errorEmitted&&!u.endEmitted},set(u){this._readableState&&(this._readableState.readable=!!u)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(u){this._readableState&&(this._readableState.flowing=u)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(u){this._readableState&&(this._readableState.destroyed=u)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),s(_e.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[me]!==!1},set(u){this[me]=!!u}}}),_._fromList=K;function K(u,d){if(d.length===0)return null;let w;return d.objectMode?w=d.buffer.shift():!u||u>=d.length?(d.decoder?w=d.buffer.join(""):d.buffer.length===1?w=d.buffer.first():w=d.buffer.concat(d.length),d.buffer.clear()):w=d.buffer.consume(u,d.decoder),w}function P(u){let d=u._readableState;U("endReadable",d.endEmitted),d.endEmitted||(d.ended=!0,t.nextTick(N,d,u))}function N(u,d){if(U("endReadableNT",u.endEmitted,u.length),!u.errored&&!u.closeEmitted&&!u.endEmitted&&u.length===0){if(u.endEmitted=!0,d.emit("end"),d.writable&&d.allowHalfOpen===!1)t.nextTick(q,d);else if(u.autoDestroy){let w=d._writableState;(!w||w.autoDestroy&&(w.finished||w.writable===!1))&&d.destroy()}}}function q(u){u.writable&&!u.writableEnded&&!u.destroyed&&u.end()}_.from=function(u,d){return H(_,u,d)};var ue;function c(){return ue===void 0&&(ue={}),ue}_.fromWeb=function(u,d){return c().newStreamReadableFromReadableStream(u,d)},_.toWeb=function(u,d){return c().newReadableStreamFromStreamReadable(u,d)},_.wrap=function(u,d){var w,I;return new _({objectMode:(w=(I=u.readableObjectMode)!==null&&I!==void 0?I:u.objectMode)!==null&&w!==void 0?w:!0,...d,destroy(W,ee){C.destroyer(u,W),ee(W)}}).wrap(u)}}),es=be((e,i)=>{ae(),he(),le();var t=Ut(),{ArrayPrototypeSlice:a,Error:h,FunctionPrototypeSymbolHasInstance:n,ObjectDefineProperty:r,ObjectDefineProperties:s,ObjectSetPrototypeOf:o,StringPrototypeToLowerCase:l,Symbol:f,SymbolHasInstance:p}=He();i.exports=se,se.WritableState=Q;var{EventEmitter:g}=(er(),Le(jt)),m=ii().Stream,{Buffer:b}=(Je(),Le(Ge)),y=Xt(),{addAbortSignal:A}=wr(),{getHighWaterMark:M,getDefaultHighWaterMark:k}=oi(),{ERR_INVALID_ARG_TYPE:v,ERR_METHOD_NOT_IMPLEMENTED:U,ERR_MULTIPLE_CALLBACK:j,ERR_STREAM_CANNOT_PIPE:C,ERR_STREAM_DESTROYED:T,ERR_STREAM_ALREADY_FINISHED:x,ERR_STREAM_NULL_VALUES:V,ERR_STREAM_WRITE_AFTER_END:J,ERR_UNKNOWN_ENCODING:ne}=tt().codes,{errorOrDestroy:S}=y;o(se.prototype,m.prototype),o(se,m);function z(){}var re=f("kOnFinished");function Q(B,D,F){typeof F!="boolean"&&(F=D instanceof vt()),this.objectMode=!!(B&&B.objectMode),F&&(this.objectMode=this.objectMode||!!(B&&B.writableObjectMode)),this.highWaterMark=B?M(this,B,"writableHighWaterMark",F):k(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let ie=!!(B&&B.decodeStrings===!1);this.decodeStrings=!ie,this.defaultEncoding=B&&B.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=_.bind(void 0,D),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,me(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!B||B.emitClose!==!1,this.autoDestroy=!B||B.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[re]=[]}function me(B){B.buffered=[],B.bufferedIndex=0,B.allBuffers=!0,B.allNoop=!0}Q.prototype.getBuffer=function(){return a(this.buffered,this.bufferedIndex)},r(Q.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function se(B){let D=this instanceof vt();if(!D&&!n(se,this))return new se(B);this._writableState=new Q(B,this,D),B&&(typeof B.write=="function"&&(this._write=B.write),typeof B.writev=="function"&&(this._writev=B.writev),typeof B.destroy=="function"&&(this._destroy=B.destroy),typeof B.final=="function"&&(this._final=B.final),typeof B.construct=="function"&&(this._construct=B.construct),B.signal&&A(B.signal,this)),m.call(this,B),y.construct(this,()=>{let F=this._writableState;F.writing||ce(this,F),fe(this,F)})}r(se,p,{__proto__:null,value:function(B){return n(this,B)?!0:this!==se?!1:B&&B._writableState instanceof Q}}),se.prototype.pipe=function(){S(this,new C)};function H(B,D,F,ie){let Z=B._writableState;if(typeof F=="function")ie=F,F=Z.defaultEncoding;else{if(!F)F=Z.defaultEncoding;else if(F!=="buffer"&&!b.isEncoding(F))throw new ne(F);typeof ie!="function"&&(ie=z)}if(D===null)throw new V;if(!Z.objectMode)if(typeof D=="string")Z.decodeStrings!==!1&&(D=b.from(D,F),F="buffer");else if(D instanceof b)F="buffer";else if(m._isUint8Array(D))D=m._uint8ArrayToBuffer(D),F="buffer";else throw new v("chunk",["string","Buffer","Uint8Array"],D);let L;return Z.ending?L=new J:Z.destroyed&&(L=new T("write")),L?(t.nextTick(ie,L),S(B,L,!0),L):(Z.pendingcb++,ye(B,Z,D,F,ie))}se.prototype.write=function(B,D,F){return H(this,B,D,F)===!0},se.prototype.cork=function(){this._writableState.corked++},se.prototype.uncork=function(){let B=this._writableState;B.corked&&(B.corked--,B.writing||ce(this,B))},se.prototype.setDefaultEncoding=function(B){if(typeof B=="string"&&(B=l(B)),!b.isEncoding(B))throw new ne(B);return this._writableState.defaultEncoding=B,this};function ye(B,D,F,ie,Z){let L=D.objectMode?1:F.length;D.length+=L;let K=D.length<D.highWaterMark;return K||(D.needDrain=!0),D.writing||D.corked||D.errored||!D.constructed?(D.buffered.push({chunk:F,encoding:ie,callback:Z}),D.allBuffers&&ie!=="buffer"&&(D.allBuffers=!1),D.allNoop&&Z!==z&&(D.allNoop=!1)):(D.writelen=L,D.writecb=Z,D.writing=!0,D.sync=!0,B._write(F,ie,D.onwrite),D.sync=!1),K&&!D.errored&&!D.destroyed}function oe(B,D,F,ie,Z,L,K){D.writelen=ie,D.writecb=K,D.writing=!0,D.sync=!0,D.destroyed?D.onwrite(new T("write")):F?B._writev(Z,D.onwrite):B._write(Z,L,D.onwrite),D.sync=!1}function _e(B,D,F,ie){--D.pendingcb,ie(F),ve(D),S(B,F)}function _(B,D){let F=B._writableState,ie=F.sync,Z=F.writecb;if(typeof Z!="function"){S(B,new j);return}F.writing=!1,F.writecb=null,F.length-=F.writelen,F.writelen=0,D?(D.stack,F.errored||(F.errored=D),B._readableState&&!B._readableState.errored&&(B._readableState.errored=D),ie?t.nextTick(_e,B,F,D,Z):_e(B,F,D,Z)):(F.buffered.length>F.bufferedIndex&&ce(B,F),ie?F.afterWriteTickInfo!==null&&F.afterWriteTickInfo.cb===Z?F.afterWriteTickInfo.count++:(F.afterWriteTickInfo={count:1,cb:Z,stream:B,state:F},t.nextTick(G,F.afterWriteTickInfo)):de(B,F,1,Z))}function G({stream:B,state:D,count:F,cb:ie}){return D.afterWriteTickInfo=null,de(B,D,F,ie)}function de(B,D,F,ie){for(!D.ending&&!B.destroyed&&D.length===0&&D.needDrain&&(D.needDrain=!1,B.emit("drain"));F-- >0;)D.pendingcb--,ie();D.destroyed&&ve(D),fe(B,D)}function ve(B){if(B.writing)return;for(let Z=B.bufferedIndex;Z<B.buffered.length;++Z){var D;let{chunk:L,callback:K}=B.buffered[Z],P=B.objectMode?1:L.length;B.length-=P,K((D=B.errored)!==null&&D!==void 0?D:new T("write"))}let F=B[re].splice(0);for(let Z=0;Z<F.length;Z++){var ie;F[Z]((ie=B.errored)!==null&&ie!==void 0?ie:new T("end"))}me(B)}function ce(B,D){if(D.corked||D.bufferProcessing||D.destroyed||!D.constructed)return;let{buffered:F,bufferedIndex:ie,objectMode:Z}=D,L=F.length-ie;if(!L)return;let K=ie;if(D.bufferProcessing=!0,L>1&&B._writev){D.pendingcb-=L-1;let P=D.allNoop?z:q=>{for(let ue=K;ue<F.length;++ue)F[ue].callback(q)},N=D.allNoop&&K===0?F:a(F,K);N.allBuffers=D.allBuffers,oe(B,D,!0,D.length,N,"",P),me(D)}else{do{let{chunk:P,encoding:N,callback:q}=F[K];F[K++]=null;let ue=Z?1:P.length;oe(B,D,!1,ue,P,N,q)}while(K<F.length&&!D.writing);K===F.length?me(D):K>256?(F.splice(0,K),D.bufferedIndex=0):D.bufferedIndex=K}D.bufferProcessing=!1}se.prototype._write=function(B,D,F){if(this._writev)this._writev([{chunk:B,encoding:D}],F);else throw new U("_write()")},se.prototype._writev=null,se.prototype.end=function(B,D,F){let ie=this._writableState;typeof B=="function"?(F=B,B=null,D=null):typeof D=="function"&&(F=D,D=null);let Z;if(B!=null){let L=H(this,B,D);L instanceof h&&(Z=L)}return ie.corked&&(ie.corked=1,this.uncork()),Z||(!ie.errored&&!ie.ending?(ie.ending=!0,fe(this,ie,!0),ie.ended=!0):ie.finished?Z=new x("end"):ie.destroyed&&(Z=new T("end"))),typeof F=="function"&&(Z||ie.finished?t.nextTick(F,Z):ie[re].push(F)),this};function R(B){return B.ending&&!B.destroyed&&B.constructed&&B.length===0&&!B.errored&&B.buffered.length===0&&!B.finished&&!B.writing&&!B.errorEmitted&&!B.closeEmitted}function E(B,D){let F=!1;function ie(Z){if(F){S(B,Z??j());return}if(F=!0,D.pendingcb--,Z){let L=D[re].splice(0);for(let K=0;K<L.length;K++)L[K](Z);S(B,Z,D.sync)}else R(D)&&(D.prefinished=!0,B.emit("prefinish"),D.pendingcb++,t.nextTick(te,B,D))}D.sync=!0,D.pendingcb++;try{B._final(ie)}catch(Z){ie(Z)}D.sync=!1}function Y(B,D){!D.prefinished&&!D.finalCalled&&(typeof B._final=="function"&&!D.destroyed?(D.finalCalled=!0,E(B,D)):(D.prefinished=!0,B.emit("prefinish")))}function fe(B,D,F){R(D)&&(Y(B,D),D.pendingcb===0&&(F?(D.pendingcb++,t.nextTick((ie,Z)=>{R(Z)?te(ie,Z):Z.pendingcb--},B,D)):R(D)&&(D.pendingcb++,te(B,D))))}function te(B,D){D.pendingcb--,D.finished=!0;let F=D[re].splice(0);for(let ie=0;ie<F.length;ie++)F[ie]();if(B.emit("finish"),D.autoDestroy){let ie=B._readableState;(!ie||ie.autoDestroy&&(ie.endEmitted||ie.readable===!1))&&B.destroy()}}s(se.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(B){this._writableState&&(this._writableState.destroyed=B)}},writable:{__proto__:null,get(){let B=this._writableState;return!!B&&B.writable!==!1&&!B.destroyed&&!B.errored&&!B.ending&&!B.ended},set(B){this._writableState&&(this._writableState.writable=!!B)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let B=this._writableState;return B?!B.destroyed&&!B.ending&&B.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var X=y.destroy;se.prototype.destroy=function(B,D){let F=this._writableState;return!F.destroyed&&(F.bufferedIndex<F.buffered.length||F[re].length)&&t.nextTick(ve,F),X.call(this,B,D),this},se.prototype._undestroy=y.undestroy,se.prototype._destroy=function(B,D){D(B)},se.prototype[g.captureRejectionSymbol]=function(B){this.destroy(B)};var we;function ge(){return we===void 0&&(we={}),we}se.fromWeb=function(B,D){return ge().newStreamWritableFromWritableStream(B,D)},se.toWeb=function(B){return ge().newWritableStreamFromStreamWritable(B)}}),Ql=be((e,i)=>{ae(),he(),le();var t=Ut(),a=(Je(),Le(Ge)),{isReadable:h,isWritable:n,isIterable:r,isNodeStream:s,isReadableNodeStream:o,isWritableNodeStream:l,isDuplexNodeStream:f}=yt(),p=Pt(),{AbortError:g,codes:{ERR_INVALID_ARG_TYPE:m,ERR_INVALID_RETURN_VALUE:b}}=tt(),{destroyer:y}=Xt(),A=vt(),M=Ar(),{createDeferredPromise:k}=bt(),v=Xo(),U=globalThis.Blob||a.Blob,j=typeof U<"u"?function(ne){return ne instanceof U}:function(ne){return!1},C=globalThis.AbortController||ei().AbortController,{FunctionPrototypeCall:T}=He(),x=class extends A{constructor(ne){super(ne),(ne==null?void 0:ne.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(ne==null?void 0:ne.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};i.exports=function ne(S,z){if(f(S))return S;if(o(S))return J({readable:S});if(l(S))return J({writable:S});if(s(S))return J({writable:!1,readable:!1});if(typeof S=="function"){let{value:Q,write:me,final:se,destroy:H}=V(S);if(r(Q))return v(x,Q,{objectMode:!0,write:me,final:se,destroy:H});let ye=Q==null?void 0:Q.then;if(typeof ye=="function"){let oe,_e=T(ye,Q,_=>{if(_!=null)throw new b("nully","body",_)},_=>{y(oe,_)});return oe=new x({objectMode:!0,readable:!1,write:me,final(_){se(async()=>{try{await _e,t.nextTick(_,null)}catch(G){t.nextTick(_,G)}})},destroy:H})}throw new b("Iterable, AsyncIterable or AsyncFunction",z,Q)}if(j(S))return ne(S.arrayBuffer());if(r(S))return v(x,S,{objectMode:!0,writable:!1});if(typeof(S==null?void 0:S.writable)=="object"||typeof(S==null?void 0:S.readable)=="object"){let Q=S!=null&&S.readable?o(S==null?void 0:S.readable)?S==null?void 0:S.readable:ne(S.readable):void 0,me=S!=null&&S.writable?l(S==null?void 0:S.writable)?S==null?void 0:S.writable:ne(S.writable):void 0;return J({readable:Q,writable:me})}let re=S==null?void 0:S.then;if(typeof re=="function"){let Q;return T(re,S,me=>{me!=null&&Q.push(me),Q.push(null)},me=>{y(Q,me)}),Q=new x({objectMode:!0,writable:!1,read(){}})}throw new m(z,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],S)};function V(ne){let{promise:S,resolve:z}=k(),re=new C,Q=re.signal;return{value:ne(async function*(){for(;;){let me=S;S=null;let{chunk:se,done:H,cb:ye}=await me;if(t.nextTick(ye),H)return;if(Q.aborted)throw new g(void 0,{cause:Q.reason});({promise:S,resolve:z}=k()),yield se}}(),{signal:Q}),write(me,se,H){let ye=z;z=null,ye({chunk:me,done:!1,cb:H})},final(me){let se=z;z=null,se({done:!0,cb:me})},destroy(me,se){re.abort(),se(me)}}}function J(ne){let S=ne.readable&&typeof ne.readable.read!="function"?M.wrap(ne.readable):ne.readable,z=ne.writable,re=!!h(S),Q=!!n(z),me,se,H,ye,oe;function _e(_){let G=ye;ye=null,G?G(_):_&&oe.destroy(_)}return oe=new x({readableObjectMode:!!(S!=null&&S.readableObjectMode),writableObjectMode:!!(z!=null&&z.writableObjectMode),readable:re,writable:Q}),Q&&(p(z,_=>{Q=!1,_&&y(S,_),_e(_)}),oe._write=function(_,G,de){z.write(_,G)?de():me=de},oe._final=function(_){z.end(),se=_},z.on("drain",function(){if(me){let _=me;me=null,_()}}),z.on("finish",function(){if(se){let _=se;se=null,_()}})),re&&(p(S,_=>{re=!1,_&&y(S,_),_e(_)}),S.on("readable",function(){if(H){let _=H;H=null,_()}}),S.on("end",function(){oe.push(null)}),oe._read=function(){for(;;){let _=S.read();if(_===null){H=oe._read;return}if(!oe.push(_))return}}),oe._destroy=function(_,G){!_&&ye!==null&&(_=new g),H=null,me=null,se=null,ye===null?G(_):(ye=G,y(z,_),y(S,_))},oe}}),vt=be((e,i)=>{ae(),he(),le();var{ObjectDefineProperties:t,ObjectGetOwnPropertyDescriptor:a,ObjectKeys:h,ObjectSetPrototypeOf:n}=He();i.exports=o;var r=Ar(),s=es();n(o.prototype,r.prototype),n(o,r);{let g=h(s.prototype);for(let m=0;m<g.length;m++){let b=g[m];o.prototype[b]||(o.prototype[b]=s.prototype[b])}}function o(g){if(!(this instanceof o))return new o(g);r.call(this,g),s.call(this,g),g?(this.allowHalfOpen=g.allowHalfOpen!==!1,g.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),g.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}t(o.prototype,{writable:{__proto__:null,...a(s.prototype,"writable")},writableHighWaterMark:{__proto__:null,...a(s.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...a(s.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...a(s.prototype,"writableBuffer")},writableLength:{__proto__:null,...a(s.prototype,"writableLength")},writableFinished:{__proto__:null,...a(s.prototype,"writableFinished")},writableCorked:{__proto__:null,...a(s.prototype,"writableCorked")},writableEnded:{__proto__:null,...a(s.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...a(s.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(g){this._readableState&&this._writableState&&(this._readableState.destroyed=g,this._writableState.destroyed=g)}}});var l;function f(){return l===void 0&&(l={}),l}o.fromWeb=function(g,m){return f().newStreamDuplexFromReadableWritablePair(g,m)},o.toWeb=function(g){return f().newReadableWritablePairFromDuplex(g)};var p;o.from=function(g){return p||(p=Ql()),p(g,"body")}}),ts=be((e,i)=>{ae(),he(),le();var{ObjectSetPrototypeOf:t,Symbol:a}=He();i.exports=o;var{ERR_METHOD_NOT_IMPLEMENTED:h}=tt().codes,n=vt(),{getHighWaterMark:r}=oi();t(o.prototype,n.prototype),t(o,n);var s=a("kCallback");function o(p){if(!(this instanceof o))return new o(p);let g=p?r(this,p,"readableHighWaterMark",!0):null;g===0&&(p={...p,highWaterMark:null,readableHighWaterMark:g,writableHighWaterMark:p.writableHighWaterMark||0}),n.call(this,p),this._readableState.sync=!1,this[s]=null,p&&(typeof p.transform=="function"&&(this._transform=p.transform),typeof p.flush=="function"&&(this._flush=p.flush)),this.on("prefinish",f)}function l(p){typeof this._flush=="function"&&!this.destroyed?this._flush((g,m)=>{if(g){p?p(g):this.destroy(g);return}m!=null&&this.push(m),this.push(null),p&&p()}):(this.push(null),p&&p())}function f(){this._final!==l&&l.call(this)}o.prototype._final=l,o.prototype._transform=function(p,g,m){throw new h("_transform()")},o.prototype._write=function(p,g,m){let b=this._readableState,y=this._writableState,A=b.length;this._transform(p,g,(M,k)=>{if(M){m(M);return}k!=null&&this.push(k),y.ended||A===b.length||b.length<b.highWaterMark?m():this[s]=m})},o.prototype._read=function(){if(this[s]){let p=this[s];this[s]=null,p()}}}),rs=be((e,i)=>{ae(),he(),le();var{ObjectSetPrototypeOf:t}=He();i.exports=h;var a=ts();t(h.prototype,a.prototype),t(h,a);function h(n){if(!(this instanceof h))return new h(n);a.call(this,n)}h.prototype._transform=function(n,r,s){s(null,n)}}),pi=be((e,i)=>{ae(),he(),le();var t=Ut(),{ArrayIsArray:a,Promise:h,SymbolAsyncIterator:n}=He(),r=Pt(),{once:s}=bt(),o=Xt(),l=vt(),{aggregateTwoErrors:f,codes:{ERR_INVALID_ARG_TYPE:p,ERR_INVALID_RETURN_VALUE:g,ERR_MISSING_ARGS:m,ERR_STREAM_DESTROYED:b,ERR_STREAM_PREMATURE_CLOSE:y},AbortError:A}=tt(),{validateFunction:M,validateAbortSignal:k}=br(),{isIterable:v,isReadable:U,isReadableNodeStream:j,isNodeStream:C,isTransformStream:T,isWebStream:x,isReadableStream:V,isReadableEnded:J}=yt(),ne=globalThis.AbortController||ei().AbortController,S,z;function re(G,de,ve){let ce=!1;G.on("close",()=>{ce=!0});let R=r(G,{readable:de,writable:ve},E=>{ce=!E});return{destroy:E=>{ce||(ce=!0,o.destroyer(G,E||new b("pipe")))},cleanup:R}}function Q(G){return M(G[G.length-1],"streams[stream.length - 1]"),G.pop()}function me(G){if(v(G))return G;if(j(G))return se(G);throw new p("val",["Readable","Iterable","AsyncIterable"],G)}async function*se(G){z||(z=Ar()),yield*z.prototype[n].call(G)}async function H(G,de,ve,{end:ce}){let R,E=null,Y=X=>{if(X&&(R=X),E){let we=E;E=null,we()}},fe=()=>new h((X,we)=>{R?we(R):E=()=>{R?we(R):X()}});de.on("drain",Y);let te=r(de,{readable:!1},Y);try{de.writableNeedDrain&&await fe();for await(let X of G)de.write(X)||await fe();ce&&de.end(),await fe(),ve()}catch(X){ve(R!==X?f(R,X):X)}finally{te(),de.off("drain",Y)}}async function ye(G,de,ve,{end:ce}){T(de)&&(de=de.writable);let R=de.getWriter();try{for await(let E of G)await R.ready,R.write(E).catch(()=>{});await R.ready,ce&&await R.close(),ve()}catch(E){try{await R.abort(E),ve(E)}catch(Y){ve(Y)}}}function oe(...G){return _e(G,s(Q(G)))}function _e(G,de,ve){if(G.length===1&&a(G[0])&&(G=G[0]),G.length<2)throw new m("streams");let ce=new ne,R=ce.signal,E=ve==null?void 0:ve.signal,Y=[];k(E,"options.signal");function fe(){D(new A)}E==null||E.addEventListener("abort",fe);let te,X,we=[],ge=0;function B(L){D(L,--ge===0)}function D(L,K){if(L&&(!te||te.code==="ERR_STREAM_PREMATURE_CLOSE")&&(te=L),!(!te&&!K)){for(;we.length;)we.shift()(te);E==null||E.removeEventListener("abort",fe),ce.abort(),K&&(te||Y.forEach(P=>P()),t.nextTick(de,te,X))}}let F;for(let L=0;L<G.length;L++){let K=G[L],P=L<G.length-1,N=L>0,q=P||(ve==null?void 0:ve.end)!==!1,ue=L===G.length-1;if(C(K)){let c=function(u){u&&u.name!=="AbortError"&&u.code!=="ERR_STREAM_PREMATURE_CLOSE"&&B(u)};if(q){let{destroy:u,cleanup:d}=re(K,P,N);we.push(u),U(K)&&ue&&Y.push(d)}K.on("error",c),U(K)&&ue&&Y.push(()=>{K.removeListener("error",c)})}if(L===0)if(typeof K=="function"){if(F=K({signal:R}),!v(F))throw new g("Iterable, AsyncIterable or Stream","source",F)}else v(K)||j(K)||T(K)?F=K:F=l.from(K);else if(typeof K=="function"){if(T(F)){var ie;F=me((ie=F)===null||ie===void 0?void 0:ie.readable)}else F=me(F);if(F=K(F,{signal:R}),P){if(!v(F,!0))throw new g("AsyncIterable",`transform[${L-1}]`,F)}else{var Z;S||(S=rs());let c=new S({objectMode:!0}),u=(Z=F)===null||Z===void 0?void 0:Z.then;if(typeof u=="function")ge++,u.call(F,I=>{X=I,I!=null&&c.write(I),q&&c.end(),t.nextTick(B)},I=>{c.destroy(I),t.nextTick(B,I)});else if(v(F,!0))ge++,H(F,c,B,{end:q});else if(V(F)||T(F)){let I=F.readable||F;ge++,H(I,c,B,{end:q})}else throw new g("AsyncIterable or Promise","destination",F);F=c;let{destroy:d,cleanup:w}=re(F,!1,!0);we.push(d),ue&&Y.push(w)}}else if(C(K)){if(j(F)){ge+=2;let c=_(F,K,B,{end:q});U(K)&&ue&&Y.push(c)}else if(T(F)||V(F)){let c=F.readable||F;ge++,H(c,K,B,{end:q})}else if(v(F))ge++,H(F,K,B,{end:q});else throw new p("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],F);F=K}else if(x(K)){if(j(F))ge++,ye(me(F),K,B,{end:q});else if(V(F)||v(F))ge++,ye(F,K,B,{end:q});else if(T(F))ge++,ye(F.readable,K,B,{end:q});else throw new p("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],F);F=K}else F=l.from(K)}return(R!=null&&R.aborted||E!=null&&E.aborted)&&t.nextTick(fe),F}function _(G,de,ve,{end:ce}){let R=!1;if(de.on("close",()=>{R||ve(new y)}),G.pipe(de,{end:!1}),ce){let E=function(){R=!0,de.end()};J(G)?t.nextTick(E):G.once("end",E)}else ve();return r(G,{readable:!0,writable:!1},E=>{let Y=G._readableState;E&&E.code==="ERR_STREAM_PREMATURE_CLOSE"&&Y&&Y.ended&&!Y.errored&&!Y.errorEmitted?G.once("end",ve).once("error",ve):ve(E)}),r(de,{readable:!1,writable:!0},ve)}i.exports={pipelineImpl:_e,pipeline:oe}}),ns=be((e,i)=>{ae(),he(),le();var{pipeline:t}=pi(),a=vt(),{destroyer:h}=Xt(),{isNodeStream:n,isReadable:r,isWritable:s,isWebStream:o,isTransformStream:l,isWritableStream:f,isReadableStream:p}=yt(),{AbortError:g,codes:{ERR_INVALID_ARG_VALUE:m,ERR_MISSING_ARGS:b}}=tt(),y=Pt();i.exports=function(...A){if(A.length===0)throw new b("streams");if(A.length===1)return a.from(A[0]);let M=[...A];if(typeof A[0]=="function"&&(A[0]=a.from(A[0])),typeof A[A.length-1]=="function"){let S=A.length-1;A[S]=a.from(A[S])}for(let S=0;S<A.length;++S)if(!(!n(A[S])&&!o(A[S]))){if(S<A.length-1&&!(r(A[S])||p(A[S])||l(A[S])))throw new m(`streams[${S}]`,M[S],"must be readable");if(S>0&&!(s(A[S])||f(A[S])||l(A[S])))throw new m(`streams[${S}]`,M[S],"must be writable")}let k,v,U,j,C;function T(S){let z=j;j=null,z?z(S):S?C.destroy(S):!ne&&!J&&C.destroy()}let x=A[0],V=t(A,T),J=!!(s(x)||f(x)||l(x)),ne=!!(r(V)||p(V)||l(V));if(C=new a({writableObjectMode:!!(x!=null&&x.writableObjectMode),readableObjectMode:!!(V!=null&&V.writableObjectMode),writable:J,readable:ne}),J){if(n(x))C._write=function(z,re,Q){x.write(z,re)?Q():k=Q},C._final=function(z){x.end(),v=z},x.on("drain",function(){if(k){let z=k;k=null,z()}});else if(o(x)){let z=(l(x)?x.writable:x).getWriter();C._write=async function(re,Q,me){try{await z.ready,z.write(re).catch(()=>{}),me()}catch(se){me(se)}},C._final=async function(re){try{await z.ready,z.close().catch(()=>{}),v=re}catch(Q){re(Q)}}}let S=l(V)?V.readable:V;y(S,()=>{if(v){let z=v;v=null,z()}})}if(ne){if(n(V))V.on("readable",function(){if(U){let S=U;U=null,S()}}),V.on("end",function(){C.push(null)}),C._read=function(){for(;;){let S=V.read();if(S===null){U=C._read;return}if(!C.push(S))return}};else if(o(V)){let S=(l(V)?V.readable:V).getReader();C._read=async function(){for(;;)try{let{value:z,done:re}=await S.read();if(!C.push(z))return;if(re){C.push(null);return}}catch{return}}}}return C._destroy=function(S,z){!S&&j!==null&&(S=new g),U=null,k=null,v=null,j===null?z(S):(j=z,n(V)&&h(V,S))},C}}),Gl=be((e,i)=>{ae(),he(),le();var t=globalThis.AbortController||ei().AbortController,{codes:{ERR_INVALID_ARG_VALUE:a,ERR_INVALID_ARG_TYPE:h,ERR_MISSING_ARGS:n,ERR_OUT_OF_RANGE:r},AbortError:s}=tt(),{validateAbortSignal:o,validateInteger:l,validateObject:f}=br(),p=He().Symbol("kWeak"),{finished:g}=Pt(),m=ns(),{addAbortSignalNoValidate:b}=wr(),{isWritable:y,isNodeStream:A}=yt(),{ArrayPrototypePush:M,MathFloor:k,Number:v,NumberIsNaN:U,Promise:j,PromiseReject:C,PromisePrototypeThen:T,Symbol:x}=He(),V=x("kEmpty"),J=x("kEof");function ne(ce,R){if(R!=null&&f(R,"options"),(R==null?void 0:R.signal)!=null&&o(R.signal,"options.signal"),A(ce)&&!y(ce))throw new a("stream",ce,"must be writable");let E=m(this,ce);return R!=null&&R.signal&&b(R.signal,E),E}function S(ce,R){if(typeof ce!="function")throw new h("fn",["Function","AsyncFunction"],ce);R!=null&&f(R,"options"),(R==null?void 0:R.signal)!=null&&o(R.signal,"options.signal");let E=1;return(R==null?void 0:R.concurrency)!=null&&(E=k(R.concurrency)),l(E,"concurrency",1),(async function*(){var Y,fe;let te=new t,X=this,we=[],ge=te.signal,B={signal:ge},D=()=>te.abort();R!=null&&(Y=R.signal)!==null&&Y!==void 0&&Y.aborted&&D(),R==null||(fe=R.signal)===null||fe===void 0||fe.addEventListener("abort",D);let F,ie,Z=!1;function L(){Z=!0}async function K(){try{for await(let q of X){var P;if(Z)return;if(ge.aborted)throw new s;try{q=ce(q,B)}catch(ue){q=C(ue)}q!==V&&(typeof((P=q)===null||P===void 0?void 0:P.catch)=="function"&&q.catch(L),we.push(q),F&&(F(),F=null),!Z&&we.length&&we.length>=E&&await new j(ue=>{ie=ue}))}we.push(J)}catch(q){let ue=C(q);T(ue,void 0,L),we.push(ue)}finally{var N;Z=!0,F&&(F(),F=null),R==null||(N=R.signal)===null||N===void 0||N.removeEventListener("abort",D)}}K();try{for(;;){for(;we.length>0;){let P=await we[0];if(P===J)return;if(ge.aborted)throw new s;P!==V&&(yield P),we.shift(),ie&&(ie(),ie=null)}await new j(P=>{F=P})}}finally{te.abort(),Z=!0,ie&&(ie(),ie=null)}}).call(this)}function z(ce=void 0){return ce!=null&&f(ce,"options"),(ce==null?void 0:ce.signal)!=null&&o(ce.signal,"options.signal"),(async function*(){let R=0;for await(let Y of this){var E;if(ce!=null&&(E=ce.signal)!==null&&E!==void 0&&E.aborted)throw new s({cause:ce.signal.reason});yield[R++,Y]}}).call(this)}async function re(ce,R=void 0){for await(let E of H.call(this,ce,R))return!0;return!1}async function Q(ce,R=void 0){if(typeof ce!="function")throw new h("fn",["Function","AsyncFunction"],ce);return!await re.call(this,async(...E)=>!await ce(...E),R)}async function me(ce,R){for await(let E of H.call(this,ce,R))return E}async function se(ce,R){if(typeof ce!="function")throw new h("fn",["Function","AsyncFunction"],ce);async function E(Y,fe){return await ce(Y,fe),V}for await(let Y of S.call(this,E,R));}function H(ce,R){if(typeof ce!="function")throw new h("fn",["Function","AsyncFunction"],ce);async function E(Y,fe){return await ce(Y,fe)?Y:V}return S.call(this,E,R)}var ye=class extends n{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function oe(ce,R,E){var Y;if(typeof ce!="function")throw new h("reducer",["Function","AsyncFunction"],ce);E!=null&&f(E,"options"),(E==null?void 0:E.signal)!=null&&o(E.signal,"options.signal");let fe=arguments.length>1;if(E!=null&&(Y=E.signal)!==null&&Y!==void 0&&Y.aborted){let B=new s(void 0,{cause:E.signal.reason});throw this.once("error",()=>{}),await g(this.destroy(B)),B}let te=new t,X=te.signal;if(E!=null&&E.signal){let B={once:!0,[p]:this};E.signal.addEventListener("abort",()=>te.abort(),B)}let we=!1;try{for await(let B of this){var ge;if(we=!0,E!=null&&(ge=E.signal)!==null&&ge!==void 0&&ge.aborted)throw new s;fe?R=await ce(R,B,{signal:X}):(R=B,fe=!0)}if(!we&&!fe)throw new ye}finally{te.abort()}return R}async function _e(ce){ce!=null&&f(ce,"options"),(ce==null?void 0:ce.signal)!=null&&o(ce.signal,"options.signal");let R=[];for await(let Y of this){var E;if(ce!=null&&(E=ce.signal)!==null&&E!==void 0&&E.aborted)throw new s(void 0,{cause:ce.signal.reason});M(R,Y)}return R}function _(ce,R){let E=S.call(this,ce,R);return(async function*(){for await(let Y of E)yield*Y}).call(this)}function G(ce){if(ce=v(ce),U(ce))return 0;if(ce<0)throw new r("number",">= 0",ce);return ce}function de(ce,R=void 0){return R!=null&&f(R,"options"),(R==null?void 0:R.signal)!=null&&o(R.signal,"options.signal"),ce=G(ce),(async function*(){var E;if(R!=null&&(E=R.signal)!==null&&E!==void 0&&E.aborted)throw new s;for await(let fe of this){var Y;if(R!=null&&(Y=R.signal)!==null&&Y!==void 0&&Y.aborted)throw new s;ce--<=0&&(yield fe)}}).call(this)}function ve(ce,R=void 0){return R!=null&&f(R,"options"),(R==null?void 0:R.signal)!=null&&o(R.signal,"options.signal"),ce=G(ce),(async function*(){var E;if(R!=null&&(E=R.signal)!==null&&E!==void 0&&E.aborted)throw new s;for await(let fe of this){var Y;if(R!=null&&(Y=R.signal)!==null&&Y!==void 0&&Y.aborted)throw new s;if(ce-- >0)yield fe;else return}}).call(this)}i.exports.streamReturningOperators={asIndexedPairs:z,drop:de,filter:H,flatMap:_,map:S,take:ve,compose:ne},i.exports.promiseReturningOperators={every:Q,forEach:se,reduce:oe,toArray:_e,some:re,find:me}}),is=be((e,i)=>{ae(),he(),le();var{ArrayPrototypePop:t,Promise:a}=He(),{isIterable:h,isNodeStream:n,isWebStream:r}=yt(),{pipelineImpl:s}=pi(),{finished:o}=Pt();os();function l(...f){return new a((p,g)=>{let m,b,y=f[f.length-1];if(y&&typeof y=="object"&&!n(y)&&!h(y)&&!r(y)){let A=t(f);m=A.signal,b=A.end}s(f,(A,M)=>{A?g(A):p(M)},{signal:m,end:b})})}i.exports={finished:o,pipeline:l}}),os=be((e,i)=>{ae(),he(),le();var{Buffer:t}=(Je(),Le(Ge)),{ObjectDefineProperty:a,ObjectKeys:h,ReflectApply:n}=He(),{promisify:{custom:r}}=bt(),{streamReturningOperators:s,promiseReturningOperators:o}=Gl(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:l}}=tt(),f=ns(),{pipeline:p}=pi(),{destroyer:g}=Xt(),m=Pt(),b=is(),y=yt(),A=i.exports=ii().Stream;A.isDisturbed=y.isDisturbed,A.isErrored=y.isErrored,A.isReadable=y.isReadable,A.Readable=Ar();for(let k of h(s)){let v=function(...j){if(new.target)throw l();return A.Readable.from(n(U,this,j))},U=s[k];a(v,"name",{__proto__:null,value:U.name}),a(v,"length",{__proto__:null,value:U.length}),a(A.Readable.prototype,k,{__proto__:null,value:v,enumerable:!1,configurable:!0,writable:!0})}for(let k of h(o)){let v=function(...j){if(new.target)throw l();return n(U,this,j)},U=o[k];a(v,"name",{__proto__:null,value:U.name}),a(v,"length",{__proto__:null,value:U.length}),a(A.Readable.prototype,k,{__proto__:null,value:v,enumerable:!1,configurable:!0,writable:!0})}A.Writable=es(),A.Duplex=vt(),A.Transform=ts(),A.PassThrough=rs(),A.pipeline=p;var{addAbortSignal:M}=wr();A.addAbortSignal=M,A.finished=m,A.destroy=g,A.compose=f,a(A,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return b}}),a(p,r,{__proto__:null,enumerable:!0,get(){return b.pipeline}}),a(m,r,{__proto__:null,enumerable:!0,get(){return b.finished}}),A.Stream=A,A._isUint8Array=function(k){return k instanceof Uint8Array},A._uint8ArrayToBuffer=function(k){return t.from(k.buffer,k.byteOffset,k.byteLength)}}),Vt=be((e,i)=>{ae(),he(),le();var t=os(),a=is(),h=t.Readable.destroy;i.exports=t.Readable,i.exports._uint8ArrayToBuffer=t._uint8ArrayToBuffer,i.exports._isUint8Array=t._isUint8Array,i.exports.isDisturbed=t.isDisturbed,i.exports.isErrored=t.isErrored,i.exports.isReadable=t.isReadable,i.exports.Readable=t.Readable,i.exports.Writable=t.Writable,i.exports.Duplex=t.Duplex,i.exports.Transform=t.Transform,i.exports.PassThrough=t.PassThrough,i.exports.addAbortSignal=t.addAbortSignal,i.exports.finished=t.finished,i.exports.destroy=t.destroy,i.exports.destroy=h,i.exports.pipeline=t.pipeline,i.exports.compose=t.compose,Object.defineProperty(t,"promises",{configurable:!0,enumerable:!0,get(){return a}}),i.exports.Stream=t.Stream,i.exports.default=i.exports}),Jl=be((e,i)=>{ae(),he(),le(),typeof Object.create=="function"?i.exports=function(t,a){a&&(t.super_=a,t.prototype=Object.create(a.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:i.exports=function(t,a){if(a){t.super_=a;var h=function(){};h.prototype=a.prototype,t.prototype=new h,t.prototype.constructor=t}}}),Zl=be((e,i)=>{ae(),he(),le();var{Buffer:t}=(Je(),Le(Ge)),a=Symbol.for("BufferList");function h(n){if(!(this instanceof h))return new h(n);h._init.call(this,n)}h._init=function(n){Object.defineProperty(this,a,{value:!0}),this._bufs=[],this.length=0,n&&this.append(n)},h.prototype._new=function(n){return new h(n)},h.prototype._offset=function(n){if(n===0)return[0,0];let r=0;for(let s=0;s<this._bufs.length;s++){let o=r+this._bufs[s].length;if(n<o||s===this._bufs.length-1)return[s,n-r];r=o}},h.prototype._reverseOffset=function(n){let r=n[0],s=n[1];for(let o=0;o<r;o++)s+=this._bufs[o].length;return s},h.prototype.get=function(n){if(n>this.length||n<0)return;let r=this._offset(n);return this._bufs[r[0]][r[1]]},h.prototype.slice=function(n,r){return typeof n=="number"&&n<0&&(n+=this.length),typeof r=="number"&&r<0&&(r+=this.length),this.copy(null,0,n,r)},h.prototype.copy=function(n,r,s,o){if((typeof s!="number"||s<0)&&(s=0),(typeof o!="number"||o>this.length)&&(o=this.length),s>=this.length||o<=0)return n||t.alloc(0);let l=!!n,f=this._offset(s),p=o-s,g=p,m=l&&r||0,b=f[1];if(s===0&&o===this.length){if(!l)return this._bufs.length===1?this._bufs[0]:t.concat(this._bufs,this.length);for(let y=0;y<this._bufs.length;y++)this._bufs[y].copy(n,m),m+=this._bufs[y].length;return n}if(g<=this._bufs[f[0]].length-b)return l?this._bufs[f[0]].copy(n,r,b,b+g):this._bufs[f[0]].slice(b,b+g);l||(n=t.allocUnsafe(p));for(let y=f[0];y<this._bufs.length;y++){let A=this._bufs[y].length-b;if(g>A)this._bufs[y].copy(n,m,b),m+=A;else{this._bufs[y].copy(n,m,b,b+g),m+=A;break}g-=A,b&&(b=0)}return n.length>m?n.slice(0,m):n},h.prototype.shallowSlice=function(n,r){if(n=n||0,r=typeof r!="number"?this.length:r,n<0&&(n+=this.length),r<0&&(r+=this.length),n===r)return this._new();let s=this._offset(n),o=this._offset(r),l=this._bufs.slice(s[0],o[0]+1);return o[1]===0?l.pop():l[l.length-1]=l[l.length-1].slice(0,o[1]),s[1]!==0&&(l[0]=l[0].slice(s[1])),this._new(l)},h.prototype.toString=function(n,r,s){return this.slice(r,s).toString(n)},h.prototype.consume=function(n){if(n=Math.trunc(n),Number.isNaN(n)||n<=0)return this;for(;this._bufs.length;)if(n>=this._bufs[0].length)n-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(n),this.length-=n;break}return this},h.prototype.duplicate=function(){let n=this._new();for(let r=0;r<this._bufs.length;r++)n.append(this._bufs[r]);return n},h.prototype.append=function(n){if(n==null)return this;if(n.buffer)this._appendBuffer(t.from(n.buffer,n.byteOffset,n.byteLength));else if(Array.isArray(n))for(let r=0;r<n.length;r++)this.append(n[r]);else if(this._isBufferList(n))for(let r=0;r<n._bufs.length;r++)this.append(n._bufs[r]);else typeof n=="number"&&(n=n.toString()),this._appendBuffer(t.from(n));return this},h.prototype._appendBuffer=function(n){this._bufs.push(n),this.length+=n.length},h.prototype.indexOf=function(n,r,s){if(s===void 0&&typeof r=="string"&&(s=r,r=void 0),typeof n=="function"||Array.isArray(n))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof n=="number"?n=t.from([n]):typeof n=="string"?n=t.from(n,s):this._isBufferList(n)?n=n.slice():Array.isArray(n.buffer)?n=t.from(n.buffer,n.byteOffset,n.byteLength):t.isBuffer(n)||(n=t.from(n)),r=Number(r||0),isNaN(r)&&(r=0),r<0&&(r=this.length+r),r<0&&(r=0),n.length===0)return r>this.length?this.length:r;let o=this._offset(r),l=o[0],f=o[1];for(;l<this._bufs.length;l++){let p=this._bufs[l];for(;f<p.length;)if(p.length-f>=n.length){let g=p.indexOf(n,f);if(g!==-1)return this._reverseOffset([l,g]);f=p.length-n.length+1}else{let g=this._reverseOffset([l,f]);if(this._match(g,n))return g;f++}f=0}return-1},h.prototype._match=function(n,r){if(this.length-n<r.length)return!1;for(let s=0;s<r.length;s++)if(this.get(n+s)!==r[s])return!1;return!0},function(){let n={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 r in n)(function(s){n[s]===null?h.prototype[s]=function(o,l){return this.slice(o,o+l)[s](0,l)}:h.prototype[s]=function(o=0){return this.slice(o,o+n[s])[s](0)}})(r)}(),h.prototype._isBufferList=function(n){return n instanceof h||h.isBufferList(n)},h.isBufferList=function(n){return n!=null&&n[a]},i.exports=h}),Xl=be((e,i)=>{ae(),he(),le();var t=Vt().Duplex,a=Jl(),h=Zl();function n(r){if(!(this instanceof n))return new n(r);if(typeof r=="function"){this._callback=r;let s=(function(o){this._callback&&(this._callback(o),this._callback=null)}).bind(this);this.on("pipe",function(o){o.on("error",s)}),this.on("unpipe",function(o){o.removeListener("error",s)}),r=null}h._init.call(this,r),t.call(this)}a(n,t),Object.assign(n.prototype,h.prototype),n.prototype._new=function(r){return new n(r)},n.prototype._write=function(r,s,o){this._appendBuffer(r),typeof o=="function"&&o()},n.prototype._read=function(r){if(!this.length)return this.push(null);r=Math.min(r,this.length),this.push(this.slice(0,r)),this.consume(r)},n.prototype.end=function(r){t.prototype.end.call(this,r),this._callback&&(this._callback(null,this.slice()),this._callback=null)},n.prototype._destroy=function(r,s){this._bufs.length=0,this.length=0,s(r)},n.prototype._isBufferList=function(r){return r instanceof n||r instanceof h||n.isBufferList(r)},n.isBufferList=h.isBufferList,i.exports=n,i.exports.BufferListStream=n,i.exports.BufferList=h}),eh=be((e,i)=>{ae(),he(),le();var t=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}};i.exports=t}),ss=be((e,i)=>{ae(),he(),le();var t=i.exports,{Buffer:a}=(Je(),Le(Ge));t.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"},t.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},t.requiredHeaderFlagsErrors={};for(let n in t.requiredHeaderFlags){let r=t.requiredHeaderFlags[n];t.requiredHeaderFlagsErrors[n]="Invalid header flag bits, must be 0x"+r.toString(16)+" for "+t.types[n]+" packet"}t.codes={};for(let n in t.types){let r=t.types[n];t.codes[r]=n}t.CMD_SHIFT=4,t.CMD_MASK=240,t.DUP_MASK=8,t.QOS_MASK=3,t.QOS_SHIFT=1,t.RETAIN_MASK=1,t.VARBYTEINT_MASK=127,t.VARBYTEINT_FIN_MASK=128,t.VARBYTEINT_MAX=268435455,t.SESSIONPRESENT_MASK=1,t.SESSIONPRESENT_HEADER=a.from([t.SESSIONPRESENT_MASK]),t.CONNACK_HEADER=a.from([t.codes.connack<<t.CMD_SHIFT]),t.USERNAME_MASK=128,t.PASSWORD_MASK=64,t.WILL_RETAIN_MASK=32,t.WILL_QOS_MASK=24,t.WILL_QOS_SHIFT=3,t.WILL_FLAG_MASK=4,t.CLEAN_SESSION_MASK=2,t.CONNECT_HEADER=a.from([t.codes.connect<<t.CMD_SHIFT]),t.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},t.propertiesCodes={};for(let n in t.properties){let r=t.properties[n];t.propertiesCodes[r]=n}t.propertiesTypes={sessionExpiryInterval:"int32",willDelayInterval:"int32",receiveMaximum:"int16",maximumPacketSize:"int32",topicAliasMaximum:"int16",requestResponseInformation:"byte",requestProblemInformation:"byte",userProperties:"pair",authenticationMethod:"string",authenticationData:"binary",payloadFormatIndicator:"byte",messageExpiryInterval:"int32",contentType:"string",responseTopic:"string",correlationData:"binary",maximumQoS:"int8",retainAvailable:"byte",assignedClientIdentifier:"string",reasonString:"string",wildcardSubscriptionAvailable:"byte",subscriptionIdentifiersAvailable:"byte",sharedSubscriptionAvailable:"byte",serverKeepAlive:"int16",responseInformation:"string",serverReference:"string",topicAlias:"int16",subscriptionIdentifier:"var"};function h(n){return[0,1,2].map(r=>[0,1].map(s=>[0,1].map(o=>{let l=a.alloc(1);return l.writeUInt8(t.codes[n]<<t.CMD_SHIFT|(s?t.DUP_MASK:0)|r<<t.QOS_SHIFT|o,0,!0),l})))}t.PUBLISH_HEADER=h("publish"),t.SUBSCRIBE_HEADER=h("subscribe"),t.SUBSCRIBE_OPTIONS_QOS_MASK=3,t.SUBSCRIBE_OPTIONS_NL_MASK=1,t.SUBSCRIBE_OPTIONS_NL_SHIFT=2,t.SUBSCRIBE_OPTIONS_RAP_MASK=1,t.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,t.SUBSCRIBE_OPTIONS_RH_MASK=3,t.SUBSCRIBE_OPTIONS_RH_SHIFT=4,t.SUBSCRIBE_OPTIONS_RH=[0,16,32],t.SUBSCRIBE_OPTIONS_NL=4,t.SUBSCRIBE_OPTIONS_RAP=8,t.SUBSCRIBE_OPTIONS_QOS=[0,1,2],t.UNSUBSCRIBE_HEADER=h("unsubscribe"),t.ACKS={unsuback:h("unsuback"),puback:h("puback"),pubcomp:h("pubcomp"),pubrel:h("pubrel"),pubrec:h("pubrec")},t.SUBACK_HEADER=a.from([t.codes.suback<<t.CMD_SHIFT]),t.VERSION3=a.from([3]),t.VERSION4=a.from([4]),t.VERSION5=a.from([5]),t.VERSION131=a.from([131]),t.VERSION132=a.from([132]),t.QOS=[0,1,2].map(n=>a.from([n])),t.EMPTY={pingreq:a.from([t.codes.pingreq<<4,0]),pingresp:a.from([t.codes.pingresp<<4,0]),disconnect:a.from([t.codes.disconnect<<4,0])},t.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"},t.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"},t.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"},t.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"},t.MQTT5_DISCONNECT_CODES={0:"Normal disconnection",4:"Disconnect with Will Message",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",135:"Not authorized",137:"Server busy",139:"Server shutting down",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},t.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}}),th=be((e,i)=>{ae(),he(),le();var t=1e3,a=t*60,h=a*60,n=h*24,r=n*7,s=n*365.25;i.exports=function(g,m){m=m||{};var b=typeof g;if(b==="string"&&g.length>0)return o(g);if(b==="number"&&isFinite(g))return m.long?f(g):l(g);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(g))};function o(g){if(g=String(g),!(g.length>100)){var m=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(g);if(m){var b=parseFloat(m[1]),y=(m[2]||"ms").toLowerCase();switch(y){case"years":case"year":case"yrs":case"yr":case"y":return b*s;case"weeks":case"week":case"w":return b*r;case"days":case"day":case"d":return b*n;case"hours":case"hour":case"hrs":case"hr":case"h":return b*h;case"minutes":case"minute":case"mins":case"min":case"m":return b*a;case"seconds":case"second":case"secs":case"sec":case"s":return b*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return b;default:return}}}}function l(g){var m=Math.abs(g);return m>=n?Math.round(g/n)+"d":m>=h?Math.round(g/h)+"h":m>=a?Math.round(g/a)+"m":m>=t?Math.round(g/t)+"s":g+"ms"}function f(g){var m=Math.abs(g);return m>=n?p(g,m,n,"day"):m>=h?p(g,m,h,"hour"):m>=a?p(g,m,a,"minute"):m>=t?p(g,m,t,"second"):g+" ms"}function p(g,m,b,y){var A=m>=b*1.5;return Math.round(g/b)+" "+y+(A?"s":"")}}),rh=be((e,i)=>{ae(),he(),le();function t(a){n.debug=n,n.default=n,n.coerce=p,n.disable=o,n.enable=s,n.enabled=l,n.humanize=th(),n.destroy=g,Object.keys(a).forEach(m=>{n[m]=a[m]}),n.names=[],n.skips=[],n.formatters={};function h(m){let b=0;for(let y=0;y<m.length;y++)b=(b<<5)-b+m.charCodeAt(y),b|=0;return n.colors[Math.abs(b)%n.colors.length]}n.selectColor=h;function n(m){let b,y=null,A,M;function k(...v){if(!k.enabled)return;let U=k,j=Number(new Date),C=j-(b||j);U.diff=C,U.prev=b,U.curr=j,b=j,v[0]=n.coerce(v[0]),typeof v[0]!="string"&&v.unshift("%O");let T=0;v[0]=v[0].replace(/%([a-zA-Z%])/g,(x,V)=>{if(x==="%%")return"%";T++;let J=n.formatters[V];if(typeof J=="function"){let ne=v[T];x=J.call(U,ne),v.splice(T,1),T--}return x}),n.formatArgs.call(U,v),(U.log||n.log).apply(U,v)}return k.namespace=m,k.useColors=n.useColors(),k.color=n.selectColor(m),k.extend=r,k.destroy=n.destroy,Object.defineProperty(k,"enabled",{enumerable:!0,configurable:!1,get:()=>y!==null?y:(A!==n.namespaces&&(A=n.namespaces,M=n.enabled(m)),M),set:v=>{y=v}}),typeof n.init=="function"&&n.init(k),k}function r(m,b){let y=n(this.namespace+(typeof b>"u"?":":b)+m);return y.log=this.log,y}function s(m){n.save(m),n.namespaces=m,n.names=[],n.skips=[];let b,y=(typeof m=="string"?m:"").split(/[\s,]+/),A=y.length;for(b=0;b<A;b++)y[b]&&(m=y[b].replace(/\*/g,".*?"),m[0]==="-"?n.skips.push(new RegExp("^"+m.slice(1)+"$")):n.names.push(new RegExp("^"+m+"$")))}function o(){let m=[...n.names.map(f),...n.skips.map(f).map(b=>"-"+b)].join(",");return n.enable(""),m}function l(m){if(m[m.length-1]==="*")return!0;let b,y;for(b=0,y=n.skips.length;b<y;b++)if(n.skips[b].test(m))return!1;for(b=0,y=n.names.length;b<y;b++)if(n.names[b].test(m))return!0;return!1}function f(m){return m.toString().substring(2,m.toString().length-2).replace(/\.\*\?$/,"*")}function p(m){return m instanceof Error?m.stack||m.message:m}function g(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}i.exports=t}),Et=be((e,i)=>{ae(),he(),le(),e.formatArgs=a,e.save=h,e.load=n,e.useColors=t,e.storage=r(),e.destroy=(()=>{let o=!1;return()=>{o||(o=!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","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function t(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a(o){if(o[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+o[0]+(this.useColors?"%c ":" ")+"+"+i.exports.humanize(this.diff),!this.useColors)return;let l="color: "+this.color;o.splice(1,0,l,"color: inherit");let f=0,p=0;o[0].replace(/%[a-zA-Z%]/g,g=>{g!=="%%"&&(f++,g==="%c"&&(p=f))}),o.splice(p,0,l)}e.log=console.debug||console.log||(()=>{});function h(o){try{o?e.storage.setItem("debug",o):e.storage.removeItem("debug")}catch{}}function n(){let o;try{o=e.storage.getItem("debug")}catch{}return!o&&typeof Re<"u"&&"env"in Re&&(o=Re.env.DEBUG),o}function r(){try{return localStorage}catch{}}i.exports=rh()(e);var{formatters:s}=i.exports;s.j=function(o){try{return JSON.stringify(o)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}}),nh=be((e,i)=>{ae(),he(),le();var t=Xl(),{EventEmitter:a}=(er(),Le(jt)),h=eh(),n=ss(),r=Et()("mqtt-packet:parser"),s=class Mi extends a{constructor(){super(),this.parser=this.constructor.parser}static parser(l){return this instanceof Mi?(this.settings=l||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new Mi().parser(l)}_resetState(){r("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new h,this.error=null,this._list=t(),this._stateCounter=0}parse(l){for(this.error&&this._resetState(),this._list.append(l),r("parse: current state: %s",this._states[this._stateCounter]);(this.packet.length!==-1||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,r("parse: state complete. _stateCounter is now: %d",this._stateCounter),r("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return r("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){let l=this._list.readUInt8(0),f=l>>n.CMD_SHIFT;this.packet.cmd=n.types[f];let p=l&15,g=n.requiredHeaderFlags[f];return g!=null&&p!==g?this._emitError(new Error(n.requiredHeaderFlagsErrors[f])):(this.packet.retain=(l&n.RETAIN_MASK)!==0,this.packet.qos=l>>n.QOS_SHIFT&n.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=(l&n.DUP_MASK)!==0,r("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){let l=this._parseVarByteNum(!0);return l&&(this.packet.length=l.value,this._list.consume(l.bytes)),r("_parseLength %d",l.value),!!l}_parsePayload(){r("_parsePayload: payload %O",this._list);let l=!1;if(this.packet.length===0||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}l=!0}return r("_parsePayload complete result: %s",l),l}_parseConnect(){r("_parseConnect");let l,f,p,g,m={},b=this.packet,y=this._parseString();if(y===null)return this._emitError(new Error("Cannot parse protocolId"));if(y!=="MQTT"&&y!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(b.protocolId=y,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(b.protocolVersion=this._list.readUInt8(this._pos),b.protocolVersion>=128&&(b.bridgeMode=!0,b.protocolVersion=b.protocolVersion-128),b.protocolVersion!==3&&b.protocolVersion!==4&&b.protocolVersion!==5)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(this._list.readUInt8(this._pos)&1)return this._emitError(new Error("Connect flag bit 0 must be 0, but got 1"));m.username=this._list.readUInt8(this._pos)&n.USERNAME_MASK,m.password=this._list.readUInt8(this._pos)&n.PASSWORD_MASK,m.will=this._list.readUInt8(this._pos)&n.WILL_FLAG_MASK;let A=!!(this._list.readUInt8(this._pos)&n.WILL_RETAIN_MASK),M=(this._list.readUInt8(this._pos)&n.WILL_QOS_MASK)>>n.WILL_QOS_SHIFT;if(m.will)b.will={},b.will.retain=A,b.will.qos=M;else{if(A)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(M)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(b.clean=(this._list.readUInt8(this._pos)&n.CLEAN_SESSION_MASK)!==0,this._pos++,b.keepalive=this._parseNum(),b.keepalive===-1)return this._emitError(new Error("Packet too short"));if(b.protocolVersion===5){let v=this._parseProperties();Object.getOwnPropertyNames(v).length&&(b.properties=v)}let k=this._parseString();if(k===null)return this._emitError(new Error("Packet too short"));if(b.clientId=k,r("_parseConnect: packet.clientId: %s",b.clientId),m.will){if(b.protocolVersion===5){let v=this._parseProperties();Object.getOwnPropertyNames(v).length&&(b.will.properties=v)}if(l=this._parseString(),l===null)return this._emitError(new Error("Cannot parse will topic"));if(b.will.topic=l,r("_parseConnect: packet.will.topic: %s",b.will.topic),f=this._parseBuffer(),f===null)return this._emitError(new Error("Cannot parse will payload"));b.will.payload=f,r("_parseConnect: packet.will.paylaod: %s",b.will.payload)}if(m.username){if(g=this._parseString(),g===null)return this._emitError(new Error("Cannot parse username"));b.username=g,r("_parseConnect: packet.username: %s",b.username)}if(m.password){if(p=this._parseBuffer(),p===null)return this._emitError(new Error("Cannot parse password"));b.password=p}return this.settings=b,r("_parseConnect: complete"),b}_parseConnack(){r("_parseConnack");let l=this.packet;if(this._list.length<1)return null;let f=this._list.readUInt8(this._pos++);if(f>1)return this._emitError(new Error("Invalid connack flags, bits 7-1 must be set to 0"));if(l.sessionPresent=!!(f&n.SESSIONPRESENT_MASK),this.settings.protocolVersion===5)this._list.length>=2?l.reasonCode=this._list.readUInt8(this._pos++):l.reasonCode=0;else{if(this._list.length<2)return null;l.returnCode=this._list.readUInt8(this._pos++)}if(l.returnCode===-1||l.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){let p=this._parseProperties();Object.getOwnPropertyNames(p).length&&(l.properties=p)}r("_parseConnack: complete")}_parsePublish(){r("_parsePublish");let l=this.packet;if(l.topic=this._parseString(),l.topic===null)return this._emitError(new Error("Cannot parse topic"));if(!(l.qos>0&&!this._parseMessageId())){if(this.settings.protocolVersion===5){let f=this._parseProperties();Object.getOwnPropertyNames(f).length&&(l.properties=f)}l.payload=this._list.slice(this._pos,l.length),r("_parsePublish: payload from buffer list: %o",l.payload)}}_parseSubscribe(){r("_parseSubscribe");let l=this.packet,f,p,g,m,b,y,A;if(l.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let M=this._parseProperties();Object.getOwnPropertyNames(M).length&&(l.properties=M)}if(l.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<l.length;){if(f=this._parseString(),f===null)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=l.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(p=this._parseByte(),this.settings.protocolVersion===5){if(p&192)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(p&252)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(g=p&n.SUBSCRIBE_OPTIONS_QOS_MASK,g>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(y=(p>>n.SUBSCRIBE_OPTIONS_NL_SHIFT&n.SUBSCRIBE_OPTIONS_NL_MASK)!==0,b=(p>>n.SUBSCRIBE_OPTIONS_RAP_SHIFT&n.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,m=p>>n.SUBSCRIBE_OPTIONS_RH_SHIFT&n.SUBSCRIBE_OPTIONS_RH_MASK,m>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));A={topic:f,qos:g},this.settings.protocolVersion===5?(A.nl=y,A.rap=b,A.rh=m):this.settings.bridgeMode&&(A.rh=0,A.rap=!0,A.nl=!0),r("_parseSubscribe: push subscription `%s` to subscription",A),l.subscriptions.push(A)}}}_parseSuback(){r("_parseSuback");let l=this.packet;if(this.packet.granted=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let f=this._parseProperties();Object.getOwnPropertyNames(f).length&&(l.properties=f)}if(l.length<=0)return this._emitError(new Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){let f=this._list.readUInt8(this._pos++);if(this.settings.protocolVersion===5){if(!n.MQTT5_SUBACK_CODES[f])return this._emitError(new Error("Invalid suback code"))}else if(f>2&&f!==128)return this._emitError(new Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(f)}}}_parseUnsubscribe(){r("_parseUnsubscribe");let l=this.packet;if(l.unsubscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let f=this._parseProperties();Object.getOwnPropertyNames(f).length&&(l.properties=f)}if(l.length<=0)return this._emitError(new Error("Malformed unsubscribe, no payload specified"));for(;this._pos<l.length;){let f=this._parseString();if(f===null)return this._emitError(new Error("Cannot parse topic"));r("_parseUnsubscribe: push topic `%s` to unsubscriptions",f),l.unsubscriptions.push(f)}}}_parseUnsuback(){r("_parseUnsuback");let l=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if((this.settings.protocolVersion===3||this.settings.protocolVersion===4)&&l.length!==2)return this._emitError(new Error("Malformed unsuback, payload length must be 2"));if(l.length<=0)return this._emitError(new Error("Malformed unsuback, no payload specified"));if(this.settings.protocolVersion===5){let f=this._parseProperties();for(Object.getOwnPropertyNames(f).length&&(l.properties=f),l.granted=[];this._pos<this.packet.length;){let p=this._list.readUInt8(this._pos++);if(!n.MQTT5_UNSUBACK_CODES[p])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(p)}}}_parseConfirmation(){r("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);let l=this.packet;if(this._parseMessageId(),this.settings.protocolVersion===5){if(l.length>2){switch(l.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!n.MQTT5_PUBACK_PUBREC_CODES[l.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!n.MQTT5_PUBREL_PUBCOMP_CODES[l.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break}r("_parseConfirmation: packet.reasonCode `%d`",l.reasonCode)}else l.reasonCode=0;if(l.length>3){let f=this._parseProperties();Object.getOwnPropertyNames(f).length&&(l.properties=f)}}return!0}_parseDisconnect(){let l=this.packet;if(r("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?(l.reasonCode=this._parseByte(),n.MQTT5_DISCONNECT_CODES[l.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):l.reasonCode=0;let f=this._parseProperties();Object.getOwnPropertyNames(f).length&&(l.properties=f)}return r("_parseDisconnect result: true"),!0}_parseAuth(){r("_parseAuth");let l=this.packet;if(this.settings.protocolVersion!==5)return this._emitError(new Error("Not supported auth packet for this version MQTT"));if(l.reasonCode=this._parseByte(),!n.MQTT5_AUTH_CODES[l.reasonCode])return this._emitError(new Error("Invalid auth reason code"));let f=this._parseProperties();return Object.getOwnPropertyNames(f).length&&(l.properties=f),r("_parseAuth: result: true"),!0}_parseMessageId(){let l=this.packet;return l.messageId=this._parseNum(),l.messageId===null?(this._emitError(new Error("Cannot parse messageId")),!1):(r("_parseMessageId: packet.messageId %d",l.messageId),!0)}_parseString(l){let f=this._parseNum(),p=f+this._pos;if(f===-1||p>this._list.length||p>this.packet.length)return null;let g=this._list.toString("utf8",this._pos,p);return this._pos+=f,r("_parseString: result: %s",g),g}_parseStringPair(){return r("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){let l=this._parseNum(),f=l+this._pos;if(l===-1||f>this._list.length||f>this.packet.length)return null;let p=this._list.slice(this._pos,f);return this._pos+=l,r("_parseBuffer: result: %o",p),p}_parseNum(){if(this._list.length-this._pos<2)return-1;let l=this._list.readUInt16BE(this._pos);return this._pos+=2,r("_parseNum: result: %s",l),l}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;let l=this._list.readUInt32BE(this._pos);return this._pos+=4,r("_parse4ByteNum: result: %s",l),l}_parseVarByteNum(l){r("_parseVarByteNum");let f=4,p=0,g=1,m=0,b=!1,y,A=this._pos?this._pos:0;for(;p<f&&A+p<this._list.length;){if(y=this._list.readUInt8(A+p++),m+=g*(y&n.VARBYTEINT_MASK),g*=128,!(y&n.VARBYTEINT_FIN_MASK)){b=!0;break}if(this._list.length<=p)break}return!b&&p===f&&this._list.length>=p&&this._emitError(new Error("Invalid variable byte integer")),A&&(this._pos+=p),b?l?b={bytes:p,value:m}:b=m:b=!1,r("_parseVarByteNum: result: %o",b),b}_parseByte(){let l;return this._pos<this._list.length&&(l=this._list.readUInt8(this._pos),this._pos++),r("_parseByte: result: %o",l),l}_parseByType(l){switch(r("_parseByType: type: %s",l),l){case"byte":return this._parseByte()!==0;case"int8":return this._parseByte();case"int16":return this._parseNum();case"int32":return this._parse4ByteNum();case"var":return this._parseVarByteNum();case"string":return this._parseString();case"pair":return this._parseStringPair();case"binary":return this._parseBuffer()}}_parseProperties(){r("_parseProperties");let l=this._parseVarByteNum(),f=this._pos+l,p={};for(;this._pos<f;){let g=this._parseByte();if(!g)return this._emitError(new Error("Cannot parse property code type")),!1;let m=n.propertiesCodes[g];if(!m)return this._emitError(new Error("Unknown property")),!1;if(m==="userProperties"){p[m]||(p[m]=Object.create(null));let b=this._parseByType(n.propertiesTypes[m]);if(p[m][b.name])if(Array.isArray(p[m][b.name]))p[m][b.name].push(b.value);else{let y=p[m][b.name];p[m][b.name]=[y],p[m][b.name].push(b.value)}else p[m][b.name]=b.value;continue}p[m]?Array.isArray(p[m])?p[m].push(this._parseByType(n.propertiesTypes[m])):(p[m]=[p[m]],p[m].push(this._parseByType(n.propertiesTypes[m]))):p[m]=this._parseByType(n.propertiesTypes[m])}return p}_newPacket(){return r("_newPacket"),this.packet&&(this._list.consume(this.packet.length),r("_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)),r("_newPacket: new packet"),this.packet=new h,this._pos=0,!0}_emitError(l){r("_emitError",l),this.error=l,this.emit("error",l)}};i.exports=s}),ih=be((e,i)=>{ae(),he(),le();var{Buffer:t}=(Je(),Le(Ge)),a=65536,h={},n=t.isBuffer(t.from([1,2]).subarray(0,1));function r(f){let p=t.allocUnsafe(2);return p.writeUInt8(f>>8,0),p.writeUInt8(f&255,1),p}function s(){for(let f=0;f<a;f++)h[f]=r(f)}function o(f){let p=0,g=0,m=t.allocUnsafe(4);do p=f%128|0,f=f/128|0,f>0&&(p=p|128),m.writeUInt8(p,g++);while(f>0&&g<4);return f>0&&(g=0),n?m.subarray(0,g):m.slice(0,g)}function l(f){let p=t.allocUnsafe(4);return p.writeUInt32BE(f,0),p}i.exports={cache:h,generateCache:s,generateNumber:r,genBufVariableByteInt:o,generate4ByteBuffer:l}}),oh=be((e,i)=>{ae(),he(),le(),typeof Re>"u"||!Re.version||Re.version.indexOf("v0.")===0||Re.version.indexOf("v1.")===0&&Re.version.indexOf("v1.8.")!==0?i.exports={nextTick:t}:i.exports=Re;function t(a,h,n,r){if(typeof a!="function")throw new TypeError('"callback" argument must be a function');var s=arguments.length,o,l;switch(s){case 0:case 1:return Re.nextTick(a);case 2:return Re.nextTick(function(){a.call(null,h)});case 3:return Re.nextTick(function(){a.call(null,h,n)});case 4:return Re.nextTick(function(){a.call(null,h,n,r)});default:for(o=new Array(s-1),l=0;l<o.length;)o[l++]=arguments[l];return Re.nextTick(function(){a.apply(null,o)})}}}),as=be((e,i)=>{ae(),he(),le();var t=ss(),{Buffer:a}=(Je(),Le(Ge)),h=a.allocUnsafe(0),n=a.from([0]),r=ih(),s=oh().nextTick,o=Et()("mqtt-packet:writeToStream"),l=r.cache,f=r.generateNumber,p=r.generateCache,g=r.genBufVariableByteInt,m=r.generate4ByteBuffer,b=se,y=!0;function A(R,E,Y){switch(o("generate called"),E.cork&&(E.cork(),s(M,E)),y&&(y=!1,p()),o("generate: packet.cmd: %s",R.cmd),R.cmd){case"connect":return k(R,E);case"connack":return v(R,E,Y);case"publish":return U(R,E,Y);case"puback":case"pubrec":case"pubrel":case"pubcomp":return j(R,E,Y);case"subscribe":return C(R,E,Y);case"suback":return T(R,E,Y);case"unsubscribe":return x(R,E,Y);case"unsuback":return V(R,E,Y);case"pingreq":case"pingresp":return J(R,E);case"disconnect":return ne(R,E,Y);case"auth":return S(R,E,Y);default:return E.destroy(new Error("Unknown command")),!1}}Object.defineProperty(A,"cacheNumbers",{get(){return b===se},set(R){R?((!l||Object.keys(l).length===0)&&(y=!0),b=se):(y=!1,b=H)}});function M(R){R.uncork()}function k(R,E,Y){let fe=R||{},te=fe.protocolId||"MQTT",X=fe.protocolVersion||4,we=fe.will,ge=fe.clean,B=fe.keepalive||0,D=fe.clientId||"",F=fe.username,ie=fe.password,Z=fe.properties;ge===void 0&&(ge=!0);let L=0;if(!te||typeof te!="string"&&!a.isBuffer(te))return E.destroy(new Error("Invalid protocolId")),!1;if(L+=te.length+2,X!==3&&X!==4&&X!==5)return E.destroy(new Error("Invalid protocol version")),!1;if(L+=1,(typeof D=="string"||a.isBuffer(D))&&(D||X>=4)&&(D||ge))L+=a.byteLength(D)+2;else{if(X<4)return E.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(ge*1===0)return E.destroy(new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof B!="number"||B<0||B>65535||B%1!==0)return E.destroy(new Error("Invalid keepalive")),!1;L+=2,L+=1;let K,P;if(X===5){if(K=_e(E,Z),!K)return!1;L+=K.length}if(we){if(typeof we!="object")return E.destroy(new Error("Invalid will")),!1;if(!we.topic||typeof we.topic!="string")return E.destroy(new Error("Invalid will topic")),!1;if(L+=a.byteLength(we.topic)+2,L+=2,we.payload)if(we.payload.length>=0)typeof we.payload=="string"?L+=a.byteLength(we.payload):L+=we.payload.length;else return E.destroy(new Error("Invalid will payload")),!1;if(P={},X===5){if(P=_e(E,we.properties),!P)return!1;L+=P.length}}let N=!1;if(F!=null)if(ce(F))N=!0,L+=a.byteLength(F)+2;else return E.destroy(new Error("Invalid username")),!1;if(ie!=null){if(!N)return E.destroy(new Error("Username is required to use password")),!1;if(ce(ie))L+=ve(ie)+2;else return E.destroy(new Error("Invalid password")),!1}E.write(t.CONNECT_HEADER),re(E,L),oe(E,te),fe.bridgeMode&&(X+=128),E.write(X===131?t.VERSION131:X===132?t.VERSION132:X===4?t.VERSION4:X===5?t.VERSION5:t.VERSION3);let q=0;return q|=F!=null?t.USERNAME_MASK:0,q|=ie!=null?t.PASSWORD_MASK:0,q|=we&&we.retain?t.WILL_RETAIN_MASK:0,q|=we&&we.qos?we.qos<<t.WILL_QOS_SHIFT:0,q|=we?t.WILL_FLAG_MASK:0,q|=ge?t.CLEAN_SESSION_MASK:0,E.write(a.from([q])),b(E,B),X===5&&K.write(),oe(E,D),we&&(X===5&&P.write(),Q(E,we.topic),oe(E,we.payload)),F!=null&&oe(E,F),ie!=null&&oe(E,ie),!0}function v(R,E,Y){let fe=Y?Y.protocolVersion:4,te=R||{},X=fe===5?te.reasonCode:te.returnCode,we=te.properties,ge=2;if(typeof X!="number")return E.destroy(new Error("Invalid return code")),!1;let B=null;if(fe===5){if(B=_e(E,we),!B)return!1;ge+=B.length}return E.write(t.CONNACK_HEADER),re(E,ge),E.write(te.sessionPresent?t.SESSIONPRESENT_HEADER:n),E.write(a.from([X])),B==null||B.write(),!0}function U(R,E,Y){o("publish: packet: %o",R);let fe=Y?Y.protocolVersion:4,te=R||{},X=te.qos||0,we=te.retain?t.RETAIN_MASK:0,ge=te.topic,B=te.payload||h,D=te.messageId,F=te.properties,ie=0;if(typeof ge=="string")ie+=a.byteLength(ge)+2;else if(a.isBuffer(ge))ie+=ge.length+2;else return E.destroy(new Error("Invalid topic")),!1;if(a.isBuffer(B)?ie+=B.length:ie+=a.byteLength(B),X&&typeof D!="number")return E.destroy(new Error("Invalid messageId")),!1;X&&(ie+=2);let Z=null;if(fe===5){if(Z=_e(E,F),!Z)return!1;ie+=Z.length}return E.write(t.PUBLISH_HEADER[X][te.dup?1:0][we?1:0]),re(E,ie),b(E,ve(ge)),E.write(ge),X>0&&b(E,D),Z==null||Z.write(),o("publish: payload: %o",B),E.write(B)}function j(R,E,Y){let fe=Y?Y.protocolVersion:4,te=R||{},X=te.cmd||"puback",we=te.messageId,ge=te.dup&&X==="pubrel"?t.DUP_MASK:0,B=0,D=te.reasonCode,F=te.properties,ie=fe===5?3:2;if(X==="pubrel"&&(B=1),typeof we!="number")return E.destroy(new Error("Invalid messageId")),!1;let Z=null;if(fe===5&&typeof F=="object"){if(Z=_(E,F,Y,ie),!Z)return!1;ie+=Z.length}return E.write(t.ACKS[X][B][ge][0]),ie===3&&(ie+=D!==0?1:-1),re(E,ie),b(E,we),fe===5&&ie!==2&&E.write(a.from([D])),Z!==null?Z.write():ie===4&&E.write(a.from([0])),!0}function C(R,E,Y){o("subscribe: packet: ");let fe=Y?Y.protocolVersion:4,te=R||{},X=te.dup?t.DUP_MASK:0,we=te.messageId,ge=te.subscriptions,B=te.properties,D=0;if(typeof we!="number")return E.destroy(new Error("Invalid messageId")),!1;D+=2;let F=null;if(fe===5){if(F=_e(E,B),!F)return!1;D+=F.length}if(typeof ge=="object"&&ge.length)for(let Z=0;Z<ge.length;Z+=1){let L=ge[Z].topic,K=ge[Z].qos;if(typeof L!="string")return E.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if(typeof K!="number")return E.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(fe===5){if(typeof(ge[Z].nl||!1)!="boolean")return E.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(ge[Z].rap||!1)!="boolean")return E.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;let P=ge[Z].rh||0;if(typeof P!="number"||P>2)return E.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}D+=a.byteLength(L)+2+1}else return E.destroy(new Error("Invalid subscriptions")),!1;o("subscribe: writing to stream: %o",t.SUBSCRIBE_HEADER),E.write(t.SUBSCRIBE_HEADER[1][X?1:0][0]),re(E,D),b(E,we),F!==null&&F.write();let ie=!0;for(let Z of ge){let L=Z.topic,K=Z.qos,P=+Z.nl,N=+Z.rap,q=Z.rh,ue;Q(E,L),ue=t.SUBSCRIBE_OPTIONS_QOS[K],fe===5&&(ue|=P?t.SUBSCRIBE_OPTIONS_NL:0,ue|=N?t.SUBSCRIBE_OPTIONS_RAP:0,ue|=q?t.SUBSCRIBE_OPTIONS_RH[q]:0),ie=E.write(a.from([ue]))}return ie}function T(R,E,Y){let fe=Y?Y.protocolVersion:4,te=R||{},X=te.messageId,we=te.granted,ge=te.properties,B=0;if(typeof X!="number")return E.destroy(new Error("Invalid messageId")),!1;if(B+=2,typeof we=="object"&&we.length)for(let F=0;F<we.length;F+=1){if(typeof we[F]!="number")return E.destroy(new Error("Invalid qos vector")),!1;B+=1}else return E.destroy(new Error("Invalid qos vector")),!1;let D=null;if(fe===5){if(D=_(E,ge,Y,B),!D)return!1;B+=D.length}return E.write(t.SUBACK_HEADER),re(E,B),b(E,X),D!==null&&D.write(),E.write(a.from(we))}function x(R,E,Y){let fe=Y?Y.protocolVersion:4,te=R||{},X=te.messageId,we=te.dup?t.DUP_MASK:0,ge=te.unsubscriptions,B=te.properties,D=0;if(typeof X!="number")return E.destroy(new Error("Invalid messageId")),!1;if(D+=2,typeof ge=="object"&&ge.length)for(let Z=0;Z<ge.length;Z+=1){if(typeof ge[Z]!="string")return E.destroy(new Error("Invalid unsubscriptions")),!1;D+=a.byteLength(ge[Z])+2}else return E.destroy(new Error("Invalid unsubscriptions")),!1;let F=null;if(fe===5){if(F=_e(E,B),!F)return!1;D+=F.length}E.write(t.UNSUBSCRIBE_HEADER[1][we?1:0][0]),re(E,D),b(E,X),F!==null&&F.write();let ie=!0;for(let Z=0;Z<ge.length;Z++)ie=Q(E,ge[Z]);return ie}function V(R,E,Y){let fe=Y?Y.protocolVersion:4,te=R||{},X=te.messageId,we=te.dup?t.DUP_MASK:0,ge=te.granted,B=te.properties,D=te.cmd,F=0,ie=2;if(typeof X!="number")return E.destroy(new Error("Invalid messageId")),!1;if(fe===5)if(typeof ge=="object"&&ge.length)for(let L=0;L<ge.length;L+=1){if(typeof ge[L]!="number")return E.destroy(new Error("Invalid qos vector")),!1;ie+=1}else return E.destroy(new Error("Invalid qos vector")),!1;let Z=null;if(fe===5){if(Z=_(E,B,Y,ie),!Z)return!1;ie+=Z.length}return E.write(t.ACKS[D][F][we][0]),re(E,ie),b(E,X),Z!==null&&Z.write(),fe===5&&E.write(a.from(ge)),!0}function J(R,E,Y){return E.write(t.EMPTY[R.cmd])}function ne(R,E,Y){let fe=Y?Y.protocolVersion:4,te=R||{},X=te.reasonCode,we=te.properties,ge=fe===5?1:0,B=null;if(fe===5){if(B=_(E,we,Y,ge),!B)return!1;ge+=B.length}return E.write(a.from([t.codes.disconnect<<4])),re(E,ge),fe===5&&E.write(a.from([X])),B!==null&&B.write(),!0}function S(R,E,Y){let fe=Y?Y.protocolVersion:4,te=R||{},X=te.reasonCode,we=te.properties,ge=fe===5?1:0;fe!==5&&E.destroy(new Error("Invalid mqtt version for auth packet"));let B=_(E,we,Y,ge);return B?(ge+=B.length,E.write(a.from([t.codes.auth<<4])),re(E,ge),E.write(a.from([X])),B!==null&&B.write(),!0):!1}var z={};function re(R,E){if(E>t.VARBYTEINT_MAX)return R.destroy(new Error(`Invalid variable byte integer: ${E}`)),!1;let Y=z[E];return Y||(Y=g(E),E<16384&&(z[E]=Y)),o("writeVarByteInt: writing to stream: %o",Y),R.write(Y)}function Q(R,E){let Y=a.byteLength(E);return b(R,Y),o("writeString: %s",E),R.write(E,"utf8")}function me(R,E,Y){Q(R,E),Q(R,Y)}function se(R,E){return o("writeNumberCached: number: %d",E),o("writeNumberCached: %o",l[E]),R.write(l[E])}function H(R,E){let Y=f(E);return o("writeNumberGenerated: %o",Y),R.write(Y)}function ye(R,E){let Y=m(E);return o("write4ByteNumber: %o",Y),R.write(Y)}function oe(R,E){typeof E=="string"?Q(R,E):E?(b(R,E.length),R.write(E)):b(R,0)}function _e(R,E){if(typeof E!="object"||E.length!=null)return{length:1,write(){de(R,{},0)}};let Y=0;function fe(te,X){let we=t.propertiesTypes[te],ge=0;switch(we){case"byte":{if(typeof X!="boolean")return R.destroy(new Error(`Invalid ${te}: ${X}`)),!1;ge+=2;break}case"int8":{if(typeof X!="number"||X<0||X>255)return R.destroy(new Error(`Invalid ${te}: ${X}`)),!1;ge+=2;break}case"binary":{if(X&&X===null)return R.destroy(new Error(`Invalid ${te}: ${X}`)),!1;ge+=1+a.byteLength(X)+2;break}case"int16":{if(typeof X!="number"||X<0||X>65535)return R.destroy(new Error(`Invalid ${te}: ${X}`)),!1;ge+=3;break}case"int32":{if(typeof X!="number"||X<0||X>4294967295)return R.destroy(new Error(`Invalid ${te}: ${X}`)),!1;ge+=5;break}case"var":{if(typeof X!="number"||X<0||X>268435455)return R.destroy(new Error(`Invalid ${te}: ${X}`)),!1;ge+=1+a.byteLength(g(X));break}case"string":{if(typeof X!="string")return R.destroy(new Error(`Invalid ${te}: ${X}`)),!1;ge+=3+a.byteLength(X.toString());break}case"pair":{if(typeof X!="object")return R.destroy(new Error(`Invalid ${te}: ${X}`)),!1;ge+=Object.getOwnPropertyNames(X).reduce((B,D)=>{let F=X[D];return Array.isArray(F)?B+=F.reduce((ie,Z)=>(ie+=3+a.byteLength(D.toString())+2+a.byteLength(Z.toString()),ie),0):B+=3+a.byteLength(D.toString())+2+a.byteLength(X[D].toString()),B},0);break}default:return R.destroy(new Error(`Invalid property ${te}: ${X}`)),!1}return ge}if(E)for(let te in E){let X=0,we=0,ge=E[te];if(Array.isArray(ge))for(let B=0;B<ge.length;B++){if(we=fe(te,ge[B]),!we)return!1;X+=we}else{if(we=fe(te,ge),!we)return!1;X=we}if(!X)return!1;Y+=X}return{length:a.byteLength(g(Y))+Y,write(){de(R,E,Y)}}}function _(R,E,Y,fe){let te=["reasonString","userProperties"],X=Y&&Y.properties&&Y.properties.maximumPacketSize?Y.properties.maximumPacketSize:0,we=_e(R,E);if(X)for(;fe+we.length>X;){let ge=te.shift();if(ge&&E[ge])delete E[ge],we=_e(R,E);else return!1}return we}function G(R,E,Y){switch(t.propertiesTypes[E]){case"byte":{R.write(a.from([t.properties[E]])),R.write(a.from([+Y]));break}case"int8":{R.write(a.from([t.properties[E]])),R.write(a.from([Y]));break}case"binary":{R.write(a.from([t.properties[E]])),oe(R,Y);break}case"int16":{R.write(a.from([t.properties[E]])),b(R,Y);break}case"int32":{R.write(a.from([t.properties[E]])),ye(R,Y);break}case"var":{R.write(a.from([t.properties[E]])),re(R,Y);break}case"string":{R.write(a.from([t.properties[E]])),Q(R,Y);break}case"pair":{Object.getOwnPropertyNames(Y).forEach(fe=>{let te=Y[fe];Array.isArray(te)?te.forEach(X=>{R.write(a.from([t.properties[E]])),me(R,fe.toString(),X.toString())}):(R.write(a.from([t.properties[E]])),me(R,fe.toString(),te.toString()))});break}default:return R.destroy(new Error(`Invalid property ${E} value: ${Y}`)),!1}}function de(R,E,Y){re(R,Y);for(let fe in E)if(Object.prototype.hasOwnProperty.call(E,fe)&&E[fe]!==null){let te=E[fe];if(Array.isArray(te))for(let X=0;X<te.length;X++)G(R,fe,te[X]);else G(R,fe,te)}}function ve(R){return R?R instanceof a?R.length:a.byteLength(R):0}function ce(R){return typeof R=="string"||R instanceof a}i.exports=A}),sh=be((e,i)=>{ae(),he(),le();var t=as(),{EventEmitter:a}=(er(),Le(jt)),{Buffer:h}=(Je(),Le(Ge));function n(s,o){let l=new r;return t(s,l,o),l.concat()}var r=class extends a{constructor(){super(),this._array=new Array(20),this._i=0}write(s){return this._array[this._i++]=s,!0}concat(){let s=0,o=new Array(this._array.length),l=this._array,f=0,p;for(p=0;p<l.length&&l[p]!==void 0;p++)typeof l[p]!="string"?o[p]=l[p].length:o[p]=h.byteLength(l[p]),s+=o[p];let g=h.allocUnsafe(s);for(p=0;p<l.length&&l[p]!==void 0;p++)typeof l[p]!="string"?(l[p].copy(g,f),f+=o[p]):(g.write(l[p],f),f+=o[p]);return g}destroy(s){s&&this.emit("error",s)}};i.exports=n}),ah=be(e=>{ae(),he(),le(),e.parser=nh().parser,e.generate=sh(),e.writeToStream=as()}),ls=be(e=>{ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0});var i=class{constructor(){this.nextId=Math.max(1,Math.floor(Math.random()*65535))}allocate(){let t=this.nextId++;return this.nextId===65536&&(this.nextId=1),t}getLastAllocated(){return this.nextId===1?65535:this.nextId-1}register(t){return!0}deallocate(t){}clear(){}};e.default=i}),lh=be((e,i)=>{ae(),he(),le(),i.exports=a;function t(n){return n instanceof mr?mr.from(n):new n.constructor(n.buffer.slice(),n.byteOffset,n.length)}function a(n){if(n=n||{},n.circles)return h(n);return n.proto?o:s;function r(l,f){for(var p=Object.keys(l),g=new Array(p.length),m=0;m<p.length;m++){var b=p[m],y=l[b];typeof y!="object"||y===null?g[b]=y:y instanceof Date?g[b]=new Date(y):ArrayBuffer.isView(y)?g[b]=t(y):g[b]=f(y)}return g}function s(l){if(typeof l!="object"||l===null)return l;if(l instanceof Date)return new Date(l);if(Array.isArray(l))return r(l,s);if(l instanceof Map)return new Map(r(Array.from(l),s));if(l instanceof Set)return new Set(r(Array.from(l),s));var f={};for(var p in l)if(Object.hasOwnProperty.call(l,p)!==!1){var g=l[p];typeof g!="object"||g===null?f[p]=g:g instanceof Date?f[p]=new Date(g):g instanceof Map?f[p]=new Map(r(Array.from(g),s)):g instanceof Set?f[p]=new Set(r(Array.from(g),s)):ArrayBuffer.isView(g)?f[p]=t(g):f[p]=s(g)}return f}function o(l){if(typeof l!="object"||l===null)return l;if(l instanceof Date)return new Date(l);if(Array.isArray(l))return r(l,o);if(l instanceof Map)return new Map(r(Array.from(l),o));if(l instanceof Set)return new Set(r(Array.from(l),o));var f={};for(var p in l){var g=l[p];typeof g!="object"||g===null?f[p]=g:g instanceof Date?f[p]=new Date(g):g instanceof Map?f[p]=new Map(r(Array.from(g),o)):g instanceof Set?f[p]=new Set(r(Array.from(g),o)):ArrayBuffer.isView(g)?f[p]=t(g):f[p]=o(g)}return f}}function h(n){var r=[],s=[];return n.proto?f:l;function o(p,g){for(var m=Object.keys(p),b=new Array(m.length),y=0;y<m.length;y++){var A=m[y],M=p[A];if(typeof M!="object"||M===null)b[A]=M;else if(M instanceof Date)b[A]=new Date(M);else if(ArrayBuffer.isView(M))b[A]=t(M);else{var k=r.indexOf(M);k!==-1?b[A]=s[k]:b[A]=g(M)}}return b}function l(p){if(typeof p!="object"||p===null)return p;if(p instanceof Date)return new Date(p);if(Array.isArray(p))return o(p,l);if(p instanceof Map)return new Map(o(Array.from(p),l));if(p instanceof Set)return new Set(o(Array.from(p),l));var g={};r.push(p),s.push(g);for(var m in p)if(Object.hasOwnProperty.call(p,m)!==!1){var b=p[m];if(typeof b!="object"||b===null)g[m]=b;else if(b instanceof Date)g[m]=new Date(b);else if(b instanceof Map)g[m]=new Map(o(Array.from(b),l));else if(b instanceof Set)g[m]=new Set(o(Array.from(b),l));else if(ArrayBuffer.isView(b))g[m]=t(b);else{var y=r.indexOf(b);y!==-1?g[m]=s[y]:g[m]=l(b)}}return r.pop(),s.pop(),g}function f(p){if(typeof p!="object"||p===null)return p;if(p instanceof Date)return new Date(p);if(Array.isArray(p))return o(p,f);if(p instanceof Map)return new Map(o(Array.from(p),f));if(p instanceof Set)return new Set(o(Array.from(p),f));var g={};r.push(p),s.push(g);for(var m in p){var b=p[m];if(typeof b!="object"||b===null)g[m]=b;else if(b instanceof Date)g[m]=new Date(b);else if(b instanceof Map)g[m]=new Map(o(Array.from(b),f));else if(b instanceof Set)g[m]=new Set(o(Array.from(b),f));else if(ArrayBuffer.isView(b))g[m]=t(b);else{var y=r.indexOf(b);y!==-1?g[m]=s[y]:g[m]=f(b)}}return r.pop(),s.pop(),g}}}),hh=be((e,i)=>{ae(),he(),le(),i.exports=lh()()}),uh=be(e=>{ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0}),e.validateTopics=e.validateTopic=void 0;function i(a){let h=a.split("/");for(let n=0;n<h.length;n++)if(h[n]!=="+"){if(h[n]==="#")return n===h.length-1;if(h[n].indexOf("+")!==-1||h[n].indexOf("#")!==-1)return!1}return!0}e.validateTopic=i;function t(a){if(a.length===0)return"empty_topic_list";for(let h=0;h<a.length;h++)if(!i(a[h]))return a[h];return null}e.validateTopics=t}),hs=be(e=>{ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0});var i=Vt(),t={objectMode:!0},a={clean:!0},h=class{constructor(n){this.options=n||{},this.options=Object.assign(Object.assign({},a),n),this._inflights=new Map}put(n,r){return this._inflights.set(n.messageId,n),r&&r(),this}createStream(){let n=new i.Readable(t),r=[],s=!1,o=0;return this._inflights.forEach((l,f)=>{r.push(l)}),n._read=()=>{!s&&o<r.length?n.push(r[o++]):n.push(null)},n.destroy=l=>{if(!s)return s=!0,setTimeout(()=>{n.emit("close")},0),n},n}del(n,r){let s=this._inflights.get(n.messageId);return s?(this._inflights.delete(n.messageId),r(null,s)):r&&r(new Error("missing packet")),this}get(n,r){let s=this._inflights.get(n.messageId);return s?r(null,s):r&&r(new Error("missing packet")),this}close(n){this.options.clean&&(this._inflights=null),n&&n()}};e.default=h}),ch=be(e=>{ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0});var i=[0,16,128,131,135,144,145,151,153],t=(a,h,n)=>{a.log("handlePublish: packet %o",h),n=typeof n<"u"?n:a.noop;let r=h.topic.toString(),s=h.payload,{qos:o}=h,{messageId:l}=h,{options:f}=a;if(a.options.protocolVersion===5){let p;if(h.properties&&(p=h.properties.topicAlias),typeof p<"u")if(r.length===0)if(p>0&&p<=65535){let g=a.topicAliasRecv.getTopicByAlias(p);if(g)r=g,a.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",r,p);else{a.log("handlePublish :: unregistered topic alias. alias: %d",p),a.emit("error",new Error("Received unregistered Topic Alias"));return}}else{a.log("handlePublish :: topic alias out of range. alias: %d",p),a.emit("error",new Error("Received Topic Alias is out of range"));return}else if(a.topicAliasRecv.put(r,p))a.log("handlePublish :: registered topic: %s - alias: %d",r,p);else{a.log("handlePublish :: topic alias out of range. alias: %d",p),a.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(a.log("handlePublish: qos %d",o),o){case 2:{f.customHandleAcks(r,s,h,(p,g)=>{if(typeof p=="number"&&(g=p,p=null),p)return a.emit("error",p);if(i.indexOf(g)===-1)return a.emit("error",new Error("Wrong reason code for pubrec"));g?a._sendPacket({cmd:"pubrec",messageId:l,reasonCode:g},n):a.incomingStore.put(h,()=>{a._sendPacket({cmd:"pubrec",messageId:l},n)})});break}case 1:{f.customHandleAcks(r,s,h,(p,g)=>{if(typeof p=="number"&&(g=p,p=null),p)return a.emit("error",p);if(i.indexOf(g)===-1)return a.emit("error",new Error("Wrong reason code for puback"));g||a.emit("message",r,s,h),a.handleMessage(h,m=>{if(m)return n&&n(m);a._sendPacket({cmd:"puback",messageId:l,reasonCode:g},n)})});break}case 0:a.emit("message",r,s,h),a.handleMessage(h,n);break;default:a.log("handlePublish: unknown QoS. Doing nothing.");break}};e.default=t}),fh=be((e,i)=>{i.exports={version:"5.10.1"}}),rr=be(e=>{ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0}),e.MQTTJS_VERSION=e.nextTick=e.applyMixin=e.ErrorWithReasonCode=void 0;var i=class Ia extends Error{constructor(h,n){super(h),this.code=n,Object.setPrototypeOf(this,Ia.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}};e.ErrorWithReasonCode=i;function t(a,h,n=!1){var r;let s=[h];for(;;){let o=s[0],l=Object.getPrototypeOf(o);if(l!=null&&l.prototype)s.unshift(l);else break}for(let o of s)for(let l of Object.getOwnPropertyNames(o.prototype))(n||l!=="constructor")&&Object.defineProperty(a.prototype,l,(r=Object.getOwnPropertyDescriptor(o.prototype,l))!==null&&r!==void 0?r:Object.create(null))}e.applyMixin=t,e.nextTick=typeof(Re==null?void 0:Re.nextTick)=="function"?Re.nextTick:a=>{setTimeout(a,0)},e.MQTTJS_VERSION=fh().version}),kr=be(e=>{ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0}),e.ReasonCodes=void 0;var i=rr();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"};var t=(a,h)=>{let{messageId:n}=h,r=h.cmd,s=null,o=a.outgoing[n]?a.outgoing[n].cb:null,l=null;if(!o){a.log("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(a.log("_handleAck :: packet type",r),r){case"pubcomp":case"puback":{let f=h.reasonCode;f&&f>0&&f!==16?(l=new i.ErrorWithReasonCode(`Publish error: ${e.ReasonCodes[f]}`,f),a._removeOutgoingAndStoreMessage(n,()=>{o(l,h)})):a._removeOutgoingAndStoreMessage(n,o);break}case"pubrec":{s={cmd:"pubrel",qos:2,messageId:n};let f=h.reasonCode;f&&f>0&&f!==16?(l=new i.ErrorWithReasonCode(`Publish error: ${e.ReasonCodes[f]}`,f),a._removeOutgoingAndStoreMessage(n,()=>{o(l,h)})):a._sendPacket(s);break}case"suback":{delete a.outgoing[n],a.messageIdProvider.deallocate(n);let f=h.granted;for(let p=0;p<f.length;p++){let g=f[p];if(g&128){l=new Error(`Subscribe error: ${e.ReasonCodes[g]}`),l.code=g;let m=a.messageIdToTopic[n];m&&m.forEach(b=>{delete a._resubscribeTopics[b]})}}delete a.messageIdToTopic[n],a._invokeStoreProcessingQueue(),o(l,h);break}case"unsuback":{delete a.outgoing[n],a.messageIdProvider.deallocate(n),a._invokeStoreProcessingQueue(),o(null,h);break}default:a.emit("error",new Error("unrecognized packet type"))}a.disconnecting&&Object.keys(a.outgoing).length===0&&a.emit("outgoingEmpty")};e.default=t}),dh=be(e=>{ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0});var i=rr(),t=kr(),a=(h,n)=>{let{options:r}=h,s=r.protocolVersion,o=s===5?n.reasonCode:n.returnCode;if(s!==5){let l=new i.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${s}`,o);h.emit("error",l);return}h.handleAuth(n,(l,f)=>{if(l){h.emit("error",l);return}if(o===24)h.reconnecting=!1,h._sendPacket(f);else{let p=new i.ErrorWithReasonCode(`Connection refused: ${t.ReasonCodes[o]}`,o);h.emit("error",p)}})};e.default=a}),ph=be(e=>{var m,b,y,A,M,k,v,U,j,C,T,x,V,J,ne,S,z,re,Q,me,se,H,ye,oe,_e,_,Li,de,ve,ce,R,Ta,Y,fe,te,Ot,Rt,Ui,jr,Dr,De,Ni,fr,L;ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=void 0;var i=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,t=new Set,a=typeof Re=="object"&&Re?Re:{},h=(K,P,N,q)=>{typeof a.emitWarning=="function"?a.emitWarning(K,P,N,q):console.error(`[${N}] ${P}: ${K}`)},n=globalThis.AbortController,r=globalThis.AbortSignal;if(typeof n>"u"){r=class{constructor(){We(this,"onabort");We(this,"_onabort",[]);We(this,"reason");We(this,"aborted",!1)}addEventListener(N,q){this._onabort.push(q)}},n=class{constructor(){We(this,"signal",new r);P()}abort(N){var q,ue;if(!this.signal.aborted){this.signal.reason=N,this.signal.aborted=!0;for(let c of this.signal._onabort)c(N);(ue=(q=this.signal).onabort)==null||ue.call(q,N)}}};let K=((m=a.env)==null?void 0:m.LRU_CACHE_IGNORE_AC_WARNING)!=="1",P=()=>{K&&(K=!1,h("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",P))}}var s=K=>!t.has(K),o=K=>K&&K===Math.floor(K)&&K>0&&isFinite(K),l=K=>o(K)?K<=Math.pow(2,8)?Uint8Array:K<=Math.pow(2,16)?Uint16Array:K<=Math.pow(2,32)?Uint32Array:K<=Number.MAX_SAFE_INTEGER?f:null:null,f=class extends Array{constructor(K){super(K),this.fill(0)}},p=(b=class{constructor(P,N){We(this,"heap");We(this,"length");if(!O(b,y))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new N(P),this.length=0}static create(P){let N=l(P);if(!N)return[];ke(b,y,!0);let q=new b(P,N);return ke(b,y,!1),q}push(P){this.heap[this.length++]=P}pop(){return this.heap[--this.length]}},y=new WeakMap,Oe(b,y,!1),b),g=(L=class{constructor(P){Oe(this,_);Oe(this,A);Oe(this,M);Oe(this,k);Oe(this,v);Oe(this,U);We(this,"ttl");We(this,"ttlResolution");We(this,"ttlAutopurge");We(this,"updateAgeOnGet");We(this,"updateAgeOnHas");We(this,"allowStale");We(this,"noDisposeOnSet");We(this,"noUpdateTTL");We(this,"maxEntrySize");We(this,"sizeCalculation");We(this,"noDeleteOnFetchRejection");We(this,"noDeleteOnStaleGet");We(this,"allowStaleOnFetchAbort");We(this,"allowStaleOnFetchRejection");We(this,"ignoreFetchAbort");Oe(this,j);Oe(this,C);Oe(this,T);Oe(this,x);Oe(this,V);Oe(this,J);Oe(this,ne);Oe(this,S);Oe(this,z);Oe(this,re);Oe(this,Q);Oe(this,me);Oe(this,se);Oe(this,H);Oe(this,ye);Oe(this,oe);Oe(this,_e);Oe(this,de,()=>{});Oe(this,ve,()=>{});Oe(this,ce,()=>{});Oe(this,R,()=>!1);Oe(this,Y,P=>{});Oe(this,fe,(P,N,q)=>{});Oe(this,te,(P,N,q,ue)=>{if(q||ue)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});let{max:N=0,ttl:q,ttlResolution:ue=1,ttlAutopurge:c,updateAgeOnGet:u,updateAgeOnHas:d,allowStale:w,dispose:I,disposeAfter:W,noDisposeOnSet:ee,noUpdateTTL:Ie,maxSize:Pe=0,maxEntrySize:Be=0,sizeCalculation:Ae,fetchMethod:Ce,noDeleteOnFetchRejection:Te,noDeleteOnStaleGet:Ue,allowStaleOnFetchRejection:Ke,allowStaleOnFetchAbort:qe,ignoreFetchAbort:Ze}=P;if(N!==0&&!o(N))throw new TypeError("max option must be a nonnegative integer");let et=N?l(N):Array;if(!et)throw new Error("invalid max value: "+N);if(ke(this,A,N),ke(this,M,Pe),this.maxEntrySize=Be||O(this,M),this.sizeCalculation=Ae,this.sizeCalculation){if(!O(this,M)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(Ce!==void 0&&typeof Ce!="function")throw new TypeError("fetchMethod must be a function if specified");if(ke(this,U,Ce),ke(this,oe,!!Ce),ke(this,T,new Map),ke(this,x,new Array(N).fill(void 0)),ke(this,V,new Array(N).fill(void 0)),ke(this,J,new et(N)),ke(this,ne,new et(N)),ke(this,S,0),ke(this,z,0),ke(this,re,p.create(N)),ke(this,j,0),ke(this,C,0),typeof I=="function"&&ke(this,k,I),typeof W=="function"?(ke(this,v,W),ke(this,Q,[])):(ke(this,v,void 0),ke(this,Q,void 0)),ke(this,ye,!!O(this,k)),ke(this,_e,!!O(this,v)),this.noDisposeOnSet=!!ee,this.noUpdateTTL=!!Ie,this.noDeleteOnFetchRejection=!!Te,this.allowStaleOnFetchRejection=!!Ke,this.allowStaleOnFetchAbort=!!qe,this.ignoreFetchAbort=!!Ze,this.maxEntrySize!==0){if(O(this,M)!==0&&!o(O(this,M)))throw new TypeError("maxSize must be a positive integer if specified");if(!o(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");Ee(this,_,Ta).call(this)}if(this.allowStale=!!w,this.noDeleteOnStaleGet=!!Ue,this.updateAgeOnGet=!!u,this.updateAgeOnHas=!!d,this.ttlResolution=o(ue)||ue===0?ue:1,this.ttlAutopurge=!!c,this.ttl=q||0,this.ttl){if(!o(this.ttl))throw new TypeError("ttl must be a positive integer if specified");Ee(this,_,Li).call(this)}if(O(this,A)===0&&this.ttl===0&&O(this,M)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!O(this,A)&&!O(this,M)){let Ye="LRU_CACHE_UNBOUNDED";s(Ye)&&(t.add(Ye),h("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Ye,L))}}static unsafeExposeInternals(P){return{starts:O(P,se),ttls:O(P,H),sizes:O(P,me),keyMap:O(P,T),keyList:O(P,x),valList:O(P,V),next:O(P,J),prev:O(P,ne),get head(){return O(P,S)},get tail(){return O(P,z)},free:O(P,re),isBackgroundFetch:N=>{var q;return Ee(q=P,_,De).call(q,N)},backgroundFetch:(N,q,ue,c)=>{var u;return Ee(u=P,_,Dr).call(u,N,q,ue,c)},moveToTail:N=>{var q;return Ee(q=P,_,fr).call(q,N)},indexes:N=>{var q;return Ee(q=P,_,Ot).call(q,N)},rindexes:N=>{var q;return Ee(q=P,_,Rt).call(q,N)},isStale:N=>{var q;return O(q=P,R).call(q,N)}}}get max(){return O(this,A)}get maxSize(){return O(this,M)}get calculatedSize(){return O(this,C)}get size(){return O(this,j)}get fetchMethod(){return O(this,U)}get dispose(){return O(this,k)}get disposeAfter(){return O(this,v)}getRemainingTTL(P){return O(this,T).has(P)?1/0:0}*entries(){for(let P of Ee(this,_,Ot).call(this))O(this,V)[P]!==void 0&&O(this,x)[P]!==void 0&&!Ee(this,_,De).call(this,O(this,V)[P])&&(yield[O(this,x)[P],O(this,V)[P]])}*rentries(){for(let P of Ee(this,_,Rt).call(this))O(this,V)[P]!==void 0&&O(this,x)[P]!==void 0&&!Ee(this,_,De).call(this,O(this,V)[P])&&(yield[O(this,x)[P],O(this,V)[P]])}*keys(){for(let P of Ee(this,_,Ot).call(this)){let N=O(this,x)[P];N!==void 0&&!Ee(this,_,De).call(this,O(this,V)[P])&&(yield N)}}*rkeys(){for(let P of Ee(this,_,Rt).call(this)){let N=O(this,x)[P];N!==void 0&&!Ee(this,_,De).call(this,O(this,V)[P])&&(yield N)}}*values(){for(let P of Ee(this,_,Ot).call(this))O(this,V)[P]!==void 0&&!Ee(this,_,De).call(this,O(this,V)[P])&&(yield O(this,V)[P])}*rvalues(){for(let P of Ee(this,_,Rt).call(this))O(this,V)[P]!==void 0&&!Ee(this,_,De).call(this,O(this,V)[P])&&(yield O(this,V)[P])}[Symbol.iterator](){return this.entries()}find(P,N={}){for(let q of Ee(this,_,Ot).call(this)){let ue=O(this,V)[q],c=Ee(this,_,De).call(this,ue)?ue.__staleWhileFetching:ue;if(c!==void 0&&P(c,O(this,x)[q],this))return this.get(O(this,x)[q],N)}}forEach(P,N=this){for(let q of Ee(this,_,Ot).call(this)){let ue=O(this,V)[q],c=Ee(this,_,De).call(this,ue)?ue.__staleWhileFetching:ue;c!==void 0&&P.call(N,c,O(this,x)[q],this)}}rforEach(P,N=this){for(let q of Ee(this,_,Rt).call(this)){let ue=O(this,V)[q],c=Ee(this,_,De).call(this,ue)?ue.__staleWhileFetching:ue;c!==void 0&&P.call(N,c,O(this,x)[q],this)}}purgeStale(){let P=!1;for(let N of Ee(this,_,Rt).call(this,{allowStale:!0}))O(this,R).call(this,N)&&(this.delete(O(this,x)[N]),P=!0);return P}dump(){let P=[];for(let N of Ee(this,_,Ot).call(this,{allowStale:!0})){let q=O(this,x)[N],ue=O(this,V)[N],c=Ee(this,_,De).call(this,ue)?ue.__staleWhileFetching:ue;if(c===void 0||q===void 0)continue;let u={value:c};if(O(this,H)&&O(this,se)){u.ttl=O(this,H)[N];let d=i.now()-O(this,se)[N];u.start=Math.floor(Date.now()-d)}O(this,me)&&(u.size=O(this,me)[N]),P.unshift([q,u])}return P}load(P){this.clear();for(let[N,q]of P){if(q.start){let ue=Date.now()-q.start;q.start=i.now()-ue}this.set(N,q.value,q)}}set(P,N,q={}){var Ie,Pe,Be,Ae,Ce;if(N===void 0)return this.delete(P),this;let{ttl:ue=this.ttl,start:c,noDisposeOnSet:u=this.noDisposeOnSet,sizeCalculation:d=this.sizeCalculation,status:w}=q,{noUpdateTTL:I=this.noUpdateTTL}=q,W=O(this,te).call(this,P,N,q.size||0,d);if(this.maxEntrySize&&W>this.maxEntrySize)return w&&(w.set="miss",w.maxEntrySizeExceeded=!0),this.delete(P),this;let ee=O(this,j)===0?void 0:O(this,T).get(P);if(ee===void 0)ee=O(this,j)===0?O(this,z):O(this,re).length!==0?O(this,re).pop():O(this,j)===O(this,A)?Ee(this,_,jr).call(this,!1):O(this,j),O(this,x)[ee]=P,O(this,V)[ee]=N,O(this,T).set(P,ee),O(this,J)[O(this,z)]=ee,O(this,ne)[ee]=O(this,z),ke(this,z,ee),Nr(this,j)._++,O(this,fe).call(this,ee,W,w),w&&(w.set="add"),I=!1;else{Ee(this,_,fr).call(this,ee);let Te=O(this,V)[ee];if(N!==Te){if(O(this,oe)&&Ee(this,_,De).call(this,Te)){Te.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:Ue}=Te;Ue!==void 0&&!u&&(O(this,ye)&&((Ie=O(this,k))==null||Ie.call(this,Ue,P,"set")),O(this,_e)&&((Pe=O(this,Q))==null||Pe.push([Ue,P,"set"])))}else u||(O(this,ye)&&((Be=O(this,k))==null||Be.call(this,Te,P,"set")),O(this,_e)&&((Ae=O(this,Q))==null||Ae.push([Te,P,"set"])));if(O(this,Y).call(this,ee),O(this,fe).call(this,ee,W,w),O(this,V)[ee]=N,w){w.set="replace";let Ue=Te&&Ee(this,_,De).call(this,Te)?Te.__staleWhileFetching:Te;Ue!==void 0&&(w.oldValue=Ue)}}else w&&(w.set="update")}if(ue!==0&&!O(this,H)&&Ee(this,_,Li).call(this),O(this,H)&&(I||O(this,ce).call(this,ee,ue,c),w&&O(this,ve).call(this,w,ee)),!u&&O(this,_e)&&O(this,Q)){let Te=O(this,Q),Ue;for(;Ue=Te==null?void 0:Te.shift();)(Ce=O(this,v))==null||Ce.call(this,...Ue)}return this}pop(){var P;try{for(;O(this,j);){let N=O(this,V)[O(this,S)];if(Ee(this,_,jr).call(this,!0),Ee(this,_,De).call(this,N)){if(N.__staleWhileFetching)return N.__staleWhileFetching}else if(N!==void 0)return N}}finally{if(O(this,_e)&&O(this,Q)){let N=O(this,Q),q;for(;q=N==null?void 0:N.shift();)(P=O(this,v))==null||P.call(this,...q)}}}has(P,N={}){let{updateAgeOnHas:q=this.updateAgeOnHas,status:ue}=N,c=O(this,T).get(P);if(c!==void 0){let u=O(this,V)[c];if(Ee(this,_,De).call(this,u)&&u.__staleWhileFetching===void 0)return!1;if(O(this,R).call(this,c))ue&&(ue.has="stale",O(this,ve).call(this,ue,c));else return q&&O(this,de).call(this,c),ue&&(ue.has="hit",O(this,ve).call(this,ue,c)),!0}else ue&&(ue.has="miss");return!1}peek(P,N={}){let{allowStale:q=this.allowStale}=N,ue=O(this,T).get(P);if(ue!==void 0&&(q||!O(this,R).call(this,ue))){let c=O(this,V)[ue];return Ee(this,_,De).call(this,c)?c.__staleWhileFetching:c}}async fetch(P,N={}){let{allowStale:q=this.allowStale,updateAgeOnGet:ue=this.updateAgeOnGet,noDeleteOnStaleGet:c=this.noDeleteOnStaleGet,ttl:u=this.ttl,noDisposeOnSet:d=this.noDisposeOnSet,size:w=0,sizeCalculation:I=this.sizeCalculation,noUpdateTTL:W=this.noUpdateTTL,noDeleteOnFetchRejection:ee=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:Ie=this.allowStaleOnFetchRejection,ignoreFetchAbort:Pe=this.ignoreFetchAbort,allowStaleOnFetchAbort:Be=this.allowStaleOnFetchAbort,context:Ae,forceRefresh:Ce=!1,status:Te,signal:Ue}=N;if(!O(this,oe))return Te&&(Te.fetch="get"),this.get(P,{allowStale:q,updateAgeOnGet:ue,noDeleteOnStaleGet:c,status:Te});let Ke={allowStale:q,updateAgeOnGet:ue,noDeleteOnStaleGet:c,ttl:u,noDisposeOnSet:d,size:w,sizeCalculation:I,noUpdateTTL:W,noDeleteOnFetchRejection:ee,allowStaleOnFetchRejection:Ie,allowStaleOnFetchAbort:Be,ignoreFetchAbort:Pe,status:Te,signal:Ue},qe=O(this,T).get(P);if(qe===void 0){Te&&(Te.fetch="miss");let Ze=Ee(this,_,Dr).call(this,P,qe,Ke,Ae);return Ze.__returned=Ze}else{let Ze=O(this,V)[qe];if(Ee(this,_,De).call(this,Ze)){let Aa=q&&Ze.__staleWhileFetching!==void 0;return Te&&(Te.fetch="inflight",Aa&&(Te.returnedStale=!0)),Aa?Ze.__staleWhileFetching:Ze.__returned=Ze}let et=O(this,R).call(this,qe);if(!Ce&&!et)return Te&&(Te.fetch="hit"),Ee(this,_,fr).call(this,qe),ue&&O(this,de).call(this,qe),Te&&O(this,ve).call(this,Te,qe),Ze;let Ye=Ee(this,_,Dr).call(this,P,qe,Ke,Ae),Sa=Ye.__staleWhileFetching!==void 0&&q;return Te&&(Te.fetch=et?"stale":"refresh",Sa&&et&&(Te.returnedStale=!0)),Sa?Ye.__staleWhileFetching:Ye.__returned=Ye}}get(P,N={}){let{allowStale:q=this.allowStale,updateAgeOnGet:ue=this.updateAgeOnGet,noDeleteOnStaleGet:c=this.noDeleteOnStaleGet,status:u}=N,d=O(this,T).get(P);if(d!==void 0){let w=O(this,V)[d],I=Ee(this,_,De).call(this,w);return u&&O(this,ve).call(this,u,d),O(this,R).call(this,d)?(u&&(u.get="stale"),I?(u&&q&&w.__staleWhileFetching!==void 0&&(u.returnedStale=!0),q?w.__staleWhileFetching:void 0):(c||this.delete(P),u&&q&&(u.returnedStale=!0),q?w:void 0)):(u&&(u.get="hit"),I?w.__staleWhileFetching:(Ee(this,_,fr).call(this,d),ue&&O(this,de).call(this,d),w))}else u&&(u.get="miss")}delete(P){var q,ue,c,u;let N=!1;if(O(this,j)!==0){let d=O(this,T).get(P);if(d!==void 0)if(N=!0,O(this,j)===1)this.clear();else{O(this,Y).call(this,d);let w=O(this,V)[d];Ee(this,_,De).call(this,w)?w.__abortController.abort(new Error("deleted")):(O(this,ye)||O(this,_e))&&(O(this,ye)&&((q=O(this,k))==null||q.call(this,w,P,"delete")),O(this,_e)&&((ue=O(this,Q))==null||ue.push([w,P,"delete"]))),O(this,T).delete(P),O(this,x)[d]=void 0,O(this,V)[d]=void 0,d===O(this,z)?ke(this,z,O(this,ne)[d]):d===O(this,S)?ke(this,S,O(this,J)[d]):(O(this,J)[O(this,ne)[d]]=O(this,J)[d],O(this,ne)[O(this,J)[d]]=O(this,ne)[d]),Nr(this,j)._--,O(this,re).push(d)}}if(O(this,_e)&&((c=O(this,Q))!=null&&c.length)){let d=O(this,Q),w;for(;w=d==null?void 0:d.shift();)(u=O(this,v))==null||u.call(this,...w)}return N}clear(){var P,N,q;for(let ue of Ee(this,_,Rt).call(this,{allowStale:!0})){let c=O(this,V)[ue];if(Ee(this,_,De).call(this,c))c.__abortController.abort(new Error("deleted"));else{let u=O(this,x)[ue];O(this,ye)&&((P=O(this,k))==null||P.call(this,c,u,"delete")),O(this,_e)&&((N=O(this,Q))==null||N.push([c,u,"delete"]))}}if(O(this,T).clear(),O(this,V).fill(void 0),O(this,x).fill(void 0),O(this,H)&&O(this,se)&&(O(this,H).fill(0),O(this,se).fill(0)),O(this,me)&&O(this,me).fill(0),ke(this,S,0),ke(this,z,0),O(this,re).length=0,ke(this,C,0),ke(this,j,0),O(this,_e)&&O(this,Q)){let ue=O(this,Q),c;for(;c=ue==null?void 0:ue.shift();)(q=O(this,v))==null||q.call(this,...c)}}},A=new WeakMap,M=new WeakMap,k=new WeakMap,v=new WeakMap,U=new WeakMap,j=new WeakMap,C=new WeakMap,T=new WeakMap,x=new WeakMap,V=new WeakMap,J=new WeakMap,ne=new WeakMap,S=new WeakMap,z=new WeakMap,re=new WeakMap,Q=new WeakMap,me=new WeakMap,se=new WeakMap,H=new WeakMap,ye=new WeakMap,oe=new WeakMap,_e=new WeakMap,_=new WeakSet,Li=function(){let P=new f(O(this,A)),N=new f(O(this,A));ke(this,H,P),ke(this,se,N),ke(this,ce,(c,u,d=i.now())=>{if(N[c]=u!==0?d:0,P[c]=u,u!==0&&this.ttlAutopurge){let w=setTimeout(()=>{O(this,R).call(this,c)&&this.delete(O(this,x)[c])},u+1);w.unref&&w.unref()}}),ke(this,de,c=>{N[c]=P[c]!==0?i.now():0}),ke(this,ve,(c,u)=>{if(P[u]){let d=P[u],w=N[u];c.ttl=d,c.start=w,c.now=q||ue();let I=c.now-w;c.remainingTTL=d-I}});let q=0,ue=()=>{let c=i.now();if(this.ttlResolution>0){q=c;let u=setTimeout(()=>q=0,this.ttlResolution);u.unref&&u.unref()}return c};this.getRemainingTTL=c=>{let u=O(this,T).get(c);if(u===void 0)return 0;let d=P[u],w=N[u];if(d===0||w===0)return 1/0;let I=(q||ue())-w;return d-I},ke(this,R,c=>P[c]!==0&&N[c]!==0&&(q||ue())-N[c]>P[c])},de=new WeakMap,ve=new WeakMap,ce=new WeakMap,R=new WeakMap,Ta=function(){let P=new f(O(this,A));ke(this,C,0),ke(this,me,P),ke(this,Y,N=>{ke(this,C,O(this,C)-P[N]),P[N]=0}),ke(this,te,(N,q,ue,c)=>{if(Ee(this,_,De).call(this,q))return 0;if(!o(ue))if(c){if(typeof c!="function")throw new TypeError("sizeCalculation must be a function");if(ue=c(q,N),!o(ue))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return ue}),ke(this,fe,(N,q,ue)=>{if(P[N]=q,O(this,M)){let c=O(this,M)-P[N];for(;O(this,C)>c;)Ee(this,_,jr).call(this,!0)}ke(this,C,O(this,C)+P[N]),ue&&(ue.entrySize=q,ue.totalCalculatedSize=O(this,C))})},Y=new WeakMap,fe=new WeakMap,te=new WeakMap,Ot=function*({allowStale:P=this.allowStale}={}){if(O(this,j))for(let N=O(this,z);!(!Ee(this,_,Ui).call(this,N)||((P||!O(this,R).call(this,N))&&(yield N),N===O(this,S)));)N=O(this,ne)[N]},Rt=function*({allowStale:P=this.allowStale}={}){if(O(this,j))for(let N=O(this,S);!(!Ee(this,_,Ui).call(this,N)||((P||!O(this,R).call(this,N))&&(yield N),N===O(this,z)));)N=O(this,J)[N]},Ui=function(P){return P!==void 0&&O(this,T).get(O(this,x)[P])===P},jr=function(P){var c,u;let N=O(this,S),q=O(this,x)[N],ue=O(this,V)[N];return O(this,oe)&&Ee(this,_,De).call(this,ue)?ue.__abortController.abort(new Error("evicted")):(O(this,ye)||O(this,_e))&&(O(this,ye)&&((c=O(this,k))==null||c.call(this,ue,q,"evict")),O(this,_e)&&((u=O(this,Q))==null||u.push([ue,q,"evict"]))),O(this,Y).call(this,N),P&&(O(this,x)[N]=void 0,O(this,V)[N]=void 0,O(this,re).push(N)),O(this,j)===1?(ke(this,S,ke(this,z,0)),O(this,re).length=0):ke(this,S,O(this,J)[N]),O(this,T).delete(q),Nr(this,j)._--,N},Dr=function(P,N,q,ue){let c=N===void 0?void 0:O(this,V)[N];if(Ee(this,_,De).call(this,c))return c;let u=new n,{signal:d}=q;d==null||d.addEventListener("abort",()=>u.abort(d.reason),{signal:u.signal});let w={signal:u.signal,options:q,context:ue},I=(Ae,Ce=!1)=>{let{aborted:Te}=u.signal,Ue=q.ignoreFetchAbort&&Ae!==void 0;if(q.status&&(Te&&!Ce?(q.status.fetchAborted=!0,q.status.fetchError=u.signal.reason,Ue&&(q.status.fetchAbortIgnored=!0)):q.status.fetchResolved=!0),Te&&!Ue&&!Ce)return ee(u.signal.reason);let Ke=Pe;return O(this,V)[N]===Pe&&(Ae===void 0?Ke.__staleWhileFetching?O(this,V)[N]=Ke.__staleWhileFetching:this.delete(P):(q.status&&(q.status.fetchUpdated=!0),this.set(P,Ae,w.options))),Ae},W=Ae=>(q.status&&(q.status.fetchRejected=!0,q.status.fetchError=Ae),ee(Ae)),ee=Ae=>{let{aborted:Ce}=u.signal,Te=Ce&&q.allowStaleOnFetchAbort,Ue=Te||q.allowStaleOnFetchRejection,Ke=Ue||q.noDeleteOnFetchRejection,qe=Pe;if(O(this,V)[N]===Pe&&(!Ke||qe.__staleWhileFetching===void 0?this.delete(P):Te||(O(this,V)[N]=qe.__staleWhileFetching)),Ue)return q.status&&qe.__staleWhileFetching!==void 0&&(q.status.returnedStale=!0),qe.__staleWhileFetching;if(qe.__returned===qe)throw Ae},Ie=(Ae,Ce)=>{var Ue;let Te=(Ue=O(this,U))==null?void 0:Ue.call(this,P,c,w);Te&&Te instanceof Promise&&Te.then(Ke=>Ae(Ke===void 0?void 0:Ke),Ce),u.signal.addEventListener("abort",()=>{(!q.ignoreFetchAbort||q.allowStaleOnFetchAbort)&&(Ae(void 0),q.allowStaleOnFetchAbort&&(Ae=Ke=>I(Ke,!0)))})};q.status&&(q.status.fetchDispatched=!0);let Pe=new Promise(Ie).then(I,W),Be=Object.assign(Pe,{__abortController:u,__staleWhileFetching:c,__returned:void 0});return N===void 0?(this.set(P,Be,{...w.options,status:void 0}),N=O(this,T).get(P)):O(this,V)[N]=Be,Be},De=function(P){if(!O(this,oe))return!1;let N=P;return!!N&&N instanceof Promise&&N.hasOwnProperty("__staleWhileFetching")&&N.__abortController instanceof n},Ni=function(P,N){O(this,ne)[N]=P,O(this,J)[P]=N},fr=function(P){P!==O(this,z)&&(P===O(this,S)?ke(this,S,O(this,J)[P]):Ee(this,_,Ni).call(this,O(this,ne)[P],O(this,J)[P]),Ee(this,_,Ni).call(this,O(this,z),P),ke(this,z,P))},L);e.LRUCache=g}),St=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.ContainerIterator=e.Container=e.Base=void 0;var i=class{constructor(h=0){this.iteratorType=h}equals(h){return this.o===h.o}};e.ContainerIterator=i;var t=class{constructor(){this.i=0}get length(){return this.i}size(){return this.i}empty(){return this.i===0}};e.Base=t;var a=class extends t{};e.Container=a}),gh=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var i=St(),t=class extends i.Base{constructor(h=[]){super(),this.S=[];let n=this;h.forEach(function(r){n.push(r)})}clear(){this.i=0,this.S=[]}push(h){return this.S.push(h),this.i+=1,this.i}pop(){if(this.i!==0)return this.i-=1,this.S.pop()}top(){return this.S[this.i-1]}},a=t;e.default=a}),mh=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var i=St(),t=class extends i.Base{constructor(h=[]){super(),this.j=0,this.q=[];let n=this;h.forEach(function(r){n.push(r)})}clear(){this.q=[],this.i=this.j=0}push(h){let n=this.q.length;if(this.j/n>.5&&this.j+this.i>=n&&n>4096){let r=this.i;for(let s=0;s<r;++s)this.q[s]=this.q[this.j+s];this.j=0,this.q[this.i]=h}else this.q[this.j+this.i]=h;return++this.i}pop(){if(this.i===0)return;let h=this.q[this.j++];return this.i-=1,h}front(){if(this.i!==0)return this.q[this.j]}},a=t;e.default=a}),bh=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var i=St(),t=class extends i.Base{constructor(h=[],n=function(s,o){return s>o?-1:s<o?1:0},r=!0){if(super(),this.v=n,Array.isArray(h))this.C=r?[...h]:h;else{this.C=[];let o=this;h.forEach(function(l){o.C.push(l)})}this.i=this.C.length;let s=this.i>>1;for(let o=this.i-1>>1;o>=0;--o)this.k(o,s)}m(h){let n=this.C[h];for(;h>0;){let r=h-1>>1,s=this.C[r];if(this.v(s,n)<=0)break;this.C[h]=s,h=r}this.C[h]=n}k(h,n){let r=this.C[h];for(;h<n;){let s=h<<1|1,o=s+1,l=this.C[s];if(o<this.i&&this.v(l,this.C[o])>0&&(s=o,l=this.C[o]),this.v(l,r)>=0)break;this.C[h]=l,h=s}this.C[h]=r}clear(){this.i=0,this.C.length=0}push(h){this.C.push(h),this.m(this.i),this.i+=1}pop(){if(this.i===0)return;let h=this.C[0],n=this.C.pop();return this.i-=1,this.i&&(this.C[0]=n,this.k(0,this.i>>1)),h}top(){return this.C[0]}find(h){return this.C.indexOf(h)>=0}remove(h){let n=this.C.indexOf(h);return n<0?!1:(n===0?this.pop():n===this.i-1?(this.C.pop(),this.i-=1):(this.C.splice(n,1,this.C.pop()),this.i-=1,this.m(n),this.k(n,this.i>>1)),!0)}updateItem(h){let n=this.C.indexOf(h);return n<0?!1:(this.m(n),this.k(n,this.i>>1),!0)}toArray(){return[...this.C]}},a=t;e.default=a}),gi=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var i=St(),t=class extends i.Container{},a=t;e.default=a}),At=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.throwIteratorAccessError=i;function i(){throw new RangeError("Iterator access denied!")}}),us=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.RandomIterator=void 0;var i=St(),t=At(),a=class extends i.ContainerIterator{constructor(h,n){super(n),this.o=h,this.iteratorType===0?(this.pre=function(){return this.o===0&&(0,t.throwIteratorAccessError)(),this.o-=1,this},this.next=function(){return this.o===this.container.size()&&(0,t.throwIteratorAccessError)(),this.o+=1,this}):(this.pre=function(){return this.o===this.container.size()-1&&(0,t.throwIteratorAccessError)(),this.o+=1,this},this.next=function(){return this.o===-1&&(0,t.throwIteratorAccessError)(),this.o-=1,this})}get pointer(){return this.container.getElementByPos(this.o)}set pointer(h){this.container.setElementByPos(this.o,h)}};e.RandomIterator=a}),yh=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var i=a(gi()),t=us();function a(s){return s&&s.t?s:{default:s}}var h=class Ca extends t.RandomIterator{constructor(o,l,f){super(o,f),this.container=l}copy(){return new Ca(this.o,this.container,this.iteratorType)}},n=class extends i.default{constructor(s=[],o=!0){if(super(),Array.isArray(s))this.J=o?[...s]:s,this.i=s.length;else{this.J=[];let l=this;s.forEach(function(f){l.pushBack(f)})}}clear(){this.i=0,this.J.length=0}begin(){return new h(0,this)}end(){return new h(this.i,this)}rBegin(){return new h(this.i-1,this,1)}rEnd(){return new h(-1,this,1)}front(){return this.J[0]}back(){return this.J[this.i-1]}getElementByPos(s){if(s<0||s>this.i-1)throw new RangeError;return this.J[s]}eraseElementByPos(s){if(s<0||s>this.i-1)throw new RangeError;return this.J.splice(s,1),this.i-=1,this.i}eraseElementByValue(s){let o=0;for(let l=0;l<this.i;++l)this.J[l]!==s&&(this.J[o++]=this.J[l]);return this.i=this.J.length=o,this.i}eraseElementByIterator(s){let o=s.o;return s=s.next(),this.eraseElementByPos(o),s}pushBack(s){return this.J.push(s),this.i+=1,this.i}popBack(){if(this.i!==0)return this.i-=1,this.J.pop()}setElementByPos(s,o){if(s<0||s>this.i-1)throw new RangeError;this.J[s]=o}insert(s,o,l=1){if(s<0||s>this.i)throw new RangeError;return this.J.splice(s,0,...new Array(l).fill(o)),this.i+=l,this.i}find(s){for(let o=0;o<this.i;++o)if(this.J[o]===s)return new h(o,this);return this.end()}reverse(){this.J.reverse()}unique(){let s=1;for(let o=1;o<this.i;++o)this.J[o]!==this.J[o-1]&&(this.J[s++]=this.J[o]);return this.i=this.J.length=s,this.i}sort(s){this.J.sort(s)}forEach(s){for(let o=0;o<this.i;++o)s(this.J[o],o,this)}[Symbol.iterator](){return(function*(){yield*this.J}).bind(this)()}},r=n;e.default=r}),wh=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var i=h(gi()),t=St(),a=At();function h(o){return o&&o.t?o:{default:o}}var n=class Pa extends t.ContainerIterator{constructor(l,f,p,g){super(g),this.o=l,this.h=f,this.container=p,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.L,this})}get pointer(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o.l}set pointer(l){this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o.l=l}copy(){return new Pa(this.o,this.h,this.container,this.iteratorType)}},r=class extends i.default{constructor(o=[]){super(),this.h={},this.p=this._=this.h.L=this.h.B=this.h;let l=this;o.forEach(function(f){l.pushBack(f)})}V(o){let{L:l,B:f}=o;l.B=f,f.L=l,o===this.p&&(this.p=f),o===this._&&(this._=l),this.i-=1}G(o,l){let f=l.B,p={l:o,L:l,B:f};l.B=p,f.L=p,l===this.h&&(this.p=p),f===this.h&&(this._=p),this.i+=1}clear(){this.i=0,this.p=this._=this.h.L=this.h.B=this.h}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.l}back(){return this._.l}getElementByPos(o){if(o<0||o>this.i-1)throw new RangeError;let l=this.p;for(;o--;)l=l.B;return l.l}eraseElementByPos(o){if(o<0||o>this.i-1)throw new RangeError;let l=this.p;for(;o--;)l=l.B;return this.V(l),this.i}eraseElementByValue(o){let l=this.p;for(;l!==this.h;)l.l===o&&this.V(l),l=l.B;return this.i}eraseElementByIterator(o){let l=o.o;return l===this.h&&(0,a.throwIteratorAccessError)(),o=o.next(),this.V(l),o}pushBack(o){return this.G(o,this._),this.i}popBack(){if(this.i===0)return;let o=this._.l;return this.V(this._),o}pushFront(o){return this.G(o,this.h),this.i}popFront(){if(this.i===0)return;let o=this.p.l;return this.V(this.p),o}setElementByPos(o,l){if(o<0||o>this.i-1)throw new RangeError;let f=this.p;for(;o--;)f=f.B;f.l=l}insert(o,l,f=1){if(o<0||o>this.i)throw new RangeError;if(f<=0)return this.i;if(o===0)for(;f--;)this.pushFront(l);else if(o===this.i)for(;f--;)this.pushBack(l);else{let p=this.p;for(let m=1;m<o;++m)p=p.B;let g=p.B;for(this.i+=f;f--;)p.B={l,L:p},p.B.L=p,p=p.B;p.B=g,g.L=p}return this.i}find(o){let l=this.p;for(;l!==this.h;){if(l.l===o)return new n(l,this.h,this);l=l.B}return this.end()}reverse(){if(this.i<=1)return;let o=this.p,l=this._,f=0;for(;f<<1<this.i;){let p=o.l;o.l=l.l,l.l=p,o=o.B,l=l.L,f+=1}}unique(){if(this.i<=1)return this.i;let o=this.p;for(;o!==this.h;){let l=o;for(;l.B!==this.h&&l.l===l.B.l;)l=l.B,this.i-=1;o.B=l.B,o.B.L=o,o=o.B}return this.i}sort(o){if(this.i<=1)return;let l=[];this.forEach(function(p){l.push(p)}),l.sort(o);let f=this.p;l.forEach(function(p){f.l=p,f=f.B})}merge(o){let l=this;if(this.i===0)o.forEach(function(f){l.pushBack(f)});else{let f=this.p;o.forEach(function(p){for(;f!==l.h&&f.l<=p;)f=f.B;l.G(p,f.L)})}return this.i}forEach(o){let l=this.p,f=0;for(;l!==this.h;)o(l.l,f++,this),l=l.B}[Symbol.iterator](){return(function*(){if(this.i===0)return;let o=this.p;for(;o!==this.h;)yield o.l,o=o.B}).bind(this)()}},s=r;e.default=s}),_h=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var i=a(gi()),t=us();function a(s){return s&&s.t?s:{default:s}}var h=class Ba extends t.RandomIterator{constructor(o,l,f){super(o,f),this.container=l}copy(){return new Ba(this.o,this.container,this.iteratorType)}},n=class extends i.default{constructor(s=[],o=4096){super(),this.j=0,this.D=0,this.R=0,this.N=0,this.P=0,this.A=[];let l=(()=>{if(typeof s.length=="number")return s.length;if(typeof s.size=="number")return s.size;if(typeof s.size=="function")return s.size();throw new TypeError("Cannot get the length or size of the container")})();this.F=o,this.P=Math.max(Math.ceil(l/this.F),1);for(let g=0;g<this.P;++g)this.A.push(new Array(this.F));let f=Math.ceil(l/this.F);this.j=this.R=(this.P>>1)-(f>>1),this.D=this.N=this.F-l%this.F>>1;let p=this;s.forEach(function(g){p.pushBack(g)})}T(){let s=[],o=Math.max(this.P>>1,1);for(let l=0;l<o;++l)s[l]=new Array(this.F);for(let l=this.j;l<this.P;++l)s[s.length]=this.A[l];for(let l=0;l<this.R;++l)s[s.length]=this.A[l];s[s.length]=[...this.A[this.R]],this.j=o,this.R=s.length-1;for(let l=0;l<o;++l)s[s.length]=new Array(this.F);this.A=s,this.P=s.length}O(s){let o=this.D+s+1,l=o%this.F,f=l-1,p=this.j+(o-l)/this.F;return l===0&&(p-=1),p%=this.P,f<0&&(f+=this.F),{curNodeBucketIndex:p,curNodePointerIndex:f}}clear(){this.A=[new Array(this.F)],this.P=1,this.j=this.R=this.i=0,this.D=this.N=this.F>>1}begin(){return new h(0,this)}end(){return new h(this.i,this)}rBegin(){return new h(this.i-1,this,1)}rEnd(){return new h(-1,this,1)}front(){if(this.i!==0)return this.A[this.j][this.D]}back(){if(this.i!==0)return this.A[this.R][this.N]}pushBack(s){return this.i&&(this.N<this.F-1?this.N+=1:this.R<this.P-1?(this.R+=1,this.N=0):(this.R=0,this.N=0),this.R===this.j&&this.N===this.D&&this.T()),this.i+=1,this.A[this.R][this.N]=s,this.i}popBack(){if(this.i===0)return;let s=this.A[this.R][this.N];return this.i!==1&&(this.N>0?this.N-=1:this.R>0?(this.R-=1,this.N=this.F-1):(this.R=this.P-1,this.N=this.F-1)),this.i-=1,s}pushFront(s){return this.i&&(this.D>0?this.D-=1:this.j>0?(this.j-=1,this.D=this.F-1):(this.j=this.P-1,this.D=this.F-1),this.j===this.R&&this.D===this.N&&this.T()),this.i+=1,this.A[this.j][this.D]=s,this.i}popFront(){if(this.i===0)return;let s=this.A[this.j][this.D];return this.i!==1&&(this.D<this.F-1?this.D+=1:this.j<this.P-1?(this.j+=1,this.D=0):(this.j=0,this.D=0)),this.i-=1,s}getElementByPos(s){if(s<0||s>this.i-1)throw new RangeError;let{curNodeBucketIndex:o,curNodePointerIndex:l}=this.O(s);return this.A[o][l]}setElementByPos(s,o){if(s<0||s>this.i-1)throw new RangeError;let{curNodeBucketIndex:l,curNodePointerIndex:f}=this.O(s);this.A[l][f]=o}insert(s,o,l=1){if(s<0||s>this.i)throw new RangeError;if(s===0)for(;l--;)this.pushFront(o);else if(s===this.i)for(;l--;)this.pushBack(o);else{let f=[];for(let p=s;p<this.i;++p)f.push(this.getElementByPos(p));this.cut(s-1);for(let p=0;p<l;++p)this.pushBack(o);for(let p=0;p<f.length;++p)this.pushBack(f[p])}return this.i}cut(s){if(s<0)return this.clear(),0;let{curNodeBucketIndex:o,curNodePointerIndex:l}=this.O(s);return this.R=o,this.N=l,this.i=s+1,this.i}eraseElementByPos(s){if(s<0||s>this.i-1)throw new RangeError;if(s===0)this.popFront();else if(s===this.i-1)this.popBack();else{let o=[];for(let f=s+1;f<this.i;++f)o.push(this.getElementByPos(f));this.cut(s),this.popBack();let l=this;o.forEach(function(f){l.pushBack(f)})}return this.i}eraseElementByValue(s){if(this.i===0)return 0;let o=[];for(let f=0;f<this.i;++f){let p=this.getElementByPos(f);p!==s&&o.push(p)}let l=o.length;for(let f=0;f<l;++f)this.setElementByPos(f,o[f]);return this.cut(l-1)}eraseElementByIterator(s){let o=s.o;return this.eraseElementByPos(o),s=s.next(),s}find(s){for(let o=0;o<this.i;++o)if(this.getElementByPos(o)===s)return new h(o,this);return this.end()}reverse(){let s=0,o=this.i-1;for(;s<o;){let l=this.getElementByPos(s);this.setElementByPos(s,this.getElementByPos(o)),this.setElementByPos(o,l),s+=1,o-=1}}unique(){if(this.i<=1)return this.i;let s=1,o=this.getElementByPos(0);for(let l=1;l<this.i;++l){let f=this.getElementByPos(l);f!==o&&(o=f,this.setElementByPos(s++,f))}for(;this.i>s;)this.popBack();return this.i}sort(s){let o=[];for(let l=0;l<this.i;++l)o.push(this.getElementByPos(l));o.sort(s);for(let l=0;l<this.i;++l)this.setElementByPos(l,o[l])}shrinkToFit(){if(this.i===0)return;let s=[];this.forEach(function(o){s.push(o)}),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 o=0;o<this.P;++o)this.A.push(new Array(this.F));for(let o=0;o<s.length;++o)this.pushBack(s[o])}forEach(s){for(let o=0;o<this.i;++o)s(this.getElementByPos(o),o,this)}[Symbol.iterator](){return(function*(){for(let s=0;s<this.i;++s)yield this.getElementByPos(s)}).bind(this)()}},r=n;e.default=r}),vh=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.TreeNodeEnableIndex=e.TreeNode=void 0;var i=class{constructor(a,h){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=a,this.l=h}L(){let a=this;if(a.ee===1&&a.tt.tt===a)a=a.W;else if(a.U)for(a=a.U;a.W;)a=a.W;else{let h=a.tt;for(;h.U===a;)a=h,h=a.tt;a=h}return a}B(){let a=this;if(a.W){for(a=a.W;a.U;)a=a.U;return a}else{let h=a.tt;for(;h.W===a;)a=h,h=a.tt;return a.W!==h?h:a}}te(){let a=this.tt,h=this.W,n=h.U;return a.tt===this?a.tt=h:a.U===this?a.U=h:a.W=h,h.tt=a,h.U=this,this.tt=h,this.W=n,n&&(n.tt=this),h}se(){let a=this.tt,h=this.U,n=h.W;return a.tt===this?a.tt=h:a.U===this?a.U=h:a.W=h,h.tt=a,h.W=this,this.tt=h,this.U=n,n&&(n.tt=this),h}};e.TreeNode=i;var t=class extends i{constructor(){super(...arguments),this.rt=1}te(){let a=super.te();return this.ie(),a.ie(),a}se(){let a=super.se();return this.ie(),a.ie(),a}ie(){this.rt=1,this.U&&(this.rt+=this.U.rt),this.W&&(this.rt+=this.W.rt)}};e.TreeNodeEnableIndex=t}),cs=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var i=vh(),t=St(),a=At(),h=class extends t.Container{constructor(r=function(o,l){return o<l?-1:o>l?1:0},s=!1){super(),this.Y=void 0,this.v=r,s?(this.re=i.TreeNodeEnableIndex,this.M=function(o,l,f){let p=this.ne(o,l,f);if(p){let g=p.tt;for(;g!==this.h;)g.rt+=1,g=g.tt;let m=this.he(p);if(m){let{parentNode:b,grandParent:y,curNode:A}=m;b.ie(),y.ie(),A.ie()}}return this.i},this.V=function(o){let l=this.fe(o);for(;l!==this.h;)l.rt-=1,l=l.tt}):(this.re=i.TreeNode,this.M=function(o,l,f){let p=this.ne(o,l,f);return p&&this.he(p),this.i},this.V=this.fe),this.h=new this.re}X(r,s){let o=this.h;for(;r;){let l=this.v(r.u,s);if(l<0)r=r.W;else if(l>0)o=r,r=r.U;else return r}return o}Z(r,s){let o=this.h;for(;r;)this.v(r.u,s)<=0?r=r.W:(o=r,r=r.U);return o}$(r,s){let o=this.h;for(;r;){let l=this.v(r.u,s);if(l<0)o=r,r=r.W;else if(l>0)r=r.U;else return r}return o}rr(r,s){let o=this.h;for(;r;)this.v(r.u,s)<0?(o=r,r=r.W):r=r.U;return o}ue(r){for(;;){let s=r.tt;if(s===this.h)return;if(r.ee===1){r.ee=0;return}if(r===s.U){let o=s.W;if(o.ee===1)o.ee=0,s.ee=1,s===this.Y?this.Y=s.te():s.te();else if(o.W&&o.W.ee===1){o.ee=s.ee,s.ee=0,o.W.ee=0,s===this.Y?this.Y=s.te():s.te();return}else o.U&&o.U.ee===1?(o.ee=1,o.U.ee=0,o.se()):(o.ee=1,r=s)}else{let o=s.U;if(o.ee===1)o.ee=0,s.ee=1,s===this.Y?this.Y=s.se():s.se();else if(o.U&&o.U.ee===1){o.ee=s.ee,s.ee=0,o.U.ee=0,s===this.Y?this.Y=s.se():s.se();return}else o.W&&o.W.ee===1?(o.ee=1,o.W.ee=0,o.te()):(o.ee=1,r=s)}}}fe(r){if(this.i===1)return this.clear(),this.h;let s=r;for(;s.U||s.W;){if(s.W)for(s=s.W;s.U;)s=s.U;else s=s.U;[r.u,s.u]=[s.u,r.u],[r.l,s.l]=[s.l,r.l],r=s}this.h.U===s?this.h.U=s.tt:this.h.W===s&&(this.h.W=s.tt),this.ue(s);let o=s.tt;return s===o.U?o.U=void 0:o.W=void 0,this.i-=1,this.Y.ee=0,o}oe(r,s){return r===void 0?!1:this.oe(r.U,s)||s(r)?!0:this.oe(r.W,s)}he(r){for(;;){let s=r.tt;if(s.ee===0)return;let o=s.tt;if(s===o.U){let l=o.W;if(l&&l.ee===1){if(l.ee=s.ee=0,o===this.Y)return;o.ee=1,r=o;continue}else if(r===s.W){if(r.ee=0,r.U&&(r.U.tt=s),r.W&&(r.W.tt=o),s.W=r.U,o.U=r.W,r.U=s,r.W=o,o===this.Y)this.Y=r,this.h.tt=r;else{let f=o.tt;f.U===o?f.U=r:f.W=r}return r.tt=o.tt,s.tt=r,o.tt=r,o.ee=1,{parentNode:s,grandParent:o,curNode:r}}else s.ee=0,o===this.Y?this.Y=o.se():o.se(),o.ee=1}else{let l=o.U;if(l&&l.ee===1){if(l.ee=s.ee=0,o===this.Y)return;o.ee=1,r=o;continue}else if(r===s.U){if(r.ee=0,r.U&&(r.U.tt=o),r.W&&(r.W.tt=s),o.W=r.U,s.U=r.W,r.U=o,r.W=s,o===this.Y)this.Y=r,this.h.tt=r;else{let f=o.tt;f.U===o?f.U=r:f.W=r}return r.tt=o.tt,s.tt=r,o.tt=r,o.ee=1,{parentNode:s,grandParent:o,curNode:r}}else s.ee=0,o===this.Y?this.Y=o.te():o.te(),o.ee=1}return}}ne(r,s,o){if(this.Y===void 0){this.i+=1,this.Y=new this.re(r,s),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 l,f=this.h.U,p=this.v(f.u,r);if(p===0){f.l=s;return}else if(p>0)f.U=new this.re(r,s),f.U.tt=f,l=f.U,this.h.U=l;else{let g=this.h.W,m=this.v(g.u,r);if(m===0){g.l=s;return}else if(m<0)g.W=new this.re(r,s),g.W.tt=g,l=g.W,this.h.W=l;else{if(o!==void 0){let b=o.o;if(b!==this.h){let y=this.v(b.u,r);if(y===0){b.l=s;return}else if(y>0){let A=b.L(),M=this.v(A.u,r);if(M===0){A.l=s;return}else M<0&&(l=new this.re(r,s),A.W===void 0?(A.W=l,l.tt=A):(b.U=l,l.tt=b))}}}if(l===void 0)for(l=this.Y;;){let b=this.v(l.u,r);if(b>0){if(l.U===void 0){l.U=new this.re(r,s),l.U.tt=l,l=l.U;break}l=l.U}else if(b<0){if(l.W===void 0){l.W=new this.re(r,s),l.W.tt=l,l=l.W;break}l=l.W}else{l.l=s;return}}}}return this.i+=1,l}I(r,s){for(;r;){let o=this.v(r.u,s);if(o<0)r=r.W;else if(o>0)r=r.U;else return r}return r||this.h}clear(){this.i=0,this.Y=void 0,this.h.tt=void 0,this.h.U=this.h.W=void 0}updateKeyByIterator(r,s){let o=r.o;if(o===this.h&&(0,a.throwIteratorAccessError)(),this.i===1)return o.u=s,!0;if(o===this.h.U)return this.v(o.B().u,s)>0?(o.u=s,!0):!1;if(o===this.h.W)return this.v(o.L().u,s)<0?(o.u=s,!0):!1;let l=o.L().u;if(this.v(l,s)>=0)return!1;let f=o.B().u;return this.v(f,s)<=0?!1:(o.u=s,!0)}eraseElementByPos(r){if(r<0||r>this.i-1)throw new RangeError;let s=0,o=this;return this.oe(this.Y,function(l){return r===s?(o.V(l),!0):(s+=1,!1)}),this.i}eraseElementByKey(r){if(this.i===0)return!1;let s=this.I(this.Y,r);return s===this.h?!1:(this.V(s),!0)}eraseElementByIterator(r){let s=r.o;s===this.h&&(0,a.throwIteratorAccessError)();let o=s.W===void 0;return r.iteratorType===0?o&&r.next():(!o||s.U===void 0)&&r.next(),this.V(s),r}forEach(r){let s=0;for(let o of this)r(o,s++,this)}getElementByPos(r){if(r<0||r>this.i-1)throw new RangeError;let s,o=0;for(let l of this){if(o===r){s=l;break}o+=1}return s}getHeight(){if(this.i===0)return 0;let r=function(s){return s?Math.max(r(s.U),r(s.W))+1:0};return r(this.Y)}},n=h;e.default=n}),fs=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var i=St(),t=At(),a=class extends i.ContainerIterator{constructor(n,r,s){super(s),this.o=n,this.h=r,this.iteratorType===0?(this.pre=function(){return this.o===this.h.U&&(0,t.throwIteratorAccessError)(),this.o=this.o.L(),this},this.next=function(){return this.o===this.h&&(0,t.throwIteratorAccessError)(),this.o=this.o.B(),this}):(this.pre=function(){return this.o===this.h.W&&(0,t.throwIteratorAccessError)(),this.o=this.o.B(),this},this.next=function(){return this.o===this.h&&(0,t.throwIteratorAccessError)(),this.o=this.o.L(),this})}get index(){let n=this.o,r=this.h.tt;if(n===this.h)return r?r.rt-1:0;let s=0;for(n.U&&(s+=n.U.rt);n!==r;){let o=n.tt;n===o.W&&(s+=1,o.U&&(s+=o.U.rt)),n=o}return s}},h=a;e.default=h}),Eh=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var i=h(cs()),t=h(fs()),a=At();function h(o){return o&&o.t?o:{default:o}}var n=class Oa extends t.default{constructor(l,f,p,g){super(l,f,g),this.container=p}get pointer(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o.u}copy(){return new Oa(this.o,this.h,this.container,this.iteratorType)}},r=class extends i.default{constructor(o=[],l,f){super(l,f);let p=this;o.forEach(function(g){p.insert(g)})}*K(o){o!==void 0&&(yield*this.K(o.U),yield o.u,yield*this.K(o.W))}begin(){return new n(this.h.U||this.h,this.h,this)}end(){return new n(this.h,this.h,this)}rBegin(){return new n(this.h.W||this.h,this.h,this,1)}rEnd(){return new n(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(o,l){return this.M(o,void 0,l)}find(o){let l=this.I(this.Y,o);return new n(l,this.h,this)}lowerBound(o){let l=this.X(this.Y,o);return new n(l,this.h,this)}upperBound(o){let l=this.Z(this.Y,o);return new n(l,this.h,this)}reverseLowerBound(o){let l=this.$(this.Y,o);return new n(l,this.h,this)}reverseUpperBound(o){let l=this.rr(this.Y,o);return new n(l,this.h,this)}union(o){let l=this;return o.forEach(function(f){l.insert(f)}),this.i}[Symbol.iterator](){return this.K(this.Y)}},s=r;e.default=s}),Sh=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var i=h(cs()),t=h(fs()),a=At();function h(o){return o&&o.t?o:{default:o}}var n=class Ra extends t.default{constructor(l,f,p,g){super(l,f,g),this.container=p}get pointer(){this.o===this.h&&(0,a.throwIteratorAccessError)();let l=this;return new Proxy([],{get(f,p){if(p==="0")return l.o.u;if(p==="1")return l.o.l},set(f,p,g){if(p!=="1")throw new TypeError("props must be 1");return l.o.l=g,!0}})}copy(){return new Ra(this.o,this.h,this.container,this.iteratorType)}},r=class extends i.default{constructor(o=[],l,f){super(l,f);let p=this;o.forEach(function(g){p.setElement(g[0],g[1])})}*K(o){o!==void 0&&(yield*this.K(o.U),yield[o.u,o.l],yield*this.K(o.W))}begin(){return new n(this.h.U||this.h,this.h,this)}end(){return new n(this.h,this.h,this)}rBegin(){return new n(this.h.W||this.h,this.h,this,1)}rEnd(){return new n(this.h,this.h,this,1)}front(){if(this.i===0)return;let o=this.h.U;return[o.u,o.l]}back(){if(this.i===0)return;let o=this.h.W;return[o.u,o.l]}lowerBound(o){let l=this.X(this.Y,o);return new n(l,this.h,this)}upperBound(o){let l=this.Z(this.Y,o);return new n(l,this.h,this)}reverseLowerBound(o){let l=this.$(this.Y,o);return new n(l,this.h,this)}reverseUpperBound(o){let l=this.rr(this.Y,o);return new n(l,this.h,this)}setElement(o,l,f){return this.M(o,l,f)}find(o){let l=this.I(this.Y,o);return new n(l,this.h,this)}getElementByKey(o){return this.I(this.Y,o).l}union(o){let l=this;return o.forEach(function(f){l.setElement(f[0],f[1])}),this.i}[Symbol.iterator](){return this.K(this.Y)}},s=r;e.default=s}),ds=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=i;function i(t){let a=typeof t;return a==="object"&&t!==null||a==="function"}}),ps=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.HashContainerIterator=e.HashContainer=void 0;var i=St(),t=h(ds()),a=At();function h(s){return s&&s.t?s:{default:s}}var n=class extends i.ContainerIterator{constructor(s,o,l){super(l),this.o=s,this.h=o,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.L,this})}};e.HashContainerIterator=n;var r=class extends i.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(s){let{L:o,B:l}=s;o.B=l,l.L=o,s===this.p&&(this.p=l),s===this._&&(this._=o),this.i-=1}M(s,o,l){l===void 0&&(l=(0,t.default)(s));let f;if(l){let p=s[this.HASH_TAG];if(p!==void 0)return this.H[p].l=o,this.i;Object.defineProperty(s,this.HASH_TAG,{value:this.H.length,configurable:!0}),f={u:s,l:o,L:this._,B:this.h},this.H.push(f)}else{let p=this.g[s];if(p)return p.l=o,this.i;f={u:s,l:o,L:this._,B:this.h},this.g[s]=f}return this.i===0?(this.p=f,this.h.B=f):this._.B=f,this._=f,this.h.L=f,++this.i}I(s,o){if(o===void 0&&(o=(0,t.default)(s)),o){let l=s[this.HASH_TAG];return l===void 0?this.h:this.H[l]}else return this.g[s]||this.h}clear(){let s=this.HASH_TAG;this.H.forEach(function(o){delete o.u[s]}),this.H=[],this.g={},Object.setPrototypeOf(this.g,null),this.i=0,this.p=this._=this.h.L=this.h.B=this.h}eraseElementByKey(s,o){let l;if(o===void 0&&(o=(0,t.default)(s)),o){let f=s[this.HASH_TAG];if(f===void 0)return!1;delete s[this.HASH_TAG],l=this.H[f],delete this.H[f]}else{if(l=this.g[s],l===void 0)return!1;delete this.g[s]}return this.V(l),!0}eraseElementByIterator(s){let o=s.o;return o===this.h&&(0,a.throwIteratorAccessError)(),this.V(o),s.next()}eraseElementByPos(s){if(s<0||s>this.i-1)throw new RangeError;let o=this.p;for(;s--;)o=o.B;return this.V(o),this.i}};e.HashContainer=r}),Ah=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var i=ps(),t=At(),a=class xa extends i.HashContainerIterator{constructor(s,o,l,f){super(s,o,f),this.container=l}get pointer(){return this.o===this.h&&(0,t.throwIteratorAccessError)(),this.o.u}copy(){return new xa(this.o,this.h,this.container,this.iteratorType)}},h=class extends i.HashContainer{constructor(r=[]){super();let s=this;r.forEach(function(o){s.insert(o)})}begin(){return new a(this.p,this.h,this)}end(){return new a(this.h,this.h,this)}rBegin(){return new a(this._,this.h,this,1)}rEnd(){return new a(this.h,this.h,this,1)}front(){return this.p.u}back(){return this._.u}insert(r,s){return this.M(r,void 0,s)}getElementByPos(r){if(r<0||r>this.i-1)throw new RangeError;let s=this.p;for(;r--;)s=s.B;return s.u}find(r,s){let o=this.I(r,s);return new a(o,this.h,this)}forEach(r){let s=0,o=this.p;for(;o!==this.h;)r(o.u,s++,this),o=o.B}[Symbol.iterator](){return(function*(){let r=this.p;for(;r!==this.h;)yield r.u,r=r.B}).bind(this)()}},n=h;e.default=n}),kh=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var i=ps(),t=h(ds()),a=At();function h(o){return o&&o.t?o:{default:o}}var n=class Ma extends i.HashContainerIterator{constructor(l,f,p,g){super(l,f,g),this.container=p}get pointer(){this.o===this.h&&(0,a.throwIteratorAccessError)();let l=this;return new Proxy([],{get(f,p){if(p==="0")return l.o.u;if(p==="1")return l.o.l},set(f,p,g){if(p!=="1")throw new TypeError("props must be 1");return l.o.l=g,!0}})}copy(){return new Ma(this.o,this.h,this.container,this.iteratorType)}},r=class extends i.HashContainer{constructor(o=[]){super();let l=this;o.forEach(function(f){l.setElement(f[0],f[1])})}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(){if(this.i!==0)return[this.p.u,this.p.l]}back(){if(this.i!==0)return[this._.u,this._.l]}setElement(o,l,f){return this.M(o,l,f)}getElementByKey(o,l){if(l===void 0&&(l=(0,t.default)(o)),l){let p=o[this.HASH_TAG];return p!==void 0?this.H[p].l:void 0}let f=this.g[o];return f?f.l:void 0}getElementByPos(o){if(o<0||o>this.i-1)throw new RangeError;let l=this.p;for(;o--;)l=l.B;return[l.u,l.l]}find(o,l){let f=this.I(o,l);return new n(f,this.h,this)}forEach(o){let l=0,f=this.p;for(;f!==this.h;)o([f.u,f.l],l++,this),f=f.B}[Symbol.iterator](){return(function*(){let o=this.p;for(;o!==this.h;)yield[o.u,o.l],o=o.B}).bind(this)()}},s=r;e.default=s}),Ih=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),Object.defineProperty(e,"Deque",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"HashMap",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(e,"HashSet",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"LinkList",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"OrderedMap",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"OrderedSet",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"PriorityQueue",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"Queue",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"Stack",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"Vector",{enumerable:!0,get:function(){return h.default}});var i=p(gh()),t=p(mh()),a=p(bh()),h=p(yh()),n=p(wh()),r=p(_h()),s=p(Eh()),o=p(Sh()),l=p(Ah()),f=p(kh());function p(g){return g&&g.t?g:{default:g}}}),Th=be((e,i)=>{ae(),he(),le();var t=Ih().OrderedSet,a=Et()("number-allocator:trace"),h=Et()("number-allocator:error");function n(s,o){this.low=s,this.high=o}n.prototype.equals=function(s){return this.low===s.low&&this.high===s.high},n.prototype.compare=function(s){return this.low<s.low&&this.high<s.low?-1:s.low<this.low&&s.high<this.low?1:0};function r(s,o){if(!(this instanceof r))return new r(s,o);this.min=s,this.max=o,this.ss=new t([],(l,f)=>l.compare(f)),a("Create"),this.clear()}r.prototype.firstVacant=function(){return this.ss.size()===0?null:this.ss.front().low},r.prototype.alloc=function(){if(this.ss.size()===0)return a("alloc():empty"),null;let s=this.ss.begin(),o=s.pointer.low,l=s.pointer.high,f=o;return f+1<=l?this.ss.updateKeyByIterator(s,new n(o+1,l)):this.ss.eraseElementByPos(0),a("alloc():"+f),f},r.prototype.use=function(s){let o=new n(s,s),l=this.ss.lowerBound(o);if(!l.equals(this.ss.end())){let f=l.pointer.low,p=l.pointer.high;return l.pointer.equals(o)?(this.ss.eraseElementByIterator(l),a("use():"+s),!0):f>s?!1:f===s?(this.ss.updateKeyByIterator(l,new n(f+1,p)),a("use():"+s),!0):p===s?(this.ss.updateKeyByIterator(l,new n(f,p-1)),a("use():"+s),!0):(this.ss.updateKeyByIterator(l,new n(s+1,p)),this.ss.insert(new n(f,s-1)),a("use():"+s),!0)}return a("use():failed"),!1},r.prototype.free=function(s){if(s<this.min||s>this.max){h("free():"+s+" is out of range");return}let o=new n(s,s),l=this.ss.upperBound(o);if(l.equals(this.ss.end())){if(l.equals(this.ss.begin())){this.ss.insert(o);return}l.pre();let f=l.pointer.high;l.pointer.high+1===s?this.ss.updateKeyByIterator(l,new n(f,s)):this.ss.insert(o)}else if(l.equals(this.ss.begin()))if(s+1===l.pointer.low){let f=l.pointer.high;this.ss.updateKeyByIterator(l,new n(s,f))}else this.ss.insert(o);else{let f=l.pointer.low,p=l.pointer.high;l.pre();let g=l.pointer.low;l.pointer.high+1===s?s+1===f?(this.ss.eraseElementByIterator(l),this.ss.updateKeyByIterator(l,new n(g,p))):this.ss.updateKeyByIterator(l,new n(g,s)):s+1===f?(this.ss.eraseElementByIterator(l.next()),this.ss.insert(new n(s,p))):this.ss.insert(o)}a("free():"+s)},r.prototype.clear=function(){a("clear()"),this.ss.clear(),this.ss.insert(new n(this.min,this.max))},r.prototype.intervalCount=function(){return this.ss.size()},r.prototype.dump=function(){console.log("length:"+this.ss.size());for(let s of this.ss)console.log(s)},i.exports=r}),gs=be((e,i)=>{ae(),he(),le();var t=Th();i.exports.NumberAllocator=t}),Ch=be(e=>{ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0});var i=ph(),t=gs(),a=class{constructor(h){h>0&&(this.aliasToTopic=new i.LRUCache({max:h}),this.topicToAlias={},this.numberAllocator=new t.NumberAllocator(1,h),this.max=h,this.length=0)}put(h,n){if(n===0||n>this.max)return!1;let r=this.aliasToTopic.get(n);return r&&delete this.topicToAlias[r],this.aliasToTopic.set(n,h),this.topicToAlias[h]=n,this.numberAllocator.use(n),this.length=this.aliasToTopic.size,!0}getTopicByAlias(h){return this.aliasToTopic.get(h)}getAliasByTopic(h){let n=this.topicToAlias[h];return typeof n<"u"&&this.aliasToTopic.get(n),n}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=a}),Ph=be(e=>{ae(),he(),le();var i=e&&e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(e,"__esModule",{value:!0});var t=kr(),a=i(Ch()),h=rr(),n=(r,s)=>{r.log("_handleConnack");let{options:o}=r,l=o.protocolVersion===5?s.reasonCode:s.returnCode;if(clearTimeout(r.connackTimer),delete r.topicAliasSend,s.properties){if(s.properties.topicAliasMaximum){if(s.properties.topicAliasMaximum>65535){r.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}s.properties.topicAliasMaximum>0&&(r.topicAliasSend=new a.default(s.properties.topicAliasMaximum))}s.properties.serverKeepAlive&&o.keepalive&&(o.keepalive=s.properties.serverKeepAlive),s.properties.maximumPacketSize&&(o.properties||(o.properties={}),o.properties.maximumPacketSize=s.properties.maximumPacketSize)}if(l===0)r.reconnecting=!1,r._onConnect(s);else if(l>0){let f=new h.ErrorWithReasonCode(`Connection refused: ${t.ReasonCodes[l]}`,l);r.emit("error",f)}};e.default=n}),Bh=be(e=>{ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0});var i=(t,a,h)=>{t.log("handling pubrel packet");let n=typeof h<"u"?h:t.noop,{messageId:r}=a,s={cmd:"pubcomp",messageId:r};t.incomingStore.get(a,(o,l)=>{o?t._sendPacket(s,n):(t.emit("message",l.topic,l.payload,l),t.handleMessage(l,f=>{if(f)return n(f);t.incomingStore.del(l,t.noop),t._sendPacket(s,n)}))})};e.default=i}),Oh=be(e=>{ae(),he(),le();var i=e&&e.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(e,"__esModule",{value:!0});var t=i(ch()),a=i(dh()),h=i(Ph()),n=i(kr()),r=i(Bh()),s=(o,l,f)=>{let{options:p}=o;if(p.protocolVersion===5&&p.properties&&p.properties.maximumPacketSize&&p.properties.maximumPacketSize<l.length)return o.emit("error",new Error(`exceeding packets size ${l.cmd}`)),o.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),o;switch(o.log("_handlePacket :: emitting packetreceive"),o.emit("packetreceive",l),l.cmd){case"publish":(0,t.default)(o,l,f);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":o.reschedulePing(),(0,n.default)(o,l),f();break;case"pubrel":o.reschedulePing(),(0,r.default)(o,l,f);break;case"connack":(0,h.default)(o,l),f();break;case"auth":o.reschedulePing(),(0,a.default)(o,l),f();break;case"pingresp":o.log("_handlePacket :: received pingresp"),o.reschedulePing(!0),f();break;case"disconnect":o.emit("disconnect",l),f();break;default:o.log("_handlePacket :: unknown command"),f();break}};e.default=s}),Rh=be(e=>{ae(),he(),le();var i=e&&e.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(e,"__esModule",{value:!0}),e.TypedEventEmitter=void 0;var t=i((er(),Le(jt))),a=rr(),h=class{};e.TypedEventEmitter=h,(0,a.applyMixin)(h,t.default)}),Ir=be(e=>{ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0}),e.isReactNativeBrowser=e.isWebWorker=void 0;var i=()=>{var n;return typeof window<"u"?typeof navigator<"u"&&((n=navigator.userAgent)===null||n===void 0?void 0:n.toLowerCase().indexOf(" electron/"))>-1&&Re!=null&&Re.versions?!Object.prototype.hasOwnProperty.call(Re.versions,"electron"):typeof window.document<"u":!1},t=()=>{var n,r;return!!(typeof self=="object"&&!((r=(n=self==null?void 0:self.constructor)===null||n===void 0?void 0:n.name)===null||r===void 0)&&r.includes("WorkerGlobalScope"))},a=()=>typeof navigator<"u"&&navigator.product==="ReactNative",h=i()||t()||a();e.isWebWorker=t(),e.isReactNativeBrowser=a(),e.default=h}),xh=be((e,i)=>{ae(),he(),le(),function(t,a){typeof e=="object"&&typeof i<"u"?a(e):typeof define=="function"&&define.amd?define(["exports"],a):(t=typeof globalThis<"u"?globalThis:t||self,a(t.fastUniqueNumbers={}))}(e,function(t){var a=function(m){return function(b){var y=m(b);return b.add(y),y}},h=function(m){return function(b,y){return m.set(b,y),y}},n=Number.MAX_SAFE_INTEGER===void 0?9007199254740991:Number.MAX_SAFE_INTEGER,r=536870912,s=r*2,o=function(m,b){return function(y){var A=b.get(y),M=A===void 0?y.size:A<s?A+1:0;if(!y.has(M))return m(y,M);if(y.size<r){for(;y.has(M);)M=Math.floor(Math.random()*s);return m(y,M)}if(y.size>n)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;y.has(M);)M=Math.floor(Math.random()*n);return m(y,M)}},l=new WeakMap,f=h(l),p=o(f,l),g=a(p);t.addUniqueNumber=g,t.generateUniqueNumber=p})}),Mh=be((e,i)=>{ae(),he(),le(),function(t,a){typeof e=="object"&&typeof i<"u"?a(e,xh()):typeof define=="function"&&define.amd?define(["exports","fast-unique-numbers"],a):(t=typeof globalThis<"u"?globalThis:t||self,a(t.workerTimersBroker={},t.fastUniqueNumbers))}(e,function(t,a){var h=function(s){return s.method!==void 0&&s.method==="call"},n=function(s){return s.error===null&&typeof s.id=="number"},r=function(s){var o=new Map([[0,function(){}]]),l=new Map([[0,function(){}]]),f=new Map,p=new Worker(s);p.addEventListener("message",function(A){var M=A.data;if(h(M)){var k=M.params,v=k.timerId,U=k.timerType;if(U==="interval"){var j=o.get(v);if(typeof j=="number"){var C=f.get(j);if(C===void 0||C.timerId!==v||C.timerType!==U)throw new Error("The timer is in an undefined state.")}else if(typeof j<"u")j();else throw new Error("The timer is in an undefined state.")}else if(U==="timeout"){var T=l.get(v);if(typeof T=="number"){var x=f.get(T);if(x===void 0||x.timerId!==v||x.timerType!==U)throw new Error("The timer is in an undefined state.")}else if(typeof T<"u")T(),l.delete(v);else throw new Error("The timer is in an undefined state.")}}else if(n(M)){var V=M.id,J=f.get(V);if(J===void 0)throw new Error("The timer is in an undefined state.");var ne=J.timerId,S=J.timerType;f.delete(V),S==="interval"?o.delete(ne):l.delete(ne)}else{var z=M.error.message;throw new Error(z)}});var g=function(A){var M=a.generateUniqueNumber(f);f.set(M,{timerId:A,timerType:"interval"}),o.set(A,M),p.postMessage({id:M,method:"clear",params:{timerId:A,timerType:"interval"}})},m=function(A){var M=a.generateUniqueNumber(f);f.set(M,{timerId:A,timerType:"timeout"}),l.set(A,M),p.postMessage({id:M,method:"clear",params:{timerId:A,timerType:"timeout"}})},b=function(A){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,k=a.generateUniqueNumber(o);return o.set(k,function(){A(),typeof o.get(k)=="function"&&p.postMessage({id:null,method:"set",params:{delay:M,now:performance.now(),timerId:k,timerType:"interval"}})}),p.postMessage({id:null,method:"set",params:{delay:M,now:performance.now(),timerId:k,timerType:"interval"}}),k},y=function(A){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,k=a.generateUniqueNumber(l);return l.set(k,A),p.postMessage({id:null,method:"set",params:{delay:M,now:performance.now(),timerId:k,timerType:"timeout"}}),k};return{clearInterval:g,clearTimeout:m,setInterval:b,setTimeout:y}};t.load=r})}),Lh=be((e,i)=>{ae(),he(),le(),function(t,a){typeof e=="object"&&typeof i<"u"?a(e,Mh()):typeof define=="function"&&define.amd?define(["exports","worker-timers-broker"],a):(t=typeof globalThis<"u"?globalThis:t||self,a(t.workerTimers={},t.workerTimersBroker))}(e,function(t,a){var h=function(p,g){var m=null;return function(){if(m!==null)return m;var b=new Blob([g],{type:"application/javascript; charset=utf-8"}),y=URL.createObjectURL(b);return m=p(y),setTimeout(function(){return URL.revokeObjectURL(y)}),m}},n=`(()=>{var e={472:(e,t,r)=>{var o,i;void 0===(i="function"==typeof(o=function(){"use strict";var e=new Map,t=new Map,r=function(t){var r=e.get(t);if(void 0===r)throw new Error('There is no interval scheduled with the given id "'.concat(t,'".'));clearTimeout(r),e.delete(t)},o=function(e){var r=t.get(e);if(void 0===r)throw new Error('There is no timeout scheduled with the given id "'.concat(e,'".'));clearTimeout(r),t.delete(e)},i=function(e,t){var r,o=performance.now();return{expected:o+(r=e-Math.max(0,o-t)),remainingDelay:r}},n=function e(t,r,o,i){var n=performance.now();n>o?postMessage({id:null,method:"call",params:{timerId:r,timerType:i}}):t.set(r,setTimeout(e,o-n,t,r,o,i))},a=function(t,r,o){var a=i(t,o),s=a.expected,d=a.remainingDelay;e.set(r,setTimeout(n,d,e,r,s,"interval"))},s=function(e,r,o){var a=i(e,o),s=a.expected,d=a.remainingDelay;t.set(r,setTimeout(n,d,t,r,s,"timeout"))};addEventListener("message",(function(e){var t=e.data;try{if("clear"===t.method){var i=t.id,n=t.params,d=n.timerId,c=n.timerType;if("interval"===c)r(d),postMessage({error:null,id:i});else{if("timeout"!==c)throw new Error('The given type "'.concat(c,'" is not supported'));o(d),postMessage({error:null,id:i})}}else{if("set"!==t.method)throw new Error('The given method "'.concat(t.method,'" is not supported'));var u=t.params,l=u.delay,p=u.now,m=u.timerId,v=u.timerType;if("interval"===v)a(l,m,p);else{if("timeout"!==v)throw new Error('The given type "'.concat(v,'" is not supported'));s(l,m,p)}}}catch(e){postMessage({error:{message:e.message},id:t.id,result:null})}}))})?o.call(t,r,t,e):o)||(e.exports=i)}},t={};function r(o){var i=t[o];if(void 0!==i)return i.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,r),n.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 o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";r(472)})()})();`,r=h(a.load,n),s=function(p){return r().clearInterval(p)},o=function(p){return r().clearTimeout(p)},l=function(){var p;return(p=r()).setInterval.apply(p,arguments)},f=function(){var p;return(p=r()).setTimeout.apply(p,arguments)};t.clearInterval=s,t.clearTimeout=o,t.setInterval=l,t.setTimeout=f})}),Uh=be(e=>{ae(),he(),le();var i=e&&e.__createBinding||(Object.create?function(l,f,p,g){g===void 0&&(g=p);var m=Object.getOwnPropertyDescriptor(f,p);(!m||("get"in m?!f.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return f[p]}}),Object.defineProperty(l,g,m)}:function(l,f,p,g){g===void 0&&(g=p),l[g]=f[p]}),t=e&&e.__setModuleDefault||(Object.create?function(l,f){Object.defineProperty(l,"default",{enumerable:!0,value:f})}:function(l,f){l.default=f}),a=e&&e.__importStar||function(l){if(l&&l.__esModule)return l;var f={};if(l!=null)for(var p in l)p!=="default"&&Object.prototype.hasOwnProperty.call(l,p)&&i(f,l,p);return t(f,l),f};Object.defineProperty(e,"__esModule",{value:!0});var h=a(Ir()),n=Lh(),r={set:n.setInterval,clear:n.clearInterval},s={set:(l,f)=>setInterval(l,f),clear:l=>clearInterval(l)},o=l=>{switch(l){case"native":return s;case"worker":return r;case"auto":default:return h.default&&!h.isWebWorker&&!h.isReactNativeBrowser?r:s}};e.default=o}),ms=be(e=>{ae(),he(),le();var i=e&&e.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(e,"__esModule",{value:!0});var t=i(Uh()),a=class{get keepaliveTimeoutTimestamp(){return this._keepaliveTimeoutTimestamp}get intervalEvery(){return this._intervalEvery}get keepalive(){return this._keepalive}constructor(h,n){this.destroyed=!1,this.client=h,this.timer=typeof n=="object"&&"set"in n&&"clear"in n?n:(0,t.default)(n),this.setKeepalive(h.options.keepalive)}clear(){this.timerId&&(this.timer.clear(this.timerId),this.timerId=null)}setKeepalive(h){if(h*=1e3,isNaN(h)||h<=0||h>2147483647)throw new Error(`Keepalive value must be an integer between 0 and 2147483647. Provided value is ${h}`);this._keepalive=h,this.reschedule(),this.client.log(`KeepaliveManager: set keepalive to ${h}ms`)}destroy(){this.clear(),this.destroyed=!0}reschedule(){if(this.destroyed)return;this.clear(),this.counter=0;let h=Math.ceil(this._keepalive*1.5);this._keepaliveTimeoutTimestamp=Date.now()+h,this._intervalEvery=Math.ceil(this._keepalive/2),this.timerId=this.timer.set(()=>{this.destroyed||(this.counter+=1,this.counter===2?this.client.sendPing():this.counter>2&&this.client.onKeepaliveTimeout())},this._intervalEvery)}};e.default=a}),mi=be(e=>{ae(),he(),le();var i=e&&e.__createBinding||(Object.create?function(j,C,T,x){x===void 0&&(x=T);var V=Object.getOwnPropertyDescriptor(C,T);(!V||("get"in V?!C.__esModule:V.writable||V.configurable))&&(V={enumerable:!0,get:function(){return C[T]}}),Object.defineProperty(j,x,V)}:function(j,C,T,x){x===void 0&&(x=T),j[x]=C[T]}),t=e&&e.__setModuleDefault||(Object.create?function(j,C){Object.defineProperty(j,"default",{enumerable:!0,value:C})}:function(j,C){j.default=C}),a=e&&e.__importStar||function(j){if(j&&j.__esModule)return j;var C={};if(j!=null)for(var T in j)T!=="default"&&Object.prototype.hasOwnProperty.call(j,T)&&i(C,j,T);return t(C,j),C},h=e&&e.__importDefault||function(j){return j&&j.__esModule?j:{default:j}};Object.defineProperty(e,"__esModule",{value:!0});var n=h(kl()),r=h(ah()),s=h(ls()),o=Vt(),l=h(hh()),f=a(uh()),p=h(Et()),g=h(hs()),m=h(Oh()),b=rr(),y=Rh(),A=h(ms()),M=a(Ir()),k=globalThis.setImmediate||((...j)=>{let C=j.shift();(0,b.nextTick)(()=>{C(...j)})}),v={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0,writeCache:!0,timerVariant:"auto"},U=class ji extends y.TypedEventEmitter{static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}constructor(C,T){super(),this.options=T||{};for(let x in v)typeof this.options[x]>"u"?this.options[x]=v[x]:this.options[x]=T[x];this.log=this.options.log||(0,p.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: version:",ji.VERSION),M.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",M.default?"browser":"node"),this.log("MqttClient :: options.protocol",T.protocol),this.log("MqttClient :: options.protocolVersion",T.protocolVersion),this.log("MqttClient :: options.username",T.username),this.log("MqttClient :: options.keepalive",T.keepalive),this.log("MqttClient :: options.reconnectPeriod",T.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",T.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",T.properties?T.properties.topicAliasMaximum:void 0),this.options.clientId=typeof T.clientId=="string"?T.clientId:ji.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=T.protocolVersion===5&&T.customHandleAcks?T.customHandleAcks:(...x)=>{x[3](null,0)},this.options.writeCache||(r.default.writeToStream.cacheNumbers=!1),this.streamBuilder=C,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new s.default:this.options.messageIdProvider,this.outgoingStore=T.outgoingStore||new g.default,this.incomingStore=T.incomingStore||new g.default,this.queueQoSZero=T.queueQoSZero===void 0?!0:T.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,T.properties&&T.properties.topicAliasMaximum>0&&(T.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new n.default(T.properties.topicAliasMaximum)),this.on("connect",()=>{let{queue:x}=this,V=()=>{let J=x.shift();this.log("deliver :: entry %o",J);let ne=null;if(!J){this._resubscribe();return}ne=J.packet,this.log("deliver :: call _sendPacket for %o",ne);let S=!0;ne.messageId&&ne.messageId!==0&&(this.messageIdProvider.register(ne.messageId)||(S=!1)),S?this._sendPacket(ne,z=>{J.cb&&J.cb(z),V()}):(this.log("messageId: %d has already used. The message is skipped and removed.",ne.messageId),V())};this.log("connect :: sending queued packets"),V()}),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(C,T){T()}handleMessage(C,T){T()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}connect(){var C;let T=new o.Writable,x=r.default.parser(this.options),V=null,J=[];this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this.disconnected&&!this.reconnecting&&(this.incomingStore=this.options.incomingStore||new g.default,this.outgoingStore=this.options.outgoingStore||new g.default,this.disconnecting=!1,this.disconnected=!1),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),x.on("packet",Q=>{this.log("parser :: on packet push to packets array."),J.push(Q)});let ne=()=>{this.log("work :: getting next packet in queue");let Q=J.shift();if(Q)this.log("work :: packet pulled from queue"),(0,m.default)(this,Q,S);else{this.log("work :: no packets in queue");let me=V;V=null,this.log("work :: done flag is %s",!!me),me&&me()}},S=()=>{if(J.length)(0,b.nextTick)(ne);else{let Q=V;V=null,Q()}};T._write=(Q,me,se)=>{V=se,this.log("writable stream :: parsing buffer"),x.parse(Q),ne()};let z=Q=>{this.log("streamErrorHandler :: error",Q.message),Q.code?(this.log("streamErrorHandler :: emitting error"),this.emit("error",Q)):this.noop(Q)};this.log("connect :: pipe stream to writable stream"),this.stream.pipe(T),this.stream.on("error",z),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 re={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&&(re.will=Object.assign(Object.assign({},this.options.will),{payload:(C=this.options.will)===null||C===void 0?void 0:C.payload})),this.topicAliasRecv&&(re.properties||(re.properties={}),this.topicAliasRecv&&(re.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket(re),x.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return this.end(()=>this.emit("error",new Error("Packet has no Authentication Method"))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&typeof this.options.authPacket=="object"){let Q=Object.assign({cmd:"auth",reasonCode:0},this.options.authPacket);this._writePacket(Q)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(()=>{this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this.emit("error",new Error("connack timeout")),this._cleanUp(!0)},this.options.connectTimeout),this}publish(C,T,x,V){this.log("publish :: message `%s` to topic `%s`",T,C);let{options:J}=this;typeof x=="function"&&(V=x,x=null),x=x||{},x=Object.assign(Object.assign({},{qos:0,retain:!1,dup:!1}),x);let{qos:ne,retain:S,dup:z,properties:re,cbStorePut:Q}=x;if(this._checkDisconnecting(V))return this;let me=()=>{let se=0;if((ne===1||ne===2)&&(se=this._nextId(),se===null))return this.log("No messageId left"),!1;let H={cmd:"publish",topic:C,payload:T,qos:ne,retain:S,messageId:se,dup:z};switch(J.protocolVersion===5&&(H.properties=re),this.log("publish :: qos",ne),ne){case 1:case 2:this.outgoing[H.messageId]={volatile:!1,cb:V||this.noop},this.log("MqttClient:publish: packet cmd: %s",H.cmd),this._sendPacket(H,void 0,Q);break;default:this.log("MqttClient:publish: packet cmd: %s",H.cmd),this._sendPacket(H,V,Q);break}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!me())&&this._storeProcessingQueue.push({invoke:me,cbStorePut:x.cbStorePut,callback:V}),this}publishAsync(C,T,x){return new Promise((V,J)=>{this.publish(C,T,x,(ne,S)=>{ne?J(ne):V(S)})})}subscribe(C,T,x){let V=this.options.protocolVersion;typeof T=="function"&&(x=T),x=x||this.noop;let J=!1,ne=[];typeof C=="string"?(C=[C],ne=C):Array.isArray(C)?ne=C:typeof C=="object"&&(J=C.resubscribe,delete C.resubscribe,ne=Object.keys(C));let S=f.validateTopics(ne);if(S!==null)return k(x,new Error(`Invalid topic ${S}`)),this;if(this._checkDisconnecting(x))return this.log("subscribe: discconecting true"),this;let z={qos:0};V===5&&(z.nl=!1,z.rap=!1,z.rh=0),T=Object.assign(Object.assign({},z),T);let re=T.properties,Q=[],me=(H,ye)=>{if(ye=ye||T,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,H)||this._resubscribeTopics[H].qos<ye.qos||J){let oe={topic:H,qos:ye.qos};V===5&&(oe.nl=ye.nl,oe.rap=ye.rap,oe.rh=ye.rh,oe.properties=re),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",oe.topic,oe.qos),Q.push(oe)}};if(Array.isArray(C)?C.forEach(H=>{this.log("subscribe: array topic %s",H),me(H)}):Object.keys(C).forEach(H=>{this.log("subscribe: object topic %s, %o",H,C[H]),me(H,C[H])}),!Q.length)return x(null,[]),this;let se=()=>{let H=this._nextId();if(H===null)return this.log("No messageId left"),!1;let ye={cmd:"subscribe",subscriptions:Q,messageId:H};if(re&&(ye.properties=re),this.options.resubscribe){this.log("subscribe :: resubscribe true");let oe=[];Q.forEach(_e=>{if(this.options.reconnectPeriod>0){let _={qos:_e.qos};V===5&&(_.nl=_e.nl||!1,_.rap=_e.rap||!1,_.rh=_e.rh||0,_.properties=_e.properties),this._resubscribeTopics[_e.topic]=_,oe.push(_e.topic)}}),this.messageIdToTopic[ye.messageId]=oe}return this.outgoing[ye.messageId]={volatile:!0,cb(oe,_e){if(!oe){let{granted:_}=_e;for(let G=0;G<_.length;G+=1)Q[G].qos=_[G]}x(oe,Q,_e)}},this.log("subscribe :: call _sendPacket"),this._sendPacket(ye),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!se())&&this._storeProcessingQueue.push({invoke:se,callback:x}),this}subscribeAsync(C,T){return new Promise((x,V)=>{this.subscribe(C,T,(J,ne)=>{J?V(J):x(ne)})})}unsubscribe(C,T,x){typeof C=="string"&&(C=[C]),typeof T=="function"&&(x=T),x=x||this.noop;let V=f.validateTopics(C);if(V!==null)return k(x,new Error(`Invalid topic ${V}`)),this;if(this._checkDisconnecting(x))return this;let J=()=>{let ne=this._nextId();if(ne===null)return this.log("No messageId left"),!1;let S={cmd:"unsubscribe",messageId:ne,unsubscriptions:[]};return typeof C=="string"?S.unsubscriptions=[C]:Array.isArray(C)&&(S.unsubscriptions=C),this.options.resubscribe&&S.unsubscriptions.forEach(z=>{delete this._resubscribeTopics[z]}),typeof T=="object"&&T.properties&&(S.properties=T.properties),this.outgoing[S.messageId]={volatile:!0,cb:x},this.log("unsubscribe: call _sendPacket"),this._sendPacket(S),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!J())&&this._storeProcessingQueue.push({invoke:J,callback:x}),this}unsubscribeAsync(C,T){return new Promise((x,V)=>{this.unsubscribe(C,T,(J,ne)=>{J?V(J):x(ne)})})}end(C,T,x){this.log("end :: (%s)",this.options.clientId),(C==null||typeof C!="boolean")&&(x=x||T,T=C,C=!1),typeof T!="object"&&(x=x||T,T=null),this.log("end :: cb? %s",!!x),(!x||typeof x!="function")&&(x=this.noop);let V=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this.incomingStore.close(ne=>{this.outgoingStore.close(S=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),x){let z=ne||S;this.log("end :: closeStores: invoking callback with args"),x(z)}})}),this._deferredReconnect?this._deferredReconnect():(this.options.reconnectPeriod===0||this.options.manualConnect)&&(this.disconnecting=!1)},J=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,C),this._cleanUp(C,()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),(0,b.nextTick)(V)},T)};return this.disconnecting?(x(),this):(this._clearReconnect(),this.disconnecting=!0,!C&&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,J,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),J()),this)}endAsync(C,T){return new Promise((x,V)=>{this.end(C,T,J=>{J?V(J):x()})})}removeOutgoingMessage(C){if(this.outgoing[C]){let{cb:T}=this.outgoing[C];this._removeOutgoingAndStoreMessage(C,()=>{T(new Error("Message removed"))})}return this}reconnect(C){this.log("client reconnect");let T=()=>{C?(this.options.incomingStore=C.incomingStore,this.options.outgoingStore=C.outgoingStore):(this.options.incomingStore=null,this.options.outgoingStore=null),this.incomingStore=this.options.incomingStore||new g.default,this.outgoingStore=this.options.outgoingStore||new g.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(C=>{this.outgoing[C].volatile&&typeof this.outgoing[C].cb=="function"&&(this.outgoing[C].cb(new Error("Connection closed")),delete this.outgoing[C])}))}_flush(){this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach(C=>{typeof this.outgoing[C].cb=="function"&&(this.outgoing[C].cb(new Error("Connection closed")),delete this.outgoing[C])}))}_removeTopicAliasAndRecoverTopicName(C){let T;C.properties&&(T=C.properties.topicAlias);let x=C.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",T,x),x.length===0){if(typeof T>"u")return new Error("Unregistered Topic Alias");if(x=this.topicAliasSend.getTopicByAlias(T),typeof x>"u")return new Error("Unregistered Topic Alias");C.topic=x}T&&delete C.properties.topicAlias}_checkDisconnecting(C){return this.disconnecting&&(C&&C!==this.noop?C(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting}_reconnect(){this.log("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this.connect()}),this.log("client already connected. disconnecting first.")):(this.log("_reconnect: calling connect"),this.connect())}_setupReconnect(){!this.disconnecting&&!this.reconnectTimer&&this.options.reconnectPeriod>0?(this.reconnecting||(this.log("_setupReconnect :: emit `offline` state"),this.emit("offline"),this.log("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),this.log("_setupReconnect :: setting reconnectTimer for %d ms",this.options.reconnectPeriod),this.reconnectTimer=setInterval(()=>{this.log("reconnectTimer :: reconnect triggered!"),this._reconnect()},this.options.reconnectPeriod)):this.log("_setupReconnect :: doing nothing...")}_clearReconnect(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)}_cleanUp(C,T,x={}){if(T&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",T)),this.log("_cleanUp :: forced? %s",C),C)this.options.reconnectPeriod===0&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{let V=Object.assign({cmd:"disconnect"},x);this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(V,()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),k(()=>{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(C,T,x){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",C.cmd);let V=C,J;if(V.cmd==="publish"&&(V=(0,l.default)(C),J=this._removeTopicAliasAndRecoverTopicName(V),J))return T&&T(J);this.outgoingStore.put(V,ne=>{if(ne)return T&&T(ne);x(),this._writePacket(C,T)})}_applyTopicAlias(C){if(this.options.protocolVersion===5&&C.cmd==="publish"){let T;C.properties&&(T=C.properties.topicAlias);let x=C.topic.toString();if(this.topicAliasSend)if(T){if(x.length!==0&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",x,T),!this.topicAliasSend.put(x,T)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",x,T),new Error("Sending Topic Alias out of range")}else x.length!==0&&(this.options.autoAssignTopicAlias?(T=this.topicAliasSend.getAliasByTopic(x),T?(C.topic="",C.properties=Object.assign(Object.assign({},C.properties),{topicAlias:T}),this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",x,T)):(T=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(x,T),C.properties=Object.assign(Object.assign({},C.properties),{topicAlias:T}),this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",x,T))):this.options.autoUseTopicAlias&&(T=this.topicAliasSend.getAliasByTopic(x),T&&(C.topic="",C.properties=Object.assign(Object.assign({},C.properties),{topicAlias:T}),this.log("applyTopicAlias :: auto use topic: %s - alias: %d",x,T))));else if(T)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",x,T),new Error("Sending Topic Alias out of range")}}_noop(C){this.log("noop ::",C)}_writePacket(C,T){this.log("_writePacket :: packet: %O",C),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",C),this.log("_writePacket :: writing to stream");let x=r.default.writeToStream(C,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",x),!x&&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(C,T,x,V){this.log("_sendPacket :: (%s) :: start",this.options.clientId),x=x||this.noop,T=T||this.noop;let J=this._applyTopicAlias(C);if(J){T(J);return}if(!this.connected){if(C.cmd==="auth"){this._writePacket(C,T);return}this.log("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(C,T,x);return}if(V){this._writePacket(C,T);return}switch(C.cmd){case"publish":break;case"pubrel":this._storeAndSend(C,T,x);return;default:this._writePacket(C,T);return}switch(C.qos){case 2:case 1:this._storeAndSend(C,T,x);break;case 0:default:this._writePacket(C,T);break}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}_storePacket(C,T,x){this.log("_storePacket :: packet: %o",C),this.log("_storePacket :: cb? %s",!!T),x=x||this.noop;let V=C;if(V.cmd==="publish"){V=(0,l.default)(C);let ne=this._removeTopicAliasAndRecoverTopicName(V);if(ne)return T&&T(ne)}let J=V.qos||0;J===0&&this.queueQoSZero||V.cmd!=="publish"?this.queue.push({packet:V,cb:T}):J>0?(T=this.outgoing[V.messageId]?this.outgoing[V.messageId].cb:null,this.outgoingStore.put(V,ne=>{if(ne)return T&&T(ne);x()})):T&&T(new Error("No connection to broker"))}_setupKeepaliveManager(){this.log("_setupKeepaliveManager :: keepalive %d (seconds)",this.options.keepalive),!this.keepaliveManager&&this.options.keepalive&&(this.keepaliveManager=new A.default(this,this.options.timerVariant))}_destroyKeepaliveManager(){this.keepaliveManager&&(this.log("_destroyKeepaliveManager :: destroying keepalive manager"),this.keepaliveManager.destroy(),this.keepaliveManager=null)}reschedulePing(C=!1){this.keepaliveManager&&this.options.keepalive&&(C||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",new Error("Keepalive timeout")),this.log("onKeepaliveTimeout :: calling _cleanUp with force true"),this._cleanUp(!0)}_resubscribe(){this.log("_resubscribe");let C=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion>=4&&!this.connackPacket.sessionPresent)&&C.length>0)if(this.options.resubscribe)if(this.options.protocolVersion===5){this.log("_resubscribe: protocolVersion 5");for(let T=0;T<C.length;T++){let x={};x[C[T]]=this._resubscribeTopics[C[T]],x.resubscribe=!0,this.subscribe(x,{properties:x[C[T]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1}_onConnect(C){if(this.disconnected){this.emit("connect",C);return}this.connackPacket=C,this.messageIdProvider.clear(),this._setupKeepaliveManager(),this.connected=!0;let T=()=>{let x=this.outgoingStore.createStream(),V=()=>{x.destroy(),x=null,this._flushStoreProcessingQueue(),J()},J=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",V),x.on("error",S=>{J(),this._flushStoreProcessingQueue(),this.removeListener("close",V),this.emit("error",S)});let ne=()=>{if(!x)return;let S=x.read(1),z;if(!S){x.once("readable",ne);return}if(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[S.messageId]){ne();return}!this.disconnecting&&!this.reconnectTimer?(z=this.outgoing[S.messageId]?this.outgoing[S.messageId].cb:null,this.outgoing[S.messageId]={volatile:!1,cb(re,Q){z&&z(re,Q),ne()}},this._packetIdsDuringStoreProcessing[S.messageId]=!0,this.messageIdProvider.register(S.messageId)?this._sendPacket(S,void 0,void 0,!0):this.log("messageId: %d has already used.",S.messageId)):x.destroy&&x.destroy()};x.on("end",()=>{let S=!0;for(let z in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[z]){S=!1;break}this.removeListener("close",V),S?(J(),this._invokeAllStoreProcessingQueue(),this.emit("connect",C)):T()}),ne()};T()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){let C=this._storeProcessingQueue[0];if(C&&C.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(let C of this._storeProcessingQueue)C.cbStorePut&&C.cbStorePut(new Error("Connection closed")),C.callback&&C.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)}_removeOutgoingAndStoreMessage(C,T){delete this.outgoing[C],this.outgoingStore.del({messageId:C},(x,V)=>{T(x,V),this.messageIdProvider.deallocate(C),this._invokeStoreProcessingQueue()})}};U.VERSION=b.MQTTJS_VERSION,e.default=U}),Nh=be(e=>{ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0});var i=gs(),t=class{constructor(){this.numberAllocator=new i.NumberAllocator(1,65535)}allocate(){return this.lastId=this.numberAllocator.alloc(),this.lastId}getLastAllocated(){return this.lastId}register(a){return this.numberAllocator.use(a)}deallocate(a){this.numberAllocator.free(a)}clear(){this.numberAllocator.clear()}};e.default=t});function qt(e){throw new RangeError(Es[e])}function bs(e,i){let t=e.split("@"),a="";t.length>1&&(a=t[0]+"@",e=t[1]);let h=function(n,r){let s=[],o=n.length;for(;o--;)s[o]=r(n[o]);return s}((e=e.replace(vs,".")).split("."),i).join(".");return a+h}function ys(e){let i=[],t=0,a=e.length;for(;t<a;){let h=e.charCodeAt(t++);if(h>=55296&&h<=56319&&t<a){let n=e.charCodeAt(t++);(64512&n)==56320?i.push(((1023&h)<<10)+(1023&n)+65536):(i.push(h),t--)}else i.push(h)}return i}var ws,_s,vs,Es,lt,Tr,bi,yi,wi,_i,Bt,jh=Qe(()=>{ae(),he(),le(),ws=/^xn--/,_s=/[^\0-\x7E]/,vs=/[\x2E\u3002\uFF0E\uFF61]/g,Es={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},lt=Math.floor,Tr=String.fromCharCode,bi=function(e,i){return e+22+75*(e<26)-((i!=0)<<5)},yi=function(e,i,t){let a=0;for(e=t?lt(e/700):e>>1,e+=lt(e/i);e>455;a+=36)e=lt(e/35);return lt(a+36*e/(e+38))},wi=function(e){let i=[],t=e.length,a=0,h=128,n=72,r=e.lastIndexOf("-");r<0&&(r=0);for(let o=0;o<r;++o)e.charCodeAt(o)>=128&&qt("not-basic"),i.push(e.charCodeAt(o));for(let o=r>0?r+1:0;o<t;){let l=a;for(let p=1,g=36;;g+=36){o>=t&&qt("invalid-input");let m=(s=e.charCodeAt(o++))-48<10?s-22:s-65<26?s-65:s-97<26?s-97:36;(m>=36||m>lt((2147483647-a)/p))&&qt("overflow"),a+=m*p;let b=g<=n?1:g>=n+26?26:g-n;if(m<b)break;let y=36-b;p>lt(2147483647/y)&&qt("overflow"),p*=y}let f=i.length+1;n=yi(a-l,f,l==0),lt(a/f)>2147483647-h&&qt("overflow"),h+=lt(a/f),a%=f,i.splice(a++,0,h)}var s;return String.fromCodePoint(...i)},_i=function(e){let i=[],t=(e=ys(e)).length,a=128,h=0,n=72;for(let o of e)o<128&&i.push(Tr(o));let r=i.length,s=r;for(r&&i.push("-");s<t;){let o=2147483647;for(let f of e)f>=a&&f<o&&(o=f);let l=s+1;o-a>lt((2147483647-h)/l)&&qt("overflow"),h+=(o-a)*l,a=o;for(let f of e)if(f<a&&++h>2147483647&&qt("overflow"),f==a){let p=h;for(let g=36;;g+=36){let m=g<=n?1:g>=n+26?26:g-n;if(p<m)break;let b=p-m,y=36-m;i.push(Tr(bi(m+b%y,0))),p=lt(b/y)}i.push(Tr(bi(p,0))),n=yi(h,l,s==r),h=0,++s}++h,++a}return i.join("")},Bt={version:"2.1.0",ucs2:{decode:ys,encode:e=>String.fromCodePoint(...e)},decode:wi,encode:_i,toASCII:function(e){return bs(e,function(i){return _s.test(i)?"xn--"+_i(i):i})},toUnicode:function(e){return bs(e,function(i){return ws.test(i)?wi(i.slice(4).toLowerCase()):i})}},Bt.decode,Bt.encode,Bt.toASCII,Bt.toUnicode,Bt.ucs2,Bt.version});function Dh(e,i){return Object.prototype.hasOwnProperty.call(e,i)}var Ss,nr,As,ft,Fh=Qe(()=>{ae(),he(),le(),Ss=function(e,i,t,a){i=i||"&",t=t||"=";var h={};if(typeof e!="string"||e.length===0)return h;var n=/\+/g;e=e.split(i);var r=1e3;a&&typeof a.maxKeys=="number"&&(r=a.maxKeys);var s=e.length;r>0&&s>r&&(s=r);for(var o=0;o<s;++o){var l,f,p,g,m=e[o].replace(n,"%20"),b=m.indexOf(t);b>=0?(l=m.substr(0,b),f=m.substr(b+1)):(l=m,f=""),p=decodeURIComponent(l),g=decodeURIComponent(f),Dh(h,p)?Array.isArray(h[p])?h[p].push(g):h[p]=[h[p],g]:h[p]=g}return h},nr=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},As=function(e,i,t,a){return i=i||"&",t=t||"=",e===null&&(e=void 0),typeof e=="object"?Object.keys(e).map(function(h){var n=encodeURIComponent(nr(h))+t;return Array.isArray(e[h])?e[h].map(function(r){return n+encodeURIComponent(nr(r))}).join(i):n+encodeURIComponent(nr(e[h]))}).join(i):a?encodeURIComponent(nr(a))+t+encodeURIComponent(nr(e)):""},ft={},ft.decode=ft.parse=Ss,ft.encode=ft.stringify=As,ft.decode,ft.encode,ft.parse,ft.stringify});function vi(){throw new Error("setTimeout has not been defined")}function Ei(){throw new Error("clearTimeout has not been defined")}function ks(e){if(It===setTimeout)return setTimeout(e,0);if((It===vi||!It)&&setTimeout)return It=setTimeout,setTimeout(e,0);try{return It(e,0)}catch{try{return It.call(null,e,0)}catch{return It.call(this||Ht,e,0)}}}function Wh(){Kt&&zt&&(Kt=!1,zt.length?dt=zt.concat(dt):ur=-1,dt.length&&Is())}function Is(){if(!Kt){var e=ks(Wh);Kt=!0;for(var i=dt.length;i;){for(zt=dt,dt=[];++ur<i;)zt&&zt[ur].run();ur=-1,i=dt.length}zt=null,Kt=!1,function(t){if(Tt===clearTimeout)return clearTimeout(t);if((Tt===Ei||!Tt)&&clearTimeout)return Tt=clearTimeout,clearTimeout(t);try{Tt(t)}catch{try{return Tt.call(null,t)}catch{return Tt.call(this||Ht,t)}}}(e)}}function Ts(e,i){(this||Ht).fun=e,(this||Ht).array=i}function kt(){}var Cs,It,Tt,Ht,Ve,zt,dt,Kt,ur,Fe,$h=Qe(()=>{ae(),he(),le(),Ht=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,Ve=Cs={},function(){try{It=typeof setTimeout=="function"?setTimeout:vi}catch{It=vi}try{Tt=typeof clearTimeout=="function"?clearTimeout:Ei}catch{Tt=Ei}}(),dt=[],Kt=!1,ur=-1,Ve.nextTick=function(e){var i=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)i[t-1]=arguments[t];dt.push(new Ts(e,i)),dt.length!==1||Kt||ks(Is)},Ts.prototype.run=function(){(this||Ht).fun.apply(null,(this||Ht).array)},Ve.title="browser",Ve.browser=!0,Ve.env={},Ve.argv=[],Ve.version="",Ve.versions={},Ve.on=kt,Ve.addListener=kt,Ve.once=kt,Ve.off=kt,Ve.removeListener=kt,Ve.removeAllListeners=kt,Ve.emit=kt,Ve.prependListener=kt,Ve.prependOnceListener=kt,Ve.listeners=function(e){return[]},Ve.binding=function(e){throw new Error("process.binding is not supported")},Ve.cwd=function(){return"/"},Ve.chdir=function(e){throw new Error("process.chdir is not supported")},Ve.umask=function(){return 0},Fe=Cs,Fe.addListener,Fe.argv,Fe.binding,Fe.browser,Fe.chdir,Fe.cwd,Fe.emit,Fe.env,Fe.listeners,Fe.nextTick,Fe.off,Fe.on,Fe.once,Fe.prependListener,Fe.prependOnceListener,Fe.removeAllListeners,Fe.removeListener,Fe.title,Fe.umask,Fe.version,Fe.versions});function Vh(){if(Si)return Cr;Si=!0;var e=Cr={},i,t;function a(){throw new Error("setTimeout has not been defined")}function h(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?i=setTimeout:i=a}catch{i=a}try{typeof clearTimeout=="function"?t=clearTimeout:t=h}catch{t=h}})();function n(y){if(i===setTimeout)return setTimeout(y,0);if((i===a||!i)&&setTimeout)return i=setTimeout,setTimeout(y,0);try{return i(y,0)}catch{try{return i.call(null,y,0)}catch{return i.call(this||Yt,y,0)}}}function r(y){if(t===clearTimeout)return clearTimeout(y);if((t===h||!t)&&clearTimeout)return t=clearTimeout,clearTimeout(y);try{return t(y)}catch{try{return t.call(null,y)}catch{return t.call(this||Yt,y)}}}var s=[],o=!1,l,f=-1;function p(){!o||!l||(o=!1,l.length?s=l.concat(s):f=-1,s.length&&g())}function g(){if(!o){var y=n(p);o=!0;for(var A=s.length;A;){for(l=s,s=[];++f<A;)l&&l[f].run();f=-1,A=s.length}l=null,o=!1,r(y)}}e.nextTick=function(y){var A=new Array(arguments.length-1);if(arguments.length>1)for(var M=1;M<arguments.length;M++)A[M-1]=arguments[M];s.push(new m(y,A)),s.length===1&&!o&&n(g)};function m(y,A){(this||Yt).fun=y,(this||Yt).array=A}m.prototype.run=function(){(this||Yt).fun.apply(null,(this||Yt).array)},e.title="browser",e.browser=!0,e.env={},e.argv=[],e.version="",e.versions={};function b(){}return e.on=b,e.addListener=b,e.once=b,e.off=b,e.removeListener=b,e.removeAllListeners=b,e.emit=b,e.prependListener=b,e.prependOnceListener=b,e.listeners=function(y){return[]},e.binding=function(y){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(y){throw new Error("process.chdir is not supported")},e.umask=function(){return 0},Cr}var Cr,Si,Yt,Ne,Ps=Qe(()=>{ae(),he(),le(),Cr={},Si=!1,Yt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,Ne=Vh(),Ne.platform="browser",Ne.addListener,Ne.argv,Ne.binding,Ne.browser,Ne.chdir,Ne.cwd,Ne.emit,Ne.env,Ne.listeners,Ne.nextTick,Ne.off,Ne.on,Ne.once,Ne.prependListener,Ne.prependOnceListener,Ne.removeAllListeners,Ne.removeListener,Ne.title,Ne.umask,Ne.version,Ne.versions});function qh(){if(Ai)return Pr;Ai=!0;var e=Ne;function i(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}function t(n,r){for(var s="",o=0,l=-1,f=0,p,g=0;g<=n.length;++g){if(g<n.length)p=n.charCodeAt(g);else{if(p===47)break;p=47}if(p===47){if(!(l===g-1||f===1))if(l!==g-1&&f===2){if(s.length<2||o!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){var m=s.lastIndexOf("/");if(m!==s.length-1){m===-1?(s="",o=0):(s=s.slice(0,m),o=s.length-1-s.lastIndexOf("/")),l=g,f=0;continue}}else if(s.length===2||s.length===1){s="",o=0,l=g,f=0;continue}}r&&(s.length>0?s+="/..":s="..",o=2)}else s.length>0?s+="/"+n.slice(l+1,g):s=n.slice(l+1,g),o=g-l-1;l=g,f=0}else p===46&&f!==-1?++f:f=-1}return s}function a(n,r){var s=r.dir||r.root,o=r.base||(r.name||"")+(r.ext||"");return s?s===r.root?s+o:s+n+o:o}var h={resolve:function(){for(var n="",r=!1,s,o=arguments.length-1;o>=-1&&!r;o--){var l;o>=0?l=arguments[o]:(s===void 0&&(s=e.cwd()),l=s),i(l),l.length!==0&&(n=l+"/"+n,r=l.charCodeAt(0)===47)}return n=t(n,!r),r?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(n){if(i(n),n.length===0)return".";var r=n.charCodeAt(0)===47,s=n.charCodeAt(n.length-1)===47;return n=t(n,!r),n.length===0&&!r&&(n="."),n.length>0&&s&&(n+="/"),r?"/"+n:n},isAbsolute:function(n){return i(n),n.length>0&&n.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var n,r=0;r<arguments.length;++r){var s=arguments[r];i(s),s.length>0&&(n===void 0?n=s:n+="/"+s)}return n===void 0?".":h.normalize(n)},relative:function(n,r){if(i(n),i(r),n===r||(n=h.resolve(n),r=h.resolve(r),n===r))return"";for(var s=1;s<n.length&&n.charCodeAt(s)===47;++s);for(var o=n.length,l=o-s,f=1;f<r.length&&r.charCodeAt(f)===47;++f);for(var p=r.length,g=p-f,m=l<g?l:g,b=-1,y=0;y<=m;++y){if(y===m){if(g>m){if(r.charCodeAt(f+y)===47)return r.slice(f+y+1);if(y===0)return r.slice(f+y)}else l>m&&(n.charCodeAt(s+y)===47?b=y:y===0&&(b=0));break}var A=n.charCodeAt(s+y),M=r.charCodeAt(f+y);if(A!==M)break;A===47&&(b=y)}var k="";for(y=s+b+1;y<=o;++y)(y===o||n.charCodeAt(y)===47)&&(k.length===0?k+="..":k+="/..");return k.length>0?k+r.slice(f+b):(f+=b,r.charCodeAt(f)===47&&++f,r.slice(f))},_makeLong:function(n){return n},dirname:function(n){if(i(n),n.length===0)return".";for(var r=n.charCodeAt(0),s=r===47,o=-1,l=!0,f=n.length-1;f>=1;--f)if(r=n.charCodeAt(f),r===47){if(!l){o=f;break}}else l=!1;return o===-1?s?"/":".":s&&o===1?"//":n.slice(0,o)},basename:function(n,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');i(n);var s=0,o=-1,l=!0,f;if(r!==void 0&&r.length>0&&r.length<=n.length){if(r.length===n.length&&r===n)return"";var p=r.length-1,g=-1;for(f=n.length-1;f>=0;--f){var m=n.charCodeAt(f);if(m===47){if(!l){s=f+1;break}}else g===-1&&(l=!1,g=f+1),p>=0&&(m===r.charCodeAt(p)?--p===-1&&(o=f):(p=-1,o=g))}return s===o?o=g:o===-1&&(o=n.length),n.slice(s,o)}else{for(f=n.length-1;f>=0;--f)if(n.charCodeAt(f)===47){if(!l){s=f+1;break}}else o===-1&&(l=!1,o=f+1);return o===-1?"":n.slice(s,o)}},extname:function(n){i(n);for(var r=-1,s=0,o=-1,l=!0,f=0,p=n.length-1;p>=0;--p){var g=n.charCodeAt(p);if(g===47){if(!l){s=p+1;break}continue}o===-1&&(l=!1,o=p+1),g===46?r===-1?r=p:f!==1&&(f=1):r!==-1&&(f=-1)}return r===-1||o===-1||f===0||f===1&&r===o-1&&r===s+1?"":n.slice(r,o)},format:function(n){if(n===null||typeof n!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof n);return a("/",n)},parse:function(n){i(n);var r={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return r;var s=n.charCodeAt(0),o=s===47,l;o?(r.root="/",l=1):l=0;for(var f=-1,p=0,g=-1,m=!0,b=n.length-1,y=0;b>=l;--b){if(s=n.charCodeAt(b),s===47){if(!m){p=b+1;break}continue}g===-1&&(m=!1,g=b+1),s===46?f===-1?f=b:y!==1&&(y=1):f!==-1&&(y=-1)}return f===-1||g===-1||y===0||y===1&&f===g-1&&f===p+1?g!==-1&&(p===0&&o?r.base=r.name=n.slice(1,g):r.base=r.name=n.slice(p,g)):(p===0&&o?(r.name=n.slice(1,f),r.base=n.slice(1,g)):(r.name=n.slice(p,f),r.base=n.slice(p,g)),r.ext=n.slice(f,g)),p>0?r.dir=n.slice(0,p-1):o&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return h.posix=h,Pr=h,Pr}var Pr,Ai,ki,Hh=Qe(()=>{ae(),he(),le(),Ps(),Pr={},Ai=!1,ki=qh()}),Bs={};xt(Bs,{URL:()=>na,Url:()=>Zs,default:()=>Me,fileURLToPath:()=>Os,format:()=>Xs,parse:()=>ra,pathToFileURL:()=>Rs,resolve:()=>ea,resolveObject:()=>ta});function ot(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function cr(e,i,t){if(e&&ht.isObject(e)&&e instanceof ot)return e;var a=new ot;return a.parse(e,i,t),a}function zh(){if(Pi)return xr;Pi=!0;var e=Fe;function i(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}function t(n,r){for(var s="",o=0,l=-1,f=0,p,g=0;g<=n.length;++g){if(g<n.length)p=n.charCodeAt(g);else{if(p===47)break;p=47}if(p===47){if(!(l===g-1||f===1))if(l!==g-1&&f===2){if(s.length<2||o!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){var m=s.lastIndexOf("/");if(m!==s.length-1){m===-1?(s="",o=0):(s=s.slice(0,m),o=s.length-1-s.lastIndexOf("/")),l=g,f=0;continue}}else if(s.length===2||s.length===1){s="",o=0,l=g,f=0;continue}}r&&(s.length>0?s+="/..":s="..",o=2)}else s.length>0?s+="/"+n.slice(l+1,g):s=n.slice(l+1,g),o=g-l-1;l=g,f=0}else p===46&&f!==-1?++f:f=-1}return s}function a(n,r){var s=r.dir||r.root,o=r.base||(r.name||"")+(r.ext||"");return s?s===r.root?s+o:s+n+o:o}var h={resolve:function(){for(var n="",r=!1,s,o=arguments.length-1;o>=-1&&!r;o--){var l;o>=0?l=arguments[o]:(s===void 0&&(s=e.cwd()),l=s),i(l),l.length!==0&&(n=l+"/"+n,r=l.charCodeAt(0)===47)}return n=t(n,!r),r?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(n){if(i(n),n.length===0)return".";var r=n.charCodeAt(0)===47,s=n.charCodeAt(n.length-1)===47;return n=t(n,!r),n.length===0&&!r&&(n="."),n.length>0&&s&&(n+="/"),r?"/"+n:n},isAbsolute:function(n){return i(n),n.length>0&&n.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var n,r=0;r<arguments.length;++r){var s=arguments[r];i(s),s.length>0&&(n===void 0?n=s:n+="/"+s)}return n===void 0?".":h.normalize(n)},relative:function(n,r){if(i(n),i(r),n===r||(n=h.resolve(n),r=h.resolve(r),n===r))return"";for(var s=1;s<n.length&&n.charCodeAt(s)===47;++s);for(var o=n.length,l=o-s,f=1;f<r.length&&r.charCodeAt(f)===47;++f);for(var p=r.length,g=p-f,m=l<g?l:g,b=-1,y=0;y<=m;++y){if(y===m){if(g>m){if(r.charCodeAt(f+y)===47)return r.slice(f+y+1);if(y===0)return r.slice(f+y)}else l>m&&(n.charCodeAt(s+y)===47?b=y:y===0&&(b=0));break}var A=n.charCodeAt(s+y),M=r.charCodeAt(f+y);if(A!==M)break;A===47&&(b=y)}var k="";for(y=s+b+1;y<=o;++y)(y===o||n.charCodeAt(y)===47)&&(k.length===0?k+="..":k+="/..");return k.length>0?k+r.slice(f+b):(f+=b,r.charCodeAt(f)===47&&++f,r.slice(f))},_makeLong:function(n){return n},dirname:function(n){if(i(n),n.length===0)return".";for(var r=n.charCodeAt(0),s=r===47,o=-1,l=!0,f=n.length-1;f>=1;--f)if(r=n.charCodeAt(f),r===47){if(!l){o=f;break}}else l=!1;return o===-1?s?"/":".":s&&o===1?"//":n.slice(0,o)},basename:function(n,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');i(n);var s=0,o=-1,l=!0,f;if(r!==void 0&&r.length>0&&r.length<=n.length){if(r.length===n.length&&r===n)return"";var p=r.length-1,g=-1;for(f=n.length-1;f>=0;--f){var m=n.charCodeAt(f);if(m===47){if(!l){s=f+1;break}}else g===-1&&(l=!1,g=f+1),p>=0&&(m===r.charCodeAt(p)?--p===-1&&(o=f):(p=-1,o=g))}return s===o?o=g:o===-1&&(o=n.length),n.slice(s,o)}else{for(f=n.length-1;f>=0;--f)if(n.charCodeAt(f)===47){if(!l){s=f+1;break}}else o===-1&&(l=!1,o=f+1);return o===-1?"":n.slice(s,o)}},extname:function(n){i(n);for(var r=-1,s=0,o=-1,l=!0,f=0,p=n.length-1;p>=0;--p){var g=n.charCodeAt(p);if(g===47){if(!l){s=p+1;break}continue}o===-1&&(l=!1,o=p+1),g===46?r===-1?r=p:f!==1&&(f=1):r!==-1&&(f=-1)}return r===-1||o===-1||f===0||f===1&&r===o-1&&r===s+1?"":n.slice(r,o)},format:function(n){if(n===null||typeof n!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof n);return a("/",n)},parse:function(n){i(n);var r={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return r;var s=n.charCodeAt(0),o=s===47,l;o?(r.root="/",l=1):l=0;for(var f=-1,p=0,g=-1,m=!0,b=n.length-1,y=0;b>=l;--b){if(s=n.charCodeAt(b),s===47){if(!m){p=b+1;break}continue}g===-1&&(m=!1,g=b+1),s===46?f===-1?f=b:y!==1&&(y=1):f!==-1&&(y=-1)}return f===-1||g===-1||y===0||y===1&&f===g-1&&f===p+1?g!==-1&&(p===0&&o?r.base=r.name=n.slice(1,g):r.base=r.name=n.slice(p,g)):(p===0&&o?(r.name=n.slice(1,f),r.base=n.slice(1,g)):(r.name=n.slice(p,f),r.base=n.slice(p,g)),r.ext=n.slice(f,g)),p>0?r.dir=n.slice(0,p-1):o&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return h.posix=h,xr=h,xr}function Kh(e){if(typeof e=="string")e=new URL(e);else if(!(e instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(e.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return Mr?Yh(e):Qh(e)}function Yh(e){let i=e.hostname,t=e.pathname;for(let a=0;a<t.length;a++)if(t[a]==="%"){let h=t.codePointAt(a+2)||32;if(t[a+1]==="2"&&h===102||t[a+1]==="5"&&h===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(t=t.replace(Hs,"\\"),t=decodeURIComponent(t),i!=="")return`\\\\${i}${t}`;{let a=t.codePointAt(1)|32,h=t[2];if(a<Vs||a>qs||h!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return t.slice(1)}}function Qh(e){if(e.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let i=e.pathname;for(let t=0;t<i.length;t++)if(i[t]==="%"){let a=i.codePointAt(t+2)||32;if(i[t+1]==="2"&&a===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(i)}function Gh(e){let i=Bi.resolve(e),t=e.charCodeAt(e.length-1);(t===$s||Mr&&t===Ws)&&i[i.length-1]!==Bi.sep&&(i+="/");let a=new URL("file://");return i.includes("%")&&(i=i.replace(zs,"%25")),!Mr&&i.includes("\\")&&(i=i.replace(Ks,"%5C")),i.includes(`
|
|
4
|
-
`)&&(i=i.replace(
|
|
5
|
-
`)&&(i=i.replace(
|
|
6
|
-
`," "]),Br=["'"].concat(Ns),Ii=["%","/","?",";","#"].concat(Br),Ti=["/","?","#"],Ci=/^[+a-z0-9A-Z_-]{0,63}$/,js=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Ds={javascript:!0,"javascript:":!0},Or={javascript:!0,"javascript:":!0},Qt={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Rr=ft,ot.prototype.parse=function(e,i,t){if(!ht.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var a=e.indexOf("?"),h=a!==-1&&a<e.indexOf("#")?"?":"#",n=e.split(h);n[0]=n[0].replace(/\\/g,"/");var r=e=n.join(h);if(r=r.trim(),!t&&e.split("#").length===1){var s=Us.exec(r);if(s)return this.path=r,this.href=r,this.pathname=s[1],s[2]?(this.search=s[2],this.query=i?Rr.parse(this.search.substr(1)):this.search.substr(1)):i&&(this.search="",this.query={}),this}var o=Ms.exec(r);if(o){var l=(o=o[0]).toLowerCase();this.protocol=l,r=r.substr(o.length)}if(t||o||r.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=r.substr(0,2)==="//";!f||o&&Or[o]||(r=r.substr(2),this.slashes=!0)}if(!Or[o]&&(f||o&&!Qt[o])){for(var p,g,m=-1,b=0;b<Ti.length;b++)(y=r.indexOf(Ti[b]))!==-1&&(m===-1||y<m)&&(m=y);for((g=m===-1?r.lastIndexOf("@"):r.lastIndexOf("@",m))!==-1&&(p=r.slice(0,g),r=r.slice(g+1),this.auth=decodeURIComponent(p)),m=-1,b=0;b<Ii.length;b++){var y;(y=r.indexOf(Ii[b]))!==-1&&(m===-1||y<m)&&(m=y)}m===-1&&(m=r.length),this.host=r.slice(0,m),r=r.slice(m),this.parseHost(),this.hostname=this.hostname||"";var A=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!A)for(var M=this.hostname.split(/\./),k=(b=0,M.length);b<k;b++){var v=M[b];if(v&&!v.match(Ci)){for(var U="",j=0,C=v.length;j<C;j++)v.charCodeAt(j)>127?U+="x":U+=v[j];if(!U.match(Ci)){var T=M.slice(0,b),x=M.slice(b+1),V=v.match(js);V&&(T.push(V[1]),x.unshift(V[2])),x.length&&(r="/"+x.join(".")+r),this.hostname=T.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),A||(this.hostname=xs.toASCII(this.hostname));var J=this.port?":"+this.port:"",ne=this.hostname||"";this.host=ne+J,this.href+=this.host,A&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),r[0]!=="/"&&(r="/"+r))}if(!Ds[l])for(b=0,k=Br.length;b<k;b++){var S=Br[b];if(r.indexOf(S)!==-1){var z=encodeURIComponent(S);z===S&&(z=escape(S)),r=r.split(S).join(z)}}var re=r.indexOf("#");re!==-1&&(this.hash=r.substr(re),r=r.slice(0,re));var Q=r.indexOf("?");if(Q!==-1?(this.search=r.substr(Q),this.query=r.substr(Q+1),i&&(this.query=Rr.parse(this.query)),r=r.slice(0,Q)):i&&(this.search="",this.query={}),r&&(this.pathname=r),Qt[l]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){J=this.pathname||"";var me=this.search||"";this.path=J+me}return this.href=this.format(),this},ot.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var i=this.protocol||"",t=this.pathname||"",a=this.hash||"",h=!1,n="";this.host?h=e+this.host:this.hostname&&(h=e+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(h+=":"+this.port)),this.query&&ht.isObject(this.query)&&Object.keys(this.query).length&&(n=Rr.stringify(this.query));var r=this.search||n&&"?"+n||"";return i&&i.substr(-1)!==":"&&(i+=":"),this.slashes||(!i||Qt[i])&&h!==!1?(h="//"+(h||""),t&&t.charAt(0)!=="/"&&(t="/"+t)):h||(h=""),a&&a.charAt(0)!=="#"&&(a="#"+a),r&&r.charAt(0)!=="?"&&(r="?"+r),i+h+(t=t.replace(/[?#]/g,function(s){return encodeURIComponent(s)}))+(r=r.replace("#","%23"))+a},ot.prototype.resolve=function(e){return this.resolveObject(cr(e,!1,!0)).format()},ot.prototype.resolveObject=function(e){if(ht.isString(e)){var i=new ot;i.parse(e,!1,!0),e=i}for(var t=new ot,a=Object.keys(this),h=0;h<a.length;h++){var n=a[h];t[n]=this[n]}if(t.hash=e.hash,e.href==="")return t.href=t.format(),t;if(e.slashes&&!e.protocol){for(var r=Object.keys(e),s=0;s<r.length;s++){var o=r[s];o!=="protocol"&&(t[o]=e[o])}return Qt[t.protocol]&&t.hostname&&!t.pathname&&(t.path=t.pathname="/"),t.href=t.format(),t}if(e.protocol&&e.protocol!==t.protocol){if(!Qt[e.protocol]){for(var l=Object.keys(e),f=0;f<l.length;f++){var p=l[f];t[p]=e[p]}return t.href=t.format(),t}if(t.protocol=e.protocol,e.host||Or[e.protocol])t.pathname=e.pathname;else{for(var g=(e.pathname||"").split("/");g.length&&!(e.host=g.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),g[0]!==""&&g.unshift(""),g.length<2&&g.unshift(""),t.pathname=g.join("/")}if(t.search=e.search,t.query=e.query,t.host=e.host||"",t.auth=e.auth,t.hostname=e.hostname||e.host,t.port=e.port,t.pathname||t.search){var m=t.pathname||"",b=t.search||"";t.path=m+b}return t.slashes=t.slashes||e.slashes,t.href=t.format(),t}var y=t.pathname&&t.pathname.charAt(0)==="/",A=e.host||e.pathname&&e.pathname.charAt(0)==="/",M=A||y||t.host&&e.pathname,k=M,v=t.pathname&&t.pathname.split("/")||[],U=(g=e.pathname&&e.pathname.split("/")||[],t.protocol&&!Qt[t.protocol]);if(U&&(t.hostname="",t.port=null,t.host&&(v[0]===""?v[0]=t.host:v.unshift(t.host)),t.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(g[0]===""?g[0]=e.host:g.unshift(e.host)),e.host=null),M=M&&(g[0]===""||v[0]==="")),A)t.host=e.host||e.host===""?e.host:t.host,t.hostname=e.hostname||e.hostname===""?e.hostname:t.hostname,t.search=e.search,t.query=e.query,v=g;else if(g.length)v||(v=[]),v.pop(),v=v.concat(g),t.search=e.search,t.query=e.query;else if(!ht.isNullOrUndefined(e.search))return U&&(t.hostname=t.host=v.shift(),(V=!!(t.host&&t.host.indexOf("@")>0)&&t.host.split("@"))&&(t.auth=V.shift(),t.host=t.hostname=V.shift())),t.search=e.search,t.query=e.query,ht.isNull(t.pathname)&&ht.isNull(t.search)||(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.href=t.format(),t;if(!v.length)return t.pathname=null,t.search?t.path="/"+t.search:t.path=null,t.href=t.format(),t;for(var j=v.slice(-1)[0],C=(t.host||e.host||v.length>1)&&(j==="."||j==="..")||j==="",T=0,x=v.length;x>=0;x--)(j=v[x])==="."?v.splice(x,1):j===".."?(v.splice(x,1),T++):T&&(v.splice(x,1),T--);if(!M&&!k)for(;T--;T)v.unshift("..");!M||v[0]===""||v[0]&&v[0].charAt(0)==="/"||v.unshift(""),C&&v.join("/").substr(-1)!=="/"&&v.push("");var V,J=v[0]===""||v[0]&&v[0].charAt(0)==="/";return U&&(t.hostname=t.host=J?"":v.length?v.shift():"",(V=!!(t.host&&t.host.indexOf("@")>0)&&t.host.split("@"))&&(t.auth=V.shift(),t.host=t.hostname=V.shift())),(M=M||t.host&&v.length)&&!J&&v.unshift(""),v.length?t.pathname=v.join("/"):(t.pathname=null,t.path=null),ht.isNull(t.pathname)&&ht.isNull(t.search)||(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.auth=e.auth||t.auth,t.slashes=t.slashes||e.slashes,t.href=t.format(),t},ot.prototype.parseHost=function(){var e=this.host,i=Ls.exec(e);i&&((i=i[0])!==":"&&(this.port=i.substr(1)),e=e.substr(0,e.length-i.length)),e&&(this.hostname=e)},Me.Url,Me.format,Me.resolve,Me.resolveObject,xr={},Pi=!1,Bi=zh(),Fs=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0,Me.URL=typeof URL<"u"?URL:null,Me.pathToFileURL=Gh,Me.fileURLToPath=Kh,Me.Url,Me.format,Me.resolve,Me.resolveObject,Me.URL,Ws=92,$s=47,Vs=97,qs=122,Mr=Fs==="win32",Hs=/\//g,zs=/%/g,Ks=/\\/g,Ys=/\n/g,Qs=/\r/g,Gs=/\t/g,Js=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0,Me.URL=typeof URL<"u"?URL:null,Me.pathToFileURL=Rs,Me.fileURLToPath=Os,Zs=Me.Url,Xs=Me.format,ea=Me.resolve,ta=Me.resolveObject,ra=Me.parse,na=Me.URL,ia=92,oa=47,sa=97,aa=122,Lr=Js==="win32",la=/\//g,ha=/%/g,ua=/\\/g,ca=/\n/g,fa=/\r/g,da=/\t/g}),eu=be((e,i)=>{ae(),he(),le(),i.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}}),Oi=be(e=>{ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0}),e.BufferedDuplex=e.writev=void 0;var i=Vt(),t=(Je(),Le(Ge));function a(n,r){let s=new Array(n.length);for(let o=0;o<n.length;o++)typeof n[o].chunk=="string"?s[o]=t.Buffer.from(n[o].chunk,"utf8"):s[o]=n[o].chunk;this._write(t.Buffer.concat(s),"binary",r)}e.writev=a;var h=class extends i.Duplex{constructor(n,r,s){super({objectMode:!0}),this.proxy=r,this.socket=s,this.writeQueue=[],n.objectMode||(this._writev=a.bind(this)),this.isSocketOpen=!1,this.proxy.on("data",o=>{this.destroyed||this.push(o)})}_read(n){this.proxy.read(n)}_write(n,r,s){this.isSocketOpen?this.writeToProxy(n,r,s):this.writeQueue.push({chunk:n,encoding:r,cb:s})}_final(n){this.writeQueue=[],this.proxy.end(n)}_destroy(n,r){this.writeQueue=[],this.proxy.destroy(),r(n)}socketReady(){this.emit("connect"),this.isSocketOpen=!0,this.processWriteQueue()}writeToProxy(n,r,s){this.proxy.write(n,r)===!1?this.proxy.once("drain",s):s()}processWriteQueue(){for(;this.writeQueue.length>0;){let{chunk:n,encoding:r,cb:s}=this.writeQueue.shift();this.writeToProxy(n,r,s)}}};e.BufferedDuplex=h}),Ur=be(e=>{ae(),he(),le();var i=e&&e.__importDefault||function(M){return M&&M.__esModule?M:{default:M}};Object.defineProperty(e,"__esModule",{value:!0}),e.streamBuilder=e.browserStreamBuilder=void 0;var t=(Je(),Le(Ge)),a=i(eu()),h=i(Et()),n=Vt(),r=i(Ir()),s=Oi(),o=(0,h.default)("mqttjs:ws"),l=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function f(M,k){let v=`${M.protocol}://${M.hostname}:${M.port}${M.path}`;return typeof M.transformWsUrl=="function"&&(v=M.transformWsUrl(v,M,k)),v}function p(M){let k=M;return M.port||(M.protocol==="wss"?k.port=443:k.port=80),M.path||(k.path="/"),M.wsOptions||(k.wsOptions={}),!r.default&&!M.forceNativeWebSocket&&M.protocol==="wss"&&l.forEach(v=>{Object.prototype.hasOwnProperty.call(M,v)&&!Object.prototype.hasOwnProperty.call(M.wsOptions,v)&&(k.wsOptions[v]=M[v])}),k}function g(M){let k=p(M);if(k.hostname||(k.hostname=k.host),!k.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");let v=new URL(document.URL);k.hostname=v.hostname,k.port||(k.port=Number(v.port))}return k.objectMode===void 0&&(k.objectMode=!(k.binary===!0||k.binary===void 0)),k}function m(M,k,v){o("createWebSocket"),o(`protocol: ${v.protocolId} ${v.protocolVersion}`);let U=v.protocolId==="MQIsdp"&&v.protocolVersion===3?"mqttv3.1":"mqtt";o(`creating new Websocket for url: ${k} and protocol: ${U}`);let j;return v.createWebsocket?j=v.createWebsocket(k,[U],v):j=new a.default(k,[U],v.wsOptions),j}function b(M,k){let v=k.protocolId==="MQIsdp"&&k.protocolVersion===3?"mqttv3.1":"mqtt",U=f(k,M),j;return k.createWebsocket?j=k.createWebsocket(U,[v],k):j=new WebSocket(U,[v]),j.binaryType="arraybuffer",j}var y=(M,k)=>{o("streamBuilder");let v=p(k);v.hostname=v.hostname||v.host||"localhost";let U=f(v,M),j=m(M,U,v),C=a.default.createWebSocketStream(j,v.wsOptions);return C.url=U,j.on("close",()=>{C.destroy()}),C};e.streamBuilder=y;var A=(M,k)=>{o("browserStreamBuilder");let v,U=g(k).browserBufferSize||1024*512,j=k.browserBufferTimeout||1e3,C=!k.objectMode,T=b(M,k),x=J(k,Q,me);k.objectMode||(x._writev=s.writev.bind(x)),x.on("close",()=>{T.close()});let V=typeof T.addEventListener<"u";T.readyState===T.OPEN?(v=x,v.socket=T):(v=new s.BufferedDuplex(k,x,T),V?T.addEventListener("open",ne):T.onopen=ne),V?(T.addEventListener("close",S),T.addEventListener("error",z),T.addEventListener("message",re)):(T.onclose=S,T.onerror=z,T.onmessage=re);function J(se,H,ye){let oe=new n.Transform({objectMode:se.objectMode});return oe._write=H,oe._flush=ye,oe}function ne(){o("WebSocket onOpen"),v instanceof s.BufferedDuplex&&v.socketReady()}function S(se){o("WebSocket onClose",se),v.end(),v.destroy()}function z(se){o("WebSocket onError",se);let H=new Error("WebSocket error");H.event=se,v.destroy(H)}async function re(se){let{data:H}=se;H instanceof ArrayBuffer?H=t.Buffer.from(H):H instanceof Blob?H=t.Buffer.from(await new Response(H).arrayBuffer()):H=t.Buffer.from(H,"utf8"),x&&!x.destroyed&&x.push(H)}function Q(se,H,ye){if(T.bufferedAmount>U){setTimeout(Q,j,se,H,ye);return}C&&typeof se=="string"&&(se=t.Buffer.from(se,"utf8"));try{T.send(se)}catch(oe){return ye(oe)}ye()}function me(se){T.close(),se()}return v};e.browserStreamBuilder=A}),Ri={};xt(Ri,{Server:()=>je,Socket:()=>je,Stream:()=>je,_createServerHandle:()=>je,_normalizeArgs:()=>je,_setSimultaneousAccepts:()=>je,connect:()=>je,createConnection:()=>je,createServer:()=>je,default:()=>pa,isIP:()=>je,isIPv4:()=>je,isIPv6:()=>je});function je(){throw new Error("Node.js net module is not supported by JSPM core outside of Node.js")}var pa,ga=Qe(()=>{ae(),he(),le(),pa={_createServerHandle:je,_normalizeArgs:je,_setSimultaneousAccepts:je,connect:je,createConnection:je,createServer:je,isIP:je,isIPv4:je,isIPv6:je,Server:je,Socket:je,Stream:je}}),ma=be(e=>{ae(),he(),le();var i=e&&e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(e,"__esModule",{value:!0});var t=i((ga(),Le(Ri))),a=i(Et()),h=(0,a.default)("mqttjs:tcp"),n=(r,s)=>{s.port=s.port||1883,s.hostname=s.hostname||s.host||"localhost";let{port:o,path:l}=s,f=s.hostname;return h("port %d and host %s",o,f),t.default.createConnection({port:o,host:f,path:l})};e.default=n}),ba={};xt(ba,{default:()=>ya});var ya,tu=Qe(()=>{ae(),he(),le(),ya={}}),wa=be(e=>{ae(),he(),le();var i=e&&e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0});var t=i((tu(),Le(ba))),a=i((ga(),Le(Ri))),h=i(Et()),n=(0,h.default)("mqttjs:tls"),r=(s,o)=>{o.port=o.port||8883,o.host=o.hostname||o.host||"localhost",a.default.isIP(o.host)===0&&(o.servername=o.host),o.rejectUnauthorized=o.rejectUnauthorized!==!1,delete o.path,n("port %d host %s rejectUnauthorized %b",o.port,o.host,o.rejectUnauthorized);let l=t.default.connect(o);l.on("secureConnect",()=>{o.rejectUnauthorized&&!l.authorized?l.emit("error",new Error("TLS not authorized")):l.removeListener("error",f)});function f(p){o.rejectUnauthorized&&s.emit("error",p),l.end()}return l.on("error",f),l};e.default=r}),_a=be(e=>{ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0});var i=(Je(),Le(Ge)),t=Vt(),a=Oi(),h,n,r;function s(){let g=new t.Transform;return g._write=(m,b,y)=>{h.send({data:m.buffer,success(){y()},fail(A){y(new Error(A))}})},g._flush=m=>{h.close({success(){m()}})},g}function o(g){g.hostname||(g.hostname="localhost"),g.path||(g.path="/"),g.wsOptions||(g.wsOptions={})}function l(g,m){let b=g.protocol==="wxs"?"wss":"ws",y=`${b}://${g.hostname}${g.path}`;return g.port&&g.port!==80&&g.port!==443&&(y=`${b}://${g.hostname}:${g.port}${g.path}`),typeof g.transformWsUrl=="function"&&(y=g.transformWsUrl(y,g,m)),y}function f(){h.onOpen(()=>{r.socketReady()}),h.onMessage(g=>{let{data:m}=g;m instanceof ArrayBuffer?m=i.Buffer.from(m):m=i.Buffer.from(m,"utf8"),n.push(m)}),h.onClose(()=>{r.emit("close"),r.end(),r.destroy()}),h.onError(g=>{let m=new Error(g.errMsg);r.destroy(m)})}var p=(g,m)=>{if(m.hostname=m.hostname||m.host,!m.hostname)throw new Error("Could not determine host. Specify host manually.");let b=m.protocolId==="MQIsdp"&&m.protocolVersion===3?"mqttv3.1":"mqtt";o(m);let y=l(m,g);h=wx.connectSocket({url:y,protocols:[b]}),n=s(),r=new a.BufferedDuplex(m,n,h),r._destroy=(M,k)=>{h.close({success(){k&&k(M)}})};let A=r.destroy;return r.destroy=(M,k)=>(r.destroy=A,setTimeout(()=>{h.close({fail(){r._destroy(M,k)}})},0),r),f(),r};e.default=p}),va=be(e=>{ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0});var i=(Je(),Le(Ge)),t=Vt(),a=Oi(),h,n,r,s=!1;function o(){let m=new t.Transform;return m._write=(b,y,A)=>{h.sendSocketMessage({data:b.buffer,success(){A()},fail(){A(new Error)}})},m._flush=b=>{h.closeSocket({success(){b()}})},m}function l(m){m.hostname||(m.hostname="localhost"),m.path||(m.path="/"),m.wsOptions||(m.wsOptions={})}function f(m,b){let y=m.protocol==="alis"?"wss":"ws",A=`${y}://${m.hostname}${m.path}`;return m.port&&m.port!==80&&m.port!==443&&(A=`${y}://${m.hostname}:${m.port}${m.path}`),typeof m.transformWsUrl=="function"&&(A=m.transformWsUrl(A,m,b)),A}function p(){s||(s=!0,h.onSocketOpen(()=>{r.socketReady()}),h.onSocketMessage(m=>{if(typeof m.data=="string"){let b=i.Buffer.from(m.data,"base64");n.push(b)}else{let b=new FileReader;b.addEventListener("load",()=>{let y=b.result;y instanceof ArrayBuffer?y=i.Buffer.from(y):y=i.Buffer.from(y,"utf8"),n.push(y)}),b.readAsArrayBuffer(m.data)}}),h.onSocketClose(()=>{r.end(),r.destroy()}),h.onSocketError(m=>{r.destroy(m)}))}var g=(m,b)=>{if(b.hostname=b.hostname||b.host,!b.hostname)throw new Error("Could not determine host. Specify host manually.");let y=b.protocolId==="MQIsdp"&&b.protocolVersion===3?"mqttv3.1":"mqtt";l(b);let A=f(b,m);return h=b.my,h.connectSocket({url:A,protocols:y}),n=o(),r=new a.BufferedDuplex(b,n,h),p(),r};e.default=g}),ru=be(e=>{ae(),he(),le();var i=e&&e.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(e,"__esModule",{value:!0}),e.connectAsync=void 0;var t=i(Et()),a=i((Xh(),Le(Bs))),h=i(mi()),n=i(Ir());typeof(Re==null?void 0:Re.nextTick)!="function"&&(Re.nextTick=setImmediate);var r=(0,t.default)("mqttjs"),s=null;function o(p){let g;p.auth&&(g=p.auth.match(/^(.+):(.+)$/),g?(p.username=g[1],p.password=g[2]):p.username=p.auth)}function l(p,g){var m,b,y,A;if(r("connecting to an MQTT broker..."),typeof p=="object"&&!g&&(g=p,p=""),g=g||{},p&&typeof p=="string"){let v=a.default.parse(p,!0),U={};if(v.port!=null&&(U.port=Number(v.port)),U.host=v.hostname,U.query=v.query,U.auth=v.auth,U.protocol=v.protocol,U.path=v.path,U.protocol=(m=U.protocol)===null||m===void 0?void 0:m.replace(/:$/,""),g=Object.assign(Object.assign({},U),g),!g.protocol)throw new Error("Missing protocol")}if(g.unixSocket=g.unixSocket||((b=g.protocol)===null||b===void 0?void 0:b.includes("+unix")),g.unixSocket?g.protocol=g.protocol.replace("+unix",""):!(!((y=g.protocol)===null||y===void 0)&&y.startsWith("ws"))&&!(!((A=g.protocol)===null||A===void 0)&&A.startsWith("wx"))&&delete g.path,o(g),g.query&&typeof g.query.clientId=="string"&&(g.clientId=g.query.clientId),g.cert&&g.key)if(g.protocol){if(["mqtts","wss","wxs","alis"].indexOf(g.protocol)===-1)switch(g.protocol){case"mqtt":g.protocol="mqtts";break;case"ws":g.protocol="wss";break;case"wx":g.protocol="wxs";break;case"ali":g.protocol="alis";break;default:throw new Error(`Unknown protocol for secure connection: "${g.protocol}"!`)}}else throw new Error("Missing secure protocol key");if(s||(s={},!n.default&&!g.forceNativeWebSocket?(s.ws=Ur().streamBuilder,s.wss=Ur().streamBuilder,s.mqtt=ma().default,s.tcp=ma().default,s.ssl=wa().default,s.tls=s.ssl,s.mqtts=wa().default):(s.ws=Ur().browserStreamBuilder,s.wss=Ur().browserStreamBuilder,s.wx=_a().default,s.wxs=_a().default,s.ali=va().default,s.alis=va().default)),!s[g.protocol]){let v=["mqtts","wss"].indexOf(g.protocol)!==-1;g.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((U,j)=>v&&j%2===0?!1:typeof s[U]=="function")[0]}if(g.clean===!1&&!g.clientId)throw new Error("Missing clientId for unclean clients");g.protocol&&(g.defaultProtocol=g.protocol);function M(v){return g.servers&&((!v._reconnectCount||v._reconnectCount===g.servers.length)&&(v._reconnectCount=0),g.host=g.servers[v._reconnectCount].host,g.port=g.servers[v._reconnectCount].port,g.protocol=g.servers[v._reconnectCount].protocol?g.servers[v._reconnectCount].protocol:g.defaultProtocol,g.hostname=g.host,v._reconnectCount++),r("calling streambuilder for",g.protocol),s[g.protocol](v,g)}let k=new h.default(M,g);return k.on("error",()=>{}),k}function f(p,g,m=!0){return new Promise((b,y)=>{let A=l(p,g),M={connect:v=>{k(),b(A)},end:()=>{k(),b(A)},error:v=>{k(),A.end(),y(v)}};m===!1&&(M.close=()=>{M.error(new Error("Couldn't connect to server"))});function k(){Object.keys(M).forEach(v=>{A.off(v,M[v])})}Object.keys(M).forEach(v=>{A.on(v,M[v])})})}e.connectAsync=f,e.default=l}),Ea=be(e=>{ae(),he(),le();var i=e&&e.__createBinding||(Object.create?function(m,b,y,A){A===void 0&&(A=y);var M=Object.getOwnPropertyDescriptor(b,y);(!M||("get"in M?!b.__esModule:M.writable||M.configurable))&&(M={enumerable:!0,get:function(){return b[y]}}),Object.defineProperty(m,A,M)}:function(m,b,y,A){A===void 0&&(A=y),m[A]=b[y]}),t=e&&e.__setModuleDefault||(Object.create?function(m,b){Object.defineProperty(m,"default",{enumerable:!0,value:b})}:function(m,b){m.default=b}),a=e&&e.__importStar||function(m){if(m&&m.__esModule)return m;var b={};if(m!=null)for(var y in m)y!=="default"&&Object.prototype.hasOwnProperty.call(m,y)&&i(b,m,y);return t(b,m),b},h=e&&e.__exportStar||function(m,b){for(var y in m)y!=="default"&&!Object.prototype.hasOwnProperty.call(b,y)&&i(b,m,y)},n=e&&e.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};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 r=n(mi());e.MqttClient=r.default;var s=n(ls());e.DefaultMessageIdProvider=s.default;var o=n(Nh());e.UniqueMessageIdProvider=o.default;var l=n(hs());e.Store=l.default;var f=a(ru());e.connect=f.default,Object.defineProperty(e,"connectAsync",{enumerable:!0,get:function(){return f.connectAsync}});var p=n(ms());e.KeepaliveManager=p.default,e.Client=r.default,h(mi(),e),h(rr(),e);var g=kr();Object.defineProperty(e,"ReasonCodes",{enumerable:!0,get:function(){return g.ReasonCodes}})}),nu=be(e=>{ae(),he(),le();var i=e&&e.__createBinding||(Object.create?function(r,s,o,l){l===void 0&&(l=o);var f=Object.getOwnPropertyDescriptor(s,o);(!f||("get"in f?!s.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(r,l,f)}:function(r,s,o,l){l===void 0&&(l=o),r[l]=s[o]}),t=e&&e.__setModuleDefault||(Object.create?function(r,s){Object.defineProperty(r,"default",{enumerable:!0,value:s})}:function(r,s){r.default=s}),a=e&&e.__importStar||function(r){if(r&&r.__esModule)return r;var s={};if(r!=null)for(var o in r)o!=="default"&&Object.prototype.hasOwnProperty.call(r,o)&&i(s,r,o);return t(s,r),s},h=e&&e.__exportStar||function(r,s){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&i(s,r,o)};Object.defineProperty(e,"__esModule",{value:!0});var n=a(Ea());e.default=n,h(Ea(),e)});const iu=nu();/*! Bundled license information:
|
|
1
|
+
(function(Ee,R){typeof exports=="object"&&typeof module<"u"?R(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],R):(Ee=typeof globalThis<"u"?globalThis:Ee||self,R(Ee["@stonecrop/beam"]={},Ee.Vue))})(this,function(Ee,R){"use strict";var wc=Object.defineProperty;var Ba=Ee=>{throw TypeError(Ee)};var _c=(Ee,R,$e)=>R in Ee?wc(Ee,R,{enumerable:!0,configurable:!0,writable:!0,value:$e}):Ee[R]=$e;var We=(Ee,R,$e)=>_c(Ee,typeof R!="symbol"?R+"":R,$e),xi=(Ee,R,$e)=>R.has(Ee)||Ba("Cannot "+$e);var O=(Ee,R,$e)=>(xi(Ee,R,"read from private field"),$e?$e.call(Ee):R.get(Ee)),Oe=(Ee,R,$e)=>R.has(Ee)?Ba("Cannot add the same private member more than once"):R instanceof WeakSet?R.add(Ee):R.set(Ee,$e),ke=(Ee,R,$e,Jt)=>(xi(Ee,R,"write to private field"),Jt?Jt.call(Ee,$e):R.set(Ee,$e),$e),Se=(Ee,R,$e)=>(xi(Ee,R,"access private method"),$e);var Ur=(Ee,R,$e,Jt)=>({set _(Fr){ke(Ee,R,Fr,$e)},get _(){return O(Ee,R,Jt)}});var $e=document.createElement("style");$e.textContent=`@import"https://fonts.googleapis.com/css2?family=Arimo:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap";.beam_metadata_arrow[data-v-94fbdac5]{align-self:center;flex-grow:1;position:relative;display:flex;align-items:center}.beam_metadata_arrow-body[data-v-94fbdac5]{width:100%;height:10px;background:#c4c4c4}.beam_metadata_arrow-head svg[data-v-94fbdac5]{width:20px;display:block}.beam_filters[data-v-7112a526]{overflow:hidden;box-sizing:border-box;transition:all .2s ease-in-out;border-bottom:1px solid var(--row-border-color);background:#fff}.beam_filters-heading[data-v-7112a526]{background:var(--primary-color);cursor:pointer;display:flex;align-items:center;padding-left:1rem;box-sizing:border-box;font-size:1rem;padding:0 2rem}.beam_filters-heading>h1[data-v-7112a526]{font-size:1rem}.beam_filters-options[data-v-7112a526]{background:#fff;margin:1rem 1rem 2rem;box-sizing:border-box;padding:0 2rem}.beam_filter-option[data-v-af0d9c81]{cursor:pointer;position:relative;margin-bottom:1rem}.beam_filter-option-heading[data-v-af0d9c81]{font-size:1rem;padding-bottom:.25rem}.beam_filter-option-select[data-v-af0d9c81]{position:relative;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:1px solid var(--row-border-color);font-weight:700;color:var(--primary-text-color);font-size:.8rem;font-family:var(--font-family);display:flex;align-items:stretch}label[data-v-af0d9c81]{cursor:pointer;padding:.5rem}.beam_filter-arrow[data-v-af0d9c81]{background:var(--primary-color);color:var(--primary-text-color);cursor:pointer;display:flex;align-items:center;width:5px;padding:.5rem .7rem}.beam_filter-label[data-v-af0d9c81]{display:flex;align-items:center}svg[data-v-af0d9c81]{fill:var(--primary-text-color);width:5px;transform:rotate(90deg)}.beam_filter-select-menu[data-v-af0d9c81]{z-index:100;border-top:none;left:0;border:1px solid var(--row-border-color);padding:0rem;list-style:none;width:100%;box-sizing:border-box;max-height:200px;overflow-y:scroll;margin:0}.beam_filter-select-option[data-v-af0d9c81]{font-size:.8rem;font-family:var(--font-family);font-weight:700;color:var(--primary-text-color);border-bottom:1px solid var(--row-border-color);padding:.5rem}.beam_filter-select-option[data-v-af0d9c81]:hover{background:var(--primary-color)}.selected[data-v-af0d9c81],.selected[data-v-af0d9c81]:hover{background:var(--row-border-color)}.fixed-top[data-v-a38a41d0]{position:sticky;top:0;left:0}.container[data-v-f44a510e]{display:block;position:relative;padding-left:2.5ch;margin:0;margin-top:.5rem;cursor:pointer;font-size:2rem;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.container input[data-v-f44a510e]{position:absolute;opacity:0;cursor:pointer;height:0;width:0}.checkmark[data-v-f44a510e]{position:absolute;top:0;left:0;height:2rem;width:2rem;background-color:#eee;outline:2px solid transparent;border:1px solid var(--highlight)}.container:hover input~.checkmark[data-v-f44a510e]{background-color:#fff}.container input:checked~.checkmark[data-v-f44a510e]{background-color:var(--brand-secondary)}.checkmark[data-v-f44a510e]:after{content:"";position:absolute;display:none}.container input:checked~.checkmark[data-v-f44a510e]:after{display:block}.container .checkmark[data-v-f44a510e]:after{left:25%;top:50%;width:.5rem;height:1rem;border:solid var(--text-color);border-width:0 3px 3px 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg) translate(-50%,-50%)}.two-column[data-v-c65440c0]{display:flex;flex-direction:row;justify-content:space-between;align-items:baseline;gap:1rem}@media screen and (max-width: 400px){.two-column[data-v-c65440c0]{flex-direction:column;gap:0}}.column[data-v-c65440c0]{flex-grow:1;width:50%}@media screen and (max-width: 400px){.column[data-v-c65440c0]{width:100%}}.column-right[data-v-c65440c0]{text-align:right}@media screen and (max-width: 400px){.column-right[data-v-c65440c0]{text-align:left}}svg[data-v-fb512459]{width:100%;overflow:visible;fill:var(--primary-text-color)}.arrow-icon[data-v-fb512459]{width:.4rem;transform:rotate(0);transform-origin:center;position:relative;transition:all .1s ease-in-out;margin:.5rem;cursor:pointer;display:flex;align-items:center}.open[data-v-fb512459]{transform:rotate(90deg)}:root{--sc-primary-color: #f2f2f2;--sc-primary-text-color: #666666;--sc-alert: #e63c28;--sc-success: #155724;--sc-font-family: Arimo, Arial, sans-serif;--sc-row-border-color: #ccc;--sc-btn-color: white;--sc-btn-border: #ccc;--sc-btn-label-color: black;--sc-list-margin: 0rem .625rem}body{font-family:var(--sc-font-family);background-color:#fff;margin:0;padding:0;display:flex;flex-direction:column;flex:1 0 auto;height:100%;box-sizing:border-box}.beam_header{border:1px solid transparent;text-align:left;font-size:1.125rem;color:var(--sc-primary-text-color);margin:0;padding:0}.beam_copy{color:var(--sc-primary-text-color);font-size:1rem;line-height:1.5rem}.beam--bold{font-weight:700}.beam--normal{font-weight:400}.beam--alert{color:var(--sc-alert)}.beam--success{color:var(--sc-success)}.beam_navbar{padding:.625rem;background-color:var(--sc-primary-color);margin-left:0;min-height:2em;max-height:2em;color:var(--sc-primary-text-color);display:flex;flex-flow:row nowrap;align-content:center;justify-content:space-between;align-items:center;position:sticky;top:0;border-bottom:1px solid var(--sc-row-border-color)}.beam_navbar h1{margin-left:.625rem}.beam_list-view{list-style-type:none;margin:var(--sc-list-margin);padding:0 0 2.5em;margin-top:1px}.beam_list-item{padding:.625rem;border-bottom:1px solid var(--sc-row-border-color);max-width:100%;box-sizing:border-box;display:flex;flex-flow:row nowrap;justify-content:space-between;gap:1.25rem;cursor:pointer;outline:2px solid transparent;outline-offset:-1px}.beam_list-item:focus{outline:2px solid var(--sc-focus-cell-outline);background-color:var(--sc-focus-cell-background)}.beam_list-text{width:80%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;flex-grow:1;font-size:.875rem;color:var(--sc-primary-text-color)}.beam_list-text label,.beam_list-text p{overflow:hidden;text-overflow:ellipsis;width:100%;display:block}.beam_list-item label{display:block}.beam_list-item p{margin:0}.beam_list-anchor{text-decoration:none;outline:none;color:var(--sc-primary-text-color)}.beam_item-count{font-size:1.3125rem;color:var(--sc-primary-text-color)}.beam_item-count span{margin:0;padding:0;outline:none}.beam_btn{font-size:.875rem;text-align:center;padding:.3125rem .75rem;border:1px solid var(--sc-btn-border);color:var(--sc-btn-label-color);background-color:var(--sc-btn-color);cursor:pointer}.beam_btn:hover,.beam_btn:active{background-color:var(--sc-btn-hover)}.beam_action-footer{margin-left:0;background:linear-gradient(180deg,transparent 0%,white 100%);color:var(--sc-primary-text-color);position:fixed;bottom:0;left:0;width:100%;padding:.625rem;text-align:center}.beam_modal{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#00000080;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);z-index:1000;text-align:center;padding:1.25rem}.beam_modal-confirm{background:#fff;padding:1.25rem;width:80%;max-width:400px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.beam_modal-confirm button{margin:.625rem}.beam_modal-confirm h2{border-bottom:1px solid var(--sc-row-border-color);padding-bottom:.625rem;color:var(--sc-primary-text-color)}.beam_metadata{box-sizing:border-box;border:1px solid black;display:flex;flex-direction:column;max-height:100vh;color:var(--sc-primary-text-color)}.beam_metadata_content{padding-top:10px}.beam_metadata_header{display:flex;flex-direction:row;align-items:baseline;padding:0 30px;justify-content:space-between}.beam_metadata_count{font-size:1.5rem}.beam_metadata_count p{margin:0}.beam_metadata_header-order-num{font-weight:700;font-size:1.5rem}.beam_metadata_block{padding:0 30px;margin:10px 0}.beam_metadata_shipping{display:flex;flex-direction:row;align-items:baseline;justify-content:space-between}.beam_metadata_shipping p{line-height:1.5rem}@media screen and (max-width: 600px){.beam_metadata_shipping{flex-direction:column}}.beam_metadata_component_header{display:flex;flex-direction:row;justify-content:space-between;align-items:baseline}.beam_metadata_components{overflow:scroll}.beam_metadata_heading{font-size:1.125rem;font-weight:700;margin:.625rem 0}
|
|
2
|
+
`,document.head.appendChild($e);const Jt={class:"beam_action-footer"},Fr={class:"footer-action-wrapper"},Di=R.defineComponent({__name:"ActionFooter",emits:["click"],setup(e,{emit:i}){const t=i,a=()=>{t("click")};return(h,n)=>(R.openBlock(),R.createElementBlock("footer",Jt,[R.createElementVNode("span",Fr,[R.createElementVNode("button",{class:"beam_btn",onClick:a},[R.renderSlot(h.$slots,"default")])])]))}}),Da={class:"beam_metadata_arrow"},Fa={class:"beam_metadata_arrow-head"},Wa={id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 6.74 7.78"},$a=R.defineComponent({__name:"BeamArrow",props:{color:{}},setup(e){return(i,t)=>(R.openBlock(),R.createElementBlock("div",Da,[R.createElementVNode("div",{class:"beam_metadata_arrow-body",style:R.normalizeStyle({background:i.color||"#c4c4c4"})},null,4),R.createElementVNode("div",Fa,[(R.openBlock(),R.createElementBlock("svg",Wa,[R.createElementVNode("polygon",{points:"6.74 3.89 0 0 0 7.78 6.74 3.89",style:R.normalizeStyle([{fill:"#c4c4c4"},{fill:i.color||"#c4c4c4"}])},null,4)]))])]))}}),ct=(e,i)=>{const t=e.__vccOpts||e;for(const[a,h]of i)t[a]=h;return t},Fi=ct($a,[["__scopeId","data-v-94fbdac5"]]),Va={},qa={class:"beam_btn"};function za(e,i){return R.openBlock(),R.createElementBlock("button",qa,[R.renderSlot(e.$slots,"default",{},()=>[i[0]||(i[0]=R.createTextVNode("Action"))])])}const Wi=ct(Va,[["render",za]]),Ha={class:"beam_filters-options"},$i=ct(R.defineComponent({__name:"BeamFilter",setup(e){const i=R.useTemplateRef("beam-filters-header"),t=R.useTemplateRef("beam-filters"),a=R.ref(!1),h=R.ref(),n=R.ref(),r=()=>{a.value=!a.value};R.onMounted(()=>{h.value=s(i.value),n.value=s(t.value),t.value.style.height=h.value});const s=o=>{const l=o.getBoundingClientRect().height,f=parseInt(getComputedStyle(o).marginTop),p=parseInt(getComputedStyle(o).marginBottom);return l+f+p+"px"};return(o,l)=>{const f=R.resolveComponent("ToggleArrow"),p=R.resolveComponent("BeamHeading");return R.openBlock(),R.createElementBlock("div",{ref:"beam-filters",class:"beam_filters",style:R.normalizeStyle({height:a.value?"100%":h.value})},[R.createElementVNode("div",{ref:"beam-filters-header",onClick:r,class:"beam_filters-heading"},[R.createVNode(f,{open:a.value},null,8,["open"]),R.createVNode(p,null,{default:R.withCtx(()=>l[0]||(l[0]=[R.createTextVNode(" Filter ")])),_:1})],512),R.createElementVNode("div",Ha,[R.renderSlot(o.$slots,"default",{},()=>[l[1]||(l[1]=R.createElementVNode("p",null,"OPTIONS GO HERE",-1))],!0)])],4)}}}),[["__scopeId","data-v-7112a526"]]),Ka={ref:"select",class:"beam_filter-option-select"},Ya={class:"beam_filter-label"},Qa={key:0,ref:"menu",class:"beam_filter-select-menu"},Ga=["data-value","onClick"],Vi=ct(R.defineComponent({__name:"BeamFilterOption",props:{choices:{default:()=>[]},title:{default:"title"}},setup(e){const i=R.ref(!1),t=R.ref(e.choices[0].value),a=R.ref(e.choices[0].choice),h=r=>{a.value=r.choice,t.value=r.value},n=()=>{i.value=!i.value};return(r,s)=>{const o=R.resolveComponent("BeamHeading");return R.openBlock(),R.createElementBlock(R.Fragment,null,[R.createVNode(o,{class:"beam_filter-option-heading"},{default:R.withCtx(()=>[R.createTextVNode(R.toDisplayString(r.title),1)]),_:1}),R.createElementVNode("div",{onClick:n,class:"beam_filter-option"},[R.createElementVNode("div",Ka,[s[0]||(s[0]=R.createElementVNode("div",{class:"beam_filter-arrow"},[R.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 35.36 70.71"},[R.createElementVNode("polygon",{points:"0 70.71 0 0 35.36 35.36 0 70.71"})])],-1)),R.createElementVNode("div",Ya,[R.createElementVNode("label",null,R.toDisplayString(a.value),1)])],512),i.value?(R.openBlock(),R.createElementBlock("ul",Qa,[(R.openBlock(!0),R.createElementBlock(R.Fragment,null,R.renderList(r.choices,(l,f)=>(R.openBlock(),R.createElementBlock("li",{class:R.normalizeClass([{selected:a.value==l.choice},"beam_filter-select-option"]),"data-value":l.value,key:f,onClick:p=>h(l)},R.toDisplayString(l.choice),11,Ga))),128))],512)):R.createCommentVNode("",!0)])],64)}}}),[["__scopeId","data-v-af0d9c81"]]),Ja={},Za={class:"beam_header"};function Xa(e,i){return R.openBlock(),R.createElementBlock("h1",Za,[R.renderSlot(e.$slots,"default")])}const qi=ct(Ja,[["render",Xa]]),el={class:"beam_metadata"},tl={class:"beam_metadata_content"},rl={class:"beam_metadata_block"},nl={class:"beam_metadata_heading"},zi=R.defineComponent({__name:"BeamMetadata",props:{order:{}},setup(e){return(i,t)=>(R.openBlock(),R.createElementBlock("div",el,[R.createElementVNode("div",tl,[R.renderSlot(i.$slots,"default",{},()=>[t[1]||(t[1]=R.createElementVNode("div",{class:"beam_metadata_header beam_metadata--two-column"},null,-1)),R.createElementVNode("div",rl,[R.createElementVNode("p",nl,[t[0]||(t[0]=R.createTextVNode(" Status: ")),R.createElementVNode("span",{class:R.normalizeClass([{alert:!i.order.complete},"beam_metadata--normal"])},R.toDisplayString(i.order.complete?"Complete":"In Progress"),3)])]),t[2]||(t[2]=R.createStaticVNode('<div class="beam_metadata_shipping beam_metadata_block"><div class="beam_metadata_source"><p class="beam_metadata_heading">Source</p></div><div class="beam_metadata_source"><p class="beam_metadata_heading">Receiving</p></div></div>',1))])])]))}}),il={class:"beam_modal"},Hi=R.defineComponent({__name:"BeamModal",props:{showModal:{type:Boolean}},setup(e){return(i,t)=>{const a=R.resolveComponent("portal");return R.openBlock(),R.createBlock(a,{to:"beam_modal_outlet"},{default:R.withCtx(()=>[R.withDirectives(R.createElementVNode("div",il,[R.createElementVNode("button",{class:"beam_btn",onClick:t[0]||(t[0]=h=>i.$emit("closemodal"))},"Close Modal"),R.renderSlot(i.$slots,"default",{onClosemodal:t[1]||(t[1]=h=>i.$emit("closemodal")),onConfirmmodal:t[2]||(t[2]=h=>i.$emit("confirmmodal"))})],512),[[R.vShow,i.showModal]])]),_:3})}}}),Ki=R.defineComponent({__name:"BeamModalOutlet",emits:["confirmmodal","closemodal"],setup(e){return(i,t)=>{const a=R.resolveComponent("portal-target");return R.openBlock(),R.createBlock(a,{name:"beam_modal_outlet"})}}}),ol={class:"beam_metadata_heading"},Yi=R.defineComponent({__name:"BeamProgress",props:{label:{default:"Status"},progressMessage:{default:"In Progress"},completeMessage:{default:"Complete"},complete:{type:Boolean,default:!1}},setup(e){const i=R.computed(()=>e.complete?e.completeMessage:e.progressMessage);return(t,a)=>(R.openBlock(),R.createElementBlock("p",ol,[R.createTextVNode(R.toDisplayString(t.label)+": ",1),R.createElementVNode("span",{class:R.normalizeClass([{"beam--alert":!t.complete},"beam--normal"])},R.toDisplayString(i.value),3)]))}}),sl={},al={class:"beam_modal-confirm"};function ll(e,i){return R.openBlock(),R.createElementBlock("div",al,[i[2]||(i[2]=R.createElementVNode("h2",null,"Would you like to continue?",-1)),R.createElementVNode("button",{class:"beam_btn",onClick:i[0]||(i[0]=t=>e.$emit("confirmmodal"))},"Yes"),R.createElementVNode("button",{class:"beam_btn",onClick:i[1]||(i[1]=t=>e.$emit("closemodal"))},"No")])}const Qi=ct(sl,[["render",ll]]),hl={},cl={class:"fixed-top"};function ul(e,i){return R.openBlock(),R.createElementBlock("div",cl,[R.renderSlot(e.$slots,"default",{},void 0,!0)])}const Gi=ct(hl,[["render",ul],["__scopeId","data-v-a38a41d0"]]),fl={class:"container"},Wr=ct(R.defineComponent({__name:"ItemCheck",props:{modelValue:{type:Boolean,default:!1},modelModifiers:{}},emits:["update:modelValue"],setup(e){const i=R.useModel(e,"modelValue");return(t,a)=>(R.openBlock(),R.createElementBlock("label",fl,[R.withDirectives(R.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":a[0]||(a[0]=h=>i.value=h),tabindex:"-1"},null,512),[[R.vModelCheckbox,i.value]]),a[1]||(a[1]=R.createElementVNode("div",{class:"checkmark",tabindex:"0"},null,-1))]))}}),[["__scopeId","data-v-f44a510e"]]),dl={class:"beam_item-count"},pl=["contenteditable"],gl={key:0},$r=R.defineComponent({__name:"ItemCount",props:R.mergeModels({denominator:{},uom:{default:""},editable:{type:Boolean,default:!0}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const i=R.useModel(e,"modelValue"),t=R.computed(()=>i.value===e.denominator),a=h=>{h.preventDefault(),h.stopPropagation();const n=Number(h.target.innerHTML)||0;i.value=Math.min(n,e.denominator)};return(h,n)=>(R.openBlock(),R.createElementBlock("div",dl,[R.createElementVNode("span",{contenteditable:h.editable,class:R.normalizeClass({"beam--alert":!t.value}),onInput:a,onClick:a},R.toDisplayString(i.value),43,pl),R.createElementVNode("span",null,"/"+R.toDisplayString(h.denominator),1),h.uom?(R.openBlock(),R.createElementBlock("span",gl," "+R.toDisplayString(h.uom),1)):R.createCommentVNode("",!0)]))}}),ml=["href"],Ji=R.defineComponent({__name:"ListAnchor",props:{to:{default:""}},setup(e){return(i,t)=>(R.openBlock(),R.createElementBlock("a",{href:i.to,class:"beam_list-anchor"},[R.renderSlot(i.$slots,"default")],8,ml))}}),bl={tabindex:"0",class:"beam_list-item"},yl={class:"beam_list-text"},wl={class:"beam--bold"},dr=R.defineComponent({__name:"ListItem",props:{item:{}},setup(e){const i=R.ref(e.item);return(t,a)=>(R.openBlock(),R.createElementBlock("li",bl,[R.createElementVNode("div",yl,[R.createElementVNode("label",wl,R.toDisplayString(i.value.label),1),R.createElementVNode("p",null,R.toDisplayString(i.value.description),1)]),i.value.count?(R.openBlock(),R.createBlock($r,{key:0,modelValue:i.value.count.count,"onUpdate:modelValue":a[0]||(a[0]=h=>i.value.count.count=h),denominator:i.value.count.of,uom:i.value.count.uom,editable:!0},null,8,["modelValue","denominator","uom"])):R.createCommentVNode("",!0),i.value.hasOwnProperty("checked")?(R.openBlock(),R.createBlock(Wr,{key:1,modelValue:i.value.checked,"onUpdate:modelValue":a[1]||(a[1]=h=>i.value.checked=h)},null,8,["modelValue"])):R.createCommentVNode("",!0)]))}}),_l={class:"beam_list-view"},Zi=R.defineComponent({__name:"ListView",props:{items:{}},emits:["scrollbottom"],setup(e,{emit:i}){const t=i;R.onMounted(()=>{window.addEventListener("scroll",a)}),R.onUnmounted(()=>{window.removeEventListener("scroll",a)});const a=()=>{const h=document.documentElement.scrollHeight-window.innerHeight,n=document.documentElement.scrollTop;h-n<=2&&t("scrollbottom")};return(h,n)=>(R.openBlock(),R.createElementBlock("ul",_l,[(R.openBlock(!0),R.createElementBlock(R.Fragment,null,R.renderList(h.items,r=>(R.openBlock(),R.createElementBlock("li",{key:r.label},[r.linkComponent?(R.openBlock(),R.createBlock(R.resolveDynamicComponent(r.linkComponent),{key:0,to:r.route,tabindex:"-1"},{default:R.withCtx(()=>[R.createVNode(dr,{item:r},null,8,["item"])]),_:2},1032,["to"])):(R.openBlock(),R.createBlock(dr,{key:1,item:r},null,8,["item"]))]))),128))]))}}),vl={class:"beam_navbar"},Xi=R.defineComponent({__name:"Navbar",emits:["click"],setup(e,{emit:i}){const t=i,a=()=>{t("click")};return(h,n)=>{const r=R.resolveComponent("BeamHeading");return R.openBlock(),R.createElementBlock("nav",vl,[R.renderSlot(h.$slots,"title",{},()=>[R.createVNode(r,null,{default:R.withCtx(()=>n[0]||(n[0]=[R.createTextVNode("TITLE")])),_:1})]),R.createElementVNode("button",{class:"navbar-action beam_btn",onClick:a},[R.renderSlot(h.$slots,"navbaraction",{},()=>[n[1]||(n[1]=R.createTextVNode("Action"))])])])}}});var El=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Sl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var eo={exports:{}};(function(e,i){(function(t,a){e.exports=a()})(El,function(){var t={attachTo:function(a,h){if(a.scannerDetectionData!==void 0)throw new Error("onScan.js is already initialized for DOM element "+a);var n={onScan:function(r,s){},onScanError:function(r){},onKeyProcess:function(r,s){},onKeyDetect:function(r,s){},onPaste:function(r,s){},keyCodeMapper:function(r){return t.decodeKeyEvent(r)},onScanButtonLongPress:function(){},scanButtonKeyCode:!1,scanButtonLongPressTime:500,timeBeforeScanTest:100,avgTimeByChar:30,minLength:6,suffixKeyCodes:[9,13],prefixKeyCodes:[],ignoreIfFocusOn:!1,stopPropagation:!1,preventDefault:!1,captureEvents:!1,reactToKeydown:!0,reactToPaste:!1,singleScanQty:1};return h=this._mergeOptions(n,h),a.scannerDetectionData={options:h,vars:{firstCharTime:0,lastCharTime:0,accumulatedString:"",testTimer:!1,longPressTimeStart:0,longPressed:!1}},h.reactToPaste===!0&&a.addEventListener("paste",this._handlePaste,h.captureEvents),h.scanButtonKeyCode!==!1&&a.addEventListener("keyup",this._handleKeyUp,h.captureEvents),(h.reactToKeydown===!0||h.scanButtonKeyCode!==!1)&&a.addEventListener("keydown",this._handleKeyDown,h.captureEvents),this},detachFrom:function(a){a.scannerDetectionData.options.reactToPaste&&a.removeEventListener("paste",this._handlePaste),a.scannerDetectionData.options.scanButtonKeyCode!==!1&&a.removeEventListener("keyup",this._handleKeyUp),a.removeEventListener("keydown",this._handleKeyDown),a.scannerDetectionData=void 0},getOptions:function(a){return a.scannerDetectionData.options},setOptions:function(a,h){switch(a.scannerDetectionData.options.reactToPaste){case!0:h.reactToPaste===!1&&a.removeEventListener("paste",this._handlePaste);break;case!1:h.reactToPaste===!0&&a.addEventListener("paste",this._handlePaste);break}switch(a.scannerDetectionData.options.scanButtonKeyCode){case!1:h.scanButtonKeyCode!==!1&&a.addEventListener("keyup",this._handleKeyUp);break;default:h.scanButtonKeyCode===!1&&a.removeEventListener("keyup",this._handleKeyUp);break}return a.scannerDetectionData.options=this._mergeOptions(a.scannerDetectionData.options,h),this._reinitialize(a),this},decodeKeyEvent:function(a){var h=this._getNormalizedKeyNum(a);switch(!0){case(h>=48&&h<=90):case(h>=106&&h<=111):if(a.key!==void 0&&a.key!=="")return a.key;var n=String.fromCharCode(h);switch(a.shiftKey){case!1:n=n.toLowerCase();break;case!0:n=n.toUpperCase();break}return n;case(h>=96&&h<=105):return 0+(h-96)}return""},simulate:function(a,h){return this._reinitialize(a),Array.isArray(h)?h.forEach(function(n){var r={};(typeof n=="object"||typeof n=="function")&&n!==null?r=n:r.keyCode=parseInt(n);var s=new KeyboardEvent("keydown",r);document.dispatchEvent(s)}):this._validateScanCode(a,h),this},_reinitialize:function(a){var h=a.scannerDetectionData.vars;h.firstCharTime=0,h.lastCharTime=0,h.accumulatedString=""},_isFocusOnIgnoredElement:function(a){var h=a.scannerDetectionData.options.ignoreIfFocusOn;if(!h)return!1;var n=document.activeElement;if(Array.isArray(h)){for(var r=0;r<h.length;r++)if(n.matches(h[r])===!0)return!0}else if(n.matches(h))return!0;return!1},_validateScanCode:function(a,h){var n=a.scannerDetectionData,r=n.options,s=n.options.singleScanQty,o=n.vars.firstCharTime,l=n.vars.lastCharTime,f={},p;switch(!0){case h.length<r.minLength:f={message:"Receieved code is shorter then minimal length"};break;case l-o>h.length*r.avgTimeByChar:f={message:"Receieved code was not entered in time"};break;default:return r.onScan.call(a,h,s),p=new CustomEvent("scan",{detail:{scanCode:h,qty:s}}),a.dispatchEvent(p),t._reinitialize(a),!0}return f.scanCode=h,f.scanDuration=l-o,f.avgTimeByChar=r.avgTimeByChar,f.minLength=r.minLength,r.onScanError.call(a,f),p=new CustomEvent("scanError",{detail:f}),a.dispatchEvent(p),t._reinitialize(a),!1},_mergeOptions:function(a,h){var n={},r;for(r in a)Object.prototype.hasOwnProperty.call(a,r)&&(n[r]=a[r]);for(r in h)Object.prototype.hasOwnProperty.call(h,r)&&(n[r]=h[r]);return n},_getNormalizedKeyNum:function(a){return a.which||a.keyCode},_handleKeyDown:function(a){var h=t._getNormalizedKeyNum(a),n=this.scannerDetectionData.options,r=this.scannerDetectionData.vars,s=!1;if(n.onKeyDetect.call(this,h,a)!==!1&&!t._isFocusOnIgnoredElement(this)){if(n.scanButtonKeyCode!==!1&&h==n.scanButtonKeyCode){r.longPressed||(r.longPressTimer=setTimeout(n.onScanButtonLongPress,n.scanButtonLongPressTime,this),r.longPressed=!0);return}switch(!0){case(r.firstCharTime&&n.suffixKeyCodes.indexOf(h)!==-1):a.preventDefault(),a.stopImmediatePropagation(),s=!0;break;case(!r.firstCharTime&&n.prefixKeyCodes.indexOf(h)!==-1):a.preventDefault(),a.stopImmediatePropagation(),s=!1;break;default:var o=n.keyCodeMapper.call(this,a);if(o===null)return;r.accumulatedString+=o,n.preventDefault&&a.preventDefault(),n.stopPropagation&&a.stopImmediatePropagation(),s=!1;break}r.firstCharTime||(r.firstCharTime=Date.now()),r.lastCharTime=Date.now(),r.testTimer&&clearTimeout(r.testTimer),s?(t._validateScanCode(this,r.accumulatedString),r.testTimer=!1):r.testTimer=setTimeout(t._validateScanCode,n.timeBeforeScanTest,this,r.accumulatedString),n.onKeyProcess.call(this,o,a)}},_handlePaste:function(a){var h=this.scannerDetectionData.options,n=this.scannerDetectionData.vars,r=(event.clipboardData||window.clipboardData).getData("text");t._isFocusOnIgnoredElement(this)||(a.preventDefault(),h.stopPropagation&&a.stopImmediatePropagation(),h.onPaste.call(this,r,event),n.firstCharTime=0,n.lastCharTime=0,t._validateScanCode(this,r))},_handleKeyUp:function(a){if(!t._isFocusOnIgnoredElement(this)){var h=t._getNormalizedKeyNum(a);h==this.scannerDetectionData.options.scanButtonKeyCode&&(clearTimeout(this.scannerDetectionData.vars.longPressTimer),this.scannerDetectionData.vars.longPressed=!1)}},isScanInProgressFor:function(a){return a.scannerDetectionData.vars.firstCharTime>0},isAttachedTo:function(a){return a.scannerDetectionData!==void 0}};return t})})(eo);var Al=eo.exports;const to=Sl(Al),kl={id:"scan_input"},ro=R.defineComponent({__name:"ScanInput",props:{scanHandler:{type:Function}},emits:["scanInstance"],setup(e,{emit:i}){const t=i,a=e;return R.onMounted(()=>{const h=to.attachTo(window,{onScan:a.scanHandler});t("scanInstance",h)}),R.onUnmounted(()=>{to.detachFrom(window)}),(h,n)=>(R.openBlock(),R.createElementBlock("div",kl))}}),Il={class:"column column-left"},Tl={class:"column column-right"},no=ct(R.defineComponent({__name:"SplitColumn",props:{justifyContent:{},alignItems:{}},setup(e){return(i,t)=>(R.openBlock(),R.createElementBlock("div",{class:"two-column",style:R.normalizeStyle({justifyContent:i.justifyContent||"space-between",alignItems:i.alignItems||"flex-start"})},[R.createElementVNode("div",Il,[R.renderSlot(i.$slots,"left",{},void 0,!0)]),R.createElementVNode("div",Tl,[R.renderSlot(i.$slots,"right",{},void 0,!0)])],4))}}),[["__scopeId","data-v-c65440c0"]]),io=ct(R.defineComponent({__name:"ToggleArrow",props:{open:{type:Boolean}},setup(e){return(i,t)=>(R.openBlock(),R.createElementBlock("div",{class:R.normalizeClass(["arrow-icon",{open:i.open}])},t[0]||(t[0]=[R.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 35.36 70.71"},[R.createElementVNode("polygon",{points:"0 70.71 0 0 35.36 35.36 0 70.71"})],-1)]),2))}}),[["__scopeId","data-v-fb512459"]]);var Vr=Object.defineProperty,Cl=Object.getOwnPropertyDescriptor,Bl=Object.getOwnPropertyNames,Pl=Object.prototype.hasOwnProperty,Qe=(e,i)=>()=>(e&&(i=e(e=0)),i),be=(e,i)=>()=>(i||e((i={exports:{}}).exports,i),i.exports),Mt=(e,i)=>{for(var t in i)Vr(e,t,{get:i[t],enumerable:!0})},Ol=(e,i,t,a)=>{if(i&&typeof i=="object"||typeof i=="function")for(let h of Bl(i))!Pl.call(e,h)&&h!==t&&Vr(e,h,{get:()=>i[h],enumerable:!(a=Cl(i,h))||a.enumerable});return e},Ne=e=>Ol(Vr({},"__esModule",{value:!0}),e),ae=Qe(()=>{}),Re={};Mt(Re,{_debugEnd:()=>An,_debugProcess:()=>Sn,_events:()=>Fn,_eventsCount:()=>Wn,_exiting:()=>hn,_fatalExceptions:()=>_n,_getActiveHandles:()=>uo,_getActiveRequests:()=>co,_kill:()=>fn,_linkedBinding:()=>lo,_maxListeners:()=>Dn,_preload_modules:()=>Ln,_rawDebug:()=>sn,_startProfilerIdleNotifier:()=>kn,_stopProfilerIdleNotifier:()=>In,_tickCallback:()=>En,abort:()=>Pn,addListener:()=>$n,allowedNodeEnvironmentFlags:()=>yn,arch:()=>Hr,argv:()=>Qr,argv0:()=>Nn,assert:()=>fo,binding:()=>en,chdir:()=>nn,config:()=>cn,cpuUsage:()=>or,cwd:()=>rn,debugPort:()=>Mn,default:()=>Gn,dlopen:()=>ho,domain:()=>ln,emit:()=>Kn,emitWarning:()=>Xr,env:()=>Yr,execArgv:()=>Gr,execPath:()=>xn,exit:()=>mn,features:()=>wn,hasUncaughtExceptionCaptureCallback:()=>po,hrtime:()=>pr,kill:()=>gn,listeners:()=>mo,memoryUsage:()=>pn,moduleLoadList:()=>an,nextTick:()=>so,off:()=>qn,on:()=>gt,once:()=>Vn,openStdin:()=>bn,pid:()=>On,platform:()=>Kr,ppid:()=>Rn,prependListener:()=>Yn,prependOnceListener:()=>Qn,reallyExit:()=>un,release:()=>on,removeAllListeners:()=>Hn,removeListener:()=>zn,resourceUsage:()=>dn,setSourceMapsEnabled:()=>Un,setUncaughtExceptionCaptureCallback:()=>vn,stderr:()=>Cn,stdin:()=>Bn,stdout:()=>Tn,title:()=>zr,umask:()=>tn,uptime:()=>go,version:()=>Jr,versions:()=>Zr});function qr(e){throw new Error("Node.js process "+e+" is not supported by JSPM core outside of Node.js")}function Rl(){!Nt||!Lt||(Nt=!1,Lt.length?ut=Lt.concat(ut):ir=-1,ut.length&&oo())}function oo(){if(!Nt){var e=setTimeout(Rl,0);Nt=!0;for(var i=ut.length;i;){for(Lt=ut,ut=[];++ir<i;)Lt&&Lt[ir].run();ir=-1,i=ut.length}Lt=null,Nt=!1,clearTimeout(e)}}function so(e){var i=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)i[t-1]=arguments[t];ut.push(new ao(e,i)),ut.length===1&&!Nt&&setTimeout(oo,0)}function ao(e,i){this.fun=e,this.array=i}function Xe(){}function lo(e){qr("_linkedBinding")}function ho(e){qr("dlopen")}function co(){return[]}function uo(){return[]}function fo(e,i){if(!e)throw new Error(i||"assertion error")}function po(){return!1}function go(){return mt.now()/1e3}function pr(e){var i=Math.floor((Date.now()-mt.now())*.001),t=mt.now()*.001,a=Math.floor(t)+i,h=Math.floor(t%1*1e9);return e&&(a=a-e[0],h=h-e[1],h<0&&(a--,h+=gr)),[a,h]}function gt(){return Gn}function mo(e){return[]}var ut,Nt,Lt,ir,zr,Hr,Kr,Yr,Qr,Gr,Jr,Zr,Xr,en,tn,rn,nn,on,sn,an,ln,hn,cn,un,fn,or,dn,pn,gn,mn,bn,yn,wn,_n,vn,En,Sn,An,kn,In,Tn,Cn,Bn,Pn,On,Rn,xn,Mn,Nn,Ln,Un,mt,jn,gr,Dn,Fn,Wn,$n,Vn,qn,zn,Hn,Kn,Yn,Qn,Gn,xl=Qe(()=>{ae(),he(),le(),ut=[],Nt=!1,ir=-1,ao.prototype.run=function(){this.fun.apply(null,this.array)},zr="browser",Hr="x64",Kr="browser",Yr={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},Qr=["/usr/bin/node"],Gr=[],Jr="v16.8.0",Zr={},Xr=function(e,i){console.warn((i?i+": ":"")+e)},en=function(e){qr("binding")},tn=function(e){return 0},rn=function(){return"/"},nn=function(e){},on={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},sn=Xe,an=[],ln={},hn=!1,cn={},un=Xe,fn=Xe,or=function(){return{}},dn=or,pn=or,gn=Xe,mn=Xe,bn=Xe,yn={},wn={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},_n=Xe,vn=Xe,En=Xe,Sn=Xe,An=Xe,kn=Xe,In=Xe,Tn=void 0,Cn=void 0,Bn=void 0,Pn=Xe,On=2,Rn=1,xn="/bin/usr/node",Mn=9229,Nn="node",Ln=[],Un=Xe,mt={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0},mt.now===void 0&&(jn=Date.now(),mt.timing&&mt.timing.navigationStart&&(jn=mt.timing.navigationStart),mt.now=()=>Date.now()-jn),gr=1e9,pr.bigint=function(e){var i=pr(e);return typeof BigInt>"u"?i[0]*gr+i[1]:BigInt(i[0]*gr)+BigInt(i[1])},Dn=10,Fn={},Wn=0,$n=gt,Vn=gt,qn=gt,zn=gt,Hn=gt,Kn=Xe,Yn=gt,Qn=gt,Gn={version:Jr,versions:Zr,arch:Hr,platform:Kr,release:on,_rawDebug:sn,moduleLoadList:an,binding:en,_linkedBinding:lo,_events:Fn,_eventsCount:Wn,_maxListeners:Dn,on:gt,addListener:$n,once:Vn,off:qn,removeListener:zn,removeAllListeners:Hn,emit:Kn,prependListener:Yn,prependOnceListener:Qn,listeners:mo,domain:ln,_exiting:hn,config:cn,dlopen:ho,uptime:go,_getActiveRequests:co,_getActiveHandles:uo,reallyExit:un,_kill:fn,cpuUsage:or,resourceUsage:dn,memoryUsage:pn,kill:gn,exit:mn,openStdin:bn,allowedNodeEnvironmentFlags:yn,assert:fo,features:wn,_fatalExceptions:_n,setUncaughtExceptionCaptureCallback:vn,hasUncaughtExceptionCaptureCallback:po,emitWarning:Xr,nextTick:so,_tickCallback:En,_debugProcess:Sn,_debugEnd:An,_startProfilerIdleNotifier:kn,_stopProfilerIdleNotifier:In,stdout:Tn,stdin:Bn,stderr:Cn,abort:Pn,umask:tn,chdir:nn,cwd:rn,env:Yr,title:zr,argv:Qr,execArgv:Gr,pid:On,ppid:Rn,execPath:xn,debugPort:Mn,hrtime:pr,argv0:Nn,_preload_modules:Ln,setSourceMapsEnabled:Un}}),le=Qe(()=>{xl()}),Ge={};Mt(Ge,{Buffer:()=>mr,INSPECT_MAX_BYTES:()=>bo,default:()=>bt,kMaxLength:()=>yo});function Ml(){if(Jn)return Zt;Jn=!0,Zt.byteLength=s,Zt.toByteArray=l,Zt.fromByteArray=g;for(var e=[],i=[],t=typeof Uint8Array<"u"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,n=a.length;h<n;++h)e[h]=a[h],i[a.charCodeAt(h)]=h;i[45]=62,i[95]=63;function r(m){var b=m.length;if(b%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var y=m.indexOf("=");y===-1&&(y=b);var A=y===b?0:4-y%4;return[y,A]}function s(m){var b=r(m),y=b[0],A=b[1];return(y+A)*3/4-A}function o(m,b,y){return(b+y)*3/4-y}function l(m){var b,y=r(m),A=y[0],N=y[1],k=new t(o(m,A,N)),v=0,U=N>0?A-4:A,D;for(D=0;D<U;D+=4)b=i[m.charCodeAt(D)]<<18|i[m.charCodeAt(D+1)]<<12|i[m.charCodeAt(D+2)]<<6|i[m.charCodeAt(D+3)],k[v++]=b>>16&255,k[v++]=b>>8&255,k[v++]=b&255;return N===2&&(b=i[m.charCodeAt(D)]<<2|i[m.charCodeAt(D+1)]>>4,k[v++]=b&255),N===1&&(b=i[m.charCodeAt(D)]<<10|i[m.charCodeAt(D+1)]<<4|i[m.charCodeAt(D+2)]>>2,k[v++]=b>>8&255,k[v++]=b&255),k}function f(m){return e[m>>18&63]+e[m>>12&63]+e[m>>6&63]+e[m&63]}function p(m,b,y){for(var A,N=[],k=b;k<y;k+=3)A=(m[k]<<16&16711680)+(m[k+1]<<8&65280)+(m[k+2]&255),N.push(f(A));return N.join("")}function g(m){for(var b,y=m.length,A=y%3,N=[],k=16383,v=0,U=y-A;v<U;v+=k)N.push(p(m,v,v+k>U?U:v+k));return A===1?(b=m[y-1],N.push(e[b>>2]+e[b<<4&63]+"==")):A===2&&(b=(m[y-2]<<8)+m[y-1],N.push(e[b>>10]+e[b>>4&63]+e[b<<2&63]+"=")),N.join("")}return Zt}function Nl(){return Zn?sr:(Zn=!0,sr.read=function(e,i,t,a,h){var n,r,s=h*8-a-1,o=(1<<s)-1,l=o>>1,f=-7,p=t?h-1:0,g=t?-1:1,m=e[i+p];for(p+=g,n=m&(1<<-f)-1,m>>=-f,f+=s;f>0;n=n*256+e[i+p],p+=g,f-=8);for(r=n&(1<<-f)-1,n>>=-f,f+=a;f>0;r=r*256+e[i+p],p+=g,f-=8);if(n===0)n=1-l;else{if(n===o)return r?NaN:(m?-1:1)*(1/0);r=r+Math.pow(2,a),n=n-l}return(m?-1:1)*r*Math.pow(2,n-a)},sr.write=function(e,i,t,a,h,n){var r,s,o,l=n*8-h-1,f=(1<<l)-1,p=f>>1,g=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=a?0:n-1,b=a?1:-1,y=i<0||i===0&&1/i<0?1:0;for(i=Math.abs(i),isNaN(i)||i===1/0?(s=isNaN(i)?1:0,r=f):(r=Math.floor(Math.log(i)/Math.LN2),i*(o=Math.pow(2,-r))<1&&(r--,o*=2),r+p>=1?i+=g/o:i+=g*Math.pow(2,1-p),i*o>=2&&(r++,o/=2),r+p>=f?(s=0,r=f):r+p>=1?(s=(i*o-1)*Math.pow(2,h),r=r+p):(s=i*Math.pow(2,p-1)*Math.pow(2,h),r=0));h>=8;e[t+m]=s&255,m+=b,s/=256,h-=8);for(r=r<<h|s,l+=h;l>0;e[t+m]=r&255,m+=b,r/=256,l-=8);e[t+m-b]|=y*128},sr)}function Ll(){if(Xn)return Bt;Xn=!0;let e=Ml(),i=Nl(),t=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Bt.Buffer=r,Bt.SlowBuffer=N,Bt.INSPECT_MAX_BYTES=50;let a=2147483647;Bt.kMaxLength=a,r.TYPED_ARRAY_SUPPORT=h(),!r.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function h(){try{let u=new Uint8Array(1),c={foo:function(){return 42}};return Object.setPrototypeOf(c,Uint8Array.prototype),Object.setPrototypeOf(u,c),u.foo()===42}catch{return!1}}Object.defineProperty(r.prototype,"parent",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.buffer}}),Object.defineProperty(r.prototype,"offset",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.byteOffset}});function n(u){if(u>a)throw new RangeError('The value "'+u+'" is invalid for option "size"');let c=new Uint8Array(u);return Object.setPrototypeOf(c,r.prototype),c}function r(u,c,d){if(typeof u=="number"){if(typeof c=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return f(u)}return s(u,c,d)}r.poolSize=8192;function s(u,c,d){if(typeof u=="string")return p(u,c);if(ArrayBuffer.isView(u))return m(u);if(u==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof u);if(K(u,ArrayBuffer)||u&&K(u.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(K(u,SharedArrayBuffer)||u&&K(u.buffer,SharedArrayBuffer)))return b(u,c,d);if(typeof u=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let w=u.valueOf&&u.valueOf();if(w!=null&&w!==u)return r.from(w,c,d);let I=y(u);if(I)return I;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof u[Symbol.toPrimitive]=="function")return r.from(u[Symbol.toPrimitive]("string"),c,d);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof u)}r.from=function(u,c,d){return s(u,c,d)},Object.setPrototypeOf(r.prototype,Uint8Array.prototype),Object.setPrototypeOf(r,Uint8Array);function o(u){if(typeof u!="number")throw new TypeError('"size" argument must be of type number');if(u<0)throw new RangeError('The value "'+u+'" is invalid for option "size"')}function l(u,c,d){return o(u),u<=0?n(u):c!==void 0?typeof d=="string"?n(u).fill(c,d):n(u).fill(c):n(u)}r.alloc=function(u,c,d){return l(u,c,d)};function f(u){return o(u),n(u<0?0:A(u)|0)}r.allocUnsafe=function(u){return f(u)},r.allocUnsafeSlow=function(u){return f(u)};function p(u,c){if((typeof c!="string"||c==="")&&(c="utf8"),!r.isEncoding(c))throw new TypeError("Unknown encoding: "+c);let d=k(u,c)|0,w=n(d),I=w.write(u,c);return I!==d&&(w=w.slice(0,I)),w}function g(u){let c=u.length<0?0:A(u.length)|0,d=n(c);for(let w=0;w<c;w+=1)d[w]=u[w]&255;return d}function m(u){if(K(u,Uint8Array)){let c=new Uint8Array(u);return b(c.buffer,c.byteOffset,c.byteLength)}return g(u)}function b(u,c,d){if(c<0||u.byteLength<c)throw new RangeError('"offset" is outside of buffer bounds');if(u.byteLength<c+(d||0))throw new RangeError('"length" is outside of buffer bounds');let w;return c===void 0&&d===void 0?w=new Uint8Array(u):d===void 0?w=new Uint8Array(u,c):w=new Uint8Array(u,c,d),Object.setPrototypeOf(w,r.prototype),w}function y(u){if(r.isBuffer(u)){let c=A(u.length)|0,d=n(c);return d.length===0||u.copy(d,0,0,c),d}if(u.length!==void 0)return typeof u.length!="number"||B(u.length)?n(0):g(u);if(u.type==="Buffer"&&Array.isArray(u.data))return g(u.data)}function A(u){if(u>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return u|0}function N(u){return+u!=u&&(u=0),r.alloc(+u)}r.isBuffer=function(u){return u!=null&&u._isBuffer===!0&&u!==r.prototype},r.compare=function(u,c){if(K(u,Uint8Array)&&(u=r.from(u,u.offset,u.byteLength)),K(c,Uint8Array)&&(c=r.from(c,c.offset,c.byteLength)),!r.isBuffer(u)||!r.isBuffer(c))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(u===c)return 0;let d=u.length,w=c.length;for(let I=0,$=Math.min(d,w);I<$;++I)if(u[I]!==c[I]){d=u[I],w=c[I];break}return d<w?-1:w<d?1:0},r.isEncoding=function(u){switch(String(u).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},r.concat=function(u,c){if(!Array.isArray(u))throw new TypeError('"list" argument must be an Array of Buffers');if(u.length===0)return r.alloc(0);let d;if(c===void 0)for(c=0,d=0;d<u.length;++d)c+=u[d].length;let w=r.allocUnsafe(c),I=0;for(d=0;d<u.length;++d){let $=u[d];if(K($,Uint8Array))I+$.length>w.length?(r.isBuffer($)||($=r.from($)),$.copy(w,I)):Uint8Array.prototype.set.call(w,$,I);else if(r.isBuffer($))$.copy(w,I);else throw new TypeError('"list" argument must be an Array of Buffers');I+=$.length}return w};function k(u,c){if(r.isBuffer(u))return u.length;if(ArrayBuffer.isView(u)||K(u,ArrayBuffer))return u.byteLength;if(typeof u!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof u);let d=u.length,w=arguments.length>2&&arguments[2]===!0;if(!w&&d===0)return 0;let I=!1;for(;;)switch(c){case"ascii":case"latin1":case"binary":return d;case"utf8":case"utf-8":return F(u).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return d*2;case"hex":return d>>>1;case"base64":return Z(u).length;default:if(I)return w?-1:F(u).length;c=(""+c).toLowerCase(),I=!0}}r.byteLength=k;function v(u,c,d){let w=!1;if((c===void 0||c<0)&&(c=0),c>this.length||((d===void 0||d>this.length)&&(d=this.length),d<=0)||(d>>>=0,c>>>=0,d<=c))return"";for(u||(u="utf8");;)switch(u){case"hex":return z(this,c,d);case"utf8":case"utf-8":return H(this,c,d);case"ascii":return me(this,c,d);case"latin1":case"binary":return se(this,c,d);case"base64":return S(this,c,d);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ye(this,c,d);default:if(w)throw new TypeError("Unknown encoding: "+u);u=(u+"").toLowerCase(),w=!0}}r.prototype._isBuffer=!0;function U(u,c,d){let w=u[c];u[c]=u[d],u[d]=w}r.prototype.swap16=function(){let u=this.length;if(u%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let c=0;c<u;c+=2)U(this,c,c+1);return this},r.prototype.swap32=function(){let u=this.length;if(u%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let c=0;c<u;c+=4)U(this,c,c+3),U(this,c+1,c+2);return this},r.prototype.swap64=function(){let u=this.length;if(u%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let c=0;c<u;c+=8)U(this,c,c+7),U(this,c+1,c+6),U(this,c+2,c+5),U(this,c+3,c+4);return this},r.prototype.toString=function(){let u=this.length;return u===0?"":arguments.length===0?H(this,0,u):v.apply(this,arguments)},r.prototype.toLocaleString=r.prototype.toString,r.prototype.equals=function(u){if(!r.isBuffer(u))throw new TypeError("Argument must be a Buffer");return this===u?!0:r.compare(this,u)===0},r.prototype.inspect=function(){let u="",c=Bt.INSPECT_MAX_BYTES;return u=this.toString("hex",0,c).replace(/(.{2})/g,"$1 ").trim(),this.length>c&&(u+=" ... "),"<Buffer "+u+">"},t&&(r.prototype[t]=r.prototype.inspect),r.prototype.compare=function(u,c,d,w,I){if(K(u,Uint8Array)&&(u=r.from(u,u.offset,u.byteLength)),!r.isBuffer(u))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof u);if(c===void 0&&(c=0),d===void 0&&(d=u?u.length:0),w===void 0&&(w=0),I===void 0&&(I=this.length),c<0||d>u.length||w<0||I>this.length)throw new RangeError("out of range index");if(w>=I&&c>=d)return 0;if(w>=I)return-1;if(c>=d)return 1;if(c>>>=0,d>>>=0,w>>>=0,I>>>=0,this===u)return 0;let $=I-w,ee=d-c,Ie=Math.min($,ee),Be=this.slice(w,I),Pe=u.slice(c,d);for(let Ae=0;Ae<Ie;++Ae)if(Be[Ae]!==Pe[Ae]){$=Be[Ae],ee=Pe[Ae];break}return $<ee?-1:ee<$?1:0};function D(u,c,d,w,I){if(u.length===0)return-1;if(typeof d=="string"?(w=d,d=0):d>2147483647?d=2147483647:d<-2147483648&&(d=-2147483648),d=+d,B(d)&&(d=I?0:u.length-1),d<0&&(d=u.length+d),d>=u.length){if(I)return-1;d=u.length-1}else if(d<0)if(I)d=0;else return-1;if(typeof c=="string"&&(c=r.from(c,w)),r.isBuffer(c))return c.length===0?-1:C(u,c,d,w,I);if(typeof c=="number")return c=c&255,typeof Uint8Array.prototype.indexOf=="function"?I?Uint8Array.prototype.indexOf.call(u,c,d):Uint8Array.prototype.lastIndexOf.call(u,c,d):C(u,[c],d,w,I);throw new TypeError("val must be string, number or Buffer")}function C(u,c,d,w,I){let $=1,ee=u.length,Ie=c.length;if(w!==void 0&&(w=String(w).toLowerCase(),w==="ucs2"||w==="ucs-2"||w==="utf16le"||w==="utf-16le")){if(u.length<2||c.length<2)return-1;$=2,ee/=2,Ie/=2,d/=2}function Be(Ae,Ce){return $===1?Ae[Ce]:Ae.readUInt16BE(Ce*$)}let Pe;if(I){let Ae=-1;for(Pe=d;Pe<ee;Pe++)if(Be(u,Pe)===Be(c,Ae===-1?0:Pe-Ae)){if(Ae===-1&&(Ae=Pe),Pe-Ae+1===Ie)return Ae*$}else Ae!==-1&&(Pe-=Pe-Ae),Ae=-1}else for(d+Ie>ee&&(d=ee-Ie),Pe=d;Pe>=0;Pe--){let Ae=!0;for(let Ce=0;Ce<Ie;Ce++)if(Be(u,Pe+Ce)!==Be(c,Ce)){Ae=!1;break}if(Ae)return Pe}return-1}r.prototype.includes=function(u,c,d){return this.indexOf(u,c,d)!==-1},r.prototype.indexOf=function(u,c,d){return D(this,u,c,d,!0)},r.prototype.lastIndexOf=function(u,c,d){return D(this,u,c,d,!1)};function T(u,c,d,w){d=Number(d)||0;let I=u.length-d;w?(w=Number(w),w>I&&(w=I)):w=I;let $=c.length;w>$/2&&(w=$/2);let ee;for(ee=0;ee<w;++ee){let Ie=parseInt(c.substr(ee*2,2),16);if(B(Ie))return ee;u[d+ee]=Ie}return ee}function M(u,c,d,w){return L(F(c,u.length-d),u,d,w)}function V(u,c,d,w){return L(W(c),u,d,w)}function J(u,c,d,w){return L(Z(c),u,d,w)}function ne(u,c,d,w){return L(ie(c,u.length-d),u,d,w)}r.prototype.write=function(u,c,d,w){if(c===void 0)w="utf8",d=this.length,c=0;else if(d===void 0&&typeof c=="string")w=c,d=this.length,c=0;else if(isFinite(c))c=c>>>0,isFinite(d)?(d=d>>>0,w===void 0&&(w="utf8")):(w=d,d=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let I=this.length-c;if((d===void 0||d>I)&&(d=I),u.length>0&&(d<0||c<0)||c>this.length)throw new RangeError("Attempt to write outside buffer bounds");w||(w="utf8");let $=!1;for(;;)switch(w){case"hex":return T(this,u,c,d);case"utf8":case"utf-8":return M(this,u,c,d);case"ascii":case"latin1":case"binary":return V(this,u,c,d);case"base64":return J(this,u,c,d);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ne(this,u,c,d);default:if($)throw new TypeError("Unknown encoding: "+w);w=(""+w).toLowerCase(),$=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function S(u,c,d){return c===0&&d===u.length?e.fromByteArray(u):e.fromByteArray(u.slice(c,d))}function H(u,c,d){d=Math.min(u.length,d);let w=[],I=c;for(;I<d;){let $=u[I],ee=null,Ie=$>239?4:$>223?3:$>191?2:1;if(I+Ie<=d){let Be,Pe,Ae,Ce;switch(Ie){case 1:$<128&&(ee=$);break;case 2:Be=u[I+1],(Be&192)===128&&(Ce=($&31)<<6|Be&63,Ce>127&&(ee=Ce));break;case 3:Be=u[I+1],Pe=u[I+2],(Be&192)===128&&(Pe&192)===128&&(Ce=($&15)<<12|(Be&63)<<6|Pe&63,Ce>2047&&(Ce<55296||Ce>57343)&&(ee=Ce));break;case 4:Be=u[I+1],Pe=u[I+2],Ae=u[I+3],(Be&192)===128&&(Pe&192)===128&&(Ae&192)===128&&(Ce=($&15)<<18|(Be&63)<<12|(Pe&63)<<6|Ae&63,Ce>65535&&Ce<1114112&&(ee=Ce))}}ee===null?(ee=65533,Ie=1):ee>65535&&(ee-=65536,w.push(ee>>>10&1023|55296),ee=56320|ee&1023),w.push(ee),I+=Ie}return Q(w)}let re=4096;function Q(u){let c=u.length;if(c<=re)return String.fromCharCode.apply(String,u);let d="",w=0;for(;w<c;)d+=String.fromCharCode.apply(String,u.slice(w,w+=re));return d}function me(u,c,d){let w="";d=Math.min(u.length,d);for(let I=c;I<d;++I)w+=String.fromCharCode(u[I]&127);return w}function se(u,c,d){let w="";d=Math.min(u.length,d);for(let I=c;I<d;++I)w+=String.fromCharCode(u[I]);return w}function z(u,c,d){let w=u.length;(!c||c<0)&&(c=0),(!d||d<0||d>w)&&(d=w);let I="";for(let $=c;$<d;++$)I+=j[u[$]];return I}function ye(u,c,d){let w=u.slice(c,d),I="";for(let $=0;$<w.length-1;$+=2)I+=String.fromCharCode(w[$]+w[$+1]*256);return I}r.prototype.slice=function(u,c){let d=this.length;u=~~u,c=c===void 0?d:~~c,u<0?(u+=d,u<0&&(u=0)):u>d&&(u=d),c<0?(c+=d,c<0&&(c=0)):c>d&&(c=d),c<u&&(c=u);let w=this.subarray(u,c);return Object.setPrototypeOf(w,r.prototype),w};function oe(u,c,d){if(u%1!==0||u<0)throw new RangeError("offset is not uint");if(u+c>d)throw new RangeError("Trying to access beyond buffer length")}r.prototype.readUintLE=r.prototype.readUIntLE=function(u,c,d){u=u>>>0,c=c>>>0,d||oe(u,c,this.length);let w=this[u],I=1,$=0;for(;++$<c&&(I*=256);)w+=this[u+$]*I;return w},r.prototype.readUintBE=r.prototype.readUIntBE=function(u,c,d){u=u>>>0,c=c>>>0,d||oe(u,c,this.length);let w=this[u+--c],I=1;for(;c>0&&(I*=256);)w+=this[u+--c]*I;return w},r.prototype.readUint8=r.prototype.readUInt8=function(u,c){return u=u>>>0,c||oe(u,1,this.length),this[u]},r.prototype.readUint16LE=r.prototype.readUInt16LE=function(u,c){return u=u>>>0,c||oe(u,2,this.length),this[u]|this[u+1]<<8},r.prototype.readUint16BE=r.prototype.readUInt16BE=function(u,c){return u=u>>>0,c||oe(u,2,this.length),this[u]<<8|this[u+1]},r.prototype.readUint32LE=r.prototype.readUInt32LE=function(u,c){return u=u>>>0,c||oe(u,4,this.length),(this[u]|this[u+1]<<8|this[u+2]<<16)+this[u+3]*16777216},r.prototype.readUint32BE=r.prototype.readUInt32BE=function(u,c){return u=u>>>0,c||oe(u,4,this.length),this[u]*16777216+(this[u+1]<<16|this[u+2]<<8|this[u+3])},r.prototype.readBigUInt64LE=q(function(u){u=u>>>0,X(u,"offset");let c=this[u],d=this[u+7];(c===void 0||d===void 0)&&we(u,this.length-8);let w=c+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24,I=this[++u]+this[++u]*2**8+this[++u]*2**16+d*2**24;return BigInt(w)+(BigInt(I)<<BigInt(32))}),r.prototype.readBigUInt64BE=q(function(u){u=u>>>0,X(u,"offset");let c=this[u],d=this[u+7];(c===void 0||d===void 0)&&we(u,this.length-8);let w=c*2**24+this[++u]*2**16+this[++u]*2**8+this[++u],I=this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+d;return(BigInt(w)<<BigInt(32))+BigInt(I)}),r.prototype.readIntLE=function(u,c,d){u=u>>>0,c=c>>>0,d||oe(u,c,this.length);let w=this[u],I=1,$=0;for(;++$<c&&(I*=256);)w+=this[u+$]*I;return I*=128,w>=I&&(w-=Math.pow(2,8*c)),w},r.prototype.readIntBE=function(u,c,d){u=u>>>0,c=c>>>0,d||oe(u,c,this.length);let w=c,I=1,$=this[u+--w];for(;w>0&&(I*=256);)$+=this[u+--w]*I;return I*=128,$>=I&&($-=Math.pow(2,8*c)),$},r.prototype.readInt8=function(u,c){return u=u>>>0,c||oe(u,1,this.length),this[u]&128?(255-this[u]+1)*-1:this[u]},r.prototype.readInt16LE=function(u,c){u=u>>>0,c||oe(u,2,this.length);let d=this[u]|this[u+1]<<8;return d&32768?d|4294901760:d},r.prototype.readInt16BE=function(u,c){u=u>>>0,c||oe(u,2,this.length);let d=this[u+1]|this[u]<<8;return d&32768?d|4294901760:d},r.prototype.readInt32LE=function(u,c){return u=u>>>0,c||oe(u,4,this.length),this[u]|this[u+1]<<8|this[u+2]<<16|this[u+3]<<24},r.prototype.readInt32BE=function(u,c){return u=u>>>0,c||oe(u,4,this.length),this[u]<<24|this[u+1]<<16|this[u+2]<<8|this[u+3]},r.prototype.readBigInt64LE=q(function(u){u=u>>>0,X(u,"offset");let c=this[u],d=this[u+7];(c===void 0||d===void 0)&&we(u,this.length-8);let w=this[u+4]+this[u+5]*2**8+this[u+6]*2**16+(d<<24);return(BigInt(w)<<BigInt(32))+BigInt(c+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24)}),r.prototype.readBigInt64BE=q(function(u){u=u>>>0,X(u,"offset");let c=this[u],d=this[u+7];(c===void 0||d===void 0)&&we(u,this.length-8);let w=(c<<24)+this[++u]*2**16+this[++u]*2**8+this[++u];return(BigInt(w)<<BigInt(32))+BigInt(this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+d)}),r.prototype.readFloatLE=function(u,c){return u=u>>>0,c||oe(u,4,this.length),i.read(this,u,!0,23,4)},r.prototype.readFloatBE=function(u,c){return u=u>>>0,c||oe(u,4,this.length),i.read(this,u,!1,23,4)},r.prototype.readDoubleLE=function(u,c){return u=u>>>0,c||oe(u,8,this.length),i.read(this,u,!0,52,8)},r.prototype.readDoubleBE=function(u,c){return u=u>>>0,c||oe(u,8,this.length),i.read(this,u,!1,52,8)};function _e(u,c,d,w,I,$){if(!r.isBuffer(u))throw new TypeError('"buffer" argument must be a Buffer instance');if(c>I||c<$)throw new RangeError('"value" argument is out of bounds');if(d+w>u.length)throw new RangeError("Index out of range")}r.prototype.writeUintLE=r.prototype.writeUIntLE=function(u,c,d,w){if(u=+u,c=c>>>0,d=d>>>0,!w){let ee=Math.pow(2,8*d)-1;_e(this,u,c,d,ee,0)}let I=1,$=0;for(this[c]=u&255;++$<d&&(I*=256);)this[c+$]=u/I&255;return c+d},r.prototype.writeUintBE=r.prototype.writeUIntBE=function(u,c,d,w){if(u=+u,c=c>>>0,d=d>>>0,!w){let ee=Math.pow(2,8*d)-1;_e(this,u,c,d,ee,0)}let I=d-1,$=1;for(this[c+I]=u&255;--I>=0&&($*=256);)this[c+I]=u/$&255;return c+d},r.prototype.writeUint8=r.prototype.writeUInt8=function(u,c,d){return u=+u,c=c>>>0,d||_e(this,u,c,1,255,0),this[c]=u&255,c+1},r.prototype.writeUint16LE=r.prototype.writeUInt16LE=function(u,c,d){return u=+u,c=c>>>0,d||_e(this,u,c,2,65535,0),this[c]=u&255,this[c+1]=u>>>8,c+2},r.prototype.writeUint16BE=r.prototype.writeUInt16BE=function(u,c,d){return u=+u,c=c>>>0,d||_e(this,u,c,2,65535,0),this[c]=u>>>8,this[c+1]=u&255,c+2},r.prototype.writeUint32LE=r.prototype.writeUInt32LE=function(u,c,d){return u=+u,c=c>>>0,d||_e(this,u,c,4,4294967295,0),this[c+3]=u>>>24,this[c+2]=u>>>16,this[c+1]=u>>>8,this[c]=u&255,c+4},r.prototype.writeUint32BE=r.prototype.writeUInt32BE=function(u,c,d){return u=+u,c=c>>>0,d||_e(this,u,c,4,4294967295,0),this[c]=u>>>24,this[c+1]=u>>>16,this[c+2]=u>>>8,this[c+3]=u&255,c+4};function _(u,c,d,w,I){te(c,w,I,u,d,7);let $=Number(c&BigInt(4294967295));u[d++]=$,$=$>>8,u[d++]=$,$=$>>8,u[d++]=$,$=$>>8,u[d++]=$;let ee=Number(c>>BigInt(32)&BigInt(4294967295));return u[d++]=ee,ee=ee>>8,u[d++]=ee,ee=ee>>8,u[d++]=ee,ee=ee>>8,u[d++]=ee,d}function G(u,c,d,w,I){te(c,w,I,u,d,7);let $=Number(c&BigInt(4294967295));u[d+7]=$,$=$>>8,u[d+6]=$,$=$>>8,u[d+5]=$,$=$>>8,u[d+4]=$;let ee=Number(c>>BigInt(32)&BigInt(4294967295));return u[d+3]=ee,ee=ee>>8,u[d+2]=ee,ee=ee>>8,u[d+1]=ee,ee=ee>>8,u[d]=ee,d+8}r.prototype.writeBigUInt64LE=q(function(u,c=0){return _(this,u,c,BigInt(0),BigInt("0xffffffffffffffff"))}),r.prototype.writeBigUInt64BE=q(function(u,c=0){return G(this,u,c,BigInt(0),BigInt("0xffffffffffffffff"))}),r.prototype.writeIntLE=function(u,c,d,w){if(u=+u,c=c>>>0,!w){let Ie=Math.pow(2,8*d-1);_e(this,u,c,d,Ie-1,-Ie)}let I=0,$=1,ee=0;for(this[c]=u&255;++I<d&&($*=256);)u<0&&ee===0&&this[c+I-1]!==0&&(ee=1),this[c+I]=(u/$>>0)-ee&255;return c+d},r.prototype.writeIntBE=function(u,c,d,w){if(u=+u,c=c>>>0,!w){let Ie=Math.pow(2,8*d-1);_e(this,u,c,d,Ie-1,-Ie)}let I=d-1,$=1,ee=0;for(this[c+I]=u&255;--I>=0&&($*=256);)u<0&&ee===0&&this[c+I+1]!==0&&(ee=1),this[c+I]=(u/$>>0)-ee&255;return c+d},r.prototype.writeInt8=function(u,c,d){return u=+u,c=c>>>0,d||_e(this,u,c,1,127,-128),u<0&&(u=255+u+1),this[c]=u&255,c+1},r.prototype.writeInt16LE=function(u,c,d){return u=+u,c=c>>>0,d||_e(this,u,c,2,32767,-32768),this[c]=u&255,this[c+1]=u>>>8,c+2},r.prototype.writeInt16BE=function(u,c,d){return u=+u,c=c>>>0,d||_e(this,u,c,2,32767,-32768),this[c]=u>>>8,this[c+1]=u&255,c+2},r.prototype.writeInt32LE=function(u,c,d){return u=+u,c=c>>>0,d||_e(this,u,c,4,2147483647,-2147483648),this[c]=u&255,this[c+1]=u>>>8,this[c+2]=u>>>16,this[c+3]=u>>>24,c+4},r.prototype.writeInt32BE=function(u,c,d){return u=+u,c=c>>>0,d||_e(this,u,c,4,2147483647,-2147483648),u<0&&(u=4294967295+u+1),this[c]=u>>>24,this[c+1]=u>>>16,this[c+2]=u>>>8,this[c+3]=u&255,c+4},r.prototype.writeBigInt64LE=q(function(u,c=0){return _(this,u,c,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),r.prototype.writeBigInt64BE=q(function(u,c=0){return G(this,u,c,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function de(u,c,d,w,I,$){if(d+w>u.length)throw new RangeError("Index out of range");if(d<0)throw new RangeError("Index out of range")}function ve(u,c,d,w,I){return c=+c,d=d>>>0,I||de(u,c,d,4),i.write(u,c,d,w,23,4),d+4}r.prototype.writeFloatLE=function(u,c,d){return ve(this,u,c,!0,d)},r.prototype.writeFloatBE=function(u,c,d){return ve(this,u,c,!1,d)};function ue(u,c,d,w,I){return c=+c,d=d>>>0,I||de(u,c,d,8),i.write(u,c,d,w,52,8),d+8}r.prototype.writeDoubleLE=function(u,c,d){return ue(this,u,c,!0,d)},r.prototype.writeDoubleBE=function(u,c,d){return ue(this,u,c,!1,d)},r.prototype.copy=function(u,c,d,w){if(!r.isBuffer(u))throw new TypeError("argument should be a Buffer");if(d||(d=0),!w&&w!==0&&(w=this.length),c>=u.length&&(c=u.length),c||(c=0),w>0&&w<d&&(w=d),w===d||u.length===0||this.length===0)return 0;if(c<0)throw new RangeError("targetStart out of bounds");if(d<0||d>=this.length)throw new RangeError("Index out of range");if(w<0)throw new RangeError("sourceEnd out of bounds");w>this.length&&(w=this.length),u.length-c<w-d&&(w=u.length-c+d);let I=w-d;return this===u&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(c,d,w):Uint8Array.prototype.set.call(u,this.subarray(d,w),c),I},r.prototype.fill=function(u,c,d,w){if(typeof u=="string"){if(typeof c=="string"?(w=c,c=0,d=this.length):typeof d=="string"&&(w=d,d=this.length),w!==void 0&&typeof w!="string")throw new TypeError("encoding must be a string");if(typeof w=="string"&&!r.isEncoding(w))throw new TypeError("Unknown encoding: "+w);if(u.length===1){let $=u.charCodeAt(0);(w==="utf8"&&$<128||w==="latin1")&&(u=$)}}else typeof u=="number"?u=u&255:typeof u=="boolean"&&(u=Number(u));if(c<0||this.length<c||this.length<d)throw new RangeError("Out of range index");if(d<=c)return this;c=c>>>0,d=d===void 0?this.length:d>>>0,u||(u=0);let I;if(typeof u=="number")for(I=c;I<d;++I)this[I]=u;else{let $=r.isBuffer(u)?u:r.from(u,w),ee=$.length;if(ee===0)throw new TypeError('The value "'+u+'" is invalid for argument "value"');for(I=0;I<d-c;++I)this[I+c]=$[I%ee]}return this};let x={};function E(u,c,d){x[u]=class extends d{constructor(){super(),Object.defineProperty(this,"message",{value:c.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${u}]`,this.stack,delete this.name}get code(){return u}set code(w){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:w,writable:!0})}toString(){return`${this.name} [${u}]: ${this.message}`}}}E("ERR_BUFFER_OUT_OF_BOUNDS",function(u){return u?`${u} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),E("ERR_INVALID_ARG_TYPE",function(u,c){return`The "${u}" argument must be of type number. Received type ${typeof c}`},TypeError),E("ERR_OUT_OF_RANGE",function(u,c,d){let w=`The value of "${u}" is out of range.`,I=d;return Number.isInteger(d)&&Math.abs(d)>2**32?I=Y(String(d)):typeof d=="bigint"&&(I=String(d),(d>BigInt(2)**BigInt(32)||d<-(BigInt(2)**BigInt(32)))&&(I=Y(I)),I+="n"),w+=` It must be ${c}. Received ${I}`,w},RangeError);function Y(u){let c="",d=u.length,w=u[0]==="-"?1:0;for(;d>=w+4;d-=3)c=`_${u.slice(d-3,d)}${c}`;return`${u.slice(0,d)}${c}`}function fe(u,c,d){X(c,"offset"),(u[c]===void 0||u[c+d]===void 0)&&we(c,u.length-(d+1))}function te(u,c,d,w,I,$){if(u>d||u<c){let ee=typeof c=="bigint"?"n":"",Ie;throw c===0||c===BigInt(0)?Ie=`>= 0${ee} and < 2${ee} ** ${($+1)*8}${ee}`:Ie=`>= -(2${ee} ** ${($+1)*8-1}${ee}) and < 2 ** ${($+1)*8-1}${ee}`,new x.ERR_OUT_OF_RANGE("value",Ie,u)}fe(w,I,$)}function X(u,c){if(typeof u!="number")throw new x.ERR_INVALID_ARG_TYPE(c,"number",u)}function we(u,c,d){throw Math.floor(u)!==u?(X(u,d),new x.ERR_OUT_OF_RANGE("offset","an integer",u)):c<0?new x.ERR_BUFFER_OUT_OF_BOUNDS:new x.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${c}`,u)}let ge=/[^+/0-9A-Za-z-_]/g;function P(u){if(u=u.split("=")[0],u=u.trim().replace(ge,""),u.length<2)return"";for(;u.length%4!==0;)u=u+"=";return u}function F(u,c){c=c||1/0;let d,w=u.length,I=null,$=[];for(let ee=0;ee<w;++ee){if(d=u.charCodeAt(ee),d>55295&&d<57344){if(!I){if(d>56319){(c-=3)>-1&&$.push(239,191,189);continue}else if(ee+1===w){(c-=3)>-1&&$.push(239,191,189);continue}I=d;continue}if(d<56320){(c-=3)>-1&&$.push(239,191,189),I=d;continue}d=(I-55296<<10|d-56320)+65536}else I&&(c-=3)>-1&&$.push(239,191,189);if(I=null,d<128){if((c-=1)<0)break;$.push(d)}else if(d<2048){if((c-=2)<0)break;$.push(d>>6|192,d&63|128)}else if(d<65536){if((c-=3)<0)break;$.push(d>>12|224,d>>6&63|128,d&63|128)}else if(d<1114112){if((c-=4)<0)break;$.push(d>>18|240,d>>12&63|128,d>>6&63|128,d&63|128)}else throw new Error("Invalid code point")}return $}function W(u){let c=[];for(let d=0;d<u.length;++d)c.push(u.charCodeAt(d)&255);return c}function ie(u,c){let d,w,I,$=[];for(let ee=0;ee<u.length&&!((c-=2)<0);++ee)d=u.charCodeAt(ee),w=d>>8,I=d%256,$.push(I),$.push(w);return $}function Z(u){return e.toByteArray(P(u))}function L(u,c,d,w){let I;for(I=0;I<w&&!(I+d>=c.length||I>=u.length);++I)c[I+d]=u[I];return I}function K(u,c){return u instanceof c||u!=null&&u.constructor!=null&&u.constructor.name!=null&&u.constructor.name===c.name}function B(u){return u!==u}let j=function(){let u="0123456789abcdef",c=new Array(256);for(let d=0;d<16;++d){let w=d*16;for(let I=0;I<16;++I)c[w+I]=u[d]+u[I]}return c}();function q(u){return typeof BigInt>"u"?ce:u}function ce(){throw new Error("BigInt not supported")}return Bt}var Zt,Jn,sr,Zn,Bt,Xn,bt,mr,bo,yo,Je=Qe(()=>{ae(),he(),le(),Zt={},Jn=!1,sr={},Zn=!1,Bt={},Xn=!1,bt=Ll(),bt.Buffer,bt.SlowBuffer,bt.INSPECT_MAX_BYTES,bt.kMaxLength,mr=bt.Buffer,bo=bt.INSPECT_MAX_BYTES,yo=bt.kMaxLength}),he=Qe(()=>{Je()}),Ul=be(e=>{ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0});var i=class{constructor(t){this.aliasToTopic={},this.max=t}put(t,a){return a===0||a>this.max?!1:(this.aliasToTopic[a]=t,this.length=Object.keys(this.aliasToTopic).length,!0)}getTopicByAlias(t){return this.aliasToTopic[t]}clear(){this.aliasToTopic={}}};e.default=i}),ze=be((e,i)=>{ae(),he(),le(),i.exports={ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,a){return t.includes(a)},ArrayPrototypeIndexOf(t,a){return t.indexOf(a)},ArrayPrototypeJoin(t,a){return t.join(a)},ArrayPrototypeMap(t,a){return t.map(a)},ArrayPrototypePop(t,a){return t.pop(a)},ArrayPrototypePush(t,a){return t.push(a)},ArrayPrototypeSlice(t,a,h){return t.slice(a,h)},Error,FunctionPrototypeCall(t,a,...h){return t.call(a,...h)},FunctionPrototypeSymbolHasInstance(t,a){return Function.prototype[Symbol.hasInstance].call(t,a)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,a){return Object.defineProperties(t,a)},ObjectDefineProperty(t,a,h){return Object.defineProperty(t,a,h)},ObjectGetOwnPropertyDescriptor(t,a){return Object.getOwnPropertyDescriptor(t,a)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,a){return Object.setPrototypeOf(t,a)},Promise,PromisePrototypeCatch(t,a){return t.catch(a)},PromisePrototypeThen(t,a,h){return t.then(a,h)},PromiseReject(t){return Promise.reject(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,a){return t.test(a)},SafeSet:Set,String,StringPrototypeSlice(t,a,h){return t.slice(a,h)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,TypedArrayPrototypeSet(t,a,h){return t.set(a,h)},Uint8Array}}),yt=be((e,i)=>{ae(),he(),le();var t=(Je(),Ne(Ge)),a=Object.getPrototypeOf(async function(){}).constructor,h=globalThis.Blob||t.Blob,n=typeof h<"u"?function(s){return s instanceof h}:function(s){return!1},r=class extends Error{constructor(s){if(!Array.isArray(s))throw new TypeError(`Expected input to be an Array, got ${typeof s}`);let o="";for(let l=0;l<s.length;l++)o+=` ${s[l].stack}
|
|
3
|
+
`;super(o),this.name="AggregateError",this.errors=s}};i.exports={AggregateError:r,kEmptyObject:Object.freeze({}),once(s){let o=!1;return function(...l){o||(o=!0,s.apply(this,l))}},createDeferredPromise:function(){let s,o;return{promise:new Promise((l,f)=>{s=l,o=f}),resolve:s,reject:o}},promisify(s){return new Promise((o,l)=>{s((f,...p)=>f?l(f):o(...p))})},debuglog(){return function(){}},format(s,...o){return s.replace(/%([sdifj])/g,function(...[l,f]){let p=o.shift();return f==="f"?p.toFixed(6):f==="j"?JSON.stringify(p):f==="s"&&typeof p=="object"?`${p.constructor!==Object?p.constructor.name:""} {}`.trim():p.toString()})},inspect(s){switch(typeof s){case"string":if(s.includes("'"))if(s.includes('"')){if(!s.includes("`")&&!s.includes("${"))return`\`${s}\``}else return`"${s}"`;return`'${s}'`;case"number":return isNaN(s)?"NaN":Object.is(s,-0)?String(s):s;case"bigint":return`${String(s)}n`;case"boolean":case"undefined":return String(s);case"object":return"{}"}},types:{isAsyncFunction(s){return s instanceof a},isArrayBufferView(s){return ArrayBuffer.isView(s)}},isBlob:n},i.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),ei=be((e,i)=>{ae(),he(),le();var{AbortController:t,AbortSignal:a}=typeof self<"u"?self:typeof window<"u"?window:void 0;i.exports=t,i.exports.AbortSignal=a,i.exports.default=t}),tt=be((e,i)=>{ae(),he(),le();var{format:t,inspect:a,AggregateError:h}=yt(),n=globalThis.AggregateError||h,r=Symbol("kIsNodeError"),s=["string","function","number","object","Function","Object","boolean","bigint","symbol"],o=/^([A-Z][a-z0-9]*)+$/,l="__node_internal_",f={};function p(k,v){if(!k)throw new f.ERR_INTERNAL_ASSERTION(v)}function g(k){let v="",U=k.length,D=k[0]==="-"?1:0;for(;U>=D+4;U-=3)v=`_${k.slice(U-3,U)}${v}`;return`${k.slice(0,U)}${v}`}function m(k,v,U){if(typeof v=="function")return p(v.length<=U.length,`Code: ${k}; The provided arguments length (${U.length}) does not match the required ones (${v.length}).`),v(...U);let D=(v.match(/%[dfijoOs]/g)||[]).length;return p(D===U.length,`Code: ${k}; The provided arguments length (${U.length}) does not match the required ones (${D}).`),U.length===0?v:t(v,...U)}function b(k,v,U){U||(U=Error);class D extends U{constructor(...T){super(m(k,v,T))}toString(){return`${this.name} [${k}]: ${this.message}`}}Object.defineProperties(D.prototype,{name:{value:U.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${k}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),D.prototype.code=k,D.prototype[r]=!0,f[k]=D}function y(k){let v=l+k.name;return Object.defineProperty(k,"name",{value:v}),k}function A(k,v){if(k&&v&&k!==v){if(Array.isArray(v.errors))return v.errors.push(k),v;let U=new n([v,k],v.message);return U.code=v.code,U}return k||v}var N=class extends Error{constructor(k="The operation was aborted",v=void 0){if(v!==void 0&&typeof v!="object")throw new f.ERR_INVALID_ARG_TYPE("options","Object",v);super(k,v),this.code="ABORT_ERR",this.name="AbortError"}};b("ERR_ASSERTION","%s",Error),b("ERR_INVALID_ARG_TYPE",(k,v,U)=>{p(typeof k=="string","'name' must be a string"),Array.isArray(v)||(v=[v]);let D="The ";k.endsWith(" argument")?D+=`${k} `:D+=`"${k}" ${k.includes(".")?"property":"argument"} `,D+="must be ";let C=[],T=[],M=[];for(let J of v)p(typeof J=="string","All expected entries have to be of type string"),s.includes(J)?C.push(J.toLowerCase()):o.test(J)?T.push(J):(p(J!=="object",'The value "object" should be written as "Object"'),M.push(J));if(T.length>0){let J=C.indexOf("object");J!==-1&&(C.splice(C,J,1),T.push("Object"))}if(C.length>0){switch(C.length){case 1:D+=`of type ${C[0]}`;break;case 2:D+=`one of type ${C[0]} or ${C[1]}`;break;default:{let J=C.pop();D+=`one of type ${C.join(", ")}, or ${J}`}}(T.length>0||M.length>0)&&(D+=" or ")}if(T.length>0){switch(T.length){case 1:D+=`an instance of ${T[0]}`;break;case 2:D+=`an instance of ${T[0]} or ${T[1]}`;break;default:{let J=T.pop();D+=`an instance of ${T.join(", ")}, or ${J}`}}M.length>0&&(D+=" or ")}switch(M.length){case 0:break;case 1:M[0].toLowerCase()!==M[0]&&(D+="an "),D+=`${M[0]}`;break;case 2:D+=`one of ${M[0]} or ${M[1]}`;break;default:{let J=M.pop();D+=`one of ${M.join(", ")}, or ${J}`}}if(U==null)D+=`. Received ${U}`;else if(typeof U=="function"&&U.name)D+=`. Received function ${U.name}`;else if(typeof U=="object"){var V;if((V=U.constructor)!==null&&V!==void 0&&V.name)D+=`. Received an instance of ${U.constructor.name}`;else{let J=a(U,{depth:-1});D+=`. Received ${J}`}}else{let J=a(U,{colors:!1});J.length>25&&(J=`${J.slice(0,25)}...`),D+=`. Received type ${typeof U} (${J})`}return D},TypeError),b("ERR_INVALID_ARG_VALUE",(k,v,U="is invalid")=>{let D=a(v);return D.length>128&&(D=D.slice(0,128)+"..."),`The ${k.includes(".")?"property":"argument"} '${k}' ${U}. Received ${D}`},TypeError),b("ERR_INVALID_RETURN_VALUE",(k,v,U)=>{var D;let C=U!=null&&(D=U.constructor)!==null&&D!==void 0&&D.name?`instance of ${U.constructor.name}`:`type ${typeof U}`;return`Expected ${k} to be returned from the "${v}" function but got ${C}.`},TypeError),b("ERR_MISSING_ARGS",(...k)=>{p(k.length>0,"At least one arg needs to be specified");let v,U=k.length;switch(k=(Array.isArray(k)?k:[k]).map(D=>`"${D}"`).join(" or "),U){case 1:v+=`The ${k[0]} argument`;break;case 2:v+=`The ${k[0]} and ${k[1]} arguments`;break;default:{let D=k.pop();v+=`The ${k.join(", ")}, and ${D} arguments`}break}return`${v} must be specified`},TypeError),b("ERR_OUT_OF_RANGE",(k,v,U)=>{p(v,'Missing "range" argument');let D;return Number.isInteger(U)&&Math.abs(U)>2**32?D=g(String(U)):typeof U=="bigint"?(D=String(U),(U>2n**32n||U<-(2n**32n))&&(D=g(D)),D+="n"):D=a(U),`The value of "${k}" is out of range. It must be ${v}. Received ${D}`},RangeError),b("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),b("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),b("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),b("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),b("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),b("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),b("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),b("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),b("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),b("ERR_STREAM_WRITE_AFTER_END","write after end",Error),b("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),i.exports={AbortError:N,aggregateTwoErrors:y(A),hideStackFrames:y,codes:f}}),br=be((e,i)=>{ae(),he(),le();var{ArrayIsArray:t,ArrayPrototypeIncludes:a,ArrayPrototypeJoin:h,ArrayPrototypeMap:n,NumberIsInteger:r,NumberIsNaN:s,NumberMAX_SAFE_INTEGER:o,NumberMIN_SAFE_INTEGER:l,NumberParseInt:f,ObjectPrototypeHasOwnProperty:p,RegExpPrototypeExec:g,String:m,StringPrototypeToUpperCase:b,StringPrototypeTrim:y}=ze(),{hideStackFrames:A,codes:{ERR_SOCKET_BAD_PORT:N,ERR_INVALID_ARG_TYPE:k,ERR_INVALID_ARG_VALUE:v,ERR_OUT_OF_RANGE:U,ERR_UNKNOWN_SIGNAL:D}}=tt(),{normalizeEncoding:C}=yt(),{isAsyncFunction:T,isArrayBufferView:M}=yt().types,V={};function J(L){return L===(L|0)}function ne(L){return L===L>>>0}var S=/^[0-7]+$/,H="must be a 32-bit unsigned integer or an octal string";function re(L,K,B){if(typeof L>"u"&&(L=B),typeof L=="string"){if(g(S,L)===null)throw new v(K,L,H);L=f(L,8)}return se(L,K),L}var Q=A((L,K,B=l,j=o)=>{if(typeof L!="number")throw new k(K,"number",L);if(!r(L))throw new U(K,"an integer",L);if(L<B||L>j)throw new U(K,`>= ${B} && <= ${j}`,L)}),me=A((L,K,B=-2147483648,j=2147483647)=>{if(typeof L!="number")throw new k(K,"number",L);if(!r(L))throw new U(K,"an integer",L);if(L<B||L>j)throw new U(K,`>= ${B} && <= ${j}`,L)}),se=A((L,K,B=!1)=>{if(typeof L!="number")throw new k(K,"number",L);if(!r(L))throw new U(K,"an integer",L);let j=B?1:0,q=4294967295;if(L<j||L>q)throw new U(K,`>= ${j} && <= ${q}`,L)});function z(L,K){if(typeof L!="string")throw new k(K,"string",L)}function ye(L,K,B=void 0,j){if(typeof L!="number")throw new k(K,"number",L);if(B!=null&&L<B||j!=null&&L>j||(B!=null||j!=null)&&s(L))throw new U(K,`${B!=null?`>= ${B}`:""}${B!=null&&j!=null?" && ":""}${j!=null?`<= ${j}`:""}`,L)}var oe=A((L,K,B)=>{if(!a(B,L)){let j="must be one of: "+h(n(B,q=>typeof q=="string"?`'${q}'`:m(q)),", ");throw new v(K,L,j)}});function _e(L,K){if(typeof L!="boolean")throw new k(K,"boolean",L)}function _(L,K,B){return L==null||!p(L,K)?B:L[K]}var G=A((L,K,B=null)=>{let j=_(B,"allowArray",!1),q=_(B,"allowFunction",!1);if(!_(B,"nullable",!1)&&L===null||!j&&t(L)||typeof L!="object"&&(!q||typeof L!="function"))throw new k(K,"Object",L)}),de=A((L,K)=>{if(L!=null&&typeof L!="object"&&typeof L!="function")throw new k(K,"a dictionary",L)}),ve=A((L,K,B=0)=>{if(!t(L))throw new k(K,"Array",L);if(L.length<B){let j=`must be longer than ${B}`;throw new v(K,L,j)}});function ue(L,K){ve(L,K);for(let B=0;B<L.length;B++)z(L[B],`${K}[${B}]`)}function x(L,K){ve(L,K);for(let B=0;B<L.length;B++)_e(L[B],`${K}[${B}]`)}function E(L,K="signal"){if(z(L,K),V[L]===void 0)throw V[b(L)]!==void 0?new D(L+" (signals must use all capital letters)"):new D(L)}var Y=A((L,K="buffer")=>{if(!M(L))throw new k(K,["Buffer","TypedArray","DataView"],L)});function fe(L,K){let B=C(K),j=L.length;if(B==="hex"&&j%2!==0)throw new v("encoding",K,`is invalid for data of length ${j}`)}function te(L,K="Port",B=!0){if(typeof L!="number"&&typeof L!="string"||typeof L=="string"&&y(L).length===0||+L!==+L>>>0||L>65535||L===0&&!B)throw new N(K,L,B);return L|0}var X=A((L,K)=>{if(L!==void 0&&(L===null||typeof L!="object"||!("aborted"in L)))throw new k(K,"AbortSignal",L)}),we=A((L,K)=>{if(typeof L!="function")throw new k(K,"Function",L)}),ge=A((L,K)=>{if(typeof L!="function"||T(L))throw new k(K,"Function",L)}),P=A((L,K)=>{if(L!==void 0)throw new k(K,"undefined",L)});function F(L,K,B){if(!a(B,L))throw new k(K,`('${h(B,"|")}')`,L)}var W=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function ie(L,K){if(typeof L>"u"||!g(W,L))throw new v(K,L,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function Z(L){if(typeof L=="string")return ie(L,"hints"),L;if(t(L)){let K=L.length,B="";if(K===0)return B;for(let j=0;j<K;j++){let q=L[j];ie(q,"hints"),B+=q,j!==K-1&&(B+=", ")}return B}throw new v("hints",L,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}i.exports={isInt32:J,isUint32:ne,parseFileMode:re,validateArray:ve,validateStringArray:ue,validateBooleanArray:x,validateBoolean:_e,validateBuffer:Y,validateDictionary:de,validateEncoding:fe,validateFunction:we,validateInt32:me,validateInteger:Q,validateNumber:ye,validateObject:G,validateOneOf:oe,validatePlainFunction:ge,validatePort:te,validateSignalName:E,validateString:z,validateUint32:se,validateUndefined:P,validateUnion:F,validateAbortSignal:X,validateLinkHeaderValue:Z}}),Ut=be((e,i)=>{ae(),he(),le();var t=i.exports={},a,h;function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?a=setTimeout:a=n}catch{a=n}try{typeof clearTimeout=="function"?h=clearTimeout:h=r}catch{h=r}})();function s(N){if(a===setTimeout)return setTimeout(N,0);if((a===n||!a)&&setTimeout)return a=setTimeout,setTimeout(N,0);try{return a(N,0)}catch{try{return a.call(null,N,0)}catch{return a.call(this,N,0)}}}function o(N){if(h===clearTimeout)return clearTimeout(N);if((h===r||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(N);try{return h(N)}catch{try{return h.call(null,N)}catch{return h.call(this,N)}}}var l=[],f=!1,p,g=-1;function m(){!f||!p||(f=!1,p.length?l=p.concat(l):g=-1,l.length&&b())}function b(){if(!f){var N=s(m);f=!0;for(var k=l.length;k;){for(p=l,l=[];++g<k;)p&&p[g].run();g=-1,k=l.length}p=null,f=!1,o(N)}}t.nextTick=function(N){var k=new Array(arguments.length-1);if(arguments.length>1)for(var v=1;v<arguments.length;v++)k[v-1]=arguments[v];l.push(new y(N,k)),l.length===1&&!f&&s(b)};function y(N,k){this.fun=N,this.array=k}y.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function A(){}t.on=A,t.addListener=A,t.once=A,t.off=A,t.removeListener=A,t.removeAllListeners=A,t.emit=A,t.prependListener=A,t.prependOnceListener=A,t.listeners=function(N){return[]},t.binding=function(N){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(N){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}}),wt=be((e,i)=>{ae(),he(),le();var{Symbol:t,SymbolAsyncIterator:a,SymbolIterator:h,SymbolFor:n}=ze(),r=t("kDestroyed"),s=t("kIsErrored"),o=t("kIsReadable"),l=t("kIsDisturbed"),f=n("nodejs.webstream.isClosedPromise"),p=n("nodejs.webstream.controllerErrorFunction");function g(_,G=!1){var de;return!!(_&&typeof _.pipe=="function"&&typeof _.on=="function"&&(!G||typeof _.pause=="function"&&typeof _.resume=="function")&&(!_._writableState||((de=_._readableState)===null||de===void 0?void 0:de.readable)!==!1)&&(!_._writableState||_._readableState))}function m(_){var G;return!!(_&&typeof _.write=="function"&&typeof _.on=="function"&&(!_._readableState||((G=_._writableState)===null||G===void 0?void 0:G.writable)!==!1))}function b(_){return!!(_&&typeof _.pipe=="function"&&_._readableState&&typeof _.on=="function"&&typeof _.write=="function")}function y(_){return _&&(_._readableState||_._writableState||typeof _.write=="function"&&typeof _.on=="function"||typeof _.pipe=="function"&&typeof _.on=="function")}function A(_){return!!(_&&!y(_)&&typeof _.pipeThrough=="function"&&typeof _.getReader=="function"&&typeof _.cancel=="function")}function N(_){return!!(_&&!y(_)&&typeof _.getWriter=="function"&&typeof _.abort=="function")}function k(_){return!!(_&&!y(_)&&typeof _.readable=="object"&&typeof _.writable=="object")}function v(_){return A(_)||N(_)||k(_)}function U(_,G){return _==null?!1:G===!0?typeof _[a]=="function":G===!1?typeof _[h]=="function":typeof _[a]=="function"||typeof _[h]=="function"}function D(_){if(!y(_))return null;let G=_._writableState,de=_._readableState,ve=G||de;return!!(_.destroyed||_[r]||ve!=null&&ve.destroyed)}function C(_){if(!m(_))return null;if(_.writableEnded===!0)return!0;let G=_._writableState;return G!=null&&G.errored?!1:typeof(G==null?void 0:G.ended)!="boolean"?null:G.ended}function T(_,G){if(!m(_))return null;if(_.writableFinished===!0)return!0;let de=_._writableState;return de!=null&&de.errored?!1:typeof(de==null?void 0:de.finished)!="boolean"?null:!!(de.finished||G===!1&&de.ended===!0&&de.length===0)}function M(_){if(!g(_))return null;if(_.readableEnded===!0)return!0;let G=_._readableState;return!G||G.errored?!1:typeof(G==null?void 0:G.ended)!="boolean"?null:G.ended}function V(_,G){if(!g(_))return null;let de=_._readableState;return de!=null&&de.errored?!1:typeof(de==null?void 0:de.endEmitted)!="boolean"?null:!!(de.endEmitted||G===!1&&de.ended===!0&&de.length===0)}function J(_){return _&&_[o]!=null?_[o]:typeof(_==null?void 0:_.readable)!="boolean"?null:D(_)?!1:g(_)&&_.readable&&!V(_)}function ne(_){return typeof(_==null?void 0:_.writable)!="boolean"?null:D(_)?!1:m(_)&&_.writable&&!C(_)}function S(_,G){return y(_)?D(_)?!0:!((G==null?void 0:G.readable)!==!1&&J(_)||(G==null?void 0:G.writable)!==!1&&ne(_)):null}function H(_){var G,de;return y(_)?_.writableErrored?_.writableErrored:(G=(de=_._writableState)===null||de===void 0?void 0:de.errored)!==null&&G!==void 0?G:null:null}function re(_){var G,de;return y(_)?_.readableErrored?_.readableErrored:(G=(de=_._readableState)===null||de===void 0?void 0:de.errored)!==null&&G!==void 0?G:null:null}function Q(_){if(!y(_))return null;if(typeof _.closed=="boolean")return _.closed;let G=_._writableState,de=_._readableState;return typeof(G==null?void 0:G.closed)=="boolean"||typeof(de==null?void 0:de.closed)=="boolean"?(G==null?void 0:G.closed)||(de==null?void 0:de.closed):typeof _._closed=="boolean"&&me(_)?_._closed:null}function me(_){return typeof _._closed=="boolean"&&typeof _._defaultKeepAlive=="boolean"&&typeof _._removedConnection=="boolean"&&typeof _._removedContLen=="boolean"}function se(_){return typeof _._sent100=="boolean"&&me(_)}function z(_){var G;return typeof _._consuming=="boolean"&&typeof _._dumped=="boolean"&&((G=_.req)===null||G===void 0?void 0:G.upgradeOrConnect)===void 0}function ye(_){if(!y(_))return null;let G=_._writableState,de=_._readableState,ve=G||de;return!ve&&se(_)||!!(ve&&ve.autoDestroy&&ve.emitClose&&ve.closed===!1)}function oe(_){var G;return!!(_&&((G=_[l])!==null&&G!==void 0?G:_.readableDidRead||_.readableAborted))}function _e(_){var G,de,ve,ue,x,E,Y,fe,te,X;return!!(_&&((G=(de=(ve=(ue=(x=(E=_[s])!==null&&E!==void 0?E:_.readableErrored)!==null&&x!==void 0?x:_.writableErrored)!==null&&ue!==void 0?ue:(Y=_._readableState)===null||Y===void 0?void 0:Y.errorEmitted)!==null&&ve!==void 0?ve:(fe=_._writableState)===null||fe===void 0?void 0:fe.errorEmitted)!==null&&de!==void 0?de:(te=_._readableState)===null||te===void 0?void 0:te.errored)!==null&&G!==void 0?G:!((X=_._writableState)===null||X===void 0)&&X.errored))}i.exports={kDestroyed:r,isDisturbed:oe,kIsDisturbed:l,isErrored:_e,kIsErrored:s,isReadable:J,kIsReadable:o,kIsClosedPromise:f,kControllerErrorFunction:p,isClosed:Q,isDestroyed:D,isDuplexNodeStream:b,isFinished:S,isIterable:U,isReadableNodeStream:g,isReadableStream:A,isReadableEnded:M,isReadableFinished:V,isReadableErrored:re,isNodeStream:y,isWebStream:v,isWritable:ne,isWritableNodeStream:m,isWritableStream:N,isWritableEnded:C,isWritableFinished:T,isWritableErrored:H,isServerRequest:z,isServerResponse:se,willEmitClose:ye,isTransformStream:k}}),Pt=be((e,i)=>{ae(),he(),le();var t=Ut(),{AbortError:a,codes:h}=tt(),{ERR_INVALID_ARG_TYPE:n,ERR_STREAM_PREMATURE_CLOSE:r}=h,{kEmptyObject:s,once:o}=yt(),{validateAbortSignal:l,validateFunction:f,validateObject:p,validateBoolean:g}=br(),{Promise:m,PromisePrototypeThen:b}=ze(),{isClosed:y,isReadable:A,isReadableNodeStream:N,isReadableStream:k,isReadableFinished:v,isReadableErrored:U,isWritable:D,isWritableNodeStream:C,isWritableStream:T,isWritableFinished:M,isWritableErrored:V,isNodeStream:J,willEmitClose:ne,kIsClosedPromise:S}=wt();function H(z){return z.setHeader&&typeof z.abort=="function"}var re=()=>{};function Q(z,ye,oe){var _e,_;if(arguments.length===2?(oe=ye,ye=s):ye==null?ye=s:p(ye,"options"),f(oe,"callback"),l(ye.signal,"options.signal"),oe=o(oe),k(z)||T(z))return me(z,ye,oe);if(!J(z))throw new n("stream",["ReadableStream","WritableStream","Stream"],z);let G=(_e=ye.readable)!==null&&_e!==void 0?_e:N(z),de=(_=ye.writable)!==null&&_!==void 0?_:C(z),ve=z._writableState,ue=z._readableState,x=()=>{z.writable||fe()},E=ne(z)&&N(z)===G&&C(z)===de,Y=M(z,!1),fe=()=>{Y=!0,z.destroyed&&(E=!1),!(E&&(!z.readable||G))&&(!G||te)&&oe.call(z)},te=v(z,!1),X=()=>{te=!0,z.destroyed&&(E=!1),!(E&&(!z.writable||de))&&(!de||Y)&&oe.call(z)},we=Z=>{oe.call(z,Z)},ge=y(z),P=()=>{ge=!0;let Z=V(z)||U(z);if(Z&&typeof Z!="boolean")return oe.call(z,Z);if(G&&!te&&N(z,!0)&&!v(z,!1))return oe.call(z,new r);if(de&&!Y&&!M(z,!1))return oe.call(z,new r);oe.call(z)},F=()=>{ge=!0;let Z=V(z)||U(z);if(Z&&typeof Z!="boolean")return oe.call(z,Z);oe.call(z)},W=()=>{z.req.on("finish",fe)};H(z)?(z.on("complete",fe),E||z.on("abort",P),z.req?W():z.on("request",W)):de&&!ve&&(z.on("end",x),z.on("close",x)),!E&&typeof z.aborted=="boolean"&&z.on("aborted",P),z.on("end",X),z.on("finish",fe),ye.error!==!1&&z.on("error",we),z.on("close",P),ge?t.nextTick(P):ve!=null&&ve.errorEmitted||ue!=null&&ue.errorEmitted?E||t.nextTick(F):(!G&&(!E||A(z))&&(Y||D(z)===!1)||!de&&(!E||D(z))&&(te||A(z)===!1)||ue&&z.req&&z.aborted)&&t.nextTick(F);let ie=()=>{oe=re,z.removeListener("aborted",P),z.removeListener("complete",fe),z.removeListener("abort",P),z.removeListener("request",W),z.req&&z.req.removeListener("finish",fe),z.removeListener("end",x),z.removeListener("close",x),z.removeListener("finish",fe),z.removeListener("end",X),z.removeListener("error",we),z.removeListener("close",P)};if(ye.signal&&!ge){let Z=()=>{let L=oe;ie(),L.call(z,new a(void 0,{cause:ye.signal.reason}))};if(ye.signal.aborted)t.nextTick(Z);else{let L=oe;oe=o((...K)=>{ye.signal.removeEventListener("abort",Z),L.apply(z,K)}),ye.signal.addEventListener("abort",Z)}}return ie}function me(z,ye,oe){let _e=!1,_=re;if(ye.signal)if(_=()=>{_e=!0,oe.call(z,new a(void 0,{cause:ye.signal.reason}))},ye.signal.aborted)t.nextTick(_);else{let de=oe;oe=o((...ve)=>{ye.signal.removeEventListener("abort",_),de.apply(z,ve)}),ye.signal.addEventListener("abort",_)}let G=(...de)=>{_e||t.nextTick(()=>oe.apply(z,de))};return b(z[S].promise,G,G),re}function se(z,ye){var oe;let _e=!1;return ye===null&&(ye=s),(oe=ye)!==null&&oe!==void 0&&oe.cleanup&&(g(ye.cleanup,"cleanup"),_e=ye.cleanup),new m((_,G)=>{let de=Q(z,ye,ve=>{_e&&de(),ve?G(ve):_()})})}i.exports=Q,i.exports.finished=se}),Xt=be((e,i)=>{ae(),he(),le();var t=Ut(),{aggregateTwoErrors:a,codes:{ERR_MULTIPLE_CALLBACK:h},AbortError:n}=tt(),{Symbol:r}=ze(),{kDestroyed:s,isDestroyed:o,isFinished:l,isServerRequest:f}=wt(),p=r("kDestroy"),g=r("kConstruct");function m(S,H,re){S&&(S.stack,H&&!H.errored&&(H.errored=S),re&&!re.errored&&(re.errored=S))}function b(S,H){let re=this._readableState,Q=this._writableState,me=Q||re;return Q!=null&&Q.destroyed||re!=null&&re.destroyed?(typeof H=="function"&&H(),this):(m(S,Q,re),Q&&(Q.destroyed=!0),re&&(re.destroyed=!0),me.constructed?y(this,S,H):this.once(p,function(se){y(this,a(se,S),H)}),this)}function y(S,H,re){let Q=!1;function me(se){if(Q)return;Q=!0;let z=S._readableState,ye=S._writableState;m(se,ye,z),ye&&(ye.closed=!0),z&&(z.closed=!0),typeof re=="function"&&re(se),se?t.nextTick(A,S,se):t.nextTick(N,S)}try{S._destroy(H||null,me)}catch(se){me(se)}}function A(S,H){k(S,H),N(S)}function N(S){let H=S._readableState,re=S._writableState;re&&(re.closeEmitted=!0),H&&(H.closeEmitted=!0),(re!=null&&re.emitClose||H!=null&&H.emitClose)&&S.emit("close")}function k(S,H){let re=S._readableState,Q=S._writableState;Q!=null&&Q.errorEmitted||re!=null&&re.errorEmitted||(Q&&(Q.errorEmitted=!0),re&&(re.errorEmitted=!0),S.emit("error",H))}function v(){let S=this._readableState,H=this._writableState;S&&(S.constructed=!0,S.closed=!1,S.closeEmitted=!1,S.destroyed=!1,S.errored=null,S.errorEmitted=!1,S.reading=!1,S.ended=S.readable===!1,S.endEmitted=S.readable===!1),H&&(H.constructed=!0,H.destroyed=!1,H.closed=!1,H.closeEmitted=!1,H.errored=null,H.errorEmitted=!1,H.finalCalled=!1,H.prefinished=!1,H.ended=H.writable===!1,H.ending=H.writable===!1,H.finished=H.writable===!1)}function U(S,H,re){let Q=S._readableState,me=S._writableState;if(me!=null&&me.destroyed||Q!=null&&Q.destroyed)return this;Q!=null&&Q.autoDestroy||me!=null&&me.autoDestroy?S.destroy(H):H&&(H.stack,me&&!me.errored&&(me.errored=H),Q&&!Q.errored&&(Q.errored=H),re?t.nextTick(k,S,H):k(S,H))}function D(S,H){if(typeof S._construct!="function")return;let re=S._readableState,Q=S._writableState;re&&(re.constructed=!1),Q&&(Q.constructed=!1),S.once(g,H),!(S.listenerCount(g)>1)&&t.nextTick(C,S)}function C(S){let H=!1;function re(Q){if(H){U(S,Q??new h);return}H=!0;let me=S._readableState,se=S._writableState,z=se||me;me&&(me.constructed=!0),se&&(se.constructed=!0),z.destroyed?S.emit(p,Q):Q?U(S,Q,!0):t.nextTick(T,S)}try{S._construct(Q=>{t.nextTick(re,Q)})}catch(Q){t.nextTick(re,Q)}}function T(S){S.emit(g)}function M(S){return(S==null?void 0:S.setHeader)&&typeof S.abort=="function"}function V(S){S.emit("close")}function J(S,H){S.emit("error",H),t.nextTick(V,S)}function ne(S,H){!S||o(S)||(!H&&!l(S)&&(H=new n),f(S)?(S.socket=null,S.destroy(H)):M(S)?S.abort():M(S.req)?S.req.abort():typeof S.destroy=="function"?S.destroy(H):typeof S.close=="function"?S.close():H?t.nextTick(J,S,H):t.nextTick(V,S),S.destroyed||(S[s]=!0))}i.exports={construct:D,destroyer:ne,destroy:b,undestroy:v,errorOrDestroy:U}});function xe(){xe.init.call(this)}function yr(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function wo(e){return e._maxListeners===void 0?xe.defaultMaxListeners:e._maxListeners}function _o(e,i,t,a){var h,n,r,s;if(yr(t),(n=e._events)===void 0?(n=e._events=Object.create(null),e._eventsCount=0):(n.newListener!==void 0&&(e.emit("newListener",i,t.listener?t.listener:t),n=e._events),r=n[i]),r===void 0)r=n[i]=t,++e._eventsCount;else if(typeof r=="function"?r=n[i]=a?[t,r]:[r,t]:a?r.unshift(t):r.push(t),(h=wo(e))>0&&r.length>h&&!r.warned){r.warned=!0;var o=new Error("Possible EventEmitter memory leak detected. "+r.length+" "+String(i)+" listeners added. Use emitter.setMaxListeners() to increase limit");o.name="MaxListenersExceededWarning",o.emitter=e,o.type=i,o.count=r.length,s=o,console&&console.warn&&console.warn(s)}return e}function jl(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function vo(e,i,t){var a={fired:!1,wrapFn:void 0,target:e,type:i,listener:t},h=jl.bind(a);return h.listener=t,a.wrapFn=h,h}function Eo(e,i,t){var a=e._events;if(a===void 0)return[];var h=a[i];return h===void 0?[]:typeof h=="function"?t?[h.listener||h]:[h]:t?function(n){for(var r=new Array(n.length),s=0;s<r.length;++s)r[s]=n[s].listener||n[s];return r}(h):Ao(h,h.length)}function So(e){var i=this._events;if(i!==void 0){var t=i[e];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}function Ao(e,i){for(var t=new Array(i),a=0;a<i;++a)t[a]=e[a];return t}var ko,Io,jt,ti,ri,ni,nt,To=Qe(()=>{ae(),he(),le(),jt=typeof Reflect=="object"?Reflect:null,ti=jt&&typeof jt.apply=="function"?jt.apply:function(e,i,t){return Function.prototype.apply.call(e,i,t)},Io=jt&&typeof jt.ownKeys=="function"?jt.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)},ri=Number.isNaN||function(e){return e!=e},ko=xe,xe.EventEmitter=xe,xe.prototype._events=void 0,xe.prototype._eventsCount=0,xe.prototype._maxListeners=void 0,ni=10,Object.defineProperty(xe,"defaultMaxListeners",{enumerable:!0,get:function(){return ni},set:function(e){if(typeof e!="number"||e<0||ri(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");ni=e}}),xe.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},xe.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||ri(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},xe.prototype.getMaxListeners=function(){return wo(this)},xe.prototype.emit=function(e){for(var i=[],t=1;t<arguments.length;t++)i.push(arguments[t]);var a=e==="error",h=this._events;if(h!==void 0)a=a&&h.error===void 0;else if(!a)return!1;if(a){var n;if(i.length>0&&(n=i[0]),n instanceof Error)throw n;var r=new Error("Unhandled error."+(n?" ("+n.message+")":""));throw r.context=n,r}var s=h[e];if(s===void 0)return!1;if(typeof s=="function")ti(s,this,i);else{var o=s.length,l=Ao(s,o);for(t=0;t<o;++t)ti(l[t],this,i)}return!0},xe.prototype.addListener=function(e,i){return _o(this,e,i,!1)},xe.prototype.on=xe.prototype.addListener,xe.prototype.prependListener=function(e,i){return _o(this,e,i,!0)},xe.prototype.once=function(e,i){return yr(i),this.on(e,vo(this,e,i)),this},xe.prototype.prependOnceListener=function(e,i){return yr(i),this.prependListener(e,vo(this,e,i)),this},xe.prototype.removeListener=function(e,i){var t,a,h,n,r;if(yr(i),(a=this._events)===void 0)return this;if((t=a[e])===void 0)return this;if(t===i||t.listener===i)--this._eventsCount==0?this._events=Object.create(null):(delete a[e],a.removeListener&&this.emit("removeListener",e,t.listener||i));else if(typeof t!="function"){for(h=-1,n=t.length-1;n>=0;n--)if(t[n]===i||t[n].listener===i){r=t[n].listener,h=n;break}if(h<0)return this;h===0?t.shift():function(s,o){for(;o+1<s.length;o++)s[o]=s[o+1];s.pop()}(t,h),t.length===1&&(a[e]=t[0]),a.removeListener!==void 0&&this.emit("removeListener",e,r||i)}return this},xe.prototype.off=xe.prototype.removeListener,xe.prototype.removeAllListeners=function(e){var i,t,a;if((t=this._events)===void 0)return this;if(t.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):t[e]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete t[e]),this;if(arguments.length===0){var h,n=Object.keys(t);for(a=0;a<n.length;++a)(h=n[a])!=="removeListener"&&this.removeAllListeners(h);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(i=t[e])=="function")this.removeListener(e,i);else if(i!==void 0)for(a=i.length-1;a>=0;a--)this.removeListener(e,i[a]);return this},xe.prototype.listeners=function(e){return Eo(this,e,!0)},xe.prototype.rawListeners=function(e){return Eo(this,e,!1)},xe.listenerCount=function(e,i){return typeof e.listenerCount=="function"?e.listenerCount(i):So.call(e,i)},xe.prototype.listenerCount=So,xe.prototype.eventNames=function(){return this._eventsCount>0?Io(this._events):[]},nt=ko,nt.EventEmitter,nt.defaultMaxListeners,nt.init,nt.listenerCount,nt.EventEmitter,nt.defaultMaxListeners,nt.init,nt.listenerCount}),Dt={};Mt(Dt,{EventEmitter:()=>Co,default:()=>nt,defaultMaxListeners:()=>Bo,init:()=>Po,listenerCount:()=>Oo,on:()=>Ro,once:()=>xo});var Co,Bo,Po,Oo,Ro,xo,er=Qe(()=>{ae(),he(),le(),To(),To(),nt.once=function(e,i){return new Promise((t,a)=>{function h(...r){n!==void 0&&e.removeListener("error",n),t(r)}let n;i!=="error"&&(n=r=>{e.removeListener(name,h),a(r)},e.once("error",n)),e.once(i,h)})},nt.on=function(e,i){let t=[],a=[],h=null,n=!1,r={async next(){let l=t.shift();if(l)return createIterResult(l,!1);if(h){let f=Promise.reject(h);return h=null,f}return n?createIterResult(void 0,!0):new Promise((f,p)=>a.push({resolve:f,reject:p}))},async return(){e.removeListener(i,s),e.removeListener("error",o),n=!0;for(let l of a)l.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(l){h=l,e.removeListener(i,s),e.removeListener("error",o)},[Symbol.asyncIterator](){return this}};return e.on(i,s),e.on("error",o),r;function s(...l){let f=a.shift();f?f.resolve(createIterResult(l,!1)):t.push(l)}function o(l){n=!0;let f=a.shift();f?f.reject(l):h=l,r.return()}},{EventEmitter:Co,defaultMaxListeners:Bo,init:Po,listenerCount:Oo,on:Ro,once:xo}=nt}),ii=be((e,i)=>{ae(),he(),le();var{ArrayIsArray:t,ObjectSetPrototypeOf:a}=ze(),{EventEmitter:h}=(er(),Ne(Dt));function n(s){h.call(this,s)}a(n.prototype,h.prototype),a(n,h),n.prototype.pipe=function(s,o){let l=this;function f(N){s.writable&&s.write(N)===!1&&l.pause&&l.pause()}l.on("data",f);function p(){l.readable&&l.resume&&l.resume()}s.on("drain",p),!s._isStdio&&(!o||o.end!==!1)&&(l.on("end",m),l.on("close",b));let g=!1;function m(){g||(g=!0,s.end())}function b(){g||(g=!0,typeof s.destroy=="function"&&s.destroy())}function y(N){A(),h.listenerCount(this,"error")===0&&this.emit("error",N)}r(l,"error",y),r(s,"error",y);function A(){l.removeListener("data",f),s.removeListener("drain",p),l.removeListener("end",m),l.removeListener("close",b),l.removeListener("error",y),s.removeListener("error",y),l.removeListener("end",A),l.removeListener("close",A),s.removeListener("close",A)}return l.on("end",A),l.on("close",A),s.on("close",A),s.emit("pipe",l),s};function r(s,o,l){if(typeof s.prependListener=="function")return s.prependListener(o,l);!s._events||!s._events[o]?s.on(o,l):t(s._events[o])?s._events[o].unshift(l):s._events[o]=[l,s._events[o]]}i.exports={Stream:n,prependListener:r}}),wr=be((e,i)=>{ae(),he(),le();var{AbortError:t,codes:a}=tt(),{isNodeStream:h,isWebStream:n,kControllerErrorFunction:r}=wt(),s=Pt(),{ERR_INVALID_ARG_TYPE:o}=a,l=(f,p)=>{if(typeof f!="object"||!("aborted"in f))throw new o(p,"AbortSignal",f)};i.exports.addAbortSignal=function(f,p){if(l(f,"signal"),!h(p)&&!n(p))throw new o("stream",["ReadableStream","WritableStream","Stream"],p);return i.exports.addAbortSignalNoValidate(f,p)},i.exports.addAbortSignalNoValidate=function(f,p){if(typeof f!="object"||!("aborted"in f))return p;let g=h(p)?()=>{p.destroy(new t(void 0,{cause:f.reason}))}:()=>{p[r](new t(void 0,{cause:f.reason}))};return f.aborted?g():(f.addEventListener("abort",g),s(p,()=>f.removeEventListener("abort",g))),p}}),Dl=be((e,i)=>{ae(),he(),le();var{StringPrototypeSlice:t,SymbolIterator:a,TypedArrayPrototypeSet:h,Uint8Array:n}=ze(),{Buffer:r}=(Je(),Ne(Ge)),{inspect:s}=yt();i.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(o){let l={data:o,next:null};this.length>0?this.tail.next=l:this.head=l,this.tail=l,++this.length}unshift(o){let l={data:o,next:this.head};this.length===0&&(this.tail=l),this.head=l,++this.length}shift(){if(this.length===0)return;let o=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,o}clear(){this.head=this.tail=null,this.length=0}join(o){if(this.length===0)return"";let l=this.head,f=""+l.data;for(;(l=l.next)!==null;)f+=o+l.data;return f}concat(o){if(this.length===0)return r.alloc(0);let l=r.allocUnsafe(o>>>0),f=this.head,p=0;for(;f;)h(l,f.data,p),p+=f.data.length,f=f.next;return l}consume(o,l){let f=this.head.data;if(o<f.length){let p=f.slice(0,o);return this.head.data=f.slice(o),p}return o===f.length?this.shift():l?this._getString(o):this._getBuffer(o)}first(){return this.head.data}*[a](){for(let o=this.head;o;o=o.next)yield o.data}_getString(o){let l="",f=this.head,p=0;do{let g=f.data;if(o>g.length)l+=g,o-=g.length;else{o===g.length?(l+=g,++p,f.next?this.head=f.next:this.head=this.tail=null):(l+=t(g,0,o),this.head=f,f.data=t(g,o));break}++p}while((f=f.next)!==null);return this.length-=p,l}_getBuffer(o){let l=r.allocUnsafe(o),f=o,p=this.head,g=0;do{let m=p.data;if(o>m.length)h(l,m,f-o),o-=m.length;else{o===m.length?(h(l,m,f-o),++g,p.next?this.head=p.next:this.head=this.tail=null):(h(l,new n(m.buffer,m.byteOffset,o),f-o),this.head=p,p.data=m.slice(o));break}++g}while((p=p.next)!==null);return this.length-=g,l}[Symbol.for("nodejs.util.inspect.custom")](o,l){return s(this,{...l,depth:0,customInspect:!1})}}}),oi=be((e,i)=>{ae(),he(),le();var{MathFloor:t,NumberIsInteger:a}=ze(),{ERR_INVALID_ARG_VALUE:h}=tt().codes;function n(o,l,f){return o.highWaterMark!=null?o.highWaterMark:l?o[f]:null}function r(o){return o?16:16*1024}function s(o,l,f,p){let g=n(l,p,f);if(g!=null){if(!a(g)||g<0){let m=p?`options.${f}`:"options.highWaterMark";throw new h(m,g)}return t(g)}return r(o.objectMode)}i.exports={getHighWaterMark:s,getDefaultHighWaterMark:r}});function Mo(e){var i=e.length;if(i%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=e.indexOf("=");return t===-1&&(t=i),[t,t===i?0:4-t%4]}function Fl(e,i,t){for(var a,h,n=[],r=i;r<t;r+=3)a=(e[r]<<16&16711680)+(e[r+1]<<8&65280)+(255&e[r+2]),n.push(st[(h=a)>>18&63]+st[h>>12&63]+st[h>>6&63]+st[63&h]);return n.join("")}function _t(e){if(e>2147483647)throw new RangeError('The value "'+e+'" is invalid for option "size"');var i=new Uint8Array(e);return Object.setPrototypeOf(i,pe.prototype),i}function pe(e,i,t){if(typeof e=="number"){if(typeof i=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return si(e)}return No(e,i,t)}function No(e,i,t){if(typeof e=="string")return function(n,r){if(typeof r=="string"&&r!==""||(r="utf8"),!pe.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var s=0|Uo(n,r),o=_t(s),l=o.write(n,r);return l!==s&&(o=o.slice(0,l)),o}(e,i);if(ArrayBuffer.isView(e))return ai(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(vt(e,ArrayBuffer)||e&&vt(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(vt(e,SharedArrayBuffer)||e&&vt(e.buffer,SharedArrayBuffer)))return Wl(e,i,t);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var a=e.valueOf&&e.valueOf();if(a!=null&&a!==e)return pe.from(a,i,t);var h=function(n){if(pe.isBuffer(n)){var r=0|li(n.length),s=_t(r);return s.length===0||n.copy(s,0,0,r),s}if(n.length!==void 0)return typeof n.length!="number"||ci(n.length)?_t(0):ai(n);if(n.type==="Buffer"&&Array.isArray(n.data))return ai(n.data)}(e);if(h)return h;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return pe.from(e[Symbol.toPrimitive]("string"),i,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function Lo(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function si(e){return Lo(e),_t(e<0?0:0|li(e))}function ai(e){for(var i=e.length<0?0:0|li(e.length),t=_t(i),a=0;a<i;a+=1)t[a]=255&e[a];return t}function Wl(e,i,t){if(i<0||e.byteLength<i)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<i+(t||0))throw new RangeError('"length" is outside of buffer bounds');var a;return a=i===void 0&&t===void 0?new Uint8Array(e):t===void 0?new Uint8Array(e,i):new Uint8Array(e,i,t),Object.setPrototypeOf(a,pe.prototype),a}function li(e){if(e>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function Uo(e,i){if(pe.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||vt(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var t=e.length,a=arguments.length>2&&arguments[2]===!0;if(!a&&t===0)return 0;for(var h=!1;;)switch(i){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return hi(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*t;case"hex":return t>>>1;case"base64":return zo(e).length;default:if(h)return a?-1:hi(e).length;i=(""+i).toLowerCase(),h=!0}}function $l(e,i,t){var a=!1;if((i===void 0||i<0)&&(i=0),i>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0)<=(i>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return Jl(this,i,t);case"utf8":case"utf-8":return Wo(this,i,t);case"ascii":return Ql(this,i,t);case"latin1":case"binary":return Gl(this,i,t);case"base64":return Yl(this,i,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Zl(this,i,t);default:if(a)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function Ft(e,i,t){var a=e[i];e[i]=e[t],e[t]=a}function jo(e,i,t,a,h){if(e.length===0)return-1;if(typeof t=="string"?(a=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),ci(t=+t)&&(t=h?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(h)return-1;t=e.length-1}else if(t<0){if(!h)return-1;t=0}if(typeof i=="string"&&(i=pe.from(i,a)),pe.isBuffer(i))return i.length===0?-1:Do(e,i,t,a,h);if(typeof i=="number")return i&=255,typeof Uint8Array.prototype.indexOf=="function"?h?Uint8Array.prototype.indexOf.call(e,i,t):Uint8Array.prototype.lastIndexOf.call(e,i,t):Do(e,[i],t,a,h);throw new TypeError("val must be string, number or Buffer")}function Do(e,i,t,a,h){var n,r=1,s=e.length,o=i.length;if(a!==void 0&&((a=String(a).toLowerCase())==="ucs2"||a==="ucs-2"||a==="utf16le"||a==="utf-16le")){if(e.length<2||i.length<2)return-1;r=2,s/=2,o/=2,t/=2}function l(m,b){return r===1?m[b]:m.readUInt16BE(b*r)}if(h){var f=-1;for(n=t;n<s;n++)if(l(e,n)===l(i,f===-1?0:n-f)){if(f===-1&&(f=n),n-f+1===o)return f*r}else f!==-1&&(n-=n-f),f=-1}else for(t+o>s&&(t=s-o),n=t;n>=0;n--){for(var p=!0,g=0;g<o;g++)if(l(e,n+g)!==l(i,g)){p=!1;break}if(p)return n}return-1}function Vl(e,i,t,a){t=Number(t)||0;var h=e.length-t;a?(a=Number(a))>h&&(a=h):a=h;var n=i.length;a>n/2&&(a=n/2);for(var r=0;r<a;++r){var s=parseInt(i.substr(2*r,2),16);if(ci(s))return r;e[t+r]=s}return r}function ql(e,i,t,a){return _r(hi(i,e.length-t),e,t,a)}function Fo(e,i,t,a){return _r(function(h){for(var n=[],r=0;r<h.length;++r)n.push(255&h.charCodeAt(r));return n}(i),e,t,a)}function zl(e,i,t,a){return Fo(e,i,t,a)}function Hl(e,i,t,a){return _r(zo(i),e,t,a)}function Kl(e,i,t,a){return _r(function(h,n){for(var r,s,o,l=[],f=0;f<h.length&&!((n-=2)<0);++f)r=h.charCodeAt(f),s=r>>8,o=r%256,l.push(o),l.push(s);return l}(i,e.length-t),e,t,a)}function Yl(e,i,t){return i===0&&t===e.length?Er.fromByteArray(e):Er.fromByteArray(e.slice(i,t))}function Wo(e,i,t){t=Math.min(e.length,t);for(var a=[],h=i;h<t;){var n,r,s,o,l=e[h],f=null,p=l>239?4:l>223?3:l>191?2:1;if(h+p<=t)switch(p){case 1:l<128&&(f=l);break;case 2:(192&(n=e[h+1]))==128&&(o=(31&l)<<6|63&n)>127&&(f=o);break;case 3:n=e[h+1],r=e[h+2],(192&n)==128&&(192&r)==128&&(o=(15&l)<<12|(63&n)<<6|63&r)>2047&&(o<55296||o>57343)&&(f=o);break;case 4:n=e[h+1],r=e[h+2],s=e[h+3],(192&n)==128&&(192&r)==128&&(192&s)==128&&(o=(15&l)<<18|(63&n)<<12|(63&r)<<6|63&s)>65535&&o<1114112&&(f=o)}f===null?(f=65533,p=1):f>65535&&(f-=65536,a.push(f>>>10&1023|55296),f=56320|1023&f),a.push(f),h+=p}return function(g){var m=g.length;if(m<=4096)return String.fromCharCode.apply(String,g);for(var b="",y=0;y<m;)b+=String.fromCharCode.apply(String,g.slice(y,y+=4096));return b}(a)}function Ql(e,i,t){var a="";t=Math.min(e.length,t);for(var h=i;h<t;++h)a+=String.fromCharCode(127&e[h]);return a}function Gl(e,i,t){var a="";t=Math.min(e.length,t);for(var h=i;h<t;++h)a+=String.fromCharCode(e[h]);return a}function Jl(e,i,t){var a=e.length;(!i||i<0)&&(i=0),(!t||t<0||t>a)&&(t=a);for(var h="",n=i;n<t;++n)h+=Zo[e[n]];return h}function Zl(e,i,t){for(var a=e.slice(i,t),h="",n=0;n<a.length;n+=2)h+=String.fromCharCode(a[n]+256*a[n+1]);return h}function He(e,i,t){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+i>t)throw new RangeError("Trying to access beyond buffer length")}function rt(e,i,t,a,h,n){if(!pe.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(i>h||i<n)throw new RangeError('"value" argument is out of bounds');if(t+a>e.length)throw new RangeError("Index out of range")}function $o(e,i,t,a,h,n){if(t+a>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function Vo(e,i,t,a,h){return i=+i,t>>>=0,h||$o(e,0,t,4),Vt.write(e,i,t,a,23,4),t+4}function qo(e,i,t,a,h){return i=+i,t>>>=0,h||$o(e,0,t,8),Vt.write(e,i,t,a,52,8),t+8}function hi(e,i){var t;i=i||1/0;for(var a=e.length,h=null,n=[],r=0;r<a;++r){if((t=e.charCodeAt(r))>55295&&t<57344){if(!h){if(t>56319){(i-=3)>-1&&n.push(239,191,189);continue}if(r+1===a){(i-=3)>-1&&n.push(239,191,189);continue}h=t;continue}if(t<56320){(i-=3)>-1&&n.push(239,191,189),h=t;continue}t=65536+(h-55296<<10|t-56320)}else h&&(i-=3)>-1&&n.push(239,191,189);if(h=null,t<128){if((i-=1)<0)break;n.push(t)}else if(t<2048){if((i-=2)<0)break;n.push(t>>6|192,63&t|128)}else if(t<65536){if((i-=3)<0)break;n.push(t>>12|224,t>>6&63|128,63&t|128)}else{if(!(t<1114112))throw new Error("Invalid code point");if((i-=4)<0)break;n.push(t>>18|240,t>>12&63|128,t>>6&63|128,63&t|128)}}return n}function zo(e){return Er.toByteArray(function(i){if((i=(i=i.split("=")[0]).trim().replace(Jo,"")).length<2)return"";for(;i.length%4!=0;)i+="=";return i}(e))}function _r(e,i,t,a){for(var h=0;h<a&&!(h+t>=i.length||h>=e.length);++h)i[h+t]=e[h];return h}function vt(e,i){return e instanceof i||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===i.name}function ci(e){return e!=e}function Ho(e,i){for(var t in e)i[t]=e[t]}function Wt(e,i,t){return at(e,i,t)}function ar(e){var i;switch(this.encoding=function(t){var a=function(h){if(!h)return"utf8";for(var n;;)switch(h){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return h;default:if(n)return;h=(""+h).toLowerCase(),n=!0}}(t);if(typeof a!="string"&&(Sr.isEncoding===di||!di(t)))throw new Error("Unknown encoding: "+t);return a||t}(e),this.encoding){case"utf16le":this.text=eh,this.end=th,i=4;break;case"utf8":this.fillLast=Xl,i=4;break;case"base64":this.text=rh,this.end=nh,i=3;break;default:return this.write=ih,this.end=oh,void 0}this.lastNeed=0,this.lastTotal=0,this.lastChar=Sr.allocUnsafe(i)}function ui(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function Xl(e){var i=this.lastTotal-this.lastNeed,t=function(a,h,n){if((192&h[0])!=128)return a.lastNeed=0,"�";if(a.lastNeed>1&&h.length>1){if((192&h[1])!=128)return a.lastNeed=1,"�";if(a.lastNeed>2&&h.length>2&&(192&h[2])!=128)return a.lastNeed=2,"�"}}(this,e);return t!==void 0?t:this.lastNeed<=e.length?(e.copy(this.lastChar,i,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,i,0,e.length),this.lastNeed-=e.length,void 0)}function eh(e,i){if((e.length-i)%2==0){var t=e.toString("utf16le",i);if(t){var a=t.charCodeAt(t.length-1);if(a>=55296&&a<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",i,e.length-1)}function th(e){var i=e&&e.length?this.write(e):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return i+this.lastChar.toString("utf16le",0,t)}return i}function rh(e,i){var t=(e.length-i)%3;return t===0?e.toString("base64",i):(this.lastNeed=3-t,this.lastTotal=3,t===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",i,e.length-t))}function nh(e){var i=e&&e.length?this.write(e):"";return this.lastNeed?i+this.lastChar.toString("base64",0,3-this.lastNeed):i}function ih(e){return e.toString(this.encoding)}function oh(e){return e&&e.length?this.write(e):""}var Ko,st,it,Yo,vr,$t,Qo,Go,ft,Er,Vt,fi,Jo,Zo,lr,hr,at,Xo,tr,Sr,di,es=Qe(()=>{for(ae(),he(),le(),Ko={byteLength:function(e){var i=Mo(e),t=i[0],a=i[1];return 3*(t+a)/4-a},toByteArray:function(e){var i,t,a=Mo(e),h=a[0],n=a[1],r=new Yo(function(l,f,p){return 3*(f+p)/4-p}(0,h,n)),s=0,o=n>0?h-4:h;for(t=0;t<o;t+=4)i=it[e.charCodeAt(t)]<<18|it[e.charCodeAt(t+1)]<<12|it[e.charCodeAt(t+2)]<<6|it[e.charCodeAt(t+3)],r[s++]=i>>16&255,r[s++]=i>>8&255,r[s++]=255&i;return n===2&&(i=it[e.charCodeAt(t)]<<2|it[e.charCodeAt(t+1)]>>4,r[s++]=255&i),n===1&&(i=it[e.charCodeAt(t)]<<10|it[e.charCodeAt(t+1)]<<4|it[e.charCodeAt(t+2)]>>2,r[s++]=i>>8&255,r[s++]=255&i),r},fromByteArray:function(e){for(var i,t=e.length,a=t%3,h=[],n=0,r=t-a;n<r;n+=16383)h.push(Fl(e,n,n+16383>r?r:n+16383));return a===1?(i=e[t-1],h.push(st[i>>2]+st[i<<4&63]+"==")):a===2&&(i=(e[t-2]<<8)+e[t-1],h.push(st[i>>10]+st[i>>4&63]+st[i<<2&63]+"=")),h.join("")}},st=[],it=[],Yo=typeof Uint8Array<"u"?Uint8Array:Array,vr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$t=0,Qo=vr.length;$t<Qo;++$t)st[$t]=vr[$t],it[vr.charCodeAt($t)]=$t;it[45]=62,it[95]=63,Go={read:function(e,i,t,a,h){var n,r,s=8*h-a-1,o=(1<<s)-1,l=o>>1,f=-7,p=t?h-1:0,g=t?-1:1,m=e[i+p];for(p+=g,n=m&(1<<-f)-1,m>>=-f,f+=s;f>0;n=256*n+e[i+p],p+=g,f-=8);for(r=n&(1<<-f)-1,n>>=-f,f+=a;f>0;r=256*r+e[i+p],p+=g,f-=8);if(n===0)n=1-l;else{if(n===o)return r?NaN:1/0*(m?-1:1);r+=Math.pow(2,a),n-=l}return(m?-1:1)*r*Math.pow(2,n-a)},write:function(e,i,t,a,h,n){var r,s,o,l=8*n-h-1,f=(1<<l)-1,p=f>>1,g=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=a?0:n-1,b=a?1:-1,y=i<0||i===0&&1/i<0?1:0;for(i=Math.abs(i),isNaN(i)||i===1/0?(s=isNaN(i)?1:0,r=f):(r=Math.floor(Math.log(i)/Math.LN2),i*(o=Math.pow(2,-r))<1&&(r--,o*=2),(i+=r+p>=1?g/o:g*Math.pow(2,1-p))*o>=2&&(r++,o/=2),r+p>=f?(s=0,r=f):r+p>=1?(s=(i*o-1)*Math.pow(2,h),r+=p):(s=i*Math.pow(2,p-1)*Math.pow(2,h),r=0));h>=8;e[t+m]=255&s,m+=b,s/=256,h-=8);for(r=r<<h|s,l+=h;l>0;e[t+m]=255&r,m+=b,r/=256,l-=8);e[t+m-b]|=128*y}},ft={},Er=Ko,Vt=Go,fi=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null,ft.Buffer=pe,ft.SlowBuffer=function(e){return+e!=e&&(e=0),pe.alloc(+e)},ft.INSPECT_MAX_BYTES=50,ft.kMaxLength=2147483647,pe.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),i={foo:function(){return 42}};return Object.setPrototypeOf(i,Uint8Array.prototype),Object.setPrototypeOf(e,i),e.foo()===42}catch{return!1}}(),pe.TYPED_ARRAY_SUPPORT||typeof console>"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(pe.prototype,"parent",{enumerable:!0,get:function(){if(pe.isBuffer(this))return this.buffer}}),Object.defineProperty(pe.prototype,"offset",{enumerable:!0,get:function(){if(pe.isBuffer(this))return this.byteOffset}}),pe.poolSize=8192,pe.from=function(e,i,t){return No(e,i,t)},Object.setPrototypeOf(pe.prototype,Uint8Array.prototype),Object.setPrototypeOf(pe,Uint8Array),pe.alloc=function(e,i,t){return function(a,h,n){return Lo(a),a<=0?_t(a):h!==void 0?typeof n=="string"?_t(a).fill(h,n):_t(a).fill(h):_t(a)}(e,i,t)},pe.allocUnsafe=function(e){return si(e)},pe.allocUnsafeSlow=function(e){return si(e)},pe.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==pe.prototype},pe.compare=function(e,i){if(vt(e,Uint8Array)&&(e=pe.from(e,e.offset,e.byteLength)),vt(i,Uint8Array)&&(i=pe.from(i,i.offset,i.byteLength)),!pe.isBuffer(e)||!pe.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===i)return 0;for(var t=e.length,a=i.length,h=0,n=Math.min(t,a);h<n;++h)if(e[h]!==i[h]){t=e[h],a=i[h];break}return t<a?-1:a<t?1:0},pe.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}},pe.concat=function(e,i){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return pe.alloc(0);var t;if(i===void 0)for(i=0,t=0;t<e.length;++t)i+=e[t].length;var a=pe.allocUnsafe(i),h=0;for(t=0;t<e.length;++t){var n=e[t];if(vt(n,Uint8Array)&&(n=pe.from(n)),!pe.isBuffer(n))throw new TypeError('"list" argument must be an Array of Buffers');n.copy(a,h),h+=n.length}return a},pe.byteLength=Uo,pe.prototype._isBuffer=!0,pe.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var i=0;i<e;i+=2)Ft(this,i,i+1);return this},pe.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var i=0;i<e;i+=4)Ft(this,i,i+3),Ft(this,i+1,i+2);return this},pe.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var i=0;i<e;i+=8)Ft(this,i,i+7),Ft(this,i+1,i+6),Ft(this,i+2,i+5),Ft(this,i+3,i+4);return this},pe.prototype.toString=function(){var e=this.length;return e===0?"":arguments.length===0?Wo(this,0,e):$l.apply(this,arguments)},pe.prototype.toLocaleString=pe.prototype.toString,pe.prototype.equals=function(e){if(!pe.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||pe.compare(this,e)===0},pe.prototype.inspect=function(){var e="",i=ft.INSPECT_MAX_BYTES;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},fi&&(pe.prototype[fi]=pe.prototype.inspect),pe.prototype.compare=function(e,i,t,a,h){if(vt(e,Uint8Array)&&(e=pe.from(e,e.offset,e.byteLength)),!pe.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(i===void 0&&(i=0),t===void 0&&(t=e?e.length:0),a===void 0&&(a=0),h===void 0&&(h=this.length),i<0||t>e.length||a<0||h>this.length)throw new RangeError("out of range index");if(a>=h&&i>=t)return 0;if(a>=h)return-1;if(i>=t)return 1;if(this===e)return 0;for(var n=(h>>>=0)-(a>>>=0),r=(t>>>=0)-(i>>>=0),s=Math.min(n,r),o=this.slice(a,h),l=e.slice(i,t),f=0;f<s;++f)if(o[f]!==l[f]){n=o[f],r=l[f];break}return n<r?-1:r<n?1:0},pe.prototype.includes=function(e,i,t){return this.indexOf(e,i,t)!==-1},pe.prototype.indexOf=function(e,i,t){return jo(this,e,i,t,!0)},pe.prototype.lastIndexOf=function(e,i,t){return jo(this,e,i,t,!1)},pe.prototype.write=function(e,i,t,a){if(i===void 0)a="utf8",t=this.length,i=0;else if(t===void 0&&typeof i=="string")a=i,t=this.length,i=0;else{if(!isFinite(i))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");i>>>=0,isFinite(t)?(t>>>=0,a===void 0&&(a="utf8")):(a=t,t=void 0)}var h=this.length-i;if((t===void 0||t>h)&&(t=h),e.length>0&&(t<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var n=!1;;)switch(a){case"hex":return Vl(this,e,i,t);case"utf8":case"utf-8":return ql(this,e,i,t);case"ascii":return Fo(this,e,i,t);case"latin1":case"binary":return zl(this,e,i,t);case"base64":return Hl(this,e,i,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Kl(this,e,i,t);default:if(n)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),n=!0}},pe.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},pe.prototype.slice=function(e,i){var t=this.length;(e=~~e)<0?(e+=t)<0&&(e=0):e>t&&(e=t),(i=i===void 0?t:~~i)<0?(i+=t)<0&&(i=0):i>t&&(i=t),i<e&&(i=e);var a=this.subarray(e,i);return Object.setPrototypeOf(a,pe.prototype),a},pe.prototype.readUIntLE=function(e,i,t){e>>>=0,i>>>=0,t||He(e,i,this.length);for(var a=this[e],h=1,n=0;++n<i&&(h*=256);)a+=this[e+n]*h;return a},pe.prototype.readUIntBE=function(e,i,t){e>>>=0,i>>>=0,t||He(e,i,this.length);for(var a=this[e+--i],h=1;i>0&&(h*=256);)a+=this[e+--i]*h;return a},pe.prototype.readUInt8=function(e,i){return e>>>=0,i||He(e,1,this.length),this[e]},pe.prototype.readUInt16LE=function(e,i){return e>>>=0,i||He(e,2,this.length),this[e]|this[e+1]<<8},pe.prototype.readUInt16BE=function(e,i){return e>>>=0,i||He(e,2,this.length),this[e]<<8|this[e+1]},pe.prototype.readUInt32LE=function(e,i){return e>>>=0,i||He(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},pe.prototype.readUInt32BE=function(e,i){return e>>>=0,i||He(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},pe.prototype.readIntLE=function(e,i,t){e>>>=0,i>>>=0,t||He(e,i,this.length);for(var a=this[e],h=1,n=0;++n<i&&(h*=256);)a+=this[e+n]*h;return a>=(h*=128)&&(a-=Math.pow(2,8*i)),a},pe.prototype.readIntBE=function(e,i,t){e>>>=0,i>>>=0,t||He(e,i,this.length);for(var a=i,h=1,n=this[e+--a];a>0&&(h*=256);)n+=this[e+--a]*h;return n>=(h*=128)&&(n-=Math.pow(2,8*i)),n},pe.prototype.readInt8=function(e,i){return e>>>=0,i||He(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},pe.prototype.readInt16LE=function(e,i){e>>>=0,i||He(e,2,this.length);var t=this[e]|this[e+1]<<8;return 32768&t?4294901760|t:t},pe.prototype.readInt16BE=function(e,i){e>>>=0,i||He(e,2,this.length);var t=this[e+1]|this[e]<<8;return 32768&t?4294901760|t:t},pe.prototype.readInt32LE=function(e,i){return e>>>=0,i||He(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},pe.prototype.readInt32BE=function(e,i){return e>>>=0,i||He(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},pe.prototype.readFloatLE=function(e,i){return e>>>=0,i||He(e,4,this.length),Vt.read(this,e,!0,23,4)},pe.prototype.readFloatBE=function(e,i){return e>>>=0,i||He(e,4,this.length),Vt.read(this,e,!1,23,4)},pe.prototype.readDoubleLE=function(e,i){return e>>>=0,i||He(e,8,this.length),Vt.read(this,e,!0,52,8)},pe.prototype.readDoubleBE=function(e,i){return e>>>=0,i||He(e,8,this.length),Vt.read(this,e,!1,52,8)},pe.prototype.writeUIntLE=function(e,i,t,a){e=+e,i>>>=0,t>>>=0,a||rt(this,e,i,t,Math.pow(2,8*t)-1,0);var h=1,n=0;for(this[i]=255&e;++n<t&&(h*=256);)this[i+n]=e/h&255;return i+t},pe.prototype.writeUIntBE=function(e,i,t,a){e=+e,i>>>=0,t>>>=0,a||rt(this,e,i,t,Math.pow(2,8*t)-1,0);var h=t-1,n=1;for(this[i+h]=255&e;--h>=0&&(n*=256);)this[i+h]=e/n&255;return i+t},pe.prototype.writeUInt8=function(e,i,t){return e=+e,i>>>=0,t||rt(this,e,i,1,255,0),this[i]=255&e,i+1},pe.prototype.writeUInt16LE=function(e,i,t){return e=+e,i>>>=0,t||rt(this,e,i,2,65535,0),this[i]=255&e,this[i+1]=e>>>8,i+2},pe.prototype.writeUInt16BE=function(e,i,t){return e=+e,i>>>=0,t||rt(this,e,i,2,65535,0),this[i]=e>>>8,this[i+1]=255&e,i+2},pe.prototype.writeUInt32LE=function(e,i,t){return e=+e,i>>>=0,t||rt(this,e,i,4,4294967295,0),this[i+3]=e>>>24,this[i+2]=e>>>16,this[i+1]=e>>>8,this[i]=255&e,i+4},pe.prototype.writeUInt32BE=function(e,i,t){return e=+e,i>>>=0,t||rt(this,e,i,4,4294967295,0),this[i]=e>>>24,this[i+1]=e>>>16,this[i+2]=e>>>8,this[i+3]=255&e,i+4},pe.prototype.writeIntLE=function(e,i,t,a){if(e=+e,i>>>=0,!a){var h=Math.pow(2,8*t-1);rt(this,e,i,t,h-1,-h)}var n=0,r=1,s=0;for(this[i]=255&e;++n<t&&(r*=256);)e<0&&s===0&&this[i+n-1]!==0&&(s=1),this[i+n]=(e/r>>0)-s&255;return i+t},pe.prototype.writeIntBE=function(e,i,t,a){if(e=+e,i>>>=0,!a){var h=Math.pow(2,8*t-1);rt(this,e,i,t,h-1,-h)}var n=t-1,r=1,s=0;for(this[i+n]=255&e;--n>=0&&(r*=256);)e<0&&s===0&&this[i+n+1]!==0&&(s=1),this[i+n]=(e/r>>0)-s&255;return i+t},pe.prototype.writeInt8=function(e,i,t){return e=+e,i>>>=0,t||rt(this,e,i,1,127,-128),e<0&&(e=255+e+1),this[i]=255&e,i+1},pe.prototype.writeInt16LE=function(e,i,t){return e=+e,i>>>=0,t||rt(this,e,i,2,32767,-32768),this[i]=255&e,this[i+1]=e>>>8,i+2},pe.prototype.writeInt16BE=function(e,i,t){return e=+e,i>>>=0,t||rt(this,e,i,2,32767,-32768),this[i]=e>>>8,this[i+1]=255&e,i+2},pe.prototype.writeInt32LE=function(e,i,t){return e=+e,i>>>=0,t||rt(this,e,i,4,2147483647,-2147483648),this[i]=255&e,this[i+1]=e>>>8,this[i+2]=e>>>16,this[i+3]=e>>>24,i+4},pe.prototype.writeInt32BE=function(e,i,t){return e=+e,i>>>=0,t||rt(this,e,i,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[i]=e>>>24,this[i+1]=e>>>16,this[i+2]=e>>>8,this[i+3]=255&e,i+4},pe.prototype.writeFloatLE=function(e,i,t){return Vo(this,e,i,!0,t)},pe.prototype.writeFloatBE=function(e,i,t){return Vo(this,e,i,!1,t)},pe.prototype.writeDoubleLE=function(e,i,t){return qo(this,e,i,!0,t)},pe.prototype.writeDoubleBE=function(e,i,t){return qo(this,e,i,!1,t)},pe.prototype.copy=function(e,i,t,a){if(!pe.isBuffer(e))throw new TypeError("argument should be a Buffer");if(t||(t=0),a||a===0||(a=this.length),i>=e.length&&(i=e.length),i||(i=0),a>0&&a<t&&(a=t),a===t||e.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(t<0||t>=this.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-i<a-t&&(a=e.length-i+t);var h=a-t;if(this===e&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin(i,t,a);else if(this===e&&t<i&&i<a)for(var n=h-1;n>=0;--n)e[n+i]=this[n+t];else Uint8Array.prototype.set.call(e,this.subarray(t,a),i);return h},pe.prototype.fill=function(e,i,t,a){if(typeof e=="string"){if(typeof i=="string"?(a=i,i=0,t=this.length):typeof t=="string"&&(a=t,t=this.length),a!==void 0&&typeof a!="string")throw new TypeError("encoding must be a string");if(typeof a=="string"&&!pe.isEncoding(a))throw new TypeError("Unknown encoding: "+a);if(e.length===1){var h=e.charCodeAt(0);(a==="utf8"&&h<128||a==="latin1")&&(e=h)}}else typeof e=="number"?e&=255:typeof e=="boolean"&&(e=Number(e));if(i<0||this.length<i||this.length<t)throw new RangeError("Out of range index");if(t<=i)return this;var n;if(i>>>=0,t=t===void 0?this.length:t>>>0,e||(e=0),typeof e=="number")for(n=i;n<t;++n)this[n]=e;else{var r=pe.isBuffer(e)?e:pe.from(e,a),s=r.length;if(s===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(n=0;n<t-i;++n)this[n+i]=r[n%s]}return this},Jo=/[^+/0-9A-Za-z-_]/g,Zo=function(){for(var e=new Array(256),i=0;i<16;++i)for(var t=16*i,a=0;a<16;++a)e[t+a]="0123456789abcdef"[i]+"0123456789abcdef"[a];return e}(),ft.Buffer,ft.INSPECT_MAX_BYTES,ft.kMaxLength,lr={},hr=ft,at=hr.Buffer,at.from&&at.alloc&&at.allocUnsafe&&at.allocUnsafeSlow?lr=hr:(Ho(hr,lr),lr.Buffer=Wt),Wt.prototype=Object.create(at.prototype),Ho(at,Wt),Wt.from=function(e,i,t){if(typeof e=="number")throw new TypeError("Argument must not be a number");return at(e,i,t)},Wt.alloc=function(e,i,t){if(typeof e!="number")throw new TypeError("Argument must be a number");var a=at(e);return i!==void 0?typeof t=="string"?a.fill(i,t):a.fill(i):a.fill(0),a},Wt.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return at(e)},Wt.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return hr.SlowBuffer(e)},Xo=lr,tr={},Sr=Xo.Buffer,di=Sr.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}},tr.StringDecoder=ar,ar.prototype.write=function(e){if(e.length===0)return"";var i,t;if(this.lastNeed){if((i=this.fillLast(e))===void 0)return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t<e.length?i?i+this.text(e,t):this.text(e,t):i||""},ar.prototype.end=function(e){var i=e&&e.length?this.write(e):"";return this.lastNeed?i+"�":i},ar.prototype.text=function(e,i){var t=function(h,n,r){var s=n.length-1;if(s<r)return 0;var o=ui(n[s]);return o>=0?(o>0&&(h.lastNeed=o-1),o):--s<r||o===-2?0:(o=ui(n[s]))>=0?(o>0&&(h.lastNeed=o-2),o):--s<r||o===-2?0:(o=ui(n[s]))>=0?(o>0&&(o===2?o=0:h.lastNeed=o-3),o):0}(this,e,i);if(!this.lastNeed)return e.toString("utf8",i);this.lastTotal=t;var a=e.length-(t-this.lastNeed);return e.copy(this.lastChar,0,a),e.toString("utf8",i,a)},ar.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},tr.StringDecoder,tr.StringDecoder}),ts={};Mt(ts,{StringDecoder:()=>rs,default:()=>tr});var rs,sh=Qe(()=>{ae(),he(),le(),es(),es(),rs=tr.StringDecoder}),ns=be((e,i)=>{ae(),he(),le();var t=Ut(),{PromisePrototypeThen:a,SymbolAsyncIterator:h,SymbolIterator:n}=ze(),{Buffer:r}=(Je(),Ne(Ge)),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_NULL_VALUES:o}=tt().codes;function l(f,p,g){let m;if(typeof p=="string"||p instanceof r)return new f({objectMode:!0,...g,read(){this.push(p),this.push(null)}});let b;if(p&&p[h])b=!0,m=p[h]();else if(p&&p[n])b=!1,m=p[n]();else throw new s("iterable",["Iterable"],p);let y=new f({objectMode:!0,highWaterMark:1,...g}),A=!1;y._read=function(){A||(A=!0,k())},y._destroy=function(v,U){a(N(v),()=>t.nextTick(U,v),D=>t.nextTick(U,D||v))};async function N(v){let U=v!=null,D=typeof m.throw=="function";if(U&&D){let{value:C,done:T}=await m.throw(v);if(await C,T)return}if(typeof m.return=="function"){let{value:C}=await m.return();await C}}async function k(){for(;;){try{let{value:v,done:U}=b?await m.next():m.next();if(U)y.push(null);else{let D=v&&typeof v.then=="function"?await v:v;if(D===null)throw A=!1,new o;if(y.push(D))continue;A=!1}}catch(v){y.destroy(v)}break}}return y}i.exports=l}),Ar=be((e,i)=>{ae(),he(),le();var t=Ut(),{ArrayPrototypeIndexOf:a,NumberIsInteger:h,NumberIsNaN:n,NumberParseInt:r,ObjectDefineProperties:s,ObjectKeys:o,ObjectSetPrototypeOf:l,Promise:f,SafeSet:p,SymbolAsyncIterator:g,Symbol:m}=ze();i.exports=_,_.ReadableState=_e;var{EventEmitter:b}=(er(),Ne(Dt)),{Stream:y,prependListener:A}=ii(),{Buffer:N}=(Je(),Ne(Ge)),{addAbortSignal:k}=wr(),v=Pt(),U=yt().debuglog("stream",c=>{U=c}),D=Dl(),C=Xt(),{getHighWaterMark:T,getDefaultHighWaterMark:M}=oi(),{aggregateTwoErrors:V,codes:{ERR_INVALID_ARG_TYPE:J,ERR_METHOD_NOT_IMPLEMENTED:ne,ERR_OUT_OF_RANGE:S,ERR_STREAM_PUSH_AFTER_EOF:H,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:re}}=tt(),{validateObject:Q}=br(),me=m("kPaused"),{StringDecoder:se}=(sh(),Ne(ts)),z=ns();l(_.prototype,y.prototype),l(_,y);var ye=()=>{},{errorOrDestroy:oe}=C;function _e(c,d,w){typeof w!="boolean"&&(w=d instanceof Et()),this.objectMode=!!(c&&c.objectMode),w&&(this.objectMode=this.objectMode||!!(c&&c.readableObjectMode)),this.highWaterMark=c?T(this,c,"readableHighWaterMark",w):M(!1),this.buffer=new D,this.length=0,this.pipes=[],this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.constructed=!0,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this[me]=null,this.errorEmitted=!1,this.emitClose=!c||c.emitClose!==!1,this.autoDestroy=!c||c.autoDestroy!==!1,this.destroyed=!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this.defaultEncoding=c&&c.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.multiAwaitDrain=!1,this.readingMore=!1,this.dataEmitted=!1,this.decoder=null,this.encoding=null,c&&c.encoding&&(this.decoder=new se(c.encoding),this.encoding=c.encoding)}function _(c){if(!(this instanceof _))return new _(c);let d=this instanceof Et();this._readableState=new _e(c,this,d),c&&(typeof c.read=="function"&&(this._read=c.read),typeof c.destroy=="function"&&(this._destroy=c.destroy),typeof c.construct=="function"&&(this._construct=c.construct),c.signal&&!d&&k(c.signal,this)),y.call(this,c),C.construct(this,()=>{this._readableState.needReadable&&te(this,this._readableState)})}_.prototype.destroy=C.destroy,_.prototype._undestroy=C.undestroy,_.prototype._destroy=function(c,d){d(c)},_.prototype[b.captureRejectionSymbol]=function(c){this.destroy(c)},_.prototype.push=function(c,d){return G(this,c,d,!1)},_.prototype.unshift=function(c,d){return G(this,c,d,!0)};function G(c,d,w,I){U("readableAddChunk",d);let $=c._readableState,ee;if($.objectMode||(typeof d=="string"?(w=w||$.defaultEncoding,$.encoding!==w&&(I&&$.encoding?d=N.from(d,w).toString($.encoding):(d=N.from(d,w),w=""))):d instanceof N?w="":y._isUint8Array(d)?(d=y._uint8ArrayToBuffer(d),w=""):d!=null&&(ee=new J("chunk",["string","Buffer","Uint8Array"],d))),ee)oe(c,ee);else if(d===null)$.reading=!1,E(c,$);else if($.objectMode||d&&d.length>0)if(I)if($.endEmitted)oe(c,new re);else{if($.destroyed||$.errored)return!1;de(c,$,d,!0)}else if($.ended)oe(c,new H);else{if($.destroyed||$.errored)return!1;$.reading=!1,$.decoder&&!w?(d=$.decoder.write(d),$.objectMode||d.length!==0?de(c,$,d,!1):te(c,$)):de(c,$,d,!1)}else I||($.reading=!1,te(c,$));return!$.ended&&($.length<$.highWaterMark||$.length===0)}function de(c,d,w,I){d.flowing&&d.length===0&&!d.sync&&c.listenerCount("data")>0?(d.multiAwaitDrain?d.awaitDrainWriters.clear():d.awaitDrainWriters=null,d.dataEmitted=!0,c.emit("data",w)):(d.length+=d.objectMode?1:w.length,I?d.buffer.unshift(w):d.buffer.push(w),d.needReadable&&Y(c)),te(c,d)}_.prototype.isPaused=function(){let c=this._readableState;return c[me]===!0||c.flowing===!1},_.prototype.setEncoding=function(c){let d=new se(c);this._readableState.decoder=d,this._readableState.encoding=this._readableState.decoder.encoding;let w=this._readableState.buffer,I="";for(let $ of w)I+=d.write($);return w.clear(),I!==""&&w.push(I),this._readableState.length=I.length,this};var ve=1073741824;function ue(c){if(c>ve)throw new S("size","<= 1GiB",c);return c--,c|=c>>>1,c|=c>>>2,c|=c>>>4,c|=c>>>8,c|=c>>>16,c++,c}function x(c,d){return c<=0||d.length===0&&d.ended?0:d.objectMode?1:n(c)?d.flowing&&d.length?d.buffer.first().length:d.length:c<=d.length?c:d.ended?d.length:0}_.prototype.read=function(c){U("read",c),c===void 0?c=NaN:h(c)||(c=r(c,10));let d=this._readableState,w=c;if(c>d.highWaterMark&&(d.highWaterMark=ue(c)),c!==0&&(d.emittedReadable=!1),c===0&&d.needReadable&&((d.highWaterMark!==0?d.length>=d.highWaterMark:d.length>0)||d.ended))return U("read: emitReadable",d.length,d.ended),d.length===0&&d.ended?B(this):Y(this),null;if(c=x(c,d),c===0&&d.ended)return d.length===0&&B(this),null;let I=d.needReadable;if(U("need readable",I),(d.length===0||d.length-c<d.highWaterMark)&&(I=!0,U("length less than watermark",I)),d.ended||d.reading||d.destroyed||d.errored||!d.constructed)I=!1,U("reading, ended or constructing",I);else if(I){U("do read"),d.reading=!0,d.sync=!0,d.length===0&&(d.needReadable=!0);try{this._read(d.highWaterMark)}catch(ee){oe(this,ee)}d.sync=!1,d.reading||(c=x(w,d))}let $;return c>0?$=K(c,d):$=null,$===null?(d.needReadable=d.length<=d.highWaterMark,c=0):(d.length-=c,d.multiAwaitDrain?d.awaitDrainWriters.clear():d.awaitDrainWriters=null),d.length===0&&(d.ended||(d.needReadable=!0),w!==c&&d.ended&&B(this)),$!==null&&!d.errorEmitted&&!d.closeEmitted&&(d.dataEmitted=!0,this.emit("data",$)),$};function E(c,d){if(U("onEofChunk"),!d.ended){if(d.decoder){let w=d.decoder.end();w&&w.length&&(d.buffer.push(w),d.length+=d.objectMode?1:w.length)}d.ended=!0,d.sync?Y(c):(d.needReadable=!1,d.emittedReadable=!0,fe(c))}}function Y(c){let d=c._readableState;U("emitReadable",d.needReadable,d.emittedReadable),d.needReadable=!1,d.emittedReadable||(U("emitReadable",d.flowing),d.emittedReadable=!0,t.nextTick(fe,c))}function fe(c){let d=c._readableState;U("emitReadable_",d.destroyed,d.length,d.ended),!d.destroyed&&!d.errored&&(d.length||d.ended)&&(c.emit("readable"),d.emittedReadable=!1),d.needReadable=!d.flowing&&!d.ended&&d.length<=d.highWaterMark,ie(c)}function te(c,d){!d.readingMore&&d.constructed&&(d.readingMore=!0,t.nextTick(X,c,d))}function X(c,d){for(;!d.reading&&!d.ended&&(d.length<d.highWaterMark||d.flowing&&d.length===0);){let w=d.length;if(U("maybeReadMore read 0"),c.read(0),w===d.length)break}d.readingMore=!1}_.prototype._read=function(c){throw new ne("_read()")},_.prototype.pipe=function(c,d){let w=this,I=this._readableState;I.pipes.length===1&&(I.multiAwaitDrain||(I.multiAwaitDrain=!0,I.awaitDrainWriters=new p(I.awaitDrainWriters?[I.awaitDrainWriters]:[]))),I.pipes.push(c),U("pipe count=%d opts=%j",I.pipes.length,d);let $=(!d||d.end!==!1)&&c!==t.stdout&&c!==t.stderr?Ie:Ze;I.endEmitted?t.nextTick($):w.once("end",$),c.on("unpipe",ee);function ee(et,Ye){U("onunpipe"),et===w&&Ye&&Ye.hasUnpiped===!1&&(Ye.hasUnpiped=!0,Ae())}function Ie(){U("onend"),c.end()}let Be,Pe=!1;function Ae(){U("cleanup"),c.removeListener("close",Ke),c.removeListener("finish",qe),Be&&c.removeListener("drain",Be),c.removeListener("error",Le),c.removeListener("unpipe",ee),w.removeListener("end",Ie),w.removeListener("end",Ze),w.removeListener("data",Te),Pe=!0,Be&&I.awaitDrainWriters&&(!c._writableState||c._writableState.needDrain)&&Be()}function Ce(){Pe||(I.pipes.length===1&&I.pipes[0]===c?(U("false write response, pause",0),I.awaitDrainWriters=c,I.multiAwaitDrain=!1):I.pipes.length>1&&I.pipes.includes(c)&&(U("false write response, pause",I.awaitDrainWriters.size),I.awaitDrainWriters.add(c)),w.pause()),Be||(Be=we(w,c),c.on("drain",Be))}w.on("data",Te);function Te(et){U("ondata");let Ye=c.write(et);U("dest.write",Ye),Ye===!1&&Ce()}function Le(et){if(U("onerror",et),Ze(),c.removeListener("error",Le),c.listenerCount("error")===0){let Ye=c._writableState||c._readableState;Ye&&!Ye.errorEmitted?oe(c,et):c.emit("error",et)}}A(c,"error",Le);function Ke(){c.removeListener("finish",qe),Ze()}c.once("close",Ke);function qe(){U("onfinish"),c.removeListener("close",Ke),Ze()}c.once("finish",qe);function Ze(){U("unpipe"),w.unpipe(c)}return c.emit("pipe",w),c.writableNeedDrain===!0?I.flowing&&Ce():I.flowing||(U("pipe resume"),w.resume()),c};function we(c,d){return function(){let w=c._readableState;w.awaitDrainWriters===d?(U("pipeOnDrain",1),w.awaitDrainWriters=null):w.multiAwaitDrain&&(U("pipeOnDrain",w.awaitDrainWriters.size),w.awaitDrainWriters.delete(d)),(!w.awaitDrainWriters||w.awaitDrainWriters.size===0)&&c.listenerCount("data")&&c.resume()}}_.prototype.unpipe=function(c){let d=this._readableState,w={hasUnpiped:!1};if(d.pipes.length===0)return this;if(!c){let $=d.pipes;d.pipes=[],this.pause();for(let ee=0;ee<$.length;ee++)$[ee].emit("unpipe",this,{hasUnpiped:!1});return this}let I=a(d.pipes,c);return I===-1?this:(d.pipes.splice(I,1),d.pipes.length===0&&this.pause(),c.emit("unpipe",this,w),this)},_.prototype.on=function(c,d){let w=y.prototype.on.call(this,c,d),I=this._readableState;return c==="data"?(I.readableListening=this.listenerCount("readable")>0,I.flowing!==!1&&this.resume()):c==="readable"&&!I.endEmitted&&!I.readableListening&&(I.readableListening=I.needReadable=!0,I.flowing=!1,I.emittedReadable=!1,U("on readable",I.length,I.reading),I.length?Y(this):I.reading||t.nextTick(P,this)),w},_.prototype.addListener=_.prototype.on,_.prototype.removeListener=function(c,d){let w=y.prototype.removeListener.call(this,c,d);return c==="readable"&&t.nextTick(ge,this),w},_.prototype.off=_.prototype.removeListener,_.prototype.removeAllListeners=function(c){let d=y.prototype.removeAllListeners.apply(this,arguments);return(c==="readable"||c===void 0)&&t.nextTick(ge,this),d};function ge(c){let d=c._readableState;d.readableListening=c.listenerCount("readable")>0,d.resumeScheduled&&d[me]===!1?d.flowing=!0:c.listenerCount("data")>0?c.resume():d.readableListening||(d.flowing=null)}function P(c){U("readable nexttick read 0"),c.read(0)}_.prototype.resume=function(){let c=this._readableState;return c.flowing||(U("resume"),c.flowing=!c.readableListening,F(this,c)),c[me]=!1,this};function F(c,d){d.resumeScheduled||(d.resumeScheduled=!0,t.nextTick(W,c,d))}function W(c,d){U("resume",d.reading),d.reading||c.read(0),d.resumeScheduled=!1,c.emit("resume"),ie(c),d.flowing&&!d.reading&&c.read(0)}_.prototype.pause=function(){return U("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(U("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[me]=!0,this};function ie(c){let d=c._readableState;for(U("flow",d.flowing);d.flowing&&c.read()!==null;);}_.prototype.wrap=function(c){let d=!1;c.on("data",I=>{!this.push(I)&&c.pause&&(d=!0,c.pause())}),c.on("end",()=>{this.push(null)}),c.on("error",I=>{oe(this,I)}),c.on("close",()=>{this.destroy()}),c.on("destroy",()=>{this.destroy()}),this._read=()=>{d&&c.resume&&(d=!1,c.resume())};let w=o(c);for(let I=1;I<w.length;I++){let $=w[I];this[$]===void 0&&typeof c[$]=="function"&&(this[$]=c[$].bind(c))}return this},_.prototype[g]=function(){return Z(this)},_.prototype.iterator=function(c){return c!==void 0&&Q(c,"options"),Z(this,c)};function Z(c,d){typeof c.read!="function"&&(c=_.wrap(c,{objectMode:!0}));let w=L(c,d);return w.stream=c,w}async function*L(c,d){let w=ye;function I(Ie){this===c?(w(),w=ye):w=Ie}c.on("readable",I);let $,ee=v(c,{writable:!1},Ie=>{$=Ie?V($,Ie):null,w(),w=ye});try{for(;;){let Ie=c.destroyed?null:c.read();if(Ie!==null)yield Ie;else{if($)throw $;if($===null)return;await new f(I)}}}catch(Ie){throw $=V($,Ie),$}finally{($||(d==null?void 0:d.destroyOnReturn)!==!1)&&($===void 0||c._readableState.autoDestroy)?C.destroyer(c,null):(c.off("readable",I),ee())}}s(_.prototype,{readable:{__proto__:null,get(){let c=this._readableState;return!!c&&c.readable!==!1&&!c.destroyed&&!c.errorEmitted&&!c.endEmitted},set(c){this._readableState&&(this._readableState.readable=!!c)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(c){this._readableState&&(this._readableState.flowing=c)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(c){this._readableState&&(this._readableState.destroyed=c)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),s(_e.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[me]!==!1},set(c){this[me]=!!c}}}),_._fromList=K;function K(c,d){if(d.length===0)return null;let w;return d.objectMode?w=d.buffer.shift():!c||c>=d.length?(d.decoder?w=d.buffer.join(""):d.buffer.length===1?w=d.buffer.first():w=d.buffer.concat(d.length),d.buffer.clear()):w=d.buffer.consume(c,d.decoder),w}function B(c){let d=c._readableState;U("endReadable",d.endEmitted),d.endEmitted||(d.ended=!0,t.nextTick(j,d,c))}function j(c,d){if(U("endReadableNT",c.endEmitted,c.length),!c.errored&&!c.closeEmitted&&!c.endEmitted&&c.length===0){if(c.endEmitted=!0,d.emit("end"),d.writable&&d.allowHalfOpen===!1)t.nextTick(q,d);else if(c.autoDestroy){let w=d._writableState;(!w||w.autoDestroy&&(w.finished||w.writable===!1))&&d.destroy()}}}function q(c){c.writable&&!c.writableEnded&&!c.destroyed&&c.end()}_.from=function(c,d){return z(_,c,d)};var ce;function u(){return ce===void 0&&(ce={}),ce}_.fromWeb=function(c,d){return u().newStreamReadableFromReadableStream(c,d)},_.toWeb=function(c,d){return u().newReadableStreamFromStreamReadable(c,d)},_.wrap=function(c,d){var w,I;return new _({objectMode:(w=(I=c.readableObjectMode)!==null&&I!==void 0?I:c.objectMode)!==null&&w!==void 0?w:!0,...d,destroy($,ee){C.destroyer(c,$),ee($)}}).wrap(c)}}),is=be((e,i)=>{ae(),he(),le();var t=Ut(),{ArrayPrototypeSlice:a,Error:h,FunctionPrototypeSymbolHasInstance:n,ObjectDefineProperty:r,ObjectDefineProperties:s,ObjectSetPrototypeOf:o,StringPrototypeToLowerCase:l,Symbol:f,SymbolHasInstance:p}=ze();i.exports=se,se.WritableState=Q;var{EventEmitter:g}=(er(),Ne(Dt)),m=ii().Stream,{Buffer:b}=(Je(),Ne(Ge)),y=Xt(),{addAbortSignal:A}=wr(),{getHighWaterMark:N,getDefaultHighWaterMark:k}=oi(),{ERR_INVALID_ARG_TYPE:v,ERR_METHOD_NOT_IMPLEMENTED:U,ERR_MULTIPLE_CALLBACK:D,ERR_STREAM_CANNOT_PIPE:C,ERR_STREAM_DESTROYED:T,ERR_STREAM_ALREADY_FINISHED:M,ERR_STREAM_NULL_VALUES:V,ERR_STREAM_WRITE_AFTER_END:J,ERR_UNKNOWN_ENCODING:ne}=tt().codes,{errorOrDestroy:S}=y;o(se.prototype,m.prototype),o(se,m);function H(){}var re=f("kOnFinished");function Q(P,F,W){typeof W!="boolean"&&(W=F instanceof Et()),this.objectMode=!!(P&&P.objectMode),W&&(this.objectMode=this.objectMode||!!(P&&P.writableObjectMode)),this.highWaterMark=P?N(this,P,"writableHighWaterMark",W):k(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let ie=!!(P&&P.decodeStrings===!1);this.decodeStrings=!ie,this.defaultEncoding=P&&P.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=_.bind(void 0,F),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,me(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!P||P.emitClose!==!1,this.autoDestroy=!P||P.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[re]=[]}function me(P){P.buffered=[],P.bufferedIndex=0,P.allBuffers=!0,P.allNoop=!0}Q.prototype.getBuffer=function(){return a(this.buffered,this.bufferedIndex)},r(Q.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function se(P){let F=this instanceof Et();if(!F&&!n(se,this))return new se(P);this._writableState=new Q(P,this,F),P&&(typeof P.write=="function"&&(this._write=P.write),typeof P.writev=="function"&&(this._writev=P.writev),typeof P.destroy=="function"&&(this._destroy=P.destroy),typeof P.final=="function"&&(this._final=P.final),typeof P.construct=="function"&&(this._construct=P.construct),P.signal&&A(P.signal,this)),m.call(this,P),y.construct(this,()=>{let W=this._writableState;W.writing||ue(this,W),fe(this,W)})}r(se,p,{__proto__:null,value:function(P){return n(this,P)?!0:this!==se?!1:P&&P._writableState instanceof Q}}),se.prototype.pipe=function(){S(this,new C)};function z(P,F,W,ie){let Z=P._writableState;if(typeof W=="function")ie=W,W=Z.defaultEncoding;else{if(!W)W=Z.defaultEncoding;else if(W!=="buffer"&&!b.isEncoding(W))throw new ne(W);typeof ie!="function"&&(ie=H)}if(F===null)throw new V;if(!Z.objectMode)if(typeof F=="string")Z.decodeStrings!==!1&&(F=b.from(F,W),W="buffer");else if(F instanceof b)W="buffer";else if(m._isUint8Array(F))F=m._uint8ArrayToBuffer(F),W="buffer";else throw new v("chunk",["string","Buffer","Uint8Array"],F);let L;return Z.ending?L=new J:Z.destroyed&&(L=new T("write")),L?(t.nextTick(ie,L),S(P,L,!0),L):(Z.pendingcb++,ye(P,Z,F,W,ie))}se.prototype.write=function(P,F,W){return z(this,P,F,W)===!0},se.prototype.cork=function(){this._writableState.corked++},se.prototype.uncork=function(){let P=this._writableState;P.corked&&(P.corked--,P.writing||ue(this,P))},se.prototype.setDefaultEncoding=function(P){if(typeof P=="string"&&(P=l(P)),!b.isEncoding(P))throw new ne(P);return this._writableState.defaultEncoding=P,this};function ye(P,F,W,ie,Z){let L=F.objectMode?1:W.length;F.length+=L;let K=F.length<F.highWaterMark;return K||(F.needDrain=!0),F.writing||F.corked||F.errored||!F.constructed?(F.buffered.push({chunk:W,encoding:ie,callback:Z}),F.allBuffers&&ie!=="buffer"&&(F.allBuffers=!1),F.allNoop&&Z!==H&&(F.allNoop=!1)):(F.writelen=L,F.writecb=Z,F.writing=!0,F.sync=!0,P._write(W,ie,F.onwrite),F.sync=!1),K&&!F.errored&&!F.destroyed}function oe(P,F,W,ie,Z,L,K){F.writelen=ie,F.writecb=K,F.writing=!0,F.sync=!0,F.destroyed?F.onwrite(new T("write")):W?P._writev(Z,F.onwrite):P._write(Z,L,F.onwrite),F.sync=!1}function _e(P,F,W,ie){--F.pendingcb,ie(W),ve(F),S(P,W)}function _(P,F){let W=P._writableState,ie=W.sync,Z=W.writecb;if(typeof Z!="function"){S(P,new D);return}W.writing=!1,W.writecb=null,W.length-=W.writelen,W.writelen=0,F?(F.stack,W.errored||(W.errored=F),P._readableState&&!P._readableState.errored&&(P._readableState.errored=F),ie?t.nextTick(_e,P,W,F,Z):_e(P,W,F,Z)):(W.buffered.length>W.bufferedIndex&&ue(P,W),ie?W.afterWriteTickInfo!==null&&W.afterWriteTickInfo.cb===Z?W.afterWriteTickInfo.count++:(W.afterWriteTickInfo={count:1,cb:Z,stream:P,state:W},t.nextTick(G,W.afterWriteTickInfo)):de(P,W,1,Z))}function G({stream:P,state:F,count:W,cb:ie}){return F.afterWriteTickInfo=null,de(P,F,W,ie)}function de(P,F,W,ie){for(!F.ending&&!P.destroyed&&F.length===0&&F.needDrain&&(F.needDrain=!1,P.emit("drain"));W-- >0;)F.pendingcb--,ie();F.destroyed&&ve(F),fe(P,F)}function ve(P){if(P.writing)return;for(let Z=P.bufferedIndex;Z<P.buffered.length;++Z){var F;let{chunk:L,callback:K}=P.buffered[Z],B=P.objectMode?1:L.length;P.length-=B,K((F=P.errored)!==null&&F!==void 0?F:new T("write"))}let W=P[re].splice(0);for(let Z=0;Z<W.length;Z++){var ie;W[Z]((ie=P.errored)!==null&&ie!==void 0?ie:new T("end"))}me(P)}function ue(P,F){if(F.corked||F.bufferProcessing||F.destroyed||!F.constructed)return;let{buffered:W,bufferedIndex:ie,objectMode:Z}=F,L=W.length-ie;if(!L)return;let K=ie;if(F.bufferProcessing=!0,L>1&&P._writev){F.pendingcb-=L-1;let B=F.allNoop?H:q=>{for(let ce=K;ce<W.length;++ce)W[ce].callback(q)},j=F.allNoop&&K===0?W:a(W,K);j.allBuffers=F.allBuffers,oe(P,F,!0,F.length,j,"",B),me(F)}else{do{let{chunk:B,encoding:j,callback:q}=W[K];W[K++]=null;let ce=Z?1:B.length;oe(P,F,!1,ce,B,j,q)}while(K<W.length&&!F.writing);K===W.length?me(F):K>256?(W.splice(0,K),F.bufferedIndex=0):F.bufferedIndex=K}F.bufferProcessing=!1}se.prototype._write=function(P,F,W){if(this._writev)this._writev([{chunk:P,encoding:F}],W);else throw new U("_write()")},se.prototype._writev=null,se.prototype.end=function(P,F,W){let ie=this._writableState;typeof P=="function"?(W=P,P=null,F=null):typeof F=="function"&&(W=F,F=null);let Z;if(P!=null){let L=z(this,P,F);L instanceof h&&(Z=L)}return ie.corked&&(ie.corked=1,this.uncork()),Z||(!ie.errored&&!ie.ending?(ie.ending=!0,fe(this,ie,!0),ie.ended=!0):ie.finished?Z=new M("end"):ie.destroyed&&(Z=new T("end"))),typeof W=="function"&&(Z||ie.finished?t.nextTick(W,Z):ie[re].push(W)),this};function x(P){return P.ending&&!P.destroyed&&P.constructed&&P.length===0&&!P.errored&&P.buffered.length===0&&!P.finished&&!P.writing&&!P.errorEmitted&&!P.closeEmitted}function E(P,F){let W=!1;function ie(Z){if(W){S(P,Z??D());return}if(W=!0,F.pendingcb--,Z){let L=F[re].splice(0);for(let K=0;K<L.length;K++)L[K](Z);S(P,Z,F.sync)}else x(F)&&(F.prefinished=!0,P.emit("prefinish"),F.pendingcb++,t.nextTick(te,P,F))}F.sync=!0,F.pendingcb++;try{P._final(ie)}catch(Z){ie(Z)}F.sync=!1}function Y(P,F){!F.prefinished&&!F.finalCalled&&(typeof P._final=="function"&&!F.destroyed?(F.finalCalled=!0,E(P,F)):(F.prefinished=!0,P.emit("prefinish")))}function fe(P,F,W){x(F)&&(Y(P,F),F.pendingcb===0&&(W?(F.pendingcb++,t.nextTick((ie,Z)=>{x(Z)?te(ie,Z):Z.pendingcb--},P,F)):x(F)&&(F.pendingcb++,te(P,F))))}function te(P,F){F.pendingcb--,F.finished=!0;let W=F[re].splice(0);for(let ie=0;ie<W.length;ie++)W[ie]();if(P.emit("finish"),F.autoDestroy){let ie=P._readableState;(!ie||ie.autoDestroy&&(ie.endEmitted||ie.readable===!1))&&P.destroy()}}s(se.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(P){this._writableState&&(this._writableState.destroyed=P)}},writable:{__proto__:null,get(){let P=this._writableState;return!!P&&P.writable!==!1&&!P.destroyed&&!P.errored&&!P.ending&&!P.ended},set(P){this._writableState&&(this._writableState.writable=!!P)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let P=this._writableState;return P?!P.destroyed&&!P.ending&&P.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var X=y.destroy;se.prototype.destroy=function(P,F){let W=this._writableState;return!W.destroyed&&(W.bufferedIndex<W.buffered.length||W[re].length)&&t.nextTick(ve,W),X.call(this,P,F),this},se.prototype._undestroy=y.undestroy,se.prototype._destroy=function(P,F){F(P)},se.prototype[g.captureRejectionSymbol]=function(P){this.destroy(P)};var we;function ge(){return we===void 0&&(we={}),we}se.fromWeb=function(P,F){return ge().newStreamWritableFromWritableStream(P,F)},se.toWeb=function(P){return ge().newWritableStreamFromStreamWritable(P)}}),ah=be((e,i)=>{ae(),he(),le();var t=Ut(),a=(Je(),Ne(Ge)),{isReadable:h,isWritable:n,isIterable:r,isNodeStream:s,isReadableNodeStream:o,isWritableNodeStream:l,isDuplexNodeStream:f}=wt(),p=Pt(),{AbortError:g,codes:{ERR_INVALID_ARG_TYPE:m,ERR_INVALID_RETURN_VALUE:b}}=tt(),{destroyer:y}=Xt(),A=Et(),N=Ar(),{createDeferredPromise:k}=yt(),v=ns(),U=globalThis.Blob||a.Blob,D=typeof U<"u"?function(ne){return ne instanceof U}:function(ne){return!1},C=globalThis.AbortController||ei().AbortController,{FunctionPrototypeCall:T}=ze(),M=class extends A{constructor(ne){super(ne),(ne==null?void 0:ne.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(ne==null?void 0:ne.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};i.exports=function ne(S,H){if(f(S))return S;if(o(S))return J({readable:S});if(l(S))return J({writable:S});if(s(S))return J({writable:!1,readable:!1});if(typeof S=="function"){let{value:Q,write:me,final:se,destroy:z}=V(S);if(r(Q))return v(M,Q,{objectMode:!0,write:me,final:se,destroy:z});let ye=Q==null?void 0:Q.then;if(typeof ye=="function"){let oe,_e=T(ye,Q,_=>{if(_!=null)throw new b("nully","body",_)},_=>{y(oe,_)});return oe=new M({objectMode:!0,readable:!1,write:me,final(_){se(async()=>{try{await _e,t.nextTick(_,null)}catch(G){t.nextTick(_,G)}})},destroy:z})}throw new b("Iterable, AsyncIterable or AsyncFunction",H,Q)}if(D(S))return ne(S.arrayBuffer());if(r(S))return v(M,S,{objectMode:!0,writable:!1});if(typeof(S==null?void 0:S.writable)=="object"||typeof(S==null?void 0:S.readable)=="object"){let Q=S!=null&&S.readable?o(S==null?void 0:S.readable)?S==null?void 0:S.readable:ne(S.readable):void 0,me=S!=null&&S.writable?l(S==null?void 0:S.writable)?S==null?void 0:S.writable:ne(S.writable):void 0;return J({readable:Q,writable:me})}let re=S==null?void 0:S.then;if(typeof re=="function"){let Q;return T(re,S,me=>{me!=null&&Q.push(me),Q.push(null)},me=>{y(Q,me)}),Q=new M({objectMode:!0,writable:!1,read(){}})}throw new m(H,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],S)};function V(ne){let{promise:S,resolve:H}=k(),re=new C,Q=re.signal;return{value:ne(async function*(){for(;;){let me=S;S=null;let{chunk:se,done:z,cb:ye}=await me;if(t.nextTick(ye),z)return;if(Q.aborted)throw new g(void 0,{cause:Q.reason});({promise:S,resolve:H}=k()),yield se}}(),{signal:Q}),write(me,se,z){let ye=H;H=null,ye({chunk:me,done:!1,cb:z})},final(me){let se=H;H=null,se({done:!0,cb:me})},destroy(me,se){re.abort(),se(me)}}}function J(ne){let S=ne.readable&&typeof ne.readable.read!="function"?N.wrap(ne.readable):ne.readable,H=ne.writable,re=!!h(S),Q=!!n(H),me,se,z,ye,oe;function _e(_){let G=ye;ye=null,G?G(_):_&&oe.destroy(_)}return oe=new M({readableObjectMode:!!(S!=null&&S.readableObjectMode),writableObjectMode:!!(H!=null&&H.writableObjectMode),readable:re,writable:Q}),Q&&(p(H,_=>{Q=!1,_&&y(S,_),_e(_)}),oe._write=function(_,G,de){H.write(_,G)?de():me=de},oe._final=function(_){H.end(),se=_},H.on("drain",function(){if(me){let _=me;me=null,_()}}),H.on("finish",function(){if(se){let _=se;se=null,_()}})),re&&(p(S,_=>{re=!1,_&&y(S,_),_e(_)}),S.on("readable",function(){if(z){let _=z;z=null,_()}}),S.on("end",function(){oe.push(null)}),oe._read=function(){for(;;){let _=S.read();if(_===null){z=oe._read;return}if(!oe.push(_))return}}),oe._destroy=function(_,G){!_&&ye!==null&&(_=new g),z=null,me=null,se=null,ye===null?G(_):(ye=G,y(H,_),y(S,_))},oe}}),Et=be((e,i)=>{ae(),he(),le();var{ObjectDefineProperties:t,ObjectGetOwnPropertyDescriptor:a,ObjectKeys:h,ObjectSetPrototypeOf:n}=ze();i.exports=o;var r=Ar(),s=is();n(o.prototype,r.prototype),n(o,r);{let g=h(s.prototype);for(let m=0;m<g.length;m++){let b=g[m];o.prototype[b]||(o.prototype[b]=s.prototype[b])}}function o(g){if(!(this instanceof o))return new o(g);r.call(this,g),s.call(this,g),g?(this.allowHalfOpen=g.allowHalfOpen!==!1,g.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),g.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}t(o.prototype,{writable:{__proto__:null,...a(s.prototype,"writable")},writableHighWaterMark:{__proto__:null,...a(s.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...a(s.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...a(s.prototype,"writableBuffer")},writableLength:{__proto__:null,...a(s.prototype,"writableLength")},writableFinished:{__proto__:null,...a(s.prototype,"writableFinished")},writableCorked:{__proto__:null,...a(s.prototype,"writableCorked")},writableEnded:{__proto__:null,...a(s.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...a(s.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(g){this._readableState&&this._writableState&&(this._readableState.destroyed=g,this._writableState.destroyed=g)}}});var l;function f(){return l===void 0&&(l={}),l}o.fromWeb=function(g,m){return f().newStreamDuplexFromReadableWritablePair(g,m)},o.toWeb=function(g){return f().newReadableWritablePairFromDuplex(g)};var p;o.from=function(g){return p||(p=ah()),p(g,"body")}}),os=be((e,i)=>{ae(),he(),le();var{ObjectSetPrototypeOf:t,Symbol:a}=ze();i.exports=o;var{ERR_METHOD_NOT_IMPLEMENTED:h}=tt().codes,n=Et(),{getHighWaterMark:r}=oi();t(o.prototype,n.prototype),t(o,n);var s=a("kCallback");function o(p){if(!(this instanceof o))return new o(p);let g=p?r(this,p,"readableHighWaterMark",!0):null;g===0&&(p={...p,highWaterMark:null,readableHighWaterMark:g,writableHighWaterMark:p.writableHighWaterMark||0}),n.call(this,p),this._readableState.sync=!1,this[s]=null,p&&(typeof p.transform=="function"&&(this._transform=p.transform),typeof p.flush=="function"&&(this._flush=p.flush)),this.on("prefinish",f)}function l(p){typeof this._flush=="function"&&!this.destroyed?this._flush((g,m)=>{if(g){p?p(g):this.destroy(g);return}m!=null&&this.push(m),this.push(null),p&&p()}):(this.push(null),p&&p())}function f(){this._final!==l&&l.call(this)}o.prototype._final=l,o.prototype._transform=function(p,g,m){throw new h("_transform()")},o.prototype._write=function(p,g,m){let b=this._readableState,y=this._writableState,A=b.length;this._transform(p,g,(N,k)=>{if(N){m(N);return}k!=null&&this.push(k),y.ended||A===b.length||b.length<b.highWaterMark?m():this[s]=m})},o.prototype._read=function(){if(this[s]){let p=this[s];this[s]=null,p()}}}),ss=be((e,i)=>{ae(),he(),le();var{ObjectSetPrototypeOf:t}=ze();i.exports=h;var a=os();t(h.prototype,a.prototype),t(h,a);function h(n){if(!(this instanceof h))return new h(n);a.call(this,n)}h.prototype._transform=function(n,r,s){s(null,n)}}),pi=be((e,i)=>{ae(),he(),le();var t=Ut(),{ArrayIsArray:a,Promise:h,SymbolAsyncIterator:n}=ze(),r=Pt(),{once:s}=yt(),o=Xt(),l=Et(),{aggregateTwoErrors:f,codes:{ERR_INVALID_ARG_TYPE:p,ERR_INVALID_RETURN_VALUE:g,ERR_MISSING_ARGS:m,ERR_STREAM_DESTROYED:b,ERR_STREAM_PREMATURE_CLOSE:y},AbortError:A}=tt(),{validateFunction:N,validateAbortSignal:k}=br(),{isIterable:v,isReadable:U,isReadableNodeStream:D,isNodeStream:C,isTransformStream:T,isWebStream:M,isReadableStream:V,isReadableEnded:J}=wt(),ne=globalThis.AbortController||ei().AbortController,S,H;function re(G,de,ve){let ue=!1;G.on("close",()=>{ue=!0});let x=r(G,{readable:de,writable:ve},E=>{ue=!E});return{destroy:E=>{ue||(ue=!0,o.destroyer(G,E||new b("pipe")))},cleanup:x}}function Q(G){return N(G[G.length-1],"streams[stream.length - 1]"),G.pop()}function me(G){if(v(G))return G;if(D(G))return se(G);throw new p("val",["Readable","Iterable","AsyncIterable"],G)}async function*se(G){H||(H=Ar()),yield*H.prototype[n].call(G)}async function z(G,de,ve,{end:ue}){let x,E=null,Y=X=>{if(X&&(x=X),E){let we=E;E=null,we()}},fe=()=>new h((X,we)=>{x?we(x):E=()=>{x?we(x):X()}});de.on("drain",Y);let te=r(de,{readable:!1},Y);try{de.writableNeedDrain&&await fe();for await(let X of G)de.write(X)||await fe();ue&&de.end(),await fe(),ve()}catch(X){ve(x!==X?f(x,X):X)}finally{te(),de.off("drain",Y)}}async function ye(G,de,ve,{end:ue}){T(de)&&(de=de.writable);let x=de.getWriter();try{for await(let E of G)await x.ready,x.write(E).catch(()=>{});await x.ready,ue&&await x.close(),ve()}catch(E){try{await x.abort(E),ve(E)}catch(Y){ve(Y)}}}function oe(...G){return _e(G,s(Q(G)))}function _e(G,de,ve){if(G.length===1&&a(G[0])&&(G=G[0]),G.length<2)throw new m("streams");let ue=new ne,x=ue.signal,E=ve==null?void 0:ve.signal,Y=[];k(E,"options.signal");function fe(){F(new A)}E==null||E.addEventListener("abort",fe);let te,X,we=[],ge=0;function P(L){F(L,--ge===0)}function F(L,K){if(L&&(!te||te.code==="ERR_STREAM_PREMATURE_CLOSE")&&(te=L),!(!te&&!K)){for(;we.length;)we.shift()(te);E==null||E.removeEventListener("abort",fe),ue.abort(),K&&(te||Y.forEach(B=>B()),t.nextTick(de,te,X))}}let W;for(let L=0;L<G.length;L++){let K=G[L],B=L<G.length-1,j=L>0,q=B||(ve==null?void 0:ve.end)!==!1,ce=L===G.length-1;if(C(K)){let u=function(c){c&&c.name!=="AbortError"&&c.code!=="ERR_STREAM_PREMATURE_CLOSE"&&P(c)};if(q){let{destroy:c,cleanup:d}=re(K,B,j);we.push(c),U(K)&&ce&&Y.push(d)}K.on("error",u),U(K)&&ce&&Y.push(()=>{K.removeListener("error",u)})}if(L===0)if(typeof K=="function"){if(W=K({signal:x}),!v(W))throw new g("Iterable, AsyncIterable or Stream","source",W)}else v(K)||D(K)||T(K)?W=K:W=l.from(K);else if(typeof K=="function"){if(T(W)){var ie;W=me((ie=W)===null||ie===void 0?void 0:ie.readable)}else W=me(W);if(W=K(W,{signal:x}),B){if(!v(W,!0))throw new g("AsyncIterable",`transform[${L-1}]`,W)}else{var Z;S||(S=ss());let u=new S({objectMode:!0}),c=(Z=W)===null||Z===void 0?void 0:Z.then;if(typeof c=="function")ge++,c.call(W,I=>{X=I,I!=null&&u.write(I),q&&u.end(),t.nextTick(P)},I=>{u.destroy(I),t.nextTick(P,I)});else if(v(W,!0))ge++,z(W,u,P,{end:q});else if(V(W)||T(W)){let I=W.readable||W;ge++,z(I,u,P,{end:q})}else throw new g("AsyncIterable or Promise","destination",W);W=u;let{destroy:d,cleanup:w}=re(W,!1,!0);we.push(d),ce&&Y.push(w)}}else if(C(K)){if(D(W)){ge+=2;let u=_(W,K,P,{end:q});U(K)&&ce&&Y.push(u)}else if(T(W)||V(W)){let u=W.readable||W;ge++,z(u,K,P,{end:q})}else if(v(W))ge++,z(W,K,P,{end:q});else throw new p("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],W);W=K}else if(M(K)){if(D(W))ge++,ye(me(W),K,P,{end:q});else if(V(W)||v(W))ge++,ye(W,K,P,{end:q});else if(T(W))ge++,ye(W.readable,K,P,{end:q});else throw new p("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],W);W=K}else W=l.from(K)}return(x!=null&&x.aborted||E!=null&&E.aborted)&&t.nextTick(fe),W}function _(G,de,ve,{end:ue}){let x=!1;if(de.on("close",()=>{x||ve(new y)}),G.pipe(de,{end:!1}),ue){let E=function(){x=!0,de.end()};J(G)?t.nextTick(E):G.once("end",E)}else ve();return r(G,{readable:!0,writable:!1},E=>{let Y=G._readableState;E&&E.code==="ERR_STREAM_PREMATURE_CLOSE"&&Y&&Y.ended&&!Y.errored&&!Y.errorEmitted?G.once("end",ve).once("error",ve):ve(E)}),r(de,{readable:!1,writable:!0},ve)}i.exports={pipelineImpl:_e,pipeline:oe}}),as=be((e,i)=>{ae(),he(),le();var{pipeline:t}=pi(),a=Et(),{destroyer:h}=Xt(),{isNodeStream:n,isReadable:r,isWritable:s,isWebStream:o,isTransformStream:l,isWritableStream:f,isReadableStream:p}=wt(),{AbortError:g,codes:{ERR_INVALID_ARG_VALUE:m,ERR_MISSING_ARGS:b}}=tt(),y=Pt();i.exports=function(...A){if(A.length===0)throw new b("streams");if(A.length===1)return a.from(A[0]);let N=[...A];if(typeof A[0]=="function"&&(A[0]=a.from(A[0])),typeof A[A.length-1]=="function"){let S=A.length-1;A[S]=a.from(A[S])}for(let S=0;S<A.length;++S)if(!(!n(A[S])&&!o(A[S]))){if(S<A.length-1&&!(r(A[S])||p(A[S])||l(A[S])))throw new m(`streams[${S}]`,N[S],"must be readable");if(S>0&&!(s(A[S])||f(A[S])||l(A[S])))throw new m(`streams[${S}]`,N[S],"must be writable")}let k,v,U,D,C;function T(S){let H=D;D=null,H?H(S):S?C.destroy(S):!ne&&!J&&C.destroy()}let M=A[0],V=t(A,T),J=!!(s(M)||f(M)||l(M)),ne=!!(r(V)||p(V)||l(V));if(C=new a({writableObjectMode:!!(M!=null&&M.writableObjectMode),readableObjectMode:!!(V!=null&&V.writableObjectMode),writable:J,readable:ne}),J){if(n(M))C._write=function(H,re,Q){M.write(H,re)?Q():k=Q},C._final=function(H){M.end(),v=H},M.on("drain",function(){if(k){let H=k;k=null,H()}});else if(o(M)){let H=(l(M)?M.writable:M).getWriter();C._write=async function(re,Q,me){try{await H.ready,H.write(re).catch(()=>{}),me()}catch(se){me(se)}},C._final=async function(re){try{await H.ready,H.close().catch(()=>{}),v=re}catch(Q){re(Q)}}}let S=l(V)?V.readable:V;y(S,()=>{if(v){let H=v;v=null,H()}})}if(ne){if(n(V))V.on("readable",function(){if(U){let S=U;U=null,S()}}),V.on("end",function(){C.push(null)}),C._read=function(){for(;;){let S=V.read();if(S===null){U=C._read;return}if(!C.push(S))return}};else if(o(V)){let S=(l(V)?V.readable:V).getReader();C._read=async function(){for(;;)try{let{value:H,done:re}=await S.read();if(!C.push(H))return;if(re){C.push(null);return}}catch{return}}}}return C._destroy=function(S,H){!S&&D!==null&&(S=new g),U=null,k=null,v=null,D===null?H(S):(D=H,n(V)&&h(V,S))},C}}),lh=be((e,i)=>{ae(),he(),le();var t=globalThis.AbortController||ei().AbortController,{codes:{ERR_INVALID_ARG_VALUE:a,ERR_INVALID_ARG_TYPE:h,ERR_MISSING_ARGS:n,ERR_OUT_OF_RANGE:r},AbortError:s}=tt(),{validateAbortSignal:o,validateInteger:l,validateObject:f}=br(),p=ze().Symbol("kWeak"),{finished:g}=Pt(),m=as(),{addAbortSignalNoValidate:b}=wr(),{isWritable:y,isNodeStream:A}=wt(),{ArrayPrototypePush:N,MathFloor:k,Number:v,NumberIsNaN:U,Promise:D,PromiseReject:C,PromisePrototypeThen:T,Symbol:M}=ze(),V=M("kEmpty"),J=M("kEof");function ne(ue,x){if(x!=null&&f(x,"options"),(x==null?void 0:x.signal)!=null&&o(x.signal,"options.signal"),A(ue)&&!y(ue))throw new a("stream",ue,"must be writable");let E=m(this,ue);return x!=null&&x.signal&&b(x.signal,E),E}function S(ue,x){if(typeof ue!="function")throw new h("fn",["Function","AsyncFunction"],ue);x!=null&&f(x,"options"),(x==null?void 0:x.signal)!=null&&o(x.signal,"options.signal");let E=1;return(x==null?void 0:x.concurrency)!=null&&(E=k(x.concurrency)),l(E,"concurrency",1),(async function*(){var Y,fe;let te=new t,X=this,we=[],ge=te.signal,P={signal:ge},F=()=>te.abort();x!=null&&(Y=x.signal)!==null&&Y!==void 0&&Y.aborted&&F(),x==null||(fe=x.signal)===null||fe===void 0||fe.addEventListener("abort",F);let W,ie,Z=!1;function L(){Z=!0}async function K(){try{for await(let q of X){var B;if(Z)return;if(ge.aborted)throw new s;try{q=ue(q,P)}catch(ce){q=C(ce)}q!==V&&(typeof((B=q)===null||B===void 0?void 0:B.catch)=="function"&&q.catch(L),we.push(q),W&&(W(),W=null),!Z&&we.length&&we.length>=E&&await new D(ce=>{ie=ce}))}we.push(J)}catch(q){let ce=C(q);T(ce,void 0,L),we.push(ce)}finally{var j;Z=!0,W&&(W(),W=null),x==null||(j=x.signal)===null||j===void 0||j.removeEventListener("abort",F)}}K();try{for(;;){for(;we.length>0;){let B=await we[0];if(B===J)return;if(ge.aborted)throw new s;B!==V&&(yield B),we.shift(),ie&&(ie(),ie=null)}await new D(B=>{W=B})}}finally{te.abort(),Z=!0,ie&&(ie(),ie=null)}}).call(this)}function H(ue=void 0){return ue!=null&&f(ue,"options"),(ue==null?void 0:ue.signal)!=null&&o(ue.signal,"options.signal"),(async function*(){let x=0;for await(let Y of this){var E;if(ue!=null&&(E=ue.signal)!==null&&E!==void 0&&E.aborted)throw new s({cause:ue.signal.reason});yield[x++,Y]}}).call(this)}async function re(ue,x=void 0){for await(let E of z.call(this,ue,x))return!0;return!1}async function Q(ue,x=void 0){if(typeof ue!="function")throw new h("fn",["Function","AsyncFunction"],ue);return!await re.call(this,async(...E)=>!await ue(...E),x)}async function me(ue,x){for await(let E of z.call(this,ue,x))return E}async function se(ue,x){if(typeof ue!="function")throw new h("fn",["Function","AsyncFunction"],ue);async function E(Y,fe){return await ue(Y,fe),V}for await(let Y of S.call(this,E,x));}function z(ue,x){if(typeof ue!="function")throw new h("fn",["Function","AsyncFunction"],ue);async function E(Y,fe){return await ue(Y,fe)?Y:V}return S.call(this,E,x)}var ye=class extends n{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function oe(ue,x,E){var Y;if(typeof ue!="function")throw new h("reducer",["Function","AsyncFunction"],ue);E!=null&&f(E,"options"),(E==null?void 0:E.signal)!=null&&o(E.signal,"options.signal");let fe=arguments.length>1;if(E!=null&&(Y=E.signal)!==null&&Y!==void 0&&Y.aborted){let P=new s(void 0,{cause:E.signal.reason});throw this.once("error",()=>{}),await g(this.destroy(P)),P}let te=new t,X=te.signal;if(E!=null&&E.signal){let P={once:!0,[p]:this};E.signal.addEventListener("abort",()=>te.abort(),P)}let we=!1;try{for await(let P of this){var ge;if(we=!0,E!=null&&(ge=E.signal)!==null&&ge!==void 0&&ge.aborted)throw new s;fe?x=await ue(x,P,{signal:X}):(x=P,fe=!0)}if(!we&&!fe)throw new ye}finally{te.abort()}return x}async function _e(ue){ue!=null&&f(ue,"options"),(ue==null?void 0:ue.signal)!=null&&o(ue.signal,"options.signal");let x=[];for await(let Y of this){var E;if(ue!=null&&(E=ue.signal)!==null&&E!==void 0&&E.aborted)throw new s(void 0,{cause:ue.signal.reason});N(x,Y)}return x}function _(ue,x){let E=S.call(this,ue,x);return(async function*(){for await(let Y of E)yield*Y}).call(this)}function G(ue){if(ue=v(ue),U(ue))return 0;if(ue<0)throw new r("number",">= 0",ue);return ue}function de(ue,x=void 0){return x!=null&&f(x,"options"),(x==null?void 0:x.signal)!=null&&o(x.signal,"options.signal"),ue=G(ue),(async function*(){var E;if(x!=null&&(E=x.signal)!==null&&E!==void 0&&E.aborted)throw new s;for await(let fe of this){var Y;if(x!=null&&(Y=x.signal)!==null&&Y!==void 0&&Y.aborted)throw new s;ue--<=0&&(yield fe)}}).call(this)}function ve(ue,x=void 0){return x!=null&&f(x,"options"),(x==null?void 0:x.signal)!=null&&o(x.signal,"options.signal"),ue=G(ue),(async function*(){var E;if(x!=null&&(E=x.signal)!==null&&E!==void 0&&E.aborted)throw new s;for await(let fe of this){var Y;if(x!=null&&(Y=x.signal)!==null&&Y!==void 0&&Y.aborted)throw new s;if(ue-- >0)yield fe;else return}}).call(this)}i.exports.streamReturningOperators={asIndexedPairs:H,drop:de,filter:z,flatMap:_,map:S,take:ve,compose:ne},i.exports.promiseReturningOperators={every:Q,forEach:se,reduce:oe,toArray:_e,some:re,find:me}}),ls=be((e,i)=>{ae(),he(),le();var{ArrayPrototypePop:t,Promise:a}=ze(),{isIterable:h,isNodeStream:n,isWebStream:r}=wt(),{pipelineImpl:s}=pi(),{finished:o}=Pt();hs();function l(...f){return new a((p,g)=>{let m,b,y=f[f.length-1];if(y&&typeof y=="object"&&!n(y)&&!h(y)&&!r(y)){let A=t(f);m=A.signal,b=A.end}s(f,(A,N)=>{A?g(A):p(N)},{signal:m,end:b})})}i.exports={finished:o,pipeline:l}}),hs=be((e,i)=>{ae(),he(),le();var{Buffer:t}=(Je(),Ne(Ge)),{ObjectDefineProperty:a,ObjectKeys:h,ReflectApply:n}=ze(),{promisify:{custom:r}}=yt(),{streamReturningOperators:s,promiseReturningOperators:o}=lh(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:l}}=tt(),f=as(),{pipeline:p}=pi(),{destroyer:g}=Xt(),m=Pt(),b=ls(),y=wt(),A=i.exports=ii().Stream;A.isDisturbed=y.isDisturbed,A.isErrored=y.isErrored,A.isReadable=y.isReadable,A.Readable=Ar();for(let k of h(s)){let v=function(...D){if(new.target)throw l();return A.Readable.from(n(U,this,D))},U=s[k];a(v,"name",{__proto__:null,value:U.name}),a(v,"length",{__proto__:null,value:U.length}),a(A.Readable.prototype,k,{__proto__:null,value:v,enumerable:!1,configurable:!0,writable:!0})}for(let k of h(o)){let v=function(...D){if(new.target)throw l();return n(U,this,D)},U=o[k];a(v,"name",{__proto__:null,value:U.name}),a(v,"length",{__proto__:null,value:U.length}),a(A.Readable.prototype,k,{__proto__:null,value:v,enumerable:!1,configurable:!0,writable:!0})}A.Writable=is(),A.Duplex=Et(),A.Transform=os(),A.PassThrough=ss(),A.pipeline=p;var{addAbortSignal:N}=wr();A.addAbortSignal=N,A.finished=m,A.destroy=g,A.compose=f,a(A,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return b}}),a(p,r,{__proto__:null,enumerable:!0,get(){return b.pipeline}}),a(m,r,{__proto__:null,enumerable:!0,get(){return b.finished}}),A.Stream=A,A._isUint8Array=function(k){return k instanceof Uint8Array},A._uint8ArrayToBuffer=function(k){return t.from(k.buffer,k.byteOffset,k.byteLength)}}),qt=be((e,i)=>{ae(),he(),le();var t=hs(),a=ls(),h=t.Readable.destroy;i.exports=t.Readable,i.exports._uint8ArrayToBuffer=t._uint8ArrayToBuffer,i.exports._isUint8Array=t._isUint8Array,i.exports.isDisturbed=t.isDisturbed,i.exports.isErrored=t.isErrored,i.exports.isReadable=t.isReadable,i.exports.Readable=t.Readable,i.exports.Writable=t.Writable,i.exports.Duplex=t.Duplex,i.exports.Transform=t.Transform,i.exports.PassThrough=t.PassThrough,i.exports.addAbortSignal=t.addAbortSignal,i.exports.finished=t.finished,i.exports.destroy=t.destroy,i.exports.destroy=h,i.exports.pipeline=t.pipeline,i.exports.compose=t.compose,Object.defineProperty(t,"promises",{configurable:!0,enumerable:!0,get(){return a}}),i.exports.Stream=t.Stream,i.exports.default=i.exports}),hh=be((e,i)=>{ae(),he(),le(),typeof Object.create=="function"?i.exports=function(t,a){a&&(t.super_=a,t.prototype=Object.create(a.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:i.exports=function(t,a){if(a){t.super_=a;var h=function(){};h.prototype=a.prototype,t.prototype=new h,t.prototype.constructor=t}}}),ch=be((e,i)=>{ae(),he(),le();var{Buffer:t}=(Je(),Ne(Ge)),a=Symbol.for("BufferList");function h(n){if(!(this instanceof h))return new h(n);h._init.call(this,n)}h._init=function(n){Object.defineProperty(this,a,{value:!0}),this._bufs=[],this.length=0,n&&this.append(n)},h.prototype._new=function(n){return new h(n)},h.prototype._offset=function(n){if(n===0)return[0,0];let r=0;for(let s=0;s<this._bufs.length;s++){let o=r+this._bufs[s].length;if(n<o||s===this._bufs.length-1)return[s,n-r];r=o}},h.prototype._reverseOffset=function(n){let r=n[0],s=n[1];for(let o=0;o<r;o++)s+=this._bufs[o].length;return s},h.prototype.get=function(n){if(n>this.length||n<0)return;let r=this._offset(n);return this._bufs[r[0]][r[1]]},h.prototype.slice=function(n,r){return typeof n=="number"&&n<0&&(n+=this.length),typeof r=="number"&&r<0&&(r+=this.length),this.copy(null,0,n,r)},h.prototype.copy=function(n,r,s,o){if((typeof s!="number"||s<0)&&(s=0),(typeof o!="number"||o>this.length)&&(o=this.length),s>=this.length||o<=0)return n||t.alloc(0);let l=!!n,f=this._offset(s),p=o-s,g=p,m=l&&r||0,b=f[1];if(s===0&&o===this.length){if(!l)return this._bufs.length===1?this._bufs[0]:t.concat(this._bufs,this.length);for(let y=0;y<this._bufs.length;y++)this._bufs[y].copy(n,m),m+=this._bufs[y].length;return n}if(g<=this._bufs[f[0]].length-b)return l?this._bufs[f[0]].copy(n,r,b,b+g):this._bufs[f[0]].slice(b,b+g);l||(n=t.allocUnsafe(p));for(let y=f[0];y<this._bufs.length;y++){let A=this._bufs[y].length-b;if(g>A)this._bufs[y].copy(n,m,b),m+=A;else{this._bufs[y].copy(n,m,b,b+g),m+=A;break}g-=A,b&&(b=0)}return n.length>m?n.slice(0,m):n},h.prototype.shallowSlice=function(n,r){if(n=n||0,r=typeof r!="number"?this.length:r,n<0&&(n+=this.length),r<0&&(r+=this.length),n===r)return this._new();let s=this._offset(n),o=this._offset(r),l=this._bufs.slice(s[0],o[0]+1);return o[1]===0?l.pop():l[l.length-1]=l[l.length-1].slice(0,o[1]),s[1]!==0&&(l[0]=l[0].slice(s[1])),this._new(l)},h.prototype.toString=function(n,r,s){return this.slice(r,s).toString(n)},h.prototype.consume=function(n){if(n=Math.trunc(n),Number.isNaN(n)||n<=0)return this;for(;this._bufs.length;)if(n>=this._bufs[0].length)n-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(n),this.length-=n;break}return this},h.prototype.duplicate=function(){let n=this._new();for(let r=0;r<this._bufs.length;r++)n.append(this._bufs[r]);return n},h.prototype.append=function(n){if(n==null)return this;if(n.buffer)this._appendBuffer(t.from(n.buffer,n.byteOffset,n.byteLength));else if(Array.isArray(n))for(let r=0;r<n.length;r++)this.append(n[r]);else if(this._isBufferList(n))for(let r=0;r<n._bufs.length;r++)this.append(n._bufs[r]);else typeof n=="number"&&(n=n.toString()),this._appendBuffer(t.from(n));return this},h.prototype._appendBuffer=function(n){this._bufs.push(n),this.length+=n.length},h.prototype.indexOf=function(n,r,s){if(s===void 0&&typeof r=="string"&&(s=r,r=void 0),typeof n=="function"||Array.isArray(n))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof n=="number"?n=t.from([n]):typeof n=="string"?n=t.from(n,s):this._isBufferList(n)?n=n.slice():Array.isArray(n.buffer)?n=t.from(n.buffer,n.byteOffset,n.byteLength):t.isBuffer(n)||(n=t.from(n)),r=Number(r||0),isNaN(r)&&(r=0),r<0&&(r=this.length+r),r<0&&(r=0),n.length===0)return r>this.length?this.length:r;let o=this._offset(r),l=o[0],f=o[1];for(;l<this._bufs.length;l++){let p=this._bufs[l];for(;f<p.length;)if(p.length-f>=n.length){let g=p.indexOf(n,f);if(g!==-1)return this._reverseOffset([l,g]);f=p.length-n.length+1}else{let g=this._reverseOffset([l,f]);if(this._match(g,n))return g;f++}f=0}return-1},h.prototype._match=function(n,r){if(this.length-n<r.length)return!1;for(let s=0;s<r.length;s++)if(this.get(n+s)!==r[s])return!1;return!0},function(){let n={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 r in n)(function(s){n[s]===null?h.prototype[s]=function(o,l){return this.slice(o,o+l)[s](0,l)}:h.prototype[s]=function(o=0){return this.slice(o,o+n[s])[s](0)}})(r)}(),h.prototype._isBufferList=function(n){return n instanceof h||h.isBufferList(n)},h.isBufferList=function(n){return n!=null&&n[a]},i.exports=h}),uh=be((e,i)=>{ae(),he(),le();var t=qt().Duplex,a=hh(),h=ch();function n(r){if(!(this instanceof n))return new n(r);if(typeof r=="function"){this._callback=r;let s=(function(o){this._callback&&(this._callback(o),this._callback=null)}).bind(this);this.on("pipe",function(o){o.on("error",s)}),this.on("unpipe",function(o){o.removeListener("error",s)}),r=null}h._init.call(this,r),t.call(this)}a(n,t),Object.assign(n.prototype,h.prototype),n.prototype._new=function(r){return new n(r)},n.prototype._write=function(r,s,o){this._appendBuffer(r),typeof o=="function"&&o()},n.prototype._read=function(r){if(!this.length)return this.push(null);r=Math.min(r,this.length),this.push(this.slice(0,r)),this.consume(r)},n.prototype.end=function(r){t.prototype.end.call(this,r),this._callback&&(this._callback(null,this.slice()),this._callback=null)},n.prototype._destroy=function(r,s){this._bufs.length=0,this.length=0,s(r)},n.prototype._isBufferList=function(r){return r instanceof n||r instanceof h||n.isBufferList(r)},n.isBufferList=h.isBufferList,i.exports=n,i.exports.BufferListStream=n,i.exports.BufferList=h}),fh=be((e,i)=>{ae(),he(),le();var t=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}};i.exports=t}),cs=be((e,i)=>{ae(),he(),le();var t=i.exports,{Buffer:a}=(Je(),Ne(Ge));t.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"},t.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},t.requiredHeaderFlagsErrors={};for(let n in t.requiredHeaderFlags){let r=t.requiredHeaderFlags[n];t.requiredHeaderFlagsErrors[n]="Invalid header flag bits, must be 0x"+r.toString(16)+" for "+t.types[n]+" packet"}t.codes={};for(let n in t.types){let r=t.types[n];t.codes[r]=n}t.CMD_SHIFT=4,t.CMD_MASK=240,t.DUP_MASK=8,t.QOS_MASK=3,t.QOS_SHIFT=1,t.RETAIN_MASK=1,t.VARBYTEINT_MASK=127,t.VARBYTEINT_FIN_MASK=128,t.VARBYTEINT_MAX=268435455,t.SESSIONPRESENT_MASK=1,t.SESSIONPRESENT_HEADER=a.from([t.SESSIONPRESENT_MASK]),t.CONNACK_HEADER=a.from([t.codes.connack<<t.CMD_SHIFT]),t.USERNAME_MASK=128,t.PASSWORD_MASK=64,t.WILL_RETAIN_MASK=32,t.WILL_QOS_MASK=24,t.WILL_QOS_SHIFT=3,t.WILL_FLAG_MASK=4,t.CLEAN_SESSION_MASK=2,t.CONNECT_HEADER=a.from([t.codes.connect<<t.CMD_SHIFT]),t.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},t.propertiesCodes={};for(let n in t.properties){let r=t.properties[n];t.propertiesCodes[r]=n}t.propertiesTypes={sessionExpiryInterval:"int32",willDelayInterval:"int32",receiveMaximum:"int16",maximumPacketSize:"int32",topicAliasMaximum:"int16",requestResponseInformation:"byte",requestProblemInformation:"byte",userProperties:"pair",authenticationMethod:"string",authenticationData:"binary",payloadFormatIndicator:"byte",messageExpiryInterval:"int32",contentType:"string",responseTopic:"string",correlationData:"binary",maximumQoS:"int8",retainAvailable:"byte",assignedClientIdentifier:"string",reasonString:"string",wildcardSubscriptionAvailable:"byte",subscriptionIdentifiersAvailable:"byte",sharedSubscriptionAvailable:"byte",serverKeepAlive:"int16",responseInformation:"string",serverReference:"string",topicAlias:"int16",subscriptionIdentifier:"var"};function h(n){return[0,1,2].map(r=>[0,1].map(s=>[0,1].map(o=>{let l=a.alloc(1);return l.writeUInt8(t.codes[n]<<t.CMD_SHIFT|(s?t.DUP_MASK:0)|r<<t.QOS_SHIFT|o,0,!0),l})))}t.PUBLISH_HEADER=h("publish"),t.SUBSCRIBE_HEADER=h("subscribe"),t.SUBSCRIBE_OPTIONS_QOS_MASK=3,t.SUBSCRIBE_OPTIONS_NL_MASK=1,t.SUBSCRIBE_OPTIONS_NL_SHIFT=2,t.SUBSCRIBE_OPTIONS_RAP_MASK=1,t.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,t.SUBSCRIBE_OPTIONS_RH_MASK=3,t.SUBSCRIBE_OPTIONS_RH_SHIFT=4,t.SUBSCRIBE_OPTIONS_RH=[0,16,32],t.SUBSCRIBE_OPTIONS_NL=4,t.SUBSCRIBE_OPTIONS_RAP=8,t.SUBSCRIBE_OPTIONS_QOS=[0,1,2],t.UNSUBSCRIBE_HEADER=h("unsubscribe"),t.ACKS={unsuback:h("unsuback"),puback:h("puback"),pubcomp:h("pubcomp"),pubrel:h("pubrel"),pubrec:h("pubrec")},t.SUBACK_HEADER=a.from([t.codes.suback<<t.CMD_SHIFT]),t.VERSION3=a.from([3]),t.VERSION4=a.from([4]),t.VERSION5=a.from([5]),t.VERSION131=a.from([131]),t.VERSION132=a.from([132]),t.QOS=[0,1,2].map(n=>a.from([n])),t.EMPTY={pingreq:a.from([t.codes.pingreq<<4,0]),pingresp:a.from([t.codes.pingresp<<4,0]),disconnect:a.from([t.codes.disconnect<<4,0])},t.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"},t.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"},t.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"},t.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"},t.MQTT5_DISCONNECT_CODES={0:"Normal disconnection",4:"Disconnect with Will Message",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",135:"Not authorized",137:"Server busy",139:"Server shutting down",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},t.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}}),dh=be((e,i)=>{ae(),he(),le();var t=1e3,a=t*60,h=a*60,n=h*24,r=n*7,s=n*365.25;i.exports=function(g,m){m=m||{};var b=typeof g;if(b==="string"&&g.length>0)return o(g);if(b==="number"&&isFinite(g))return m.long?f(g):l(g);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(g))};function o(g){if(g=String(g),!(g.length>100)){var m=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(g);if(m){var b=parseFloat(m[1]),y=(m[2]||"ms").toLowerCase();switch(y){case"years":case"year":case"yrs":case"yr":case"y":return b*s;case"weeks":case"week":case"w":return b*r;case"days":case"day":case"d":return b*n;case"hours":case"hour":case"hrs":case"hr":case"h":return b*h;case"minutes":case"minute":case"mins":case"min":case"m":return b*a;case"seconds":case"second":case"secs":case"sec":case"s":return b*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return b;default:return}}}}function l(g){var m=Math.abs(g);return m>=n?Math.round(g/n)+"d":m>=h?Math.round(g/h)+"h":m>=a?Math.round(g/a)+"m":m>=t?Math.round(g/t)+"s":g+"ms"}function f(g){var m=Math.abs(g);return m>=n?p(g,m,n,"day"):m>=h?p(g,m,h,"hour"):m>=a?p(g,m,a,"minute"):m>=t?p(g,m,t,"second"):g+" ms"}function p(g,m,b,y){var A=m>=b*1.5;return Math.round(g/b)+" "+y+(A?"s":"")}}),ph=be((e,i)=>{ae(),he(),le();function t(a){n.debug=n,n.default=n,n.coerce=p,n.disable=o,n.enable=s,n.enabled=l,n.humanize=dh(),n.destroy=g,Object.keys(a).forEach(m=>{n[m]=a[m]}),n.names=[],n.skips=[],n.formatters={};function h(m){let b=0;for(let y=0;y<m.length;y++)b=(b<<5)-b+m.charCodeAt(y),b|=0;return n.colors[Math.abs(b)%n.colors.length]}n.selectColor=h;function n(m){let b,y=null,A,N;function k(...v){if(!k.enabled)return;let U=k,D=Number(new Date),C=D-(b||D);U.diff=C,U.prev=b,U.curr=D,b=D,v[0]=n.coerce(v[0]),typeof v[0]!="string"&&v.unshift("%O");let T=0;v[0]=v[0].replace(/%([a-zA-Z%])/g,(M,V)=>{if(M==="%%")return"%";T++;let J=n.formatters[V];if(typeof J=="function"){let ne=v[T];M=J.call(U,ne),v.splice(T,1),T--}return M}),n.formatArgs.call(U,v),(U.log||n.log).apply(U,v)}return k.namespace=m,k.useColors=n.useColors(),k.color=n.selectColor(m),k.extend=r,k.destroy=n.destroy,Object.defineProperty(k,"enabled",{enumerable:!0,configurable:!1,get:()=>y!==null?y:(A!==n.namespaces&&(A=n.namespaces,N=n.enabled(m)),N),set:v=>{y=v}}),typeof n.init=="function"&&n.init(k),k}function r(m,b){let y=n(this.namespace+(typeof b>"u"?":":b)+m);return y.log=this.log,y}function s(m){n.save(m),n.namespaces=m,n.names=[],n.skips=[];let b,y=(typeof m=="string"?m:"").split(/[\s,]+/),A=y.length;for(b=0;b<A;b++)y[b]&&(m=y[b].replace(/\*/g,".*?"),m[0]==="-"?n.skips.push(new RegExp("^"+m.slice(1)+"$")):n.names.push(new RegExp("^"+m+"$")))}function o(){let m=[...n.names.map(f),...n.skips.map(f).map(b=>"-"+b)].join(",");return n.enable(""),m}function l(m){if(m[m.length-1]==="*")return!0;let b,y;for(b=0,y=n.skips.length;b<y;b++)if(n.skips[b].test(m))return!1;for(b=0,y=n.names.length;b<y;b++)if(n.names[b].test(m))return!0;return!1}function f(m){return m.toString().substring(2,m.toString().length-2).replace(/\.\*\?$/,"*")}function p(m){return m instanceof Error?m.stack||m.message:m}function g(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}i.exports=t}),St=be((e,i)=>{ae(),he(),le(),e.formatArgs=a,e.save=h,e.load=n,e.useColors=t,e.storage=r(),e.destroy=(()=>{let o=!1;return()=>{o||(o=!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","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function t(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a(o){if(o[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+o[0]+(this.useColors?"%c ":" ")+"+"+i.exports.humanize(this.diff),!this.useColors)return;let l="color: "+this.color;o.splice(1,0,l,"color: inherit");let f=0,p=0;o[0].replace(/%[a-zA-Z%]/g,g=>{g!=="%%"&&(f++,g==="%c"&&(p=f))}),o.splice(p,0,l)}e.log=console.debug||console.log||(()=>{});function h(o){try{o?e.storage.setItem("debug",o):e.storage.removeItem("debug")}catch{}}function n(){let o;try{o=e.storage.getItem("debug")}catch{}return!o&&typeof Re<"u"&&"env"in Re&&(o=Re.env.DEBUG),o}function r(){try{return localStorage}catch{}}i.exports=ph()(e);var{formatters:s}=i.exports;s.j=function(o){try{return JSON.stringify(o)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}}),gh=be((e,i)=>{ae(),he(),le();var t=uh(),{EventEmitter:a}=(er(),Ne(Dt)),h=fh(),n=cs(),r=St()("mqtt-packet:parser"),s=class Mi extends a{constructor(){super(),this.parser=this.constructor.parser}static parser(l){return this instanceof Mi?(this.settings=l||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new Mi().parser(l)}_resetState(){r("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new h,this.error=null,this._list=t(),this._stateCounter=0}parse(l){for(this.error&&this._resetState(),this._list.append(l),r("parse: current state: %s",this._states[this._stateCounter]);(this.packet.length!==-1||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,r("parse: state complete. _stateCounter is now: %d",this._stateCounter),r("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return r("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){let l=this._list.readUInt8(0),f=l>>n.CMD_SHIFT;this.packet.cmd=n.types[f];let p=l&15,g=n.requiredHeaderFlags[f];return g!=null&&p!==g?this._emitError(new Error(n.requiredHeaderFlagsErrors[f])):(this.packet.retain=(l&n.RETAIN_MASK)!==0,this.packet.qos=l>>n.QOS_SHIFT&n.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=(l&n.DUP_MASK)!==0,r("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){let l=this._parseVarByteNum(!0);return l&&(this.packet.length=l.value,this._list.consume(l.bytes)),r("_parseLength %d",l.value),!!l}_parsePayload(){r("_parsePayload: payload %O",this._list);let l=!1;if(this.packet.length===0||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}l=!0}return r("_parsePayload complete result: %s",l),l}_parseConnect(){r("_parseConnect");let l,f,p,g,m={},b=this.packet,y=this._parseString();if(y===null)return this._emitError(new Error("Cannot parse protocolId"));if(y!=="MQTT"&&y!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(b.protocolId=y,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(b.protocolVersion=this._list.readUInt8(this._pos),b.protocolVersion>=128&&(b.bridgeMode=!0,b.protocolVersion=b.protocolVersion-128),b.protocolVersion!==3&&b.protocolVersion!==4&&b.protocolVersion!==5)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(this._list.readUInt8(this._pos)&1)return this._emitError(new Error("Connect flag bit 0 must be 0, but got 1"));m.username=this._list.readUInt8(this._pos)&n.USERNAME_MASK,m.password=this._list.readUInt8(this._pos)&n.PASSWORD_MASK,m.will=this._list.readUInt8(this._pos)&n.WILL_FLAG_MASK;let A=!!(this._list.readUInt8(this._pos)&n.WILL_RETAIN_MASK),N=(this._list.readUInt8(this._pos)&n.WILL_QOS_MASK)>>n.WILL_QOS_SHIFT;if(m.will)b.will={},b.will.retain=A,b.will.qos=N;else{if(A)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(N)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(b.clean=(this._list.readUInt8(this._pos)&n.CLEAN_SESSION_MASK)!==0,this._pos++,b.keepalive=this._parseNum(),b.keepalive===-1)return this._emitError(new Error("Packet too short"));if(b.protocolVersion===5){let v=this._parseProperties();Object.getOwnPropertyNames(v).length&&(b.properties=v)}let k=this._parseString();if(k===null)return this._emitError(new Error("Packet too short"));if(b.clientId=k,r("_parseConnect: packet.clientId: %s",b.clientId),m.will){if(b.protocolVersion===5){let v=this._parseProperties();Object.getOwnPropertyNames(v).length&&(b.will.properties=v)}if(l=this._parseString(),l===null)return this._emitError(new Error("Cannot parse will topic"));if(b.will.topic=l,r("_parseConnect: packet.will.topic: %s",b.will.topic),f=this._parseBuffer(),f===null)return this._emitError(new Error("Cannot parse will payload"));b.will.payload=f,r("_parseConnect: packet.will.paylaod: %s",b.will.payload)}if(m.username){if(g=this._parseString(),g===null)return this._emitError(new Error("Cannot parse username"));b.username=g,r("_parseConnect: packet.username: %s",b.username)}if(m.password){if(p=this._parseBuffer(),p===null)return this._emitError(new Error("Cannot parse password"));b.password=p}return this.settings=b,r("_parseConnect: complete"),b}_parseConnack(){r("_parseConnack");let l=this.packet;if(this._list.length<1)return null;let f=this._list.readUInt8(this._pos++);if(f>1)return this._emitError(new Error("Invalid connack flags, bits 7-1 must be set to 0"));if(l.sessionPresent=!!(f&n.SESSIONPRESENT_MASK),this.settings.protocolVersion===5)this._list.length>=2?l.reasonCode=this._list.readUInt8(this._pos++):l.reasonCode=0;else{if(this._list.length<2)return null;l.returnCode=this._list.readUInt8(this._pos++)}if(l.returnCode===-1||l.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){let p=this._parseProperties();Object.getOwnPropertyNames(p).length&&(l.properties=p)}r("_parseConnack: complete")}_parsePublish(){r("_parsePublish");let l=this.packet;if(l.topic=this._parseString(),l.topic===null)return this._emitError(new Error("Cannot parse topic"));if(!(l.qos>0&&!this._parseMessageId())){if(this.settings.protocolVersion===5){let f=this._parseProperties();Object.getOwnPropertyNames(f).length&&(l.properties=f)}l.payload=this._list.slice(this._pos,l.length),r("_parsePublish: payload from buffer list: %o",l.payload)}}_parseSubscribe(){r("_parseSubscribe");let l=this.packet,f,p,g,m,b,y,A;if(l.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let N=this._parseProperties();Object.getOwnPropertyNames(N).length&&(l.properties=N)}if(l.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<l.length;){if(f=this._parseString(),f===null)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=l.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(p=this._parseByte(),this.settings.protocolVersion===5){if(p&192)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(p&252)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(g=p&n.SUBSCRIBE_OPTIONS_QOS_MASK,g>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(y=(p>>n.SUBSCRIBE_OPTIONS_NL_SHIFT&n.SUBSCRIBE_OPTIONS_NL_MASK)!==0,b=(p>>n.SUBSCRIBE_OPTIONS_RAP_SHIFT&n.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,m=p>>n.SUBSCRIBE_OPTIONS_RH_SHIFT&n.SUBSCRIBE_OPTIONS_RH_MASK,m>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));A={topic:f,qos:g},this.settings.protocolVersion===5?(A.nl=y,A.rap=b,A.rh=m):this.settings.bridgeMode&&(A.rh=0,A.rap=!0,A.nl=!0),r("_parseSubscribe: push subscription `%s` to subscription",A),l.subscriptions.push(A)}}}_parseSuback(){r("_parseSuback");let l=this.packet;if(this.packet.granted=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let f=this._parseProperties();Object.getOwnPropertyNames(f).length&&(l.properties=f)}if(l.length<=0)return this._emitError(new Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){let f=this._list.readUInt8(this._pos++);if(this.settings.protocolVersion===5){if(!n.MQTT5_SUBACK_CODES[f])return this._emitError(new Error("Invalid suback code"))}else if(f>2&&f!==128)return this._emitError(new Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(f)}}}_parseUnsubscribe(){r("_parseUnsubscribe");let l=this.packet;if(l.unsubscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let f=this._parseProperties();Object.getOwnPropertyNames(f).length&&(l.properties=f)}if(l.length<=0)return this._emitError(new Error("Malformed unsubscribe, no payload specified"));for(;this._pos<l.length;){let f=this._parseString();if(f===null)return this._emitError(new Error("Cannot parse topic"));r("_parseUnsubscribe: push topic `%s` to unsubscriptions",f),l.unsubscriptions.push(f)}}}_parseUnsuback(){r("_parseUnsuback");let l=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if((this.settings.protocolVersion===3||this.settings.protocolVersion===4)&&l.length!==2)return this._emitError(new Error("Malformed unsuback, payload length must be 2"));if(l.length<=0)return this._emitError(new Error("Malformed unsuback, no payload specified"));if(this.settings.protocolVersion===5){let f=this._parseProperties();for(Object.getOwnPropertyNames(f).length&&(l.properties=f),l.granted=[];this._pos<this.packet.length;){let p=this._list.readUInt8(this._pos++);if(!n.MQTT5_UNSUBACK_CODES[p])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(p)}}}_parseConfirmation(){r("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);let l=this.packet;if(this._parseMessageId(),this.settings.protocolVersion===5){if(l.length>2){switch(l.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!n.MQTT5_PUBACK_PUBREC_CODES[l.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!n.MQTT5_PUBREL_PUBCOMP_CODES[l.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break}r("_parseConfirmation: packet.reasonCode `%d`",l.reasonCode)}else l.reasonCode=0;if(l.length>3){let f=this._parseProperties();Object.getOwnPropertyNames(f).length&&(l.properties=f)}}return!0}_parseDisconnect(){let l=this.packet;if(r("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?(l.reasonCode=this._parseByte(),n.MQTT5_DISCONNECT_CODES[l.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):l.reasonCode=0;let f=this._parseProperties();Object.getOwnPropertyNames(f).length&&(l.properties=f)}return r("_parseDisconnect result: true"),!0}_parseAuth(){r("_parseAuth");let l=this.packet;if(this.settings.protocolVersion!==5)return this._emitError(new Error("Not supported auth packet for this version MQTT"));if(l.reasonCode=this._parseByte(),!n.MQTT5_AUTH_CODES[l.reasonCode])return this._emitError(new Error("Invalid auth reason code"));let f=this._parseProperties();return Object.getOwnPropertyNames(f).length&&(l.properties=f),r("_parseAuth: result: true"),!0}_parseMessageId(){let l=this.packet;return l.messageId=this._parseNum(),l.messageId===null?(this._emitError(new Error("Cannot parse messageId")),!1):(r("_parseMessageId: packet.messageId %d",l.messageId),!0)}_parseString(l){let f=this._parseNum(),p=f+this._pos;if(f===-1||p>this._list.length||p>this.packet.length)return null;let g=this._list.toString("utf8",this._pos,p);return this._pos+=f,r("_parseString: result: %s",g),g}_parseStringPair(){return r("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){let l=this._parseNum(),f=l+this._pos;if(l===-1||f>this._list.length||f>this.packet.length)return null;let p=this._list.slice(this._pos,f);return this._pos+=l,r("_parseBuffer: result: %o",p),p}_parseNum(){if(this._list.length-this._pos<2)return-1;let l=this._list.readUInt16BE(this._pos);return this._pos+=2,r("_parseNum: result: %s",l),l}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;let l=this._list.readUInt32BE(this._pos);return this._pos+=4,r("_parse4ByteNum: result: %s",l),l}_parseVarByteNum(l){r("_parseVarByteNum");let f=4,p=0,g=1,m=0,b=!1,y,A=this._pos?this._pos:0;for(;p<f&&A+p<this._list.length;){if(y=this._list.readUInt8(A+p++),m+=g*(y&n.VARBYTEINT_MASK),g*=128,!(y&n.VARBYTEINT_FIN_MASK)){b=!0;break}if(this._list.length<=p)break}return!b&&p===f&&this._list.length>=p&&this._emitError(new Error("Invalid variable byte integer")),A&&(this._pos+=p),b?l?b={bytes:p,value:m}:b=m:b=!1,r("_parseVarByteNum: result: %o",b),b}_parseByte(){let l;return this._pos<this._list.length&&(l=this._list.readUInt8(this._pos),this._pos++),r("_parseByte: result: %o",l),l}_parseByType(l){switch(r("_parseByType: type: %s",l),l){case"byte":return this._parseByte()!==0;case"int8":return this._parseByte();case"int16":return this._parseNum();case"int32":return this._parse4ByteNum();case"var":return this._parseVarByteNum();case"string":return this._parseString();case"pair":return this._parseStringPair();case"binary":return this._parseBuffer()}}_parseProperties(){r("_parseProperties");let l=this._parseVarByteNum(),f=this._pos+l,p={};for(;this._pos<f;){let g=this._parseByte();if(!g)return this._emitError(new Error("Cannot parse property code type")),!1;let m=n.propertiesCodes[g];if(!m)return this._emitError(new Error("Unknown property")),!1;if(m==="userProperties"){p[m]||(p[m]=Object.create(null));let b=this._parseByType(n.propertiesTypes[m]);if(p[m][b.name])if(Array.isArray(p[m][b.name]))p[m][b.name].push(b.value);else{let y=p[m][b.name];p[m][b.name]=[y],p[m][b.name].push(b.value)}else p[m][b.name]=b.value;continue}p[m]?Array.isArray(p[m])?p[m].push(this._parseByType(n.propertiesTypes[m])):(p[m]=[p[m]],p[m].push(this._parseByType(n.propertiesTypes[m]))):p[m]=this._parseByType(n.propertiesTypes[m])}return p}_newPacket(){return r("_newPacket"),this.packet&&(this._list.consume(this.packet.length),r("_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)),r("_newPacket: new packet"),this.packet=new h,this._pos=0,!0}_emitError(l){r("_emitError",l),this.error=l,this.emit("error",l)}};i.exports=s}),mh=be((e,i)=>{ae(),he(),le();var{Buffer:t}=(Je(),Ne(Ge)),a=65536,h={},n=t.isBuffer(t.from([1,2]).subarray(0,1));function r(f){let p=t.allocUnsafe(2);return p.writeUInt8(f>>8,0),p.writeUInt8(f&255,1),p}function s(){for(let f=0;f<a;f++)h[f]=r(f)}function o(f){let p=0,g=0,m=t.allocUnsafe(4);do p=f%128|0,f=f/128|0,f>0&&(p=p|128),m.writeUInt8(p,g++);while(f>0&&g<4);return f>0&&(g=0),n?m.subarray(0,g):m.slice(0,g)}function l(f){let p=t.allocUnsafe(4);return p.writeUInt32BE(f,0),p}i.exports={cache:h,generateCache:s,generateNumber:r,genBufVariableByteInt:o,generate4ByteBuffer:l}}),bh=be((e,i)=>{ae(),he(),le(),typeof Re>"u"||!Re.version||Re.version.indexOf("v0.")===0||Re.version.indexOf("v1.")===0&&Re.version.indexOf("v1.8.")!==0?i.exports={nextTick:t}:i.exports=Re;function t(a,h,n,r){if(typeof a!="function")throw new TypeError('"callback" argument must be a function');var s=arguments.length,o,l;switch(s){case 0:case 1:return Re.nextTick(a);case 2:return Re.nextTick(function(){a.call(null,h)});case 3:return Re.nextTick(function(){a.call(null,h,n)});case 4:return Re.nextTick(function(){a.call(null,h,n,r)});default:for(o=new Array(s-1),l=0;l<o.length;)o[l++]=arguments[l];return Re.nextTick(function(){a.apply(null,o)})}}}),us=be((e,i)=>{ae(),he(),le();var t=cs(),{Buffer:a}=(Je(),Ne(Ge)),h=a.allocUnsafe(0),n=a.from([0]),r=mh(),s=bh().nextTick,o=St()("mqtt-packet:writeToStream"),l=r.cache,f=r.generateNumber,p=r.generateCache,g=r.genBufVariableByteInt,m=r.generate4ByteBuffer,b=se,y=!0;function A(x,E,Y){switch(o("generate called"),E.cork&&(E.cork(),s(N,E)),y&&(y=!1,p()),o("generate: packet.cmd: %s",x.cmd),x.cmd){case"connect":return k(x,E);case"connack":return v(x,E,Y);case"publish":return U(x,E,Y);case"puback":case"pubrec":case"pubrel":case"pubcomp":return D(x,E,Y);case"subscribe":return C(x,E,Y);case"suback":return T(x,E,Y);case"unsubscribe":return M(x,E,Y);case"unsuback":return V(x,E,Y);case"pingreq":case"pingresp":return J(x,E);case"disconnect":return ne(x,E,Y);case"auth":return S(x,E,Y);default:return E.destroy(new Error("Unknown command")),!1}}Object.defineProperty(A,"cacheNumbers",{get(){return b===se},set(x){x?((!l||Object.keys(l).length===0)&&(y=!0),b=se):(y=!1,b=z)}});function N(x){x.uncork()}function k(x,E,Y){let fe=x||{},te=fe.protocolId||"MQTT",X=fe.protocolVersion||4,we=fe.will,ge=fe.clean,P=fe.keepalive||0,F=fe.clientId||"",W=fe.username,ie=fe.password,Z=fe.properties;ge===void 0&&(ge=!0);let L=0;if(!te||typeof te!="string"&&!a.isBuffer(te))return E.destroy(new Error("Invalid protocolId")),!1;if(L+=te.length+2,X!==3&&X!==4&&X!==5)return E.destroy(new Error("Invalid protocol version")),!1;if(L+=1,(typeof F=="string"||a.isBuffer(F))&&(F||X>=4)&&(F||ge))L+=a.byteLength(F)+2;else{if(X<4)return E.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(ge*1===0)return E.destroy(new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof P!="number"||P<0||P>65535||P%1!==0)return E.destroy(new Error("Invalid keepalive")),!1;L+=2,L+=1;let K,B;if(X===5){if(K=_e(E,Z),!K)return!1;L+=K.length}if(we){if(typeof we!="object")return E.destroy(new Error("Invalid will")),!1;if(!we.topic||typeof we.topic!="string")return E.destroy(new Error("Invalid will topic")),!1;if(L+=a.byteLength(we.topic)+2,L+=2,we.payload)if(we.payload.length>=0)typeof we.payload=="string"?L+=a.byteLength(we.payload):L+=we.payload.length;else return E.destroy(new Error("Invalid will payload")),!1;if(B={},X===5){if(B=_e(E,we.properties),!B)return!1;L+=B.length}}let j=!1;if(W!=null)if(ue(W))j=!0,L+=a.byteLength(W)+2;else return E.destroy(new Error("Invalid username")),!1;if(ie!=null){if(!j)return E.destroy(new Error("Username is required to use password")),!1;if(ue(ie))L+=ve(ie)+2;else return E.destroy(new Error("Invalid password")),!1}E.write(t.CONNECT_HEADER),re(E,L),oe(E,te),fe.bridgeMode&&(X+=128),E.write(X===131?t.VERSION131:X===132?t.VERSION132:X===4?t.VERSION4:X===5?t.VERSION5:t.VERSION3);let q=0;return q|=W!=null?t.USERNAME_MASK:0,q|=ie!=null?t.PASSWORD_MASK:0,q|=we&&we.retain?t.WILL_RETAIN_MASK:0,q|=we&&we.qos?we.qos<<t.WILL_QOS_SHIFT:0,q|=we?t.WILL_FLAG_MASK:0,q|=ge?t.CLEAN_SESSION_MASK:0,E.write(a.from([q])),b(E,P),X===5&&K.write(),oe(E,F),we&&(X===5&&B.write(),Q(E,we.topic),oe(E,we.payload)),W!=null&&oe(E,W),ie!=null&&oe(E,ie),!0}function v(x,E,Y){let fe=Y?Y.protocolVersion:4,te=x||{},X=fe===5?te.reasonCode:te.returnCode,we=te.properties,ge=2;if(typeof X!="number")return E.destroy(new Error("Invalid return code")),!1;let P=null;if(fe===5){if(P=_e(E,we),!P)return!1;ge+=P.length}return E.write(t.CONNACK_HEADER),re(E,ge),E.write(te.sessionPresent?t.SESSIONPRESENT_HEADER:n),E.write(a.from([X])),P==null||P.write(),!0}function U(x,E,Y){o("publish: packet: %o",x);let fe=Y?Y.protocolVersion:4,te=x||{},X=te.qos||0,we=te.retain?t.RETAIN_MASK:0,ge=te.topic,P=te.payload||h,F=te.messageId,W=te.properties,ie=0;if(typeof ge=="string")ie+=a.byteLength(ge)+2;else if(a.isBuffer(ge))ie+=ge.length+2;else return E.destroy(new Error("Invalid topic")),!1;if(a.isBuffer(P)?ie+=P.length:ie+=a.byteLength(P),X&&typeof F!="number")return E.destroy(new Error("Invalid messageId")),!1;X&&(ie+=2);let Z=null;if(fe===5){if(Z=_e(E,W),!Z)return!1;ie+=Z.length}return E.write(t.PUBLISH_HEADER[X][te.dup?1:0][we?1:0]),re(E,ie),b(E,ve(ge)),E.write(ge),X>0&&b(E,F),Z==null||Z.write(),o("publish: payload: %o",P),E.write(P)}function D(x,E,Y){let fe=Y?Y.protocolVersion:4,te=x||{},X=te.cmd||"puback",we=te.messageId,ge=te.dup&&X==="pubrel"?t.DUP_MASK:0,P=0,F=te.reasonCode,W=te.properties,ie=fe===5?3:2;if(X==="pubrel"&&(P=1),typeof we!="number")return E.destroy(new Error("Invalid messageId")),!1;let Z=null;if(fe===5&&typeof W=="object"){if(Z=_(E,W,Y,ie),!Z)return!1;ie+=Z.length}return E.write(t.ACKS[X][P][ge][0]),ie===3&&(ie+=F!==0?1:-1),re(E,ie),b(E,we),fe===5&&ie!==2&&E.write(a.from([F])),Z!==null?Z.write():ie===4&&E.write(a.from([0])),!0}function C(x,E,Y){o("subscribe: packet: ");let fe=Y?Y.protocolVersion:4,te=x||{},X=te.dup?t.DUP_MASK:0,we=te.messageId,ge=te.subscriptions,P=te.properties,F=0;if(typeof we!="number")return E.destroy(new Error("Invalid messageId")),!1;F+=2;let W=null;if(fe===5){if(W=_e(E,P),!W)return!1;F+=W.length}if(typeof ge=="object"&&ge.length)for(let Z=0;Z<ge.length;Z+=1){let L=ge[Z].topic,K=ge[Z].qos;if(typeof L!="string")return E.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if(typeof K!="number")return E.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(fe===5){if(typeof(ge[Z].nl||!1)!="boolean")return E.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(ge[Z].rap||!1)!="boolean")return E.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;let B=ge[Z].rh||0;if(typeof B!="number"||B>2)return E.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}F+=a.byteLength(L)+2+1}else return E.destroy(new Error("Invalid subscriptions")),!1;o("subscribe: writing to stream: %o",t.SUBSCRIBE_HEADER),E.write(t.SUBSCRIBE_HEADER[1][X?1:0][0]),re(E,F),b(E,we),W!==null&&W.write();let ie=!0;for(let Z of ge){let L=Z.topic,K=Z.qos,B=+Z.nl,j=+Z.rap,q=Z.rh,ce;Q(E,L),ce=t.SUBSCRIBE_OPTIONS_QOS[K],fe===5&&(ce|=B?t.SUBSCRIBE_OPTIONS_NL:0,ce|=j?t.SUBSCRIBE_OPTIONS_RAP:0,ce|=q?t.SUBSCRIBE_OPTIONS_RH[q]:0),ie=E.write(a.from([ce]))}return ie}function T(x,E,Y){let fe=Y?Y.protocolVersion:4,te=x||{},X=te.messageId,we=te.granted,ge=te.properties,P=0;if(typeof X!="number")return E.destroy(new Error("Invalid messageId")),!1;if(P+=2,typeof we=="object"&&we.length)for(let W=0;W<we.length;W+=1){if(typeof we[W]!="number")return E.destroy(new Error("Invalid qos vector")),!1;P+=1}else return E.destroy(new Error("Invalid qos vector")),!1;let F=null;if(fe===5){if(F=_(E,ge,Y,P),!F)return!1;P+=F.length}return E.write(t.SUBACK_HEADER),re(E,P),b(E,X),F!==null&&F.write(),E.write(a.from(we))}function M(x,E,Y){let fe=Y?Y.protocolVersion:4,te=x||{},X=te.messageId,we=te.dup?t.DUP_MASK:0,ge=te.unsubscriptions,P=te.properties,F=0;if(typeof X!="number")return E.destroy(new Error("Invalid messageId")),!1;if(F+=2,typeof ge=="object"&&ge.length)for(let Z=0;Z<ge.length;Z+=1){if(typeof ge[Z]!="string")return E.destroy(new Error("Invalid unsubscriptions")),!1;F+=a.byteLength(ge[Z])+2}else return E.destroy(new Error("Invalid unsubscriptions")),!1;let W=null;if(fe===5){if(W=_e(E,P),!W)return!1;F+=W.length}E.write(t.UNSUBSCRIBE_HEADER[1][we?1:0][0]),re(E,F),b(E,X),W!==null&&W.write();let ie=!0;for(let Z=0;Z<ge.length;Z++)ie=Q(E,ge[Z]);return ie}function V(x,E,Y){let fe=Y?Y.protocolVersion:4,te=x||{},X=te.messageId,we=te.dup?t.DUP_MASK:0,ge=te.granted,P=te.properties,F=te.cmd,W=0,ie=2;if(typeof X!="number")return E.destroy(new Error("Invalid messageId")),!1;if(fe===5)if(typeof ge=="object"&&ge.length)for(let L=0;L<ge.length;L+=1){if(typeof ge[L]!="number")return E.destroy(new Error("Invalid qos vector")),!1;ie+=1}else return E.destroy(new Error("Invalid qos vector")),!1;let Z=null;if(fe===5){if(Z=_(E,P,Y,ie),!Z)return!1;ie+=Z.length}return E.write(t.ACKS[F][W][we][0]),re(E,ie),b(E,X),Z!==null&&Z.write(),fe===5&&E.write(a.from(ge)),!0}function J(x,E,Y){return E.write(t.EMPTY[x.cmd])}function ne(x,E,Y){let fe=Y?Y.protocolVersion:4,te=x||{},X=te.reasonCode,we=te.properties,ge=fe===5?1:0,P=null;if(fe===5){if(P=_(E,we,Y,ge),!P)return!1;ge+=P.length}return E.write(a.from([t.codes.disconnect<<4])),re(E,ge),fe===5&&E.write(a.from([X])),P!==null&&P.write(),!0}function S(x,E,Y){let fe=Y?Y.protocolVersion:4,te=x||{},X=te.reasonCode,we=te.properties,ge=fe===5?1:0;fe!==5&&E.destroy(new Error("Invalid mqtt version for auth packet"));let P=_(E,we,Y,ge);return P?(ge+=P.length,E.write(a.from([t.codes.auth<<4])),re(E,ge),E.write(a.from([X])),P!==null&&P.write(),!0):!1}var H={};function re(x,E){if(E>t.VARBYTEINT_MAX)return x.destroy(new Error(`Invalid variable byte integer: ${E}`)),!1;let Y=H[E];return Y||(Y=g(E),E<16384&&(H[E]=Y)),o("writeVarByteInt: writing to stream: %o",Y),x.write(Y)}function Q(x,E){let Y=a.byteLength(E);return b(x,Y),o("writeString: %s",E),x.write(E,"utf8")}function me(x,E,Y){Q(x,E),Q(x,Y)}function se(x,E){return o("writeNumberCached: number: %d",E),o("writeNumberCached: %o",l[E]),x.write(l[E])}function z(x,E){let Y=f(E);return o("writeNumberGenerated: %o",Y),x.write(Y)}function ye(x,E){let Y=m(E);return o("write4ByteNumber: %o",Y),x.write(Y)}function oe(x,E){typeof E=="string"?Q(x,E):E?(b(x,E.length),x.write(E)):b(x,0)}function _e(x,E){if(typeof E!="object"||E.length!=null)return{length:1,write(){de(x,{},0)}};let Y=0;function fe(te,X){let we=t.propertiesTypes[te],ge=0;switch(we){case"byte":{if(typeof X!="boolean")return x.destroy(new Error(`Invalid ${te}: ${X}`)),!1;ge+=2;break}case"int8":{if(typeof X!="number"||X<0||X>255)return x.destroy(new Error(`Invalid ${te}: ${X}`)),!1;ge+=2;break}case"binary":{if(X&&X===null)return x.destroy(new Error(`Invalid ${te}: ${X}`)),!1;ge+=1+a.byteLength(X)+2;break}case"int16":{if(typeof X!="number"||X<0||X>65535)return x.destroy(new Error(`Invalid ${te}: ${X}`)),!1;ge+=3;break}case"int32":{if(typeof X!="number"||X<0||X>4294967295)return x.destroy(new Error(`Invalid ${te}: ${X}`)),!1;ge+=5;break}case"var":{if(typeof X!="number"||X<0||X>268435455)return x.destroy(new Error(`Invalid ${te}: ${X}`)),!1;ge+=1+a.byteLength(g(X));break}case"string":{if(typeof X!="string")return x.destroy(new Error(`Invalid ${te}: ${X}`)),!1;ge+=3+a.byteLength(X.toString());break}case"pair":{if(typeof X!="object")return x.destroy(new Error(`Invalid ${te}: ${X}`)),!1;ge+=Object.getOwnPropertyNames(X).reduce((P,F)=>{let W=X[F];return Array.isArray(W)?P+=W.reduce((ie,Z)=>(ie+=3+a.byteLength(F.toString())+2+a.byteLength(Z.toString()),ie),0):P+=3+a.byteLength(F.toString())+2+a.byteLength(X[F].toString()),P},0);break}default:return x.destroy(new Error(`Invalid property ${te}: ${X}`)),!1}return ge}if(E)for(let te in E){let X=0,we=0,ge=E[te];if(Array.isArray(ge))for(let P=0;P<ge.length;P++){if(we=fe(te,ge[P]),!we)return!1;X+=we}else{if(we=fe(te,ge),!we)return!1;X=we}if(!X)return!1;Y+=X}return{length:a.byteLength(g(Y))+Y,write(){de(x,E,Y)}}}function _(x,E,Y,fe){let te=["reasonString","userProperties"],X=Y&&Y.properties&&Y.properties.maximumPacketSize?Y.properties.maximumPacketSize:0,we=_e(x,E);if(X)for(;fe+we.length>X;){let ge=te.shift();if(ge&&E[ge])delete E[ge],we=_e(x,E);else return!1}return we}function G(x,E,Y){switch(t.propertiesTypes[E]){case"byte":{x.write(a.from([t.properties[E]])),x.write(a.from([+Y]));break}case"int8":{x.write(a.from([t.properties[E]])),x.write(a.from([Y]));break}case"binary":{x.write(a.from([t.properties[E]])),oe(x,Y);break}case"int16":{x.write(a.from([t.properties[E]])),b(x,Y);break}case"int32":{x.write(a.from([t.properties[E]])),ye(x,Y);break}case"var":{x.write(a.from([t.properties[E]])),re(x,Y);break}case"string":{x.write(a.from([t.properties[E]])),Q(x,Y);break}case"pair":{Object.getOwnPropertyNames(Y).forEach(fe=>{let te=Y[fe];Array.isArray(te)?te.forEach(X=>{x.write(a.from([t.properties[E]])),me(x,fe.toString(),X.toString())}):(x.write(a.from([t.properties[E]])),me(x,fe.toString(),te.toString()))});break}default:return x.destroy(new Error(`Invalid property ${E} value: ${Y}`)),!1}}function de(x,E,Y){re(x,Y);for(let fe in E)if(Object.prototype.hasOwnProperty.call(E,fe)&&E[fe]!==null){let te=E[fe];if(Array.isArray(te))for(let X=0;X<te.length;X++)G(x,fe,te[X]);else G(x,fe,te)}}function ve(x){return x?x instanceof a?x.length:a.byteLength(x):0}function ue(x){return typeof x=="string"||x instanceof a}i.exports=A}),yh=be((e,i)=>{ae(),he(),le();var t=us(),{EventEmitter:a}=(er(),Ne(Dt)),{Buffer:h}=(Je(),Ne(Ge));function n(s,o){let l=new r;return t(s,l,o),l.concat()}var r=class extends a{constructor(){super(),this._array=new Array(20),this._i=0}write(s){return this._array[this._i++]=s,!0}concat(){let s=0,o=new Array(this._array.length),l=this._array,f=0,p;for(p=0;p<l.length&&l[p]!==void 0;p++)typeof l[p]!="string"?o[p]=l[p].length:o[p]=h.byteLength(l[p]),s+=o[p];let g=h.allocUnsafe(s);for(p=0;p<l.length&&l[p]!==void 0;p++)typeof l[p]!="string"?(l[p].copy(g,f),f+=o[p]):(g.write(l[p],f),f+=o[p]);return g}destroy(s){s&&this.emit("error",s)}};i.exports=n}),wh=be(e=>{ae(),he(),le(),e.parser=gh().parser,e.generate=yh(),e.writeToStream=us()}),fs=be(e=>{ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0});var i=class{constructor(){this.nextId=Math.max(1,Math.floor(Math.random()*65535))}allocate(){let t=this.nextId++;return this.nextId===65536&&(this.nextId=1),t}getLastAllocated(){return this.nextId===1?65535:this.nextId-1}register(t){return!0}deallocate(t){}clear(){}};e.default=i}),_h=be((e,i)=>{ae(),he(),le(),i.exports=a;function t(n){return n instanceof mr?mr.from(n):new n.constructor(n.buffer.slice(),n.byteOffset,n.length)}function a(n){if(n=n||{},n.circles)return h(n);return n.proto?o:s;function r(l,f){for(var p=Object.keys(l),g=new Array(p.length),m=0;m<p.length;m++){var b=p[m],y=l[b];typeof y!="object"||y===null?g[b]=y:y instanceof Date?g[b]=new Date(y):ArrayBuffer.isView(y)?g[b]=t(y):g[b]=f(y)}return g}function s(l){if(typeof l!="object"||l===null)return l;if(l instanceof Date)return new Date(l);if(Array.isArray(l))return r(l,s);if(l instanceof Map)return new Map(r(Array.from(l),s));if(l instanceof Set)return new Set(r(Array.from(l),s));var f={};for(var p in l)if(Object.hasOwnProperty.call(l,p)!==!1){var g=l[p];typeof g!="object"||g===null?f[p]=g:g instanceof Date?f[p]=new Date(g):g instanceof Map?f[p]=new Map(r(Array.from(g),s)):g instanceof Set?f[p]=new Set(r(Array.from(g),s)):ArrayBuffer.isView(g)?f[p]=t(g):f[p]=s(g)}return f}function o(l){if(typeof l!="object"||l===null)return l;if(l instanceof Date)return new Date(l);if(Array.isArray(l))return r(l,o);if(l instanceof Map)return new Map(r(Array.from(l),o));if(l instanceof Set)return new Set(r(Array.from(l),o));var f={};for(var p in l){var g=l[p];typeof g!="object"||g===null?f[p]=g:g instanceof Date?f[p]=new Date(g):g instanceof Map?f[p]=new Map(r(Array.from(g),o)):g instanceof Set?f[p]=new Set(r(Array.from(g),o)):ArrayBuffer.isView(g)?f[p]=t(g):f[p]=o(g)}return f}}function h(n){var r=[],s=[];return n.proto?f:l;function o(p,g){for(var m=Object.keys(p),b=new Array(m.length),y=0;y<m.length;y++){var A=m[y],N=p[A];if(typeof N!="object"||N===null)b[A]=N;else if(N instanceof Date)b[A]=new Date(N);else if(ArrayBuffer.isView(N))b[A]=t(N);else{var k=r.indexOf(N);k!==-1?b[A]=s[k]:b[A]=g(N)}}return b}function l(p){if(typeof p!="object"||p===null)return p;if(p instanceof Date)return new Date(p);if(Array.isArray(p))return o(p,l);if(p instanceof Map)return new Map(o(Array.from(p),l));if(p instanceof Set)return new Set(o(Array.from(p),l));var g={};r.push(p),s.push(g);for(var m in p)if(Object.hasOwnProperty.call(p,m)!==!1){var b=p[m];if(typeof b!="object"||b===null)g[m]=b;else if(b instanceof Date)g[m]=new Date(b);else if(b instanceof Map)g[m]=new Map(o(Array.from(b),l));else if(b instanceof Set)g[m]=new Set(o(Array.from(b),l));else if(ArrayBuffer.isView(b))g[m]=t(b);else{var y=r.indexOf(b);y!==-1?g[m]=s[y]:g[m]=l(b)}}return r.pop(),s.pop(),g}function f(p){if(typeof p!="object"||p===null)return p;if(p instanceof Date)return new Date(p);if(Array.isArray(p))return o(p,f);if(p instanceof Map)return new Map(o(Array.from(p),f));if(p instanceof Set)return new Set(o(Array.from(p),f));var g={};r.push(p),s.push(g);for(var m in p){var b=p[m];if(typeof b!="object"||b===null)g[m]=b;else if(b instanceof Date)g[m]=new Date(b);else if(b instanceof Map)g[m]=new Map(o(Array.from(b),f));else if(b instanceof Set)g[m]=new Set(o(Array.from(b),f));else if(ArrayBuffer.isView(b))g[m]=t(b);else{var y=r.indexOf(b);y!==-1?g[m]=s[y]:g[m]=f(b)}}return r.pop(),s.pop(),g}}}),vh=be((e,i)=>{ae(),he(),le(),i.exports=_h()()}),Eh=be(e=>{ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0}),e.validateTopics=e.validateTopic=void 0;function i(a){let h=a.split("/");for(let n=0;n<h.length;n++)if(h[n]!=="+"){if(h[n]==="#")return n===h.length-1;if(h[n].indexOf("+")!==-1||h[n].indexOf("#")!==-1)return!1}return!0}e.validateTopic=i;function t(a){if(a.length===0)return"empty_topic_list";for(let h=0;h<a.length;h++)if(!i(a[h]))return a[h];return null}e.validateTopics=t}),ds=be(e=>{ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0});var i=qt(),t={objectMode:!0},a={clean:!0},h=class{constructor(n){this.options=n||{},this.options=Object.assign(Object.assign({},a),n),this._inflights=new Map}put(n,r){return this._inflights.set(n.messageId,n),r&&r(),this}createStream(){let n=new i.Readable(t),r=[],s=!1,o=0;return this._inflights.forEach((l,f)=>{r.push(l)}),n._read=()=>{!s&&o<r.length?n.push(r[o++]):n.push(null)},n.destroy=l=>{if(!s)return s=!0,setTimeout(()=>{n.emit("close")},0),n},n}del(n,r){let s=this._inflights.get(n.messageId);return s?(this._inflights.delete(n.messageId),r(null,s)):r&&r(new Error("missing packet")),this}get(n,r){let s=this._inflights.get(n.messageId);return s?r(null,s):r&&r(new Error("missing packet")),this}close(n){this.options.clean&&(this._inflights=null),n&&n()}};e.default=h}),Sh=be(e=>{ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0});var i=[0,16,128,131,135,144,145,151,153],t=(a,h,n)=>{a.log("handlePublish: packet %o",h),n=typeof n<"u"?n:a.noop;let r=h.topic.toString(),s=h.payload,{qos:o}=h,{messageId:l}=h,{options:f}=a;if(a.options.protocolVersion===5){let p;if(h.properties&&(p=h.properties.topicAlias),typeof p<"u")if(r.length===0)if(p>0&&p<=65535){let g=a.topicAliasRecv.getTopicByAlias(p);if(g)r=g,a.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",r,p);else{a.log("handlePublish :: unregistered topic alias. alias: %d",p),a.emit("error",new Error("Received unregistered Topic Alias"));return}}else{a.log("handlePublish :: topic alias out of range. alias: %d",p),a.emit("error",new Error("Received Topic Alias is out of range"));return}else if(a.topicAliasRecv.put(r,p))a.log("handlePublish :: registered topic: %s - alias: %d",r,p);else{a.log("handlePublish :: topic alias out of range. alias: %d",p),a.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(a.log("handlePublish: qos %d",o),o){case 2:{f.customHandleAcks(r,s,h,(p,g)=>{if(typeof p=="number"&&(g=p,p=null),p)return a.emit("error",p);if(i.indexOf(g)===-1)return a.emit("error",new Error("Wrong reason code for pubrec"));g?a._sendPacket({cmd:"pubrec",messageId:l,reasonCode:g},n):a.incomingStore.put(h,()=>{a._sendPacket({cmd:"pubrec",messageId:l},n)})});break}case 1:{f.customHandleAcks(r,s,h,(p,g)=>{if(typeof p=="number"&&(g=p,p=null),p)return a.emit("error",p);if(i.indexOf(g)===-1)return a.emit("error",new Error("Wrong reason code for puback"));g||a.emit("message",r,s,h),a.handleMessage(h,m=>{if(m)return n&&n(m);a._sendPacket({cmd:"puback",messageId:l,reasonCode:g},n)})});break}case 0:a.emit("message",r,s,h),a.handleMessage(h,n);break;default:a.log("handlePublish: unknown QoS. Doing nothing.");break}};e.default=t}),Ah=be((e,i)=>{i.exports={version:"5.10.1"}}),rr=be(e=>{ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0}),e.MQTTJS_VERSION=e.nextTick=e.applyMixin=e.ErrorWithReasonCode=void 0;var i=class Pa extends Error{constructor(h,n){super(h),this.code=n,Object.setPrototypeOf(this,Pa.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}};e.ErrorWithReasonCode=i;function t(a,h,n=!1){var r;let s=[h];for(;;){let o=s[0],l=Object.getPrototypeOf(o);if(l!=null&&l.prototype)s.unshift(l);else break}for(let o of s)for(let l of Object.getOwnPropertyNames(o.prototype))(n||l!=="constructor")&&Object.defineProperty(a.prototype,l,(r=Object.getOwnPropertyDescriptor(o.prototype,l))!==null&&r!==void 0?r:Object.create(null))}e.applyMixin=t,e.nextTick=typeof(Re==null?void 0:Re.nextTick)=="function"?Re.nextTick:a=>{setTimeout(a,0)},e.MQTTJS_VERSION=Ah().version}),kr=be(e=>{ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0}),e.ReasonCodes=void 0;var i=rr();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"};var t=(a,h)=>{let{messageId:n}=h,r=h.cmd,s=null,o=a.outgoing[n]?a.outgoing[n].cb:null,l=null;if(!o){a.log("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(a.log("_handleAck :: packet type",r),r){case"pubcomp":case"puback":{let f=h.reasonCode;f&&f>0&&f!==16?(l=new i.ErrorWithReasonCode(`Publish error: ${e.ReasonCodes[f]}`,f),a._removeOutgoingAndStoreMessage(n,()=>{o(l,h)})):a._removeOutgoingAndStoreMessage(n,o);break}case"pubrec":{s={cmd:"pubrel",qos:2,messageId:n};let f=h.reasonCode;f&&f>0&&f!==16?(l=new i.ErrorWithReasonCode(`Publish error: ${e.ReasonCodes[f]}`,f),a._removeOutgoingAndStoreMessage(n,()=>{o(l,h)})):a._sendPacket(s);break}case"suback":{delete a.outgoing[n],a.messageIdProvider.deallocate(n);let f=h.granted;for(let p=0;p<f.length;p++){let g=f[p];if(g&128){l=new Error(`Subscribe error: ${e.ReasonCodes[g]}`),l.code=g;let m=a.messageIdToTopic[n];m&&m.forEach(b=>{delete a._resubscribeTopics[b]})}}delete a.messageIdToTopic[n],a._invokeStoreProcessingQueue(),o(l,h);break}case"unsuback":{delete a.outgoing[n],a.messageIdProvider.deallocate(n),a._invokeStoreProcessingQueue(),o(null,h);break}default:a.emit("error",new Error("unrecognized packet type"))}a.disconnecting&&Object.keys(a.outgoing).length===0&&a.emit("outgoingEmpty")};e.default=t}),kh=be(e=>{ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0});var i=rr(),t=kr(),a=(h,n)=>{let{options:r}=h,s=r.protocolVersion,o=s===5?n.reasonCode:n.returnCode;if(s!==5){let l=new i.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${s}`,o);h.emit("error",l);return}h.handleAuth(n,(l,f)=>{if(l){h.emit("error",l);return}if(o===24)h.reconnecting=!1,h._sendPacket(f);else{let p=new i.ErrorWithReasonCode(`Connection refused: ${t.ReasonCodes[o]}`,o);h.emit("error",p)}})};e.default=a}),Ih=be(e=>{var m,b,y,A,N,k,v,U,D,C,T,M,V,J,ne,S,H,re,Q,me,se,z,ye,oe,_e,_,Ni,de,ve,ue,x,Oa,Y,fe,te,Rt,xt,Li,jr,Dr,De,Ui,fr,L;ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=void 0;var i=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,t=new Set,a=typeof Re=="object"&&Re?Re:{},h=(K,B,j,q)=>{typeof a.emitWarning=="function"?a.emitWarning(K,B,j,q):console.error(`[${j}] ${B}: ${K}`)},n=globalThis.AbortController,r=globalThis.AbortSignal;if(typeof n>"u"){r=class{constructor(){We(this,"onabort");We(this,"_onabort",[]);We(this,"reason");We(this,"aborted",!1)}addEventListener(j,q){this._onabort.push(q)}},n=class{constructor(){We(this,"signal",new r);B()}abort(j){var q,ce;if(!this.signal.aborted){this.signal.reason=j,this.signal.aborted=!0;for(let u of this.signal._onabort)u(j);(ce=(q=this.signal).onabort)==null||ce.call(q,j)}}};let K=((m=a.env)==null?void 0:m.LRU_CACHE_IGNORE_AC_WARNING)!=="1",B=()=>{K&&(K=!1,h("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",B))}}var s=K=>!t.has(K),o=K=>K&&K===Math.floor(K)&&K>0&&isFinite(K),l=K=>o(K)?K<=Math.pow(2,8)?Uint8Array:K<=Math.pow(2,16)?Uint16Array:K<=Math.pow(2,32)?Uint32Array:K<=Number.MAX_SAFE_INTEGER?f:null:null,f=class extends Array{constructor(K){super(K),this.fill(0)}},p=(b=class{constructor(B,j){We(this,"heap");We(this,"length");if(!O(b,y))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new j(B),this.length=0}static create(B){let j=l(B);if(!j)return[];ke(b,y,!0);let q=new b(B,j);return ke(b,y,!1),q}push(B){this.heap[this.length++]=B}pop(){return this.heap[--this.length]}},y=new WeakMap,Oe(b,y,!1),b),g=(L=class{constructor(B){Oe(this,_);Oe(this,A);Oe(this,N);Oe(this,k);Oe(this,v);Oe(this,U);We(this,"ttl");We(this,"ttlResolution");We(this,"ttlAutopurge");We(this,"updateAgeOnGet");We(this,"updateAgeOnHas");We(this,"allowStale");We(this,"noDisposeOnSet");We(this,"noUpdateTTL");We(this,"maxEntrySize");We(this,"sizeCalculation");We(this,"noDeleteOnFetchRejection");We(this,"noDeleteOnStaleGet");We(this,"allowStaleOnFetchAbort");We(this,"allowStaleOnFetchRejection");We(this,"ignoreFetchAbort");Oe(this,D);Oe(this,C);Oe(this,T);Oe(this,M);Oe(this,V);Oe(this,J);Oe(this,ne);Oe(this,S);Oe(this,H);Oe(this,re);Oe(this,Q);Oe(this,me);Oe(this,se);Oe(this,z);Oe(this,ye);Oe(this,oe);Oe(this,_e);Oe(this,de,()=>{});Oe(this,ve,()=>{});Oe(this,ue,()=>{});Oe(this,x,()=>!1);Oe(this,Y,B=>{});Oe(this,fe,(B,j,q)=>{});Oe(this,te,(B,j,q,ce)=>{if(q||ce)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});let{max:j=0,ttl:q,ttlResolution:ce=1,ttlAutopurge:u,updateAgeOnGet:c,updateAgeOnHas:d,allowStale:w,dispose:I,disposeAfter:$,noDisposeOnSet:ee,noUpdateTTL:Ie,maxSize:Be=0,maxEntrySize:Pe=0,sizeCalculation:Ae,fetchMethod:Ce,noDeleteOnFetchRejection:Te,noDeleteOnStaleGet:Le,allowStaleOnFetchRejection:Ke,allowStaleOnFetchAbort:qe,ignoreFetchAbort:Ze}=B;if(j!==0&&!o(j))throw new TypeError("max option must be a nonnegative integer");let et=j?l(j):Array;if(!et)throw new Error("invalid max value: "+j);if(ke(this,A,j),ke(this,N,Be),this.maxEntrySize=Pe||O(this,N),this.sizeCalculation=Ae,this.sizeCalculation){if(!O(this,N)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(Ce!==void 0&&typeof Ce!="function")throw new TypeError("fetchMethod must be a function if specified");if(ke(this,U,Ce),ke(this,oe,!!Ce),ke(this,T,new Map),ke(this,M,new Array(j).fill(void 0)),ke(this,V,new Array(j).fill(void 0)),ke(this,J,new et(j)),ke(this,ne,new et(j)),ke(this,S,0),ke(this,H,0),ke(this,re,p.create(j)),ke(this,D,0),ke(this,C,0),typeof I=="function"&&ke(this,k,I),typeof $=="function"?(ke(this,v,$),ke(this,Q,[])):(ke(this,v,void 0),ke(this,Q,void 0)),ke(this,ye,!!O(this,k)),ke(this,_e,!!O(this,v)),this.noDisposeOnSet=!!ee,this.noUpdateTTL=!!Ie,this.noDeleteOnFetchRejection=!!Te,this.allowStaleOnFetchRejection=!!Ke,this.allowStaleOnFetchAbort=!!qe,this.ignoreFetchAbort=!!Ze,this.maxEntrySize!==0){if(O(this,N)!==0&&!o(O(this,N)))throw new TypeError("maxSize must be a positive integer if specified");if(!o(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");Se(this,_,Oa).call(this)}if(this.allowStale=!!w,this.noDeleteOnStaleGet=!!Le,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!d,this.ttlResolution=o(ce)||ce===0?ce:1,this.ttlAutopurge=!!u,this.ttl=q||0,this.ttl){if(!o(this.ttl))throw new TypeError("ttl must be a positive integer if specified");Se(this,_,Ni).call(this)}if(O(this,A)===0&&this.ttl===0&&O(this,N)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!O(this,A)&&!O(this,N)){let Ye="LRU_CACHE_UNBOUNDED";s(Ye)&&(t.add(Ye),h("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Ye,L))}}static unsafeExposeInternals(B){return{starts:O(B,se),ttls:O(B,z),sizes:O(B,me),keyMap:O(B,T),keyList:O(B,M),valList:O(B,V),next:O(B,J),prev:O(B,ne),get head(){return O(B,S)},get tail(){return O(B,H)},free:O(B,re),isBackgroundFetch:j=>{var q;return Se(q=B,_,De).call(q,j)},backgroundFetch:(j,q,ce,u)=>{var c;return Se(c=B,_,Dr).call(c,j,q,ce,u)},moveToTail:j=>{var q;return Se(q=B,_,fr).call(q,j)},indexes:j=>{var q;return Se(q=B,_,Rt).call(q,j)},rindexes:j=>{var q;return Se(q=B,_,xt).call(q,j)},isStale:j=>{var q;return O(q=B,x).call(q,j)}}}get max(){return O(this,A)}get maxSize(){return O(this,N)}get calculatedSize(){return O(this,C)}get size(){return O(this,D)}get fetchMethod(){return O(this,U)}get dispose(){return O(this,k)}get disposeAfter(){return O(this,v)}getRemainingTTL(B){return O(this,T).has(B)?1/0:0}*entries(){for(let B of Se(this,_,Rt).call(this))O(this,V)[B]!==void 0&&O(this,M)[B]!==void 0&&!Se(this,_,De).call(this,O(this,V)[B])&&(yield[O(this,M)[B],O(this,V)[B]])}*rentries(){for(let B of Se(this,_,xt).call(this))O(this,V)[B]!==void 0&&O(this,M)[B]!==void 0&&!Se(this,_,De).call(this,O(this,V)[B])&&(yield[O(this,M)[B],O(this,V)[B]])}*keys(){for(let B of Se(this,_,Rt).call(this)){let j=O(this,M)[B];j!==void 0&&!Se(this,_,De).call(this,O(this,V)[B])&&(yield j)}}*rkeys(){for(let B of Se(this,_,xt).call(this)){let j=O(this,M)[B];j!==void 0&&!Se(this,_,De).call(this,O(this,V)[B])&&(yield j)}}*values(){for(let B of Se(this,_,Rt).call(this))O(this,V)[B]!==void 0&&!Se(this,_,De).call(this,O(this,V)[B])&&(yield O(this,V)[B])}*rvalues(){for(let B of Se(this,_,xt).call(this))O(this,V)[B]!==void 0&&!Se(this,_,De).call(this,O(this,V)[B])&&(yield O(this,V)[B])}[Symbol.iterator](){return this.entries()}find(B,j={}){for(let q of Se(this,_,Rt).call(this)){let ce=O(this,V)[q],u=Se(this,_,De).call(this,ce)?ce.__staleWhileFetching:ce;if(u!==void 0&&B(u,O(this,M)[q],this))return this.get(O(this,M)[q],j)}}forEach(B,j=this){for(let q of Se(this,_,Rt).call(this)){let ce=O(this,V)[q],u=Se(this,_,De).call(this,ce)?ce.__staleWhileFetching:ce;u!==void 0&&B.call(j,u,O(this,M)[q],this)}}rforEach(B,j=this){for(let q of Se(this,_,xt).call(this)){let ce=O(this,V)[q],u=Se(this,_,De).call(this,ce)?ce.__staleWhileFetching:ce;u!==void 0&&B.call(j,u,O(this,M)[q],this)}}purgeStale(){let B=!1;for(let j of Se(this,_,xt).call(this,{allowStale:!0}))O(this,x).call(this,j)&&(this.delete(O(this,M)[j]),B=!0);return B}dump(){let B=[];for(let j of Se(this,_,Rt).call(this,{allowStale:!0})){let q=O(this,M)[j],ce=O(this,V)[j],u=Se(this,_,De).call(this,ce)?ce.__staleWhileFetching:ce;if(u===void 0||q===void 0)continue;let c={value:u};if(O(this,z)&&O(this,se)){c.ttl=O(this,z)[j];let d=i.now()-O(this,se)[j];c.start=Math.floor(Date.now()-d)}O(this,me)&&(c.size=O(this,me)[j]),B.unshift([q,c])}return B}load(B){this.clear();for(let[j,q]of B){if(q.start){let ce=Date.now()-q.start;q.start=i.now()-ce}this.set(j,q.value,q)}}set(B,j,q={}){var Ie,Be,Pe,Ae,Ce;if(j===void 0)return this.delete(B),this;let{ttl:ce=this.ttl,start:u,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:d=this.sizeCalculation,status:w}=q,{noUpdateTTL:I=this.noUpdateTTL}=q,$=O(this,te).call(this,B,j,q.size||0,d);if(this.maxEntrySize&&$>this.maxEntrySize)return w&&(w.set="miss",w.maxEntrySizeExceeded=!0),this.delete(B),this;let ee=O(this,D)===0?void 0:O(this,T).get(B);if(ee===void 0)ee=O(this,D)===0?O(this,H):O(this,re).length!==0?O(this,re).pop():O(this,D)===O(this,A)?Se(this,_,jr).call(this,!1):O(this,D),O(this,M)[ee]=B,O(this,V)[ee]=j,O(this,T).set(B,ee),O(this,J)[O(this,H)]=ee,O(this,ne)[ee]=O(this,H),ke(this,H,ee),Ur(this,D)._++,O(this,fe).call(this,ee,$,w),w&&(w.set="add"),I=!1;else{Se(this,_,fr).call(this,ee);let Te=O(this,V)[ee];if(j!==Te){if(O(this,oe)&&Se(this,_,De).call(this,Te)){Te.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:Le}=Te;Le!==void 0&&!c&&(O(this,ye)&&((Ie=O(this,k))==null||Ie.call(this,Le,B,"set")),O(this,_e)&&((Be=O(this,Q))==null||Be.push([Le,B,"set"])))}else c||(O(this,ye)&&((Pe=O(this,k))==null||Pe.call(this,Te,B,"set")),O(this,_e)&&((Ae=O(this,Q))==null||Ae.push([Te,B,"set"])));if(O(this,Y).call(this,ee),O(this,fe).call(this,ee,$,w),O(this,V)[ee]=j,w){w.set="replace";let Le=Te&&Se(this,_,De).call(this,Te)?Te.__staleWhileFetching:Te;Le!==void 0&&(w.oldValue=Le)}}else w&&(w.set="update")}if(ce!==0&&!O(this,z)&&Se(this,_,Ni).call(this),O(this,z)&&(I||O(this,ue).call(this,ee,ce,u),w&&O(this,ve).call(this,w,ee)),!c&&O(this,_e)&&O(this,Q)){let Te=O(this,Q),Le;for(;Le=Te==null?void 0:Te.shift();)(Ce=O(this,v))==null||Ce.call(this,...Le)}return this}pop(){var B;try{for(;O(this,D);){let j=O(this,V)[O(this,S)];if(Se(this,_,jr).call(this,!0),Se(this,_,De).call(this,j)){if(j.__staleWhileFetching)return j.__staleWhileFetching}else if(j!==void 0)return j}}finally{if(O(this,_e)&&O(this,Q)){let j=O(this,Q),q;for(;q=j==null?void 0:j.shift();)(B=O(this,v))==null||B.call(this,...q)}}}has(B,j={}){let{updateAgeOnHas:q=this.updateAgeOnHas,status:ce}=j,u=O(this,T).get(B);if(u!==void 0){let c=O(this,V)[u];if(Se(this,_,De).call(this,c)&&c.__staleWhileFetching===void 0)return!1;if(O(this,x).call(this,u))ce&&(ce.has="stale",O(this,ve).call(this,ce,u));else return q&&O(this,de).call(this,u),ce&&(ce.has="hit",O(this,ve).call(this,ce,u)),!0}else ce&&(ce.has="miss");return!1}peek(B,j={}){let{allowStale:q=this.allowStale}=j,ce=O(this,T).get(B);if(ce!==void 0&&(q||!O(this,x).call(this,ce))){let u=O(this,V)[ce];return Se(this,_,De).call(this,u)?u.__staleWhileFetching:u}}async fetch(B,j={}){let{allowStale:q=this.allowStale,updateAgeOnGet:ce=this.updateAgeOnGet,noDeleteOnStaleGet:u=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:d=this.noDisposeOnSet,size:w=0,sizeCalculation:I=this.sizeCalculation,noUpdateTTL:$=this.noUpdateTTL,noDeleteOnFetchRejection:ee=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:Ie=this.allowStaleOnFetchRejection,ignoreFetchAbort:Be=this.ignoreFetchAbort,allowStaleOnFetchAbort:Pe=this.allowStaleOnFetchAbort,context:Ae,forceRefresh:Ce=!1,status:Te,signal:Le}=j;if(!O(this,oe))return Te&&(Te.fetch="get"),this.get(B,{allowStale:q,updateAgeOnGet:ce,noDeleteOnStaleGet:u,status:Te});let Ke={allowStale:q,updateAgeOnGet:ce,noDeleteOnStaleGet:u,ttl:c,noDisposeOnSet:d,size:w,sizeCalculation:I,noUpdateTTL:$,noDeleteOnFetchRejection:ee,allowStaleOnFetchRejection:Ie,allowStaleOnFetchAbort:Pe,ignoreFetchAbort:Be,status:Te,signal:Le},qe=O(this,T).get(B);if(qe===void 0){Te&&(Te.fetch="miss");let Ze=Se(this,_,Dr).call(this,B,qe,Ke,Ae);return Ze.__returned=Ze}else{let Ze=O(this,V)[qe];if(Se(this,_,De).call(this,Ze)){let Ca=q&&Ze.__staleWhileFetching!==void 0;return Te&&(Te.fetch="inflight",Ca&&(Te.returnedStale=!0)),Ca?Ze.__staleWhileFetching:Ze.__returned=Ze}let et=O(this,x).call(this,qe);if(!Ce&&!et)return Te&&(Te.fetch="hit"),Se(this,_,fr).call(this,qe),ce&&O(this,de).call(this,qe),Te&&O(this,ve).call(this,Te,qe),Ze;let Ye=Se(this,_,Dr).call(this,B,qe,Ke,Ae),Ta=Ye.__staleWhileFetching!==void 0&&q;return Te&&(Te.fetch=et?"stale":"refresh",Ta&&et&&(Te.returnedStale=!0)),Ta?Ye.__staleWhileFetching:Ye.__returned=Ye}}get(B,j={}){let{allowStale:q=this.allowStale,updateAgeOnGet:ce=this.updateAgeOnGet,noDeleteOnStaleGet:u=this.noDeleteOnStaleGet,status:c}=j,d=O(this,T).get(B);if(d!==void 0){let w=O(this,V)[d],I=Se(this,_,De).call(this,w);return c&&O(this,ve).call(this,c,d),O(this,x).call(this,d)?(c&&(c.get="stale"),I?(c&&q&&w.__staleWhileFetching!==void 0&&(c.returnedStale=!0),q?w.__staleWhileFetching:void 0):(u||this.delete(B),c&&q&&(c.returnedStale=!0),q?w:void 0)):(c&&(c.get="hit"),I?w.__staleWhileFetching:(Se(this,_,fr).call(this,d),ce&&O(this,de).call(this,d),w))}else c&&(c.get="miss")}delete(B){var q,ce,u,c;let j=!1;if(O(this,D)!==0){let d=O(this,T).get(B);if(d!==void 0)if(j=!0,O(this,D)===1)this.clear();else{O(this,Y).call(this,d);let w=O(this,V)[d];Se(this,_,De).call(this,w)?w.__abortController.abort(new Error("deleted")):(O(this,ye)||O(this,_e))&&(O(this,ye)&&((q=O(this,k))==null||q.call(this,w,B,"delete")),O(this,_e)&&((ce=O(this,Q))==null||ce.push([w,B,"delete"]))),O(this,T).delete(B),O(this,M)[d]=void 0,O(this,V)[d]=void 0,d===O(this,H)?ke(this,H,O(this,ne)[d]):d===O(this,S)?ke(this,S,O(this,J)[d]):(O(this,J)[O(this,ne)[d]]=O(this,J)[d],O(this,ne)[O(this,J)[d]]=O(this,ne)[d]),Ur(this,D)._--,O(this,re).push(d)}}if(O(this,_e)&&((u=O(this,Q))!=null&&u.length)){let d=O(this,Q),w;for(;w=d==null?void 0:d.shift();)(c=O(this,v))==null||c.call(this,...w)}return j}clear(){var B,j,q;for(let ce of Se(this,_,xt).call(this,{allowStale:!0})){let u=O(this,V)[ce];if(Se(this,_,De).call(this,u))u.__abortController.abort(new Error("deleted"));else{let c=O(this,M)[ce];O(this,ye)&&((B=O(this,k))==null||B.call(this,u,c,"delete")),O(this,_e)&&((j=O(this,Q))==null||j.push([u,c,"delete"]))}}if(O(this,T).clear(),O(this,V).fill(void 0),O(this,M).fill(void 0),O(this,z)&&O(this,se)&&(O(this,z).fill(0),O(this,se).fill(0)),O(this,me)&&O(this,me).fill(0),ke(this,S,0),ke(this,H,0),O(this,re).length=0,ke(this,C,0),ke(this,D,0),O(this,_e)&&O(this,Q)){let ce=O(this,Q),u;for(;u=ce==null?void 0:ce.shift();)(q=O(this,v))==null||q.call(this,...u)}}},A=new WeakMap,N=new WeakMap,k=new WeakMap,v=new WeakMap,U=new WeakMap,D=new WeakMap,C=new WeakMap,T=new WeakMap,M=new WeakMap,V=new WeakMap,J=new WeakMap,ne=new WeakMap,S=new WeakMap,H=new WeakMap,re=new WeakMap,Q=new WeakMap,me=new WeakMap,se=new WeakMap,z=new WeakMap,ye=new WeakMap,oe=new WeakMap,_e=new WeakMap,_=new WeakSet,Ni=function(){let B=new f(O(this,A)),j=new f(O(this,A));ke(this,z,B),ke(this,se,j),ke(this,ue,(u,c,d=i.now())=>{if(j[u]=c!==0?d:0,B[u]=c,c!==0&&this.ttlAutopurge){let w=setTimeout(()=>{O(this,x).call(this,u)&&this.delete(O(this,M)[u])},c+1);w.unref&&w.unref()}}),ke(this,de,u=>{j[u]=B[u]!==0?i.now():0}),ke(this,ve,(u,c)=>{if(B[c]){let d=B[c],w=j[c];u.ttl=d,u.start=w,u.now=q||ce();let I=u.now-w;u.remainingTTL=d-I}});let q=0,ce=()=>{let u=i.now();if(this.ttlResolution>0){q=u;let c=setTimeout(()=>q=0,this.ttlResolution);c.unref&&c.unref()}return u};this.getRemainingTTL=u=>{let c=O(this,T).get(u);if(c===void 0)return 0;let d=B[c],w=j[c];if(d===0||w===0)return 1/0;let I=(q||ce())-w;return d-I},ke(this,x,u=>B[u]!==0&&j[u]!==0&&(q||ce())-j[u]>B[u])},de=new WeakMap,ve=new WeakMap,ue=new WeakMap,x=new WeakMap,Oa=function(){let B=new f(O(this,A));ke(this,C,0),ke(this,me,B),ke(this,Y,j=>{ke(this,C,O(this,C)-B[j]),B[j]=0}),ke(this,te,(j,q,ce,u)=>{if(Se(this,_,De).call(this,q))return 0;if(!o(ce))if(u){if(typeof u!="function")throw new TypeError("sizeCalculation must be a function");if(ce=u(q,j),!o(ce))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return ce}),ke(this,fe,(j,q,ce)=>{if(B[j]=q,O(this,N)){let u=O(this,N)-B[j];for(;O(this,C)>u;)Se(this,_,jr).call(this,!0)}ke(this,C,O(this,C)+B[j]),ce&&(ce.entrySize=q,ce.totalCalculatedSize=O(this,C))})},Y=new WeakMap,fe=new WeakMap,te=new WeakMap,Rt=function*({allowStale:B=this.allowStale}={}){if(O(this,D))for(let j=O(this,H);!(!Se(this,_,Li).call(this,j)||((B||!O(this,x).call(this,j))&&(yield j),j===O(this,S)));)j=O(this,ne)[j]},xt=function*({allowStale:B=this.allowStale}={}){if(O(this,D))for(let j=O(this,S);!(!Se(this,_,Li).call(this,j)||((B||!O(this,x).call(this,j))&&(yield j),j===O(this,H)));)j=O(this,J)[j]},Li=function(B){return B!==void 0&&O(this,T).get(O(this,M)[B])===B},jr=function(B){var u,c;let j=O(this,S),q=O(this,M)[j],ce=O(this,V)[j];return O(this,oe)&&Se(this,_,De).call(this,ce)?ce.__abortController.abort(new Error("evicted")):(O(this,ye)||O(this,_e))&&(O(this,ye)&&((u=O(this,k))==null||u.call(this,ce,q,"evict")),O(this,_e)&&((c=O(this,Q))==null||c.push([ce,q,"evict"]))),O(this,Y).call(this,j),B&&(O(this,M)[j]=void 0,O(this,V)[j]=void 0,O(this,re).push(j)),O(this,D)===1?(ke(this,S,ke(this,H,0)),O(this,re).length=0):ke(this,S,O(this,J)[j]),O(this,T).delete(q),Ur(this,D)._--,j},Dr=function(B,j,q,ce){let u=j===void 0?void 0:O(this,V)[j];if(Se(this,_,De).call(this,u))return u;let c=new n,{signal:d}=q;d==null||d.addEventListener("abort",()=>c.abort(d.reason),{signal:c.signal});let w={signal:c.signal,options:q,context:ce},I=(Ae,Ce=!1)=>{let{aborted:Te}=c.signal,Le=q.ignoreFetchAbort&&Ae!==void 0;if(q.status&&(Te&&!Ce?(q.status.fetchAborted=!0,q.status.fetchError=c.signal.reason,Le&&(q.status.fetchAbortIgnored=!0)):q.status.fetchResolved=!0),Te&&!Le&&!Ce)return ee(c.signal.reason);let Ke=Be;return O(this,V)[j]===Be&&(Ae===void 0?Ke.__staleWhileFetching?O(this,V)[j]=Ke.__staleWhileFetching:this.delete(B):(q.status&&(q.status.fetchUpdated=!0),this.set(B,Ae,w.options))),Ae},$=Ae=>(q.status&&(q.status.fetchRejected=!0,q.status.fetchError=Ae),ee(Ae)),ee=Ae=>{let{aborted:Ce}=c.signal,Te=Ce&&q.allowStaleOnFetchAbort,Le=Te||q.allowStaleOnFetchRejection,Ke=Le||q.noDeleteOnFetchRejection,qe=Be;if(O(this,V)[j]===Be&&(!Ke||qe.__staleWhileFetching===void 0?this.delete(B):Te||(O(this,V)[j]=qe.__staleWhileFetching)),Le)return q.status&&qe.__staleWhileFetching!==void 0&&(q.status.returnedStale=!0),qe.__staleWhileFetching;if(qe.__returned===qe)throw Ae},Ie=(Ae,Ce)=>{var Le;let Te=(Le=O(this,U))==null?void 0:Le.call(this,B,u,w);Te&&Te instanceof Promise&&Te.then(Ke=>Ae(Ke===void 0?void 0:Ke),Ce),c.signal.addEventListener("abort",()=>{(!q.ignoreFetchAbort||q.allowStaleOnFetchAbort)&&(Ae(void 0),q.allowStaleOnFetchAbort&&(Ae=Ke=>I(Ke,!0)))})};q.status&&(q.status.fetchDispatched=!0);let Be=new Promise(Ie).then(I,$),Pe=Object.assign(Be,{__abortController:c,__staleWhileFetching:u,__returned:void 0});return j===void 0?(this.set(B,Pe,{...w.options,status:void 0}),j=O(this,T).get(B)):O(this,V)[j]=Pe,Pe},De=function(B){if(!O(this,oe))return!1;let j=B;return!!j&&j instanceof Promise&&j.hasOwnProperty("__staleWhileFetching")&&j.__abortController instanceof n},Ui=function(B,j){O(this,ne)[j]=B,O(this,J)[B]=j},fr=function(B){B!==O(this,H)&&(B===O(this,S)?ke(this,S,O(this,J)[B]):Se(this,_,Ui).call(this,O(this,ne)[B],O(this,J)[B]),Se(this,_,Ui).call(this,O(this,H),B),ke(this,H,B))},L);e.LRUCache=g}),At=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.ContainerIterator=e.Container=e.Base=void 0;var i=class{constructor(h=0){this.iteratorType=h}equals(h){return this.o===h.o}};e.ContainerIterator=i;var t=class{constructor(){this.i=0}get length(){return this.i}size(){return this.i}empty(){return this.i===0}};e.Base=t;var a=class extends t{};e.Container=a}),Th=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var i=At(),t=class extends i.Base{constructor(h=[]){super(),this.S=[];let n=this;h.forEach(function(r){n.push(r)})}clear(){this.i=0,this.S=[]}push(h){return this.S.push(h),this.i+=1,this.i}pop(){if(this.i!==0)return this.i-=1,this.S.pop()}top(){return this.S[this.i-1]}},a=t;e.default=a}),Ch=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var i=At(),t=class extends i.Base{constructor(h=[]){super(),this.j=0,this.q=[];let n=this;h.forEach(function(r){n.push(r)})}clear(){this.q=[],this.i=this.j=0}push(h){let n=this.q.length;if(this.j/n>.5&&this.j+this.i>=n&&n>4096){let r=this.i;for(let s=0;s<r;++s)this.q[s]=this.q[this.j+s];this.j=0,this.q[this.i]=h}else this.q[this.j+this.i]=h;return++this.i}pop(){if(this.i===0)return;let h=this.q[this.j++];return this.i-=1,h}front(){if(this.i!==0)return this.q[this.j]}},a=t;e.default=a}),Bh=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var i=At(),t=class extends i.Base{constructor(h=[],n=function(s,o){return s>o?-1:s<o?1:0},r=!0){if(super(),this.v=n,Array.isArray(h))this.C=r?[...h]:h;else{this.C=[];let o=this;h.forEach(function(l){o.C.push(l)})}this.i=this.C.length;let s=this.i>>1;for(let o=this.i-1>>1;o>=0;--o)this.k(o,s)}m(h){let n=this.C[h];for(;h>0;){let r=h-1>>1,s=this.C[r];if(this.v(s,n)<=0)break;this.C[h]=s,h=r}this.C[h]=n}k(h,n){let r=this.C[h];for(;h<n;){let s=h<<1|1,o=s+1,l=this.C[s];if(o<this.i&&this.v(l,this.C[o])>0&&(s=o,l=this.C[o]),this.v(l,r)>=0)break;this.C[h]=l,h=s}this.C[h]=r}clear(){this.i=0,this.C.length=0}push(h){this.C.push(h),this.m(this.i),this.i+=1}pop(){if(this.i===0)return;let h=this.C[0],n=this.C.pop();return this.i-=1,this.i&&(this.C[0]=n,this.k(0,this.i>>1)),h}top(){return this.C[0]}find(h){return this.C.indexOf(h)>=0}remove(h){let n=this.C.indexOf(h);return n<0?!1:(n===0?this.pop():n===this.i-1?(this.C.pop(),this.i-=1):(this.C.splice(n,1,this.C.pop()),this.i-=1,this.m(n),this.k(n,this.i>>1)),!0)}updateItem(h){let n=this.C.indexOf(h);return n<0?!1:(this.m(n),this.k(n,this.i>>1),!0)}toArray(){return[...this.C]}},a=t;e.default=a}),gi=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var i=At(),t=class extends i.Container{},a=t;e.default=a}),kt=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.throwIteratorAccessError=i;function i(){throw new RangeError("Iterator access denied!")}}),ps=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.RandomIterator=void 0;var i=At(),t=kt(),a=class extends i.ContainerIterator{constructor(h,n){super(n),this.o=h,this.iteratorType===0?(this.pre=function(){return this.o===0&&(0,t.throwIteratorAccessError)(),this.o-=1,this},this.next=function(){return this.o===this.container.size()&&(0,t.throwIteratorAccessError)(),this.o+=1,this}):(this.pre=function(){return this.o===this.container.size()-1&&(0,t.throwIteratorAccessError)(),this.o+=1,this},this.next=function(){return this.o===-1&&(0,t.throwIteratorAccessError)(),this.o-=1,this})}get pointer(){return this.container.getElementByPos(this.o)}set pointer(h){this.container.setElementByPos(this.o,h)}};e.RandomIterator=a}),Ph=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var i=a(gi()),t=ps();function a(s){return s&&s.t?s:{default:s}}var h=class Ra extends t.RandomIterator{constructor(o,l,f){super(o,f),this.container=l}copy(){return new Ra(this.o,this.container,this.iteratorType)}},n=class extends i.default{constructor(s=[],o=!0){if(super(),Array.isArray(s))this.J=o?[...s]:s,this.i=s.length;else{this.J=[];let l=this;s.forEach(function(f){l.pushBack(f)})}}clear(){this.i=0,this.J.length=0}begin(){return new h(0,this)}end(){return new h(this.i,this)}rBegin(){return new h(this.i-1,this,1)}rEnd(){return new h(-1,this,1)}front(){return this.J[0]}back(){return this.J[this.i-1]}getElementByPos(s){if(s<0||s>this.i-1)throw new RangeError;return this.J[s]}eraseElementByPos(s){if(s<0||s>this.i-1)throw new RangeError;return this.J.splice(s,1),this.i-=1,this.i}eraseElementByValue(s){let o=0;for(let l=0;l<this.i;++l)this.J[l]!==s&&(this.J[o++]=this.J[l]);return this.i=this.J.length=o,this.i}eraseElementByIterator(s){let o=s.o;return s=s.next(),this.eraseElementByPos(o),s}pushBack(s){return this.J.push(s),this.i+=1,this.i}popBack(){if(this.i!==0)return this.i-=1,this.J.pop()}setElementByPos(s,o){if(s<0||s>this.i-1)throw new RangeError;this.J[s]=o}insert(s,o,l=1){if(s<0||s>this.i)throw new RangeError;return this.J.splice(s,0,...new Array(l).fill(o)),this.i+=l,this.i}find(s){for(let o=0;o<this.i;++o)if(this.J[o]===s)return new h(o,this);return this.end()}reverse(){this.J.reverse()}unique(){let s=1;for(let o=1;o<this.i;++o)this.J[o]!==this.J[o-1]&&(this.J[s++]=this.J[o]);return this.i=this.J.length=s,this.i}sort(s){this.J.sort(s)}forEach(s){for(let o=0;o<this.i;++o)s(this.J[o],o,this)}[Symbol.iterator](){return(function*(){yield*this.J}).bind(this)()}},r=n;e.default=r}),Oh=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var i=h(gi()),t=At(),a=kt();function h(o){return o&&o.t?o:{default:o}}var n=class xa extends t.ContainerIterator{constructor(l,f,p,g){super(g),this.o=l,this.h=f,this.container=p,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.L,this})}get pointer(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o.l}set pointer(l){this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o.l=l}copy(){return new xa(this.o,this.h,this.container,this.iteratorType)}},r=class extends i.default{constructor(o=[]){super(),this.h={},this.p=this._=this.h.L=this.h.B=this.h;let l=this;o.forEach(function(f){l.pushBack(f)})}V(o){let{L:l,B:f}=o;l.B=f,f.L=l,o===this.p&&(this.p=f),o===this._&&(this._=l),this.i-=1}G(o,l){let f=l.B,p={l:o,L:l,B:f};l.B=p,f.L=p,l===this.h&&(this.p=p),f===this.h&&(this._=p),this.i+=1}clear(){this.i=0,this.p=this._=this.h.L=this.h.B=this.h}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.l}back(){return this._.l}getElementByPos(o){if(o<0||o>this.i-1)throw new RangeError;let l=this.p;for(;o--;)l=l.B;return l.l}eraseElementByPos(o){if(o<0||o>this.i-1)throw new RangeError;let l=this.p;for(;o--;)l=l.B;return this.V(l),this.i}eraseElementByValue(o){let l=this.p;for(;l!==this.h;)l.l===o&&this.V(l),l=l.B;return this.i}eraseElementByIterator(o){let l=o.o;return l===this.h&&(0,a.throwIteratorAccessError)(),o=o.next(),this.V(l),o}pushBack(o){return this.G(o,this._),this.i}popBack(){if(this.i===0)return;let o=this._.l;return this.V(this._),o}pushFront(o){return this.G(o,this.h),this.i}popFront(){if(this.i===0)return;let o=this.p.l;return this.V(this.p),o}setElementByPos(o,l){if(o<0||o>this.i-1)throw new RangeError;let f=this.p;for(;o--;)f=f.B;f.l=l}insert(o,l,f=1){if(o<0||o>this.i)throw new RangeError;if(f<=0)return this.i;if(o===0)for(;f--;)this.pushFront(l);else if(o===this.i)for(;f--;)this.pushBack(l);else{let p=this.p;for(let m=1;m<o;++m)p=p.B;let g=p.B;for(this.i+=f;f--;)p.B={l,L:p},p.B.L=p,p=p.B;p.B=g,g.L=p}return this.i}find(o){let l=this.p;for(;l!==this.h;){if(l.l===o)return new n(l,this.h,this);l=l.B}return this.end()}reverse(){if(this.i<=1)return;let o=this.p,l=this._,f=0;for(;f<<1<this.i;){let p=o.l;o.l=l.l,l.l=p,o=o.B,l=l.L,f+=1}}unique(){if(this.i<=1)return this.i;let o=this.p;for(;o!==this.h;){let l=o;for(;l.B!==this.h&&l.l===l.B.l;)l=l.B,this.i-=1;o.B=l.B,o.B.L=o,o=o.B}return this.i}sort(o){if(this.i<=1)return;let l=[];this.forEach(function(p){l.push(p)}),l.sort(o);let f=this.p;l.forEach(function(p){f.l=p,f=f.B})}merge(o){let l=this;if(this.i===0)o.forEach(function(f){l.pushBack(f)});else{let f=this.p;o.forEach(function(p){for(;f!==l.h&&f.l<=p;)f=f.B;l.G(p,f.L)})}return this.i}forEach(o){let l=this.p,f=0;for(;l!==this.h;)o(l.l,f++,this),l=l.B}[Symbol.iterator](){return(function*(){if(this.i===0)return;let o=this.p;for(;o!==this.h;)yield o.l,o=o.B}).bind(this)()}},s=r;e.default=s}),Rh=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var i=a(gi()),t=ps();function a(s){return s&&s.t?s:{default:s}}var h=class Ma extends t.RandomIterator{constructor(o,l,f){super(o,f),this.container=l}copy(){return new Ma(this.o,this.container,this.iteratorType)}},n=class extends i.default{constructor(s=[],o=4096){super(),this.j=0,this.D=0,this.R=0,this.N=0,this.P=0,this.A=[];let l=(()=>{if(typeof s.length=="number")return s.length;if(typeof s.size=="number")return s.size;if(typeof s.size=="function")return s.size();throw new TypeError("Cannot get the length or size of the container")})();this.F=o,this.P=Math.max(Math.ceil(l/this.F),1);for(let g=0;g<this.P;++g)this.A.push(new Array(this.F));let f=Math.ceil(l/this.F);this.j=this.R=(this.P>>1)-(f>>1),this.D=this.N=this.F-l%this.F>>1;let p=this;s.forEach(function(g){p.pushBack(g)})}T(){let s=[],o=Math.max(this.P>>1,1);for(let l=0;l<o;++l)s[l]=new Array(this.F);for(let l=this.j;l<this.P;++l)s[s.length]=this.A[l];for(let l=0;l<this.R;++l)s[s.length]=this.A[l];s[s.length]=[...this.A[this.R]],this.j=o,this.R=s.length-1;for(let l=0;l<o;++l)s[s.length]=new Array(this.F);this.A=s,this.P=s.length}O(s){let o=this.D+s+1,l=o%this.F,f=l-1,p=this.j+(o-l)/this.F;return l===0&&(p-=1),p%=this.P,f<0&&(f+=this.F),{curNodeBucketIndex:p,curNodePointerIndex:f}}clear(){this.A=[new Array(this.F)],this.P=1,this.j=this.R=this.i=0,this.D=this.N=this.F>>1}begin(){return new h(0,this)}end(){return new h(this.i,this)}rBegin(){return new h(this.i-1,this,1)}rEnd(){return new h(-1,this,1)}front(){if(this.i!==0)return this.A[this.j][this.D]}back(){if(this.i!==0)return this.A[this.R][this.N]}pushBack(s){return this.i&&(this.N<this.F-1?this.N+=1:this.R<this.P-1?(this.R+=1,this.N=0):(this.R=0,this.N=0),this.R===this.j&&this.N===this.D&&this.T()),this.i+=1,this.A[this.R][this.N]=s,this.i}popBack(){if(this.i===0)return;let s=this.A[this.R][this.N];return this.i!==1&&(this.N>0?this.N-=1:this.R>0?(this.R-=1,this.N=this.F-1):(this.R=this.P-1,this.N=this.F-1)),this.i-=1,s}pushFront(s){return this.i&&(this.D>0?this.D-=1:this.j>0?(this.j-=1,this.D=this.F-1):(this.j=this.P-1,this.D=this.F-1),this.j===this.R&&this.D===this.N&&this.T()),this.i+=1,this.A[this.j][this.D]=s,this.i}popFront(){if(this.i===0)return;let s=this.A[this.j][this.D];return this.i!==1&&(this.D<this.F-1?this.D+=1:this.j<this.P-1?(this.j+=1,this.D=0):(this.j=0,this.D=0)),this.i-=1,s}getElementByPos(s){if(s<0||s>this.i-1)throw new RangeError;let{curNodeBucketIndex:o,curNodePointerIndex:l}=this.O(s);return this.A[o][l]}setElementByPos(s,o){if(s<0||s>this.i-1)throw new RangeError;let{curNodeBucketIndex:l,curNodePointerIndex:f}=this.O(s);this.A[l][f]=o}insert(s,o,l=1){if(s<0||s>this.i)throw new RangeError;if(s===0)for(;l--;)this.pushFront(o);else if(s===this.i)for(;l--;)this.pushBack(o);else{let f=[];for(let p=s;p<this.i;++p)f.push(this.getElementByPos(p));this.cut(s-1);for(let p=0;p<l;++p)this.pushBack(o);for(let p=0;p<f.length;++p)this.pushBack(f[p])}return this.i}cut(s){if(s<0)return this.clear(),0;let{curNodeBucketIndex:o,curNodePointerIndex:l}=this.O(s);return this.R=o,this.N=l,this.i=s+1,this.i}eraseElementByPos(s){if(s<0||s>this.i-1)throw new RangeError;if(s===0)this.popFront();else if(s===this.i-1)this.popBack();else{let o=[];for(let f=s+1;f<this.i;++f)o.push(this.getElementByPos(f));this.cut(s),this.popBack();let l=this;o.forEach(function(f){l.pushBack(f)})}return this.i}eraseElementByValue(s){if(this.i===0)return 0;let o=[];for(let f=0;f<this.i;++f){let p=this.getElementByPos(f);p!==s&&o.push(p)}let l=o.length;for(let f=0;f<l;++f)this.setElementByPos(f,o[f]);return this.cut(l-1)}eraseElementByIterator(s){let o=s.o;return this.eraseElementByPos(o),s=s.next(),s}find(s){for(let o=0;o<this.i;++o)if(this.getElementByPos(o)===s)return new h(o,this);return this.end()}reverse(){let s=0,o=this.i-1;for(;s<o;){let l=this.getElementByPos(s);this.setElementByPos(s,this.getElementByPos(o)),this.setElementByPos(o,l),s+=1,o-=1}}unique(){if(this.i<=1)return this.i;let s=1,o=this.getElementByPos(0);for(let l=1;l<this.i;++l){let f=this.getElementByPos(l);f!==o&&(o=f,this.setElementByPos(s++,f))}for(;this.i>s;)this.popBack();return this.i}sort(s){let o=[];for(let l=0;l<this.i;++l)o.push(this.getElementByPos(l));o.sort(s);for(let l=0;l<this.i;++l)this.setElementByPos(l,o[l])}shrinkToFit(){if(this.i===0)return;let s=[];this.forEach(function(o){s.push(o)}),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 o=0;o<this.P;++o)this.A.push(new Array(this.F));for(let o=0;o<s.length;++o)this.pushBack(s[o])}forEach(s){for(let o=0;o<this.i;++o)s(this.getElementByPos(o),o,this)}[Symbol.iterator](){return(function*(){for(let s=0;s<this.i;++s)yield this.getElementByPos(s)}).bind(this)()}},r=n;e.default=r}),xh=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.TreeNodeEnableIndex=e.TreeNode=void 0;var i=class{constructor(a,h){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=a,this.l=h}L(){let a=this;if(a.ee===1&&a.tt.tt===a)a=a.W;else if(a.U)for(a=a.U;a.W;)a=a.W;else{let h=a.tt;for(;h.U===a;)a=h,h=a.tt;a=h}return a}B(){let a=this;if(a.W){for(a=a.W;a.U;)a=a.U;return a}else{let h=a.tt;for(;h.W===a;)a=h,h=a.tt;return a.W!==h?h:a}}te(){let a=this.tt,h=this.W,n=h.U;return a.tt===this?a.tt=h:a.U===this?a.U=h:a.W=h,h.tt=a,h.U=this,this.tt=h,this.W=n,n&&(n.tt=this),h}se(){let a=this.tt,h=this.U,n=h.W;return a.tt===this?a.tt=h:a.U===this?a.U=h:a.W=h,h.tt=a,h.W=this,this.tt=h,this.U=n,n&&(n.tt=this),h}};e.TreeNode=i;var t=class extends i{constructor(){super(...arguments),this.rt=1}te(){let a=super.te();return this.ie(),a.ie(),a}se(){let a=super.se();return this.ie(),a.ie(),a}ie(){this.rt=1,this.U&&(this.rt+=this.U.rt),this.W&&(this.rt+=this.W.rt)}};e.TreeNodeEnableIndex=t}),gs=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var i=xh(),t=At(),a=kt(),h=class extends t.Container{constructor(r=function(o,l){return o<l?-1:o>l?1:0},s=!1){super(),this.Y=void 0,this.v=r,s?(this.re=i.TreeNodeEnableIndex,this.M=function(o,l,f){let p=this.ne(o,l,f);if(p){let g=p.tt;for(;g!==this.h;)g.rt+=1,g=g.tt;let m=this.he(p);if(m){let{parentNode:b,grandParent:y,curNode:A}=m;b.ie(),y.ie(),A.ie()}}return this.i},this.V=function(o){let l=this.fe(o);for(;l!==this.h;)l.rt-=1,l=l.tt}):(this.re=i.TreeNode,this.M=function(o,l,f){let p=this.ne(o,l,f);return p&&this.he(p),this.i},this.V=this.fe),this.h=new this.re}X(r,s){let o=this.h;for(;r;){let l=this.v(r.u,s);if(l<0)r=r.W;else if(l>0)o=r,r=r.U;else return r}return o}Z(r,s){let o=this.h;for(;r;)this.v(r.u,s)<=0?r=r.W:(o=r,r=r.U);return o}$(r,s){let o=this.h;for(;r;){let l=this.v(r.u,s);if(l<0)o=r,r=r.W;else if(l>0)r=r.U;else return r}return o}rr(r,s){let o=this.h;for(;r;)this.v(r.u,s)<0?(o=r,r=r.W):r=r.U;return o}ue(r){for(;;){let s=r.tt;if(s===this.h)return;if(r.ee===1){r.ee=0;return}if(r===s.U){let o=s.W;if(o.ee===1)o.ee=0,s.ee=1,s===this.Y?this.Y=s.te():s.te();else if(o.W&&o.W.ee===1){o.ee=s.ee,s.ee=0,o.W.ee=0,s===this.Y?this.Y=s.te():s.te();return}else o.U&&o.U.ee===1?(o.ee=1,o.U.ee=0,o.se()):(o.ee=1,r=s)}else{let o=s.U;if(o.ee===1)o.ee=0,s.ee=1,s===this.Y?this.Y=s.se():s.se();else if(o.U&&o.U.ee===1){o.ee=s.ee,s.ee=0,o.U.ee=0,s===this.Y?this.Y=s.se():s.se();return}else o.W&&o.W.ee===1?(o.ee=1,o.W.ee=0,o.te()):(o.ee=1,r=s)}}}fe(r){if(this.i===1)return this.clear(),this.h;let s=r;for(;s.U||s.W;){if(s.W)for(s=s.W;s.U;)s=s.U;else s=s.U;[r.u,s.u]=[s.u,r.u],[r.l,s.l]=[s.l,r.l],r=s}this.h.U===s?this.h.U=s.tt:this.h.W===s&&(this.h.W=s.tt),this.ue(s);let o=s.tt;return s===o.U?o.U=void 0:o.W=void 0,this.i-=1,this.Y.ee=0,o}oe(r,s){return r===void 0?!1:this.oe(r.U,s)||s(r)?!0:this.oe(r.W,s)}he(r){for(;;){let s=r.tt;if(s.ee===0)return;let o=s.tt;if(s===o.U){let l=o.W;if(l&&l.ee===1){if(l.ee=s.ee=0,o===this.Y)return;o.ee=1,r=o;continue}else if(r===s.W){if(r.ee=0,r.U&&(r.U.tt=s),r.W&&(r.W.tt=o),s.W=r.U,o.U=r.W,r.U=s,r.W=o,o===this.Y)this.Y=r,this.h.tt=r;else{let f=o.tt;f.U===o?f.U=r:f.W=r}return r.tt=o.tt,s.tt=r,o.tt=r,o.ee=1,{parentNode:s,grandParent:o,curNode:r}}else s.ee=0,o===this.Y?this.Y=o.se():o.se(),o.ee=1}else{let l=o.U;if(l&&l.ee===1){if(l.ee=s.ee=0,o===this.Y)return;o.ee=1,r=o;continue}else if(r===s.U){if(r.ee=0,r.U&&(r.U.tt=o),r.W&&(r.W.tt=s),o.W=r.U,s.U=r.W,r.U=o,r.W=s,o===this.Y)this.Y=r,this.h.tt=r;else{let f=o.tt;f.U===o?f.U=r:f.W=r}return r.tt=o.tt,s.tt=r,o.tt=r,o.ee=1,{parentNode:s,grandParent:o,curNode:r}}else s.ee=0,o===this.Y?this.Y=o.te():o.te(),o.ee=1}return}}ne(r,s,o){if(this.Y===void 0){this.i+=1,this.Y=new this.re(r,s),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 l,f=this.h.U,p=this.v(f.u,r);if(p===0){f.l=s;return}else if(p>0)f.U=new this.re(r,s),f.U.tt=f,l=f.U,this.h.U=l;else{let g=this.h.W,m=this.v(g.u,r);if(m===0){g.l=s;return}else if(m<0)g.W=new this.re(r,s),g.W.tt=g,l=g.W,this.h.W=l;else{if(o!==void 0){let b=o.o;if(b!==this.h){let y=this.v(b.u,r);if(y===0){b.l=s;return}else if(y>0){let A=b.L(),N=this.v(A.u,r);if(N===0){A.l=s;return}else N<0&&(l=new this.re(r,s),A.W===void 0?(A.W=l,l.tt=A):(b.U=l,l.tt=b))}}}if(l===void 0)for(l=this.Y;;){let b=this.v(l.u,r);if(b>0){if(l.U===void 0){l.U=new this.re(r,s),l.U.tt=l,l=l.U;break}l=l.U}else if(b<0){if(l.W===void 0){l.W=new this.re(r,s),l.W.tt=l,l=l.W;break}l=l.W}else{l.l=s;return}}}}return this.i+=1,l}I(r,s){for(;r;){let o=this.v(r.u,s);if(o<0)r=r.W;else if(o>0)r=r.U;else return r}return r||this.h}clear(){this.i=0,this.Y=void 0,this.h.tt=void 0,this.h.U=this.h.W=void 0}updateKeyByIterator(r,s){let o=r.o;if(o===this.h&&(0,a.throwIteratorAccessError)(),this.i===1)return o.u=s,!0;if(o===this.h.U)return this.v(o.B().u,s)>0?(o.u=s,!0):!1;if(o===this.h.W)return this.v(o.L().u,s)<0?(o.u=s,!0):!1;let l=o.L().u;if(this.v(l,s)>=0)return!1;let f=o.B().u;return this.v(f,s)<=0?!1:(o.u=s,!0)}eraseElementByPos(r){if(r<0||r>this.i-1)throw new RangeError;let s=0,o=this;return this.oe(this.Y,function(l){return r===s?(o.V(l),!0):(s+=1,!1)}),this.i}eraseElementByKey(r){if(this.i===0)return!1;let s=this.I(this.Y,r);return s===this.h?!1:(this.V(s),!0)}eraseElementByIterator(r){let s=r.o;s===this.h&&(0,a.throwIteratorAccessError)();let o=s.W===void 0;return r.iteratorType===0?o&&r.next():(!o||s.U===void 0)&&r.next(),this.V(s),r}forEach(r){let s=0;for(let o of this)r(o,s++,this)}getElementByPos(r){if(r<0||r>this.i-1)throw new RangeError;let s,o=0;for(let l of this){if(o===r){s=l;break}o+=1}return s}getHeight(){if(this.i===0)return 0;let r=function(s){return s?Math.max(r(s.U),r(s.W))+1:0};return r(this.Y)}},n=h;e.default=n}),ms=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var i=At(),t=kt(),a=class extends i.ContainerIterator{constructor(n,r,s){super(s),this.o=n,this.h=r,this.iteratorType===0?(this.pre=function(){return this.o===this.h.U&&(0,t.throwIteratorAccessError)(),this.o=this.o.L(),this},this.next=function(){return this.o===this.h&&(0,t.throwIteratorAccessError)(),this.o=this.o.B(),this}):(this.pre=function(){return this.o===this.h.W&&(0,t.throwIteratorAccessError)(),this.o=this.o.B(),this},this.next=function(){return this.o===this.h&&(0,t.throwIteratorAccessError)(),this.o=this.o.L(),this})}get index(){let n=this.o,r=this.h.tt;if(n===this.h)return r?r.rt-1:0;let s=0;for(n.U&&(s+=n.U.rt);n!==r;){let o=n.tt;n===o.W&&(s+=1,o.U&&(s+=o.U.rt)),n=o}return s}},h=a;e.default=h}),Mh=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var i=h(gs()),t=h(ms()),a=kt();function h(o){return o&&o.t?o:{default:o}}var n=class Na extends t.default{constructor(l,f,p,g){super(l,f,g),this.container=p}get pointer(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o.u}copy(){return new Na(this.o,this.h,this.container,this.iteratorType)}},r=class extends i.default{constructor(o=[],l,f){super(l,f);let p=this;o.forEach(function(g){p.insert(g)})}*K(o){o!==void 0&&(yield*this.K(o.U),yield o.u,yield*this.K(o.W))}begin(){return new n(this.h.U||this.h,this.h,this)}end(){return new n(this.h,this.h,this)}rBegin(){return new n(this.h.W||this.h,this.h,this,1)}rEnd(){return new n(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(o,l){return this.M(o,void 0,l)}find(o){let l=this.I(this.Y,o);return new n(l,this.h,this)}lowerBound(o){let l=this.X(this.Y,o);return new n(l,this.h,this)}upperBound(o){let l=this.Z(this.Y,o);return new n(l,this.h,this)}reverseLowerBound(o){let l=this.$(this.Y,o);return new n(l,this.h,this)}reverseUpperBound(o){let l=this.rr(this.Y,o);return new n(l,this.h,this)}union(o){let l=this;return o.forEach(function(f){l.insert(f)}),this.i}[Symbol.iterator](){return this.K(this.Y)}},s=r;e.default=s}),Nh=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var i=h(gs()),t=h(ms()),a=kt();function h(o){return o&&o.t?o:{default:o}}var n=class La extends t.default{constructor(l,f,p,g){super(l,f,g),this.container=p}get pointer(){this.o===this.h&&(0,a.throwIteratorAccessError)();let l=this;return new Proxy([],{get(f,p){if(p==="0")return l.o.u;if(p==="1")return l.o.l},set(f,p,g){if(p!=="1")throw new TypeError("props must be 1");return l.o.l=g,!0}})}copy(){return new La(this.o,this.h,this.container,this.iteratorType)}},r=class extends i.default{constructor(o=[],l,f){super(l,f);let p=this;o.forEach(function(g){p.setElement(g[0],g[1])})}*K(o){o!==void 0&&(yield*this.K(o.U),yield[o.u,o.l],yield*this.K(o.W))}begin(){return new n(this.h.U||this.h,this.h,this)}end(){return new n(this.h,this.h,this)}rBegin(){return new n(this.h.W||this.h,this.h,this,1)}rEnd(){return new n(this.h,this.h,this,1)}front(){if(this.i===0)return;let o=this.h.U;return[o.u,o.l]}back(){if(this.i===0)return;let o=this.h.W;return[o.u,o.l]}lowerBound(o){let l=this.X(this.Y,o);return new n(l,this.h,this)}upperBound(o){let l=this.Z(this.Y,o);return new n(l,this.h,this)}reverseLowerBound(o){let l=this.$(this.Y,o);return new n(l,this.h,this)}reverseUpperBound(o){let l=this.rr(this.Y,o);return new n(l,this.h,this)}setElement(o,l,f){return this.M(o,l,f)}find(o){let l=this.I(this.Y,o);return new n(l,this.h,this)}getElementByKey(o){return this.I(this.Y,o).l}union(o){let l=this;return o.forEach(function(f){l.setElement(f[0],f[1])}),this.i}[Symbol.iterator](){return this.K(this.Y)}},s=r;e.default=s}),bs=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=i;function i(t){let a=typeof t;return a==="object"&&t!==null||a==="function"}}),ys=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.HashContainerIterator=e.HashContainer=void 0;var i=At(),t=h(bs()),a=kt();function h(s){return s&&s.t?s:{default:s}}var n=class extends i.ContainerIterator{constructor(s,o,l){super(l),this.o=s,this.h=o,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.L,this})}};e.HashContainerIterator=n;var r=class extends i.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(s){let{L:o,B:l}=s;o.B=l,l.L=o,s===this.p&&(this.p=l),s===this._&&(this._=o),this.i-=1}M(s,o,l){l===void 0&&(l=(0,t.default)(s));let f;if(l){let p=s[this.HASH_TAG];if(p!==void 0)return this.H[p].l=o,this.i;Object.defineProperty(s,this.HASH_TAG,{value:this.H.length,configurable:!0}),f={u:s,l:o,L:this._,B:this.h},this.H.push(f)}else{let p=this.g[s];if(p)return p.l=o,this.i;f={u:s,l:o,L:this._,B:this.h},this.g[s]=f}return this.i===0?(this.p=f,this.h.B=f):this._.B=f,this._=f,this.h.L=f,++this.i}I(s,o){if(o===void 0&&(o=(0,t.default)(s)),o){let l=s[this.HASH_TAG];return l===void 0?this.h:this.H[l]}else return this.g[s]||this.h}clear(){let s=this.HASH_TAG;this.H.forEach(function(o){delete o.u[s]}),this.H=[],this.g={},Object.setPrototypeOf(this.g,null),this.i=0,this.p=this._=this.h.L=this.h.B=this.h}eraseElementByKey(s,o){let l;if(o===void 0&&(o=(0,t.default)(s)),o){let f=s[this.HASH_TAG];if(f===void 0)return!1;delete s[this.HASH_TAG],l=this.H[f],delete this.H[f]}else{if(l=this.g[s],l===void 0)return!1;delete this.g[s]}return this.V(l),!0}eraseElementByIterator(s){let o=s.o;return o===this.h&&(0,a.throwIteratorAccessError)(),this.V(o),s.next()}eraseElementByPos(s){if(s<0||s>this.i-1)throw new RangeError;let o=this.p;for(;s--;)o=o.B;return this.V(o),this.i}};e.HashContainer=r}),Lh=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var i=ys(),t=kt(),a=class Ua extends i.HashContainerIterator{constructor(s,o,l,f){super(s,o,f),this.container=l}get pointer(){return this.o===this.h&&(0,t.throwIteratorAccessError)(),this.o.u}copy(){return new Ua(this.o,this.h,this.container,this.iteratorType)}},h=class extends i.HashContainer{constructor(r=[]){super();let s=this;r.forEach(function(o){s.insert(o)})}begin(){return new a(this.p,this.h,this)}end(){return new a(this.h,this.h,this)}rBegin(){return new a(this._,this.h,this,1)}rEnd(){return new a(this.h,this.h,this,1)}front(){return this.p.u}back(){return this._.u}insert(r,s){return this.M(r,void 0,s)}getElementByPos(r){if(r<0||r>this.i-1)throw new RangeError;let s=this.p;for(;r--;)s=s.B;return s.u}find(r,s){let o=this.I(r,s);return new a(o,this.h,this)}forEach(r){let s=0,o=this.p;for(;o!==this.h;)r(o.u,s++,this),o=o.B}[Symbol.iterator](){return(function*(){let r=this.p;for(;r!==this.h;)yield r.u,r=r.B}).bind(this)()}},n=h;e.default=n}),Uh=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var i=ys(),t=h(bs()),a=kt();function h(o){return o&&o.t?o:{default:o}}var n=class ja extends i.HashContainerIterator{constructor(l,f,p,g){super(l,f,g),this.container=p}get pointer(){this.o===this.h&&(0,a.throwIteratorAccessError)();let l=this;return new Proxy([],{get(f,p){if(p==="0")return l.o.u;if(p==="1")return l.o.l},set(f,p,g){if(p!=="1")throw new TypeError("props must be 1");return l.o.l=g,!0}})}copy(){return new ja(this.o,this.h,this.container,this.iteratorType)}},r=class extends i.HashContainer{constructor(o=[]){super();let l=this;o.forEach(function(f){l.setElement(f[0],f[1])})}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(){if(this.i!==0)return[this.p.u,this.p.l]}back(){if(this.i!==0)return[this._.u,this._.l]}setElement(o,l,f){return this.M(o,l,f)}getElementByKey(o,l){if(l===void 0&&(l=(0,t.default)(o)),l){let p=o[this.HASH_TAG];return p!==void 0?this.H[p].l:void 0}let f=this.g[o];return f?f.l:void 0}getElementByPos(o){if(o<0||o>this.i-1)throw new RangeError;let l=this.p;for(;o--;)l=l.B;return[l.u,l.l]}find(o,l){let f=this.I(o,l);return new n(f,this.h,this)}forEach(o){let l=0,f=this.p;for(;f!==this.h;)o([f.u,f.l],l++,this),f=f.B}[Symbol.iterator](){return(function*(){let o=this.p;for(;o!==this.h;)yield[o.u,o.l],o=o.B}).bind(this)()}},s=r;e.default=s}),jh=be(e=>{ae(),he(),le(),Object.defineProperty(e,"t",{value:!0}),Object.defineProperty(e,"Deque",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"HashMap",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(e,"HashSet",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"LinkList",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"OrderedMap",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"OrderedSet",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"PriorityQueue",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"Queue",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"Stack",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"Vector",{enumerable:!0,get:function(){return h.default}});var i=p(Th()),t=p(Ch()),a=p(Bh()),h=p(Ph()),n=p(Oh()),r=p(Rh()),s=p(Mh()),o=p(Nh()),l=p(Lh()),f=p(Uh());function p(g){return g&&g.t?g:{default:g}}}),Dh=be((e,i)=>{ae(),he(),le();var t=jh().OrderedSet,a=St()("number-allocator:trace"),h=St()("number-allocator:error");function n(s,o){this.low=s,this.high=o}n.prototype.equals=function(s){return this.low===s.low&&this.high===s.high},n.prototype.compare=function(s){return this.low<s.low&&this.high<s.low?-1:s.low<this.low&&s.high<this.low?1:0};function r(s,o){if(!(this instanceof r))return new r(s,o);this.min=s,this.max=o,this.ss=new t([],(l,f)=>l.compare(f)),a("Create"),this.clear()}r.prototype.firstVacant=function(){return this.ss.size()===0?null:this.ss.front().low},r.prototype.alloc=function(){if(this.ss.size()===0)return a("alloc():empty"),null;let s=this.ss.begin(),o=s.pointer.low,l=s.pointer.high,f=o;return f+1<=l?this.ss.updateKeyByIterator(s,new n(o+1,l)):this.ss.eraseElementByPos(0),a("alloc():"+f),f},r.prototype.use=function(s){let o=new n(s,s),l=this.ss.lowerBound(o);if(!l.equals(this.ss.end())){let f=l.pointer.low,p=l.pointer.high;return l.pointer.equals(o)?(this.ss.eraseElementByIterator(l),a("use():"+s),!0):f>s?!1:f===s?(this.ss.updateKeyByIterator(l,new n(f+1,p)),a("use():"+s),!0):p===s?(this.ss.updateKeyByIterator(l,new n(f,p-1)),a("use():"+s),!0):(this.ss.updateKeyByIterator(l,new n(s+1,p)),this.ss.insert(new n(f,s-1)),a("use():"+s),!0)}return a("use():failed"),!1},r.prototype.free=function(s){if(s<this.min||s>this.max){h("free():"+s+" is out of range");return}let o=new n(s,s),l=this.ss.upperBound(o);if(l.equals(this.ss.end())){if(l.equals(this.ss.begin())){this.ss.insert(o);return}l.pre();let f=l.pointer.high;l.pointer.high+1===s?this.ss.updateKeyByIterator(l,new n(f,s)):this.ss.insert(o)}else if(l.equals(this.ss.begin()))if(s+1===l.pointer.low){let f=l.pointer.high;this.ss.updateKeyByIterator(l,new n(s,f))}else this.ss.insert(o);else{let f=l.pointer.low,p=l.pointer.high;l.pre();let g=l.pointer.low;l.pointer.high+1===s?s+1===f?(this.ss.eraseElementByIterator(l),this.ss.updateKeyByIterator(l,new n(g,p))):this.ss.updateKeyByIterator(l,new n(g,s)):s+1===f?(this.ss.eraseElementByIterator(l.next()),this.ss.insert(new n(s,p))):this.ss.insert(o)}a("free():"+s)},r.prototype.clear=function(){a("clear()"),this.ss.clear(),this.ss.insert(new n(this.min,this.max))},r.prototype.intervalCount=function(){return this.ss.size()},r.prototype.dump=function(){console.log("length:"+this.ss.size());for(let s of this.ss)console.log(s)},i.exports=r}),ws=be((e,i)=>{ae(),he(),le();var t=Dh();i.exports.NumberAllocator=t}),Fh=be(e=>{ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0});var i=Ih(),t=ws(),a=class{constructor(h){h>0&&(this.aliasToTopic=new i.LRUCache({max:h}),this.topicToAlias={},this.numberAllocator=new t.NumberAllocator(1,h),this.max=h,this.length=0)}put(h,n){if(n===0||n>this.max)return!1;let r=this.aliasToTopic.get(n);return r&&delete this.topicToAlias[r],this.aliasToTopic.set(n,h),this.topicToAlias[h]=n,this.numberAllocator.use(n),this.length=this.aliasToTopic.size,!0}getTopicByAlias(h){return this.aliasToTopic.get(h)}getAliasByTopic(h){let n=this.topicToAlias[h];return typeof n<"u"&&this.aliasToTopic.get(n),n}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=a}),Wh=be(e=>{ae(),he(),le();var i=e&&e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(e,"__esModule",{value:!0});var t=kr(),a=i(Fh()),h=rr(),n=(r,s)=>{r.log("_handleConnack");let{options:o}=r,l=o.protocolVersion===5?s.reasonCode:s.returnCode;if(clearTimeout(r.connackTimer),delete r.topicAliasSend,s.properties){if(s.properties.topicAliasMaximum){if(s.properties.topicAliasMaximum>65535){r.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}s.properties.topicAliasMaximum>0&&(r.topicAliasSend=new a.default(s.properties.topicAliasMaximum))}s.properties.serverKeepAlive&&o.keepalive&&(o.keepalive=s.properties.serverKeepAlive),s.properties.maximumPacketSize&&(o.properties||(o.properties={}),o.properties.maximumPacketSize=s.properties.maximumPacketSize)}if(l===0)r.reconnecting=!1,r._onConnect(s);else if(l>0){let f=new h.ErrorWithReasonCode(`Connection refused: ${t.ReasonCodes[l]}`,l);r.emit("error",f)}};e.default=n}),$h=be(e=>{ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0});var i=(t,a,h)=>{t.log("handling pubrel packet");let n=typeof h<"u"?h:t.noop,{messageId:r}=a,s={cmd:"pubcomp",messageId:r};t.incomingStore.get(a,(o,l)=>{o?t._sendPacket(s,n):(t.emit("message",l.topic,l.payload,l),t.handleMessage(l,f=>{if(f)return n(f);t.incomingStore.del(l,t.noop),t._sendPacket(s,n)}))})};e.default=i}),Vh=be(e=>{ae(),he(),le();var i=e&&e.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(e,"__esModule",{value:!0});var t=i(Sh()),a=i(kh()),h=i(Wh()),n=i(kr()),r=i($h()),s=(o,l,f)=>{let{options:p}=o;if(p.protocolVersion===5&&p.properties&&p.properties.maximumPacketSize&&p.properties.maximumPacketSize<l.length)return o.emit("error",new Error(`exceeding packets size ${l.cmd}`)),o.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),o;switch(o.log("_handlePacket :: emitting packetreceive"),o.emit("packetreceive",l),l.cmd){case"publish":(0,t.default)(o,l,f);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":o.reschedulePing(),(0,n.default)(o,l),f();break;case"pubrel":o.reschedulePing(),(0,r.default)(o,l,f);break;case"connack":(0,h.default)(o,l),f();break;case"auth":o.reschedulePing(),(0,a.default)(o,l),f();break;case"pingresp":o.log("_handlePacket :: received pingresp"),o.reschedulePing(!0),f();break;case"disconnect":o.emit("disconnect",l),f();break;default:o.log("_handlePacket :: unknown command"),f();break}};e.default=s}),qh=be(e=>{ae(),he(),le();var i=e&&e.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(e,"__esModule",{value:!0}),e.TypedEventEmitter=void 0;var t=i((er(),Ne(Dt))),a=rr(),h=class{};e.TypedEventEmitter=h,(0,a.applyMixin)(h,t.default)}),Ir=be(e=>{ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0}),e.isReactNativeBrowser=e.isWebWorker=void 0;var i=()=>{var n;return typeof window<"u"?typeof navigator<"u"&&((n=navigator.userAgent)===null||n===void 0?void 0:n.toLowerCase().indexOf(" electron/"))>-1&&Re!=null&&Re.versions?!Object.prototype.hasOwnProperty.call(Re.versions,"electron"):typeof window.document<"u":!1},t=()=>{var n,r;return!!(typeof self=="object"&&!((r=(n=self==null?void 0:self.constructor)===null||n===void 0?void 0:n.name)===null||r===void 0)&&r.includes("WorkerGlobalScope"))},a=()=>typeof navigator<"u"&&navigator.product==="ReactNative",h=i()||t()||a();e.isWebWorker=t(),e.isReactNativeBrowser=a(),e.default=h}),zh=be((e,i)=>{ae(),he(),le(),function(t,a){typeof e=="object"&&typeof i<"u"?a(e):typeof define=="function"&&define.amd?define(["exports"],a):(t=typeof globalThis<"u"?globalThis:t||self,a(t.fastUniqueNumbers={}))}(e,function(t){var a=function(m){return function(b){var y=m(b);return b.add(y),y}},h=function(m){return function(b,y){return m.set(b,y),y}},n=Number.MAX_SAFE_INTEGER===void 0?9007199254740991:Number.MAX_SAFE_INTEGER,r=536870912,s=r*2,o=function(m,b){return function(y){var A=b.get(y),N=A===void 0?y.size:A<s?A+1:0;if(!y.has(N))return m(y,N);if(y.size<r){for(;y.has(N);)N=Math.floor(Math.random()*s);return m(y,N)}if(y.size>n)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;y.has(N);)N=Math.floor(Math.random()*n);return m(y,N)}},l=new WeakMap,f=h(l),p=o(f,l),g=a(p);t.addUniqueNumber=g,t.generateUniqueNumber=p})}),Hh=be((e,i)=>{ae(),he(),le(),function(t,a){typeof e=="object"&&typeof i<"u"?a(e,zh()):typeof define=="function"&&define.amd?define(["exports","fast-unique-numbers"],a):(t=typeof globalThis<"u"?globalThis:t||self,a(t.workerTimersBroker={},t.fastUniqueNumbers))}(e,function(t,a){var h=function(s){return s.method!==void 0&&s.method==="call"},n=function(s){return s.error===null&&typeof s.id=="number"},r=function(s){var o=new Map([[0,function(){}]]),l=new Map([[0,function(){}]]),f=new Map,p=new Worker(s);p.addEventListener("message",function(A){var N=A.data;if(h(N)){var k=N.params,v=k.timerId,U=k.timerType;if(U==="interval"){var D=o.get(v);if(typeof D=="number"){var C=f.get(D);if(C===void 0||C.timerId!==v||C.timerType!==U)throw new Error("The timer is in an undefined state.")}else if(typeof D<"u")D();else throw new Error("The timer is in an undefined state.")}else if(U==="timeout"){var T=l.get(v);if(typeof T=="number"){var M=f.get(T);if(M===void 0||M.timerId!==v||M.timerType!==U)throw new Error("The timer is in an undefined state.")}else if(typeof T<"u")T(),l.delete(v);else throw new Error("The timer is in an undefined state.")}}else if(n(N)){var V=N.id,J=f.get(V);if(J===void 0)throw new Error("The timer is in an undefined state.");var ne=J.timerId,S=J.timerType;f.delete(V),S==="interval"?o.delete(ne):l.delete(ne)}else{var H=N.error.message;throw new Error(H)}});var g=function(A){var N=a.generateUniqueNumber(f);f.set(N,{timerId:A,timerType:"interval"}),o.set(A,N),p.postMessage({id:N,method:"clear",params:{timerId:A,timerType:"interval"}})},m=function(A){var N=a.generateUniqueNumber(f);f.set(N,{timerId:A,timerType:"timeout"}),l.set(A,N),p.postMessage({id:N,method:"clear",params:{timerId:A,timerType:"timeout"}})},b=function(A){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,k=a.generateUniqueNumber(o);return o.set(k,function(){A(),typeof o.get(k)=="function"&&p.postMessage({id:null,method:"set",params:{delay:N,now:performance.now(),timerId:k,timerType:"interval"}})}),p.postMessage({id:null,method:"set",params:{delay:N,now:performance.now(),timerId:k,timerType:"interval"}}),k},y=function(A){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,k=a.generateUniqueNumber(l);return l.set(k,A),p.postMessage({id:null,method:"set",params:{delay:N,now:performance.now(),timerId:k,timerType:"timeout"}}),k};return{clearInterval:g,clearTimeout:m,setInterval:b,setTimeout:y}};t.load=r})}),Kh=be((e,i)=>{ae(),he(),le(),function(t,a){typeof e=="object"&&typeof i<"u"?a(e,Hh()):typeof define=="function"&&define.amd?define(["exports","worker-timers-broker"],a):(t=typeof globalThis<"u"?globalThis:t||self,a(t.workerTimers={},t.workerTimersBroker))}(e,function(t,a){var h=function(p,g){var m=null;return function(){if(m!==null)return m;var b=new Blob([g],{type:"application/javascript; charset=utf-8"}),y=URL.createObjectURL(b);return m=p(y),setTimeout(function(){return URL.revokeObjectURL(y)}),m}},n=`(()=>{var e={472:(e,t,r)=>{var o,i;void 0===(i="function"==typeof(o=function(){"use strict";var e=new Map,t=new Map,r=function(t){var r=e.get(t);if(void 0===r)throw new Error('There is no interval scheduled with the given id "'.concat(t,'".'));clearTimeout(r),e.delete(t)},o=function(e){var r=t.get(e);if(void 0===r)throw new Error('There is no timeout scheduled with the given id "'.concat(e,'".'));clearTimeout(r),t.delete(e)},i=function(e,t){var r,o=performance.now();return{expected:o+(r=e-Math.max(0,o-t)),remainingDelay:r}},n=function e(t,r,o,i){var n=performance.now();n>o?postMessage({id:null,method:"call",params:{timerId:r,timerType:i}}):t.set(r,setTimeout(e,o-n,t,r,o,i))},a=function(t,r,o){var a=i(t,o),s=a.expected,d=a.remainingDelay;e.set(r,setTimeout(n,d,e,r,s,"interval"))},s=function(e,r,o){var a=i(e,o),s=a.expected,d=a.remainingDelay;t.set(r,setTimeout(n,d,t,r,s,"timeout"))};addEventListener("message",(function(e){var t=e.data;try{if("clear"===t.method){var i=t.id,n=t.params,d=n.timerId,c=n.timerType;if("interval"===c)r(d),postMessage({error:null,id:i});else{if("timeout"!==c)throw new Error('The given type "'.concat(c,'" is not supported'));o(d),postMessage({error:null,id:i})}}else{if("set"!==t.method)throw new Error('The given method "'.concat(t.method,'" is not supported'));var u=t.params,l=u.delay,p=u.now,m=u.timerId,v=u.timerType;if("interval"===v)a(l,m,p);else{if("timeout"!==v)throw new Error('The given type "'.concat(v,'" is not supported'));s(l,m,p)}}}catch(e){postMessage({error:{message:e.message},id:t.id,result:null})}}))})?o.call(t,r,t,e):o)||(e.exports=i)}},t={};function r(o){var i=t[o];if(void 0!==i)return i.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,r),n.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 o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";r(472)})()})();`,r=h(a.load,n),s=function(p){return r().clearInterval(p)},o=function(p){return r().clearTimeout(p)},l=function(){var p;return(p=r()).setInterval.apply(p,arguments)},f=function(){var p;return(p=r()).setTimeout.apply(p,arguments)};t.clearInterval=s,t.clearTimeout=o,t.setInterval=l,t.setTimeout=f})}),Yh=be(e=>{ae(),he(),le();var i=e&&e.__createBinding||(Object.create?function(l,f,p,g){g===void 0&&(g=p);var m=Object.getOwnPropertyDescriptor(f,p);(!m||("get"in m?!f.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return f[p]}}),Object.defineProperty(l,g,m)}:function(l,f,p,g){g===void 0&&(g=p),l[g]=f[p]}),t=e&&e.__setModuleDefault||(Object.create?function(l,f){Object.defineProperty(l,"default",{enumerable:!0,value:f})}:function(l,f){l.default=f}),a=e&&e.__importStar||function(l){if(l&&l.__esModule)return l;var f={};if(l!=null)for(var p in l)p!=="default"&&Object.prototype.hasOwnProperty.call(l,p)&&i(f,l,p);return t(f,l),f};Object.defineProperty(e,"__esModule",{value:!0});var h=a(Ir()),n=Kh(),r={set:n.setInterval,clear:n.clearInterval},s={set:(l,f)=>setInterval(l,f),clear:l=>clearInterval(l)},o=l=>{switch(l){case"native":return s;case"worker":return r;case"auto":default:return h.default&&!h.isWebWorker&&!h.isReactNativeBrowser?r:s}};e.default=o}),_s=be(e=>{ae(),he(),le();var i=e&&e.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(e,"__esModule",{value:!0});var t=i(Yh()),a=class{get keepaliveTimeoutTimestamp(){return this._keepaliveTimeoutTimestamp}get intervalEvery(){return this._intervalEvery}get keepalive(){return this._keepalive}constructor(h,n){this.destroyed=!1,this.client=h,this.timer=typeof n=="object"&&"set"in n&&"clear"in n?n:(0,t.default)(n),this.setKeepalive(h.options.keepalive)}clear(){this.timerId&&(this.timer.clear(this.timerId),this.timerId=null)}setKeepalive(h){if(h*=1e3,isNaN(h)||h<=0||h>2147483647)throw new Error(`Keepalive value must be an integer between 0 and 2147483647. Provided value is ${h}`);this._keepalive=h,this.reschedule(),this.client.log(`KeepaliveManager: set keepalive to ${h}ms`)}destroy(){this.clear(),this.destroyed=!0}reschedule(){if(this.destroyed)return;this.clear(),this.counter=0;let h=Math.ceil(this._keepalive*1.5);this._keepaliveTimeoutTimestamp=Date.now()+h,this._intervalEvery=Math.ceil(this._keepalive/2),this.timerId=this.timer.set(()=>{this.destroyed||(this.counter+=1,this.counter===2?this.client.sendPing():this.counter>2&&this.client.onKeepaliveTimeout())},this._intervalEvery)}};e.default=a}),mi=be(e=>{ae(),he(),le();var i=e&&e.__createBinding||(Object.create?function(D,C,T,M){M===void 0&&(M=T);var V=Object.getOwnPropertyDescriptor(C,T);(!V||("get"in V?!C.__esModule:V.writable||V.configurable))&&(V={enumerable:!0,get:function(){return C[T]}}),Object.defineProperty(D,M,V)}:function(D,C,T,M){M===void 0&&(M=T),D[M]=C[T]}),t=e&&e.__setModuleDefault||(Object.create?function(D,C){Object.defineProperty(D,"default",{enumerable:!0,value:C})}:function(D,C){D.default=C}),a=e&&e.__importStar||function(D){if(D&&D.__esModule)return D;var C={};if(D!=null)for(var T in D)T!=="default"&&Object.prototype.hasOwnProperty.call(D,T)&&i(C,D,T);return t(C,D),C},h=e&&e.__importDefault||function(D){return D&&D.__esModule?D:{default:D}};Object.defineProperty(e,"__esModule",{value:!0});var n=h(Ul()),r=h(wh()),s=h(fs()),o=qt(),l=h(vh()),f=a(Eh()),p=h(St()),g=h(ds()),m=h(Vh()),b=rr(),y=qh(),A=h(_s()),N=a(Ir()),k=globalThis.setImmediate||((...D)=>{let C=D.shift();(0,b.nextTick)(()=>{C(...D)})}),v={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0,writeCache:!0,timerVariant:"auto"},U=class ji extends y.TypedEventEmitter{static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}constructor(C,T){super(),this.options=T||{};for(let M in v)typeof this.options[M]>"u"?this.options[M]=v[M]:this.options[M]=T[M];this.log=this.options.log||(0,p.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: version:",ji.VERSION),N.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",N.default?"browser":"node"),this.log("MqttClient :: options.protocol",T.protocol),this.log("MqttClient :: options.protocolVersion",T.protocolVersion),this.log("MqttClient :: options.username",T.username),this.log("MqttClient :: options.keepalive",T.keepalive),this.log("MqttClient :: options.reconnectPeriod",T.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",T.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",T.properties?T.properties.topicAliasMaximum:void 0),this.options.clientId=typeof T.clientId=="string"?T.clientId:ji.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=T.protocolVersion===5&&T.customHandleAcks?T.customHandleAcks:(...M)=>{M[3](null,0)},this.options.writeCache||(r.default.writeToStream.cacheNumbers=!1),this.streamBuilder=C,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new s.default:this.options.messageIdProvider,this.outgoingStore=T.outgoingStore||new g.default,this.incomingStore=T.incomingStore||new g.default,this.queueQoSZero=T.queueQoSZero===void 0?!0:T.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,T.properties&&T.properties.topicAliasMaximum>0&&(T.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new n.default(T.properties.topicAliasMaximum)),this.on("connect",()=>{let{queue:M}=this,V=()=>{let J=M.shift();this.log("deliver :: entry %o",J);let ne=null;if(!J){this._resubscribe();return}ne=J.packet,this.log("deliver :: call _sendPacket for %o",ne);let S=!0;ne.messageId&&ne.messageId!==0&&(this.messageIdProvider.register(ne.messageId)||(S=!1)),S?this._sendPacket(ne,H=>{J.cb&&J.cb(H),V()}):(this.log("messageId: %d has already used. The message is skipped and removed.",ne.messageId),V())};this.log("connect :: sending queued packets"),V()}),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(C,T){T()}handleMessage(C,T){T()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}connect(){var C;let T=new o.Writable,M=r.default.parser(this.options),V=null,J=[];this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this.disconnected&&!this.reconnecting&&(this.incomingStore=this.options.incomingStore||new g.default,this.outgoingStore=this.options.outgoingStore||new g.default,this.disconnecting=!1,this.disconnected=!1),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),M.on("packet",Q=>{this.log("parser :: on packet push to packets array."),J.push(Q)});let ne=()=>{this.log("work :: getting next packet in queue");let Q=J.shift();if(Q)this.log("work :: packet pulled from queue"),(0,m.default)(this,Q,S);else{this.log("work :: no packets in queue");let me=V;V=null,this.log("work :: done flag is %s",!!me),me&&me()}},S=()=>{if(J.length)(0,b.nextTick)(ne);else{let Q=V;V=null,Q()}};T._write=(Q,me,se)=>{V=se,this.log("writable stream :: parsing buffer"),M.parse(Q),ne()};let H=Q=>{this.log("streamErrorHandler :: error",Q.message),Q.code?(this.log("streamErrorHandler :: emitting error"),this.emit("error",Q)):this.noop(Q)};this.log("connect :: pipe stream to writable stream"),this.stream.pipe(T),this.stream.on("error",H),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 re={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&&(re.will=Object.assign(Object.assign({},this.options.will),{payload:(C=this.options.will)===null||C===void 0?void 0:C.payload})),this.topicAliasRecv&&(re.properties||(re.properties={}),this.topicAliasRecv&&(re.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket(re),M.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return this.end(()=>this.emit("error",new Error("Packet has no Authentication Method"))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&typeof this.options.authPacket=="object"){let Q=Object.assign({cmd:"auth",reasonCode:0},this.options.authPacket);this._writePacket(Q)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(()=>{this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this.emit("error",new Error("connack timeout")),this._cleanUp(!0)},this.options.connectTimeout),this}publish(C,T,M,V){this.log("publish :: message `%s` to topic `%s`",T,C);let{options:J}=this;typeof M=="function"&&(V=M,M=null),M=M||{},M=Object.assign(Object.assign({},{qos:0,retain:!1,dup:!1}),M);let{qos:ne,retain:S,dup:H,properties:re,cbStorePut:Q}=M;if(this._checkDisconnecting(V))return this;let me=()=>{let se=0;if((ne===1||ne===2)&&(se=this._nextId(),se===null))return this.log("No messageId left"),!1;let z={cmd:"publish",topic:C,payload:T,qos:ne,retain:S,messageId:se,dup:H};switch(J.protocolVersion===5&&(z.properties=re),this.log("publish :: qos",ne),ne){case 1:case 2:this.outgoing[z.messageId]={volatile:!1,cb:V||this.noop},this.log("MqttClient:publish: packet cmd: %s",z.cmd),this._sendPacket(z,void 0,Q);break;default:this.log("MqttClient:publish: packet cmd: %s",z.cmd),this._sendPacket(z,V,Q);break}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!me())&&this._storeProcessingQueue.push({invoke:me,cbStorePut:M.cbStorePut,callback:V}),this}publishAsync(C,T,M){return new Promise((V,J)=>{this.publish(C,T,M,(ne,S)=>{ne?J(ne):V(S)})})}subscribe(C,T,M){let V=this.options.protocolVersion;typeof T=="function"&&(M=T),M=M||this.noop;let J=!1,ne=[];typeof C=="string"?(C=[C],ne=C):Array.isArray(C)?ne=C:typeof C=="object"&&(J=C.resubscribe,delete C.resubscribe,ne=Object.keys(C));let S=f.validateTopics(ne);if(S!==null)return k(M,new Error(`Invalid topic ${S}`)),this;if(this._checkDisconnecting(M))return this.log("subscribe: discconecting true"),this;let H={qos:0};V===5&&(H.nl=!1,H.rap=!1,H.rh=0),T=Object.assign(Object.assign({},H),T);let re=T.properties,Q=[],me=(z,ye)=>{if(ye=ye||T,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,z)||this._resubscribeTopics[z].qos<ye.qos||J){let oe={topic:z,qos:ye.qos};V===5&&(oe.nl=ye.nl,oe.rap=ye.rap,oe.rh=ye.rh,oe.properties=re),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",oe.topic,oe.qos),Q.push(oe)}};if(Array.isArray(C)?C.forEach(z=>{this.log("subscribe: array topic %s",z),me(z)}):Object.keys(C).forEach(z=>{this.log("subscribe: object topic %s, %o",z,C[z]),me(z,C[z])}),!Q.length)return M(null,[]),this;let se=()=>{let z=this._nextId();if(z===null)return this.log("No messageId left"),!1;let ye={cmd:"subscribe",subscriptions:Q,messageId:z};if(re&&(ye.properties=re),this.options.resubscribe){this.log("subscribe :: resubscribe true");let oe=[];Q.forEach(_e=>{if(this.options.reconnectPeriod>0){let _={qos:_e.qos};V===5&&(_.nl=_e.nl||!1,_.rap=_e.rap||!1,_.rh=_e.rh||0,_.properties=_e.properties),this._resubscribeTopics[_e.topic]=_,oe.push(_e.topic)}}),this.messageIdToTopic[ye.messageId]=oe}return this.outgoing[ye.messageId]={volatile:!0,cb(oe,_e){if(!oe){let{granted:_}=_e;for(let G=0;G<_.length;G+=1)Q[G].qos=_[G]}M(oe,Q,_e)}},this.log("subscribe :: call _sendPacket"),this._sendPacket(ye),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!se())&&this._storeProcessingQueue.push({invoke:se,callback:M}),this}subscribeAsync(C,T){return new Promise((M,V)=>{this.subscribe(C,T,(J,ne)=>{J?V(J):M(ne)})})}unsubscribe(C,T,M){typeof C=="string"&&(C=[C]),typeof T=="function"&&(M=T),M=M||this.noop;let V=f.validateTopics(C);if(V!==null)return k(M,new Error(`Invalid topic ${V}`)),this;if(this._checkDisconnecting(M))return this;let J=()=>{let ne=this._nextId();if(ne===null)return this.log("No messageId left"),!1;let S={cmd:"unsubscribe",messageId:ne,unsubscriptions:[]};return typeof C=="string"?S.unsubscriptions=[C]:Array.isArray(C)&&(S.unsubscriptions=C),this.options.resubscribe&&S.unsubscriptions.forEach(H=>{delete this._resubscribeTopics[H]}),typeof T=="object"&&T.properties&&(S.properties=T.properties),this.outgoing[S.messageId]={volatile:!0,cb:M},this.log("unsubscribe: call _sendPacket"),this._sendPacket(S),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!J())&&this._storeProcessingQueue.push({invoke:J,callback:M}),this}unsubscribeAsync(C,T){return new Promise((M,V)=>{this.unsubscribe(C,T,(J,ne)=>{J?V(J):M(ne)})})}end(C,T,M){this.log("end :: (%s)",this.options.clientId),(C==null||typeof C!="boolean")&&(M=M||T,T=C,C=!1),typeof T!="object"&&(M=M||T,T=null),this.log("end :: cb? %s",!!M),(!M||typeof M!="function")&&(M=this.noop);let V=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this.incomingStore.close(ne=>{this.outgoingStore.close(S=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),M){let H=ne||S;this.log("end :: closeStores: invoking callback with args"),M(H)}})}),this._deferredReconnect?this._deferredReconnect():(this.options.reconnectPeriod===0||this.options.manualConnect)&&(this.disconnecting=!1)},J=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,C),this._cleanUp(C,()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),(0,b.nextTick)(V)},T)};return this.disconnecting?(M(),this):(this._clearReconnect(),this.disconnecting=!0,!C&&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,J,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),J()),this)}endAsync(C,T){return new Promise((M,V)=>{this.end(C,T,J=>{J?V(J):M()})})}removeOutgoingMessage(C){if(this.outgoing[C]){let{cb:T}=this.outgoing[C];this._removeOutgoingAndStoreMessage(C,()=>{T(new Error("Message removed"))})}return this}reconnect(C){this.log("client reconnect");let T=()=>{C?(this.options.incomingStore=C.incomingStore,this.options.outgoingStore=C.outgoingStore):(this.options.incomingStore=null,this.options.outgoingStore=null),this.incomingStore=this.options.incomingStore||new g.default,this.outgoingStore=this.options.outgoingStore||new g.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(C=>{this.outgoing[C].volatile&&typeof this.outgoing[C].cb=="function"&&(this.outgoing[C].cb(new Error("Connection closed")),delete this.outgoing[C])}))}_flush(){this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach(C=>{typeof this.outgoing[C].cb=="function"&&(this.outgoing[C].cb(new Error("Connection closed")),delete this.outgoing[C])}))}_removeTopicAliasAndRecoverTopicName(C){let T;C.properties&&(T=C.properties.topicAlias);let M=C.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",T,M),M.length===0){if(typeof T>"u")return new Error("Unregistered Topic Alias");if(M=this.topicAliasSend.getTopicByAlias(T),typeof M>"u")return new Error("Unregistered Topic Alias");C.topic=M}T&&delete C.properties.topicAlias}_checkDisconnecting(C){return this.disconnecting&&(C&&C!==this.noop?C(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting}_reconnect(){this.log("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this.connect()}),this.log("client already connected. disconnecting first.")):(this.log("_reconnect: calling connect"),this.connect())}_setupReconnect(){!this.disconnecting&&!this.reconnectTimer&&this.options.reconnectPeriod>0?(this.reconnecting||(this.log("_setupReconnect :: emit `offline` state"),this.emit("offline"),this.log("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),this.log("_setupReconnect :: setting reconnectTimer for %d ms",this.options.reconnectPeriod),this.reconnectTimer=setInterval(()=>{this.log("reconnectTimer :: reconnect triggered!"),this._reconnect()},this.options.reconnectPeriod)):this.log("_setupReconnect :: doing nothing...")}_clearReconnect(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)}_cleanUp(C,T,M={}){if(T&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",T)),this.log("_cleanUp :: forced? %s",C),C)this.options.reconnectPeriod===0&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{let V=Object.assign({cmd:"disconnect"},M);this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(V,()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),k(()=>{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(C,T,M){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",C.cmd);let V=C,J;if(V.cmd==="publish"&&(V=(0,l.default)(C),J=this._removeTopicAliasAndRecoverTopicName(V),J))return T&&T(J);this.outgoingStore.put(V,ne=>{if(ne)return T&&T(ne);M(),this._writePacket(C,T)})}_applyTopicAlias(C){if(this.options.protocolVersion===5&&C.cmd==="publish"){let T;C.properties&&(T=C.properties.topicAlias);let M=C.topic.toString();if(this.topicAliasSend)if(T){if(M.length!==0&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",M,T),!this.topicAliasSend.put(M,T)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",M,T),new Error("Sending Topic Alias out of range")}else M.length!==0&&(this.options.autoAssignTopicAlias?(T=this.topicAliasSend.getAliasByTopic(M),T?(C.topic="",C.properties=Object.assign(Object.assign({},C.properties),{topicAlias:T}),this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",M,T)):(T=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(M,T),C.properties=Object.assign(Object.assign({},C.properties),{topicAlias:T}),this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",M,T))):this.options.autoUseTopicAlias&&(T=this.topicAliasSend.getAliasByTopic(M),T&&(C.topic="",C.properties=Object.assign(Object.assign({},C.properties),{topicAlias:T}),this.log("applyTopicAlias :: auto use topic: %s - alias: %d",M,T))));else if(T)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",M,T),new Error("Sending Topic Alias out of range")}}_noop(C){this.log("noop ::",C)}_writePacket(C,T){this.log("_writePacket :: packet: %O",C),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",C),this.log("_writePacket :: writing to stream");let M=r.default.writeToStream(C,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",M),!M&&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(C,T,M,V){this.log("_sendPacket :: (%s) :: start",this.options.clientId),M=M||this.noop,T=T||this.noop;let J=this._applyTopicAlias(C);if(J){T(J);return}if(!this.connected){if(C.cmd==="auth"){this._writePacket(C,T);return}this.log("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(C,T,M);return}if(V){this._writePacket(C,T);return}switch(C.cmd){case"publish":break;case"pubrel":this._storeAndSend(C,T,M);return;default:this._writePacket(C,T);return}switch(C.qos){case 2:case 1:this._storeAndSend(C,T,M);break;case 0:default:this._writePacket(C,T);break}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}_storePacket(C,T,M){this.log("_storePacket :: packet: %o",C),this.log("_storePacket :: cb? %s",!!T),M=M||this.noop;let V=C;if(V.cmd==="publish"){V=(0,l.default)(C);let ne=this._removeTopicAliasAndRecoverTopicName(V);if(ne)return T&&T(ne)}let J=V.qos||0;J===0&&this.queueQoSZero||V.cmd!=="publish"?this.queue.push({packet:V,cb:T}):J>0?(T=this.outgoing[V.messageId]?this.outgoing[V.messageId].cb:null,this.outgoingStore.put(V,ne=>{if(ne)return T&&T(ne);M()})):T&&T(new Error("No connection to broker"))}_setupKeepaliveManager(){this.log("_setupKeepaliveManager :: keepalive %d (seconds)",this.options.keepalive),!this.keepaliveManager&&this.options.keepalive&&(this.keepaliveManager=new A.default(this,this.options.timerVariant))}_destroyKeepaliveManager(){this.keepaliveManager&&(this.log("_destroyKeepaliveManager :: destroying keepalive manager"),this.keepaliveManager.destroy(),this.keepaliveManager=null)}reschedulePing(C=!1){this.keepaliveManager&&this.options.keepalive&&(C||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",new Error("Keepalive timeout")),this.log("onKeepaliveTimeout :: calling _cleanUp with force true"),this._cleanUp(!0)}_resubscribe(){this.log("_resubscribe");let C=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion>=4&&!this.connackPacket.sessionPresent)&&C.length>0)if(this.options.resubscribe)if(this.options.protocolVersion===5){this.log("_resubscribe: protocolVersion 5");for(let T=0;T<C.length;T++){let M={};M[C[T]]=this._resubscribeTopics[C[T]],M.resubscribe=!0,this.subscribe(M,{properties:M[C[T]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1}_onConnect(C){if(this.disconnected){this.emit("connect",C);return}this.connackPacket=C,this.messageIdProvider.clear(),this._setupKeepaliveManager(),this.connected=!0;let T=()=>{let M=this.outgoingStore.createStream(),V=()=>{M.destroy(),M=null,this._flushStoreProcessingQueue(),J()},J=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",V),M.on("error",S=>{J(),this._flushStoreProcessingQueue(),this.removeListener("close",V),this.emit("error",S)});let ne=()=>{if(!M)return;let S=M.read(1),H;if(!S){M.once("readable",ne);return}if(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[S.messageId]){ne();return}!this.disconnecting&&!this.reconnectTimer?(H=this.outgoing[S.messageId]?this.outgoing[S.messageId].cb:null,this.outgoing[S.messageId]={volatile:!1,cb(re,Q){H&&H(re,Q),ne()}},this._packetIdsDuringStoreProcessing[S.messageId]=!0,this.messageIdProvider.register(S.messageId)?this._sendPacket(S,void 0,void 0,!0):this.log("messageId: %d has already used.",S.messageId)):M.destroy&&M.destroy()};M.on("end",()=>{let S=!0;for(let H in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[H]){S=!1;break}this.removeListener("close",V),S?(J(),this._invokeAllStoreProcessingQueue(),this.emit("connect",C)):T()}),ne()};T()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){let C=this._storeProcessingQueue[0];if(C&&C.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(let C of this._storeProcessingQueue)C.cbStorePut&&C.cbStorePut(new Error("Connection closed")),C.callback&&C.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)}_removeOutgoingAndStoreMessage(C,T){delete this.outgoing[C],this.outgoingStore.del({messageId:C},(M,V)=>{T(M,V),this.messageIdProvider.deallocate(C),this._invokeStoreProcessingQueue()})}};U.VERSION=b.MQTTJS_VERSION,e.default=U}),Qh=be(e=>{ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0});var i=ws(),t=class{constructor(){this.numberAllocator=new i.NumberAllocator(1,65535)}allocate(){return this.lastId=this.numberAllocator.alloc(),this.lastId}getLastAllocated(){return this.lastId}register(a){return this.numberAllocator.use(a)}deallocate(a){this.numberAllocator.free(a)}clear(){this.numberAllocator.clear()}};e.default=t});function zt(e){throw new RangeError(Is[e])}function vs(e,i){let t=e.split("@"),a="";t.length>1&&(a=t[0]+"@",e=t[1]);let h=function(n,r){let s=[],o=n.length;for(;o--;)s[o]=r(n[o]);return s}((e=e.replace(ks,".")).split("."),i).join(".");return a+h}function Es(e){let i=[],t=0,a=e.length;for(;t<a;){let h=e.charCodeAt(t++);if(h>=55296&&h<=56319&&t<a){let n=e.charCodeAt(t++);(64512&n)==56320?i.push(((1023&h)<<10)+(1023&n)+65536):(i.push(h),t--)}else i.push(h)}return i}var Ss,As,ks,Is,lt,Tr,bi,yi,wi,_i,Ot,Gh=Qe(()=>{ae(),he(),le(),Ss=/^xn--/,As=/[^\0-\x7E]/,ks=/[\x2E\u3002\uFF0E\uFF61]/g,Is={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},lt=Math.floor,Tr=String.fromCharCode,bi=function(e,i){return e+22+75*(e<26)-((i!=0)<<5)},yi=function(e,i,t){let a=0;for(e=t?lt(e/700):e>>1,e+=lt(e/i);e>455;a+=36)e=lt(e/35);return lt(a+36*e/(e+38))},wi=function(e){let i=[],t=e.length,a=0,h=128,n=72,r=e.lastIndexOf("-");r<0&&(r=0);for(let o=0;o<r;++o)e.charCodeAt(o)>=128&&zt("not-basic"),i.push(e.charCodeAt(o));for(let o=r>0?r+1:0;o<t;){let l=a;for(let p=1,g=36;;g+=36){o>=t&&zt("invalid-input");let m=(s=e.charCodeAt(o++))-48<10?s-22:s-65<26?s-65:s-97<26?s-97:36;(m>=36||m>lt((2147483647-a)/p))&&zt("overflow"),a+=m*p;let b=g<=n?1:g>=n+26?26:g-n;if(m<b)break;let y=36-b;p>lt(2147483647/y)&&zt("overflow"),p*=y}let f=i.length+1;n=yi(a-l,f,l==0),lt(a/f)>2147483647-h&&zt("overflow"),h+=lt(a/f),a%=f,i.splice(a++,0,h)}var s;return String.fromCodePoint(...i)},_i=function(e){let i=[],t=(e=Es(e)).length,a=128,h=0,n=72;for(let o of e)o<128&&i.push(Tr(o));let r=i.length,s=r;for(r&&i.push("-");s<t;){let o=2147483647;for(let f of e)f>=a&&f<o&&(o=f);let l=s+1;o-a>lt((2147483647-h)/l)&&zt("overflow"),h+=(o-a)*l,a=o;for(let f of e)if(f<a&&++h>2147483647&&zt("overflow"),f==a){let p=h;for(let g=36;;g+=36){let m=g<=n?1:g>=n+26?26:g-n;if(p<m)break;let b=p-m,y=36-m;i.push(Tr(bi(m+b%y,0))),p=lt(b/y)}i.push(Tr(bi(p,0))),n=yi(h,l,s==r),h=0,++s}++h,++a}return i.join("")},Ot={version:"2.1.0",ucs2:{decode:Es,encode:e=>String.fromCodePoint(...e)},decode:wi,encode:_i,toASCII:function(e){return vs(e,function(i){return As.test(i)?"xn--"+_i(i):i})},toUnicode:function(e){return vs(e,function(i){return Ss.test(i)?wi(i.slice(4).toLowerCase()):i})}},Ot.decode,Ot.encode,Ot.toASCII,Ot.toUnicode,Ot.ucs2,Ot.version});function Jh(e,i){return Object.prototype.hasOwnProperty.call(e,i)}var Ts,nr,Cs,dt,Zh=Qe(()=>{ae(),he(),le(),Ts=function(e,i,t,a){i=i||"&",t=t||"=";var h={};if(typeof e!="string"||e.length===0)return h;var n=/\+/g;e=e.split(i);var r=1e3;a&&typeof a.maxKeys=="number"&&(r=a.maxKeys);var s=e.length;r>0&&s>r&&(s=r);for(var o=0;o<s;++o){var l,f,p,g,m=e[o].replace(n,"%20"),b=m.indexOf(t);b>=0?(l=m.substr(0,b),f=m.substr(b+1)):(l=m,f=""),p=decodeURIComponent(l),g=decodeURIComponent(f),Jh(h,p)?Array.isArray(h[p])?h[p].push(g):h[p]=[h[p],g]:h[p]=g}return h},nr=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},Cs=function(e,i,t,a){return i=i||"&",t=t||"=",e===null&&(e=void 0),typeof e=="object"?Object.keys(e).map(function(h){var n=encodeURIComponent(nr(h))+t;return Array.isArray(e[h])?e[h].map(function(r){return n+encodeURIComponent(nr(r))}).join(i):n+encodeURIComponent(nr(e[h]))}).join(i):a?encodeURIComponent(nr(a))+t+encodeURIComponent(nr(e)):""},dt={},dt.decode=dt.parse=Ts,dt.encode=dt.stringify=Cs,dt.decode,dt.encode,dt.parse,dt.stringify});function vi(){throw new Error("setTimeout has not been defined")}function Ei(){throw new Error("clearTimeout has not been defined")}function Bs(e){if(Tt===setTimeout)return setTimeout(e,0);if((Tt===vi||!Tt)&&setTimeout)return Tt=setTimeout,setTimeout(e,0);try{return Tt(e,0)}catch{try{return Tt.call(null,e,0)}catch{return Tt.call(this||Ht,e,0)}}}function Xh(){Yt&&Kt&&(Yt=!1,Kt.length?pt=Kt.concat(pt):cr=-1,pt.length&&Ps())}function Ps(){if(!Yt){var e=Bs(Xh);Yt=!0;for(var i=pt.length;i;){for(Kt=pt,pt=[];++cr<i;)Kt&&Kt[cr].run();cr=-1,i=pt.length}Kt=null,Yt=!1,function(t){if(Ct===clearTimeout)return clearTimeout(t);if((Ct===Ei||!Ct)&&clearTimeout)return Ct=clearTimeout,clearTimeout(t);try{Ct(t)}catch{try{return Ct.call(null,t)}catch{return Ct.call(this||Ht,t)}}}(e)}}function Os(e,i){(this||Ht).fun=e,(this||Ht).array=i}function It(){}var Rs,Tt,Ct,Ht,Ve,Kt,pt,Yt,cr,Fe,ec=Qe(()=>{ae(),he(),le(),Ht=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,Ve=Rs={},function(){try{Tt=typeof setTimeout=="function"?setTimeout:vi}catch{Tt=vi}try{Ct=typeof clearTimeout=="function"?clearTimeout:Ei}catch{Ct=Ei}}(),pt=[],Yt=!1,cr=-1,Ve.nextTick=function(e){var i=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)i[t-1]=arguments[t];pt.push(new Os(e,i)),pt.length!==1||Yt||Bs(Ps)},Os.prototype.run=function(){(this||Ht).fun.apply(null,(this||Ht).array)},Ve.title="browser",Ve.browser=!0,Ve.env={},Ve.argv=[],Ve.version="",Ve.versions={},Ve.on=It,Ve.addListener=It,Ve.once=It,Ve.off=It,Ve.removeListener=It,Ve.removeAllListeners=It,Ve.emit=It,Ve.prependListener=It,Ve.prependOnceListener=It,Ve.listeners=function(e){return[]},Ve.binding=function(e){throw new Error("process.binding is not supported")},Ve.cwd=function(){return"/"},Ve.chdir=function(e){throw new Error("process.chdir is not supported")},Ve.umask=function(){return 0},Fe=Rs,Fe.addListener,Fe.argv,Fe.binding,Fe.browser,Fe.chdir,Fe.cwd,Fe.emit,Fe.env,Fe.listeners,Fe.nextTick,Fe.off,Fe.on,Fe.once,Fe.prependListener,Fe.prependOnceListener,Fe.removeAllListeners,Fe.removeListener,Fe.title,Fe.umask,Fe.version,Fe.versions});function tc(){if(Si)return Cr;Si=!0;var e=Cr={},i,t;function a(){throw new Error("setTimeout has not been defined")}function h(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?i=setTimeout:i=a}catch{i=a}try{typeof clearTimeout=="function"?t=clearTimeout:t=h}catch{t=h}})();function n(y){if(i===setTimeout)return setTimeout(y,0);if((i===a||!i)&&setTimeout)return i=setTimeout,setTimeout(y,0);try{return i(y,0)}catch{try{return i.call(null,y,0)}catch{return i.call(this||Qt,y,0)}}}function r(y){if(t===clearTimeout)return clearTimeout(y);if((t===h||!t)&&clearTimeout)return t=clearTimeout,clearTimeout(y);try{return t(y)}catch{try{return t.call(null,y)}catch{return t.call(this||Qt,y)}}}var s=[],o=!1,l,f=-1;function p(){!o||!l||(o=!1,l.length?s=l.concat(s):f=-1,s.length&&g())}function g(){if(!o){var y=n(p);o=!0;for(var A=s.length;A;){for(l=s,s=[];++f<A;)l&&l[f].run();f=-1,A=s.length}l=null,o=!1,r(y)}}e.nextTick=function(y){var A=new Array(arguments.length-1);if(arguments.length>1)for(var N=1;N<arguments.length;N++)A[N-1]=arguments[N];s.push(new m(y,A)),s.length===1&&!o&&n(g)};function m(y,A){(this||Qt).fun=y,(this||Qt).array=A}m.prototype.run=function(){(this||Qt).fun.apply(null,(this||Qt).array)},e.title="browser",e.browser=!0,e.env={},e.argv=[],e.version="",e.versions={};function b(){}return e.on=b,e.addListener=b,e.once=b,e.off=b,e.removeListener=b,e.removeAllListeners=b,e.emit=b,e.prependListener=b,e.prependOnceListener=b,e.listeners=function(y){return[]},e.binding=function(y){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(y){throw new Error("process.chdir is not supported")},e.umask=function(){return 0},Cr}var Cr,Si,Qt,Ue,xs=Qe(()=>{ae(),he(),le(),Cr={},Si=!1,Qt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,Ue=tc(),Ue.platform="browser",Ue.addListener,Ue.argv,Ue.binding,Ue.browser,Ue.chdir,Ue.cwd,Ue.emit,Ue.env,Ue.listeners,Ue.nextTick,Ue.off,Ue.on,Ue.once,Ue.prependListener,Ue.prependOnceListener,Ue.removeAllListeners,Ue.removeListener,Ue.title,Ue.umask,Ue.version,Ue.versions});function rc(){if(Ai)return Br;Ai=!0;var e=Ue;function i(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}function t(n,r){for(var s="",o=0,l=-1,f=0,p,g=0;g<=n.length;++g){if(g<n.length)p=n.charCodeAt(g);else{if(p===47)break;p=47}if(p===47){if(!(l===g-1||f===1))if(l!==g-1&&f===2){if(s.length<2||o!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){var m=s.lastIndexOf("/");if(m!==s.length-1){m===-1?(s="",o=0):(s=s.slice(0,m),o=s.length-1-s.lastIndexOf("/")),l=g,f=0;continue}}else if(s.length===2||s.length===1){s="",o=0,l=g,f=0;continue}}r&&(s.length>0?s+="/..":s="..",o=2)}else s.length>0?s+="/"+n.slice(l+1,g):s=n.slice(l+1,g),o=g-l-1;l=g,f=0}else p===46&&f!==-1?++f:f=-1}return s}function a(n,r){var s=r.dir||r.root,o=r.base||(r.name||"")+(r.ext||"");return s?s===r.root?s+o:s+n+o:o}var h={resolve:function(){for(var n="",r=!1,s,o=arguments.length-1;o>=-1&&!r;o--){var l;o>=0?l=arguments[o]:(s===void 0&&(s=e.cwd()),l=s),i(l),l.length!==0&&(n=l+"/"+n,r=l.charCodeAt(0)===47)}return n=t(n,!r),r?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(n){if(i(n),n.length===0)return".";var r=n.charCodeAt(0)===47,s=n.charCodeAt(n.length-1)===47;return n=t(n,!r),n.length===0&&!r&&(n="."),n.length>0&&s&&(n+="/"),r?"/"+n:n},isAbsolute:function(n){return i(n),n.length>0&&n.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var n,r=0;r<arguments.length;++r){var s=arguments[r];i(s),s.length>0&&(n===void 0?n=s:n+="/"+s)}return n===void 0?".":h.normalize(n)},relative:function(n,r){if(i(n),i(r),n===r||(n=h.resolve(n),r=h.resolve(r),n===r))return"";for(var s=1;s<n.length&&n.charCodeAt(s)===47;++s);for(var o=n.length,l=o-s,f=1;f<r.length&&r.charCodeAt(f)===47;++f);for(var p=r.length,g=p-f,m=l<g?l:g,b=-1,y=0;y<=m;++y){if(y===m){if(g>m){if(r.charCodeAt(f+y)===47)return r.slice(f+y+1);if(y===0)return r.slice(f+y)}else l>m&&(n.charCodeAt(s+y)===47?b=y:y===0&&(b=0));break}var A=n.charCodeAt(s+y),N=r.charCodeAt(f+y);if(A!==N)break;A===47&&(b=y)}var k="";for(y=s+b+1;y<=o;++y)(y===o||n.charCodeAt(y)===47)&&(k.length===0?k+="..":k+="/..");return k.length>0?k+r.slice(f+b):(f+=b,r.charCodeAt(f)===47&&++f,r.slice(f))},_makeLong:function(n){return n},dirname:function(n){if(i(n),n.length===0)return".";for(var r=n.charCodeAt(0),s=r===47,o=-1,l=!0,f=n.length-1;f>=1;--f)if(r=n.charCodeAt(f),r===47){if(!l){o=f;break}}else l=!1;return o===-1?s?"/":".":s&&o===1?"//":n.slice(0,o)},basename:function(n,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');i(n);var s=0,o=-1,l=!0,f;if(r!==void 0&&r.length>0&&r.length<=n.length){if(r.length===n.length&&r===n)return"";var p=r.length-1,g=-1;for(f=n.length-1;f>=0;--f){var m=n.charCodeAt(f);if(m===47){if(!l){s=f+1;break}}else g===-1&&(l=!1,g=f+1),p>=0&&(m===r.charCodeAt(p)?--p===-1&&(o=f):(p=-1,o=g))}return s===o?o=g:o===-1&&(o=n.length),n.slice(s,o)}else{for(f=n.length-1;f>=0;--f)if(n.charCodeAt(f)===47){if(!l){s=f+1;break}}else o===-1&&(l=!1,o=f+1);return o===-1?"":n.slice(s,o)}},extname:function(n){i(n);for(var r=-1,s=0,o=-1,l=!0,f=0,p=n.length-1;p>=0;--p){var g=n.charCodeAt(p);if(g===47){if(!l){s=p+1;break}continue}o===-1&&(l=!1,o=p+1),g===46?r===-1?r=p:f!==1&&(f=1):r!==-1&&(f=-1)}return r===-1||o===-1||f===0||f===1&&r===o-1&&r===s+1?"":n.slice(r,o)},format:function(n){if(n===null||typeof n!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof n);return a("/",n)},parse:function(n){i(n);var r={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return r;var s=n.charCodeAt(0),o=s===47,l;o?(r.root="/",l=1):l=0;for(var f=-1,p=0,g=-1,m=!0,b=n.length-1,y=0;b>=l;--b){if(s=n.charCodeAt(b),s===47){if(!m){p=b+1;break}continue}g===-1&&(m=!1,g=b+1),s===46?f===-1?f=b:y!==1&&(y=1):f!==-1&&(y=-1)}return f===-1||g===-1||y===0||y===1&&f===g-1&&f===p+1?g!==-1&&(p===0&&o?r.base=r.name=n.slice(1,g):r.base=r.name=n.slice(p,g)):(p===0&&o?(r.name=n.slice(1,f),r.base=n.slice(1,g)):(r.name=n.slice(p,f),r.base=n.slice(p,g)),r.ext=n.slice(f,g)),p>0?r.dir=n.slice(0,p-1):o&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return h.posix=h,Br=h,Br}var Br,Ai,ki,nc=Qe(()=>{ae(),he(),le(),xs(),Br={},Ai=!1,ki=rc()}),Ms={};Mt(Ms,{URL:()=>aa,Url:()=>ra,default:()=>Me,fileURLToPath:()=>Ns,format:()=>na,parse:()=>sa,pathToFileURL:()=>Ls,resolve:()=>ia,resolveObject:()=>oa});function ot(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function ur(e,i,t){if(e&&ht.isObject(e)&&e instanceof ot)return e;var a=new ot;return a.parse(e,i,t),a}function ic(){if(Bi)return xr;Bi=!0;var e=Fe;function i(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}function t(n,r){for(var s="",o=0,l=-1,f=0,p,g=0;g<=n.length;++g){if(g<n.length)p=n.charCodeAt(g);else{if(p===47)break;p=47}if(p===47){if(!(l===g-1||f===1))if(l!==g-1&&f===2){if(s.length<2||o!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){var m=s.lastIndexOf("/");if(m!==s.length-1){m===-1?(s="",o=0):(s=s.slice(0,m),o=s.length-1-s.lastIndexOf("/")),l=g,f=0;continue}}else if(s.length===2||s.length===1){s="",o=0,l=g,f=0;continue}}r&&(s.length>0?s+="/..":s="..",o=2)}else s.length>0?s+="/"+n.slice(l+1,g):s=n.slice(l+1,g),o=g-l-1;l=g,f=0}else p===46&&f!==-1?++f:f=-1}return s}function a(n,r){var s=r.dir||r.root,o=r.base||(r.name||"")+(r.ext||"");return s?s===r.root?s+o:s+n+o:o}var h={resolve:function(){for(var n="",r=!1,s,o=arguments.length-1;o>=-1&&!r;o--){var l;o>=0?l=arguments[o]:(s===void 0&&(s=e.cwd()),l=s),i(l),l.length!==0&&(n=l+"/"+n,r=l.charCodeAt(0)===47)}return n=t(n,!r),r?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(n){if(i(n),n.length===0)return".";var r=n.charCodeAt(0)===47,s=n.charCodeAt(n.length-1)===47;return n=t(n,!r),n.length===0&&!r&&(n="."),n.length>0&&s&&(n+="/"),r?"/"+n:n},isAbsolute:function(n){return i(n),n.length>0&&n.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var n,r=0;r<arguments.length;++r){var s=arguments[r];i(s),s.length>0&&(n===void 0?n=s:n+="/"+s)}return n===void 0?".":h.normalize(n)},relative:function(n,r){if(i(n),i(r),n===r||(n=h.resolve(n),r=h.resolve(r),n===r))return"";for(var s=1;s<n.length&&n.charCodeAt(s)===47;++s);for(var o=n.length,l=o-s,f=1;f<r.length&&r.charCodeAt(f)===47;++f);for(var p=r.length,g=p-f,m=l<g?l:g,b=-1,y=0;y<=m;++y){if(y===m){if(g>m){if(r.charCodeAt(f+y)===47)return r.slice(f+y+1);if(y===0)return r.slice(f+y)}else l>m&&(n.charCodeAt(s+y)===47?b=y:y===0&&(b=0));break}var A=n.charCodeAt(s+y),N=r.charCodeAt(f+y);if(A!==N)break;A===47&&(b=y)}var k="";for(y=s+b+1;y<=o;++y)(y===o||n.charCodeAt(y)===47)&&(k.length===0?k+="..":k+="/..");return k.length>0?k+r.slice(f+b):(f+=b,r.charCodeAt(f)===47&&++f,r.slice(f))},_makeLong:function(n){return n},dirname:function(n){if(i(n),n.length===0)return".";for(var r=n.charCodeAt(0),s=r===47,o=-1,l=!0,f=n.length-1;f>=1;--f)if(r=n.charCodeAt(f),r===47){if(!l){o=f;break}}else l=!1;return o===-1?s?"/":".":s&&o===1?"//":n.slice(0,o)},basename:function(n,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');i(n);var s=0,o=-1,l=!0,f;if(r!==void 0&&r.length>0&&r.length<=n.length){if(r.length===n.length&&r===n)return"";var p=r.length-1,g=-1;for(f=n.length-1;f>=0;--f){var m=n.charCodeAt(f);if(m===47){if(!l){s=f+1;break}}else g===-1&&(l=!1,g=f+1),p>=0&&(m===r.charCodeAt(p)?--p===-1&&(o=f):(p=-1,o=g))}return s===o?o=g:o===-1&&(o=n.length),n.slice(s,o)}else{for(f=n.length-1;f>=0;--f)if(n.charCodeAt(f)===47){if(!l){s=f+1;break}}else o===-1&&(l=!1,o=f+1);return o===-1?"":n.slice(s,o)}},extname:function(n){i(n);for(var r=-1,s=0,o=-1,l=!0,f=0,p=n.length-1;p>=0;--p){var g=n.charCodeAt(p);if(g===47){if(!l){s=p+1;break}continue}o===-1&&(l=!1,o=p+1),g===46?r===-1?r=p:f!==1&&(f=1):r!==-1&&(f=-1)}return r===-1||o===-1||f===0||f===1&&r===o-1&&r===s+1?"":n.slice(r,o)},format:function(n){if(n===null||typeof n!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof n);return a("/",n)},parse:function(n){i(n);var r={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return r;var s=n.charCodeAt(0),o=s===47,l;o?(r.root="/",l=1):l=0;for(var f=-1,p=0,g=-1,m=!0,b=n.length-1,y=0;b>=l;--b){if(s=n.charCodeAt(b),s===47){if(!m){p=b+1;break}continue}g===-1&&(m=!1,g=b+1),s===46?f===-1?f=b:y!==1&&(y=1):f!==-1&&(y=-1)}return f===-1||g===-1||y===0||y===1&&f===g-1&&f===p+1?g!==-1&&(p===0&&o?r.base=r.name=n.slice(1,g):r.base=r.name=n.slice(p,g)):(p===0&&o?(r.name=n.slice(1,f),r.base=n.slice(1,g)):(r.name=n.slice(p,f),r.base=n.slice(p,g)),r.ext=n.slice(f,g)),p>0?r.dir=n.slice(0,p-1):o&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return h.posix=h,xr=h,xr}function oc(e){if(typeof e=="string")e=new URL(e);else if(!(e instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(e.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return Mr?sc(e):ac(e)}function sc(e){let i=e.hostname,t=e.pathname;for(let a=0;a<t.length;a++)if(t[a]==="%"){let h=t.codePointAt(a+2)||32;if(t[a+1]==="2"&&h===102||t[a+1]==="5"&&h===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(t=t.replace(Qs,"\\"),t=decodeURIComponent(t),i!=="")return`\\\\${i}${t}`;{let a=t.codePointAt(1)|32,h=t[2];if(a<Ks||a>Ys||h!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return t.slice(1)}}function ac(e){if(e.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let i=e.pathname;for(let t=0;t<i.length;t++)if(i[t]==="%"){let a=i.codePointAt(t+2)||32;if(i[t+1]==="2"&&a===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(i)}function lc(e){let i=Pi.resolve(e),t=e.charCodeAt(e.length-1);(t===Hs||Mr&&t===zs)&&i[i.length-1]!==Pi.sep&&(i+="/");let a=new URL("file://");return i.includes("%")&&(i=i.replace(Gs,"%25")),!Mr&&i.includes("\\")&&(i=i.replace(Js,"%5C")),i.includes(`
|
|
4
|
+
`)&&(i=i.replace(Zs,"%0A")),i.includes("\r")&&(i=i.replace(Xs,"%0D")),i.includes(" ")&&(i=i.replace(ea,"%09")),a.pathname=i,a}function Ns(e){if(typeof e=="string")e=new URL(e);else if(!(e instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(e.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return Nr?hc(e):cc(e)}function hc(e){let i=e.hostname,t=e.pathname;for(let a=0;a<t.length;a++)if(t[a]==="%"){let h=t.codePointAt(a+2)||32;if(t[a+1]==="2"&&h===102||t[a+1]==="5"&&h===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(t=t.replace(fa,"\\"),t=decodeURIComponent(t),i!=="")return`\\\\${i}${t}`;{let a=t.codePointAt(1)|32,h=t[2];if(a<ca||a>ua||h!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return t.slice(1)}}function cc(e){if(e.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let i=e.pathname;for(let t=0;t<i.length;t++)if(i[t]==="%"){let a=i.codePointAt(t+2)||32;if(i[t+1]==="2"&&a===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(i)}function Ls(e){let i=ki.resolve(e),t=e.charCodeAt(e.length-1);(t===ha||Nr&&t===la)&&i[i.length-1]!==ki.sep&&(i+="/");let a=new URL("file://");return i.includes("%")&&(i=i.replace(da,"%25")),!Nr&&i.includes("\\")&&(i=i.replace(pa,"%5C")),i.includes(`
|
|
5
|
+
`)&&(i=i.replace(ga,"%0A")),i.includes("\r")&&(i=i.replace(ma,"%0D")),i.includes(" ")&&(i=i.replace(ba,"%09")),a.pathname=i,a}var Me,Us,ht,js,Ds,Fs,Ws,Pr,Ii,Ti,Ci,$s,Vs,Or,Gt,Rr,xr,Bi,Pi,qs,zs,Hs,Ks,Ys,Mr,Qs,Gs,Js,Zs,Xs,ea,ta,ra,na,ia,oa,sa,aa,la,ha,ca,ua,Nr,fa,da,pa,ga,ma,ba,uc=Qe(()=>{ae(),he(),le(),Gh(),Zh(),ec(),nc(),xs(),Me={},Us=Ot,ht={isString:function(e){return typeof e=="string"},isObject:function(e){return typeof e=="object"&&e!==null},isNull:function(e){return e===null},isNullOrUndefined:function(e){return e==null}},Me.parse=ur,Me.resolve=function(e,i){return ur(e,!1,!0).resolve(i)},Me.resolveObject=function(e,i){return e?ur(e,!1,!0).resolveObject(i):i},Me.format=function(e){return ht.isString(e)&&(e=ur(e)),e instanceof ot?e.format():ot.prototype.format.call(e)},Me.Url=ot,js=/^([a-z0-9.+-]+:)/i,Ds=/:[0-9]*$/,Fs=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Ws=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
6
|
+
`," "]),Pr=["'"].concat(Ws),Ii=["%","/","?",";","#"].concat(Pr),Ti=["/","?","#"],Ci=/^[+a-z0-9A-Z_-]{0,63}$/,$s=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Vs={javascript:!0,"javascript:":!0},Or={javascript:!0,"javascript:":!0},Gt={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Rr=dt,ot.prototype.parse=function(e,i,t){if(!ht.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var a=e.indexOf("?"),h=a!==-1&&a<e.indexOf("#")?"?":"#",n=e.split(h);n[0]=n[0].replace(/\\/g,"/");var r=e=n.join(h);if(r=r.trim(),!t&&e.split("#").length===1){var s=Fs.exec(r);if(s)return this.path=r,this.href=r,this.pathname=s[1],s[2]?(this.search=s[2],this.query=i?Rr.parse(this.search.substr(1)):this.search.substr(1)):i&&(this.search="",this.query={}),this}var o=js.exec(r);if(o){var l=(o=o[0]).toLowerCase();this.protocol=l,r=r.substr(o.length)}if(t||o||r.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=r.substr(0,2)==="//";!f||o&&Or[o]||(r=r.substr(2),this.slashes=!0)}if(!Or[o]&&(f||o&&!Gt[o])){for(var p,g,m=-1,b=0;b<Ti.length;b++)(y=r.indexOf(Ti[b]))!==-1&&(m===-1||y<m)&&(m=y);for((g=m===-1?r.lastIndexOf("@"):r.lastIndexOf("@",m))!==-1&&(p=r.slice(0,g),r=r.slice(g+1),this.auth=decodeURIComponent(p)),m=-1,b=0;b<Ii.length;b++){var y;(y=r.indexOf(Ii[b]))!==-1&&(m===-1||y<m)&&(m=y)}m===-1&&(m=r.length),this.host=r.slice(0,m),r=r.slice(m),this.parseHost(),this.hostname=this.hostname||"";var A=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!A)for(var N=this.hostname.split(/\./),k=(b=0,N.length);b<k;b++){var v=N[b];if(v&&!v.match(Ci)){for(var U="",D=0,C=v.length;D<C;D++)v.charCodeAt(D)>127?U+="x":U+=v[D];if(!U.match(Ci)){var T=N.slice(0,b),M=N.slice(b+1),V=v.match($s);V&&(T.push(V[1]),M.unshift(V[2])),M.length&&(r="/"+M.join(".")+r),this.hostname=T.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),A||(this.hostname=Us.toASCII(this.hostname));var J=this.port?":"+this.port:"",ne=this.hostname||"";this.host=ne+J,this.href+=this.host,A&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),r[0]!=="/"&&(r="/"+r))}if(!Vs[l])for(b=0,k=Pr.length;b<k;b++){var S=Pr[b];if(r.indexOf(S)!==-1){var H=encodeURIComponent(S);H===S&&(H=escape(S)),r=r.split(S).join(H)}}var re=r.indexOf("#");re!==-1&&(this.hash=r.substr(re),r=r.slice(0,re));var Q=r.indexOf("?");if(Q!==-1?(this.search=r.substr(Q),this.query=r.substr(Q+1),i&&(this.query=Rr.parse(this.query)),r=r.slice(0,Q)):i&&(this.search="",this.query={}),r&&(this.pathname=r),Gt[l]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){J=this.pathname||"";var me=this.search||"";this.path=J+me}return this.href=this.format(),this},ot.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var i=this.protocol||"",t=this.pathname||"",a=this.hash||"",h=!1,n="";this.host?h=e+this.host:this.hostname&&(h=e+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(h+=":"+this.port)),this.query&&ht.isObject(this.query)&&Object.keys(this.query).length&&(n=Rr.stringify(this.query));var r=this.search||n&&"?"+n||"";return i&&i.substr(-1)!==":"&&(i+=":"),this.slashes||(!i||Gt[i])&&h!==!1?(h="//"+(h||""),t&&t.charAt(0)!=="/"&&(t="/"+t)):h||(h=""),a&&a.charAt(0)!=="#"&&(a="#"+a),r&&r.charAt(0)!=="?"&&(r="?"+r),i+h+(t=t.replace(/[?#]/g,function(s){return encodeURIComponent(s)}))+(r=r.replace("#","%23"))+a},ot.prototype.resolve=function(e){return this.resolveObject(ur(e,!1,!0)).format()},ot.prototype.resolveObject=function(e){if(ht.isString(e)){var i=new ot;i.parse(e,!1,!0),e=i}for(var t=new ot,a=Object.keys(this),h=0;h<a.length;h++){var n=a[h];t[n]=this[n]}if(t.hash=e.hash,e.href==="")return t.href=t.format(),t;if(e.slashes&&!e.protocol){for(var r=Object.keys(e),s=0;s<r.length;s++){var o=r[s];o!=="protocol"&&(t[o]=e[o])}return Gt[t.protocol]&&t.hostname&&!t.pathname&&(t.path=t.pathname="/"),t.href=t.format(),t}if(e.protocol&&e.protocol!==t.protocol){if(!Gt[e.protocol]){for(var l=Object.keys(e),f=0;f<l.length;f++){var p=l[f];t[p]=e[p]}return t.href=t.format(),t}if(t.protocol=e.protocol,e.host||Or[e.protocol])t.pathname=e.pathname;else{for(var g=(e.pathname||"").split("/");g.length&&!(e.host=g.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),g[0]!==""&&g.unshift(""),g.length<2&&g.unshift(""),t.pathname=g.join("/")}if(t.search=e.search,t.query=e.query,t.host=e.host||"",t.auth=e.auth,t.hostname=e.hostname||e.host,t.port=e.port,t.pathname||t.search){var m=t.pathname||"",b=t.search||"";t.path=m+b}return t.slashes=t.slashes||e.slashes,t.href=t.format(),t}var y=t.pathname&&t.pathname.charAt(0)==="/",A=e.host||e.pathname&&e.pathname.charAt(0)==="/",N=A||y||t.host&&e.pathname,k=N,v=t.pathname&&t.pathname.split("/")||[],U=(g=e.pathname&&e.pathname.split("/")||[],t.protocol&&!Gt[t.protocol]);if(U&&(t.hostname="",t.port=null,t.host&&(v[0]===""?v[0]=t.host:v.unshift(t.host)),t.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(g[0]===""?g[0]=e.host:g.unshift(e.host)),e.host=null),N=N&&(g[0]===""||v[0]==="")),A)t.host=e.host||e.host===""?e.host:t.host,t.hostname=e.hostname||e.hostname===""?e.hostname:t.hostname,t.search=e.search,t.query=e.query,v=g;else if(g.length)v||(v=[]),v.pop(),v=v.concat(g),t.search=e.search,t.query=e.query;else if(!ht.isNullOrUndefined(e.search))return U&&(t.hostname=t.host=v.shift(),(V=!!(t.host&&t.host.indexOf("@")>0)&&t.host.split("@"))&&(t.auth=V.shift(),t.host=t.hostname=V.shift())),t.search=e.search,t.query=e.query,ht.isNull(t.pathname)&&ht.isNull(t.search)||(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.href=t.format(),t;if(!v.length)return t.pathname=null,t.search?t.path="/"+t.search:t.path=null,t.href=t.format(),t;for(var D=v.slice(-1)[0],C=(t.host||e.host||v.length>1)&&(D==="."||D==="..")||D==="",T=0,M=v.length;M>=0;M--)(D=v[M])==="."?v.splice(M,1):D===".."?(v.splice(M,1),T++):T&&(v.splice(M,1),T--);if(!N&&!k)for(;T--;T)v.unshift("..");!N||v[0]===""||v[0]&&v[0].charAt(0)==="/"||v.unshift(""),C&&v.join("/").substr(-1)!=="/"&&v.push("");var V,J=v[0]===""||v[0]&&v[0].charAt(0)==="/";return U&&(t.hostname=t.host=J?"":v.length?v.shift():"",(V=!!(t.host&&t.host.indexOf("@")>0)&&t.host.split("@"))&&(t.auth=V.shift(),t.host=t.hostname=V.shift())),(N=N||t.host&&v.length)&&!J&&v.unshift(""),v.length?t.pathname=v.join("/"):(t.pathname=null,t.path=null),ht.isNull(t.pathname)&&ht.isNull(t.search)||(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.auth=e.auth||t.auth,t.slashes=t.slashes||e.slashes,t.href=t.format(),t},ot.prototype.parseHost=function(){var e=this.host,i=Ds.exec(e);i&&((i=i[0])!==":"&&(this.port=i.substr(1)),e=e.substr(0,e.length-i.length)),e&&(this.hostname=e)},Me.Url,Me.format,Me.resolve,Me.resolveObject,xr={},Bi=!1,Pi=ic(),qs=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0,Me.URL=typeof URL<"u"?URL:null,Me.pathToFileURL=lc,Me.fileURLToPath=oc,Me.Url,Me.format,Me.resolve,Me.resolveObject,Me.URL,zs=92,Hs=47,Ks=97,Ys=122,Mr=qs==="win32",Qs=/\//g,Gs=/%/g,Js=/\\/g,Zs=/\n/g,Xs=/\r/g,ea=/\t/g,ta=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0,Me.URL=typeof URL<"u"?URL:null,Me.pathToFileURL=Ls,Me.fileURLToPath=Ns,ra=Me.Url,na=Me.format,ia=Me.resolve,oa=Me.resolveObject,sa=Me.parse,aa=Me.URL,la=92,ha=47,ca=97,ua=122,Nr=ta==="win32",fa=/\//g,da=/%/g,pa=/\\/g,ga=/\n/g,ma=/\r/g,ba=/\t/g}),fc=be((e,i)=>{ae(),he(),le(),i.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}}),Oi=be(e=>{ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0}),e.BufferedDuplex=e.writev=void 0;var i=qt(),t=(Je(),Ne(Ge));function a(n,r){let s=new Array(n.length);for(let o=0;o<n.length;o++)typeof n[o].chunk=="string"?s[o]=t.Buffer.from(n[o].chunk,"utf8"):s[o]=n[o].chunk;this._write(t.Buffer.concat(s),"binary",r)}e.writev=a;var h=class extends i.Duplex{constructor(n,r,s){super({objectMode:!0}),this.proxy=r,this.socket=s,this.writeQueue=[],n.objectMode||(this._writev=a.bind(this)),this.isSocketOpen=!1,this.proxy.on("data",o=>{this.destroyed||this.push(o)})}_read(n){this.proxy.read(n)}_write(n,r,s){this.isSocketOpen?this.writeToProxy(n,r,s):this.writeQueue.push({chunk:n,encoding:r,cb:s})}_final(n){this.writeQueue=[],this.proxy.end(n)}_destroy(n,r){this.writeQueue=[],this.proxy.destroy(),r(n)}socketReady(){this.emit("connect"),this.isSocketOpen=!0,this.processWriteQueue()}writeToProxy(n,r,s){this.proxy.write(n,r)===!1?this.proxy.once("drain",s):s()}processWriteQueue(){for(;this.writeQueue.length>0;){let{chunk:n,encoding:r,cb:s}=this.writeQueue.shift();this.writeToProxy(n,r,s)}}};e.BufferedDuplex=h}),Lr=be(e=>{ae(),he(),le();var i=e&&e.__importDefault||function(N){return N&&N.__esModule?N:{default:N}};Object.defineProperty(e,"__esModule",{value:!0}),e.streamBuilder=e.browserStreamBuilder=void 0;var t=(Je(),Ne(Ge)),a=i(fc()),h=i(St()),n=qt(),r=i(Ir()),s=Oi(),o=(0,h.default)("mqttjs:ws"),l=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function f(N,k){let v=`${N.protocol}://${N.hostname}:${N.port}${N.path}`;return typeof N.transformWsUrl=="function"&&(v=N.transformWsUrl(v,N,k)),v}function p(N){let k=N;return N.port||(N.protocol==="wss"?k.port=443:k.port=80),N.path||(k.path="/"),N.wsOptions||(k.wsOptions={}),!r.default&&!N.forceNativeWebSocket&&N.protocol==="wss"&&l.forEach(v=>{Object.prototype.hasOwnProperty.call(N,v)&&!Object.prototype.hasOwnProperty.call(N.wsOptions,v)&&(k.wsOptions[v]=N[v])}),k}function g(N){let k=p(N);if(k.hostname||(k.hostname=k.host),!k.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");let v=new URL(document.URL);k.hostname=v.hostname,k.port||(k.port=Number(v.port))}return k.objectMode===void 0&&(k.objectMode=!(k.binary===!0||k.binary===void 0)),k}function m(N,k,v){o("createWebSocket"),o(`protocol: ${v.protocolId} ${v.protocolVersion}`);let U=v.protocolId==="MQIsdp"&&v.protocolVersion===3?"mqttv3.1":"mqtt";o(`creating new Websocket for url: ${k} and protocol: ${U}`);let D;return v.createWebsocket?D=v.createWebsocket(k,[U],v):D=new a.default(k,[U],v.wsOptions),D}function b(N,k){let v=k.protocolId==="MQIsdp"&&k.protocolVersion===3?"mqttv3.1":"mqtt",U=f(k,N),D;return k.createWebsocket?D=k.createWebsocket(U,[v],k):D=new WebSocket(U,[v]),D.binaryType="arraybuffer",D}var y=(N,k)=>{o("streamBuilder");let v=p(k);v.hostname=v.hostname||v.host||"localhost";let U=f(v,N),D=m(N,U,v),C=a.default.createWebSocketStream(D,v.wsOptions);return C.url=U,D.on("close",()=>{C.destroy()}),C};e.streamBuilder=y;var A=(N,k)=>{o("browserStreamBuilder");let v,U=g(k).browserBufferSize||1024*512,D=k.browserBufferTimeout||1e3,C=!k.objectMode,T=b(N,k),M=J(k,Q,me);k.objectMode||(M._writev=s.writev.bind(M)),M.on("close",()=>{T.close()});let V=typeof T.addEventListener<"u";T.readyState===T.OPEN?(v=M,v.socket=T):(v=new s.BufferedDuplex(k,M,T),V?T.addEventListener("open",ne):T.onopen=ne),V?(T.addEventListener("close",S),T.addEventListener("error",H),T.addEventListener("message",re)):(T.onclose=S,T.onerror=H,T.onmessage=re);function J(se,z,ye){let oe=new n.Transform({objectMode:se.objectMode});return oe._write=z,oe._flush=ye,oe}function ne(){o("WebSocket onOpen"),v instanceof s.BufferedDuplex&&v.socketReady()}function S(se){o("WebSocket onClose",se),v.end(),v.destroy()}function H(se){o("WebSocket onError",se);let z=new Error("WebSocket error");z.event=se,v.destroy(z)}async function re(se){let{data:z}=se;z instanceof ArrayBuffer?z=t.Buffer.from(z):z instanceof Blob?z=t.Buffer.from(await new Response(z).arrayBuffer()):z=t.Buffer.from(z,"utf8"),M&&!M.destroyed&&M.push(z)}function Q(se,z,ye){if(T.bufferedAmount>U){setTimeout(Q,D,se,z,ye);return}C&&typeof se=="string"&&(se=t.Buffer.from(se,"utf8"));try{T.send(se)}catch(oe){return ye(oe)}ye()}function me(se){T.close(),se()}return v};e.browserStreamBuilder=A}),Ri={};Mt(Ri,{Server:()=>je,Socket:()=>je,Stream:()=>je,_createServerHandle:()=>je,_normalizeArgs:()=>je,_setSimultaneousAccepts:()=>je,connect:()=>je,createConnection:()=>je,createServer:()=>je,default:()=>ya,isIP:()=>je,isIPv4:()=>je,isIPv6:()=>je});function je(){throw new Error("Node.js net module is not supported by JSPM core outside of Node.js")}var ya,wa=Qe(()=>{ae(),he(),le(),ya={_createServerHandle:je,_normalizeArgs:je,_setSimultaneousAccepts:je,connect:je,createConnection:je,createServer:je,isIP:je,isIPv4:je,isIPv6:je,Server:je,Socket:je,Stream:je}}),_a=be(e=>{ae(),he(),le();var i=e&&e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(e,"__esModule",{value:!0});var t=i((wa(),Ne(Ri))),a=i(St()),h=(0,a.default)("mqttjs:tcp"),n=(r,s)=>{s.port=s.port||1883,s.hostname=s.hostname||s.host||"localhost";let{port:o,path:l}=s,f=s.hostname;return h("port %d and host %s",o,f),t.default.createConnection({port:o,host:f,path:l})};e.default=n}),va={};Mt(va,{default:()=>Ea});var Ea,dc=Qe(()=>{ae(),he(),le(),Ea={}}),Sa=be(e=>{ae(),he(),le();var i=e&&e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0});var t=i((dc(),Ne(va))),a=i((wa(),Ne(Ri))),h=i(St()),n=(0,h.default)("mqttjs:tls"),r=(s,o)=>{o.port=o.port||8883,o.host=o.hostname||o.host||"localhost",a.default.isIP(o.host)===0&&(o.servername=o.host),o.rejectUnauthorized=o.rejectUnauthorized!==!1,delete o.path,n("port %d host %s rejectUnauthorized %b",o.port,o.host,o.rejectUnauthorized);let l=t.default.connect(o);l.on("secureConnect",()=>{o.rejectUnauthorized&&!l.authorized?l.emit("error",new Error("TLS not authorized")):l.removeListener("error",f)});function f(p){o.rejectUnauthorized&&s.emit("error",p),l.end()}return l.on("error",f),l};e.default=r}),Aa=be(e=>{ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0});var i=(Je(),Ne(Ge)),t=qt(),a=Oi(),h,n,r;function s(){let g=new t.Transform;return g._write=(m,b,y)=>{h.send({data:m.buffer,success(){y()},fail(A){y(new Error(A))}})},g._flush=m=>{h.close({success(){m()}})},g}function o(g){g.hostname||(g.hostname="localhost"),g.path||(g.path="/"),g.wsOptions||(g.wsOptions={})}function l(g,m){let b=g.protocol==="wxs"?"wss":"ws",y=`${b}://${g.hostname}${g.path}`;return g.port&&g.port!==80&&g.port!==443&&(y=`${b}://${g.hostname}:${g.port}${g.path}`),typeof g.transformWsUrl=="function"&&(y=g.transformWsUrl(y,g,m)),y}function f(){h.onOpen(()=>{r.socketReady()}),h.onMessage(g=>{let{data:m}=g;m instanceof ArrayBuffer?m=i.Buffer.from(m):m=i.Buffer.from(m,"utf8"),n.push(m)}),h.onClose(()=>{r.emit("close"),r.end(),r.destroy()}),h.onError(g=>{let m=new Error(g.errMsg);r.destroy(m)})}var p=(g,m)=>{if(m.hostname=m.hostname||m.host,!m.hostname)throw new Error("Could not determine host. Specify host manually.");let b=m.protocolId==="MQIsdp"&&m.protocolVersion===3?"mqttv3.1":"mqtt";o(m);let y=l(m,g);h=wx.connectSocket({url:y,protocols:[b]}),n=s(),r=new a.BufferedDuplex(m,n,h),r._destroy=(N,k)=>{h.close({success(){k&&k(N)}})};let A=r.destroy;return r.destroy=(N,k)=>(r.destroy=A,setTimeout(()=>{h.close({fail(){r._destroy(N,k)}})},0),r),f(),r};e.default=p}),ka=be(e=>{ae(),he(),le(),Object.defineProperty(e,"__esModule",{value:!0});var i=(Je(),Ne(Ge)),t=qt(),a=Oi(),h,n,r,s=!1;function o(){let m=new t.Transform;return m._write=(b,y,A)=>{h.sendSocketMessage({data:b.buffer,success(){A()},fail(){A(new Error)}})},m._flush=b=>{h.closeSocket({success(){b()}})},m}function l(m){m.hostname||(m.hostname="localhost"),m.path||(m.path="/"),m.wsOptions||(m.wsOptions={})}function f(m,b){let y=m.protocol==="alis"?"wss":"ws",A=`${y}://${m.hostname}${m.path}`;return m.port&&m.port!==80&&m.port!==443&&(A=`${y}://${m.hostname}:${m.port}${m.path}`),typeof m.transformWsUrl=="function"&&(A=m.transformWsUrl(A,m,b)),A}function p(){s||(s=!0,h.onSocketOpen(()=>{r.socketReady()}),h.onSocketMessage(m=>{if(typeof m.data=="string"){let b=i.Buffer.from(m.data,"base64");n.push(b)}else{let b=new FileReader;b.addEventListener("load",()=>{let y=b.result;y instanceof ArrayBuffer?y=i.Buffer.from(y):y=i.Buffer.from(y,"utf8"),n.push(y)}),b.readAsArrayBuffer(m.data)}}),h.onSocketClose(()=>{r.end(),r.destroy()}),h.onSocketError(m=>{r.destroy(m)}))}var g=(m,b)=>{if(b.hostname=b.hostname||b.host,!b.hostname)throw new Error("Could not determine host. Specify host manually.");let y=b.protocolId==="MQIsdp"&&b.protocolVersion===3?"mqttv3.1":"mqtt";l(b);let A=f(b,m);return h=b.my,h.connectSocket({url:A,protocols:y}),n=o(),r=new a.BufferedDuplex(b,n,h),p(),r};e.default=g}),pc=be(e=>{ae(),he(),le();var i=e&&e.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(e,"__esModule",{value:!0}),e.connectAsync=void 0;var t=i(St()),a=i((uc(),Ne(Ms))),h=i(mi()),n=i(Ir());typeof(Re==null?void 0:Re.nextTick)!="function"&&(Re.nextTick=setImmediate);var r=(0,t.default)("mqttjs"),s=null;function o(p){let g;p.auth&&(g=p.auth.match(/^(.+):(.+)$/),g?(p.username=g[1],p.password=g[2]):p.username=p.auth)}function l(p,g){var m,b,y,A;if(r("connecting to an MQTT broker..."),typeof p=="object"&&!g&&(g=p,p=""),g=g||{},p&&typeof p=="string"){let v=a.default.parse(p,!0),U={};if(v.port!=null&&(U.port=Number(v.port)),U.host=v.hostname,U.query=v.query,U.auth=v.auth,U.protocol=v.protocol,U.path=v.path,U.protocol=(m=U.protocol)===null||m===void 0?void 0:m.replace(/:$/,""),g=Object.assign(Object.assign({},U),g),!g.protocol)throw new Error("Missing protocol")}if(g.unixSocket=g.unixSocket||((b=g.protocol)===null||b===void 0?void 0:b.includes("+unix")),g.unixSocket?g.protocol=g.protocol.replace("+unix",""):!(!((y=g.protocol)===null||y===void 0)&&y.startsWith("ws"))&&!(!((A=g.protocol)===null||A===void 0)&&A.startsWith("wx"))&&delete g.path,o(g),g.query&&typeof g.query.clientId=="string"&&(g.clientId=g.query.clientId),g.cert&&g.key)if(g.protocol){if(["mqtts","wss","wxs","alis"].indexOf(g.protocol)===-1)switch(g.protocol){case"mqtt":g.protocol="mqtts";break;case"ws":g.protocol="wss";break;case"wx":g.protocol="wxs";break;case"ali":g.protocol="alis";break;default:throw new Error(`Unknown protocol for secure connection: "${g.protocol}"!`)}}else throw new Error("Missing secure protocol key");if(s||(s={},!n.default&&!g.forceNativeWebSocket?(s.ws=Lr().streamBuilder,s.wss=Lr().streamBuilder,s.mqtt=_a().default,s.tcp=_a().default,s.ssl=Sa().default,s.tls=s.ssl,s.mqtts=Sa().default):(s.ws=Lr().browserStreamBuilder,s.wss=Lr().browserStreamBuilder,s.wx=Aa().default,s.wxs=Aa().default,s.ali=ka().default,s.alis=ka().default)),!s[g.protocol]){let v=["mqtts","wss"].indexOf(g.protocol)!==-1;g.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((U,D)=>v&&D%2===0?!1:typeof s[U]=="function")[0]}if(g.clean===!1&&!g.clientId)throw new Error("Missing clientId for unclean clients");g.protocol&&(g.defaultProtocol=g.protocol);function N(v){return g.servers&&((!v._reconnectCount||v._reconnectCount===g.servers.length)&&(v._reconnectCount=0),g.host=g.servers[v._reconnectCount].host,g.port=g.servers[v._reconnectCount].port,g.protocol=g.servers[v._reconnectCount].protocol?g.servers[v._reconnectCount].protocol:g.defaultProtocol,g.hostname=g.host,v._reconnectCount++),r("calling streambuilder for",g.protocol),s[g.protocol](v,g)}let k=new h.default(N,g);return k.on("error",()=>{}),k}function f(p,g,m=!0){return new Promise((b,y)=>{let A=l(p,g),N={connect:v=>{k(),b(A)},end:()=>{k(),b(A)},error:v=>{k(),A.end(),y(v)}};m===!1&&(N.close=()=>{N.error(new Error("Couldn't connect to server"))});function k(){Object.keys(N).forEach(v=>{A.off(v,N[v])})}Object.keys(N).forEach(v=>{A.on(v,N[v])})})}e.connectAsync=f,e.default=l}),Ia=be(e=>{ae(),he(),le();var i=e&&e.__createBinding||(Object.create?function(m,b,y,A){A===void 0&&(A=y);var N=Object.getOwnPropertyDescriptor(b,y);(!N||("get"in N?!b.__esModule:N.writable||N.configurable))&&(N={enumerable:!0,get:function(){return b[y]}}),Object.defineProperty(m,A,N)}:function(m,b,y,A){A===void 0&&(A=y),m[A]=b[y]}),t=e&&e.__setModuleDefault||(Object.create?function(m,b){Object.defineProperty(m,"default",{enumerable:!0,value:b})}:function(m,b){m.default=b}),a=e&&e.__importStar||function(m){if(m&&m.__esModule)return m;var b={};if(m!=null)for(var y in m)y!=="default"&&Object.prototype.hasOwnProperty.call(m,y)&&i(b,m,y);return t(b,m),b},h=e&&e.__exportStar||function(m,b){for(var y in m)y!=="default"&&!Object.prototype.hasOwnProperty.call(b,y)&&i(b,m,y)},n=e&&e.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};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 r=n(mi());e.MqttClient=r.default;var s=n(fs());e.DefaultMessageIdProvider=s.default;var o=n(Qh());e.UniqueMessageIdProvider=o.default;var l=n(ds());e.Store=l.default;var f=a(pc());e.connect=f.default,Object.defineProperty(e,"connectAsync",{enumerable:!0,get:function(){return f.connectAsync}});var p=n(_s());e.KeepaliveManager=p.default,e.Client=r.default,h(mi(),e),h(rr(),e);var g=kr();Object.defineProperty(e,"ReasonCodes",{enumerable:!0,get:function(){return g.ReasonCodes}})}),gc=be(e=>{ae(),he(),le();var i=e&&e.__createBinding||(Object.create?function(r,s,o,l){l===void 0&&(l=o);var f=Object.getOwnPropertyDescriptor(s,o);(!f||("get"in f?!s.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(r,l,f)}:function(r,s,o,l){l===void 0&&(l=o),r[l]=s[o]}),t=e&&e.__setModuleDefault||(Object.create?function(r,s){Object.defineProperty(r,"default",{enumerable:!0,value:s})}:function(r,s){r.default=s}),a=e&&e.__importStar||function(r){if(r&&r.__esModule)return r;var s={};if(r!=null)for(var o in r)o!=="default"&&Object.prototype.hasOwnProperty.call(r,o)&&i(s,r,o);return t(s,r),s},h=e&&e.__exportStar||function(r,s){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&i(s,r,o)};Object.defineProperty(e,"__esModule",{value:!0});var n=a(Ia());e.default=n,h(Ia(),e)});const mc=gc();/*! Bundled license information:
|
|
7
7
|
|
|
8
8
|
@jspm/core/nodelibs/browser/buffer.js:
|
|
9
9
|
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
10
|
-
*/const
|
|
10
|
+
*/const bc=e=>{const i=R.ref(null),t=R.ref({});return R.onMounted(()=>{i.value=mc.connect(e),e.topics||(e.topics=["#"]);for(const a of e.topics)i.value.subscribe(a,h=>{if(h)throw h});i.value.on("message",(a,h)=>{t.value[a]||(t.value[a]=[]),t.value[a].push(h.toString())})}),R.onUnmounted(()=>{i.value.end()}),{messages:t}};function yc(e){e.component("ActionFooter",Di),e.component("BeamArrow",Fi),e.component("BeamBtn",Wi),e.component("BeamFilter",$i),e.component("BeamFilterOption",Vi),e.component("BeamHeading",qi),e.component("BeamMetadata",zi),e.component("BeamModal",Hi),e.component("BeamModalOutlet",Ki),e.component("BeamProgress",Yi),e.component("Confirm",Qi),e.component("FixedTop",Gi),e.component("ItemCheck",Wr),e.component("ItemCount",$r),e.component("ListAnchor",Ji),e.component("ListItem",dr),e.component("ListView",Zi),e.component("Navbar",Xi),e.component("ScanInput",ro),e.component("SplitColumn",no),e.component("ToggleArrow",io)}Ee.ActionFooter=Di,Ee.BeamArrow=Fi,Ee.BeamBtn=Wi,Ee.BeamFilter=$i,Ee.BeamFilterOption=Vi,Ee.BeamHeading=qi,Ee.BeamMetadata=zi,Ee.BeamModal=Hi,Ee.BeamModalOutlet=Ki,Ee.BeamProgress=Yi,Ee.Confirm=Qi,Ee.FixedTop=Gi,Ee.ItemCheck=Wr,Ee.ItemCount=$r,Ee.ListAnchor=Ji,Ee.ListItem=dr,Ee.ListView=Zi,Ee.Navbar=Xi,Ee.ScanInput=ro,Ee.SplitColumn=no,Ee.ToggleArrow=io,Ee.install=yc,Ee.useMqttStream=bc,Object.defineProperty(Ee,Symbol.toStringTag,{value:"Module"})});
|
|
11
11
|
//# sourceMappingURL=beam.umd.cjs.map
|