@shjjs/visual-ui 3.0.8 → 3.0.9

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/umd/index.js CHANGED
@@ -32660,7 +32660,7 @@ void main() {
32660
32660
  `,h),this.label3d.setLabelStyle(m,.08/this.scale,"x"),m.name="bar-"+t.id,m.setParent(this.barLabelGroup),m.userData.adcode=c.adcode,m.userData.value=c.value,m.userData.name=c.name,m.userData.position=[h.x,h.y,h.z],m},o=t.width||7,l=t.height||7,u=Math.max.apply(Math,r.map(c=>c.value));r.map((c,d)=>{if(Ht.isNumber(c.value)){let h=c.value<=0?.1:l*(c.value/u),p=new hf({color:new Ts(t.color||"#ffffff"),transparent:!0,opacity:s?0:t.opacity,depthTest:!1,fog:!1});p.name="bar-"+t.id,p.userData.opacity=t.opacity;const m=new IO(.05*o,.05*o,h);m.translate(0,0,h/2);const x=new Hu(m,p);x.renderOrder=22,x.geometry.computeBoundsTree();let v=x,[y,E]=this.geoProjection(c.coords);v.position.set(y,-E,(this.depth+.46)/this.scale),s?v.scale.set(1/this.scale,1/this.scale,0):v.scale.set(1/this.scale,1/this.scale,1/this.scale),v.userData.name=c.name,v.userData.adcode=c.adcode,v.userData.value=c.value,v.userData.position=[y,-E,(this.depth+.46)/this.scale];let S=this.createBarGuangQuan(t.bottom,s);if(S.position.set(y,-E,(this.depth+.46)/this.scale),S.userData.name=c.name,S.userData.adcode=c.adcode,S.userData.position=[y,-E,(this.depth+.46)/this.scale],S.name="bar-"+t.id,this.barGuangQuanGroup.add(S),t.huiguang.show&&h>0){let T=this.createBarHUIGUANG(h,t.huiguang);v.add(...T)}v.name="bar-"+t.id,this.barGroup.add(v);let C=a(c,d,new ir(y,-E,(this.depth+.9+h)/this.scale));this.allBar.push(v),this.allBarMaterial.push(p),this.allBarGuangquan.push(S),this.allBarLabel.push(C)}}),this.setBarLabelStyle(t.label,t.id),this.barGroup.scale.set(this.scale,this.scale,this.scale),this.barGuangQuanGroup.scale.set(this.scale,this.scale,this.scale),this.barLabelGroup.scale.set(this.scale,this.scale,this.scale),this.mainSceneGroup.add(this.barGroup),this.mainSceneGroup.add(this.barGuangQuanGroup),this.mainSceneGroup.add(this.barLabelGroup),this.option.scene.defaultMapAdcode!==1e5&&this.setBarScale()}}catch{}}cleanAllBar(){try{for(;this.barGroup.children.length;)this.barGroup.remove(this.barGroup.children[0]);for(;this.barGuangQuanGroup.children.length;)this.barGuangQuanGroup.remove(this.barGuangQuanGroup.children[0]);for(;this.barLabelGroup.children.length;)this.barLabelGroup.remove(this.barLabelGroup.children[0]);this.allBar=[],this.allBarLabel=[],this.allBarMaterial=[],this.allBarGuangquan=[]}catch{}}createBarTimeLine(){const t=ju.timeline();this.allBar.map((r,n)=>{t.add(ju.to(r.scale,{duration:1,delay:.05*n,x:1/this.scale,y:1/this.scale,z:1/this.scale,ease:"circ.out"}),"bar")}),this.allBarMaterial.map((r,n)=>{t.add(ju.to(r,{duration:.5,delay:.05*n,opacity:r.userData.opacity,ease:"circ.out"}),"bar")}),this.allBarGuangquan.map((r,n)=>{t.add(ju.to(r.children[0].scale,{duration:.5,delay:.05*n,x:1/this.scale,y:1/this.scale,z:1/this.scale,ease:"circ.out"}),"bar"),t.add(ju.to(r.children[1].scale,{duration:.5,delay:.05*n,x:1/this.scale,y:1/this.scale,z:1/this.scale,ease:"circ.out"}),"bar")}),this.allBarLabel.map(r=>{const n=r.element.querySelector(".bar-label .wrap");n.style.opacity=0}),this.allBarLabel.map((r,n)=>{const s=r.element.querySelector(".bar-label .label"),a=r.element.querySelector(".bar-label .wrap"),o=Number(s.innerText),l={score:0};if(t.add(ju.to(s,{duration:.5,delay:.05*n,opacity:1,ease:"circ.out"}),"bar"),t.add(ju.to(a,{duration:.5,delay:.05*n,opacity:1,ease:"circ.out"}),"bar"),o){let u=function(){s.innerText=l.score.toFixed(0)};const c=ju.to(l,{duration:2,delay:.05*n,score:o,onUpdate:u});t.add(c,"bar")}})}setBarLabelStyle(t,r){t&&(Qo.installFont(t.fontFamily),Qo.installFont(t.unitStyle.fontFamily),this.allBarLabel.map((n,s)=>{if(n.name==="bar-"+r){const a=n.element.querySelector(".bar-label.bar-"+r+" .wrap");t.show?a.style.opacity=1:a.style.opacity=0,a&&(a.style.backgroundColor=t.bg.color,a.style.padding=`${t.bg.paddingW}px ${t.bg.paddingH}px`,a.style.borderRadius=t.bg.borderRadius+"px",a.style.borderWidth=t.bg.borderWidth+"px",a.style.borderColor=t.bg.borderColor,a.style.borderStyle=t.bg.borderStyle);const o=n.element.querySelector(".bar-label.bar-"+r+" .label");t.show?o.innerText=o.innerText:o.innerText="",o.style.fontSize=t.fontSize+"px",o.style.fontFamily=t.fontFamily,o.style.color=t.color;const l=n.element.querySelector(".bar-label.bar-"+r+" .unit");t.show&&t.unitStyle.show?l.innerText=l.innerText:l.innerText="",l.style.fontSize=t.unitStyle.fontSize+"px",l.style.fontFamily=t.unitStyle.fontFamily,l.style.color=t.unitStyle.color}}))}setBarScale(){const t=this.boundBox;this.barGroup.position.x=-t.center.x,this.barGroup.position.y=-t.center.y,this.barGuangQuanGroup.position.x=-t.center.x,this.barGuangQuanGroup.position.y=-t.center.y,this.barLabelGroup.position.x=-t.center.x,this.barLabelGroup.position.y=-t.center.y}createBarHUIGUANG(t,r){let n=new W4(r.size,t);n.translate(0,t/2,0);const s=this.assets.instance.getResource("huiguang");s.colorSpace="srgb",s.wrapS=py,s.wrapT=py;let a=new hf({color:new Ts(r.color||"#ffffff"),map:s,transparent:!0,opacity:r.opacity,depthWrite:!1,side:w0,blending:eg}),o=new Hu(n,a);o.renderOrder=23,o.rotateX(Math.PI/2);let l=o.clone(),u=o.clone();return l.rotateY(Math.PI/180*60),u.rotateY(Math.PI/180*120),[o,l,u]}createBarGuangQuan(t,r){const n=this.assets.instance.getResource("guangquan1"),s=this.assets.instance.getResource("guangquan2");let a=new W4(t.width,t.height),o=new hf({color:new Ts(t.color||"#ffffff"),map:n,alphaMap:n,opacity:t.opacity,transparent:!0,depthTest:!1,fog:!1,blending:eg}),l=new hf({color:new Ts(t.color||"#ffffff"),map:s,alphaMap:s,opacity:t.opacity,transparent:!0,depthTest:!1,fog:!1,blending:eg}),u=new Hu(a,o),c=new Hu(a,l);u.renderOrder=24,c.renderOrder=24,c.position.z-=.001,r?(u.scale.set(0,0,0),c.scale.set(0,0,0)):(u.scale.set(1/this.scale,1/this.scale,1/this.scale),c.scale.set(1/this.scale,1/this.scale,1/this.scale));const d=new lc;return d.add(u,c),this.time.on("tick",h=>{u.rotation.z+=h*2}),d}setBarMove(t,r="up"){this.allBar.map(n=>{n.userData.adcode===t&&ju.to(n.position,{duration:.3,z:r==="up"?n.userData.position[2]+this.depth/2+.3:n.userData.position[2]})})}setBarGuangQuanMove(t,r="up"){this.allBarGuangquan.map(n=>{n.userData.adcode===t&&ju.to(n.position,{duration:.3,z:r==="up"?n.userData.position[2]+this.depth/2+.3:n.userData.position[2]})})}setBarLabelMove(t,r="up"){this.allBarLabel.map(n=>{n.userData.adcode===t&&ju.to(n.position,{duration:.3,z:r==="up"?n.userData.position[2]+this.depth/2+.3:n.userData.position[2]})})}createScatter(t,r=[],n=!0,s=!1){if(!(!n&&(r=this.datasource[t._sourceId],!r))&&(n||(this.scatterLabelGroup.remove(...this.scatterLabelGroup.children.filter(a=>a.name==="scatter-"+t.id)),this.allScatterLabel=this.allScatterLabel.filter(a=>a.name!=="scatter-"+t.id)),r&&Ht.isArray(r)&&r.length>0))try{if(this.datasource[t._sourceId]=r,!t.isHide){const a=(o,l,u)=>{let c=t.format;try{const h=t.format.match(/\{(.*?)}/g);if(h)for(let p=0;p<h.length;p++)c=c.replaceAll(h[p],o[h[p].slice(1,-1)])}catch{}let d=this.label3d.create("","scatter-label scatter-"+t.id,t.follow);return d.init(`<div class="wrap">
32661
32661
  <span class="label">${c}</span>
32662
32662
  <img src="${t.map}" style="width:${t.width}px; height:${t.height}px;" >
32663
- </div>`,u),this.label3d.setLabelStyle(d,.08/this.scale,"x"),t.rotation&&(d.rotation.x=t.rotation[0]*(Math.PI/180),d.rotation.y=t.rotation[1]*(Math.PI/180),d.rotation.z=t.rotation[2]*(Math.PI/180)),d.name="scatter-"+t.id,d.setParent(this.scatterLabelGroup),d.userData.adcode=o.adcode,d.userData.scale=o,d.userData.name=o.name,d.userData.labelShow=t.label.show,d.userData.value=o.value,d.userData.position=[u.x,u.y,u.z],d};r.map((o,l)=>{let[u,c]=this.geoProjection([o.lng,o.lat]),d=a(o,l,new ir(u,-c,this.depth/this.scale));this.allScatterLabel.push(d)}),this.setScatterLabelStyle(t.label,t.id),this.mainSceneGroup.add(this.scatterLabelGroup),this.scatterLabelGroup.scale.set(this.scale,this.scale,this.scale),this.option.scene.defaultMapAdcode!==1e5&&this.setScatterScale()}}catch{}}setScatterLabelStyle(t,r){t&&(Qo.installFont(t.fontFamily),this.allScatterLabel.map((n,s)=>{if(n.name==="scatter-"+r){const a=n.element.querySelector(".scatter-label.scatter-"+r+" .wrap");t.show?a.style.opacity=1:a.style.opacity=0;const o=n.element.querySelector(".scatter-label.scatter-"+r+" .label");t.show?o.innerText=o.innerText:o.innerText="",o.style.left=t.left+"px",o.style.top=t.top+"px",o.style.fontSize=t.fontSize+"px",o.style.fontFamily=t.fontFamily,o.style.color=t.color,o.style.backgroundColor=t.bg.color,o.style.padding=`${t.bg.paddingW}px ${t.bg.paddingH}px`,o.style.borderRadius=t.bg.borderRadius+"px",o.style.borderWidth=t.bg.borderWidth+"px",o.style.borderColor=t.bg.borderColor,o.style.borderStyle=t.bg.borderStyle}}))}setScatterScale(){const t=this.boundBox;this.scatterLabelGroup.position.x=-t.center.x,this.scatterLabelGroup.position.y=-t.center.y}createScatterTimeLine(){const t=ju.timeline();this.allScatterLabel.map(r=>{const n=r.element.querySelector(".scatter-label .wrap");n.style.opacity=0}),this.allScatterLabel.map((r,n)=>{if(r.userData.labelShow){const s=r.element.querySelector(".scatter-label .wrap");t.add(ju.to(s,{duration:.5,delay:.05*n,opacity:1,ease:"circ.out"}),"scatter")}})}cleanAllScatter(){for(;this.scatterLabelGroup.children.length;)this.scatterLabelGroup.remove(this.scatterLabelGroup.children[0]);this.allScatterLabel=[]}setScatterLabelMove(t,r="up"){this.allScatterLabel.map(n=>{n.userData.adcode===t&&ju.to(n.position,{duration:.3,z:r==="up"?n.userData.position[2]+this.depth/2+.3:n.userData.position[2]})})}createFlyLine(t,r,n=!0,s=!1){if(!(!n&&(r=this.datasource[t._sourceId],!r))&&(n||(this.flyLineGroup.remove(...this.flyLineGroup.children.filter(a=>a.name==="flyline-"+t.id)),this.flyLineLabelGroup.remove(...this.flyLineLabelGroup.children.filter(a=>a.name==="flyline-"+t.id)),this.allFlyLine=this.allFlyLine.filter(a=>a.name!=="flyline-"+t.id),this.allFlyLineLabel=this.allFlyLineLabel.filter(a=>a.name!=="flyline-"+t.id)),r&&Ht.isArray(r)&&r.length>0))try{if(this.datasource[t._sourceId]=r,!t.isHide){const a=new vy().load(t.texture);a.wrapS=a.wrapT=py,a.generateMipmaps=!1,a.magFilter=hm,a.repeat.set(.5,1);let o=new H5n(this,{data:r,option:t,texture:a,radius:t.radius/this.scale,speed:t.speed,middleHeight:t.middleHeight/this.scale,segments:t.segments,radialSegments:t.radialSegments,allFlyLine:this.allFlyLine,material:new hf({map:a,alphaMap:a,color:new Ts(t.material.color),transparent:!0,opacity:s?0:t.material.opacity,fog:!1,depthTest:!1,blending:eg})});o.instance.name="flyline-"+t.id,o.instance.position.z=(this.depth+.4)/this.scale,this.flyLineGroup.add(o.instance),this.setFlylineLabelStyle(t.label,t.id),this.flyLineGroup.scale.set(this.scale,this.scale,this.scale),this.flyLineLabelGroup.scale.set(this.scale,this.scale,this.scale),this.mainSceneGroup.add(this.flyLineGroup),this.mainSceneGroup.add(this.flyLineLabelGroup),this.option.scene.defaultMapAdcode!==1e5&&this.setFlylineScale()}}catch{}}setFlylineLabelStyle(t,r){t&&(Qo.installFont(t.fontFamily),this.allFlyLineLabel.map((n,s)=>{if(n.name==="flyline-"+r){const a=n.element.querySelector(".flyline-label.flyline-"+r+" .wrap");t.show?a.style.opacity=1:a.style.opacity=0,a&&(a.style.backgroundColor=t.bg.color,a.style.padding=`${t.bg.paddingW}px ${t.bg.paddingH}px`,a.style.borderRadius=t.bg.borderRadius+"px",a.style.borderWidth=t.bg.borderWidth+"px",a.style.borderColor=t.bg.borderColor,a.style.borderStyle=t.bg.borderStyle);const o=n.element.querySelector(".flyline-label.flyline-"+r+" .label");t.show?o.innerText=o.innerText:o.innerText="",o.style.fontSize=t.fontSize+"px",o.style.fontFamily=t.fontFamily,o.style.color=t.color}}))}setFlylineScale(){const t=this.boundBox;this.flyLineGroup.position.x=-t.center.x,this.flyLineGroup.position.y=-t.center.y,this.flyLineLabelGroup.position.x=-t.center.x,this.flyLineLabelGroup.position.y=-t.center.y}cleanAllFlyLine(){for(;this.flyLineGroup.children.length;)this.flyLineGroup.remove(this.flyLineGroup.children[0]);for(;this.flyLineLabelGroup.children.length;)this.flyLineLabelGroup.remove(this.flyLineLabelGroup.children[0]);this.allFlyLine=[],this.allFlyLineLabel=[]}createFlyLineTimeLine(){const t=ju.timeline();this.allFlyLine.map((r,n)=>{t.add(ju.to(r.material,{duration:.2,opacity:1,ease:"circ.out"}),"flyLine")}),this.allFlyLineLabel.map(r=>{const n=r.element.querySelector(".flyline-label .wrap");n.style.opacity=0}),this.allFlyLineLabel.map((r,n)=>{const s=r.element.querySelector(".flyline-label .wrap");t.add(ju.to(s,{duration:.5,delay:.05*n,opacity:1,ease:"circ.out"}),"flyline")})}createRegionalLevel(t,r,n=!0,s=!1){try{if(!n&&(r=this.datasource[t._sourceId],!r))return;n||this.areaMapGroup.children[0].children.forEach(a=>{a.remove(...a.children.filter(o=>o.name==="shapeGroup-"+t.id))}),r&&Ht.isArray(r)&&r.length>0&&(this.datasource[t._sourceId]=r,t.isHide||XAr(this.mapJsonData).features.forEach((o,l)=>{const{name:u,adcode:c,parent:d}=o.properties,h=new lc;h.name="shapeGroup-"+t.id,o.geometry.coordinates.forEach(m=>{m.forEach((x,v)=>{const y=new q2e;for(let C=0;C<x.length;C++){if(!x[C][0]||!x[C][1])return!1;const[T,I]=this.geoProjection(x[C]);C===0&&y.moveTo(T,-I),y.lineTo(T,-I)}const E=r.find(C=>C.name===u);let S=t.defaultColor;if(E)for(let C=0;C<t.rules.length;C++){const T=t.rules[C];E.value>=T.min&&E.value<=T.max&&(S=T.color||t.defaultColor)}try{const C=new ett(Ht.cloneDeep(y)),T=new Hu(C,new j8({color:new Ts(S),transparent:!0,opacity:s?0:t.opacity}));T.userData.depth=this.depth,T.userData.name=u,T.userData.adcode=c,T.userData.parent=d,T.userData.opacity=t.opacity,T.renderOrder=20,T.name="shapeArea",this.allRegionalLevel.push(T),h.add(T)}catch{}})}),h.position.set(0,0,this.depth+.2);const p=this.areaMapGroup.getObjectByName("meshGroup"+l);if(p&&p.children.length>1){const m=this.areaMapGroup.getObjectByName("meshGroup"+l);m&&m.add(h)}}))}catch{}}createAllRegionalLevel(){this.areaMapGroup.children[0].children.forEach(t=>{t.remove(...t.children.filter(r=>r.name.includes("shapeGroup-")))})}createRegionalLevelTimeLine(){const t=ju.timeline();this.allRegionalLevel.map((r,n)=>{t.add(ju.to(r.material,{duration:.5,delay:.002*n,opacity:r.userData.opacity,ease:"circ.out"}),"RegionalLevel")})}handleMapMousedown(t){if(t.preventDefault(),this.isMousedown=!0,!this.isMapAnimationSuccess)return;const r=new g_r,n=new Tn,s=this.renderer.instance.domElement.getBoundingClientRect();n.x=(t.clientX-s.left)/s.width*2-1,n.y=-((t.clientY-s.top)/s.height)*2+1,r.setFromCamera(n,this.camera.instance);let a=r.intersectObjects(this.scene.children,!0);a=a.filter(o=>o.object.name.includes("scatter-")||o.object.name.includes("bar-")||o.object.name.includes("flyline-")||o.object.name.includes("mapArea-")),a.length>0&&a[0]?this.clickMapObj=a[0]:this.clickMapObj=null}handleMapMouseup(t){if(t.preventDefault(),this.isMousedown=!1,!!this.isMapAnimationSuccess&&this.clickMapObj){if(this.clickMapObj.object.name.includes("scatter-")&&this.clickMapObj.object.visible&&this.onCallBack.onClickScatter(this.clickMapObj.object.userData),this.clickMapObj.object.name.includes("bar-")&&this.clickMapObj.object.visible&&this.onCallBack.onClickBar(this.clickMapObj.object.userData),this.clickMapObj.object.name.includes("flyline-")&&this.clickMapObj.object.visible&&this.onCallBack.onClickFlyline(this.clickMapObj.object.userData),this.clickMapObj.object.name.includes("mapArea-")){let r=this.clickMapObj.object.userData;this.onCallBack.onLoadChild(r)}this.clickMapObj=null}}handleHoverAreaMap(t){if(t.preventDefault(),this.clickMapObj=null,!this.isMapAnimationSuccess)return;if(this.isMousedown){this.hoverAreaMap&&this.reset(this.hoverAreaMap.parent);return}this.mouse.x=(t.clientX-this.clientRect.left)/this.clientRect.width*2-1,this.mouse.y=-((t.clientY-this.clientRect.top)/this.clientRect.height)*2+1,this.raycasterMousemove.setFromCamera(this.mouse,this.camera.instance);let r=this.raycasterMousemove.intersectObjects(this.areaMapGroup.children,!0);if(r=r.filter(n=>n.object.name.includes("mapArea-")),r.length>0&&r[0]&&r[0].object.name.includes("mapArea-")){if(this.hoverAreaMap===null){this.move(r[0].object.parent,r[0].object);return}this.hoverAreaMap.name!==r[0].object.name&&(this.reset(this.hoverAreaMap.parent),this.move(r[0].object.parent,r[0].object))}else this.hoverAreaMap&&this.reset(this.hoverAreaMap.parent)}move(t,r){try{const n=this.areaMapTopMaterial.clone();n.opacity=this.option.map.topMaterial.hoverOpacity||1,t.children[0].material[0]=n;const s=t.getObjectByName("lineGroup");if(s&&s.children&&s.children[0]){const a=this.provinceLineMaterial.clone();a.color=new Ts(this.option.map.hoverLineColor||this.option.map.lineColor||"#000000"),s.children[0].material=a}}catch{}ju.to(t.scale,{duration:.3,z:this.option.map.hoverDepth||1.5}),this.setAreaLabelMove(t.userData.adcode),this.setBarMove(t.userData.adcode),this.setBarGuangQuanMove(t.userData.adcode),this.setBarLabelMove(t.userData.adcode),this.setScatterLabelMove(t.userData.adcode),this.onCallBack.onAreaMouseover(r.userData),this.hoverAreaMap=r}reset(t){try{t.children[0].material[0]=this.areaMapTopMaterial;const r=t.getObjectByName("lineGroup");r&&r.children&&r.children[0]&&(r.children[0].material=this.provinceLineMaterial)}catch{}ju.to(t.scale,{duration:.3,z:1}),this.setAreaLabelMove(t.userData.adcode,"down"),this.setBarMove(t.userData.adcode,"down"),this.setBarGuangQuanMove(t.userData.adcode,"down"),this.setBarLabelMove(t.userData.adcode,"down"),this.setScatterLabelMove(t.userData.adcode,"down"),this.onCallBack.onAreaMouseout(this.hoverAreaMap.userData),this.hoverAreaMap=null}update(){super.update()}destroy(){try{super.destroy(),this.canvas.removeEventListener("mousedown",this.handleMapMousedown.bind(this),!1),this.canvas.removeEventListener("mouseup",this.handleMapMouseup.bind(this),!1),this.canvas.removeEventListener("mousemove",this.handleHoverAreaMap.bind(this),!1),this.label3d&&this.label3d.destroy(),this.groundMirror&&this.groundMirror.dispose(),this.toastLoading&&this.toastLoading.destroy(),this.childMap&&this.childMap.destroy()}catch{}}}const d9n=(i,e,t,r,n)=>{Ai(()=>Ht.cloneDeep(i.option.map.depth),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&n()}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.scene.defaultMapAdcode),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&n()}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.scene.translateX),(s,a)=>{try{if(!Ht.isEqual(s,a)&&e.value){const o=i.option.scene.translateX||0,l=i.option.scene.translateY||0,u=i.option.scene.translateZ||0,c=i.option.camera.position.x+o,d=i.option.camera.position.y+l,h=i.option.camera.position.z+u;e.value.camera.instance.position.set(c,d,h);const p=i.option.camera.target;if(p){const m=p[0]+o,x=p[1]+l,v=p[2]+u;e.value.camera.controls.target.set(m,x,v)}}}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.scene.translateY),(s,a)=>{try{if(!Ht.isEqual(s,a)&&e.value){const o=i.option.scene.translateX||0,l=i.option.scene.translateY||0,u=i.option.scene.translateZ||0,c=i.option.camera.position.x+o,d=i.option.camera.position.y+l,h=i.option.camera.position.z+u;e.value.camera.instance.position.set(c,d,h);const p=i.option.camera.target;if(p){const m=p[0]+o,x=p[1]+l,v=p[2]+u;e.value.camera.controls.target.set(m,x,v)}}}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.scene.translateZ),(s,a)=>{try{if(!Ht.isEqual(s,a)&&e.value){const o=i.option.scene.translateX||0,l=i.option.scene.translateY||0,u=i.option.scene.translateZ||0,c=i.option.camera.position.x+o,d=i.option.camera.position.y+l,h=i.option.camera.position.z+u;e.value.camera.instance.position.set(c,d,h);const p=i.option.camera.target;if(p){const m=p[0]+o,x=p[1]+l,v=p[2]+u;e.value.camera.controls.target.set(m,x,v)}}}catch{}},{deep:!0}),i.option.orbitControls&&Ai(()=>Ht.cloneDeep(i.option.orbitControls),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&e.value.camera.setControls(s)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.scene.z),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&(e.value.scene.position.z=s)}catch{}},{deep:!0}),i.option.map.backgroundImg&&(Ai(()=>Ht.cloneDeep(i.option.map.backgroundImg.show),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&e.value.createMapBackgroundImg(!1)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.map.backgroundImg.src),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&e.value.mapBackgroundImgMaterial&&e.value.createMapBackgroundImg(!1)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.map.backgroundImg.alphaMap),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&e.value.mapBackgroundImgMaterial&&e.value.createMapBackgroundImg(!1)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.map.backgroundImg.color),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&e.value.mapBackgroundImgMaterial&&(e.value.mapBackgroundImgMaterial.color=new Ts(s))}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.map.backgroundImg.opacity),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&e.value.mapBackgroundImgMaterial&&(e.value.mapBackgroundImgMaterial.opacity=s)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.map.backgroundImg.rotation),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&e.value.mapBackgroundImgMesh&&(e.value.mapBackgroundImgMesh.rotation.x=s[0]*(Math.PI/180),e.value.mapBackgroundImgMesh.rotation.y=s[1]*(Math.PI/180),e.value.mapBackgroundImgMesh.rotation.z=s[2]*(Math.PI/180))}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.map.backgroundImg.position),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&e.value.mapBackgroundImgMesh&&(e.value.mapBackgroundImgMesh.position.x=s[0],e.value.mapBackgroundImgMesh.position.y=s[1],e.value.mapBackgroundImgMesh.position.z=s[2])}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.map.backgroundImg.scale),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&e.value.mapBackgroundImgMesh&&(e.value.mapBackgroundImgMesh.scale.x=s[0],e.value.mapBackgroundImgMesh.scale.y=s[1],e.value.mapBackgroundImgMesh.scale.z=s[2])}catch{}},{deep:!0})),Ai(()=>Ht.cloneDeep(i.option.scene.background),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&(e.value.scene.background=new Ts(s))}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.scene.isBackground),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&(s?e.value.scene.background=new Ts(i.option.scene.background):e.value.scene.background=null)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.map.lineColor),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&(e.value.provinceLineMaterial.color=new Ts(s))}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.map.mirrorShow),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&(e.value.groundMirror.visible=s)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.map.arealabel),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&e.value.setAreaLabelStyle(s)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.map.titleLabel),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&e.value.setMapTitleLabelStyle(s)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.map.topMaterial),async(s,a)=>{try{if(!Ht.isEqual(s,a)&&e.value){let[o,l]=e.value.createProvinceMaterial(i.option.map.topMaterial,i.option.map.sideMaterial);e.value.areaMapTopMaterial=o,e.value.areaMapSideMaterial=l,e.value.provinceMesh.mapGroup.traverse(u=>{u.isMesh&&(u.material[0]=o,u.material[1]=l)})}}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.map.sideMaterial),(s,a)=>{try{if(!Ht.isEqual(s,a)&&e.value){let[o,l]=e.value.createProvinceMaterial(i.option.map.topMaterial,i.option.map.sideMaterial);e.value.areaMapTopMaterial=o,e.value.areaMapSideMaterial=l,e.value.provinceMesh.mapGroup.traverse(u=>{u.isMesh&&(u.material[0]=o,u.material[1]=l)})}}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.map.storkeAnimation),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&e.value.createAreaMapStorke(s,!1)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.particle),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&e6r(e.value,s)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.floor.gaoguang),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&(e.value.gaoguangMesh.visible=s.show,e.value.gaoguangMesh.material.color=new Ts(s.color))}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.floor.quan),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&(e.value.quan.visible=s.show,e.value.quan.material.color=new Ts(s.color))}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.floor.gridRipple),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&$Ar(e.value,s)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.floor.rotateBorder),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&ZAr(e.value,s,!1)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.light.ambientLight),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&r6r(e.value,s)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.light.directionalLight),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&i6r(e.value,s,i.option.debugger)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.light.pointLight1),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&n6r(e.value,s,i.option.debugger)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.light.pointLight2),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&s6r(e.value,s,i.option.debugger)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.debugger),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&(a6r(e.value,i.option.light,i.option.debugger),e.value.mapBoxHelper.visible=i.option.debugger,e.value.axesHelper.visible=i.option.debugger)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.camera.position),(s,a)=>{try{if(!Ht.isEqual(s,a)&&e.value){const o=i.option.scene.translateX||0,l=i.option.scene.translateY||0,u=i.option.scene.translateZ||0,c=i.option.camera.position.x+o,d=i.option.camera.position.y+l,h=i.option.camera.position.z+u;e.value.camera.instance.position.set(c,d,h)}}catch{}},{deep:!0}),i.option.camera.target&&Ai(()=>Ht.cloneDeep(i.option.camera.target),(s,a)=>{try{if(!Ht.isEqual(s,a)&&e.value){const o=i.option.scene.translateX||0,l=i.option.scene.translateY||0,u=i.option.scene.translateZ||0,c=i.option.camera.target;if(c){const d=c[0]+o,h=c[1]+l,p=c[2]+u;e.value.camera.controls.target.set(d,h,p)}}}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.widgets.filter(s=>s.type==="bar")),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&s.length===a.length&&s.forEach(o=>{e.value.createBar(o,void 0,!1)})}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.widgets.filter(s=>s.type==="scatter")),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&s.length===a.length&&s.forEach(o=>{e.value.createScatter(o,void 0,!1)})}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.widgets.filter(s=>s.type==="flyline")),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&s.length===a.length&&s.forEach(o=>{e.value.createFlyLine(o,void 0,!1)})}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.widgets.filter(s=>s.type==="regionalLevel")),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&s.length===a.length&&s.forEach(o=>{e.value.createRegionalLevel(o,void 0,!1)})}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.sources),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&r(!1)}catch{}},{deep:!0})},o6r="2.0.0",h9n=i=>{const e=Ht.cloneDeep(i);if(e.version!==o6r){e.version=o6r;const t={};return e.backButton&&(t.backButton={show:e.backButton,left:e.backButtonLeft,bottom:e.backButtonBottom,text:{color:e.backButtonCss.color,fontSize:e.backButtonCss.fontSize,fontStyle:e.backButtonCss.fontStyle,fontWeight:e.backButtonCss.fontWeight,fontFamily:e.backButtonCss.fontFamily},border:{borderRadius:e.backButtonCss.borderRadius,borderWidth:e.backButtonCss.borderWidth,borderColor:e.backButtonCss.borderColor,borderStyle:e.backButtonCss.borderStyle},background:{backgroundColor:e.backButtonCss.backgroundColor,backgroundImage:e.backButtonCss.backgroundImage,backgroundSize:e.backButtonCss.backgroundSize}}),{...e,...t}}return i},f9n={style:{width:"100%",height:"100%"}},p9n={class:"value"},m9n=["onClick"],g9n={key:3,class:"fps"},x9n=ar({...ar({name:"ShjMap3d"}),props:{option:{},sources:{},useEvents:{}},emits:["on-loaded","on-animated","on-drill-down","on-area-mouseover","on-area-mouseout","on-area-click","on-bar-click","on-scatter-click","on-flyline-click","on-return","on-data-change"],setup(i,{expose:e,emit:t}){const r=fi(()=>h9n(i.option)),n=t,s=Wt(),a=Wt(!1),o=Wt(!1),l="zerov-map3d-scene",u=Wt(),c=new N5n,d=Wt(!1),h=(j=!0)=>{s.value.cleanAllBar(),s.value.cleanAllScatter(),s.value.cleanAllFlyLine(),s.value.createAllRegionalLevel(),i.sources&&i.sources.length>0&&r.value.widgets.forEach((Y,X)=>{pl.parse({sources:[i.sources[X]],callback:q=>{try{Y&&Y.type==="bar"&&s.value.createBar(Y,q.data[0].data,!0,j),Y&&Y.type==="scatter"&&s.value.createScatter(Y,q.data[0].data,!0,j),Y&&Y.type==="flyline"&&s.value.createFlyLine(Y,q.data[0].data,!0,j),Y&&Y.type==="regionalLevel"&&s.value.createRegionalLevel(Y,q.data[0].data,!0,j),j&&(s.value.createBarTimeLine(),s.value.createScatterTimeLine(),s.value.createFlyLineTimeLine(),s.value.createRegionalLevelTimeLine()),n("on-data-change",q),bi.parseEvents(i.useEvents,"on-data-change",q)}catch{n("on-data-change",null),bi.parseEvents(i.useEvents,"on-data-change",null)}}})})},p=()=>{try{u.value&&document.getElementById(l)&&u.value.removeChild(document.getElementById(l));const j=document.createElement("canvas");j.id=l,j.className="zerov-map-3d",j.style.width="100%",j.style.height="100%",u.value.appendChild(j)}catch{}},m=j=>(a.value=!1,o.value=!1,s.value&&(s.value.destroy(),s.value=null),p(),new c9n(document.getElementById(l),{geoProjectionCenter:[108.55,36.32]},j,{onAreaMouseover:X=>{n("on-area-mouseover",X),bi.parseEvents(i.useEvents,"on-area-mouseover",X)},onAreaMouseout:X=>{n("on-area-mouseout",X),bi.parseEvents(i.useEvents,"on-area-mouseout",X)},onLoadChild:X=>{if(n("on-area-click",X),bi.parseEvents(i.useEvents,"on-area-click",X),X.adcode!==c.present&&j.scene.isDrilling&&j.scene.defaultMapAdcode!==1){n("on-drill-down",X),bi.parseEvents(i.useEvents,"on-drill-down",X);const q=Ht.cloneDeep(j);q.scene.defaultMapAdcode=X.adcode,s.value=m(q),c.push(X.adcode),c.past.length<=0?d.value=!1:d.value=!0}},onMapSuccess:()=>{a.value=!0,n("on-loaded"),bi.parseEvents(i.useEvents,"on-loaded",null)},onMapAnimationSuccess:()=>{h(),o.value=!0,n("on-animated"),bi.parseEvents(i.useEvents,"on-animated",null)},onClickBar:X=>{n("on-bar-click",X),bi.parseEvents(i.useEvents,"on-bar-click",X)},onClickScatter:X=>{n("on-scatter-click",X),bi.parseEvents(i.useEvents,"on-scatter-click",X)},onClickFlyline:X=>{n("on-flyline-click",X),bi.parseEvents(i.useEvents,"on-flyline-click",X)}})),x=()=>{if(!u.value)return;const{clientWidth:j,clientHeight:Y}=u.value;!j||!Y||(s.value=m(r.value),c.push(r.value.scene.defaultMapAdcode),d9n({option:r.value,sources:i.sources,useEvents:i.useEvents},s,m,h,y))};_a(()=>{Go(()=>{x()}),window.addEventListener("resize",()=>{x()})}),f1(()=>{s.value&&s.value.destroy()});const v=()=>{n("on-return",{parentAdcode:c.past[c.past.length-1],adcode:c.present}),bi.parseEvents(i.useEvents,"on-return",{parentAdcode:c.past[c.past.length-1],adcode:c.present}),c.undo();const j=Ht.cloneDeep(r.value);j.scene.defaultMapAdcode=c.present,s.value=m(j),c.past.length<=0?d.value=!1:d.value=!0},y=()=>{c.empty(),c.push(r.value.scene.defaultMapAdcode),s.value=m(r.value),c.past.length<=0?d.value=!1:d.value=!0},E=(j,Y,X)=>{ju.timeline().add(ju.to(s.value.camera.instance.position,{duration:2,delay:0,x:j,y:Y,z:X,ease:"circ.out"}))};e({refresh:()=>h(),refreshView:()=>h(),refreshData:()=>h(),goBack:()=>v(),setCameraPosition:(j,Y,X)=>E(j,Y,X)});const S=Aai(),C=Wt(),T=j=>{if(C.value&&j){const Y=`url(${j.backgroundImage})`;return{...Qo.json2cssObject(j.background),...Qo.json2cssObject(j.border),...Qo.json2cssObject(j.text),left:r.value.backButton.left+"%",bottom:r.value.backButton.bottom+"%","background-image":Y}}return{}},I=Wt(Ht.cloneDeep(r.value.widgets)),B=fi(()=>{try{const j=I.value.filter(Y=>Y.type==="regionalLevel");return j.length>0?j[0].isHide?null:j[0]:null}catch{return null}});Ai(()=>Ht.cloneDeep(r.value.widgets),(j,Y)=>{try{!Ht.isEqual(j,Y)&&s.value&&(I.value=Ht.cloneDeep(r.value.widgets))}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(I.value.filter(j=>j.type==="bar")),(j,Y)=>{try{!Ht.isEqual(j,Y)&&s.value&&j.length===Y.length&&j.forEach(X=>{s.value.createBar(X,void 0,!1)})}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(I.value.filter(j=>j.type==="scatter")),(j,Y)=>{try{!Ht.isEqual(j,Y)&&s.value&&j.length===Y.length&&j.forEach(X=>{s.value.createScatter(X,void 0,!1)})}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(I.value.filter(j=>j.type==="flyline")),(j,Y)=>{try{!Ht.isEqual(j,Y)&&s.value&&j.length===Y.length&&j.forEach(X=>{s.value.createFlyLine(X,void 0,!1)})}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(I.value.filter(j=>j.type==="regionalLevel")),(j,Y)=>{try{!Ht.isEqual(j,Y)&&s.value&&j.length===Y.length&&j.forEach(X=>{s.value.createRegionalLevel(X,void 0,!1)})}catch{}},{deep:!0});const O=j=>{try{j.isHide===void 0?j.isHide=!0:j.isHide=!j.isHide}catch{}},L=()=>{try{const j=I.value.every(Y=>!Y.isHide);I.value.forEach(Y=>Y.isHide=j)}catch{}},k=j=>{const Y=`url(${j.backgroundImage})`,X=`url(${U(j.hover.backgroundImage)})`,q=`url(${U(j.active.backgroundImage)})`;return{...Qo.json2cssObject(j),...Qo.json2cssObject(j.hover,"hover"),...Qo.json2cssObject(j.active,"active"),"background-image":Y,"--hover-background-image":X,"--active-background-image":q}},U=j=>!j.startsWith("http")&&!j.startsWith("//")?"../"+j:j;return(j,Y)=>(Gt(),Wr("div",f9n,[tn("div",{ref_key:"map3dWrapRef",ref:u,class:Xa(["map-3d-wrap",{show:a.value}])},[o.value&&d.value&&r.value.backButton.show?(Gt(),Wr("div",{key:0,ref_key:"buttonRef",ref:C,class:"return-btn",style:Va(T(r.value.backButton)),onClick:v}," 返回上一级 ",4)):qi("",!0),B.value?(Gt(),Wr("div",{key:1,class:"regional-level",style:Va({left:B.value.labelStyle.left+"%",top:B.value.labelStyle.top+"%",flexDirection:B.value.labelStyle.direction,gap:B.value.labelStyle.gap+"px",fontSize:B.value.labelStyle.fontSize+"px",fontFamily:B.value.labelStyle.fontFamily,fontStyle:B.value.labelStyle.fontStyle,color:B.value.labelStyle.color,"--color-width":B.value.labelStyle.colorStyle.width+"px","--color-height":B.value.labelStyle.colorStyle.height+"px","--color-borderRadius":B.value.labelStyle.colorStyle.borderRadius+"px"})},[(Gt(!0),Wr(ia,null,ou(B.value.rules,(X,q)=>(Gt(),Wr("div",{key:q,class:"item"},[tn("div",{class:"color",style:Va({backgroundColor:X.color})},null,4),tn("span",p9n,jd(X.label),1)]))),128))],4)):qi("",!0),r.value.widgets.length>0&&r.value.widgetControlStyle&&r.value.widgetControlStyle.show?(Gt(),Wr("div",{key:2,class:"widget-control",style:Va({left:r.value.widgetControlStyle.left+"%",top:r.value.widgetControlStyle.top+"%",flexDirection:r.value.widgetControlStyle.direction,gap:r.value.widgetControlStyle.gap+"px","--widget-width":r.value.widgetControlStyle.width+"px","--widget-height":r.value.widgetControlStyle.height+"px"})},[tn("div",{class:Xa(["control-button",{active:I.value.every(X=>!X.isHide)}]),style:Va(k(r.value.widgetControlStyle)),onClick:L},jd(I.value.every(X=>!X.isHide)?"隐藏":"显示")+"/全部 ",7),(Gt(!0),Wr(ia,null,ou(I.value,X=>(Gt(),Wr("div",{key:X.id,class:Xa(["control-button",{active:!X.isHide}]),style:Va(k(r.value.widgetControlStyle)),onClick:q=>O(X)},jd(X.name||"-"),15,m9n))),128))],4)):qi("",!0),r.value.debugger?(Gt(),Wr("div",g9n,"fps:"+jd(kr(S)),1)):qi("",!0)],2)]))}}),l6r=Ji(Cc(x9n,[["__scopeId","data-v-c98e3112"]])),u6r="2.0.0",v9n=i=>{const e=Ht.cloneDeep(i);return e.version!==u6r?{base:{mode:"iframe-webscoket",iframeUrl:e.iframeUrl,webSocketUrl:e.webSocketUrl},version:u6r}:i},y9n={class:"iframe-webscoket"},D9n=["src"],E9n={key:1},b9n=ar({...ar({name:"ShjUeIframe"}),props:{option:{},sources:{},useEvents:{}},emits:["ue-scoket-on-message"],setup(i,{emit:e}){const t=fi(()=>v9n(i.option)),r=e,n=3e3,s=1/0;let a=0,o;const l=()=>{window.SHJSceneUEIframeWebscoket&&(window.SHJSceneUEIframeWebscoket.onclose=null,window.SHJSceneUEIframeWebscoket.close()),window.SHJSceneUEIframeWebscoket=new WebSocket(t.value.base.webSocketUrl),window.SHJSceneUEIframeWebscoket.onmessage=u=>{try{const c=JSON.parse(u.data);if(c.type==="ping")return;if(!c.data)throw new Error("数据格式异常");r("ue-scoket-on-message",c.data),bi.parseEvents(i.useEvents,"ue-scoket-on-message",c.data)}catch{}},window.SHJSceneUEIframeWebscoket.onopen=()=>{a=0,clearTimeout(o)},window.SHJSceneUEIframeWebscoket.onerror=()=>{},window.SHJSceneUEIframeWebscoket.onclose=()=>{const u=n*Math.pow(2,a);o=setTimeout(()=>{a<s&&(a++,l())},u)}};return _a(()=>{if(t.value.base.webSocketUrl)try{l()}catch{}}),f1(()=>{window.SHJSceneUEIframeWebscoket&&window.SHJSceneUEIframeWebscoket.close()}),(u,c)=>(Gt(),Wr("div",y9n,[t.value.base.iframeUrl?(Gt(),Wr("iframe",{key:0,src:t.value.base.iframeUrl,sandbox:"allow-scripts allow-same-origin",style:{width:"100%",height:"100%",border:"0"},frameborder:"0"},null,8,D9n)):(Gt(),Wr("span",E9n," 请先连接到UE服务地址 "))]))}}),c6r=Ji(Cc(b9n,[["__scopeId","data-v-45f7470f"]])),d6r="2.0.0",_9n=i=>{const e=Ht.cloneDeep(i);return e.version!==d6r?(e.version=d6r,e):i},A9n={class:"shj-for-ue"},S9n=ar({...ar({name:"ShjUeShj"}),props:{option:{},sources:{},useEvents:{}},emits:["ue-scene-on-message"],setup(i,{emit:e}){fi(()=>_9n(i.option));const t=e;return _a(()=>{i.useEvents.length<=0||i.useEvents.forEach(r=>{r&&r.receivingMethod&&(window.ue.interface[r.receivingMethod]=n=>{try{if(!JSON.parse(n).data)throw new Error("");const s=i.useEvents.filter(a=>a.receivingMethod===r.receivingMethod);t("ue-scene-on-message",JSON.parse(n).data),bi.parseEvents(s,"ue-scene-on-message",JSON.parse(n).data)}catch{}})})}),(r,n)=>(Gt(),Wr("div",A9n))}}),h6r=Ji(Cc(S9n,[["__scopeId","data-v-73b53cd3"]])),f6r="2.0.0",C9n=i=>{const e=Ht.cloneDeep(i);return e.version!==f6r?{base:{mode:"iframe-render",iframeUrl:e.iframeUrl},version:f6r}:i},T9n={class:"unity-iframe"},w9n=["src"],F9n={key:1},R9n=ar({...ar({name:"ShjUnityIframe"}),props:{option:{},sources:{},useEvents:{}},emits:["unity-scene-on-message"],setup(i,{emit:e}){const t=fi(()=>C9n(i.option)),r=e,n=Wt();_a(()=>{window.SHJSceneUnityIframeInstance||(window.SHJSceneUnityIframeInstance={}),window.SHJSceneUnityIframeInstance.url=t.value.base.iframeUrl,window.SHJSceneUnityIframeInstance.ref=n.value,window.addEventListener("message",s,!1)}),f1(()=>{window.SHJSceneUnityIframeInstance=null,window.removeEventListener("message",s,!1)});const s=a=>{r("unity-scene-on-message",a.data),bi.parseEvents(i.useEvents,"unity-scene-on-message",a.data)};return(a,o)=>(Gt(),Wr("div",T9n,[t.value.base.iframeUrl?(Gt(),Wr("iframe",{key:0,ref_key:"unityIframeRef",ref:n,src:t.value.base.iframeUrl,sandbox:"allow-scripts allow-same-origin",style:{width:"100%",height:"100%",border:"0"},frameborder:"0"},null,8,w9n)):(Gt(),Wr("span",F9n," 请先连接到Unity服务地址 "))]))}}),p6r=Ji(Cc(R9n,[["__scopeId","data-v-40a92f36"]])),m6r="2.0.0",P9n=i=>{const e=Ht.cloneDeep(i);return e.version!==m6r?{base:{mode:"webgl-render",url:e.url},version:m6r}:i},I9n={class:"unity-webgl"},M9n=["src"],B9n={key:1},O9n=ar({...ar({name:"ShjUnityWebgl"}),props:{option:{},sources:{},useEvents:{}},emits:["unity-scene-on-message"],setup(i,{emit:e}){const t=fi(()=>P9n(i.option)),r=e,n=Wt();_a(()=>{window.SHJSceneUnityIframeInstance||(window.SHJSceneUnityIframeInstance={}),window.SHJSceneUnityIframeInstance.url=t.value.base.url+"/index.html",window.SHJSceneUnityIframeInstance.ref=n.value,window.addEventListener("message",s,!1)}),f1(()=>{window.SHJSceneUnityIframeInstance=null,window.removeEventListener("message",s,!1)});const s=a=>{r("unity-scene-on-message",a.data),bi.parseEvents(i.useEvents,"unity-scene-on-message",a.data)};return(a,o)=>(Gt(),Wr("div",I9n,[t.value.base.url?(Gt(),Wr("iframe",{key:0,ref_key:"unityIframeRef",ref:n,src:`${t.value.base.url}/index.html`,sandbox:"allow-scripts allow-same-origin",style:{width:"100%",height:"100%",border:"0"},frameborder:"0"},null,8,M9n)):(Gt(),Wr("span",B9n," 请先连接到Unity服务地址 "))]))}}),g6r=Ji(Cc(O9n,[["__scopeId","data-v-444b8723"]])),L9n="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1716263282576'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='11645'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M991.232%20330.752c-13.824-6.144-27.648-6.144-34.304%200l-392.704%20208.384c-6.656%206.144-13.824%2018.944-13.824%2025.088v416.768c0%2012.8%202.56%2026.112%2016.384%2034.304%205.12%202.56%2011.264%203.584%2017.92%203.584%204.608%200%209.216%200.512%2020.48-6.144l386.048-208.384c12.8-5.632%2020.48-17.92%2020.48-31.744V361.984c0-13.312-8.192-26.112-20.48-31.232z%20m-55.296%20429.568l-310.272%20164.352v-334.848l310.272-164.352v334.848z%20m13.824-549.888L552.96%2016.896c-15.36-7.68-33.28-9.728-50.176-5.12-2.56%201.024-5.632%202.048-8.192%203.072L88.576%20213.504c-4.096%202.048-8.192%204.608-11.776%207.168-7.168%205.12-16.384%2011.264-16.384%2021.504%200%2012.8%206.656%2025.088%2020.48%2031.744l407.552%20211.968c3.072%201.536%206.656%202.56%209.728%203.584%205.632%201.536%2011.264%205.632%2016.384%205.632%206.144%200%2012.288%200%2018.432-4.608%203.072-2.048%206.144-3.584%209.216-5.632l406.528-210.944c17.408-7.68%2025.6-28.16%2017.92-45.568-2.56-7.68-9.216-14.336-16.896-17.92z%20m-434.176%20208.384l-337.92-170.496%20337.92-164.352%20337.92%20164.352-337.92%20170.496zM74.24%20330.752c-6.656-6.144-20.48-6.144-34.304%200-12.8%205.632-20.48%2017.92-20.48%2031.744v416.768c0%2012.8%206.656%2025.088%2020.48%2031.744l367.616%20198.656c11.776%206.656%2025.088%209.728%2038.912%209.728%206.656%200%2014.336%200.512%2020.48-6.144%2013.824-7.68%2020.48-17.92%2020.48-31.744v-416.768c0-13.824-8.192-26.112-20.48-31.744%200.512%200-392.704-202.24-392.704-202.24z%20m330.752%20593.92l-310.272-164.352V419.328L404.992%20583.68v340.992z'%20fill='%23ffffff'%20p-id='11646'%3e%3c/path%3e%3c/svg%3e",zxe="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1715236117111'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='8911'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M670.634667%20182.656a40.832%2040.832%200%200%201%200%2057.941333L397.99466699%20512l272.64000001%20271.402667a40.832%2040.832%200%200%201%200%2057.941333%2041.258667%2041.258667%200%200%201-58.197334%200l-301.738666-300.37333299a40.832%2040.832%200%200%201%200-57.94133402l301.738666-300.37333299a41.258667%2041.258667%200%200%201%2058.197334%200z'%20p-id='8912'%20fill='%23ffffff'%3e%3c/path%3e%3c/svg%3e",N9n="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1715236327428'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='9114'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M843.40179753%20545.14017975H180.59820247v-66.2803595h662.80359506v66.2803595z'%20fill='%23ffffff'%20p-id='9115'%3e%3c/path%3e%3cpath%20d='M478.85982025%20843.40179753V180.59820247h66.2803595v662.80359506h-66.2803595z'%20fill='%23ffffff'%20p-id='9116'%3e%3c/path%3e%3c/svg%3e",k9n="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1715236377345'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='9318'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M889.06160075%20549.70616007H134.93839925v-75.41232014h754.1232015v75.41232014z'%20p-id='9319'%20fill='%23ffffff'%3e%3c/path%3e%3c/svg%3e",V9n="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1715236409396'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='9521'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M300.95162432%20943.72479443c-55.520501%200-93.25901001-44.607964-93.25901-110.98881401l0-671.442362c0-66.38084999%2037.738509-110.98779001%2093.285616-110.98779%2021.22951001%200%2043.632753%206.590092%2066.121953%2019.57175402L895.63169532%20406.20865343c39.06471401%2022.529109%2061.195757%2055.01703401%2061.19575701%2090.87266%200%2035.81571699-22.01234%2068.263733-62.01849501%2091.36282401L368.05492832%20923.55542842C344.55777132%20937.14698143%20322.18113432%20943.72479443%20300.95162432%20943.72479443zM300.97823032%20104.61985142c-34.79445699%200-38.971593%2039.634696-38.971593%2056.673767l0%20671.442362c0%2017.040095%204.177136%2056.67478999%2038.944987%2056.67479001%2011.403724%200%2025.02802299-4.242627%2038.965453-12.292977l526.661931-335.11129101c23.16560599-13.406335%2035.933397-29.55615301%2035.933397-44.92518899%200-15.408945-12.72890601-31.598672-34.967396-44.435025L338.92140032%20116.31521743C325.99397333%20108.87578143%20312.39525732%20104.61985142%20300.97823032%20104.61985142z'%20fill='%23ffffff'%20p-id='9522'%3e%3c/path%3e%3cpath%20d='M570.88956632%20672.92522843c-4.52198999%200-8.924253-2.240017-11.510148-6.351662-3.99089402-6.338359-2.081405-14.719236%204.25593-18.723434l7.333012-4.615111c6.35166201-3.97861399%2014.731516-2.094708%2018.723434%204.270257%204.00522%206.337335%202.095731%2014.718213-4.25593%2018.72241001l-7.333012%204.61613399C575.86181132%20672.24779942%20573.35573432%20672.92522843%20570.88956632%20672.92522843z'%20fill='%23ffffff'%20p-id='9523'%3e%3c/path%3e%3cpath%20d='M371.97316732%20798.03464342c-4.520967%200-8.924253-2.240017-11.510148-6.351662-3.99089402-6.337335-2.081405-14.731516%204.269233-18.72241l152.386666-95.85923099c6.338359-3.964288%2014.719236-2.094708%2018.723434%204.270257%203.99089402%206.337335%202.082428%2014.731516-4.269233%2018.72343399l-152.386666%2095.85820799C376.94541232%20797.35926142%20374.43933532%20798.03464342%20371.97316732%20798.03464342z'%20fill='%23ffffff'%20p-id='9524'%3e%3c/path%3e%3c/svg%3e",U9n="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1715236437011'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='9730'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M458.64625344%20800.05792025c0%2063.6614775-51.61300594%20115.26776813-115.28119969%20115.26776811l-1.38434157%200c-63.66819281%200-115.28023969-51.60629062-115.28023968-115.26776811L226.70047344%20193.01317679c0-63.6614775%2051.61204687-115.26776813%20115.28023968-115.26776812l1.38434157%200c63.66819281%200%20115.28119969%2051.60629062%20115.28119968%20115.26776812L458.64625344%20800.05792025zM407.10327969%20193.01317679c0-35.19661689-28.53393375-63.72479437-63.73726594-63.72479437l-1.38434155%200c-35.20333219%200-63.73726594%2028.52721844-63.73726595%2063.72479437L278.24440625%20800.05792025c0%2035.19661689%2028.53393375%2063.72479437%2063.73726593%2063.72479436l1.38434157%200c35.20333219%200%2063.73726594-28.52721844%2063.73726594-63.72479436L407.10327969%20193.01317679z'%20fill='%23ffffff'%20p-id='9731'%3e%3c/path%3e%3cpath%20d='M316.90235655%20296.80520618c-7.12221094%200-12.88598345-5.76377249-12.88598342-12.88598344l0-51.54393281c0-7.12221094%205.76377249-12.88598345%2012.88598342-12.88598343%207.10973938%200%2012.88598345%205.76377249%2012.88598345%2012.88598343l0%2051.54393281C329.78738%20291.0414337%20324.01209594%20296.80520618%20316.90235655%20296.80520618z'%20fill='%23ffffff'%20p-id='9732'%3e%3c/path%3e%3cpath%20d='M316.90235655%20335.46219649c-7.12221094%200-12.88598345-5.76281251-12.88598342-12.88598343l0-5.3359022c0-7.12221094%205.76377249-12.88598345%2012.88598342-12.88598344%207.10973938%200%2012.88598345%205.76377249%2012.88598345%2012.88598344l0%205.3359022C329.78738%20329.69938399%20324.01209594%20335.46219649%20316.90235655%20335.46219649z'%20fill='%23ffffff'%20p-id='9733'%3e%3c/path%3e%3cpath%20d='M790.66253055%20800.05792025c0%2063.6614775-51.60629062%20115.26776813-115.28119969%20115.26776811l-1.3833825%200c-63.67394906%200-115.28023969-51.60629062-115.28023968-115.26776811L558.71770961%20193.01317679c0-63.6614775%2051.60629062-115.26776813%20115.28023969-115.26776812l1.3833825%200c63.67490812%200%20115.28119969%2051.60629062%20115.28119969%20115.26776812L790.66253055%20800.05792025zM739.11859774%20193.01317679c0-35.19661689-28.5281775-63.72479437-63.73726594-63.72479437l-1.3833825%200c-35.2100475%200-63.73726594%2028.52721844-63.73726594%2063.72479437L610.26068336%20800.05792025c0%2035.19661689%2028.52721844%2063.72479437%2063.73726594%2063.72479436l1.3833825%200c35.20908844%200%2063.73726594-28.52721844%2063.73726594-63.72479436L739.11859774%20193.01317679z'%20fill='%23ffffff'%20p-id='9734'%3e%3c/path%3e%3c/svg%3e",G9n="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1715236465064'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='9940'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M844.8%20247.466667c0-17.066667-17.066667-34.133333-34.133333-34.133334s-34.133333%2012.8-34.133334%2034.133334v68.266666c-8.533333-17.066667-21.333333-29.866667-29.866666-38.4C682.666667%20217.6%20601.6%20179.2%20512%20179.2c-183.466667%200-332.8%20149.333333-332.8%20332.8s149.333333%20332.8%20332.8%20332.8c89.6%200%20170.666667-34.133333%20234.666667-98.133333%2012.8-12.8%2012.8-34.133333%200-46.933334s-34.133333-12.8-46.933334%200c-51.2%2051.2-119.466667%2076.8-187.733333%2076.8-145.066667%200-264.533333-119.466667-264.533333-264.533333S366.933333%20243.2%20512%20243.2c72.533333%200%20136.533333%2025.6%20187.733333%2076.8l38.4%2038.4h-76.8c-17.066667%200-34.133333%2012.8-34.133333%2034.133333s12.8%2034.133333%2034.133333%2034.133334H823.466667s4.266667%200%204.266666-4.266667c0%200%204.266667%200%204.266667-4.266667l4.266667-4.266666%204.266666-4.266667v-4.266667-157.866666z'%20p-id='9941'%20fill='%23ffffff'%3e%3c/path%3e%3c/svg%3e";/*!
32663
+ </div>`,u),this.label3d.setLabelStyle(d,.08/this.scale,"x","auto"),t.rotation&&(d.rotation.x=t.rotation[0]*(Math.PI/180),d.rotation.y=t.rotation[1]*(Math.PI/180),d.rotation.z=t.rotation[2]*(Math.PI/180)),d.name="scatter-"+t.id,d.setParent(this.scatterLabelGroup),d.userData.adcode=o.adcode,d.userData.scale=o,d.userData.name=o.name,d.userData.labelShow=t.label.show,d.userData.value=o.value,d.userData.position=[u.x,u.y,u.z],d.element.style.cursor="pointer",d.element.addEventListener("click",()=>{this.onCallBack.onClickScatter(d.userData)}),d};r.map((o,l)=>{let[u,c]=this.geoProjection([o.lng,o.lat]),d=a(o,l,new ir(u,-c,this.depth/this.scale));this.allScatterLabel.push(d)}),this.setScatterLabelStyle(t.label,t.id),this.mainSceneGroup.add(this.scatterLabelGroup),this.scatterLabelGroup.scale.set(this.scale,this.scale,this.scale),this.option.scene.defaultMapAdcode!==1e5&&this.setScatterScale()}}catch{}}setScatterLabelStyle(t,r){t&&(Qo.installFont(t.fontFamily),this.allScatterLabel.map((n,s)=>{if(n.name==="scatter-"+r){const a=n.element.querySelector(".scatter-label.scatter-"+r+" .wrap");t.show?a.style.opacity=1:a.style.opacity=0;const o=n.element.querySelector(".scatter-label.scatter-"+r+" .label");t.show?o.innerText=o.innerText:o.innerText="",o.style.left=t.left+"px",o.style.top=t.top+"px",o.style.fontSize=t.fontSize+"px",o.style.fontFamily=t.fontFamily,o.style.color=t.color,o.style.backgroundColor=t.bg.color,o.style.padding=`${t.bg.paddingW}px ${t.bg.paddingH}px`,o.style.borderRadius=t.bg.borderRadius+"px",o.style.borderWidth=t.bg.borderWidth+"px",o.style.borderColor=t.bg.borderColor,o.style.borderStyle=t.bg.borderStyle}}))}setScatterScale(){const t=this.boundBox;this.scatterLabelGroup.position.x=-t.center.x,this.scatterLabelGroup.position.y=-t.center.y}createScatterTimeLine(){const t=ju.timeline();this.allScatterLabel.map(r=>{const n=r.element.querySelector(".scatter-label .wrap");n.style.opacity=0}),this.allScatterLabel.map((r,n)=>{if(r.userData.labelShow){const s=r.element.querySelector(".scatter-label .wrap");t.add(ju.to(s,{duration:.5,delay:.05*n,opacity:1,ease:"circ.out"}),"scatter")}})}cleanAllScatter(){for(;this.scatterLabelGroup.children.length;)this.scatterLabelGroup.remove(this.scatterLabelGroup.children[0]);this.allScatterLabel=[]}setScatterLabelMove(t,r="up"){this.allScatterLabel.map(n=>{n.userData.adcode===t&&ju.to(n.position,{duration:.3,z:r==="up"?n.userData.position[2]+this.depth/2+.3:n.userData.position[2]})})}createFlyLine(t,r,n=!0,s=!1){if(!(!n&&(r=this.datasource[t._sourceId],!r))&&(n||(this.flyLineGroup.remove(...this.flyLineGroup.children.filter(a=>a.name==="flyline-"+t.id)),this.flyLineLabelGroup.remove(...this.flyLineLabelGroup.children.filter(a=>a.name==="flyline-"+t.id)),this.allFlyLine=this.allFlyLine.filter(a=>a.name!=="flyline-"+t.id),this.allFlyLineLabel=this.allFlyLineLabel.filter(a=>a.name!=="flyline-"+t.id)),r&&Ht.isArray(r)&&r.length>0))try{if(this.datasource[t._sourceId]=r,!t.isHide){const a=new vy().load(t.texture);a.wrapS=a.wrapT=py,a.generateMipmaps=!1,a.magFilter=hm,a.repeat.set(.5,1);let o=new H5n(this,{data:r,option:t,texture:a,radius:t.radius/this.scale,speed:t.speed,middleHeight:t.middleHeight/this.scale,segments:t.segments,radialSegments:t.radialSegments,allFlyLine:this.allFlyLine,material:new hf({map:a,alphaMap:a,color:new Ts(t.material.color),transparent:!0,opacity:s?0:t.material.opacity,fog:!1,depthTest:!1,blending:eg})});o.instance.name="flyline-"+t.id,o.instance.position.z=(this.depth+.4)/this.scale,this.flyLineGroup.add(o.instance),this.setFlylineLabelStyle(t.label,t.id),this.flyLineGroup.scale.set(this.scale,this.scale,this.scale),this.flyLineLabelGroup.scale.set(this.scale,this.scale,this.scale),this.mainSceneGroup.add(this.flyLineGroup),this.mainSceneGroup.add(this.flyLineLabelGroup),this.option.scene.defaultMapAdcode!==1e5&&this.setFlylineScale()}}catch{}}setFlylineLabelStyle(t,r){t&&(Qo.installFont(t.fontFamily),this.allFlyLineLabel.map((n,s)=>{if(n.name==="flyline-"+r){const a=n.element.querySelector(".flyline-label.flyline-"+r+" .wrap");t.show?a.style.opacity=1:a.style.opacity=0,a&&(a.style.backgroundColor=t.bg.color,a.style.padding=`${t.bg.paddingW}px ${t.bg.paddingH}px`,a.style.borderRadius=t.bg.borderRadius+"px",a.style.borderWidth=t.bg.borderWidth+"px",a.style.borderColor=t.bg.borderColor,a.style.borderStyle=t.bg.borderStyle);const o=n.element.querySelector(".flyline-label.flyline-"+r+" .label");t.show?o.innerText=o.innerText:o.innerText="",o.style.fontSize=t.fontSize+"px",o.style.fontFamily=t.fontFamily,o.style.color=t.color}}))}setFlylineScale(){const t=this.boundBox;this.flyLineGroup.position.x=-t.center.x,this.flyLineGroup.position.y=-t.center.y,this.flyLineLabelGroup.position.x=-t.center.x,this.flyLineLabelGroup.position.y=-t.center.y}cleanAllFlyLine(){for(;this.flyLineGroup.children.length;)this.flyLineGroup.remove(this.flyLineGroup.children[0]);for(;this.flyLineLabelGroup.children.length;)this.flyLineLabelGroup.remove(this.flyLineLabelGroup.children[0]);this.allFlyLine=[],this.allFlyLineLabel=[]}createFlyLineTimeLine(){const t=ju.timeline();this.allFlyLine.map((r,n)=>{t.add(ju.to(r.material,{duration:.2,opacity:1,ease:"circ.out"}),"flyLine")}),this.allFlyLineLabel.map(r=>{const n=r.element.querySelector(".flyline-label .wrap");n.style.opacity=0}),this.allFlyLineLabel.map((r,n)=>{const s=r.element.querySelector(".flyline-label .wrap");t.add(ju.to(s,{duration:.5,delay:.05*n,opacity:1,ease:"circ.out"}),"flyline")})}createRegionalLevel(t,r,n=!0,s=!1){try{if(!n&&(r=this.datasource[t._sourceId],!r))return;n||this.areaMapGroup.children[0].children.forEach(a=>{a.remove(...a.children.filter(o=>o.name==="shapeGroup-"+t.id))}),r&&Ht.isArray(r)&&r.length>0&&(this.datasource[t._sourceId]=r,t.isHide||XAr(this.mapJsonData).features.forEach((o,l)=>{const{name:u,adcode:c,parent:d}=o.properties,h=new lc;h.name="shapeGroup-"+t.id,o.geometry.coordinates.forEach(m=>{m.forEach((x,v)=>{const y=new q2e;for(let C=0;C<x.length;C++){if(!x[C][0]||!x[C][1])return!1;const[T,I]=this.geoProjection(x[C]);C===0&&y.moveTo(T,-I),y.lineTo(T,-I)}const E=r.find(C=>C.name===u);let S=t.defaultColor;if(E)for(let C=0;C<t.rules.length;C++){const T=t.rules[C];E.value>=T.min&&E.value<=T.max&&(S=T.color||t.defaultColor)}try{const C=new ett(Ht.cloneDeep(y)),T=new Hu(C,new j8({color:new Ts(S),transparent:!0,opacity:s?0:t.opacity}));T.userData.depth=this.depth,T.userData.name=u,T.userData.adcode=c,T.userData.parent=d,T.userData.opacity=t.opacity,T.renderOrder=20,T.name="shapeArea",this.allRegionalLevel.push(T),h.add(T)}catch{}})}),h.position.set(0,0,this.depth+.2);const p=this.areaMapGroup.getObjectByName("meshGroup"+l);if(p&&p.children.length>1){const m=this.areaMapGroup.getObjectByName("meshGroup"+l);m&&m.add(h)}}))}catch{}}createAllRegionalLevel(){this.areaMapGroup.children[0].children.forEach(t=>{t.remove(...t.children.filter(r=>r.name.includes("shapeGroup-")))})}createRegionalLevelTimeLine(){const t=ju.timeline();this.allRegionalLevel.map((r,n)=>{t.add(ju.to(r.material,{duration:.5,delay:.002*n,opacity:r.userData.opacity,ease:"circ.out"}),"RegionalLevel")})}handleMapMousedown(t){if(t.preventDefault(),this.isMousedown=!0,!this.isMapAnimationSuccess)return;const r=new g_r,n=new Tn,s=this.renderer.instance.domElement.getBoundingClientRect();n.x=(t.clientX-s.left)/s.width*2-1,n.y=-((t.clientY-s.top)/s.height)*2+1,r.setFromCamera(n,this.camera.instance);let a=r.intersectObjects(this.scene.children,!0);a=a.filter(o=>o.object.name.includes("scatter-")||o.object.name.includes("bar-")||o.object.name.includes("flyline-")||o.object.name.includes("mapArea-")),a.length>0&&a[0]?this.clickMapObj=a[0]:this.clickMapObj=null}handleMapMouseup(t){if(t.preventDefault(),this.isMousedown=!1,!!this.isMapAnimationSuccess&&this.clickMapObj){if(this.clickMapObj.object.name.includes("scatter-")&&this.clickMapObj.object.visible&&this.onCallBack.onClickScatter(this.clickMapObj.object.userData),this.clickMapObj.object.name.includes("bar-")&&this.clickMapObj.object.visible&&this.onCallBack.onClickBar(this.clickMapObj.object.userData),this.clickMapObj.object.name.includes("flyline-")&&this.clickMapObj.object.visible&&this.onCallBack.onClickFlyline(this.clickMapObj.object.userData),this.clickMapObj.object.name.includes("mapArea-")){let r=this.clickMapObj.object.userData;this.onCallBack.onLoadChild(r)}this.clickMapObj=null}}handleHoverAreaMap(t){if(t.preventDefault(),this.clickMapObj=null,!this.isMapAnimationSuccess)return;if(this.isMousedown){this.hoverAreaMap&&this.reset(this.hoverAreaMap.parent);return}this.mouse.x=(t.clientX-this.clientRect.left)/this.clientRect.width*2-1,this.mouse.y=-((t.clientY-this.clientRect.top)/this.clientRect.height)*2+1,this.raycasterMousemove.setFromCamera(this.mouse,this.camera.instance);let r=this.raycasterMousemove.intersectObjects(this.areaMapGroup.children,!0);if(r=r.filter(n=>n.object.name.includes("mapArea-")),r.length>0&&r[0]&&r[0].object.name.includes("mapArea-")){if(this.hoverAreaMap===null){this.move(r[0].object.parent,r[0].object);return}this.hoverAreaMap.name!==r[0].object.name&&(this.reset(this.hoverAreaMap.parent),this.move(r[0].object.parent,r[0].object))}else this.hoverAreaMap&&this.reset(this.hoverAreaMap.parent)}move(t,r){try{const n=this.areaMapTopMaterial.clone();n.opacity=this.option.map.topMaterial.hoverOpacity||1,t.children[0].material[0]=n;const s=t.getObjectByName("lineGroup");if(s&&s.children&&s.children[0]){const a=this.provinceLineMaterial.clone();a.color=new Ts(this.option.map.hoverLineColor||this.option.map.lineColor||"#000000"),s.children[0].material=a}}catch{}ju.to(t.scale,{duration:.3,z:this.option.map.hoverDepth||1.5}),this.setAreaLabelMove(t.userData.adcode),this.setBarMove(t.userData.adcode),this.setBarGuangQuanMove(t.userData.adcode),this.setBarLabelMove(t.userData.adcode),this.setScatterLabelMove(t.userData.adcode),this.onCallBack.onAreaMouseover(r.userData),this.hoverAreaMap=r}reset(t){try{t.children[0].material[0]=this.areaMapTopMaterial;const r=t.getObjectByName("lineGroup");r&&r.children&&r.children[0]&&(r.children[0].material=this.provinceLineMaterial)}catch{}ju.to(t.scale,{duration:.3,z:1}),this.setAreaLabelMove(t.userData.adcode,"down"),this.setBarMove(t.userData.adcode,"down"),this.setBarGuangQuanMove(t.userData.adcode,"down"),this.setBarLabelMove(t.userData.adcode,"down"),this.setScatterLabelMove(t.userData.adcode,"down"),this.onCallBack.onAreaMouseout(this.hoverAreaMap.userData),this.hoverAreaMap=null}update(){super.update()}destroy(){try{super.destroy(),this.canvas.removeEventListener("mousedown",this.handleMapMousedown.bind(this),!1),this.canvas.removeEventListener("mouseup",this.handleMapMouseup.bind(this),!1),this.canvas.removeEventListener("mousemove",this.handleHoverAreaMap.bind(this),!1),this.label3d&&this.label3d.destroy(),this.groundMirror&&this.groundMirror.dispose(),this.toastLoading&&this.toastLoading.destroy(),this.childMap&&this.childMap.destroy()}catch{}}}const d9n=(i,e,t,r,n)=>{Ai(()=>Ht.cloneDeep(i.option.map.depth),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&n()}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.scene.defaultMapAdcode),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&n()}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.scene.translateX),(s,a)=>{try{if(!Ht.isEqual(s,a)&&e.value){const o=i.option.scene.translateX||0,l=i.option.scene.translateY||0,u=i.option.scene.translateZ||0,c=i.option.camera.position.x+o,d=i.option.camera.position.y+l,h=i.option.camera.position.z+u;e.value.camera.instance.position.set(c,d,h);const p=i.option.camera.target;if(p){const m=p[0]+o,x=p[1]+l,v=p[2]+u;e.value.camera.controls.target.set(m,x,v)}}}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.scene.translateY),(s,a)=>{try{if(!Ht.isEqual(s,a)&&e.value){const o=i.option.scene.translateX||0,l=i.option.scene.translateY||0,u=i.option.scene.translateZ||0,c=i.option.camera.position.x+o,d=i.option.camera.position.y+l,h=i.option.camera.position.z+u;e.value.camera.instance.position.set(c,d,h);const p=i.option.camera.target;if(p){const m=p[0]+o,x=p[1]+l,v=p[2]+u;e.value.camera.controls.target.set(m,x,v)}}}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.scene.translateZ),(s,a)=>{try{if(!Ht.isEqual(s,a)&&e.value){const o=i.option.scene.translateX||0,l=i.option.scene.translateY||0,u=i.option.scene.translateZ||0,c=i.option.camera.position.x+o,d=i.option.camera.position.y+l,h=i.option.camera.position.z+u;e.value.camera.instance.position.set(c,d,h);const p=i.option.camera.target;if(p){const m=p[0]+o,x=p[1]+l,v=p[2]+u;e.value.camera.controls.target.set(m,x,v)}}}catch{}},{deep:!0}),i.option.orbitControls&&Ai(()=>Ht.cloneDeep(i.option.orbitControls),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&e.value.camera.setControls(s)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.scene.z),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&(e.value.scene.position.z=s)}catch{}},{deep:!0}),i.option.map.backgroundImg&&(Ai(()=>Ht.cloneDeep(i.option.map.backgroundImg.show),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&e.value.createMapBackgroundImg(!1)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.map.backgroundImg.src),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&e.value.mapBackgroundImgMaterial&&e.value.createMapBackgroundImg(!1)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.map.backgroundImg.alphaMap),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&e.value.mapBackgroundImgMaterial&&e.value.createMapBackgroundImg(!1)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.map.backgroundImg.color),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&e.value.mapBackgroundImgMaterial&&(e.value.mapBackgroundImgMaterial.color=new Ts(s))}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.map.backgroundImg.opacity),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&e.value.mapBackgroundImgMaterial&&(e.value.mapBackgroundImgMaterial.opacity=s)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.map.backgroundImg.rotation),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&e.value.mapBackgroundImgMesh&&(e.value.mapBackgroundImgMesh.rotation.x=s[0]*(Math.PI/180),e.value.mapBackgroundImgMesh.rotation.y=s[1]*(Math.PI/180),e.value.mapBackgroundImgMesh.rotation.z=s[2]*(Math.PI/180))}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.map.backgroundImg.position),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&e.value.mapBackgroundImgMesh&&(e.value.mapBackgroundImgMesh.position.x=s[0],e.value.mapBackgroundImgMesh.position.y=s[1],e.value.mapBackgroundImgMesh.position.z=s[2])}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.map.backgroundImg.scale),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&e.value.mapBackgroundImgMesh&&(e.value.mapBackgroundImgMesh.scale.x=s[0],e.value.mapBackgroundImgMesh.scale.y=s[1],e.value.mapBackgroundImgMesh.scale.z=s[2])}catch{}},{deep:!0})),Ai(()=>Ht.cloneDeep(i.option.scene.background),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&(e.value.scene.background=new Ts(s))}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.scene.isBackground),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&(s?e.value.scene.background=new Ts(i.option.scene.background):e.value.scene.background=null)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.map.lineColor),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&(e.value.provinceLineMaterial.color=new Ts(s))}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.map.mirrorShow),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&(e.value.groundMirror.visible=s)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.map.arealabel),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&e.value.setAreaLabelStyle(s)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.map.titleLabel),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&e.value.setMapTitleLabelStyle(s)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.map.topMaterial),async(s,a)=>{try{if(!Ht.isEqual(s,a)&&e.value){let[o,l]=e.value.createProvinceMaterial(i.option.map.topMaterial,i.option.map.sideMaterial);e.value.areaMapTopMaterial=o,e.value.areaMapSideMaterial=l,e.value.provinceMesh.mapGroup.traverse(u=>{u.isMesh&&(u.material[0]=o,u.material[1]=l)})}}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.map.sideMaterial),(s,a)=>{try{if(!Ht.isEqual(s,a)&&e.value){let[o,l]=e.value.createProvinceMaterial(i.option.map.topMaterial,i.option.map.sideMaterial);e.value.areaMapTopMaterial=o,e.value.areaMapSideMaterial=l,e.value.provinceMesh.mapGroup.traverse(u=>{u.isMesh&&(u.material[0]=o,u.material[1]=l)})}}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.map.storkeAnimation),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&e.value.createAreaMapStorke(s,!1)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.particle),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&e6r(e.value,s)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.floor.gaoguang),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&(e.value.gaoguangMesh.visible=s.show,e.value.gaoguangMesh.material.color=new Ts(s.color))}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.floor.quan),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&(e.value.quan.visible=s.show,e.value.quan.material.color=new Ts(s.color))}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.floor.gridRipple),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&$Ar(e.value,s)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.floor.rotateBorder),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&ZAr(e.value,s,!1)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.light.ambientLight),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&r6r(e.value,s)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.light.directionalLight),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&i6r(e.value,s,i.option.debugger)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.light.pointLight1),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&n6r(e.value,s,i.option.debugger)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.light.pointLight2),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&s6r(e.value,s,i.option.debugger)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.debugger),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&(a6r(e.value,i.option.light,i.option.debugger),e.value.mapBoxHelper.visible=i.option.debugger,e.value.axesHelper.visible=i.option.debugger)}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.camera.position),(s,a)=>{try{if(!Ht.isEqual(s,a)&&e.value){const o=i.option.scene.translateX||0,l=i.option.scene.translateY||0,u=i.option.scene.translateZ||0,c=i.option.camera.position.x+o,d=i.option.camera.position.y+l,h=i.option.camera.position.z+u;e.value.camera.instance.position.set(c,d,h)}}catch{}},{deep:!0}),i.option.camera.target&&Ai(()=>Ht.cloneDeep(i.option.camera.target),(s,a)=>{try{if(!Ht.isEqual(s,a)&&e.value){const o=i.option.scene.translateX||0,l=i.option.scene.translateY||0,u=i.option.scene.translateZ||0,c=i.option.camera.target;if(c){const d=c[0]+o,h=c[1]+l,p=c[2]+u;e.value.camera.controls.target.set(d,h,p)}}}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.widgets.filter(s=>s.type==="bar")),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&s.length===a.length&&s.forEach(o=>{e.value.createBar(o,void 0,!1)})}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.widgets.filter(s=>s.type==="scatter")),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&s.length===a.length&&s.forEach(o=>{e.value.createScatter(o,void 0,!1)})}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.widgets.filter(s=>s.type==="flyline")),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&s.length===a.length&&s.forEach(o=>{e.value.createFlyLine(o,void 0,!1)})}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.option.widgets.filter(s=>s.type==="regionalLevel")),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&s.length===a.length&&s.forEach(o=>{e.value.createRegionalLevel(o,void 0,!1)})}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(i.sources),(s,a)=>{try{!Ht.isEqual(s,a)&&e.value&&r(!1)}catch{}},{deep:!0})},o6r="2.0.0",h9n=i=>{const e=Ht.cloneDeep(i);if(e.version!==o6r){e.version=o6r;const t={};return e.backButton&&(t.backButton={show:e.backButton,left:e.backButtonLeft,bottom:e.backButtonBottom,text:{color:e.backButtonCss.color,fontSize:e.backButtonCss.fontSize,fontStyle:e.backButtonCss.fontStyle,fontWeight:e.backButtonCss.fontWeight,fontFamily:e.backButtonCss.fontFamily},border:{borderRadius:e.backButtonCss.borderRadius,borderWidth:e.backButtonCss.borderWidth,borderColor:e.backButtonCss.borderColor,borderStyle:e.backButtonCss.borderStyle},background:{backgroundColor:e.backButtonCss.backgroundColor,backgroundImage:e.backButtonCss.backgroundImage,backgroundSize:e.backButtonCss.backgroundSize}}),{...e,...t}}return i},f9n={style:{width:"100%",height:"100%"}},p9n={class:"value"},m9n=["onClick"],g9n={key:3,class:"fps"},x9n=ar({...ar({name:"ShjMap3d"}),props:{option:{},sources:{},useEvents:{}},emits:["on-loaded","on-animated","on-drill-down","on-area-mouseover","on-area-mouseout","on-area-click","on-bar-click","on-scatter-click","on-flyline-click","on-return","on-data-change"],setup(i,{expose:e,emit:t}){const r=fi(()=>h9n(i.option)),n=t,s=Wt(),a=Wt(!1),o=Wt(!1),l="zerov-map3d-scene",u=Wt(),c=new N5n,d=Wt(!1),h=(j=!0)=>{s.value.cleanAllBar(),s.value.cleanAllScatter(),s.value.cleanAllFlyLine(),s.value.createAllRegionalLevel(),i.sources&&i.sources.length>0&&r.value.widgets.forEach((Y,X)=>{pl.parse({sources:[i.sources[X]],callback:q=>{try{Y&&Y.type==="bar"&&s.value.createBar(Y,q.data[0].data,!0,j),Y&&Y.type==="scatter"&&s.value.createScatter(Y,q.data[0].data,!0,j),Y&&Y.type==="flyline"&&s.value.createFlyLine(Y,q.data[0].data,!0,j),Y&&Y.type==="regionalLevel"&&s.value.createRegionalLevel(Y,q.data[0].data,!0,j),j&&(s.value.createBarTimeLine(),s.value.createScatterTimeLine(),s.value.createFlyLineTimeLine(),s.value.createRegionalLevelTimeLine()),n("on-data-change",q),bi.parseEvents(i.useEvents,"on-data-change",q)}catch{n("on-data-change",null),bi.parseEvents(i.useEvents,"on-data-change",null)}}})})},p=()=>{try{u.value&&document.getElementById(l)&&u.value.removeChild(document.getElementById(l));const j=document.createElement("canvas");j.id=l,j.className="zerov-map-3d",j.style.width="100%",j.style.height="100%",u.value.appendChild(j)}catch{}},m=j=>(a.value=!1,o.value=!1,s.value&&(s.value.destroy(),s.value=null),p(),new c9n(document.getElementById(l),{geoProjectionCenter:[108.55,36.32]},j,{onAreaMouseover:X=>{n("on-area-mouseover",X),bi.parseEvents(i.useEvents,"on-area-mouseover",X)},onAreaMouseout:X=>{n("on-area-mouseout",X),bi.parseEvents(i.useEvents,"on-area-mouseout",X)},onLoadChild:X=>{if(n("on-area-click",X),bi.parseEvents(i.useEvents,"on-area-click",X),X.adcode!==c.present&&j.scene.isDrilling&&j.scene.defaultMapAdcode!==1){n("on-drill-down",X),bi.parseEvents(i.useEvents,"on-drill-down",X);const q=Ht.cloneDeep(j);q.scene.defaultMapAdcode=X.adcode,s.value=m(q),c.push(X.adcode),c.past.length<=0?d.value=!1:d.value=!0}},onMapSuccess:()=>{a.value=!0,n("on-loaded"),bi.parseEvents(i.useEvents,"on-loaded",null)},onMapAnimationSuccess:()=>{h(),o.value=!0,n("on-animated"),bi.parseEvents(i.useEvents,"on-animated",null)},onClickBar:X=>{n("on-bar-click",X),bi.parseEvents(i.useEvents,"on-bar-click",X)},onClickScatter:X=>{n("on-scatter-click",X),bi.parseEvents(i.useEvents,"on-scatter-click",X)},onClickFlyline:X=>{n("on-flyline-click",X),bi.parseEvents(i.useEvents,"on-flyline-click",X)}})),x=()=>{if(!u.value)return;const{clientWidth:j,clientHeight:Y}=u.value;!j||!Y||(s.value=m(r.value),c.push(r.value.scene.defaultMapAdcode),d9n({option:r.value,sources:i.sources,useEvents:i.useEvents},s,m,h,y))};_a(()=>{Go(()=>{x()}),window.addEventListener("resize",()=>{x()})}),f1(()=>{s.value&&s.value.destroy()});const v=()=>{n("on-return",{parentAdcode:c.past[c.past.length-1],adcode:c.present}),bi.parseEvents(i.useEvents,"on-return",{parentAdcode:c.past[c.past.length-1],adcode:c.present}),c.undo();const j=Ht.cloneDeep(r.value);j.scene.defaultMapAdcode=c.present,s.value=m(j),c.past.length<=0?d.value=!1:d.value=!0},y=()=>{c.empty(),c.push(r.value.scene.defaultMapAdcode),s.value=m(r.value),c.past.length<=0?d.value=!1:d.value=!0},E=(j,Y,X)=>{ju.timeline().add(ju.to(s.value.camera.instance.position,{duration:2,delay:0,x:j,y:Y,z:X,ease:"circ.out"}))};e({refresh:()=>h(),refreshView:()=>h(),refreshData:()=>h(),goBack:()=>v(),setCameraPosition:(j,Y,X)=>E(j,Y,X)});const S=Aai(),C=Wt(),T=j=>{if(C.value&&j){const Y=`url(${j.backgroundImage})`;return{...Qo.json2cssObject(j.background),...Qo.json2cssObject(j.border),...Qo.json2cssObject(j.text),left:r.value.backButton.left+"%",bottom:r.value.backButton.bottom+"%","background-image":Y}}return{}},I=Wt(Ht.cloneDeep(r.value.widgets)),B=fi(()=>{try{const j=I.value.filter(Y=>Y.type==="regionalLevel");return j.length>0?j[0].isHide?null:j[0]:null}catch{return null}});Ai(()=>Ht.cloneDeep(r.value.widgets),(j,Y)=>{try{!Ht.isEqual(j,Y)&&s.value&&(I.value=Ht.cloneDeep(r.value.widgets))}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(I.value.filter(j=>j.type==="bar")),(j,Y)=>{try{!Ht.isEqual(j,Y)&&s.value&&j.length===Y.length&&j.forEach(X=>{s.value.createBar(X,void 0,!1)})}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(I.value.filter(j=>j.type==="scatter")),(j,Y)=>{try{!Ht.isEqual(j,Y)&&s.value&&j.length===Y.length&&j.forEach(X=>{s.value.createScatter(X,void 0,!1)})}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(I.value.filter(j=>j.type==="flyline")),(j,Y)=>{try{!Ht.isEqual(j,Y)&&s.value&&j.length===Y.length&&j.forEach(X=>{s.value.createFlyLine(X,void 0,!1)})}catch{}},{deep:!0}),Ai(()=>Ht.cloneDeep(I.value.filter(j=>j.type==="regionalLevel")),(j,Y)=>{try{!Ht.isEqual(j,Y)&&s.value&&j.length===Y.length&&j.forEach(X=>{s.value.createRegionalLevel(X,void 0,!1)})}catch{}},{deep:!0});const O=j=>{try{j.isHide===void 0?j.isHide=!0:j.isHide=!j.isHide}catch{}},L=()=>{try{const j=I.value.every(Y=>!Y.isHide);I.value.forEach(Y=>Y.isHide=j)}catch{}},k=j=>{const Y=`url(${j.backgroundImage})`,X=`url(${U(j.hover.backgroundImage)})`,q=`url(${U(j.active.backgroundImage)})`;return{...Qo.json2cssObject(j),...Qo.json2cssObject(j.hover,"hover"),...Qo.json2cssObject(j.active,"active"),"background-image":Y,"--hover-background-image":X,"--active-background-image":q}},U=j=>!j.startsWith("http")&&!j.startsWith("//")?"../"+j:j;return(j,Y)=>(Gt(),Wr("div",f9n,[tn("div",{ref_key:"map3dWrapRef",ref:u,class:Xa(["map-3d-wrap",{show:a.value}])},[o.value&&d.value&&r.value.backButton.show?(Gt(),Wr("div",{key:0,ref_key:"buttonRef",ref:C,class:"return-btn",style:Va(T(r.value.backButton)),onClick:v}," 返回上一级 ",4)):qi("",!0),B.value?(Gt(),Wr("div",{key:1,class:"regional-level",style:Va({left:B.value.labelStyle.left+"%",top:B.value.labelStyle.top+"%",flexDirection:B.value.labelStyle.direction,gap:B.value.labelStyle.gap+"px",fontSize:B.value.labelStyle.fontSize+"px",fontFamily:B.value.labelStyle.fontFamily,fontStyle:B.value.labelStyle.fontStyle,color:B.value.labelStyle.color,"--color-width":B.value.labelStyle.colorStyle.width+"px","--color-height":B.value.labelStyle.colorStyle.height+"px","--color-borderRadius":B.value.labelStyle.colorStyle.borderRadius+"px"})},[(Gt(!0),Wr(ia,null,ou(B.value.rules,(X,q)=>(Gt(),Wr("div",{key:q,class:"item"},[tn("div",{class:"color",style:Va({backgroundColor:X.color})},null,4),tn("span",p9n,jd(X.label),1)]))),128))],4)):qi("",!0),r.value.widgets.length>0&&r.value.widgetControlStyle&&r.value.widgetControlStyle.show?(Gt(),Wr("div",{key:2,class:"widget-control",style:Va({left:r.value.widgetControlStyle.left+"%",top:r.value.widgetControlStyle.top+"%",flexDirection:r.value.widgetControlStyle.direction,gap:r.value.widgetControlStyle.gap+"px","--widget-width":r.value.widgetControlStyle.width+"px","--widget-height":r.value.widgetControlStyle.height+"px"})},[tn("div",{class:Xa(["control-button",{active:I.value.every(X=>!X.isHide)}]),style:Va(k(r.value.widgetControlStyle)),onClick:L},jd(I.value.every(X=>!X.isHide)?"隐藏":"显示")+"/全部 ",7),(Gt(!0),Wr(ia,null,ou(I.value,X=>(Gt(),Wr("div",{key:X.id,class:Xa(["control-button",{active:!X.isHide}]),style:Va(k(r.value.widgetControlStyle)),onClick:q=>O(X)},jd(X.name||"-"),15,m9n))),128))],4)):qi("",!0),r.value.debugger?(Gt(),Wr("div",g9n,"fps:"+jd(kr(S)),1)):qi("",!0)],2)]))}}),l6r=Ji(Cc(x9n,[["__scopeId","data-v-c98e3112"]])),u6r="2.0.0",v9n=i=>{const e=Ht.cloneDeep(i);return e.version!==u6r?{base:{mode:"iframe-webscoket",iframeUrl:e.iframeUrl,webSocketUrl:e.webSocketUrl},version:u6r}:i},y9n={class:"iframe-webscoket"},D9n=["src"],E9n={key:1},b9n=ar({...ar({name:"ShjUeIframe"}),props:{option:{},sources:{},useEvents:{}},emits:["ue-scoket-on-message"],setup(i,{emit:e}){const t=fi(()=>v9n(i.option)),r=e,n=3e3,s=1/0;let a=0,o;const l=()=>{window.SHJSceneUEIframeWebscoket&&(window.SHJSceneUEIframeWebscoket.onclose=null,window.SHJSceneUEIframeWebscoket.close()),window.SHJSceneUEIframeWebscoket=new WebSocket(t.value.base.webSocketUrl),window.SHJSceneUEIframeWebscoket.onmessage=u=>{try{const c=JSON.parse(u.data);if(c.type==="ping")return;if(!c.data)throw new Error("数据格式异常");r("ue-scoket-on-message",c.data),bi.parseEvents(i.useEvents,"ue-scoket-on-message",c.data)}catch{}},window.SHJSceneUEIframeWebscoket.onopen=()=>{a=0,clearTimeout(o)},window.SHJSceneUEIframeWebscoket.onerror=()=>{},window.SHJSceneUEIframeWebscoket.onclose=()=>{const u=n*Math.pow(2,a);o=setTimeout(()=>{a<s&&(a++,l())},u)}};return _a(()=>{if(t.value.base.webSocketUrl)try{l()}catch{}}),f1(()=>{window.SHJSceneUEIframeWebscoket&&window.SHJSceneUEIframeWebscoket.close()}),(u,c)=>(Gt(),Wr("div",y9n,[t.value.base.iframeUrl?(Gt(),Wr("iframe",{key:0,src:t.value.base.iframeUrl,sandbox:"allow-scripts allow-same-origin",style:{width:"100%",height:"100%",border:"0"},frameborder:"0"},null,8,D9n)):(Gt(),Wr("span",E9n," 请先连接到UE服务地址 "))]))}}),c6r=Ji(Cc(b9n,[["__scopeId","data-v-45f7470f"]])),d6r="2.0.0",_9n=i=>{const e=Ht.cloneDeep(i);return e.version!==d6r?(e.version=d6r,e):i},A9n={class:"shj-for-ue"},S9n=ar({...ar({name:"ShjUeShj"}),props:{option:{},sources:{},useEvents:{}},emits:["ue-scene-on-message"],setup(i,{emit:e}){fi(()=>_9n(i.option));const t=e;return _a(()=>{i.useEvents.length<=0||i.useEvents.forEach(r=>{r&&r.receivingMethod&&(window.ue.interface[r.receivingMethod]=n=>{try{if(!JSON.parse(n).data)throw new Error("");const s=i.useEvents.filter(a=>a.receivingMethod===r.receivingMethod);t("ue-scene-on-message",JSON.parse(n).data),bi.parseEvents(s,"ue-scene-on-message",JSON.parse(n).data)}catch{}})})}),(r,n)=>(Gt(),Wr("div",A9n))}}),h6r=Ji(Cc(S9n,[["__scopeId","data-v-73b53cd3"]])),f6r="2.0.0",C9n=i=>{const e=Ht.cloneDeep(i);return e.version!==f6r?{base:{mode:"iframe-render",iframeUrl:e.iframeUrl},version:f6r}:i},T9n={class:"unity-iframe"},w9n=["src"],F9n={key:1},R9n=ar({...ar({name:"ShjUnityIframe"}),props:{option:{},sources:{},useEvents:{}},emits:["unity-scene-on-message"],setup(i,{emit:e}){const t=fi(()=>C9n(i.option)),r=e,n=Wt();_a(()=>{window.SHJSceneUnityIframeInstance||(window.SHJSceneUnityIframeInstance={}),window.SHJSceneUnityIframeInstance.url=t.value.base.iframeUrl,window.SHJSceneUnityIframeInstance.ref=n.value,window.addEventListener("message",s,!1)}),f1(()=>{window.SHJSceneUnityIframeInstance=null,window.removeEventListener("message",s,!1)});const s=a=>{r("unity-scene-on-message",a.data),bi.parseEvents(i.useEvents,"unity-scene-on-message",a.data)};return(a,o)=>(Gt(),Wr("div",T9n,[t.value.base.iframeUrl?(Gt(),Wr("iframe",{key:0,ref_key:"unityIframeRef",ref:n,src:t.value.base.iframeUrl,sandbox:"allow-scripts allow-same-origin",style:{width:"100%",height:"100%",border:"0"},frameborder:"0"},null,8,w9n)):(Gt(),Wr("span",F9n," 请先连接到Unity服务地址 "))]))}}),p6r=Ji(Cc(R9n,[["__scopeId","data-v-40a92f36"]])),m6r="2.0.0",P9n=i=>{const e=Ht.cloneDeep(i);return e.version!==m6r?{base:{mode:"webgl-render",url:e.url},version:m6r}:i},I9n={class:"unity-webgl"},M9n=["src"],B9n={key:1},O9n=ar({...ar({name:"ShjUnityWebgl"}),props:{option:{},sources:{},useEvents:{}},emits:["unity-scene-on-message"],setup(i,{emit:e}){const t=fi(()=>P9n(i.option)),r=e,n=Wt();_a(()=>{window.SHJSceneUnityIframeInstance||(window.SHJSceneUnityIframeInstance={}),window.SHJSceneUnityIframeInstance.url=t.value.base.url+"/index.html",window.SHJSceneUnityIframeInstance.ref=n.value,window.addEventListener("message",s,!1)}),f1(()=>{window.SHJSceneUnityIframeInstance=null,window.removeEventListener("message",s,!1)});const s=a=>{r("unity-scene-on-message",a.data),bi.parseEvents(i.useEvents,"unity-scene-on-message",a.data)};return(a,o)=>(Gt(),Wr("div",I9n,[t.value.base.url?(Gt(),Wr("iframe",{key:0,ref_key:"unityIframeRef",ref:n,src:`${t.value.base.url}/index.html`,sandbox:"allow-scripts allow-same-origin",style:{width:"100%",height:"100%",border:"0"},frameborder:"0"},null,8,M9n)):(Gt(),Wr("span",B9n," 请先连接到Unity服务地址 "))]))}}),g6r=Ji(Cc(O9n,[["__scopeId","data-v-444b8723"]])),L9n="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1716263282576'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='11645'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M991.232%20330.752c-13.824-6.144-27.648-6.144-34.304%200l-392.704%20208.384c-6.656%206.144-13.824%2018.944-13.824%2025.088v416.768c0%2012.8%202.56%2026.112%2016.384%2034.304%205.12%202.56%2011.264%203.584%2017.92%203.584%204.608%200%209.216%200.512%2020.48-6.144l386.048-208.384c12.8-5.632%2020.48-17.92%2020.48-31.744V361.984c0-13.312-8.192-26.112-20.48-31.232z%20m-55.296%20429.568l-310.272%20164.352v-334.848l310.272-164.352v334.848z%20m13.824-549.888L552.96%2016.896c-15.36-7.68-33.28-9.728-50.176-5.12-2.56%201.024-5.632%202.048-8.192%203.072L88.576%20213.504c-4.096%202.048-8.192%204.608-11.776%207.168-7.168%205.12-16.384%2011.264-16.384%2021.504%200%2012.8%206.656%2025.088%2020.48%2031.744l407.552%20211.968c3.072%201.536%206.656%202.56%209.728%203.584%205.632%201.536%2011.264%205.632%2016.384%205.632%206.144%200%2012.288%200%2018.432-4.608%203.072-2.048%206.144-3.584%209.216-5.632l406.528-210.944c17.408-7.68%2025.6-28.16%2017.92-45.568-2.56-7.68-9.216-14.336-16.896-17.92z%20m-434.176%20208.384l-337.92-170.496%20337.92-164.352%20337.92%20164.352-337.92%20170.496zM74.24%20330.752c-6.656-6.144-20.48-6.144-34.304%200-12.8%205.632-20.48%2017.92-20.48%2031.744v416.768c0%2012.8%206.656%2025.088%2020.48%2031.744l367.616%20198.656c11.776%206.656%2025.088%209.728%2038.912%209.728%206.656%200%2014.336%200.512%2020.48-6.144%2013.824-7.68%2020.48-17.92%2020.48-31.744v-416.768c0-13.824-8.192-26.112-20.48-31.744%200.512%200-392.704-202.24-392.704-202.24z%20m330.752%20593.92l-310.272-164.352V419.328L404.992%20583.68v340.992z'%20fill='%23ffffff'%20p-id='11646'%3e%3c/path%3e%3c/svg%3e",zxe="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1715236117111'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='8911'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M670.634667%20182.656a40.832%2040.832%200%200%201%200%2057.941333L397.99466699%20512l272.64000001%20271.402667a40.832%2040.832%200%200%201%200%2057.941333%2041.258667%2041.258667%200%200%201-58.197334%200l-301.738666-300.37333299a40.832%2040.832%200%200%201%200-57.94133402l301.738666-300.37333299a41.258667%2041.258667%200%200%201%2058.197334%200z'%20p-id='8912'%20fill='%23ffffff'%3e%3c/path%3e%3c/svg%3e",N9n="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1715236327428'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='9114'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M843.40179753%20545.14017975H180.59820247v-66.2803595h662.80359506v66.2803595z'%20fill='%23ffffff'%20p-id='9115'%3e%3c/path%3e%3cpath%20d='M478.85982025%20843.40179753V180.59820247h66.2803595v662.80359506h-66.2803595z'%20fill='%23ffffff'%20p-id='9116'%3e%3c/path%3e%3c/svg%3e",k9n="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1715236377345'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='9318'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M889.06160075%20549.70616007H134.93839925v-75.41232014h754.1232015v75.41232014z'%20p-id='9319'%20fill='%23ffffff'%3e%3c/path%3e%3c/svg%3e",V9n="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1715236409396'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='9521'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M300.95162432%20943.72479443c-55.520501%200-93.25901001-44.607964-93.25901-110.98881401l0-671.442362c0-66.38084999%2037.738509-110.98779001%2093.285616-110.98779%2021.22951001%200%2043.632753%206.590092%2066.121953%2019.57175402L895.63169532%20406.20865343c39.06471401%2022.529109%2061.195757%2055.01703401%2061.19575701%2090.87266%200%2035.81571699-22.01234%2068.263733-62.01849501%2091.36282401L368.05492832%20923.55542842C344.55777132%20937.14698143%20322.18113432%20943.72479443%20300.95162432%20943.72479443zM300.97823032%20104.61985142c-34.79445699%200-38.971593%2039.634696-38.971593%2056.673767l0%20671.442362c0%2017.040095%204.177136%2056.67478999%2038.944987%2056.67479001%2011.403724%200%2025.02802299-4.242627%2038.965453-12.292977l526.661931-335.11129101c23.16560599-13.406335%2035.933397-29.55615301%2035.933397-44.92518899%200-15.408945-12.72890601-31.598672-34.967396-44.435025L338.92140032%20116.31521743C325.99397333%20108.87578143%20312.39525732%20104.61985142%20300.97823032%20104.61985142z'%20fill='%23ffffff'%20p-id='9522'%3e%3c/path%3e%3cpath%20d='M570.88956632%20672.92522843c-4.52198999%200-8.924253-2.240017-11.510148-6.351662-3.99089402-6.338359-2.081405-14.719236%204.25593-18.723434l7.333012-4.615111c6.35166201-3.97861399%2014.731516-2.094708%2018.723434%204.270257%204.00522%206.337335%202.095731%2014.718213-4.25593%2018.72241001l-7.333012%204.61613399C575.86181132%20672.24779942%20573.35573432%20672.92522843%20570.88956632%20672.92522843z'%20fill='%23ffffff'%20p-id='9523'%3e%3c/path%3e%3cpath%20d='M371.97316732%20798.03464342c-4.520967%200-8.924253-2.240017-11.510148-6.351662-3.99089402-6.337335-2.081405-14.731516%204.269233-18.72241l152.386666-95.85923099c6.338359-3.964288%2014.719236-2.094708%2018.723434%204.270257%203.99089402%206.337335%202.082428%2014.731516-4.269233%2018.72343399l-152.386666%2095.85820799C376.94541232%20797.35926142%20374.43933532%20798.03464342%20371.97316732%20798.03464342z'%20fill='%23ffffff'%20p-id='9524'%3e%3c/path%3e%3c/svg%3e",U9n="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1715236437011'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='9730'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M458.64625344%20800.05792025c0%2063.6614775-51.61300594%20115.26776813-115.28119969%20115.26776811l-1.38434157%200c-63.66819281%200-115.28023969-51.60629062-115.28023968-115.26776811L226.70047344%20193.01317679c0-63.6614775%2051.61204687-115.26776813%20115.28023968-115.26776812l1.38434157%200c63.66819281%200%20115.28119969%2051.60629062%20115.28119968%20115.26776812L458.64625344%20800.05792025zM407.10327969%20193.01317679c0-35.19661689-28.53393375-63.72479437-63.73726594-63.72479437l-1.38434155%200c-35.20333219%200-63.73726594%2028.52721844-63.73726595%2063.72479437L278.24440625%20800.05792025c0%2035.19661689%2028.53393375%2063.72479437%2063.73726593%2063.72479436l1.38434157%200c35.20333219%200%2063.73726594-28.52721844%2063.73726594-63.72479436L407.10327969%20193.01317679z'%20fill='%23ffffff'%20p-id='9731'%3e%3c/path%3e%3cpath%20d='M316.90235655%20296.80520618c-7.12221094%200-12.88598345-5.76377249-12.88598342-12.88598344l0-51.54393281c0-7.12221094%205.76377249-12.88598345%2012.88598342-12.88598343%207.10973938%200%2012.88598345%205.76377249%2012.88598345%2012.88598343l0%2051.54393281C329.78738%20291.0414337%20324.01209594%20296.80520618%20316.90235655%20296.80520618z'%20fill='%23ffffff'%20p-id='9732'%3e%3c/path%3e%3cpath%20d='M316.90235655%20335.46219649c-7.12221094%200-12.88598345-5.76281251-12.88598342-12.88598343l0-5.3359022c0-7.12221094%205.76377249-12.88598345%2012.88598342-12.88598344%207.10973938%200%2012.88598345%205.76377249%2012.88598345%2012.88598344l0%205.3359022C329.78738%20329.69938399%20324.01209594%20335.46219649%20316.90235655%20335.46219649z'%20fill='%23ffffff'%20p-id='9733'%3e%3c/path%3e%3cpath%20d='M790.66253055%20800.05792025c0%2063.6614775-51.60629062%20115.26776813-115.28119969%20115.26776811l-1.3833825%200c-63.67394906%200-115.28023969-51.60629062-115.28023968-115.26776811L558.71770961%20193.01317679c0-63.6614775%2051.60629062-115.26776813%20115.28023969-115.26776812l1.3833825%200c63.67490812%200%20115.28119969%2051.60629062%20115.28119969%20115.26776812L790.66253055%20800.05792025zM739.11859774%20193.01317679c0-35.19661689-28.5281775-63.72479437-63.73726594-63.72479437l-1.3833825%200c-35.2100475%200-63.73726594%2028.52721844-63.73726594%2063.72479437L610.26068336%20800.05792025c0%2035.19661689%2028.52721844%2063.72479437%2063.73726594%2063.72479436l1.3833825%200c35.20908844%200%2063.73726594-28.52721844%2063.73726594-63.72479436L739.11859774%20193.01317679z'%20fill='%23ffffff'%20p-id='9734'%3e%3c/path%3e%3c/svg%3e",G9n="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1715236465064'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='9940'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M844.8%20247.466667c0-17.066667-17.066667-34.133333-34.133333-34.133334s-34.133333%2012.8-34.133334%2034.133334v68.266666c-8.533333-17.066667-21.333333-29.866667-29.866666-38.4C682.666667%20217.6%20601.6%20179.2%20512%20179.2c-183.466667%200-332.8%20149.333333-332.8%20332.8s149.333333%20332.8%20332.8%20332.8c89.6%200%20170.666667-34.133333%20234.666667-98.133333%2012.8-12.8%2012.8-34.133333%200-46.933334s-34.133333-12.8-46.933334%200c-51.2%2051.2-119.466667%2076.8-187.733333%2076.8-145.066667%200-264.533333-119.466667-264.533333-264.533333S366.933333%20243.2%20512%20243.2c72.533333%200%20136.533333%2025.6%20187.733333%2076.8l38.4%2038.4h-76.8c-17.066667%200-34.133333%2012.8-34.133333%2034.133333s12.8%2034.133333%2034.133333%2034.133334H823.466667s4.266667%200%204.266666-4.266667c0%200%204.266667%200%204.266667-4.266667l4.266667-4.266666%204.266666-4.266667v-4.266667-157.866666z'%20p-id='9941'%20fill='%23ffffff'%3e%3c/path%3e%3c/svg%3e";/*!
32664
32664
  * vue-router v4.5.1
32665
32665
  * (c) 2025 Eduardo San Martin Morote
32666
32666
  * @license MIT
@@ -33375,7 +33375,7 @@ void main() {
33375
33375
  `;n=n.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,""),n=jl.replaceStringVariables(n),r=new Function("data",n)(t)}catch{}return r}static conditionLogic(e,t){var a,o;if(!((o=(a=e.condition)==null?void 0:a.list)!=null&&o.length))return!0;const r=l=>{if(l.type==="field"){if(!l.conditionName)return!1;const u=t[l.conditionName];if(u===void 0)return!1;const c=l.conditionValue;switch(l.conditionExpression){case"eq":return u.toString()===(c||"").toString();case"neq":return u!==c;case"lt":return u<Number(c);case"gt":return u>Number(c);case"lte":return u<=Number(c);case"gte":return u>=Number(c);case"includes":return u.includes(c);case"noincludes":return!u.includes(c);default:return!1}}if(l.type==="custom")try{let u=`
33376
33376
  ${l.customValue}
33377
33377
  return condition(data);
33378
- `;return u=u.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,""),u=jl.replaceStringVariables(u),new Function("data",u)(t)}catch{return!1}return!1},n=e.condition.list.map(r);return e.condition.type==="and"?n.every(Boolean):n.some(Boolean)}}pr(bi,"actions",new Set([{type:"link",parser:X7n},{type:"sendApi",parser:q7n},{type:"move",parser:Y7n},{type:"scale",parser:Q7n},{type:"rotate",parser:K7n},{type:"updatePage",parser:J7n},{type:"invoke",parser:Z7n},{type:"fullscreen",parser:rTn},{type:"updateVariable",parser:iTn},{type:"updateWidget",parser:nTn},{type:"ueCommonsWebscoket",parser:sTn},{type:"ueShjExecMethod",parser:aTn},{type:"unityWebglExecMethod",parser:oTn},{type:"unityIframeExecMethod",parser:lTn},{type:"vrSceneMethod",parser:uTn},{type:"refreshVariable",parser:cTn}]));const drt=(i,e)=>{i&&i.setField&&i.setType!==0&&(i.setType===1&&localStorage.setItem("Local_"+i.setField,JSON.stringify(e)),i.setType===2&&sessionStorage.setItem("Session_"+i.setField,JSON.stringify(e)))},oS=class oS{static executeAllVariable(e){e.forEach(t=>{t.sources.isVariable=!0}),oS.setVariables(e),e.forEach(t=>{pl.parse({sources:[t.sources],noUseMapping:!0,callback:r=>{oS.setVariableById(t,r,!1)}})})}static replaceObjectVariables(e){const t=this.replaceStringVariables(JSON.stringify(e));return JSON.parse(t)}static replaceStringVariables(e){return e.replace(/\$g\{([^}]+)\}/g,(t,r)=>{const{varName:n,propPath:s}=this.parseVariablePath(r),a=this.getVariables().find(l=>l.name===n);if(!a)return t;let o=a._value;try{for(const l of s){if(o==null){o=void 0;break}o=o[l]}}catch{return"undefined"}return typeof o=="object"?JSON.stringify(o):o===void 0?"undefined":String(o)})}static getObjectVariableNames(e){return this.getStringVariableNames(JSON.stringify(e))}static getStringVariableNames(e){const t=new Set,r=/\$g\{([^}]+)\}/g;for(const n of e.matchAll(r)){const s=n[1],{varName:a}=this.parseVariablePath(s);a&&t.add(a)}return Array.from(t)}static parseVariablePath(e){const r=e.replace(/\[/g,".").replace(/\]/g,"").split("."),n=r[0],s=r.slice(1);return{varName:n,propPath:s}}static getEnvironments(){return window._apiEnvironment}static setEnvironments(e){const t=e.find(r=>r.selected);t&&(window._apiEnvironment={envName:t.envName,envBaseUrl:t.envBaseUrl})}static getVariables(){return window._variables||[]}static setVariables(e){window._variables=Ht.cloneDeep(e),window._variables.forEach(t=>{t._callbacks??(t._callbacks=new Map)})}static setVariableById(e,t,r=!0){const n=this.getVariableById(e.id);if(n){n._value=t,n._initialState??(n._initialState=!0);try{drt(e.sources.source.storage,t)}catch{}n._callbacks??(n._callbacks=new Map),n._callbacks.forEach(s=>s(e._value)),r&&Z6.updateWidgetVariableData(n)}}static getVariableById(e){return window._variables.find(t=>t.id===e)}static getVariableByName(e){return window._variables.find(t=>t.name===e)}static getVariableValueByName(e){const t=window._variables.find(r=>r.name===e);return t?t._value:null}static noneData(e){return{id:e,finalKeyData:{id:e,data:null},finalUserData:{id:e,data:null},filteredData:null,rawData:null,noMappingData:null}}};pr(oS,"addVariable",e=>{pl.parse({sources:[e.sources],noUseMapping:!0,callback:t=>{oS.getVariables().push(e),oS.setVariableById(e,t,!1)}})}),pr(oS,"updateVariable",e=>{pl.parse({sources:[e.sources],noUseMapping:!0,callback:t=>{oS.setVariableById(e,t,!1)}})}),pr(oS,"deleteVariableById",e=>{const t=window._variables.findIndex(r=>r.id===e);t>-1&&window._variables.splice(t,1)});let jl=oS;const dTn=(i,e,t)=>{try{const r=jl.replaceObjectVariables(i.source.static);pl.processData(i.source,r,i.id,e).then(n=>{t(n)}).catch(()=>{t(jl.noneData(i.id))});return}catch{t(jl.noneData(i.id))}},hTn=(i,e,t)=>{try{let r={};const n=new URLSearchParams(window.location.search);if(n.toString()&&(r=Object.fromEntries(n.entries())),Object.keys(r).length===0&&window.location.hash){const s=window.location.hash.indexOf("?");if(s!==-1){const a=window.location.hash.substring(s+1),o=new URLSearchParams(a);r=Object.fromEntries(o.entries())}}pl.processData(i.source,r,i.id,e).then(s=>{t(s)}).catch(()=>{t(jl.noneData(i.id))});return}catch{t(jl.noneData(i.id))}},fTn=(i,e,t)=>{try{const r=jl.getVariableByName(i.source.variableId);if(!r){t(jl.noneData(i.id));return}pl.processData(i.source,r._value,i.id,e).then(n=>{t(n)}).catch(()=>{t(jl.noneData(i.id))});return}catch{t(jl.noneData(i.id))}};class pTn{constructor(){pr(this,"instance");this.instance=ile.create(),this.instance.interceptors.response.use(e=>{try{const t=e.config,r=Z6.getGlobalEvent(),n=Z6.getGlobalApiListenter();n.length&&n.forEach(s=>{s.type==="include"&&t.url.includes(s.url)&&bi.parseEvents(r,"on-global-api-listenter",e),s.type==="exclude"&&(t.url.includes(s.url)||bi.parseEvents(r,"on-global-api-listenter",e)),s.type==="equal"&&t.url===s.url&&bi.parseEvents(r,"on-global-api-listenter",e),s.type==="notEqual"&&t.url!==s.url&&bi.parseEvents(r,"on-global-api-listenter",e)})}catch{}return e})}get(e,t){return this.instance.get(e,t)}post(e,t,r,n="application/json; charset=UTF-8"){const s={headers:{"Content-Type":"application/json; charset=UTF-8"}};if(n==="multipart/form-data"){s.headers={};const a=new FormData;for(const o in t)a.append(o,t[o]);t=a}else n==="application/x-www-form-urlencoded; charset=UTF-8"&&(s.headers["Content-Type"]="application/x-www-form-urlencoded; charset=UTF-8",s.transformRequest=[a=>{const o=new URLSearchParams;for(const l in a)o.append(l,a[l]);return o.toString()}]);return this.instance.post(e,t,Ht.merge({},s,r))}put(e,t,r,n="application/x-www-form-urlencoded; charset=UTF-8"){const s={headers:{"Content-Type":n}};if(n==="multipart/form-data"){s.headers={};const a=new FormData;for(const o in t)a.append(o,t[o]);t=a}else n==="application/x-www-form-urlencoded; charset=UTF-8"&&(s.headers["Content-Type"]="application/x-www-form-urlencoded; charset=UTF-8",s.transformRequest=[a=>{const o=new URLSearchParams;for(const l in a)o.append(l,a[l]);return o.toString()}]);return this.instance.put(e,t,Ht.merge({},s,r))}delete(e,t){const r={headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}};return this.instance.delete(e,Ht.merge({},r,t))}upload(e,t,r){const n={headers:{"Content-Type":"multipart/form-data"}};return this.instance.post(e,t,r||n)}download(e,t,r){const n={responseType:"blob",headers:{"Content-Type":"application/json"}};return this.instance.post(e,t,r||n)}custom(e,t){return this.instance.get(e,t)}}const qxe=new pTn,mTn=async(i,e,t)=>{var m;const r=i==null?void 0:i.id,n=(m=i==null?void 0:i.source)==null?void 0:m.api,s=x=>{t(jl.noneData(x))};if(!n||!r)return s(r||"");const{isHeaders:a,isBody:o,headers:l,contentType:u,url:c,postParam:d,type:h,isUseEnv:p=!0}=n;try{const v=jl.getEnvironments().envBaseUrl??"",y=p?v:"",E=jl.replaceStringVariables(c),S=a?jl.replaceObjectVariables(l):{},C=o?jl.replaceObjectVariables(d):{},T=y+E;if(!T)return s(r);let I;switch(h){case"GET":I=qxe.get(T,{headers:S});break;case"POST":I=qxe.post(T,C,{headers:S},u);break;case"PUT":I=qxe.put(T,C,{headers:S},u);break;case"DELETE":I=qxe.delete(T,{headers:S});break;default:return s(r)}const B=await I;if(B.status===200){const O=await pl.processData(i.source,B.data,r,e);O?t(O):s(r)}else s(r)}catch{s(r)}},gTn=(i,e,t)=>{try{if(!i.source.storage){t(jl.noneData(i.id));return}const{getType:r,getField:n}=i.source.storage;if(r===0){t(jl.noneData(i.id));return}if(!n){t(jl.noneData(i.id));return}let s=null;r===1&&(s=localStorage.getItem("Local_"+n)),r===2&&(s=sessionStorage.getItem("Session_"+n)),pl.processData(i.source,s,i.id,e).then(a=>{t(a)}).catch(()=>{t(jl.noneData(i.id))});return}catch{t(jl.noneData(i.id))}};var hrt=Object.defineProperty,xTn=Object.getOwnPropertyDescriptor,vTn=Object.getOwnPropertyNames,yTn=Object.prototype.hasOwnProperty,Ey=(i,e)=>()=>(i&&(e=i(i=0)),e),Sn=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),OH=(i,e)=>{for(var t in e)hrt(i,t,{get:e[t],enumerable:!0})},DTn=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of vTn(e))!yTn.call(i,n)&&n!==t&&hrt(i,n,{get:()=>e[n],enumerable:!(r=xTn(e,n))||r.enumerable});return i},Ch=i=>DTn(hrt({},"__esModule",{value:!0}),i),gn=Ey(()=>{}),wd={};OH(wd,{_debugEnd:()=>Yrt,_debugProcess:()=>Xrt,_events:()=>uit,_eventsCount:()=>cit,_exiting:()=>Irt,_fatalExceptions:()=>jrt,_getActiveHandles:()=>W6r,_getActiveRequests:()=>H6r,_kill:()=>Ort,_linkedBinding:()=>z6r,_maxListeners:()=>lit,_preload_modules:()=>sit,_rawDebug:()=>Frt,_startProfilerIdleNotifier:()=>qrt,_stopProfilerIdleNotifier:()=>Qrt,_tickCallback:()=>Wrt,abort:()=>$rt,addListener:()=>dit,allowedNodeEnvironmentFlags:()=>Grt,arch:()=>mrt,argv:()=>vrt,argv0:()=>nit,assert:()=>X6r,binding:()=>_rt,browser:()=>wrt,chdir:()=>Crt,config:()=>Mrt,cpuUsage:()=>Ete,cwd:()=>Srt,debugPort:()=>iit,default:()=>yit,dlopen:()=>j6r,domain:()=>Prt,emit:()=>git,emitWarning:()=>brt,env:()=>xrt,execArgv:()=>yrt,execPath:()=>rit,exit:()=>Vrt,features:()=>zrt,hasUncaughtExceptionCaptureCallback:()=>Y6r,hrtime:()=>Qxe,kill:()=>krt,listeners:()=>Q6r,memoryUsage:()=>Nrt,moduleLoadList:()=>Rrt,nextTick:()=>U6r,off:()=>fit,on:()=>o9,once:()=>hit,openStdin:()=>Urt,pid:()=>eit,platform:()=>grt,ppid:()=>tit,prependListener:()=>xit,prependOnceListener:()=>vit,reallyExit:()=>Brt,release:()=>Trt,removeAllListeners:()=>mit,removeListener:()=>pit,resourceUsage:()=>Lrt,setSourceMapsEnabled:()=>ait,setUncaughtExceptionCaptureCallback:()=>Hrt,stderr:()=>Jrt,stdin:()=>Zrt,stdout:()=>Krt,title:()=>prt,umask:()=>Art,uptime:()=>q6r,version:()=>Drt,versions:()=>Ert});function frt(i){throw new Error("Node.js process "+i+" is not supported by JSPM core outside of Node.js")}function ETn(){!UO||!GO||(UO=!1,GO.length?$6=GO.concat($6):Dte=-1,$6.length&&V6r())}function V6r(){if(!UO){var i=setTimeout(ETn,0);UO=!0;for(var e=$6.length;e;){for(GO=$6,$6=[];++Dte<e;)GO&&GO[Dte].run();Dte=-1,e=$6.length}GO=null,UO=!1,clearTimeout(i)}}function U6r(i){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];$6.push(new G6r(i,e)),$6.length===1&&!UO&&setTimeout(V6r,0)}function G6r(i,e){this.fun=i,this.array=e}function mx(){}function z6r(i){frt("_linkedBinding")}function j6r(i){frt("dlopen")}function H6r(){return[]}function W6r(){return[]}function X6r(i,e){if(!i)throw new Error(e||"assertion error")}function Y6r(){return!1}function q6r(){return l9.now()/1e3}function Qxe(i){var e=Math.floor((Date.now()-l9.now())*.001),t=l9.now()*.001,r=Math.floor(t)+e,n=Math.floor(t%1*1e9);return i&&(r=r-i[0],n=n-i[1],n<0&&(r--,n+=Kxe)),[r,n]}function o9(){return yit}function Q6r(i){return[]}var $6,UO,GO,Dte,prt,mrt,grt,xrt,vrt,yrt,Drt,Ert,brt,_rt,Art,Srt,Crt,Trt,wrt,Frt,Rrt,Prt,Irt,Mrt,Brt,Ort,Ete,Lrt,Nrt,krt,Vrt,Urt,Grt,zrt,jrt,Hrt,Wrt,Xrt,Yrt,qrt,Qrt,Krt,Jrt,Zrt,$rt,eit,tit,rit,iit,nit,sit,ait,l9,oit,Kxe,lit,uit,cit,dit,hit,fit,pit,mit,git,xit,vit,yit,bTn=Ey(()=>{gn(),vn(),xn(),$6=[],UO=!1,Dte=-1,G6r.prototype.run=function(){this.fun.apply(null,this.array)},prt="browser",mrt="x64",grt="browser",xrt={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},vrt=["/usr/bin/node"],yrt=[],Drt="v16.8.0",Ert={},brt=function(i,e){},_rt=function(i){frt("binding")},Art=function(i){return 0},Srt=function(){return"/"},Crt=function(i){},Trt={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},wrt=!0,Frt=mx,Rrt=[],Prt={},Irt=!1,Mrt={},Brt=mx,Ort=mx,Ete=function(){return{}},Lrt=Ete,Nrt=Ete,krt=mx,Vrt=mx,Urt=mx,Grt={},zrt={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},jrt=mx,Hrt=mx,Wrt=mx,Xrt=mx,Yrt=mx,qrt=mx,Qrt=mx,Krt=void 0,Jrt=void 0,Zrt=void 0,$rt=mx,eit=2,tit=1,rit="/bin/usr/node",iit=9229,nit="node",sit=[],ait=mx,l9={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0},l9.now===void 0&&(oit=Date.now(),l9.timing&&l9.timing.navigationStart&&(oit=l9.timing.navigationStart),l9.now=()=>Date.now()-oit),Kxe=1e9,Qxe.bigint=function(i){var e=Qxe(i);return typeof BigInt>"u"?e[0]*Kxe+e[1]:BigInt(e[0]*Kxe)+BigInt(e[1])},lit=10,uit={},cit=0,dit=o9,hit=o9,fit=o9,pit=o9,mit=o9,git=mx,xit=o9,vit=o9,yit={version:Drt,versions:Ert,arch:mrt,platform:grt,browser:wrt,release:Trt,_rawDebug:Frt,moduleLoadList:Rrt,binding:_rt,_linkedBinding:z6r,_events:uit,_eventsCount:cit,_maxListeners:lit,on:o9,addListener:dit,once:hit,off:fit,removeListener:pit,removeAllListeners:mit,emit:git,prependListener:xit,prependOnceListener:vit,listeners:Q6r,domain:Prt,_exiting:Irt,config:Mrt,dlopen:j6r,uptime:q6r,_getActiveRequests:H6r,_getActiveHandles:W6r,reallyExit:Brt,_kill:Ort,cpuUsage:Ete,resourceUsage:Lrt,memoryUsage:Nrt,kill:krt,exit:Vrt,openStdin:Urt,allowedNodeEnvironmentFlags:Grt,assert:X6r,features:zrt,_fatalExceptions:jrt,setUncaughtExceptionCaptureCallback:Hrt,hasUncaughtExceptionCaptureCallback:Y6r,emitWarning:brt,nextTick:U6r,_tickCallback:Wrt,_debugProcess:Xrt,_debugEnd:Yrt,_startProfilerIdleNotifier:qrt,_stopProfilerIdleNotifier:Qrt,stdout:Krt,stdin:Zrt,stderr:Jrt,abort:$rt,umask:Art,chdir:Crt,cwd:Srt,env:xrt,title:prt,argv:vrt,execArgv:yrt,pid:eit,ppid:tit,execPath:rit,debugPort:iit,hrtime:Qxe,argv0:nit,_preload_modules:sit,setSourceMapsEnabled:ait}}),xn=Ey(()=>{bTn()});function _Tn(){if(Dit)return LH;Dit=!0,LH.byteLength=o,LH.toByteArray=u,LH.fromByteArray=h;for(var i=[],e=[],t=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,s=r.length;n<s;++n)i[n]=r[n],e[r.charCodeAt(n)]=n;e[45]=62,e[95]=63;function a(p){var m=p.length;if(m%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var x=p.indexOf("=");x===-1&&(x=m);var v=x===m?0:4-x%4;return[x,v]}function o(p){var m=a(p),x=m[0],v=m[1];return(x+v)*3/4-v}function l(p,m,x){return(m+x)*3/4-x}function u(p){var m,x=a(p),v=x[0],y=x[1],E=new t(l(p,v,y)),S=0,C=y>0?v-4:v,T;for(T=0;T<C;T+=4)m=e[p.charCodeAt(T)]<<18|e[p.charCodeAt(T+1)]<<12|e[p.charCodeAt(T+2)]<<6|e[p.charCodeAt(T+3)],E[S++]=m>>16&255,E[S++]=m>>8&255,E[S++]=m&255;return y===2&&(m=e[p.charCodeAt(T)]<<2|e[p.charCodeAt(T+1)]>>4,E[S++]=m&255),y===1&&(m=e[p.charCodeAt(T)]<<10|e[p.charCodeAt(T+1)]<<4|e[p.charCodeAt(T+2)]>>2,E[S++]=m>>8&255,E[S++]=m&255),E}function c(p){return i[p>>18&63]+i[p>>12&63]+i[p>>6&63]+i[p&63]}function d(p,m,x){for(var v,y=[],E=m;E<x;E+=3)v=(p[E]<<16&16711680)+(p[E+1]<<8&65280)+(p[E+2]&255),y.push(c(v));return y.join("")}function h(p){for(var m,x=p.length,v=x%3,y=[],E=16383,S=0,C=x-v;S<C;S+=E)y.push(d(p,S,S+E>C?C:S+E));return v===1?(m=p[x-1],y.push(i[m>>2]+i[m<<4&63]+"==")):v===2&&(m=(p[x-2]<<8)+p[x-1],y.push(i[m>>10]+i[m>>4&63]+i[m<<2&63]+"=")),y.join("")}return LH}function ATn(){return Eit?bte:(Eit=!0,bte.read=function(i,e,t,r,n){var s,a,o=n*8-r-1,l=(1<<o)-1,u=l>>1,c=-7,d=t?n-1:0,h=t?-1:1,p=i[e+d];for(d+=h,s=p&(1<<-c)-1,p>>=-c,c+=o;c>0;s=s*256+i[e+d],d+=h,c-=8);for(a=s&(1<<-c)-1,s>>=-c,c+=r;c>0;a=a*256+i[e+d],d+=h,c-=8);if(s===0)s=1-u;else{if(s===l)return a?NaN:(p?-1:1)*(1/0);a=a+Math.pow(2,r),s=s-u}return(p?-1:1)*a*Math.pow(2,s-r)},bte.write=function(i,e,t,r,n,s){var a,o,l,u=s*8-n-1,c=(1<<u)-1,d=c>>1,h=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:s-1,m=r?1:-1,x=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+d>=1?e+=h/l:e+=h*Math.pow(2,1-d),e*l>=2&&(a++,l/=2),a+d>=c?(o=0,a=c):a+d>=1?(o=(e*l-1)*Math.pow(2,n),a=a+d):(o=e*Math.pow(2,d-1)*Math.pow(2,n),a=0));n>=8;i[t+p]=o&255,p+=m,o/=256,n-=8);for(a=a<<n|o,u+=n;u>0;i[t+p]=a&255,p+=m,a/=256,u-=8);i[t+p-m]|=x*128},bte)}function STn(){if(bit)return HF;bit=!0;let i=_Tn(),e=ATn(),t=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;HF.Buffer=a,HF.SlowBuffer=y,HF.INSPECT_MAX_BYTES=50;let r=2147483647;HF.kMaxLength=r,a.TYPED_ARRAY_SUPPORT=n(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u";function n(){try{let Ce=new Uint8Array(1),Pe={foo:function(){return 42}};return Object.setPrototypeOf(Pe,Uint8Array.prototype),Object.setPrototypeOf(Ce,Pe),Ce.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function s(Ce){if(Ce>r)throw new RangeError('The value "'+Ce+'" is invalid for option "size"');let Pe=new Uint8Array(Ce);return Object.setPrototypeOf(Pe,a.prototype),Pe}function a(Ce,Pe,ke){if(typeof Ce=="number"){if(typeof Pe=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return c(Ce)}return o(Ce,Pe,ke)}a.poolSize=8192;function o(Ce,Pe,ke){if(typeof Ce=="string")return d(Ce,Pe);if(ArrayBuffer.isView(Ce))return p(Ce);if(Ce==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Ce);if(bt(Ce,ArrayBuffer)||Ce&&bt(Ce.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(bt(Ce,SharedArrayBuffer)||Ce&&bt(Ce.buffer,SharedArrayBuffer)))return m(Ce,Pe,ke);if(typeof Ce=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let Ye=Ce.valueOf&&Ce.valueOf();if(Ye!=null&&Ye!==Ce)return a.from(Ye,Pe,ke);let Me=x(Ce);if(Me)return Me;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Ce[Symbol.toPrimitive]=="function")return a.from(Ce[Symbol.toPrimitive]("string"),Pe,ke);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Ce)}a.from=function(Ce,Pe,ke){return o(Ce,Pe,ke)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function l(Ce){if(typeof Ce!="number")throw new TypeError('"size" argument must be of type number');if(Ce<0)throw new RangeError('The value "'+Ce+'" is invalid for option "size"')}function u(Ce,Pe,ke){return l(Ce),Ce<=0?s(Ce):Pe!==void 0?typeof ke=="string"?s(Ce).fill(Pe,ke):s(Ce).fill(Pe):s(Ce)}a.alloc=function(Ce,Pe,ke){return u(Ce,Pe,ke)};function c(Ce){return l(Ce),s(Ce<0?0:v(Ce)|0)}a.allocUnsafe=function(Ce){return c(Ce)},a.allocUnsafeSlow=function(Ce){return c(Ce)};function d(Ce,Pe){if((typeof Pe!="string"||Pe==="")&&(Pe="utf8"),!a.isEncoding(Pe))throw new TypeError("Unknown encoding: "+Pe);let ke=E(Ce,Pe)|0,Ye=s(ke),Me=Ye.write(Ce,Pe);return Me!==ke&&(Ye=Ye.slice(0,Me)),Ye}function h(Ce){let Pe=Ce.length<0?0:v(Ce.length)|0,ke=s(Pe);for(let Ye=0;Ye<Pe;Ye+=1)ke[Ye]=Ce[Ye]&255;return ke}function p(Ce){if(bt(Ce,Uint8Array)){let Pe=new Uint8Array(Ce);return m(Pe.buffer,Pe.byteOffset,Pe.byteLength)}return h(Ce)}function m(Ce,Pe,ke){if(Pe<0||Ce.byteLength<Pe)throw new RangeError('"offset" is outside of buffer bounds');if(Ce.byteLength<Pe+(ke||0))throw new RangeError('"length" is outside of buffer bounds');let Ye;return Pe===void 0&&ke===void 0?Ye=new Uint8Array(Ce):ke===void 0?Ye=new Uint8Array(Ce,Pe):Ye=new Uint8Array(Ce,Pe,ke),Object.setPrototypeOf(Ye,a.prototype),Ye}function x(Ce){if(a.isBuffer(Ce)){let Pe=v(Ce.length)|0,ke=s(Pe);return ke.length===0||Ce.copy(ke,0,0,Pe),ke}if(Ce.length!==void 0)return typeof Ce.length!="number"||$t(Ce.length)?s(0):h(Ce);if(Ce.type==="Buffer"&&Array.isArray(Ce.data))return h(Ce.data)}function v(Ce){if(Ce>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return Ce|0}function y(Ce){return+Ce!=Ce&&(Ce=0),a.alloc(+Ce)}a.isBuffer=function(Ce){return Ce!=null&&Ce._isBuffer===!0&&Ce!==a.prototype},a.compare=function(Ce,Pe){if(bt(Ce,Uint8Array)&&(Ce=a.from(Ce,Ce.offset,Ce.byteLength)),bt(Pe,Uint8Array)&&(Pe=a.from(Pe,Pe.offset,Pe.byteLength)),!a.isBuffer(Ce)||!a.isBuffer(Pe))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Ce===Pe)return 0;let ke=Ce.length,Ye=Pe.length;for(let Me=0,et=Math.min(ke,Ye);Me<et;++Me)if(Ce[Me]!==Pe[Me]){ke=Ce[Me],Ye=Pe[Me];break}return ke<Ye?-1:Ye<ke?1:0},a.isEncoding=function(Ce){switch(String(Ce).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}},a.concat=function(Ce,Pe){if(!Array.isArray(Ce))throw new TypeError('"list" argument must be an Array of Buffers');if(Ce.length===0)return a.alloc(0);let ke;if(Pe===void 0)for(Pe=0,ke=0;ke<Ce.length;++ke)Pe+=Ce[ke].length;let Ye=a.allocUnsafe(Pe),Me=0;for(ke=0;ke<Ce.length;++ke){let et=Ce[ke];if(bt(et,Uint8Array))Me+et.length>Ye.length?(a.isBuffer(et)||(et=a.from(et)),et.copy(Ye,Me)):Uint8Array.prototype.set.call(Ye,et,Me);else if(a.isBuffer(et))et.copy(Ye,Me);else throw new TypeError('"list" argument must be an Array of Buffers');Me+=et.length}return Ye};function E(Ce,Pe){if(a.isBuffer(Ce))return Ce.length;if(ArrayBuffer.isView(Ce)||bt(Ce,ArrayBuffer))return Ce.byteLength;if(typeof Ce!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Ce);let ke=Ce.length,Ye=arguments.length>2&&arguments[2]===!0;if(!Ye&&ke===0)return 0;let Me=!1;for(;;)switch(Pe){case"ascii":case"latin1":case"binary":return ke;case"utf8":case"utf-8":return Ke(Ce).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ke*2;case"hex":return ke>>>1;case"base64":return xt(Ce).length;default:if(Me)return Ye?-1:Ke(Ce).length;Pe=(""+Pe).toLowerCase(),Me=!0}}a.byteLength=E;function S(Ce,Pe,ke){let Ye=!1;if((Pe===void 0||Pe<0)&&(Pe=0),Pe>this.length||((ke===void 0||ke>this.length)&&(ke=this.length),ke<=0)||(ke>>>=0,Pe>>>=0,ke<=Pe))return"";for(Ce||(Ce="utf8");;)switch(Ce){case"hex":return ee(this,Pe,ke);case"utf8":case"utf-8":return Y(this,Pe,ke);case"ascii":return J(this,Pe,ke);case"latin1":case"binary":return $(this,Pe,ke);case"base64":return j(this,Pe,ke);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae(this,Pe,ke);default:if(Ye)throw new TypeError("Unknown encoding: "+Ce);Ce=(Ce+"").toLowerCase(),Ye=!0}}a.prototype._isBuffer=!0;function C(Ce,Pe,ke){let Ye=Ce[Pe];Ce[Pe]=Ce[ke],Ce[ke]=Ye}a.prototype.swap16=function(){let Ce=this.length;if(Ce%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Pe=0;Pe<Ce;Pe+=2)C(this,Pe,Pe+1);return this},a.prototype.swap32=function(){let Ce=this.length;if(Ce%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let Pe=0;Pe<Ce;Pe+=4)C(this,Pe,Pe+3),C(this,Pe+1,Pe+2);return this},a.prototype.swap64=function(){let Ce=this.length;if(Ce%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let Pe=0;Pe<Ce;Pe+=8)C(this,Pe,Pe+7),C(this,Pe+1,Pe+6),C(this,Pe+2,Pe+5),C(this,Pe+3,Pe+4);return this},a.prototype.toString=function(){let Ce=this.length;return Ce===0?"":arguments.length===0?Y(this,0,Ce):S.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(Ce){if(!a.isBuffer(Ce))throw new TypeError("Argument must be a Buffer");return this===Ce?!0:a.compare(this,Ce)===0},a.prototype.inspect=function(){let Ce="",Pe=HF.INSPECT_MAX_BYTES;return Ce=this.toString("hex",0,Pe).replace(/(.{2})/g,"$1 ").trim(),this.length>Pe&&(Ce+=" ... "),"<Buffer "+Ce+">"},t&&(a.prototype[t]=a.prototype.inspect),a.prototype.compare=function(Ce,Pe,ke,Ye,Me){if(bt(Ce,Uint8Array)&&(Ce=a.from(Ce,Ce.offset,Ce.byteLength)),!a.isBuffer(Ce))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Ce);if(Pe===void 0&&(Pe=0),ke===void 0&&(ke=Ce?Ce.length:0),Ye===void 0&&(Ye=0),Me===void 0&&(Me=this.length),Pe<0||ke>Ce.length||Ye<0||Me>this.length)throw new RangeError("out of range index");if(Ye>=Me&&Pe>=ke)return 0;if(Ye>=Me)return-1;if(Pe>=ke)return 1;if(Pe>>>=0,ke>>>=0,Ye>>>=0,Me>>>=0,this===Ce)return 0;let et=Me-Ye,ot=ke-Pe,vt=Math.min(et,ot),At=this.slice(Ye,Me),cr=Ce.slice(Pe,ke);for(let Br=0;Br<vt;++Br)if(At[Br]!==cr[Br]){et=At[Br],ot=cr[Br];break}return et<ot?-1:ot<et?1:0};function T(Ce,Pe,ke,Ye,Me){if(Ce.length===0)return-1;if(typeof ke=="string"?(Ye=ke,ke=0):ke>2147483647?ke=2147483647:ke<-2147483648&&(ke=-2147483648),ke=+ke,$t(ke)&&(ke=Me?0:Ce.length-1),ke<0&&(ke=Ce.length+ke),ke>=Ce.length){if(Me)return-1;ke=Ce.length-1}else if(ke<0)if(Me)ke=0;else return-1;if(typeof Pe=="string"&&(Pe=a.from(Pe,Ye)),a.isBuffer(Pe))return Pe.length===0?-1:I(Ce,Pe,ke,Ye,Me);if(typeof Pe=="number")return Pe=Pe&255,typeof Uint8Array.prototype.indexOf=="function"?Me?Uint8Array.prototype.indexOf.call(Ce,Pe,ke):Uint8Array.prototype.lastIndexOf.call(Ce,Pe,ke):I(Ce,[Pe],ke,Ye,Me);throw new TypeError("val must be string, number or Buffer")}function I(Ce,Pe,ke,Ye,Me){let et=1,ot=Ce.length,vt=Pe.length;if(Ye!==void 0&&(Ye=String(Ye).toLowerCase(),Ye==="ucs2"||Ye==="ucs-2"||Ye==="utf16le"||Ye==="utf-16le")){if(Ce.length<2||Pe.length<2)return-1;et=2,ot/=2,vt/=2,ke/=2}function At(Br,ei){return et===1?Br[ei]:Br.readUInt16BE(ei*et)}let cr;if(Me){let Br=-1;for(cr=ke;cr<ot;cr++)if(At(Ce,cr)===At(Pe,Br===-1?0:cr-Br)){if(Br===-1&&(Br=cr),cr-Br+1===vt)return Br*et}else Br!==-1&&(cr-=cr-Br),Br=-1}else for(ke+vt>ot&&(ke=ot-vt),cr=ke;cr>=0;cr--){let Br=!0;for(let ei=0;ei<vt;ei++)if(At(Ce,cr+ei)!==At(Pe,ei)){Br=!1;break}if(Br)return cr}return-1}a.prototype.includes=function(Ce,Pe,ke){return this.indexOf(Ce,Pe,ke)!==-1},a.prototype.indexOf=function(Ce,Pe,ke){return T(this,Ce,Pe,ke,!0)},a.prototype.lastIndexOf=function(Ce,Pe,ke){return T(this,Ce,Pe,ke,!1)};function B(Ce,Pe,ke,Ye){ke=Number(ke)||0;let Me=Ce.length-ke;Ye?(Ye=Number(Ye),Ye>Me&&(Ye=Me)):Ye=Me;let et=Pe.length;Ye>et/2&&(Ye=et/2);let ot;for(ot=0;ot<Ye;++ot){let vt=parseInt(Pe.substr(ot*2,2),16);if($t(vt))return ot;Ce[ke+ot]=vt}return ot}function O(Ce,Pe,ke,Ye){return Vt(Ke(Pe,Ce.length-ke),Ce,ke,Ye)}function L(Ce,Pe,ke,Ye){return Vt(ht(Pe),Ce,ke,Ye)}function k(Ce,Pe,ke,Ye){return Vt(xt(Pe),Ce,ke,Ye)}function U(Ce,Pe,ke,Ye){return Vt(St(Pe,Ce.length-ke),Ce,ke,Ye)}a.prototype.write=function(Ce,Pe,ke,Ye){if(Pe===void 0)Ye="utf8",ke=this.length,Pe=0;else if(ke===void 0&&typeof Pe=="string")Ye=Pe,ke=this.length,Pe=0;else if(isFinite(Pe))Pe=Pe>>>0,isFinite(ke)?(ke=ke>>>0,Ye===void 0&&(Ye="utf8")):(Ye=ke,ke=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let Me=this.length-Pe;if((ke===void 0||ke>Me)&&(ke=Me),Ce.length>0&&(ke<0||Pe<0)||Pe>this.length)throw new RangeError("Attempt to write outside buffer bounds");Ye||(Ye="utf8");let et=!1;for(;;)switch(Ye){case"hex":return B(this,Ce,Pe,ke);case"utf8":case"utf-8":return O(this,Ce,Pe,ke);case"ascii":case"latin1":case"binary":return L(this,Ce,Pe,ke);case"base64":return k(this,Ce,Pe,ke);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,Ce,Pe,ke);default:if(et)throw new TypeError("Unknown encoding: "+Ye);Ye=(""+Ye).toLowerCase(),et=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function j(Ce,Pe,ke){return Pe===0&&ke===Ce.length?i.fromByteArray(Ce):i.fromByteArray(Ce.slice(Pe,ke))}function Y(Ce,Pe,ke){ke=Math.min(Ce.length,ke);let Ye=[],Me=Pe;for(;Me<ke;){let et=Ce[Me],ot=null,vt=et>239?4:et>223?3:et>191?2:1;if(Me+vt<=ke){let At,cr,Br,ei;switch(vt){case 1:et<128&&(ot=et);break;case 2:At=Ce[Me+1],(At&192)===128&&(ei=(et&31)<<6|At&63,ei>127&&(ot=ei));break;case 3:At=Ce[Me+1],cr=Ce[Me+2],(At&192)===128&&(cr&192)===128&&(ei=(et&15)<<12|(At&63)<<6|cr&63,ei>2047&&(ei<55296||ei>57343)&&(ot=ei));break;case 4:At=Ce[Me+1],cr=Ce[Me+2],Br=Ce[Me+3],(At&192)===128&&(cr&192)===128&&(Br&192)===128&&(ei=(et&15)<<18|(At&63)<<12|(cr&63)<<6|Br&63,ei>65535&&ei<1114112&&(ot=ei))}}ot===null?(ot=65533,vt=1):ot>65535&&(ot-=65536,Ye.push(ot>>>10&1023|55296),ot=56320|ot&1023),Ye.push(ot),Me+=vt}return q(Ye)}let X=4096;function q(Ce){let Pe=Ce.length;if(Pe<=X)return String.fromCharCode.apply(String,Ce);let ke="",Ye=0;for(;Ye<Pe;)ke+=String.fromCharCode.apply(String,Ce.slice(Ye,Ye+=X));return ke}function J(Ce,Pe,ke){let Ye="";ke=Math.min(Ce.length,ke);for(let Me=Pe;Me<ke;++Me)Ye+=String.fromCharCode(Ce[Me]&127);return Ye}function $(Ce,Pe,ke){let Ye="";ke=Math.min(Ce.length,ke);for(let Me=Pe;Me<ke;++Me)Ye+=String.fromCharCode(Ce[Me]);return Ye}function ee(Ce,Pe,ke){let Ye=Ce.length;(!Pe||Pe<0)&&(Pe=0),(!ke||ke<0||ke>Ye)&&(ke=Ye);let Me="";for(let et=Pe;et<ke;++et)Me+=Xe[Ce[et]];return Me}function ae(Ce,Pe,ke){let Ye=Ce.slice(Pe,ke),Me="";for(let et=0;et<Ye.length-1;et+=2)Me+=String.fromCharCode(Ye[et]+Ye[et+1]*256);return Me}a.prototype.slice=function(Ce,Pe){let ke=this.length;Ce=~~Ce,Pe=Pe===void 0?ke:~~Pe,Ce<0?(Ce+=ke,Ce<0&&(Ce=0)):Ce>ke&&(Ce=ke),Pe<0?(Pe+=ke,Pe<0&&(Pe=0)):Pe>ke&&(Pe=ke),Pe<Ce&&(Pe=Ce);let Ye=this.subarray(Ce,Pe);return Object.setPrototypeOf(Ye,a.prototype),Ye};function ce(Ce,Pe,ke){if(Ce%1!==0||Ce<0)throw new RangeError("offset is not uint");if(Ce+Pe>ke)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(Ce,Pe,ke){Ce=Ce>>>0,Pe=Pe>>>0,ke||ce(Ce,Pe,this.length);let Ye=this[Ce],Me=1,et=0;for(;++et<Pe&&(Me*=256);)Ye+=this[Ce+et]*Me;return Ye},a.prototype.readUintBE=a.prototype.readUIntBE=function(Ce,Pe,ke){Ce=Ce>>>0,Pe=Pe>>>0,ke||ce(Ce,Pe,this.length);let Ye=this[Ce+--Pe],Me=1;for(;Pe>0&&(Me*=256);)Ye+=this[Ce+--Pe]*Me;return Ye},a.prototype.readUint8=a.prototype.readUInt8=function(Ce,Pe){return Ce=Ce>>>0,Pe||ce(Ce,1,this.length),this[Ce]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(Ce,Pe){return Ce=Ce>>>0,Pe||ce(Ce,2,this.length),this[Ce]|this[Ce+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(Ce,Pe){return Ce=Ce>>>0,Pe||ce(Ce,2,this.length),this[Ce]<<8|this[Ce+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(Ce,Pe){return Ce=Ce>>>0,Pe||ce(Ce,4,this.length),(this[Ce]|this[Ce+1]<<8|this[Ce+2]<<16)+this[Ce+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(Ce,Pe){return Ce=Ce>>>0,Pe||ce(Ce,4,this.length),this[Ce]*16777216+(this[Ce+1]<<16|this[Ce+2]<<8|this[Ce+3])},a.prototype.readBigUInt64LE=Oe(function(Ce){Ce=Ce>>>0,De(Ce,"offset");let Pe=this[Ce],ke=this[Ce+7];(Pe===void 0||ke===void 0)&&ze(Ce,this.length-8);let Ye=Pe+this[++Ce]*2**8+this[++Ce]*2**16+this[++Ce]*2**24,Me=this[++Ce]+this[++Ce]*2**8+this[++Ce]*2**16+ke*2**24;return BigInt(Ye)+(BigInt(Me)<<BigInt(32))}),a.prototype.readBigUInt64BE=Oe(function(Ce){Ce=Ce>>>0,De(Ce,"offset");let Pe=this[Ce],ke=this[Ce+7];(Pe===void 0||ke===void 0)&&ze(Ce,this.length-8);let Ye=Pe*2**24+this[++Ce]*2**16+this[++Ce]*2**8+this[++Ce],Me=this[++Ce]*2**24+this[++Ce]*2**16+this[++Ce]*2**8+ke;return(BigInt(Ye)<<BigInt(32))+BigInt(Me)}),a.prototype.readIntLE=function(Ce,Pe,ke){Ce=Ce>>>0,Pe=Pe>>>0,ke||ce(Ce,Pe,this.length);let Ye=this[Ce],Me=1,et=0;for(;++et<Pe&&(Me*=256);)Ye+=this[Ce+et]*Me;return Me*=128,Ye>=Me&&(Ye-=Math.pow(2,8*Pe)),Ye},a.prototype.readIntBE=function(Ce,Pe,ke){Ce=Ce>>>0,Pe=Pe>>>0,ke||ce(Ce,Pe,this.length);let Ye=Pe,Me=1,et=this[Ce+--Ye];for(;Ye>0&&(Me*=256);)et+=this[Ce+--Ye]*Me;return Me*=128,et>=Me&&(et-=Math.pow(2,8*Pe)),et},a.prototype.readInt8=function(Ce,Pe){return Ce=Ce>>>0,Pe||ce(Ce,1,this.length),this[Ce]&128?(255-this[Ce]+1)*-1:this[Ce]},a.prototype.readInt16LE=function(Ce,Pe){Ce=Ce>>>0,Pe||ce(Ce,2,this.length);let ke=this[Ce]|this[Ce+1]<<8;return ke&32768?ke|4294901760:ke},a.prototype.readInt16BE=function(Ce,Pe){Ce=Ce>>>0,Pe||ce(Ce,2,this.length);let ke=this[Ce+1]|this[Ce]<<8;return ke&32768?ke|4294901760:ke},a.prototype.readInt32LE=function(Ce,Pe){return Ce=Ce>>>0,Pe||ce(Ce,4,this.length),this[Ce]|this[Ce+1]<<8|this[Ce+2]<<16|this[Ce+3]<<24},a.prototype.readInt32BE=function(Ce,Pe){return Ce=Ce>>>0,Pe||ce(Ce,4,this.length),this[Ce]<<24|this[Ce+1]<<16|this[Ce+2]<<8|this[Ce+3]},a.prototype.readBigInt64LE=Oe(function(Ce){Ce=Ce>>>0,De(Ce,"offset");let Pe=this[Ce],ke=this[Ce+7];(Pe===void 0||ke===void 0)&&ze(Ce,this.length-8);let Ye=this[Ce+4]+this[Ce+5]*2**8+this[Ce+6]*2**16+(ke<<24);return(BigInt(Ye)<<BigInt(32))+BigInt(Pe+this[++Ce]*2**8+this[++Ce]*2**16+this[++Ce]*2**24)}),a.prototype.readBigInt64BE=Oe(function(Ce){Ce=Ce>>>0,De(Ce,"offset");let Pe=this[Ce],ke=this[Ce+7];(Pe===void 0||ke===void 0)&&ze(Ce,this.length-8);let Ye=(Pe<<24)+this[++Ce]*2**16+this[++Ce]*2**8+this[++Ce];return(BigInt(Ye)<<BigInt(32))+BigInt(this[++Ce]*2**24+this[++Ce]*2**16+this[++Ce]*2**8+ke)}),a.prototype.readFloatLE=function(Ce,Pe){return Ce=Ce>>>0,Pe||ce(Ce,4,this.length),e.read(this,Ce,!0,23,4)},a.prototype.readFloatBE=function(Ce,Pe){return Ce=Ce>>>0,Pe||ce(Ce,4,this.length),e.read(this,Ce,!1,23,4)},a.prototype.readDoubleLE=function(Ce,Pe){return Ce=Ce>>>0,Pe||ce(Ce,8,this.length),e.read(this,Ce,!0,52,8)},a.prototype.readDoubleBE=function(Ce,Pe){return Ce=Ce>>>0,Pe||ce(Ce,8,this.length),e.read(this,Ce,!1,52,8)};function re(Ce,Pe,ke,Ye,Me,et){if(!a.isBuffer(Ce))throw new TypeError('"buffer" argument must be a Buffer instance');if(Pe>Me||Pe<et)throw new RangeError('"value" argument is out of bounds');if(ke+Ye>Ce.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(Ce,Pe,ke,Ye){if(Ce=+Ce,Pe=Pe>>>0,ke=ke>>>0,!Ye){let ot=Math.pow(2,8*ke)-1;re(this,Ce,Pe,ke,ot,0)}let Me=1,et=0;for(this[Pe]=Ce&255;++et<ke&&(Me*=256);)this[Pe+et]=Ce/Me&255;return Pe+ke},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(Ce,Pe,ke,Ye){if(Ce=+Ce,Pe=Pe>>>0,ke=ke>>>0,!Ye){let ot=Math.pow(2,8*ke)-1;re(this,Ce,Pe,ke,ot,0)}let Me=ke-1,et=1;for(this[Pe+Me]=Ce&255;--Me>=0&&(et*=256);)this[Pe+Me]=Ce/et&255;return Pe+ke},a.prototype.writeUint8=a.prototype.writeUInt8=function(Ce,Pe,ke){return Ce=+Ce,Pe=Pe>>>0,ke||re(this,Ce,Pe,1,255,0),this[Pe]=Ce&255,Pe+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(Ce,Pe,ke){return Ce=+Ce,Pe=Pe>>>0,ke||re(this,Ce,Pe,2,65535,0),this[Pe]=Ce&255,this[Pe+1]=Ce>>>8,Pe+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(Ce,Pe,ke){return Ce=+Ce,Pe=Pe>>>0,ke||re(this,Ce,Pe,2,65535,0),this[Pe]=Ce>>>8,this[Pe+1]=Ce&255,Pe+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(Ce,Pe,ke){return Ce=+Ce,Pe=Pe>>>0,ke||re(this,Ce,Pe,4,4294967295,0),this[Pe+3]=Ce>>>24,this[Pe+2]=Ce>>>16,this[Pe+1]=Ce>>>8,this[Pe]=Ce&255,Pe+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(Ce,Pe,ke){return Ce=+Ce,Pe=Pe>>>0,ke||re(this,Ce,Pe,4,4294967295,0),this[Pe]=Ce>>>24,this[Pe+1]=Ce>>>16,this[Pe+2]=Ce>>>8,this[Pe+3]=Ce&255,Pe+4};function se(Ce,Pe,ke,Ye,Me){Re(Pe,Ye,Me,Ce,ke,7);let et=Number(Pe&BigInt(4294967295));Ce[ke++]=et,et=et>>8,Ce[ke++]=et,et=et>>8,Ce[ke++]=et,et=et>>8,Ce[ke++]=et;let ot=Number(Pe>>BigInt(32)&BigInt(4294967295));return Ce[ke++]=ot,ot=ot>>8,Ce[ke++]=ot,ot=ot>>8,Ce[ke++]=ot,ot=ot>>8,Ce[ke++]=ot,ke}function fe(Ce,Pe,ke,Ye,Me){Re(Pe,Ye,Me,Ce,ke,7);let et=Number(Pe&BigInt(4294967295));Ce[ke+7]=et,et=et>>8,Ce[ke+6]=et,et=et>>8,Ce[ke+5]=et,et=et>>8,Ce[ke+4]=et;let ot=Number(Pe>>BigInt(32)&BigInt(4294967295));return Ce[ke+3]=ot,ot=ot>>8,Ce[ke+2]=ot,ot=ot>>8,Ce[ke+1]=ot,ot=ot>>8,Ce[ke]=ot,ke+8}a.prototype.writeBigUInt64LE=Oe(function(Ce,Pe=0){return se(this,Ce,Pe,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=Oe(function(Ce,Pe=0){return fe(this,Ce,Pe,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(Ce,Pe,ke,Ye){if(Ce=+Ce,Pe=Pe>>>0,!Ye){let vt=Math.pow(2,8*ke-1);re(this,Ce,Pe,ke,vt-1,-vt)}let Me=0,et=1,ot=0;for(this[Pe]=Ce&255;++Me<ke&&(et*=256);)Ce<0&&ot===0&&this[Pe+Me-1]!==0&&(ot=1),this[Pe+Me]=(Ce/et>>0)-ot&255;return Pe+ke},a.prototype.writeIntBE=function(Ce,Pe,ke,Ye){if(Ce=+Ce,Pe=Pe>>>0,!Ye){let vt=Math.pow(2,8*ke-1);re(this,Ce,Pe,ke,vt-1,-vt)}let Me=ke-1,et=1,ot=0;for(this[Pe+Me]=Ce&255;--Me>=0&&(et*=256);)Ce<0&&ot===0&&this[Pe+Me+1]!==0&&(ot=1),this[Pe+Me]=(Ce/et>>0)-ot&255;return Pe+ke},a.prototype.writeInt8=function(Ce,Pe,ke){return Ce=+Ce,Pe=Pe>>>0,ke||re(this,Ce,Pe,1,127,-128),Ce<0&&(Ce=255+Ce+1),this[Pe]=Ce&255,Pe+1},a.prototype.writeInt16LE=function(Ce,Pe,ke){return Ce=+Ce,Pe=Pe>>>0,ke||re(this,Ce,Pe,2,32767,-32768),this[Pe]=Ce&255,this[Pe+1]=Ce>>>8,Pe+2},a.prototype.writeInt16BE=function(Ce,Pe,ke){return Ce=+Ce,Pe=Pe>>>0,ke||re(this,Ce,Pe,2,32767,-32768),this[Pe]=Ce>>>8,this[Pe+1]=Ce&255,Pe+2},a.prototype.writeInt32LE=function(Ce,Pe,ke){return Ce=+Ce,Pe=Pe>>>0,ke||re(this,Ce,Pe,4,2147483647,-2147483648),this[Pe]=Ce&255,this[Pe+1]=Ce>>>8,this[Pe+2]=Ce>>>16,this[Pe+3]=Ce>>>24,Pe+4},a.prototype.writeInt32BE=function(Ce,Pe,ke){return Ce=+Ce,Pe=Pe>>>0,ke||re(this,Ce,Pe,4,2147483647,-2147483648),Ce<0&&(Ce=4294967295+Ce+1),this[Pe]=Ce>>>24,this[Pe+1]=Ce>>>16,this[Pe+2]=Ce>>>8,this[Pe+3]=Ce&255,Pe+4},a.prototype.writeBigInt64LE=Oe(function(Ce,Pe=0){return se(this,Ce,Pe,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=Oe(function(Ce,Pe=0){return fe(this,Ce,Pe,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function me(Ce,Pe,ke,Ye,Me,et){if(ke+Ye>Ce.length)throw new RangeError("Index out of range");if(ke<0)throw new RangeError("Index out of range")}function oe(Ce,Pe,ke,Ye,Me){return Pe=+Pe,ke=ke>>>0,Me||me(Ce,Pe,ke,4),e.write(Ce,Pe,ke,Ye,23,4),ke+4}a.prototype.writeFloatLE=function(Ce,Pe,ke){return oe(this,Ce,Pe,!0,ke)},a.prototype.writeFloatBE=function(Ce,Pe,ke){return oe(this,Ce,Pe,!1,ke)};function ve(Ce,Pe,ke,Ye,Me){return Pe=+Pe,ke=ke>>>0,Me||me(Ce,Pe,ke,8),e.write(Ce,Pe,ke,Ye,52,8),ke+8}a.prototype.writeDoubleLE=function(Ce,Pe,ke){return ve(this,Ce,Pe,!0,ke)},a.prototype.writeDoubleBE=function(Ce,Pe,ke){return ve(this,Ce,Pe,!1,ke)},a.prototype.copy=function(Ce,Pe,ke,Ye){if(!a.isBuffer(Ce))throw new TypeError("argument should be a Buffer");if(ke||(ke=0),!Ye&&Ye!==0&&(Ye=this.length),Pe>=Ce.length&&(Pe=Ce.length),Pe||(Pe=0),Ye>0&&Ye<ke&&(Ye=ke),Ye===ke||Ce.length===0||this.length===0)return 0;if(Pe<0)throw new RangeError("targetStart out of bounds");if(ke<0||ke>=this.length)throw new RangeError("Index out of range");if(Ye<0)throw new RangeError("sourceEnd out of bounds");Ye>this.length&&(Ye=this.length),Ce.length-Pe<Ye-ke&&(Ye=Ce.length-Pe+ke);let Me=Ye-ke;return this===Ce&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(Pe,ke,Ye):Uint8Array.prototype.set.call(Ce,this.subarray(ke,Ye),Pe),Me},a.prototype.fill=function(Ce,Pe,ke,Ye){if(typeof Ce=="string"){if(typeof Pe=="string"?(Ye=Pe,Pe=0,ke=this.length):typeof ke=="string"&&(Ye=ke,ke=this.length),Ye!==void 0&&typeof Ye!="string")throw new TypeError("encoding must be a string");if(typeof Ye=="string"&&!a.isEncoding(Ye))throw new TypeError("Unknown encoding: "+Ye);if(Ce.length===1){let et=Ce.charCodeAt(0);(Ye==="utf8"&&et<128||Ye==="latin1")&&(Ce=et)}}else typeof Ce=="number"?Ce=Ce&255:typeof Ce=="boolean"&&(Ce=Number(Ce));if(Pe<0||this.length<Pe||this.length<ke)throw new RangeError("Out of range index");if(ke<=Pe)return this;Pe=Pe>>>0,ke=ke===void 0?this.length:ke>>>0,Ce||(Ce=0);let Me;if(typeof Ce=="number")for(Me=Pe;Me<ke;++Me)this[Me]=Ce;else{let et=a.isBuffer(Ce)?Ce:a.from(Ce,Ye),ot=et.length;if(ot===0)throw new TypeError('The value "'+Ce+'" is invalid for argument "value"');for(Me=0;Me<ke-Pe;++Me)this[Me+Pe]=et[Me%ot]}return this};let ne={};function pe(Ce,Pe,ke){ne[Ce]=class extends ke{constructor(){super(),Object.defineProperty(this,"message",{value:Pe.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${Ce}]`,this.stack,delete this.name}get code(){return Ce}set code(Ye){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Ye,writable:!0})}toString(){return`${this.name} [${Ce}]: ${this.message}`}}}pe("ERR_BUFFER_OUT_OF_BOUNDS",function(Ce){return Ce?`${Ce} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),pe("ERR_INVALID_ARG_TYPE",function(Ce,Pe){return`The "${Ce}" argument must be of type number. Received type ${typeof Pe}`},TypeError),pe("ERR_OUT_OF_RANGE",function(Ce,Pe,ke){let Ye=`The value of "${Ce}" is out of range.`,Me=ke;return Number.isInteger(ke)&&Math.abs(ke)>2**32?Me=Ae(String(ke)):typeof ke=="bigint"&&(Me=String(ke),(ke>BigInt(2)**BigInt(32)||ke<-(BigInt(2)**BigInt(32)))&&(Me=Ae(Me)),Me+="n"),Ye+=` It must be ${Pe}. Received ${Me}`,Ye},RangeError);function Ae(Ce){let Pe="",ke=Ce.length,Ye=Ce[0]==="-"?1:0;for(;ke>=Ye+4;ke-=3)Pe=`_${Ce.slice(ke-3,ke)}${Pe}`;return`${Ce.slice(0,ke)}${Pe}`}function Ge(Ce,Pe,ke){De(Pe,"offset"),(Ce[Pe]===void 0||Ce[Pe+ke]===void 0)&&ze(Pe,Ce.length-(ke+1))}function Re(Ce,Pe,ke,Ye,Me,et){if(Ce>ke||Ce<Pe){let ot=typeof Pe=="bigint"?"n":"",vt;throw Pe===0||Pe===BigInt(0)?vt=`>= 0${ot} and < 2${ot} ** ${(et+1)*8}${ot}`:vt=`>= -(2${ot} ** ${(et+1)*8-1}${ot}) and < 2 ** ${(et+1)*8-1}${ot}`,new ne.ERR_OUT_OF_RANGE("value",vt,Ce)}Ge(Ye,Me,et)}function De(Ce,Pe){if(typeof Ce!="number")throw new ne.ERR_INVALID_ARG_TYPE(Pe,"number",Ce)}function ze(Ce,Pe,ke){throw Math.floor(Ce)!==Ce?(De(Ce,ke),new ne.ERR_OUT_OF_RANGE("offset","an integer",Ce)):Pe<0?new ne.ERR_BUFFER_OUT_OF_BOUNDS:new ne.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${Pe}`,Ce)}let He=/[^+/0-9A-Za-z-_]/g;function Be(Ce){if(Ce=Ce.split("=")[0],Ce=Ce.trim().replace(He,""),Ce.length<2)return"";for(;Ce.length%4!==0;)Ce=Ce+"=";return Ce}function Ke(Ce,Pe){Pe=Pe||1/0;let ke,Ye=Ce.length,Me=null,et=[];for(let ot=0;ot<Ye;++ot){if(ke=Ce.charCodeAt(ot),ke>55295&&ke<57344){if(!Me){if(ke>56319){(Pe-=3)>-1&&et.push(239,191,189);continue}else if(ot+1===Ye){(Pe-=3)>-1&&et.push(239,191,189);continue}Me=ke;continue}if(ke<56320){(Pe-=3)>-1&&et.push(239,191,189),Me=ke;continue}ke=(Me-55296<<10|ke-56320)+65536}else Me&&(Pe-=3)>-1&&et.push(239,191,189);if(Me=null,ke<128){if((Pe-=1)<0)break;et.push(ke)}else if(ke<2048){if((Pe-=2)<0)break;et.push(ke>>6|192,ke&63|128)}else if(ke<65536){if((Pe-=3)<0)break;et.push(ke>>12|224,ke>>6&63|128,ke&63|128)}else if(ke<1114112){if((Pe-=4)<0)break;et.push(ke>>18|240,ke>>12&63|128,ke>>6&63|128,ke&63|128)}else throw new Error("Invalid code point")}return et}function ht(Ce){let Pe=[];for(let ke=0;ke<Ce.length;++ke)Pe.push(Ce.charCodeAt(ke)&255);return Pe}function St(Ce,Pe){let ke,Ye,Me,et=[];for(let ot=0;ot<Ce.length&&!((Pe-=2)<0);++ot)ke=Ce.charCodeAt(ot),Ye=ke>>8,Me=ke%256,et.push(Me),et.push(Ye);return et}function xt(Ce){return i.toByteArray(Be(Ce))}function Vt(Ce,Pe,ke,Ye){let Me;for(Me=0;Me<Ye&&!(Me+ke>=Pe.length||Me>=Ce.length);++Me)Pe[Me+ke]=Ce[Me];return Me}function bt(Ce,Pe){return Ce instanceof Pe||Ce!=null&&Ce.constructor!=null&&Ce.constructor.name!=null&&Ce.constructor.name===Pe.name}function $t(Ce){return Ce!==Ce}let Xe=function(){let Ce="0123456789abcdef",Pe=new Array(256);for(let ke=0;ke<16;++ke){let Ye=ke*16;for(let Me=0;Me<16;++Me)Pe[Ye+Me]=Ce[ke]+Ce[Me]}return Pe}();function Oe(Ce){return typeof BigInt>"u"?ft:Ce}function ft(){throw new Error("BigInt not supported")}return HF}var LH,Dit,bte,Eit,HF,bit,CTn=Ey(()=>{gn(),vn(),xn(),LH={},Dit=!1,bte={},Eit=!1,HF={},bit=!1}),ig={};OH(ig,{Buffer:()=>Jxe,INSPECT_MAX_BYTES:()=>K6r,default:()=>u9,kMaxLength:()=>J6r});var u9,Jxe,K6r,J6r,ng=Ey(()=>{gn(),vn(),xn(),CTn(),u9=STn(),u9.Buffer,u9.SlowBuffer,u9.INSPECT_MAX_BYTES,u9.kMaxLength,Jxe=u9.Buffer,K6r=u9.INSPECT_MAX_BYTES,J6r=u9.kMaxLength}),vn=Ey(()=>{ng()}),e0=Sn((i,e)=>{gn(),vn(),xn();var t=class extends Error{constructor(r){if(!Array.isArray(r))throw new TypeError(`Expected input to be an Array, got ${typeof r}`);let n="";for(let s=0;s<r.length;s++)n+=` ${r[s].stack}
33378
+ `;return u=u.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,""),u=jl.replaceStringVariables(u),new Function("data",u)(t)}catch{return!1}return!1},n=e.condition.list.map(r);return e.condition.type==="and"?n.every(Boolean):n.some(Boolean)}}pr(bi,"actions",new Set([{type:"link",parser:X7n},{type:"sendApi",parser:q7n},{type:"move",parser:Y7n},{type:"scale",parser:Q7n},{type:"rotate",parser:K7n},{type:"updatePage",parser:J7n},{type:"invoke",parser:Z7n},{type:"fullscreen",parser:rTn},{type:"updateVariable",parser:iTn},{type:"updateWidget",parser:nTn},{type:"ueCommonsWebscoket",parser:sTn},{type:"ueShjExecMethod",parser:aTn},{type:"unityWebglExecMethod",parser:oTn},{type:"unityIframeExecMethod",parser:lTn},{type:"vrSceneMethod",parser:uTn},{type:"refreshVariable",parser:cTn}]));const drt=(i,e)=>{i&&i.setField&&i.setType!==0&&(i.setType===1&&localStorage.setItem("Local_"+i.setField,JSON.stringify(e)),i.setType===2&&sessionStorage.setItem("Session_"+i.setField,JSON.stringify(e)))},oS=class oS{static executeAllVariable(e){e.forEach(t=>{t.sources.isVariable=!0}),oS.setVariables(e),e.forEach(t=>{pl.parse({sources:[t.sources],noUseMapping:!0,callback:r=>{oS.setVariableById(t,r,!1)}})})}static replaceObjectVariables(e){const t=this.replaceStringVariables(JSON.stringify(e));return JSON.parse(t)}static replaceStringVariables(e){return e.replace(/\$g\{([^}]+)\}/g,(t,r)=>{const{varName:n,propPath:s}=this.parseVariablePath(r),a=this.getVariables().find(l=>l.name===n);if(!a)return t;let o=a._value;try{for(const l of s){if(o==null){o=void 0;break}o=o[l]}}catch{return"undefined"}return typeof o=="object"?JSON.stringify(o):o===void 0?"undefined":String(o)})}static getObjectVariableNames(e){return this.getStringVariableNames(JSON.stringify(e))}static getStringVariableNames(e){const t=new Set,r=/\$g\{([^}]+)\}/g;for(const n of e.matchAll(r)){const s=n[1],{varName:a}=this.parseVariablePath(s);a&&t.add(a)}return Array.from(t)}static parseVariablePath(e){const r=e.replace(/\[/g,".").replace(/\]/g,"").split("."),n=r[0],s=r.slice(1);return{varName:n,propPath:s}}static getEnvironments(){return window._apiEnvironment}static setEnvironments(e){const t=e.find(r=>r.selected);t&&(window._apiEnvironment={envName:t.envName,envBaseUrl:t.envBaseUrl})}static getVariables(){return window._variables||[]}static setVariables(e){window._variables=Ht.cloneDeep(e),window._variables.forEach(t=>{t._callbacks??(t._callbacks=new Map)})}static setVariableById(e,t,r=!0){const n=this.getVariableById(e.id);if(n){n._value=t,n._initialState??(n._initialState=!0);try{drt(e.sources.source.storage,t)}catch{}n._callbacks??(n._callbacks=new Map),n._callbacks.forEach(s=>s(e._value)),r&&Z6.updateWidgetVariableData(n)}}static getVariableById(e){return window._variables.find(t=>t.id===e)}static getVariableByName(e){return window._variables.find(t=>t.name===e)}static getVariableValueById(e){const t=window._variables.find(r=>r.id===e);return t?t._value:null}static noneData(e){return{id:e,finalKeyData:{id:e,data:null},finalUserData:{id:e,data:null},filteredData:null,rawData:null,noMappingData:null}}};pr(oS,"addVariable",e=>{pl.parse({sources:[e.sources],noUseMapping:!0,callback:t=>{oS.getVariables().push(e),oS.setVariableById(e,t,!1)}})}),pr(oS,"updateVariable",e=>{pl.parse({sources:[e.sources],noUseMapping:!0,callback:t=>{oS.setVariableById(e,t,!0)}})}),pr(oS,"deleteVariableById",e=>{const t=window._variables.findIndex(r=>r.id===e);t>-1&&window._variables.splice(t,1)});let jl=oS;const dTn=(i,e,t)=>{try{const r=jl.replaceObjectVariables(i.source.static);pl.processData(i.source,r,i.id,e).then(n=>{t(n)}).catch(()=>{t(jl.noneData(i.id))});return}catch{t(jl.noneData(i.id))}},hTn=(i,e,t)=>{try{let r={};const n=new URLSearchParams(window.location.search);if(n.toString()&&(r=Object.fromEntries(n.entries())),Object.keys(r).length===0&&window.location.hash){const s=window.location.hash.indexOf("?");if(s!==-1){const a=window.location.hash.substring(s+1),o=new URLSearchParams(a);r=Object.fromEntries(o.entries())}}pl.processData(i.source,r,i.id,e).then(s=>{t(s)}).catch(()=>{t(jl.noneData(i.id))});return}catch{t(jl.noneData(i.id))}},fTn=(i,e,t)=>{try{const r=jl.getVariableByName(i.source.variableId);if(!r){t(jl.noneData(i.id));return}pl.processData(i.source,r._value,i.id,e).then(n=>{t(n)}).catch(()=>{t(jl.noneData(i.id))});return}catch{t(jl.noneData(i.id))}};class pTn{constructor(){pr(this,"instance");this.instance=ile.create(),this.instance.interceptors.response.use(e=>{try{const t=e.config,r=Z6.getGlobalEvent(),n=Z6.getGlobalApiListenter();n.length&&n.forEach(s=>{s.type==="include"&&t.url.includes(s.url)&&bi.parseEvents(r,"on-global-api-listenter",e),s.type==="exclude"&&(t.url.includes(s.url)||bi.parseEvents(r,"on-global-api-listenter",e)),s.type==="equal"&&t.url===s.url&&bi.parseEvents(r,"on-global-api-listenter",e),s.type==="notEqual"&&t.url!==s.url&&bi.parseEvents(r,"on-global-api-listenter",e)})}catch{}return e})}get(e,t){return this.instance.get(e,t)}post(e,t,r,n="application/json; charset=UTF-8"){const s={headers:{"Content-Type":"application/json; charset=UTF-8"}};if(n==="multipart/form-data"){s.headers={};const a=new FormData;for(const o in t)a.append(o,t[o]);t=a}else n==="application/x-www-form-urlencoded; charset=UTF-8"&&(s.headers["Content-Type"]="application/x-www-form-urlencoded; charset=UTF-8",s.transformRequest=[a=>{const o=new URLSearchParams;for(const l in a)o.append(l,a[l]);return o.toString()}]);return this.instance.post(e,t,Ht.merge({},s,r))}put(e,t,r,n="application/x-www-form-urlencoded; charset=UTF-8"){const s={headers:{"Content-Type":n}};if(n==="multipart/form-data"){s.headers={};const a=new FormData;for(const o in t)a.append(o,t[o]);t=a}else n==="application/x-www-form-urlencoded; charset=UTF-8"&&(s.headers["Content-Type"]="application/x-www-form-urlencoded; charset=UTF-8",s.transformRequest=[a=>{const o=new URLSearchParams;for(const l in a)o.append(l,a[l]);return o.toString()}]);return this.instance.put(e,t,Ht.merge({},s,r))}delete(e,t){const r={headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}};return this.instance.delete(e,Ht.merge({},r,t))}upload(e,t,r){const n={headers:{"Content-Type":"multipart/form-data"}};return this.instance.post(e,t,r||n)}download(e,t,r){const n={responseType:"blob",headers:{"Content-Type":"application/json"}};return this.instance.post(e,t,r||n)}custom(e,t){return this.instance.get(e,t)}}const qxe=new pTn,mTn=async(i,e,t)=>{var m;const r=i==null?void 0:i.id,n=(m=i==null?void 0:i.source)==null?void 0:m.api,s=x=>{t(jl.noneData(x))};if(!n||!r)return s(r||"");const{isHeaders:a,isBody:o,headers:l,contentType:u,url:c,postParam:d,type:h,isUseEnv:p=!0}=n;try{const v=jl.getEnvironments().envBaseUrl??"",y=p?v:"",E=jl.replaceStringVariables(c),S=a?jl.replaceObjectVariables(l):{},C=o?jl.replaceObjectVariables(d):{},T=y+E;if(!T)return s(r);let I;switch(h){case"GET":I=qxe.get(T,{headers:S});break;case"POST":I=qxe.post(T,C,{headers:S},u);break;case"PUT":I=qxe.put(T,C,{headers:S},u);break;case"DELETE":I=qxe.delete(T,{headers:S});break;default:return s(r)}const B=await I;if(B.status===200){const O=await pl.processData(i.source,B.data,r,e);O?t(O):s(r)}else s(r)}catch{s(r)}},gTn=(i,e,t)=>{try{if(!i.source.storage){t(jl.noneData(i.id));return}const{getType:r,getField:n}=i.source.storage;if(r===0){t(jl.noneData(i.id));return}if(!n){t(jl.noneData(i.id));return}let s=null;r===1&&(s=localStorage.getItem("Local_"+n)),r===2&&(s=sessionStorage.getItem("Session_"+n)),pl.processData(i.source,s,i.id,e).then(a=>{t(a)}).catch(()=>{t(jl.noneData(i.id))});return}catch{t(jl.noneData(i.id))}};var hrt=Object.defineProperty,xTn=Object.getOwnPropertyDescriptor,vTn=Object.getOwnPropertyNames,yTn=Object.prototype.hasOwnProperty,Ey=(i,e)=>()=>(i&&(e=i(i=0)),e),Sn=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),OH=(i,e)=>{for(var t in e)hrt(i,t,{get:e[t],enumerable:!0})},DTn=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of vTn(e))!yTn.call(i,n)&&n!==t&&hrt(i,n,{get:()=>e[n],enumerable:!(r=xTn(e,n))||r.enumerable});return i},Ch=i=>DTn(hrt({},"__esModule",{value:!0}),i),gn=Ey(()=>{}),wd={};OH(wd,{_debugEnd:()=>Yrt,_debugProcess:()=>Xrt,_events:()=>uit,_eventsCount:()=>cit,_exiting:()=>Irt,_fatalExceptions:()=>jrt,_getActiveHandles:()=>W6r,_getActiveRequests:()=>H6r,_kill:()=>Ort,_linkedBinding:()=>z6r,_maxListeners:()=>lit,_preload_modules:()=>sit,_rawDebug:()=>Frt,_startProfilerIdleNotifier:()=>qrt,_stopProfilerIdleNotifier:()=>Qrt,_tickCallback:()=>Wrt,abort:()=>$rt,addListener:()=>dit,allowedNodeEnvironmentFlags:()=>Grt,arch:()=>mrt,argv:()=>vrt,argv0:()=>nit,assert:()=>X6r,binding:()=>_rt,browser:()=>wrt,chdir:()=>Crt,config:()=>Mrt,cpuUsage:()=>Ete,cwd:()=>Srt,debugPort:()=>iit,default:()=>yit,dlopen:()=>j6r,domain:()=>Prt,emit:()=>git,emitWarning:()=>brt,env:()=>xrt,execArgv:()=>yrt,execPath:()=>rit,exit:()=>Vrt,features:()=>zrt,hasUncaughtExceptionCaptureCallback:()=>Y6r,hrtime:()=>Qxe,kill:()=>krt,listeners:()=>Q6r,memoryUsage:()=>Nrt,moduleLoadList:()=>Rrt,nextTick:()=>U6r,off:()=>fit,on:()=>o9,once:()=>hit,openStdin:()=>Urt,pid:()=>eit,platform:()=>grt,ppid:()=>tit,prependListener:()=>xit,prependOnceListener:()=>vit,reallyExit:()=>Brt,release:()=>Trt,removeAllListeners:()=>mit,removeListener:()=>pit,resourceUsage:()=>Lrt,setSourceMapsEnabled:()=>ait,setUncaughtExceptionCaptureCallback:()=>Hrt,stderr:()=>Jrt,stdin:()=>Zrt,stdout:()=>Krt,title:()=>prt,umask:()=>Art,uptime:()=>q6r,version:()=>Drt,versions:()=>Ert});function frt(i){throw new Error("Node.js process "+i+" is not supported by JSPM core outside of Node.js")}function ETn(){!UO||!GO||(UO=!1,GO.length?$6=GO.concat($6):Dte=-1,$6.length&&V6r())}function V6r(){if(!UO){var i=setTimeout(ETn,0);UO=!0;for(var e=$6.length;e;){for(GO=$6,$6=[];++Dte<e;)GO&&GO[Dte].run();Dte=-1,e=$6.length}GO=null,UO=!1,clearTimeout(i)}}function U6r(i){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];$6.push(new G6r(i,e)),$6.length===1&&!UO&&setTimeout(V6r,0)}function G6r(i,e){this.fun=i,this.array=e}function mx(){}function z6r(i){frt("_linkedBinding")}function j6r(i){frt("dlopen")}function H6r(){return[]}function W6r(){return[]}function X6r(i,e){if(!i)throw new Error(e||"assertion error")}function Y6r(){return!1}function q6r(){return l9.now()/1e3}function Qxe(i){var e=Math.floor((Date.now()-l9.now())*.001),t=l9.now()*.001,r=Math.floor(t)+e,n=Math.floor(t%1*1e9);return i&&(r=r-i[0],n=n-i[1],n<0&&(r--,n+=Kxe)),[r,n]}function o9(){return yit}function Q6r(i){return[]}var $6,UO,GO,Dte,prt,mrt,grt,xrt,vrt,yrt,Drt,Ert,brt,_rt,Art,Srt,Crt,Trt,wrt,Frt,Rrt,Prt,Irt,Mrt,Brt,Ort,Ete,Lrt,Nrt,krt,Vrt,Urt,Grt,zrt,jrt,Hrt,Wrt,Xrt,Yrt,qrt,Qrt,Krt,Jrt,Zrt,$rt,eit,tit,rit,iit,nit,sit,ait,l9,oit,Kxe,lit,uit,cit,dit,hit,fit,pit,mit,git,xit,vit,yit,bTn=Ey(()=>{gn(),vn(),xn(),$6=[],UO=!1,Dte=-1,G6r.prototype.run=function(){this.fun.apply(null,this.array)},prt="browser",mrt="x64",grt="browser",xrt={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},vrt=["/usr/bin/node"],yrt=[],Drt="v16.8.0",Ert={},brt=function(i,e){},_rt=function(i){frt("binding")},Art=function(i){return 0},Srt=function(){return"/"},Crt=function(i){},Trt={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},wrt=!0,Frt=mx,Rrt=[],Prt={},Irt=!1,Mrt={},Brt=mx,Ort=mx,Ete=function(){return{}},Lrt=Ete,Nrt=Ete,krt=mx,Vrt=mx,Urt=mx,Grt={},zrt={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},jrt=mx,Hrt=mx,Wrt=mx,Xrt=mx,Yrt=mx,qrt=mx,Qrt=mx,Krt=void 0,Jrt=void 0,Zrt=void 0,$rt=mx,eit=2,tit=1,rit="/bin/usr/node",iit=9229,nit="node",sit=[],ait=mx,l9={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0},l9.now===void 0&&(oit=Date.now(),l9.timing&&l9.timing.navigationStart&&(oit=l9.timing.navigationStart),l9.now=()=>Date.now()-oit),Kxe=1e9,Qxe.bigint=function(i){var e=Qxe(i);return typeof BigInt>"u"?e[0]*Kxe+e[1]:BigInt(e[0]*Kxe)+BigInt(e[1])},lit=10,uit={},cit=0,dit=o9,hit=o9,fit=o9,pit=o9,mit=o9,git=mx,xit=o9,vit=o9,yit={version:Drt,versions:Ert,arch:mrt,platform:grt,browser:wrt,release:Trt,_rawDebug:Frt,moduleLoadList:Rrt,binding:_rt,_linkedBinding:z6r,_events:uit,_eventsCount:cit,_maxListeners:lit,on:o9,addListener:dit,once:hit,off:fit,removeListener:pit,removeAllListeners:mit,emit:git,prependListener:xit,prependOnceListener:vit,listeners:Q6r,domain:Prt,_exiting:Irt,config:Mrt,dlopen:j6r,uptime:q6r,_getActiveRequests:H6r,_getActiveHandles:W6r,reallyExit:Brt,_kill:Ort,cpuUsage:Ete,resourceUsage:Lrt,memoryUsage:Nrt,kill:krt,exit:Vrt,openStdin:Urt,allowedNodeEnvironmentFlags:Grt,assert:X6r,features:zrt,_fatalExceptions:jrt,setUncaughtExceptionCaptureCallback:Hrt,hasUncaughtExceptionCaptureCallback:Y6r,emitWarning:brt,nextTick:U6r,_tickCallback:Wrt,_debugProcess:Xrt,_debugEnd:Yrt,_startProfilerIdleNotifier:qrt,_stopProfilerIdleNotifier:Qrt,stdout:Krt,stdin:Zrt,stderr:Jrt,abort:$rt,umask:Art,chdir:Crt,cwd:Srt,env:xrt,title:prt,argv:vrt,execArgv:yrt,pid:eit,ppid:tit,execPath:rit,debugPort:iit,hrtime:Qxe,argv0:nit,_preload_modules:sit,setSourceMapsEnabled:ait}}),xn=Ey(()=>{bTn()});function _Tn(){if(Dit)return LH;Dit=!0,LH.byteLength=o,LH.toByteArray=u,LH.fromByteArray=h;for(var i=[],e=[],t=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,s=r.length;n<s;++n)i[n]=r[n],e[r.charCodeAt(n)]=n;e[45]=62,e[95]=63;function a(p){var m=p.length;if(m%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var x=p.indexOf("=");x===-1&&(x=m);var v=x===m?0:4-x%4;return[x,v]}function o(p){var m=a(p),x=m[0],v=m[1];return(x+v)*3/4-v}function l(p,m,x){return(m+x)*3/4-x}function u(p){var m,x=a(p),v=x[0],y=x[1],E=new t(l(p,v,y)),S=0,C=y>0?v-4:v,T;for(T=0;T<C;T+=4)m=e[p.charCodeAt(T)]<<18|e[p.charCodeAt(T+1)]<<12|e[p.charCodeAt(T+2)]<<6|e[p.charCodeAt(T+3)],E[S++]=m>>16&255,E[S++]=m>>8&255,E[S++]=m&255;return y===2&&(m=e[p.charCodeAt(T)]<<2|e[p.charCodeAt(T+1)]>>4,E[S++]=m&255),y===1&&(m=e[p.charCodeAt(T)]<<10|e[p.charCodeAt(T+1)]<<4|e[p.charCodeAt(T+2)]>>2,E[S++]=m>>8&255,E[S++]=m&255),E}function c(p){return i[p>>18&63]+i[p>>12&63]+i[p>>6&63]+i[p&63]}function d(p,m,x){for(var v,y=[],E=m;E<x;E+=3)v=(p[E]<<16&16711680)+(p[E+1]<<8&65280)+(p[E+2]&255),y.push(c(v));return y.join("")}function h(p){for(var m,x=p.length,v=x%3,y=[],E=16383,S=0,C=x-v;S<C;S+=E)y.push(d(p,S,S+E>C?C:S+E));return v===1?(m=p[x-1],y.push(i[m>>2]+i[m<<4&63]+"==")):v===2&&(m=(p[x-2]<<8)+p[x-1],y.push(i[m>>10]+i[m>>4&63]+i[m<<2&63]+"=")),y.join("")}return LH}function ATn(){return Eit?bte:(Eit=!0,bte.read=function(i,e,t,r,n){var s,a,o=n*8-r-1,l=(1<<o)-1,u=l>>1,c=-7,d=t?n-1:0,h=t?-1:1,p=i[e+d];for(d+=h,s=p&(1<<-c)-1,p>>=-c,c+=o;c>0;s=s*256+i[e+d],d+=h,c-=8);for(a=s&(1<<-c)-1,s>>=-c,c+=r;c>0;a=a*256+i[e+d],d+=h,c-=8);if(s===0)s=1-u;else{if(s===l)return a?NaN:(p?-1:1)*(1/0);a=a+Math.pow(2,r),s=s-u}return(p?-1:1)*a*Math.pow(2,s-r)},bte.write=function(i,e,t,r,n,s){var a,o,l,u=s*8-n-1,c=(1<<u)-1,d=c>>1,h=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:s-1,m=r?1:-1,x=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+d>=1?e+=h/l:e+=h*Math.pow(2,1-d),e*l>=2&&(a++,l/=2),a+d>=c?(o=0,a=c):a+d>=1?(o=(e*l-1)*Math.pow(2,n),a=a+d):(o=e*Math.pow(2,d-1)*Math.pow(2,n),a=0));n>=8;i[t+p]=o&255,p+=m,o/=256,n-=8);for(a=a<<n|o,u+=n;u>0;i[t+p]=a&255,p+=m,a/=256,u-=8);i[t+p-m]|=x*128},bte)}function STn(){if(bit)return HF;bit=!0;let i=_Tn(),e=ATn(),t=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;HF.Buffer=a,HF.SlowBuffer=y,HF.INSPECT_MAX_BYTES=50;let r=2147483647;HF.kMaxLength=r,a.TYPED_ARRAY_SUPPORT=n(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u";function n(){try{let Ce=new Uint8Array(1),Pe={foo:function(){return 42}};return Object.setPrototypeOf(Pe,Uint8Array.prototype),Object.setPrototypeOf(Ce,Pe),Ce.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function s(Ce){if(Ce>r)throw new RangeError('The value "'+Ce+'" is invalid for option "size"');let Pe=new Uint8Array(Ce);return Object.setPrototypeOf(Pe,a.prototype),Pe}function a(Ce,Pe,ke){if(typeof Ce=="number"){if(typeof Pe=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return c(Ce)}return o(Ce,Pe,ke)}a.poolSize=8192;function o(Ce,Pe,ke){if(typeof Ce=="string")return d(Ce,Pe);if(ArrayBuffer.isView(Ce))return p(Ce);if(Ce==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Ce);if(bt(Ce,ArrayBuffer)||Ce&&bt(Ce.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(bt(Ce,SharedArrayBuffer)||Ce&&bt(Ce.buffer,SharedArrayBuffer)))return m(Ce,Pe,ke);if(typeof Ce=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let Ye=Ce.valueOf&&Ce.valueOf();if(Ye!=null&&Ye!==Ce)return a.from(Ye,Pe,ke);let Me=x(Ce);if(Me)return Me;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Ce[Symbol.toPrimitive]=="function")return a.from(Ce[Symbol.toPrimitive]("string"),Pe,ke);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Ce)}a.from=function(Ce,Pe,ke){return o(Ce,Pe,ke)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function l(Ce){if(typeof Ce!="number")throw new TypeError('"size" argument must be of type number');if(Ce<0)throw new RangeError('The value "'+Ce+'" is invalid for option "size"')}function u(Ce,Pe,ke){return l(Ce),Ce<=0?s(Ce):Pe!==void 0?typeof ke=="string"?s(Ce).fill(Pe,ke):s(Ce).fill(Pe):s(Ce)}a.alloc=function(Ce,Pe,ke){return u(Ce,Pe,ke)};function c(Ce){return l(Ce),s(Ce<0?0:v(Ce)|0)}a.allocUnsafe=function(Ce){return c(Ce)},a.allocUnsafeSlow=function(Ce){return c(Ce)};function d(Ce,Pe){if((typeof Pe!="string"||Pe==="")&&(Pe="utf8"),!a.isEncoding(Pe))throw new TypeError("Unknown encoding: "+Pe);let ke=E(Ce,Pe)|0,Ye=s(ke),Me=Ye.write(Ce,Pe);return Me!==ke&&(Ye=Ye.slice(0,Me)),Ye}function h(Ce){let Pe=Ce.length<0?0:v(Ce.length)|0,ke=s(Pe);for(let Ye=0;Ye<Pe;Ye+=1)ke[Ye]=Ce[Ye]&255;return ke}function p(Ce){if(bt(Ce,Uint8Array)){let Pe=new Uint8Array(Ce);return m(Pe.buffer,Pe.byteOffset,Pe.byteLength)}return h(Ce)}function m(Ce,Pe,ke){if(Pe<0||Ce.byteLength<Pe)throw new RangeError('"offset" is outside of buffer bounds');if(Ce.byteLength<Pe+(ke||0))throw new RangeError('"length" is outside of buffer bounds');let Ye;return Pe===void 0&&ke===void 0?Ye=new Uint8Array(Ce):ke===void 0?Ye=new Uint8Array(Ce,Pe):Ye=new Uint8Array(Ce,Pe,ke),Object.setPrototypeOf(Ye,a.prototype),Ye}function x(Ce){if(a.isBuffer(Ce)){let Pe=v(Ce.length)|0,ke=s(Pe);return ke.length===0||Ce.copy(ke,0,0,Pe),ke}if(Ce.length!==void 0)return typeof Ce.length!="number"||$t(Ce.length)?s(0):h(Ce);if(Ce.type==="Buffer"&&Array.isArray(Ce.data))return h(Ce.data)}function v(Ce){if(Ce>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return Ce|0}function y(Ce){return+Ce!=Ce&&(Ce=0),a.alloc(+Ce)}a.isBuffer=function(Ce){return Ce!=null&&Ce._isBuffer===!0&&Ce!==a.prototype},a.compare=function(Ce,Pe){if(bt(Ce,Uint8Array)&&(Ce=a.from(Ce,Ce.offset,Ce.byteLength)),bt(Pe,Uint8Array)&&(Pe=a.from(Pe,Pe.offset,Pe.byteLength)),!a.isBuffer(Ce)||!a.isBuffer(Pe))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Ce===Pe)return 0;let ke=Ce.length,Ye=Pe.length;for(let Me=0,et=Math.min(ke,Ye);Me<et;++Me)if(Ce[Me]!==Pe[Me]){ke=Ce[Me],Ye=Pe[Me];break}return ke<Ye?-1:Ye<ke?1:0},a.isEncoding=function(Ce){switch(String(Ce).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}},a.concat=function(Ce,Pe){if(!Array.isArray(Ce))throw new TypeError('"list" argument must be an Array of Buffers');if(Ce.length===0)return a.alloc(0);let ke;if(Pe===void 0)for(Pe=0,ke=0;ke<Ce.length;++ke)Pe+=Ce[ke].length;let Ye=a.allocUnsafe(Pe),Me=0;for(ke=0;ke<Ce.length;++ke){let et=Ce[ke];if(bt(et,Uint8Array))Me+et.length>Ye.length?(a.isBuffer(et)||(et=a.from(et)),et.copy(Ye,Me)):Uint8Array.prototype.set.call(Ye,et,Me);else if(a.isBuffer(et))et.copy(Ye,Me);else throw new TypeError('"list" argument must be an Array of Buffers');Me+=et.length}return Ye};function E(Ce,Pe){if(a.isBuffer(Ce))return Ce.length;if(ArrayBuffer.isView(Ce)||bt(Ce,ArrayBuffer))return Ce.byteLength;if(typeof Ce!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Ce);let ke=Ce.length,Ye=arguments.length>2&&arguments[2]===!0;if(!Ye&&ke===0)return 0;let Me=!1;for(;;)switch(Pe){case"ascii":case"latin1":case"binary":return ke;case"utf8":case"utf-8":return Ke(Ce).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ke*2;case"hex":return ke>>>1;case"base64":return xt(Ce).length;default:if(Me)return Ye?-1:Ke(Ce).length;Pe=(""+Pe).toLowerCase(),Me=!0}}a.byteLength=E;function S(Ce,Pe,ke){let Ye=!1;if((Pe===void 0||Pe<0)&&(Pe=0),Pe>this.length||((ke===void 0||ke>this.length)&&(ke=this.length),ke<=0)||(ke>>>=0,Pe>>>=0,ke<=Pe))return"";for(Ce||(Ce="utf8");;)switch(Ce){case"hex":return ee(this,Pe,ke);case"utf8":case"utf-8":return Y(this,Pe,ke);case"ascii":return J(this,Pe,ke);case"latin1":case"binary":return $(this,Pe,ke);case"base64":return j(this,Pe,ke);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae(this,Pe,ke);default:if(Ye)throw new TypeError("Unknown encoding: "+Ce);Ce=(Ce+"").toLowerCase(),Ye=!0}}a.prototype._isBuffer=!0;function C(Ce,Pe,ke){let Ye=Ce[Pe];Ce[Pe]=Ce[ke],Ce[ke]=Ye}a.prototype.swap16=function(){let Ce=this.length;if(Ce%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Pe=0;Pe<Ce;Pe+=2)C(this,Pe,Pe+1);return this},a.prototype.swap32=function(){let Ce=this.length;if(Ce%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let Pe=0;Pe<Ce;Pe+=4)C(this,Pe,Pe+3),C(this,Pe+1,Pe+2);return this},a.prototype.swap64=function(){let Ce=this.length;if(Ce%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let Pe=0;Pe<Ce;Pe+=8)C(this,Pe,Pe+7),C(this,Pe+1,Pe+6),C(this,Pe+2,Pe+5),C(this,Pe+3,Pe+4);return this},a.prototype.toString=function(){let Ce=this.length;return Ce===0?"":arguments.length===0?Y(this,0,Ce):S.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(Ce){if(!a.isBuffer(Ce))throw new TypeError("Argument must be a Buffer");return this===Ce?!0:a.compare(this,Ce)===0},a.prototype.inspect=function(){let Ce="",Pe=HF.INSPECT_MAX_BYTES;return Ce=this.toString("hex",0,Pe).replace(/(.{2})/g,"$1 ").trim(),this.length>Pe&&(Ce+=" ... "),"<Buffer "+Ce+">"},t&&(a.prototype[t]=a.prototype.inspect),a.prototype.compare=function(Ce,Pe,ke,Ye,Me){if(bt(Ce,Uint8Array)&&(Ce=a.from(Ce,Ce.offset,Ce.byteLength)),!a.isBuffer(Ce))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Ce);if(Pe===void 0&&(Pe=0),ke===void 0&&(ke=Ce?Ce.length:0),Ye===void 0&&(Ye=0),Me===void 0&&(Me=this.length),Pe<0||ke>Ce.length||Ye<0||Me>this.length)throw new RangeError("out of range index");if(Ye>=Me&&Pe>=ke)return 0;if(Ye>=Me)return-1;if(Pe>=ke)return 1;if(Pe>>>=0,ke>>>=0,Ye>>>=0,Me>>>=0,this===Ce)return 0;let et=Me-Ye,ot=ke-Pe,vt=Math.min(et,ot),At=this.slice(Ye,Me),cr=Ce.slice(Pe,ke);for(let Br=0;Br<vt;++Br)if(At[Br]!==cr[Br]){et=At[Br],ot=cr[Br];break}return et<ot?-1:ot<et?1:0};function T(Ce,Pe,ke,Ye,Me){if(Ce.length===0)return-1;if(typeof ke=="string"?(Ye=ke,ke=0):ke>2147483647?ke=2147483647:ke<-2147483648&&(ke=-2147483648),ke=+ke,$t(ke)&&(ke=Me?0:Ce.length-1),ke<0&&(ke=Ce.length+ke),ke>=Ce.length){if(Me)return-1;ke=Ce.length-1}else if(ke<0)if(Me)ke=0;else return-1;if(typeof Pe=="string"&&(Pe=a.from(Pe,Ye)),a.isBuffer(Pe))return Pe.length===0?-1:I(Ce,Pe,ke,Ye,Me);if(typeof Pe=="number")return Pe=Pe&255,typeof Uint8Array.prototype.indexOf=="function"?Me?Uint8Array.prototype.indexOf.call(Ce,Pe,ke):Uint8Array.prototype.lastIndexOf.call(Ce,Pe,ke):I(Ce,[Pe],ke,Ye,Me);throw new TypeError("val must be string, number or Buffer")}function I(Ce,Pe,ke,Ye,Me){let et=1,ot=Ce.length,vt=Pe.length;if(Ye!==void 0&&(Ye=String(Ye).toLowerCase(),Ye==="ucs2"||Ye==="ucs-2"||Ye==="utf16le"||Ye==="utf-16le")){if(Ce.length<2||Pe.length<2)return-1;et=2,ot/=2,vt/=2,ke/=2}function At(Br,ei){return et===1?Br[ei]:Br.readUInt16BE(ei*et)}let cr;if(Me){let Br=-1;for(cr=ke;cr<ot;cr++)if(At(Ce,cr)===At(Pe,Br===-1?0:cr-Br)){if(Br===-1&&(Br=cr),cr-Br+1===vt)return Br*et}else Br!==-1&&(cr-=cr-Br),Br=-1}else for(ke+vt>ot&&(ke=ot-vt),cr=ke;cr>=0;cr--){let Br=!0;for(let ei=0;ei<vt;ei++)if(At(Ce,cr+ei)!==At(Pe,ei)){Br=!1;break}if(Br)return cr}return-1}a.prototype.includes=function(Ce,Pe,ke){return this.indexOf(Ce,Pe,ke)!==-1},a.prototype.indexOf=function(Ce,Pe,ke){return T(this,Ce,Pe,ke,!0)},a.prototype.lastIndexOf=function(Ce,Pe,ke){return T(this,Ce,Pe,ke,!1)};function B(Ce,Pe,ke,Ye){ke=Number(ke)||0;let Me=Ce.length-ke;Ye?(Ye=Number(Ye),Ye>Me&&(Ye=Me)):Ye=Me;let et=Pe.length;Ye>et/2&&(Ye=et/2);let ot;for(ot=0;ot<Ye;++ot){let vt=parseInt(Pe.substr(ot*2,2),16);if($t(vt))return ot;Ce[ke+ot]=vt}return ot}function O(Ce,Pe,ke,Ye){return Vt(Ke(Pe,Ce.length-ke),Ce,ke,Ye)}function L(Ce,Pe,ke,Ye){return Vt(ht(Pe),Ce,ke,Ye)}function k(Ce,Pe,ke,Ye){return Vt(xt(Pe),Ce,ke,Ye)}function U(Ce,Pe,ke,Ye){return Vt(St(Pe,Ce.length-ke),Ce,ke,Ye)}a.prototype.write=function(Ce,Pe,ke,Ye){if(Pe===void 0)Ye="utf8",ke=this.length,Pe=0;else if(ke===void 0&&typeof Pe=="string")Ye=Pe,ke=this.length,Pe=0;else if(isFinite(Pe))Pe=Pe>>>0,isFinite(ke)?(ke=ke>>>0,Ye===void 0&&(Ye="utf8")):(Ye=ke,ke=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let Me=this.length-Pe;if((ke===void 0||ke>Me)&&(ke=Me),Ce.length>0&&(ke<0||Pe<0)||Pe>this.length)throw new RangeError("Attempt to write outside buffer bounds");Ye||(Ye="utf8");let et=!1;for(;;)switch(Ye){case"hex":return B(this,Ce,Pe,ke);case"utf8":case"utf-8":return O(this,Ce,Pe,ke);case"ascii":case"latin1":case"binary":return L(this,Ce,Pe,ke);case"base64":return k(this,Ce,Pe,ke);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,Ce,Pe,ke);default:if(et)throw new TypeError("Unknown encoding: "+Ye);Ye=(""+Ye).toLowerCase(),et=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function j(Ce,Pe,ke){return Pe===0&&ke===Ce.length?i.fromByteArray(Ce):i.fromByteArray(Ce.slice(Pe,ke))}function Y(Ce,Pe,ke){ke=Math.min(Ce.length,ke);let Ye=[],Me=Pe;for(;Me<ke;){let et=Ce[Me],ot=null,vt=et>239?4:et>223?3:et>191?2:1;if(Me+vt<=ke){let At,cr,Br,ei;switch(vt){case 1:et<128&&(ot=et);break;case 2:At=Ce[Me+1],(At&192)===128&&(ei=(et&31)<<6|At&63,ei>127&&(ot=ei));break;case 3:At=Ce[Me+1],cr=Ce[Me+2],(At&192)===128&&(cr&192)===128&&(ei=(et&15)<<12|(At&63)<<6|cr&63,ei>2047&&(ei<55296||ei>57343)&&(ot=ei));break;case 4:At=Ce[Me+1],cr=Ce[Me+2],Br=Ce[Me+3],(At&192)===128&&(cr&192)===128&&(Br&192)===128&&(ei=(et&15)<<18|(At&63)<<12|(cr&63)<<6|Br&63,ei>65535&&ei<1114112&&(ot=ei))}}ot===null?(ot=65533,vt=1):ot>65535&&(ot-=65536,Ye.push(ot>>>10&1023|55296),ot=56320|ot&1023),Ye.push(ot),Me+=vt}return q(Ye)}let X=4096;function q(Ce){let Pe=Ce.length;if(Pe<=X)return String.fromCharCode.apply(String,Ce);let ke="",Ye=0;for(;Ye<Pe;)ke+=String.fromCharCode.apply(String,Ce.slice(Ye,Ye+=X));return ke}function J(Ce,Pe,ke){let Ye="";ke=Math.min(Ce.length,ke);for(let Me=Pe;Me<ke;++Me)Ye+=String.fromCharCode(Ce[Me]&127);return Ye}function $(Ce,Pe,ke){let Ye="";ke=Math.min(Ce.length,ke);for(let Me=Pe;Me<ke;++Me)Ye+=String.fromCharCode(Ce[Me]);return Ye}function ee(Ce,Pe,ke){let Ye=Ce.length;(!Pe||Pe<0)&&(Pe=0),(!ke||ke<0||ke>Ye)&&(ke=Ye);let Me="";for(let et=Pe;et<ke;++et)Me+=Xe[Ce[et]];return Me}function ae(Ce,Pe,ke){let Ye=Ce.slice(Pe,ke),Me="";for(let et=0;et<Ye.length-1;et+=2)Me+=String.fromCharCode(Ye[et]+Ye[et+1]*256);return Me}a.prototype.slice=function(Ce,Pe){let ke=this.length;Ce=~~Ce,Pe=Pe===void 0?ke:~~Pe,Ce<0?(Ce+=ke,Ce<0&&(Ce=0)):Ce>ke&&(Ce=ke),Pe<0?(Pe+=ke,Pe<0&&(Pe=0)):Pe>ke&&(Pe=ke),Pe<Ce&&(Pe=Ce);let Ye=this.subarray(Ce,Pe);return Object.setPrototypeOf(Ye,a.prototype),Ye};function ce(Ce,Pe,ke){if(Ce%1!==0||Ce<0)throw new RangeError("offset is not uint");if(Ce+Pe>ke)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(Ce,Pe,ke){Ce=Ce>>>0,Pe=Pe>>>0,ke||ce(Ce,Pe,this.length);let Ye=this[Ce],Me=1,et=0;for(;++et<Pe&&(Me*=256);)Ye+=this[Ce+et]*Me;return Ye},a.prototype.readUintBE=a.prototype.readUIntBE=function(Ce,Pe,ke){Ce=Ce>>>0,Pe=Pe>>>0,ke||ce(Ce,Pe,this.length);let Ye=this[Ce+--Pe],Me=1;for(;Pe>0&&(Me*=256);)Ye+=this[Ce+--Pe]*Me;return Ye},a.prototype.readUint8=a.prototype.readUInt8=function(Ce,Pe){return Ce=Ce>>>0,Pe||ce(Ce,1,this.length),this[Ce]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(Ce,Pe){return Ce=Ce>>>0,Pe||ce(Ce,2,this.length),this[Ce]|this[Ce+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(Ce,Pe){return Ce=Ce>>>0,Pe||ce(Ce,2,this.length),this[Ce]<<8|this[Ce+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(Ce,Pe){return Ce=Ce>>>0,Pe||ce(Ce,4,this.length),(this[Ce]|this[Ce+1]<<8|this[Ce+2]<<16)+this[Ce+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(Ce,Pe){return Ce=Ce>>>0,Pe||ce(Ce,4,this.length),this[Ce]*16777216+(this[Ce+1]<<16|this[Ce+2]<<8|this[Ce+3])},a.prototype.readBigUInt64LE=Oe(function(Ce){Ce=Ce>>>0,De(Ce,"offset");let Pe=this[Ce],ke=this[Ce+7];(Pe===void 0||ke===void 0)&&ze(Ce,this.length-8);let Ye=Pe+this[++Ce]*2**8+this[++Ce]*2**16+this[++Ce]*2**24,Me=this[++Ce]+this[++Ce]*2**8+this[++Ce]*2**16+ke*2**24;return BigInt(Ye)+(BigInt(Me)<<BigInt(32))}),a.prototype.readBigUInt64BE=Oe(function(Ce){Ce=Ce>>>0,De(Ce,"offset");let Pe=this[Ce],ke=this[Ce+7];(Pe===void 0||ke===void 0)&&ze(Ce,this.length-8);let Ye=Pe*2**24+this[++Ce]*2**16+this[++Ce]*2**8+this[++Ce],Me=this[++Ce]*2**24+this[++Ce]*2**16+this[++Ce]*2**8+ke;return(BigInt(Ye)<<BigInt(32))+BigInt(Me)}),a.prototype.readIntLE=function(Ce,Pe,ke){Ce=Ce>>>0,Pe=Pe>>>0,ke||ce(Ce,Pe,this.length);let Ye=this[Ce],Me=1,et=0;for(;++et<Pe&&(Me*=256);)Ye+=this[Ce+et]*Me;return Me*=128,Ye>=Me&&(Ye-=Math.pow(2,8*Pe)),Ye},a.prototype.readIntBE=function(Ce,Pe,ke){Ce=Ce>>>0,Pe=Pe>>>0,ke||ce(Ce,Pe,this.length);let Ye=Pe,Me=1,et=this[Ce+--Ye];for(;Ye>0&&(Me*=256);)et+=this[Ce+--Ye]*Me;return Me*=128,et>=Me&&(et-=Math.pow(2,8*Pe)),et},a.prototype.readInt8=function(Ce,Pe){return Ce=Ce>>>0,Pe||ce(Ce,1,this.length),this[Ce]&128?(255-this[Ce]+1)*-1:this[Ce]},a.prototype.readInt16LE=function(Ce,Pe){Ce=Ce>>>0,Pe||ce(Ce,2,this.length);let ke=this[Ce]|this[Ce+1]<<8;return ke&32768?ke|4294901760:ke},a.prototype.readInt16BE=function(Ce,Pe){Ce=Ce>>>0,Pe||ce(Ce,2,this.length);let ke=this[Ce+1]|this[Ce]<<8;return ke&32768?ke|4294901760:ke},a.prototype.readInt32LE=function(Ce,Pe){return Ce=Ce>>>0,Pe||ce(Ce,4,this.length),this[Ce]|this[Ce+1]<<8|this[Ce+2]<<16|this[Ce+3]<<24},a.prototype.readInt32BE=function(Ce,Pe){return Ce=Ce>>>0,Pe||ce(Ce,4,this.length),this[Ce]<<24|this[Ce+1]<<16|this[Ce+2]<<8|this[Ce+3]},a.prototype.readBigInt64LE=Oe(function(Ce){Ce=Ce>>>0,De(Ce,"offset");let Pe=this[Ce],ke=this[Ce+7];(Pe===void 0||ke===void 0)&&ze(Ce,this.length-8);let Ye=this[Ce+4]+this[Ce+5]*2**8+this[Ce+6]*2**16+(ke<<24);return(BigInt(Ye)<<BigInt(32))+BigInt(Pe+this[++Ce]*2**8+this[++Ce]*2**16+this[++Ce]*2**24)}),a.prototype.readBigInt64BE=Oe(function(Ce){Ce=Ce>>>0,De(Ce,"offset");let Pe=this[Ce],ke=this[Ce+7];(Pe===void 0||ke===void 0)&&ze(Ce,this.length-8);let Ye=(Pe<<24)+this[++Ce]*2**16+this[++Ce]*2**8+this[++Ce];return(BigInt(Ye)<<BigInt(32))+BigInt(this[++Ce]*2**24+this[++Ce]*2**16+this[++Ce]*2**8+ke)}),a.prototype.readFloatLE=function(Ce,Pe){return Ce=Ce>>>0,Pe||ce(Ce,4,this.length),e.read(this,Ce,!0,23,4)},a.prototype.readFloatBE=function(Ce,Pe){return Ce=Ce>>>0,Pe||ce(Ce,4,this.length),e.read(this,Ce,!1,23,4)},a.prototype.readDoubleLE=function(Ce,Pe){return Ce=Ce>>>0,Pe||ce(Ce,8,this.length),e.read(this,Ce,!0,52,8)},a.prototype.readDoubleBE=function(Ce,Pe){return Ce=Ce>>>0,Pe||ce(Ce,8,this.length),e.read(this,Ce,!1,52,8)};function re(Ce,Pe,ke,Ye,Me,et){if(!a.isBuffer(Ce))throw new TypeError('"buffer" argument must be a Buffer instance');if(Pe>Me||Pe<et)throw new RangeError('"value" argument is out of bounds');if(ke+Ye>Ce.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(Ce,Pe,ke,Ye){if(Ce=+Ce,Pe=Pe>>>0,ke=ke>>>0,!Ye){let ot=Math.pow(2,8*ke)-1;re(this,Ce,Pe,ke,ot,0)}let Me=1,et=0;for(this[Pe]=Ce&255;++et<ke&&(Me*=256);)this[Pe+et]=Ce/Me&255;return Pe+ke},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(Ce,Pe,ke,Ye){if(Ce=+Ce,Pe=Pe>>>0,ke=ke>>>0,!Ye){let ot=Math.pow(2,8*ke)-1;re(this,Ce,Pe,ke,ot,0)}let Me=ke-1,et=1;for(this[Pe+Me]=Ce&255;--Me>=0&&(et*=256);)this[Pe+Me]=Ce/et&255;return Pe+ke},a.prototype.writeUint8=a.prototype.writeUInt8=function(Ce,Pe,ke){return Ce=+Ce,Pe=Pe>>>0,ke||re(this,Ce,Pe,1,255,0),this[Pe]=Ce&255,Pe+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(Ce,Pe,ke){return Ce=+Ce,Pe=Pe>>>0,ke||re(this,Ce,Pe,2,65535,0),this[Pe]=Ce&255,this[Pe+1]=Ce>>>8,Pe+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(Ce,Pe,ke){return Ce=+Ce,Pe=Pe>>>0,ke||re(this,Ce,Pe,2,65535,0),this[Pe]=Ce>>>8,this[Pe+1]=Ce&255,Pe+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(Ce,Pe,ke){return Ce=+Ce,Pe=Pe>>>0,ke||re(this,Ce,Pe,4,4294967295,0),this[Pe+3]=Ce>>>24,this[Pe+2]=Ce>>>16,this[Pe+1]=Ce>>>8,this[Pe]=Ce&255,Pe+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(Ce,Pe,ke){return Ce=+Ce,Pe=Pe>>>0,ke||re(this,Ce,Pe,4,4294967295,0),this[Pe]=Ce>>>24,this[Pe+1]=Ce>>>16,this[Pe+2]=Ce>>>8,this[Pe+3]=Ce&255,Pe+4};function se(Ce,Pe,ke,Ye,Me){Re(Pe,Ye,Me,Ce,ke,7);let et=Number(Pe&BigInt(4294967295));Ce[ke++]=et,et=et>>8,Ce[ke++]=et,et=et>>8,Ce[ke++]=et,et=et>>8,Ce[ke++]=et;let ot=Number(Pe>>BigInt(32)&BigInt(4294967295));return Ce[ke++]=ot,ot=ot>>8,Ce[ke++]=ot,ot=ot>>8,Ce[ke++]=ot,ot=ot>>8,Ce[ke++]=ot,ke}function fe(Ce,Pe,ke,Ye,Me){Re(Pe,Ye,Me,Ce,ke,7);let et=Number(Pe&BigInt(4294967295));Ce[ke+7]=et,et=et>>8,Ce[ke+6]=et,et=et>>8,Ce[ke+5]=et,et=et>>8,Ce[ke+4]=et;let ot=Number(Pe>>BigInt(32)&BigInt(4294967295));return Ce[ke+3]=ot,ot=ot>>8,Ce[ke+2]=ot,ot=ot>>8,Ce[ke+1]=ot,ot=ot>>8,Ce[ke]=ot,ke+8}a.prototype.writeBigUInt64LE=Oe(function(Ce,Pe=0){return se(this,Ce,Pe,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=Oe(function(Ce,Pe=0){return fe(this,Ce,Pe,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(Ce,Pe,ke,Ye){if(Ce=+Ce,Pe=Pe>>>0,!Ye){let vt=Math.pow(2,8*ke-1);re(this,Ce,Pe,ke,vt-1,-vt)}let Me=0,et=1,ot=0;for(this[Pe]=Ce&255;++Me<ke&&(et*=256);)Ce<0&&ot===0&&this[Pe+Me-1]!==0&&(ot=1),this[Pe+Me]=(Ce/et>>0)-ot&255;return Pe+ke},a.prototype.writeIntBE=function(Ce,Pe,ke,Ye){if(Ce=+Ce,Pe=Pe>>>0,!Ye){let vt=Math.pow(2,8*ke-1);re(this,Ce,Pe,ke,vt-1,-vt)}let Me=ke-1,et=1,ot=0;for(this[Pe+Me]=Ce&255;--Me>=0&&(et*=256);)Ce<0&&ot===0&&this[Pe+Me+1]!==0&&(ot=1),this[Pe+Me]=(Ce/et>>0)-ot&255;return Pe+ke},a.prototype.writeInt8=function(Ce,Pe,ke){return Ce=+Ce,Pe=Pe>>>0,ke||re(this,Ce,Pe,1,127,-128),Ce<0&&(Ce=255+Ce+1),this[Pe]=Ce&255,Pe+1},a.prototype.writeInt16LE=function(Ce,Pe,ke){return Ce=+Ce,Pe=Pe>>>0,ke||re(this,Ce,Pe,2,32767,-32768),this[Pe]=Ce&255,this[Pe+1]=Ce>>>8,Pe+2},a.prototype.writeInt16BE=function(Ce,Pe,ke){return Ce=+Ce,Pe=Pe>>>0,ke||re(this,Ce,Pe,2,32767,-32768),this[Pe]=Ce>>>8,this[Pe+1]=Ce&255,Pe+2},a.prototype.writeInt32LE=function(Ce,Pe,ke){return Ce=+Ce,Pe=Pe>>>0,ke||re(this,Ce,Pe,4,2147483647,-2147483648),this[Pe]=Ce&255,this[Pe+1]=Ce>>>8,this[Pe+2]=Ce>>>16,this[Pe+3]=Ce>>>24,Pe+4},a.prototype.writeInt32BE=function(Ce,Pe,ke){return Ce=+Ce,Pe=Pe>>>0,ke||re(this,Ce,Pe,4,2147483647,-2147483648),Ce<0&&(Ce=4294967295+Ce+1),this[Pe]=Ce>>>24,this[Pe+1]=Ce>>>16,this[Pe+2]=Ce>>>8,this[Pe+3]=Ce&255,Pe+4},a.prototype.writeBigInt64LE=Oe(function(Ce,Pe=0){return se(this,Ce,Pe,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=Oe(function(Ce,Pe=0){return fe(this,Ce,Pe,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function me(Ce,Pe,ke,Ye,Me,et){if(ke+Ye>Ce.length)throw new RangeError("Index out of range");if(ke<0)throw new RangeError("Index out of range")}function oe(Ce,Pe,ke,Ye,Me){return Pe=+Pe,ke=ke>>>0,Me||me(Ce,Pe,ke,4),e.write(Ce,Pe,ke,Ye,23,4),ke+4}a.prototype.writeFloatLE=function(Ce,Pe,ke){return oe(this,Ce,Pe,!0,ke)},a.prototype.writeFloatBE=function(Ce,Pe,ke){return oe(this,Ce,Pe,!1,ke)};function ve(Ce,Pe,ke,Ye,Me){return Pe=+Pe,ke=ke>>>0,Me||me(Ce,Pe,ke,8),e.write(Ce,Pe,ke,Ye,52,8),ke+8}a.prototype.writeDoubleLE=function(Ce,Pe,ke){return ve(this,Ce,Pe,!0,ke)},a.prototype.writeDoubleBE=function(Ce,Pe,ke){return ve(this,Ce,Pe,!1,ke)},a.prototype.copy=function(Ce,Pe,ke,Ye){if(!a.isBuffer(Ce))throw new TypeError("argument should be a Buffer");if(ke||(ke=0),!Ye&&Ye!==0&&(Ye=this.length),Pe>=Ce.length&&(Pe=Ce.length),Pe||(Pe=0),Ye>0&&Ye<ke&&(Ye=ke),Ye===ke||Ce.length===0||this.length===0)return 0;if(Pe<0)throw new RangeError("targetStart out of bounds");if(ke<0||ke>=this.length)throw new RangeError("Index out of range");if(Ye<0)throw new RangeError("sourceEnd out of bounds");Ye>this.length&&(Ye=this.length),Ce.length-Pe<Ye-ke&&(Ye=Ce.length-Pe+ke);let Me=Ye-ke;return this===Ce&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(Pe,ke,Ye):Uint8Array.prototype.set.call(Ce,this.subarray(ke,Ye),Pe),Me},a.prototype.fill=function(Ce,Pe,ke,Ye){if(typeof Ce=="string"){if(typeof Pe=="string"?(Ye=Pe,Pe=0,ke=this.length):typeof ke=="string"&&(Ye=ke,ke=this.length),Ye!==void 0&&typeof Ye!="string")throw new TypeError("encoding must be a string");if(typeof Ye=="string"&&!a.isEncoding(Ye))throw new TypeError("Unknown encoding: "+Ye);if(Ce.length===1){let et=Ce.charCodeAt(0);(Ye==="utf8"&&et<128||Ye==="latin1")&&(Ce=et)}}else typeof Ce=="number"?Ce=Ce&255:typeof Ce=="boolean"&&(Ce=Number(Ce));if(Pe<0||this.length<Pe||this.length<ke)throw new RangeError("Out of range index");if(ke<=Pe)return this;Pe=Pe>>>0,ke=ke===void 0?this.length:ke>>>0,Ce||(Ce=0);let Me;if(typeof Ce=="number")for(Me=Pe;Me<ke;++Me)this[Me]=Ce;else{let et=a.isBuffer(Ce)?Ce:a.from(Ce,Ye),ot=et.length;if(ot===0)throw new TypeError('The value "'+Ce+'" is invalid for argument "value"');for(Me=0;Me<ke-Pe;++Me)this[Me+Pe]=et[Me%ot]}return this};let ne={};function pe(Ce,Pe,ke){ne[Ce]=class extends ke{constructor(){super(),Object.defineProperty(this,"message",{value:Pe.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${Ce}]`,this.stack,delete this.name}get code(){return Ce}set code(Ye){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Ye,writable:!0})}toString(){return`${this.name} [${Ce}]: ${this.message}`}}}pe("ERR_BUFFER_OUT_OF_BOUNDS",function(Ce){return Ce?`${Ce} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),pe("ERR_INVALID_ARG_TYPE",function(Ce,Pe){return`The "${Ce}" argument must be of type number. Received type ${typeof Pe}`},TypeError),pe("ERR_OUT_OF_RANGE",function(Ce,Pe,ke){let Ye=`The value of "${Ce}" is out of range.`,Me=ke;return Number.isInteger(ke)&&Math.abs(ke)>2**32?Me=Ae(String(ke)):typeof ke=="bigint"&&(Me=String(ke),(ke>BigInt(2)**BigInt(32)||ke<-(BigInt(2)**BigInt(32)))&&(Me=Ae(Me)),Me+="n"),Ye+=` It must be ${Pe}. Received ${Me}`,Ye},RangeError);function Ae(Ce){let Pe="",ke=Ce.length,Ye=Ce[0]==="-"?1:0;for(;ke>=Ye+4;ke-=3)Pe=`_${Ce.slice(ke-3,ke)}${Pe}`;return`${Ce.slice(0,ke)}${Pe}`}function Ge(Ce,Pe,ke){De(Pe,"offset"),(Ce[Pe]===void 0||Ce[Pe+ke]===void 0)&&ze(Pe,Ce.length-(ke+1))}function Re(Ce,Pe,ke,Ye,Me,et){if(Ce>ke||Ce<Pe){let ot=typeof Pe=="bigint"?"n":"",vt;throw Pe===0||Pe===BigInt(0)?vt=`>= 0${ot} and < 2${ot} ** ${(et+1)*8}${ot}`:vt=`>= -(2${ot} ** ${(et+1)*8-1}${ot}) and < 2 ** ${(et+1)*8-1}${ot}`,new ne.ERR_OUT_OF_RANGE("value",vt,Ce)}Ge(Ye,Me,et)}function De(Ce,Pe){if(typeof Ce!="number")throw new ne.ERR_INVALID_ARG_TYPE(Pe,"number",Ce)}function ze(Ce,Pe,ke){throw Math.floor(Ce)!==Ce?(De(Ce,ke),new ne.ERR_OUT_OF_RANGE("offset","an integer",Ce)):Pe<0?new ne.ERR_BUFFER_OUT_OF_BOUNDS:new ne.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${Pe}`,Ce)}let He=/[^+/0-9A-Za-z-_]/g;function Be(Ce){if(Ce=Ce.split("=")[0],Ce=Ce.trim().replace(He,""),Ce.length<2)return"";for(;Ce.length%4!==0;)Ce=Ce+"=";return Ce}function Ke(Ce,Pe){Pe=Pe||1/0;let ke,Ye=Ce.length,Me=null,et=[];for(let ot=0;ot<Ye;++ot){if(ke=Ce.charCodeAt(ot),ke>55295&&ke<57344){if(!Me){if(ke>56319){(Pe-=3)>-1&&et.push(239,191,189);continue}else if(ot+1===Ye){(Pe-=3)>-1&&et.push(239,191,189);continue}Me=ke;continue}if(ke<56320){(Pe-=3)>-1&&et.push(239,191,189),Me=ke;continue}ke=(Me-55296<<10|ke-56320)+65536}else Me&&(Pe-=3)>-1&&et.push(239,191,189);if(Me=null,ke<128){if((Pe-=1)<0)break;et.push(ke)}else if(ke<2048){if((Pe-=2)<0)break;et.push(ke>>6|192,ke&63|128)}else if(ke<65536){if((Pe-=3)<0)break;et.push(ke>>12|224,ke>>6&63|128,ke&63|128)}else if(ke<1114112){if((Pe-=4)<0)break;et.push(ke>>18|240,ke>>12&63|128,ke>>6&63|128,ke&63|128)}else throw new Error("Invalid code point")}return et}function ht(Ce){let Pe=[];for(let ke=0;ke<Ce.length;++ke)Pe.push(Ce.charCodeAt(ke)&255);return Pe}function St(Ce,Pe){let ke,Ye,Me,et=[];for(let ot=0;ot<Ce.length&&!((Pe-=2)<0);++ot)ke=Ce.charCodeAt(ot),Ye=ke>>8,Me=ke%256,et.push(Me),et.push(Ye);return et}function xt(Ce){return i.toByteArray(Be(Ce))}function Vt(Ce,Pe,ke,Ye){let Me;for(Me=0;Me<Ye&&!(Me+ke>=Pe.length||Me>=Ce.length);++Me)Pe[Me+ke]=Ce[Me];return Me}function bt(Ce,Pe){return Ce instanceof Pe||Ce!=null&&Ce.constructor!=null&&Ce.constructor.name!=null&&Ce.constructor.name===Pe.name}function $t(Ce){return Ce!==Ce}let Xe=function(){let Ce="0123456789abcdef",Pe=new Array(256);for(let ke=0;ke<16;++ke){let Ye=ke*16;for(let Me=0;Me<16;++Me)Pe[Ye+Me]=Ce[ke]+Ce[Me]}return Pe}();function Oe(Ce){return typeof BigInt>"u"?ft:Ce}function ft(){throw new Error("BigInt not supported")}return HF}var LH,Dit,bte,Eit,HF,bit,CTn=Ey(()=>{gn(),vn(),xn(),LH={},Dit=!1,bte={},Eit=!1,HF={},bit=!1}),ig={};OH(ig,{Buffer:()=>Jxe,INSPECT_MAX_BYTES:()=>K6r,default:()=>u9,kMaxLength:()=>J6r});var u9,Jxe,K6r,J6r,ng=Ey(()=>{gn(),vn(),xn(),CTn(),u9=STn(),u9.Buffer,u9.SlowBuffer,u9.INSPECT_MAX_BYTES,u9.kMaxLength,Jxe=u9.Buffer,K6r=u9.INSPECT_MAX_BYTES,J6r=u9.kMaxLength}),vn=Ey(()=>{ng()}),e0=Sn((i,e)=>{gn(),vn(),xn();var t=class extends Error{constructor(r){if(!Array.isArray(r))throw new TypeError(`Expected input to be an Array, got ${typeof r}`);let n="";for(let s=0;s<r.length;s++)n+=` ${r[s].stack}
33379
33379
  `;super(n),this.name="AggregateError",this.errors=r}};e.exports={AggregateError:t,ArrayIsArray(r){return Array.isArray(r)},ArrayPrototypeIncludes(r,n){return r.includes(n)},ArrayPrototypeIndexOf(r,n){return r.indexOf(n)},ArrayPrototypeJoin(r,n){return r.join(n)},ArrayPrototypeMap(r,n){return r.map(n)},ArrayPrototypePop(r,n){return r.pop(n)},ArrayPrototypePush(r,n){return r.push(n)},ArrayPrototypeSlice(r,n,s){return r.slice(n,s)},Error,FunctionPrototypeCall(r,n,...s){return r.call(n,...s)},FunctionPrototypeSymbolHasInstance(r,n){return Function.prototype[Symbol.hasInstance].call(r,n)},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(r,n){return Object.defineProperties(r,n)},ObjectDefineProperty(r,n,s){return Object.defineProperty(r,n,s)},ObjectGetOwnPropertyDescriptor(r,n){return Object.getOwnPropertyDescriptor(r,n)},ObjectKeys(r){return Object.keys(r)},ObjectSetPrototypeOf(r,n){return Object.setPrototypeOf(r,n)},Promise,PromisePrototypeCatch(r,n){return r.catch(n)},PromisePrototypeThen(r,n,s){return r.then(n,s)},PromiseReject(r){return Promise.reject(r)},PromiseResolve(r){return Promise.resolve(r)},ReflectApply:Reflect.apply,RegExpPrototypeTest(r,n){return r.test(n)},SafeSet:Set,String,StringPrototypeSlice(r,n,s){return r.slice(n,s)},StringPrototypeToLowerCase(r){return r.toLowerCase()},StringPrototypeToUpperCase(r){return r.toUpperCase()},StringPrototypeTrim(r){return r.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(r,n,s){return r.set(n,s)},Boolean,Uint8Array}}),Z6r=Sn((i,e)=>{gn(),vn(),xn(),e.exports={format(t,...r){return t.replace(/%([sdifj])/g,function(...[n,s]){let a=r.shift();return s==="f"?a.toFixed(6):s==="j"?JSON.stringify(a):s==="s"&&typeof a=="object"?`${a.constructor!==Object?a.constructor.name:""} {}`.trim():a.toString()})},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}}}}),N3=Sn((i,e)=>{gn(),vn(),xn();var{format:t,inspect:r}=Z6r(),{AggregateError:n}=e0(),s=globalThis.AggregateError||n,a=Symbol("kIsNodeError"),o=["string","function","number","object","Function","Object","boolean","bigint","symbol"],l=/^([A-Z][a-z0-9]*)+$/,u="__node_internal_",c={};function d(E,S){if(!E)throw new c.ERR_INTERNAL_ASSERTION(S)}function h(E){let S="",C=E.length,T=E[0]==="-"?1:0;for(;C>=T+4;C-=3)S=`_${E.slice(C-3,C)}${S}`;return`${E.slice(0,C)}${S}`}function p(E,S,C){if(typeof S=="function")return d(S.length<=C.length,`Code: ${E}; The provided arguments length (${C.length}) does not match the required ones (${S.length}).`),S(...C);let T=(S.match(/%[dfijoOs]/g)||[]).length;return d(T===C.length,`Code: ${E}; The provided arguments length (${C.length}) does not match the required ones (${T}).`),C.length===0?S:t(S,...C)}function m(E,S,C){C||(C=Error);class T extends C{constructor(...B){super(p(E,S,B))}toString(){return`${this.name} [${E}]: ${this.message}`}}Object.defineProperties(T.prototype,{name:{value:C.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${E}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),T.prototype.code=E,T.prototype[a]=!0,c[E]=T}function x(E){let S=u+E.name;return Object.defineProperty(E,"name",{value:S}),E}function v(E,S){if(E&&S&&E!==S){if(Array.isArray(S.errors))return S.errors.push(E),S;let C=new s([S,E],S.message);return C.code=S.code,C}return E||S}var y=class extends Error{constructor(E="The operation was aborted",S=void 0){if(S!==void 0&&typeof S!="object")throw new c.ERR_INVALID_ARG_TYPE("options","Object",S);super(E,S),this.code="ABORT_ERR",this.name="AbortError"}};m("ERR_ASSERTION","%s",Error),m("ERR_INVALID_ARG_TYPE",(E,S,C)=>{d(typeof E=="string","'name' must be a string"),Array.isArray(S)||(S=[S]);let T="The ";E.endsWith(" argument")?T+=`${E} `:T+=`"${E}" ${E.includes(".")?"property":"argument"} `,T+="must be ";let I=[],B=[],O=[];for(let k of S)d(typeof k=="string","All expected entries have to be of type string"),o.includes(k)?I.push(k.toLowerCase()):l.test(k)?B.push(k):(d(k!=="object",'The value "object" should be written as "Object"'),O.push(k));if(B.length>0){let k=I.indexOf("object");k!==-1&&(I.splice(I,k,1),B.push("Object"))}if(I.length>0){switch(I.length){case 1:T+=`of type ${I[0]}`;break;case 2:T+=`one of type ${I[0]} or ${I[1]}`;break;default:{let k=I.pop();T+=`one of type ${I.join(", ")}, or ${k}`}}(B.length>0||O.length>0)&&(T+=" or ")}if(B.length>0){switch(B.length){case 1:T+=`an instance of ${B[0]}`;break;case 2:T+=`an instance of ${B[0]} or ${B[1]}`;break;default:{let k=B.pop();T+=`an instance of ${B.join(", ")}, or ${k}`}}O.length>0&&(T+=" or ")}switch(O.length){case 0:break;case 1:O[0].toLowerCase()!==O[0]&&(T+="an "),T+=`${O[0]}`;break;case 2:T+=`one of ${O[0]} or ${O[1]}`;break;default:{let k=O.pop();T+=`one of ${O.join(", ")}, or ${k}`}}if(C==null)T+=`. Received ${C}`;else if(typeof C=="function"&&C.name)T+=`. Received function ${C.name}`;else if(typeof C=="object"){var L;if((L=C.constructor)!==null&&L!==void 0&&L.name)T+=`. Received an instance of ${C.constructor.name}`;else{let k=r(C,{depth:-1});T+=`. Received ${k}`}}else{let k=r(C,{colors:!1});k.length>25&&(k=`${k.slice(0,25)}...`),T+=`. Received type ${typeof C} (${k})`}return T},TypeError),m("ERR_INVALID_ARG_VALUE",(E,S,C="is invalid")=>{let T=r(S);return T.length>128&&(T=T.slice(0,128)+"..."),`The ${E.includes(".")?"property":"argument"} '${E}' ${C}. Received ${T}`},TypeError),m("ERR_INVALID_RETURN_VALUE",(E,S,C)=>{var T;let I=C!=null&&(T=C.constructor)!==null&&T!==void 0&&T.name?`instance of ${C.constructor.name}`:`type ${typeof C}`;return`Expected ${E} to be returned from the "${S}" function but got ${I}.`},TypeError),m("ERR_MISSING_ARGS",(...E)=>{d(E.length>0,"At least one arg needs to be specified");let S,C=E.length;switch(E=(Array.isArray(E)?E:[E]).map(T=>`"${T}"`).join(" or "),C){case 1:S+=`The ${E[0]} argument`;break;case 2:S+=`The ${E[0]} and ${E[1]} arguments`;break;default:{let T=E.pop();S+=`The ${E.join(", ")}, and ${T} arguments`}break}return`${S} must be specified`},TypeError),m("ERR_OUT_OF_RANGE",(E,S,C)=>{d(S,'Missing "range" argument');let T;if(Number.isInteger(C)&&Math.abs(C)>2**32)T=h(String(C));else if(typeof C=="bigint"){T=String(C);let I=BigInt(2)**BigInt(32);(C>I||C<-I)&&(T=h(T)),T+="n"}else T=r(C);return`The value of "${E}" is out of range. It must be ${S}. Received ${T}`},RangeError),m("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),m("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),m("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),m("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),m("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),m("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),m("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),m("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),m("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),m("ERR_STREAM_WRITE_AFTER_END","write after end",Error),m("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),e.exports={AbortError:y,aggregateTwoErrors:x(v),hideStackFrames:x,codes:c}}),_te=Sn((i,e)=>{gn(),vn(),xn();var{AbortController:t,AbortSignal:r}=typeof self<"u"?self:typeof window<"u"?window:void 0;e.exports=t,e.exports.AbortSignal=r,e.exports.default=t}),WF={};OH(WF,{EventEmitter:()=>$6r,default:()=>NH,defaultMaxListeners:()=>eSr,init:()=>tSr,listenerCount:()=>rSr,on:()=>iSr,once:()=>nSr});function TTn(){if(_it)return Ate;_it=!0;var i=typeof Reflect=="object"?Reflect:null,e=i&&typeof i.apply=="function"?i.apply:function(C,T,I){return Function.prototype.apply.call(C,T,I)},t;i&&typeof i.ownKeys=="function"?t=i.ownKeys:Object.getOwnPropertySymbols?t=function(C){return Object.getOwnPropertyNames(C).concat(Object.getOwnPropertySymbols(C))}:t=function(C){return Object.getOwnPropertyNames(C)};function r(C){}var n=Number.isNaN||function(C){return C!==C};function s(){s.init.call(this)}Ate=s,Ate.once=y,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function o(C){if(typeof C!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof C)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(C){if(typeof C!="number"||C<0||n(C))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+C+".");a=C}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(C){if(typeof C!="number"||C<0||n(C))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+C+".");return this._maxListeners=C,this};function l(C){return C._maxListeners===void 0?s.defaultMaxListeners:C._maxListeners}s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(C){for(var T=[],I=1;I<arguments.length;I++)T.push(arguments[I]);var B=C==="error",O=this._events;if(O!==void 0)B=B&&O.error===void 0;else if(!B)return!1;if(B){var L;if(T.length>0&&(L=T[0]),L instanceof Error)throw L;var k=new Error("Unhandled error."+(L?" ("+L.message+")":""));throw k.context=L,k}var U=O[C];if(U===void 0)return!1;if(typeof U=="function")e(U,this,T);else for(var j=U.length,Y=m(U,j),I=0;I<j;++I)e(Y[I],this,T);return!0};function u(C,T,I,B){var O,L,k;if(o(I),L=C._events,L===void 0?(L=C._events=Object.create(null),C._eventsCount=0):(L.newListener!==void 0&&(C.emit("newListener",T,I.listener?I.listener:I),L=C._events),k=L[T]),k===void 0)k=L[T]=I,++C._eventsCount;else if(typeof k=="function"?k=L[T]=B?[I,k]:[k,I]:B?k.unshift(I):k.push(I),O=l(C),O>0&&k.length>O&&!k.warned){k.warned=!0;var U=new Error("Possible EventEmitter memory leak detected. "+k.length+" "+String(T)+" listeners added. Use emitter.setMaxListeners() to increase limit");U.name="MaxListenersExceededWarning",U.emitter=C,U.type=T,U.count=k.length}return C}s.prototype.addListener=function(C,T){return u(this,C,T,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(C,T){return u(this,C,T,!0)};function c(){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 d(C,T,I){var B={fired:!1,wrapFn:void 0,target:C,type:T,listener:I},O=c.bind(B);return O.listener=I,B.wrapFn=O,O}s.prototype.once=function(C,T){return o(T),this.on(C,d(this,C,T)),this},s.prototype.prependOnceListener=function(C,T){return o(T),this.prependListener(C,d(this,C,T)),this},s.prototype.removeListener=function(C,T){var I,B,O,L,k;if(o(T),B=this._events,B===void 0)return this;if(I=B[C],I===void 0)return this;if(I===T||I.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete B[C],B.removeListener&&this.emit("removeListener",C,I.listener||T));else if(typeof I!="function"){for(O=-1,L=I.length-1;L>=0;L--)if(I[L]===T||I[L].listener===T){k=I[L].listener,O=L;break}if(O<0)return this;O===0?I.shift():x(I,O),I.length===1&&(B[C]=I[0]),B.removeListener!==void 0&&this.emit("removeListener",C,k||T)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(C){var T,I,B;if(I=this._events,I===void 0)return this;if(I.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):I[C]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete I[C]),this;if(arguments.length===0){var O=Object.keys(I),L;for(B=0;B<O.length;++B)L=O[B],L!=="removeListener"&&this.removeAllListeners(L);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(T=I[C],typeof T=="function")this.removeListener(C,T);else if(T!==void 0)for(B=T.length-1;B>=0;B--)this.removeListener(C,T[B]);return this};function h(C,T,I){var B=C._events;if(B===void 0)return[];var O=B[T];return O===void 0?[]:typeof O=="function"?I?[O.listener||O]:[O]:I?v(O):m(O,O.length)}s.prototype.listeners=function(C){return h(this,C,!0)},s.prototype.rawListeners=function(C){return h(this,C,!1)},s.listenerCount=function(C,T){return typeof C.listenerCount=="function"?C.listenerCount(T):p.call(C,T)},s.prototype.listenerCount=p;function p(C){var T=this._events;if(T!==void 0){var I=T[C];if(typeof I=="function")return 1;if(I!==void 0)return I.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function m(C,T){for(var I=new Array(T),B=0;B<T;++B)I[B]=C[B];return I}function x(C,T){for(;T+1<C.length;T++)C[T]=C[T+1];C.pop()}function v(C){for(var T=new Array(C.length),I=0;I<T.length;++I)T[I]=C[I].listener||C[I];return T}function y(C,T){return new Promise(function(I,B){function O(k){C.removeListener(T,L),B(k)}function L(){typeof C.removeListener=="function"&&C.removeListener("error",O),I([].slice.call(arguments))}S(C,T,L,{once:!0}),T!=="error"&&E(C,O,{once:!0})})}function E(C,T,I){typeof C.on=="function"&&S(C,"error",T,I)}function S(C,T,I,B){if(typeof C.on=="function")B.once?C.once(T,I):C.on(T,I);else if(typeof C.addEventListener=="function")C.addEventListener(T,function O(L){B.once&&C.removeEventListener(T,O),I(L)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof C)}return Ate}var Ate,_it,NH,$6r,eSr,tSr,rSr,iSr,nSr,zO=Ey(()=>{gn(),vn(),xn(),Ate={},_it=!1,NH=TTn(),NH.once,NH.once=function(i,e){return new Promise((t,r)=>{function n(...a){s!==void 0&&i.removeListener("error",s),t(a)}let s;e!=="error"&&(s=a=>{i.removeListener(name,n),r(a)},i.once("error",s)),i.once(e,n)})},NH.on=function(i,e){let t=[],r=[],n=null,s=!1,a={async next(){let u=t.shift();if(u)return createIterResult(u,!1);if(n){let c=Promise.reject(n);return n=null,c}return s?createIterResult(void 0,!0):new Promise((c,d)=>r.push({resolve:c,reject:d}))},async return(){i.removeListener(e,o),i.removeListener("error",l),s=!0;for(let u of r)u.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(u){n=u,i.removeListener(e,o),i.removeListener("error",l)},[Symbol.asyncIterator](){return this}};return i.on(e,o),i.on("error",l),a;function o(...u){let c=r.shift();c?c.resolve(createIterResult(u,!1)):t.push(u)}function l(u){s=!0;let c=r.shift();c?c.reject(u):n=u,a.return()}},{EventEmitter:$6r,defaultMaxListeners:eSr,init:tSr,listenerCount:rSr,on:iSr,once:nSr}=NH}),by=Sn((i,e)=>{gn(),vn(),xn();var t=(ng(),Ch(ig)),{format:r,inspect:n}=Z6r(),{codes:{ERR_INVALID_ARG_TYPE:s}}=N3(),{kResistStopPropagation:a,AggregateError:o,SymbolDispose:l}=e0(),u=globalThis.AbortSignal||_te().AbortSignal,c=globalThis.AbortController||_te().AbortController,d=Object.getPrototypeOf(async function(){}).constructor,h=globalThis.Blob||t.Blob,p=typeof h<"u"?function(v){return v instanceof h}:function(v){return!1},m=(v,y)=>{if(v!==void 0&&(v===null||typeof v!="object"||!("aborted"in v)))throw new s(y,"AbortSignal",v)},x=(v,y)=>{if(typeof v!="function")throw new s(y,"Function",v)};e.exports={AggregateError:o,kEmptyObject:Object.freeze({}),once(v){let y=!1;return function(...E){y||(y=!0,v.apply(this,E))}},createDeferredPromise:function(){let v,y;return{promise:new Promise((E,S)=>{v=E,y=S}),resolve:v,reject:y}},promisify(v){return new Promise((y,E)=>{v((S,...C)=>S?E(S):y(...C))})},debuglog(){return function(){}},format:r,inspect:n,types:{isAsyncFunction(v){return v instanceof d},isArrayBufferView(v){return ArrayBuffer.isView(v)}},isBlob:p,deprecate(v,y){return v},addAbortListener:(zO(),Ch(WF)).addAbortListener||function(v,y){if(v===void 0)throw new s("signal","AbortSignal",v);m(v,"signal"),x(y,"listener");let E;return v.aborted?queueMicrotask(()=>y()):(v.addEventListener("abort",y,{__proto__:null,once:!0,[a]:!0}),E=()=>{v.removeEventListener("abort",y)}),{__proto__:null,[l](){var S;(S=E)===null||S===void 0||S()}}},AbortSignalAny:u.any||function(v){if(v.length===1)return v[0];let y=new c,E=()=>y.abort();return v.forEach(S=>{m(S,"signals"),S.addEventListener("abort",E,{once:!0})}),y.signal.addEventListener("abort",()=>{v.forEach(S=>S.removeEventListener("abort",E))},{once:!0}),y.signal}},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),Ste=Sn((i,e)=>{gn(),vn(),xn();var{ArrayIsArray:t,ArrayPrototypeIncludes:r,ArrayPrototypeJoin:n,ArrayPrototypeMap:s,NumberIsInteger:a,NumberIsNaN:o,NumberMAX_SAFE_INTEGER:l,NumberMIN_SAFE_INTEGER:u,NumberParseInt:c,ObjectPrototypeHasOwnProperty:d,RegExpPrototypeExec:h,String:p,StringPrototypeToUpperCase:m,StringPrototypeTrim:x}=e0(),{hideStackFrames:v,codes:{ERR_SOCKET_BAD_PORT:y,ERR_INVALID_ARG_TYPE:E,ERR_INVALID_ARG_VALUE:S,ERR_OUT_OF_RANGE:C,ERR_UNKNOWN_SIGNAL:T}}=N3(),{normalizeEncoding:I}=by(),{isAsyncFunction:B,isArrayBufferView:O}=by().types,L={};function k(bt){return bt===(bt|0)}function U(bt){return bt===bt>>>0}var j=/^[0-7]+$/,Y="must be a 32-bit unsigned integer or an octal string";function X(bt,$t,Xe){if(typeof bt>"u"&&(bt=Xe),typeof bt=="string"){if(h(j,bt)===null)throw new S($t,bt,Y);bt=c(bt,8)}return $(bt,$t),bt}var q=v((bt,$t,Xe=u,Oe=l)=>{if(typeof bt!="number")throw new E($t,"number",bt);if(!a(bt))throw new C($t,"an integer",bt);if(bt<Xe||bt>Oe)throw new C($t,`>= ${Xe} && <= ${Oe}`,bt)}),J=v((bt,$t,Xe=-2147483648,Oe=2147483647)=>{if(typeof bt!="number")throw new E($t,"number",bt);if(!a(bt))throw new C($t,"an integer",bt);if(bt<Xe||bt>Oe)throw new C($t,`>= ${Xe} && <= ${Oe}`,bt)}),$=v((bt,$t,Xe=!1)=>{if(typeof bt!="number")throw new E($t,"number",bt);if(!a(bt))throw new C($t,"an integer",bt);let Oe=Xe?1:0,ft=4294967295;if(bt<Oe||bt>ft)throw new C($t,`>= ${Oe} && <= ${ft}`,bt)});function ee(bt,$t){if(typeof bt!="string")throw new E($t,"string",bt)}function ae(bt,$t,Xe=void 0,Oe){if(typeof bt!="number")throw new E($t,"number",bt);if(Xe!=null&&bt<Xe||Oe!=null&&bt>Oe||(Xe!=null||Oe!=null)&&o(bt))throw new C($t,`${Xe!=null?`>= ${Xe}`:""}${Xe!=null&&Oe!=null?" && ":""}${Oe!=null?`<= ${Oe}`:""}`,bt)}var ce=v((bt,$t,Xe)=>{if(!r(Xe,bt)){let Oe="must be one of: "+n(s(Xe,ft=>typeof ft=="string"?`'${ft}'`:p(ft)),", ");throw new S($t,bt,Oe)}});function re(bt,$t){if(typeof bt!="boolean")throw new E($t,"boolean",bt)}function se(bt,$t,Xe){return bt==null||!d(bt,$t)?Xe:bt[$t]}var fe=v((bt,$t,Xe=null)=>{let Oe=se(Xe,"allowArray",!1),ft=se(Xe,"allowFunction",!1);if(!se(Xe,"nullable",!1)&&bt===null||!Oe&&t(bt)||typeof bt!="object"&&(!ft||typeof bt!="function"))throw new E($t,"Object",bt)}),me=v((bt,$t)=>{if(bt!=null&&typeof bt!="object"&&typeof bt!="function")throw new E($t,"a dictionary",bt)}),oe=v((bt,$t,Xe=0)=>{if(!t(bt))throw new E($t,"Array",bt);if(bt.length<Xe){let Oe=`must be longer than ${Xe}`;throw new S($t,bt,Oe)}});function ve(bt,$t){oe(bt,$t);for(let Xe=0;Xe<bt.length;Xe++)ee(bt[Xe],`${$t}[${Xe}]`)}function ne(bt,$t){oe(bt,$t);for(let Xe=0;Xe<bt.length;Xe++)re(bt[Xe],`${$t}[${Xe}]`)}function pe(bt,$t){oe(bt,$t);for(let Xe=0;Xe<bt.length;Xe++){let Oe=bt[Xe],ft=`${$t}[${Xe}]`;if(Oe==null)throw new E(ft,"AbortSignal",Oe);ze(Oe,ft)}}function Ae(bt,$t="signal"){if(ee(bt,$t),L[bt]===void 0)throw L[m(bt)]!==void 0?new T(bt+" (signals must use all capital letters)"):new T(bt)}var Ge=v((bt,$t="buffer")=>{if(!O(bt))throw new E($t,["Buffer","TypedArray","DataView"],bt)});function Re(bt,$t){let Xe=I($t),Oe=bt.length;if(Xe==="hex"&&Oe%2!==0)throw new S("encoding",$t,`is invalid for data of length ${Oe}`)}function De(bt,$t="Port",Xe=!0){if(typeof bt!="number"&&typeof bt!="string"||typeof bt=="string"&&x(bt).length===0||+bt!==+bt>>>0||bt>65535||bt===0&&!Xe)throw new y($t,bt,Xe);return bt|0}var ze=v((bt,$t)=>{if(bt!==void 0&&(bt===null||typeof bt!="object"||!("aborted"in bt)))throw new E($t,"AbortSignal",bt)}),He=v((bt,$t)=>{if(typeof bt!="function")throw new E($t,"Function",bt)}),Be=v((bt,$t)=>{if(typeof bt!="function"||B(bt))throw new E($t,"Function",bt)}),Ke=v((bt,$t)=>{if(bt!==void 0)throw new E($t,"undefined",bt)});function ht(bt,$t,Xe){if(!r(Xe,bt))throw new E($t,`('${n(Xe,"|")}')`,bt)}var St=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function xt(bt,$t){if(typeof bt>"u"||!h(St,bt))throw new S($t,bt,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function Vt(bt){if(typeof bt=="string")return xt(bt,"hints"),bt;if(t(bt)){let $t=bt.length,Xe="";if($t===0)return Xe;for(let Oe=0;Oe<$t;Oe++){let ft=bt[Oe];xt(ft,"hints"),Xe+=ft,Oe!==$t-1&&(Xe+=", ")}return Xe}throw new S("hints",bt,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}e.exports={isInt32:k,isUint32:U,parseFileMode:X,validateArray:oe,validateStringArray:ve,validateBooleanArray:ne,validateAbortSignalArray:pe,validateBoolean:re,validateBuffer:Ge,validateDictionary:me,validateEncoding:Re,validateFunction:He,validateInt32:J,validateInteger:q,validateNumber:ae,validateObject:fe,validateOneOf:ce,validatePlainFunction:Be,validatePort:De,validateSignalName:Ae,validateString:ee,validateUint32:$,validateUndefined:Ke,validateUnion:ht,validateAbortSignal:ze,validateLinkHeaderValue:Vt}}),jO=Sn((i,e)=>{gn(),vn(),xn();var t=e.exports={},r,n;function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?r=setTimeout:r=s}catch{r=s}try{typeof clearTimeout=="function"?n=clearTimeout:n=a}catch{n=a}})();function o(y){if(r===setTimeout)return setTimeout(y,0);if((r===s||!r)&&setTimeout)return r=setTimeout,setTimeout(y,0);try{return r(y,0)}catch{try{return r.call(null,y,0)}catch{return r.call(this,y,0)}}}function l(y){if(n===clearTimeout)return clearTimeout(y);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(y);try{return n(y)}catch{try{return n.call(null,y)}catch{return n.call(this,y)}}}var u=[],c=!1,d,h=-1;function p(){!c||!d||(c=!1,d.length?u=d.concat(u):h=-1,u.length&&m())}function m(){if(!c){var y=o(p);c=!0;for(var E=u.length;E;){for(d=u,u=[];++h<E;)d&&d[h].run();h=-1,E=u.length}d=null,c=!1,l(y)}}t.nextTick=function(y){var E=new Array(arguments.length-1);if(arguments.length>1)for(var S=1;S<arguments.length;S++)E[S-1]=arguments[S];u.push(new x(y,E)),u.length===1&&!c&&o(m)};function x(y,E){this.fun=y,this.array=E}x.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function v(){}t.on=v,t.addListener=v,t.once=v,t.off=v,t.removeListener=v,t.removeAllListeners=v,t.emit=v,t.prependListener=v,t.prependOnceListener=v,t.listeners=function(y){return[]},t.binding=function(y){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(y){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}}),c9=Sn((i,e)=>{gn(),vn(),xn();var{SymbolAsyncIterator:t,SymbolIterator:r,SymbolFor:n}=e0(),s=n("nodejs.stream.destroyed"),a=n("nodejs.stream.errored"),o=n("nodejs.stream.readable"),l=n("nodejs.stream.writable"),u=n("nodejs.stream.disturbed"),c=n("nodejs.webstream.isClosedPromise"),d=n("nodejs.webstream.controllerErrorFunction");function h(se,fe=!1){var me;return!!(se&&typeof se.pipe=="function"&&typeof se.on=="function"&&(!fe||typeof se.pause=="function"&&typeof se.resume=="function")&&(!se._writableState||((me=se._readableState)===null||me===void 0?void 0:me.readable)!==!1)&&(!se._writableState||se._readableState))}function p(se){var fe;return!!(se&&typeof se.write=="function"&&typeof se.on=="function"&&(!se._readableState||((fe=se._writableState)===null||fe===void 0?void 0:fe.writable)!==!1))}function m(se){return!!(se&&typeof se.pipe=="function"&&se._readableState&&typeof se.on=="function"&&typeof se.write=="function")}function x(se){return se&&(se._readableState||se._writableState||typeof se.write=="function"&&typeof se.on=="function"||typeof se.pipe=="function"&&typeof se.on=="function")}function v(se){return!!(se&&!x(se)&&typeof se.pipeThrough=="function"&&typeof se.getReader=="function"&&typeof se.cancel=="function")}function y(se){return!!(se&&!x(se)&&typeof se.getWriter=="function"&&typeof se.abort=="function")}function E(se){return!!(se&&!x(se)&&typeof se.readable=="object"&&typeof se.writable=="object")}function S(se){return v(se)||y(se)||E(se)}function C(se,fe){return se==null?!1:fe===!0?typeof se[t]=="function":fe===!1?typeof se[r]=="function":typeof se[t]=="function"||typeof se[r]=="function"}function T(se){if(!x(se))return null;let fe=se._writableState,me=se._readableState,oe=fe||me;return!!(se.destroyed||se[s]||oe!=null&&oe.destroyed)}function I(se){if(!p(se))return null;if(se.writableEnded===!0)return!0;let fe=se._writableState;return fe!=null&&fe.errored?!1:typeof(fe==null?void 0:fe.ended)!="boolean"?null:fe.ended}function B(se,fe){if(!p(se))return null;if(se.writableFinished===!0)return!0;let me=se._writableState;return me!=null&&me.errored?!1:typeof(me==null?void 0:me.finished)!="boolean"?null:!!(me.finished||fe===!1&&me.ended===!0&&me.length===0)}function O(se){if(!h(se))return null;if(se.readableEnded===!0)return!0;let fe=se._readableState;return!fe||fe.errored?!1:typeof(fe==null?void 0:fe.ended)!="boolean"?null:fe.ended}function L(se,fe){if(!h(se))return null;let me=se._readableState;return me!=null&&me.errored?!1:typeof(me==null?void 0:me.endEmitted)!="boolean"?null:!!(me.endEmitted||fe===!1&&me.ended===!0&&me.length===0)}function k(se){return se&&se[o]!=null?se[o]:typeof(se==null?void 0:se.readable)!="boolean"?null:T(se)?!1:h(se)&&se.readable&&!L(se)}function U(se){return se&&se[l]!=null?se[l]:typeof(se==null?void 0:se.writable)!="boolean"?null:T(se)?!1:p(se)&&se.writable&&!I(se)}function j(se,fe){return x(se)?T(se)?!0:!((fe==null?void 0:fe.readable)!==!1&&k(se)||(fe==null?void 0:fe.writable)!==!1&&U(se)):null}function Y(se){var fe,me;return x(se)?se.writableErrored?se.writableErrored:(fe=(me=se._writableState)===null||me===void 0?void 0:me.errored)!==null&&fe!==void 0?fe:null:null}function X(se){var fe,me;return x(se)?se.readableErrored?se.readableErrored:(fe=(me=se._readableState)===null||me===void 0?void 0:me.errored)!==null&&fe!==void 0?fe:null:null}function q(se){if(!x(se))return null;if(typeof se.closed=="boolean")return se.closed;let fe=se._writableState,me=se._readableState;return typeof(fe==null?void 0:fe.closed)=="boolean"||typeof(me==null?void 0:me.closed)=="boolean"?(fe==null?void 0:fe.closed)||(me==null?void 0:me.closed):typeof se._closed=="boolean"&&J(se)?se._closed:null}function J(se){return typeof se._closed=="boolean"&&typeof se._defaultKeepAlive=="boolean"&&typeof se._removedConnection=="boolean"&&typeof se._removedContLen=="boolean"}function $(se){return typeof se._sent100=="boolean"&&J(se)}function ee(se){var fe;return typeof se._consuming=="boolean"&&typeof se._dumped=="boolean"&&((fe=se.req)===null||fe===void 0?void 0:fe.upgradeOrConnect)===void 0}function ae(se){if(!x(se))return null;let fe=se._writableState,me=se._readableState,oe=fe||me;return!oe&&$(se)||!!(oe&&oe.autoDestroy&&oe.emitClose&&oe.closed===!1)}function ce(se){var fe;return!!(se&&((fe=se[u])!==null&&fe!==void 0?fe:se.readableDidRead||se.readableAborted))}function re(se){var fe,me,oe,ve,ne,pe,Ae,Ge,Re,De;return!!(se&&((fe=(me=(oe=(ve=(ne=(pe=se[a])!==null&&pe!==void 0?pe:se.readableErrored)!==null&&ne!==void 0?ne:se.writableErrored)!==null&&ve!==void 0?ve:(Ae=se._readableState)===null||Ae===void 0?void 0:Ae.errorEmitted)!==null&&oe!==void 0?oe:(Ge=se._writableState)===null||Ge===void 0?void 0:Ge.errorEmitted)!==null&&me!==void 0?me:(Re=se._readableState)===null||Re===void 0?void 0:Re.errored)!==null&&fe!==void 0?fe:!((De=se._writableState)===null||De===void 0)&&De.errored))}e.exports={isDestroyed:T,kIsDestroyed:s,isDisturbed:ce,kIsDisturbed:u,isErrored:re,kIsErrored:a,isReadable:k,kIsReadable:o,kIsClosedPromise:c,kControllerErrorFunction:d,kIsWritable:l,isClosed:q,isDuplexNodeStream:m,isFinished:j,isIterable:C,isReadableNodeStream:h,isReadableStream:v,isReadableEnded:O,isReadableFinished:L,isReadableErrored:X,isNodeStream:x,isWebStream:S,isWritable:U,isWritableNodeStream:p,isWritableStream:y,isWritableEnded:I,isWritableFinished:B,isWritableErrored:Y,isServerRequest:ee,isServerResponse:$,willEmitClose:ae,isTransformStream:E}}),XF=Sn((i,e)=>{gn(),vn(),xn();var t=jO(),{AbortError:r,codes:n}=N3(),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_PREMATURE_CLOSE:a}=n,{kEmptyObject:o,once:l}=by(),{validateAbortSignal:u,validateFunction:c,validateObject:d,validateBoolean:h}=Ste(),{Promise:p,PromisePrototypeThen:m,SymbolDispose:x}=e0(),{isClosed:v,isReadable:y,isReadableNodeStream:E,isReadableStream:S,isReadableFinished:C,isReadableErrored:T,isWritable:I,isWritableNodeStream:B,isWritableStream:O,isWritableFinished:L,isWritableErrored:k,isNodeStream:U,willEmitClose:j,kIsClosedPromise:Y}=c9(),X;function q(ce){return ce.setHeader&&typeof ce.abort=="function"}var J=()=>{};function $(ce,re,se){var fe,me;if(arguments.length===2?(se=re,re=o):re==null?re=o:d(re,"options"),c(se,"callback"),u(re.signal,"options.signal"),se=l(se),S(ce)||O(ce))return ee(ce,re,se);if(!U(ce))throw new s("stream",["ReadableStream","WritableStream","Stream"],ce);let oe=(fe=re.readable)!==null&&fe!==void 0?fe:E(ce),ve=(me=re.writable)!==null&&me!==void 0?me:B(ce),ne=ce._writableState,pe=ce._readableState,Ae=()=>{ce.writable||De()},Ge=j(ce)&&E(ce)===oe&&B(ce)===ve,Re=L(ce,!1),De=()=>{Re=!0,ce.destroyed&&(Ge=!1),!(Ge&&(!ce.readable||oe))&&(!oe||ze)&&se.call(ce)},ze=C(ce,!1),He=()=>{ze=!0,ce.destroyed&&(Ge=!1),!(Ge&&(!ce.writable||ve))&&(!ve||Re)&&se.call(ce)},Be=bt=>{se.call(ce,bt)},Ke=v(ce),ht=()=>{Ke=!0;let bt=k(ce)||T(ce);if(bt&&typeof bt!="boolean")return se.call(ce,bt);if(oe&&!ze&&E(ce,!0)&&!C(ce,!1))return se.call(ce,new a);if(ve&&!Re&&!L(ce,!1))return se.call(ce,new a);se.call(ce)},St=()=>{Ke=!0;let bt=k(ce)||T(ce);if(bt&&typeof bt!="boolean")return se.call(ce,bt);se.call(ce)},xt=()=>{ce.req.on("finish",De)};q(ce)?(ce.on("complete",De),Ge||ce.on("abort",ht),ce.req?xt():ce.on("request",xt)):ve&&!ne&&(ce.on("end",Ae),ce.on("close",Ae)),!Ge&&typeof ce.aborted=="boolean"&&ce.on("aborted",ht),ce.on("end",He),ce.on("finish",De),re.error!==!1&&ce.on("error",Be),ce.on("close",ht),Ke?t.nextTick(ht):ne!=null&&ne.errorEmitted||pe!=null&&pe.errorEmitted?Ge||t.nextTick(St):(!oe&&(!Ge||y(ce))&&(Re||I(ce)===!1)||!ve&&(!Ge||I(ce))&&(ze||y(ce)===!1)||pe&&ce.req&&ce.aborted)&&t.nextTick(St);let Vt=()=>{se=J,ce.removeListener("aborted",ht),ce.removeListener("complete",De),ce.removeListener("abort",ht),ce.removeListener("request",xt),ce.req&&ce.req.removeListener("finish",De),ce.removeListener("end",Ae),ce.removeListener("close",Ae),ce.removeListener("finish",De),ce.removeListener("end",He),ce.removeListener("error",Be),ce.removeListener("close",ht)};if(re.signal&&!Ke){let bt=()=>{let $t=se;Vt(),$t.call(ce,new r(void 0,{cause:re.signal.reason}))};if(re.signal.aborted)t.nextTick(bt);else{X=X||by().addAbortListener;let $t=X(re.signal,bt),Xe=se;se=l((...Oe)=>{$t[x](),Xe.apply(ce,Oe)})}}return Vt}function ee(ce,re,se){let fe=!1,me=J;if(re.signal)if(me=()=>{fe=!0,se.call(ce,new r(void 0,{cause:re.signal.reason}))},re.signal.aborted)t.nextTick(me);else{X=X||by().addAbortListener;let ve=X(re.signal,me),ne=se;se=l((...pe)=>{ve[x](),ne.apply(ce,pe)})}let oe=(...ve)=>{fe||t.nextTick(()=>se.apply(ce,ve))};return m(ce[Y].promise,oe,oe),J}function ae(ce,re){var se;let fe=!1;return re===null&&(re=o),(se=re)!==null&&se!==void 0&&se.cleanup&&(h(re.cleanup,"cleanup"),fe=re.cleanup),new p((me,oe)=>{let ve=$(ce,re,ne=>{fe&&ve(),ne?oe(ne):me()})})}e.exports=$,e.exports.finished=ae}),kH=Sn((i,e)=>{gn(),vn(),xn();var t=jO(),{aggregateTwoErrors:r,codes:{ERR_MULTIPLE_CALLBACK:n},AbortError:s}=N3(),{Symbol:a}=e0(),{kIsDestroyed:o,isDestroyed:l,isFinished:u,isServerRequest:c}=c9(),d=a("kDestroy"),h=a("kConstruct");function p(j,Y,X){j&&(j.stack,Y&&!Y.errored&&(Y.errored=j),X&&!X.errored&&(X.errored=j))}function m(j,Y){let X=this._readableState,q=this._writableState,J=q||X;return q!=null&&q.destroyed||X!=null&&X.destroyed?(typeof Y=="function"&&Y(),this):(p(j,q,X),q&&(q.destroyed=!0),X&&(X.destroyed=!0),J.constructed?x(this,j,Y):this.once(d,function($){x(this,r($,j),Y)}),this)}function x(j,Y,X){let q=!1;function J($){if(q)return;q=!0;let ee=j._readableState,ae=j._writableState;p($,ae,ee),ae&&(ae.closed=!0),ee&&(ee.closed=!0),typeof X=="function"&&X($),$?t.nextTick(v,j,$):t.nextTick(y,j)}try{j._destroy(Y||null,J)}catch($){J($)}}function v(j,Y){E(j,Y),y(j)}function y(j){let Y=j._readableState,X=j._writableState;X&&(X.closeEmitted=!0),Y&&(Y.closeEmitted=!0),(X!=null&&X.emitClose||Y!=null&&Y.emitClose)&&j.emit("close")}function E(j,Y){let X=j._readableState,q=j._writableState;q!=null&&q.errorEmitted||X!=null&&X.errorEmitted||(q&&(q.errorEmitted=!0),X&&(X.errorEmitted=!0),j.emit("error",Y))}function S(){let j=this._readableState,Y=this._writableState;j&&(j.constructed=!0,j.closed=!1,j.closeEmitted=!1,j.destroyed=!1,j.errored=null,j.errorEmitted=!1,j.reading=!1,j.ended=j.readable===!1,j.endEmitted=j.readable===!1),Y&&(Y.constructed=!0,Y.destroyed=!1,Y.closed=!1,Y.closeEmitted=!1,Y.errored=null,Y.errorEmitted=!1,Y.finalCalled=!1,Y.prefinished=!1,Y.ended=Y.writable===!1,Y.ending=Y.writable===!1,Y.finished=Y.writable===!1)}function C(j,Y,X){let q=j._readableState,J=j._writableState;if(J!=null&&J.destroyed||q!=null&&q.destroyed)return this;q!=null&&q.autoDestroy||J!=null&&J.autoDestroy?j.destroy(Y):Y&&(Y.stack,J&&!J.errored&&(J.errored=Y),q&&!q.errored&&(q.errored=Y),X?t.nextTick(E,j,Y):E(j,Y))}function T(j,Y){if(typeof j._construct!="function")return;let X=j._readableState,q=j._writableState;X&&(X.constructed=!1),q&&(q.constructed=!1),j.once(h,Y),!(j.listenerCount(h)>1)&&t.nextTick(I,j)}function I(j){let Y=!1;function X(q){if(Y){C(j,q??new n);return}Y=!0;let J=j._readableState,$=j._writableState,ee=$||J;J&&(J.constructed=!0),$&&($.constructed=!0),ee.destroyed?j.emit(d,q):q?C(j,q,!0):t.nextTick(B,j)}try{j._construct(q=>{t.nextTick(X,q)})}catch(q){t.nextTick(X,q)}}function B(j){j.emit(h)}function O(j){return(j==null?void 0:j.setHeader)&&typeof j.abort=="function"}function L(j){j.emit("close")}function k(j,Y){j.emit("error",Y),t.nextTick(L,j)}function U(j,Y){!j||l(j)||(!Y&&!u(j)&&(Y=new s),c(j)?(j.socket=null,j.destroy(Y)):O(j)?j.abort():O(j.req)?j.req.abort():typeof j.destroy=="function"?j.destroy(Y):typeof j.close=="function"?j.close():Y?t.nextTick(k,j,Y):t.nextTick(L,j),j.destroyed||(j[o]=!0))}e.exports={construct:T,destroyer:U,destroy:m,undestroy:S,errorOrDestroy:C}}),Ait=Sn((i,e)=>{gn(),vn(),xn();var{ArrayIsArray:t,ObjectSetPrototypeOf:r}=e0(),{EventEmitter:n}=(zO(),Ch(WF));function s(o){n.call(this,o)}r(s.prototype,n.prototype),r(s,n),s.prototype.pipe=function(o,l){let u=this;function c(y){o.writable&&o.write(y)===!1&&u.pause&&u.pause()}u.on("data",c);function d(){u.readable&&u.resume&&u.resume()}o.on("drain",d),!o._isStdio&&(!l||l.end!==!1)&&(u.on("end",p),u.on("close",m));let h=!1;function p(){h||(h=!0,o.end())}function m(){h||(h=!0,typeof o.destroy=="function"&&o.destroy())}function x(y){v(),n.listenerCount(this,"error")===0&&this.emit("error",y)}a(u,"error",x),a(o,"error",x);function v(){u.removeListener("data",c),o.removeListener("drain",d),u.removeListener("end",p),u.removeListener("close",m),u.removeListener("error",x),o.removeListener("error",x),u.removeListener("end",v),u.removeListener("close",v),o.removeListener("close",v)}return u.on("end",v),u.on("close",v),o.on("close",v),o.emit("pipe",u),o};function a(o,l,u){if(typeof o.prependListener=="function")return o.prependListener(l,u);!o._events||!o._events[l]?o.on(l,u):t(o._events[l])?o._events[l].unshift(u):o._events[l]=[u,o._events[l]]}e.exports={Stream:s,prependListener:a}}),Zxe=Sn((i,e)=>{gn(),vn(),xn();var{SymbolDispose:t}=e0(),{AbortError:r,codes:n}=N3(),{isNodeStream:s,isWebStream:a,kControllerErrorFunction:o}=c9(),l=XF(),{ERR_INVALID_ARG_TYPE:u}=n,c,d=(h,p)=>{if(typeof h!="object"||!("aborted"in h))throw new u(p,"AbortSignal",h)};e.exports.addAbortSignal=function(h,p){if(d(h,"signal"),!s(p)&&!a(p))throw new u("stream",["ReadableStream","WritableStream","Stream"],p);return e.exports.addAbortSignalNoValidate(h,p)},e.exports.addAbortSignalNoValidate=function(h,p){if(typeof h!="object"||!("aborted"in h))return p;let m=s(p)?()=>{p.destroy(new r(void 0,{cause:h.reason}))}:()=>{p[o](new r(void 0,{cause:h.reason}))};if(h.aborted)m();else{c=c||by().addAbortListener;let x=c(h,m);l(p,x[t])}return p}}),wTn=Sn((i,e)=>{gn(),vn(),xn();var{StringPrototypeSlice:t,SymbolIterator:r,TypedArrayPrototypeSet:n,Uint8Array:s}=e0(),{Buffer:a}=(ng(),Ch(ig)),{inspect:o}=by();e.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(l){let u={data:l,next:null};this.length>0?this.tail.next=u:this.head=u,this.tail=u,++this.length}unshift(l){let u={data:l,next:this.head};this.length===0&&(this.tail=u),this.head=u,++this.length}shift(){if(this.length===0)return;let l=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,l}clear(){this.head=this.tail=null,this.length=0}join(l){if(this.length===0)return"";let u=this.head,c=""+u.data;for(;(u=u.next)!==null;)c+=l+u.data;return c}concat(l){if(this.length===0)return a.alloc(0);let u=a.allocUnsafe(l>>>0),c=this.head,d=0;for(;c;)n(u,c.data,d),d+=c.data.length,c=c.next;return u}consume(l,u){let c=this.head.data;if(l<c.length){let d=c.slice(0,l);return this.head.data=c.slice(l),d}return l===c.length?this.shift():u?this._getString(l):this._getBuffer(l)}first(){return this.head.data}*[r](){for(let l=this.head;l;l=l.next)yield l.data}_getString(l){let u="",c=this.head,d=0;do{let h=c.data;if(l>h.length)u+=h,l-=h.length;else{l===h.length?(u+=h,++d,c.next?this.head=c.next:this.head=this.tail=null):(u+=t(h,0,l),this.head=c,c.data=t(h,l));break}++d}while((c=c.next)!==null);return this.length-=d,u}_getBuffer(l){let u=a.allocUnsafe(l),c=l,d=this.head,h=0;do{let p=d.data;if(l>p.length)n(u,p,c-l),l-=p.length;else{l===p.length?(n(u,p,c-l),++h,d.next?this.head=d.next:this.head=this.tail=null):(n(u,new s(p.buffer,p.byteOffset,l),c-l),this.head=d,d.data=p.slice(l));break}++h}while((d=d.next)!==null);return this.length-=h,u}[Symbol.for("nodejs.util.inspect.custom")](l,u){return o(this,{...u,depth:0,customInspect:!1})}}}),$xe=Sn((i,e)=>{gn(),vn(),xn();var{MathFloor:t,NumberIsInteger:r}=e0(),{validateInteger:n}=Ste(),{ERR_INVALID_ARG_VALUE:s}=N3().codes,a=16*1024,o=16;function l(h,p,m){return h.highWaterMark!=null?h.highWaterMark:p?h[m]:null}function u(h){return h?o:a}function c(h,p){n(p,"value",0),h?o=p:a=p}function d(h,p,m,x){let v=l(p,x,m);if(v!=null){if(!r(v)||v<0){let y=x?`options.${m}`:"options.highWaterMark";throw new s(y,v)}return t(v)}return u(h.objectMode)}e.exports={getHighWaterMark:d,getDefaultHighWaterMark:u,setDefaultHighWaterMark:c}}),FTn=Sn((i,e)=>{gn(),vn(),xn();var t=(ng(),Ch(ig)),r=t.Buffer;function n(a,o){for(var l in a)o[l]=a[l]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=t:(n(t,i),i.Buffer=s);function s(a,o,l){return r(a,o,l)}s.prototype=Object.create(r.prototype),n(r,s),s.from=function(a,o,l){if(typeof a=="number")throw new TypeError("Argument must not be a number");return r(a,o,l)},s.alloc=function(a,o,l){if(typeof a!="number")throw new TypeError("Argument must be a number");var u=r(a);return o!==void 0?typeof l=="string"?u.fill(o,l):u.fill(o):u.fill(0),u},s.allocUnsafe=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return r(a)},s.allocUnsafeSlow=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return t.SlowBuffer(a)}}),RTn=Sn(i=>{gn(),vn(),xn();var e=FTn().Buffer,t=e.isEncoding||function(E){switch(E=""+E,E&&E.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(E){if(!E)return"utf8";for(var S;;)switch(E){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return E;default:if(S)return;E=(""+E).toLowerCase(),S=!0}}function n(E){var S=r(E);if(typeof S!="string"&&(e.isEncoding===t||!t(E)))throw new Error("Unknown encoding: "+E);return S||E}i.StringDecoder=s;function s(E){this.encoding=n(E);var S;switch(this.encoding){case"utf16le":this.text=h,this.end=p,S=4;break;case"utf8":this.fillLast=u,S=4;break;case"base64":this.text=m,this.end=x,S=3;break;default:this.write=v,this.end=y;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(S)}s.prototype.write=function(E){if(E.length===0)return"";var S,C;if(this.lastNeed){if(S=this.fillLast(E),S===void 0)return"";C=this.lastNeed,this.lastNeed=0}else C=0;return C<E.length?S?S+this.text(E,C):this.text(E,C):S||""},s.prototype.end=d,s.prototype.text=c,s.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};function a(E){return E<=127?0:E>>5===6?2:E>>4===14?3:E>>3===30?4:E>>6===2?-1:-2}function o(E,S,C){var T=S.length-1;if(T<C)return 0;var I=a(S[T]);return I>=0?(I>0&&(E.lastNeed=I-1),I):--T<C||I===-2?0:(I=a(S[T]),I>=0?(I>0&&(E.lastNeed=I-2),I):--T<C||I===-2?0:(I=a(S[T]),I>=0?(I>0&&(I===2?I=0:E.lastNeed=I-3),I):0))}function l(E,S,C){if((S[0]&192)!==128)return E.lastNeed=0,"�";if(E.lastNeed>1&&S.length>1){if((S[1]&192)!==128)return E.lastNeed=1,"�";if(E.lastNeed>2&&S.length>2&&(S[2]&192)!==128)return E.lastNeed=2,"�"}}function u(E){var S=this.lastTotal-this.lastNeed,C=l(this,E);if(C!==void 0)return C;if(this.lastNeed<=E.length)return E.copy(this.lastChar,S,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);E.copy(this.lastChar,S,0,E.length),this.lastNeed-=E.length}function c(E,S){var C=o(this,E,S);if(!this.lastNeed)return E.toString("utf8",S);this.lastTotal=C;var T=E.length-(C-this.lastNeed);return E.copy(this.lastChar,0,T),E.toString("utf8",S,T)}function d(E){var S=E&&E.length?this.write(E):"";return this.lastNeed?S+"�":S}function h(E,S){if((E.length-S)%2===0){var C=E.toString("utf16le",S);if(C){var T=C.charCodeAt(C.length-1);if(T>=55296&&T<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=E[E.length-2],this.lastChar[1]=E[E.length-1],C.slice(0,-1)}return C}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=E[E.length-1],E.toString("utf16le",S,E.length-1)}function p(E){var S=E&&E.length?this.write(E):"";if(this.lastNeed){var C=this.lastTotal-this.lastNeed;return S+this.lastChar.toString("utf16le",0,C)}return S}function m(E,S){var C=(E.length-S)%3;return C===0?E.toString("base64",S):(this.lastNeed=3-C,this.lastTotal=3,C===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",S,E.length-C))}function x(E){var S=E&&E.length?this.write(E):"";return this.lastNeed?S+this.lastChar.toString("base64",0,3-this.lastNeed):S}function v(E){return E.toString(this.encoding)}function y(E){return E&&E.length?this.write(E):""}}),sSr=Sn((i,e)=>{gn(),vn(),xn();var t=jO(),{PromisePrototypeThen:r,SymbolAsyncIterator:n,SymbolIterator:s}=e0(),{Buffer:a}=(ng(),Ch(ig)),{ERR_INVALID_ARG_TYPE:o,ERR_STREAM_NULL_VALUES:l}=N3().codes;function u(c,d,h){let p;if(typeof d=="string"||d instanceof a)return new c({objectMode:!0,...h,read(){this.push(d),this.push(null)}});let m;if(d&&d[n])m=!0,p=d[n]();else if(d&&d[s])m=!1,p=d[s]();else throw new o("iterable",["Iterable"],d);let x=new c({objectMode:!0,highWaterMark:1,...h}),v=!1;x._read=function(){v||(v=!0,E())},x._destroy=function(S,C){r(y(S),()=>t.nextTick(C,S),T=>t.nextTick(C,T||S))};async function y(S){let C=S!=null,T=typeof p.throw=="function";if(C&&T){let{value:I,done:B}=await p.throw(S);if(await I,B)return}if(typeof p.return=="function"){let{value:I}=await p.return();await I}}async function E(){for(;;){try{let{value:S,done:C}=m?await p.next():p.next();if(C)x.push(null);else{let T=S&&typeof S.then=="function"?await S:S;if(T===null)throw v=!1,new l;if(x.push(T))continue;v=!1}}catch(S){x.destroy(S)}break}}return x}e.exports=u}),e3e=Sn((i,e)=>{gn(),vn(),xn();var t=jO(),{ArrayPrototypeIndexOf:r,NumberIsInteger:n,NumberIsNaN:s,NumberParseInt:a,ObjectDefineProperties:o,ObjectKeys:l,ObjectSetPrototypeOf:u,Promise:c,SafeSet:d,SymbolAsyncDispose:h,SymbolAsyncIterator:p,Symbol:m}=e0();e.exports=Oe,Oe.ReadableState=Xe;var{EventEmitter:x}=(zO(),Ch(WF)),{Stream:v,prependListener:y}=Ait(),{Buffer:E}=(ng(),Ch(ig)),{addAbortSignal:S}=Zxe(),C=XF(),T=by().debuglog("stream",Zt=>{T=Zt}),I=wTn(),B=kH(),{getHighWaterMark:O,getDefaultHighWaterMark:L}=$xe(),{aggregateTwoErrors:k,codes:{ERR_INVALID_ARG_TYPE:U,ERR_METHOD_NOT_IMPLEMENTED:j,ERR_OUT_OF_RANGE:Y,ERR_STREAM_PUSH_AFTER_EOF:X,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:q},AbortError:J}=N3(),{validateObject:$}=Ste(),ee=m("kPaused"),{StringDecoder:ae}=RTn(),ce=sSr();u(Oe.prototype,v.prototype),u(Oe,v);var re=()=>{},{errorOrDestroy:se}=B,fe=1,me=2,oe=4,ve=8,ne=16,pe=32,Ae=64,Ge=128,Re=256,De=512,ze=1024,He=2048,Be=4096,Ke=8192,ht=16384,St=32768,xt=65536,Vt=1<<17,bt=1<<18;function $t(Zt){return{enumerable:!1,get(){return(this.state&Zt)!==0},set(gr){gr?this.state|=Zt:this.state&=~Zt}}}o(Xe.prototype,{objectMode:$t(fe),ended:$t(me),endEmitted:$t(oe),reading:$t(ve),constructed:$t(ne),sync:$t(pe),needReadable:$t(Ae),emittedReadable:$t(Ge),readableListening:$t(Re),resumeScheduled:$t(De),errorEmitted:$t(ze),emitClose:$t(He),autoDestroy:$t(Be),destroyed:$t(Ke),closed:$t(ht),closeEmitted:$t(St),multiAwaitDrain:$t(xt),readingMore:$t(Vt),dataEmitted:$t(bt)});function Xe(Zt,gr,Qi){typeof Qi!="boolean"&&(Qi=gr instanceof d9()),this.state=He|Be|ne|pe,Zt&&Zt.objectMode&&(this.state|=fe),Qi&&Zt&&Zt.readableObjectMode&&(this.state|=fe),this.highWaterMark=Zt?O(this,Zt,"readableHighWaterMark",Qi):L(!1),this.buffer=new I,this.length=0,this.pipes=[],this.flowing=null,this[ee]=null,Zt&&Zt.emitClose===!1&&(this.state&=~He),Zt&&Zt.autoDestroy===!1&&(this.state&=~Be),this.errored=null,this.defaultEncoding=Zt&&Zt.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,Zt&&Zt.encoding&&(this.decoder=new ae(Zt.encoding),this.encoding=Zt.encoding)}function Oe(Zt){if(!(this instanceof Oe))return new Oe(Zt);let gr=this instanceof d9();this._readableState=new Xe(Zt,this,gr),Zt&&(typeof Zt.read=="function"&&(this._read=Zt.read),typeof Zt.destroy=="function"&&(this._destroy=Zt.destroy),typeof Zt.construct=="function"&&(this._construct=Zt.construct),Zt.signal&&!gr&&S(Zt.signal,this)),v.call(this,Zt),B.construct(this,()=>{this._readableState.needReadable&&vt(this,this._readableState)})}Oe.prototype.destroy=B.destroy,Oe.prototype._undestroy=B.undestroy,Oe.prototype._destroy=function(Zt,gr){gr(Zt)},Oe.prototype[x.captureRejectionSymbol]=function(Zt){this.destroy(Zt)},Oe.prototype[h]=function(){let Zt;return this.destroyed||(Zt=this.readableEnded?null:new J,this.destroy(Zt)),new c((gr,Qi)=>C(this,kn=>kn&&kn!==Zt?Qi(kn):gr(null)))},Oe.prototype.push=function(Zt,gr){return ft(this,Zt,gr,!1)},Oe.prototype.unshift=function(Zt,gr){return ft(this,Zt,gr,!0)};function ft(Zt,gr,Qi,kn){T("readableAddChunk",gr);let ds=Zt._readableState,ao;if((ds.state&fe)===0&&(typeof gr=="string"?(Qi=Qi||ds.defaultEncoding,ds.encoding!==Qi&&(kn&&ds.encoding?gr=E.from(gr,Qi).toString(ds.encoding):(gr=E.from(gr,Qi),Qi=""))):gr instanceof E?Qi="":v._isUint8Array(gr)?(gr=v._uint8ArrayToBuffer(gr),Qi=""):gr!=null&&(ao=new U("chunk",["string","Buffer","Uint8Array"],gr))),ao)se(Zt,ao);else if(gr===null)ds.state&=~ve,Me(Zt,ds);else if((ds.state&fe)!==0||gr&&gr.length>0)if(kn)if((ds.state&oe)!==0)se(Zt,new q);else{if(ds.destroyed||ds.errored)return!1;Ce(Zt,ds,gr,!0)}else if(ds.ended)se(Zt,new X);else{if(ds.destroyed||ds.errored)return!1;ds.state&=~ve,ds.decoder&&!Qi?(gr=ds.decoder.write(gr),ds.objectMode||gr.length!==0?Ce(Zt,ds,gr,!1):vt(Zt,ds)):Ce(Zt,ds,gr,!1)}else kn||(ds.state&=~ve,vt(Zt,ds));return!ds.ended&&(ds.length<ds.highWaterMark||ds.length===0)}function Ce(Zt,gr,Qi,kn){gr.flowing&&gr.length===0&&!gr.sync&&Zt.listenerCount("data")>0?((gr.state&xt)!==0?gr.awaitDrainWriters.clear():gr.awaitDrainWriters=null,gr.dataEmitted=!0,Zt.emit("data",Qi)):(gr.length+=gr.objectMode?1:Qi.length,kn?gr.buffer.unshift(Qi):gr.buffer.push(Qi),(gr.state&Ae)!==0&&et(Zt)),vt(Zt,gr)}Oe.prototype.isPaused=function(){let Zt=this._readableState;return Zt[ee]===!0||Zt.flowing===!1},Oe.prototype.setEncoding=function(Zt){let gr=new ae(Zt);this._readableState.decoder=gr,this._readableState.encoding=this._readableState.decoder.encoding;let Qi=this._readableState.buffer,kn="";for(let ds of Qi)kn+=gr.write(ds);return Qi.clear(),kn!==""&&Qi.push(kn),this._readableState.length=kn.length,this};var Pe=1073741824;function ke(Zt){if(Zt>Pe)throw new Y("size","<= 1GiB",Zt);return Zt--,Zt|=Zt>>>1,Zt|=Zt>>>2,Zt|=Zt>>>4,Zt|=Zt>>>8,Zt|=Zt>>>16,Zt++,Zt}function Ye(Zt,gr){return Zt<=0||gr.length===0&&gr.ended?0:(gr.state&fe)!==0?1:s(Zt)?gr.flowing&&gr.length?gr.buffer.first().length:gr.length:Zt<=gr.length?Zt:gr.ended?gr.length:0}Oe.prototype.read=function(Zt){T("read",Zt),Zt===void 0?Zt=NaN:n(Zt)||(Zt=a(Zt,10));let gr=this._readableState,Qi=Zt;if(Zt>gr.highWaterMark&&(gr.highWaterMark=ke(Zt)),Zt!==0&&(gr.state&=~Ge),Zt===0&&gr.needReadable&&((gr.highWaterMark!==0?gr.length>=gr.highWaterMark:gr.length>0)||gr.ended))return T("read: emitReadable",gr.length,gr.ended),gr.length===0&&gr.ended?Fi(this):et(this),null;if(Zt=Ye(Zt,gr),Zt===0&&gr.ended)return gr.length===0&&Fi(this),null;let kn=(gr.state&Ae)!==0;if(T("need readable",kn),(gr.length===0||gr.length-Zt<gr.highWaterMark)&&(kn=!0,T("length less than watermark",kn)),gr.ended||gr.reading||gr.destroyed||gr.errored||!gr.constructed)kn=!1,T("reading, ended or constructing",kn);else if(kn){T("do read"),gr.state|=ve|pe,gr.length===0&&(gr.state|=Ae);try{this._read(gr.highWaterMark)}catch(ao){se(this,ao)}gr.state&=~pe,gr.reading||(Zt=Ye(Qi,gr))}let ds;return Zt>0?ds=Vr(Zt,gr):ds=null,ds===null?(gr.needReadable=gr.length<=gr.highWaterMark,Zt=0):(gr.length-=Zt,gr.multiAwaitDrain?gr.awaitDrainWriters.clear():gr.awaitDrainWriters=null),gr.length===0&&(gr.ended||(gr.needReadable=!0),Qi!==Zt&&gr.ended&&Fi(this)),ds!==null&&!gr.errorEmitted&&!gr.closeEmitted&&(gr.dataEmitted=!0,this.emit("data",ds)),ds};function Me(Zt,gr){if(T("onEofChunk"),!gr.ended){if(gr.decoder){let Qi=gr.decoder.end();Qi&&Qi.length&&(gr.buffer.push(Qi),gr.length+=gr.objectMode?1:Qi.length)}gr.ended=!0,gr.sync?et(Zt):(gr.needReadable=!1,gr.emittedReadable=!0,ot(Zt))}}function et(Zt){let gr=Zt._readableState;T("emitReadable",gr.needReadable,gr.emittedReadable),gr.needReadable=!1,gr.emittedReadable||(T("emitReadable",gr.flowing),gr.emittedReadable=!0,t.nextTick(ot,Zt))}function ot(Zt){let gr=Zt._readableState;T("emitReadable_",gr.destroyed,gr.length,gr.ended),!gr.destroyed&&!gr.errored&&(gr.length||gr.ended)&&(Zt.emit("readable"),gr.emittedReadable=!1),gr.needReadable=!gr.flowing&&!gr.ended&&gr.length<=gr.highWaterMark,Kr(Zt)}function vt(Zt,gr){!gr.readingMore&&gr.constructed&&(gr.readingMore=!0,t.nextTick(At,Zt,gr))}function At(Zt,gr){for(;!gr.reading&&!gr.ended&&(gr.length<gr.highWaterMark||gr.flowing&&gr.length===0);){let Qi=gr.length;if(T("maybeReadMore read 0"),Zt.read(0),Qi===gr.length)break}gr.readingMore=!1}Oe.prototype._read=function(Zt){throw new j("_read()")},Oe.prototype.pipe=function(Zt,gr){let Qi=this,kn=this._readableState;kn.pipes.length===1&&(kn.multiAwaitDrain||(kn.multiAwaitDrain=!0,kn.awaitDrainWriters=new d(kn.awaitDrainWriters?[kn.awaitDrainWriters]:[]))),kn.pipes.push(Zt),T("pipe count=%d opts=%j",kn.pipes.length,gr);let ds=(!gr||gr.end!==!1)&&Zt!==t.stdout&&Zt!==t.stderr?as:Tr;kn.endEmitted?t.nextTick(ds):Qi.once("end",ds),Zt.on("unpipe",ao);function ao(wi,Qn){T("onunpipe"),wi===Qi&&Qn&&Qn.hasUnpiped===!1&&(Qn.hasUnpiped=!0,Mu())}function as(){T("onend"),Zt.end()}let vs,Bc=!1;function Mu(){T("cleanup"),Zt.removeListener("close",mi),Zt.removeListener("finish",Wi),vs&&Zt.removeListener("drain",vs),Zt.removeListener("error",_r),Zt.removeListener("unpipe",ao),Qi.removeListener("end",as),Qi.removeListener("end",Tr),Qi.removeListener("data",pd),Bc=!0,vs&&kn.awaitDrainWriters&&(!Zt._writableState||Zt._writableState.needDrain)&&vs()}function ed(){Bc||(kn.pipes.length===1&&kn.pipes[0]===Zt?(T("false write response, pause",0),kn.awaitDrainWriters=Zt,kn.multiAwaitDrain=!1):kn.pipes.length>1&&kn.pipes.includes(Zt)&&(T("false write response, pause",kn.awaitDrainWriters.size),kn.awaitDrainWriters.add(Zt)),Qi.pause()),vs||(vs=cr(Qi,Zt),Zt.on("drain",vs))}Qi.on("data",pd);function pd(wi){T("ondata");let Qn=Zt.write(wi);T("dest.write",Qn),Qn===!1&&ed()}function _r(wi){if(T("onerror",wi),Tr(),Zt.removeListener("error",_r),Zt.listenerCount("error")===0){let Qn=Zt._writableState||Zt._readableState;Qn&&!Qn.errorEmitted?se(Zt,wi):Zt.emit("error",wi)}}y(Zt,"error",_r);function mi(){Zt.removeListener("finish",Wi),Tr()}Zt.once("close",mi);function Wi(){T("onfinish"),Zt.removeListener("close",mi),Tr()}Zt.once("finish",Wi);function Tr(){T("unpipe"),Qi.unpipe(Zt)}return Zt.emit("pipe",Qi),Zt.writableNeedDrain===!0?ed():kn.flowing||(T("pipe resume"),Qi.resume()),Zt};function cr(Zt,gr){return function(){let Qi=Zt._readableState;Qi.awaitDrainWriters===gr?(T("pipeOnDrain",1),Qi.awaitDrainWriters=null):Qi.multiAwaitDrain&&(T("pipeOnDrain",Qi.awaitDrainWriters.size),Qi.awaitDrainWriters.delete(gr)),(!Qi.awaitDrainWriters||Qi.awaitDrainWriters.size===0)&&Zt.listenerCount("data")&&Zt.resume()}}Oe.prototype.unpipe=function(Zt){let gr=this._readableState,Qi={hasUnpiped:!1};if(gr.pipes.length===0)return this;if(!Zt){let ds=gr.pipes;gr.pipes=[],this.pause();for(let ao=0;ao<ds.length;ao++)ds[ao].emit("unpipe",this,{hasUnpiped:!1});return this}let kn=r(gr.pipes,Zt);return kn===-1?this:(gr.pipes.splice(kn,1),gr.pipes.length===0&&this.pause(),Zt.emit("unpipe",this,Qi),this)},Oe.prototype.on=function(Zt,gr){let Qi=v.prototype.on.call(this,Zt,gr),kn=this._readableState;return Zt==="data"?(kn.readableListening=this.listenerCount("readable")>0,kn.flowing!==!1&&this.resume()):Zt==="readable"&&!kn.endEmitted&&!kn.readableListening&&(kn.readableListening=kn.needReadable=!0,kn.flowing=!1,kn.emittedReadable=!1,T("on readable",kn.length,kn.reading),kn.length?et(this):kn.reading||t.nextTick(ei,this)),Qi},Oe.prototype.addListener=Oe.prototype.on,Oe.prototype.removeListener=function(Zt,gr){let Qi=v.prototype.removeListener.call(this,Zt,gr);return Zt==="readable"&&t.nextTick(Br,this),Qi},Oe.prototype.off=Oe.prototype.removeListener,Oe.prototype.removeAllListeners=function(Zt){let gr=v.prototype.removeAllListeners.apply(this,arguments);return(Zt==="readable"||Zt===void 0)&&t.nextTick(Br,this),gr};function Br(Zt){let gr=Zt._readableState;gr.readableListening=Zt.listenerCount("readable")>0,gr.resumeScheduled&&gr[ee]===!1?gr.flowing=!0:Zt.listenerCount("data")>0?Zt.resume():gr.readableListening||(gr.flowing=null)}function ei(Zt){T("readable nexttick read 0"),Zt.read(0)}Oe.prototype.resume=function(){let Zt=this._readableState;return Zt.flowing||(T("resume"),Zt.flowing=!Zt.readableListening,jt(this,Zt)),Zt[ee]=!1,this};function jt(Zt,gr){gr.resumeScheduled||(gr.resumeScheduled=!0,t.nextTick(nt,Zt,gr))}function nt(Zt,gr){T("resume",gr.reading),gr.reading||Zt.read(0),gr.resumeScheduled=!1,Zt.emit("resume"),Kr(Zt),gr.flowing&&!gr.reading&&Zt.read(0)}Oe.prototype.pause=function(){return T("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(T("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[ee]=!0,this};function Kr(Zt){let gr=Zt._readableState;for(T("flow",gr.flowing);gr.flowing&&Zt.read()!==null;);}Oe.prototype.wrap=function(Zt){let gr=!1;Zt.on("data",kn=>{!this.push(kn)&&Zt.pause&&(gr=!0,Zt.pause())}),Zt.on("end",()=>{this.push(null)}),Zt.on("error",kn=>{se(this,kn)}),Zt.on("close",()=>{this.destroy()}),Zt.on("destroy",()=>{this.destroy()}),this._read=()=>{gr&&Zt.resume&&(gr=!1,Zt.resume())};let Qi=l(Zt);for(let kn=1;kn<Qi.length;kn++){let ds=Qi[kn];this[ds]===void 0&&typeof Zt[ds]=="function"&&(this[ds]=Zt[ds].bind(Zt))}return this},Oe.prototype[p]=function(){return Pr(this)},Oe.prototype.iterator=function(Zt){return Zt!==void 0&&$(Zt,"options"),Pr(this,Zt)};function Pr(Zt,gr){typeof Zt.read!="function"&&(Zt=Oe.wrap(Zt,{objectMode:!0}));let Qi=Dr(Zt,gr);return Qi.stream=Zt,Qi}async function*Dr(Zt,gr){let Qi=re;function kn(as){this===Zt?(Qi(),Qi=re):Qi=as}Zt.on("readable",kn);let ds,ao=C(Zt,{writable:!1},as=>{ds=as?k(ds,as):null,Qi(),Qi=re});try{for(;;){let as=Zt.destroyed?null:Zt.read();if(as!==null)yield as;else{if(ds)throw ds;if(ds===null)return;await new c(kn)}}}catch(as){throw ds=k(ds,as),ds}finally{(ds||(gr==null?void 0:gr.destroyOnReturn)!==!1)&&(ds===void 0||Zt._readableState.autoDestroy)?B.destroyer(Zt,null):(Zt.off("readable",kn),ao())}}o(Oe.prototype,{readable:{__proto__:null,get(){let Zt=this._readableState;return!!Zt&&Zt.readable!==!1&&!Zt.destroyed&&!Zt.errorEmitted&&!Zt.endEmitted},set(Zt){this._readableState&&(this._readableState.readable=!!Zt)}},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(Zt){this._readableState&&(this._readableState.flowing=Zt)}},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(Zt){this._readableState&&(this._readableState.destroyed=Zt)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),o(Xe.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[ee]!==!1},set(Zt){this[ee]=!!Zt}}}),Oe._fromList=Vr;function Vr(Zt,gr){if(gr.length===0)return null;let Qi;return gr.objectMode?Qi=gr.buffer.shift():!Zt||Zt>=gr.length?(gr.decoder?Qi=gr.buffer.join(""):gr.buffer.length===1?Qi=gr.buffer.first():Qi=gr.buffer.concat(gr.length),gr.buffer.clear()):Qi=gr.buffer.consume(Zt,gr.decoder),Qi}function Fi(Zt){let gr=Zt._readableState;T("endReadable",gr.endEmitted),gr.endEmitted||(gr.ended=!0,t.nextTick(Jn,gr,Zt))}function Jn(Zt,gr){if(T("endReadableNT",Zt.endEmitted,Zt.length),!Zt.errored&&!Zt.closeEmitted&&!Zt.endEmitted&&Zt.length===0){if(Zt.endEmitted=!0,gr.emit("end"),gr.writable&&gr.allowHalfOpen===!1)t.nextTick(Ps,gr);else if(Zt.autoDestroy){let Qi=gr._writableState;(!Qi||Qi.autoDestroy&&(Qi.finished||Qi.writable===!1))&&gr.destroy()}}}function Ps(Zt){Zt.writable&&!Zt.writableEnded&&!Zt.destroyed&&Zt.end()}Oe.from=function(Zt,gr){return ce(Oe,Zt,gr)};var wa;function Vs(){return wa===void 0&&(wa={}),wa}Oe.fromWeb=function(Zt,gr){return Vs().newStreamReadableFromReadableStream(Zt,gr)},Oe.toWeb=function(Zt,gr){return Vs().newReadableStreamFromStreamReadable(Zt,gr)},Oe.wrap=function(Zt,gr){var Qi,kn;return new Oe({objectMode:(Qi=(kn=Zt.readableObjectMode)!==null&&kn!==void 0?kn:Zt.objectMode)!==null&&Qi!==void 0?Qi:!0,...gr,destroy(ds,ao){B.destroyer(Zt,ds),ao(ds)}}).wrap(Zt)}}),Sit=Sn((i,e)=>{gn(),vn(),xn();var t=jO(),{ArrayPrototypeSlice:r,Error:n,FunctionPrototypeSymbolHasInstance:s,ObjectDefineProperty:a,ObjectDefineProperties:o,ObjectSetPrototypeOf:l,StringPrototypeToLowerCase:u,Symbol:c,SymbolHasInstance:d}=e0();e.exports=$,$.WritableState=q;var{EventEmitter:h}=(zO(),Ch(WF)),p=Ait().Stream,{Buffer:m}=(ng(),Ch(ig)),x=kH(),{addAbortSignal:v}=Zxe(),{getHighWaterMark:y,getDefaultHighWaterMark:E}=$xe(),{ERR_INVALID_ARG_TYPE:S,ERR_METHOD_NOT_IMPLEMENTED:C,ERR_MULTIPLE_CALLBACK:T,ERR_STREAM_CANNOT_PIPE:I,ERR_STREAM_DESTROYED:B,ERR_STREAM_ALREADY_FINISHED:O,ERR_STREAM_NULL_VALUES:L,ERR_STREAM_WRITE_AFTER_END:k,ERR_UNKNOWN_ENCODING:U}=N3().codes,{errorOrDestroy:j}=x;l($.prototype,p.prototype),l($,p);function Y(){}var X=c("kOnFinished");function q(Be,Ke,ht){typeof ht!="boolean"&&(ht=Ke instanceof d9()),this.objectMode=!!(Be&&Be.objectMode),ht&&(this.objectMode=this.objectMode||!!(Be&&Be.writableObjectMode)),this.highWaterMark=Be?y(this,Be,"writableHighWaterMark",ht):E(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let St=!!(Be&&Be.decodeStrings===!1);this.decodeStrings=!St,this.defaultEncoding=Be&&Be.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=se.bind(void 0,Ke),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,J(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!Be||Be.emitClose!==!1,this.autoDestroy=!Be||Be.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[X]=[]}function J(Be){Be.buffered=[],Be.bufferedIndex=0,Be.allBuffers=!0,Be.allNoop=!0}q.prototype.getBuffer=function(){return r(this.buffered,this.bufferedIndex)},a(q.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function $(Be){let Ke=this instanceof d9();if(!Ke&&!s($,this))return new $(Be);this._writableState=new q(Be,this,Ke),Be&&(typeof Be.write=="function"&&(this._write=Be.write),typeof Be.writev=="function"&&(this._writev=Be.writev),typeof Be.destroy=="function"&&(this._destroy=Be.destroy),typeof Be.final=="function"&&(this._final=Be.final),typeof Be.construct=="function"&&(this._construct=Be.construct),Be.signal&&v(Be.signal,this)),p.call(this,Be),x.construct(this,()=>{let ht=this._writableState;ht.writing||ve(this,ht),Ge(this,ht)})}a($,d,{__proto__:null,value:function(Be){return s(this,Be)?!0:this!==$?!1:Be&&Be._writableState instanceof q}}),$.prototype.pipe=function(){j(this,new I)};function ee(Be,Ke,ht,St){let xt=Be._writableState;if(typeof ht=="function")St=ht,ht=xt.defaultEncoding;else{if(!ht)ht=xt.defaultEncoding;else if(ht!=="buffer"&&!m.isEncoding(ht))throw new U(ht);typeof St!="function"&&(St=Y)}if(Ke===null)throw new L;if(!xt.objectMode)if(typeof Ke=="string")xt.decodeStrings!==!1&&(Ke=m.from(Ke,ht),ht="buffer");else if(Ke instanceof m)ht="buffer";else if(p._isUint8Array(Ke))Ke=p._uint8ArrayToBuffer(Ke),ht="buffer";else throw new S("chunk",["string","Buffer","Uint8Array"],Ke);let Vt;return xt.ending?Vt=new k:xt.destroyed&&(Vt=new B("write")),Vt?(t.nextTick(St,Vt),j(Be,Vt,!0),Vt):(xt.pendingcb++,ae(Be,xt,Ke,ht,St))}$.prototype.write=function(Be,Ke,ht){return ee(this,Be,Ke,ht)===!0},$.prototype.cork=function(){this._writableState.corked++},$.prototype.uncork=function(){let Be=this._writableState;Be.corked&&(Be.corked--,Be.writing||ve(this,Be))},$.prototype.setDefaultEncoding=function(Be){if(typeof Be=="string"&&(Be=u(Be)),!m.isEncoding(Be))throw new U(Be);return this._writableState.defaultEncoding=Be,this};function ae(Be,Ke,ht,St,xt){let Vt=Ke.objectMode?1:ht.length;Ke.length+=Vt;let bt=Ke.length<Ke.highWaterMark;return bt||(Ke.needDrain=!0),Ke.writing||Ke.corked||Ke.errored||!Ke.constructed?(Ke.buffered.push({chunk:ht,encoding:St,callback:xt}),Ke.allBuffers&&St!=="buffer"&&(Ke.allBuffers=!1),Ke.allNoop&&xt!==Y&&(Ke.allNoop=!1)):(Ke.writelen=Vt,Ke.writecb=xt,Ke.writing=!0,Ke.sync=!0,Be._write(ht,St,Ke.onwrite),Ke.sync=!1),bt&&!Ke.errored&&!Ke.destroyed}function ce(Be,Ke,ht,St,xt,Vt,bt){Ke.writelen=St,Ke.writecb=bt,Ke.writing=!0,Ke.sync=!0,Ke.destroyed?Ke.onwrite(new B("write")):ht?Be._writev(xt,Ke.onwrite):Be._write(xt,Vt,Ke.onwrite),Ke.sync=!1}function re(Be,Ke,ht,St){--Ke.pendingcb,St(ht),oe(Ke),j(Be,ht)}function se(Be,Ke){let ht=Be._writableState,St=ht.sync,xt=ht.writecb;if(typeof xt!="function"){j(Be,new T);return}ht.writing=!1,ht.writecb=null,ht.length-=ht.writelen,ht.writelen=0,Ke?(Ke.stack,ht.errored||(ht.errored=Ke),Be._readableState&&!Be._readableState.errored&&(Be._readableState.errored=Ke),St?t.nextTick(re,Be,ht,Ke,xt):re(Be,ht,Ke,xt)):(ht.buffered.length>ht.bufferedIndex&&ve(Be,ht),St?ht.afterWriteTickInfo!==null&&ht.afterWriteTickInfo.cb===xt?ht.afterWriteTickInfo.count++:(ht.afterWriteTickInfo={count:1,cb:xt,stream:Be,state:ht},t.nextTick(fe,ht.afterWriteTickInfo)):me(Be,ht,1,xt))}function fe({stream:Be,state:Ke,count:ht,cb:St}){return Ke.afterWriteTickInfo=null,me(Be,Ke,ht,St)}function me(Be,Ke,ht,St){for(!Ke.ending&&!Be.destroyed&&Ke.length===0&&Ke.needDrain&&(Ke.needDrain=!1,Be.emit("drain"));ht-- >0;)Ke.pendingcb--,St();Ke.destroyed&&oe(Ke),Ge(Be,Ke)}function oe(Be){if(Be.writing)return;for(let xt=Be.bufferedIndex;xt<Be.buffered.length;++xt){var Ke;let{chunk:Vt,callback:bt}=Be.buffered[xt],$t=Be.objectMode?1:Vt.length;Be.length-=$t,bt((Ke=Be.errored)!==null&&Ke!==void 0?Ke:new B("write"))}let ht=Be[X].splice(0);for(let xt=0;xt<ht.length;xt++){var St;ht[xt]((St=Be.errored)!==null&&St!==void 0?St:new B("end"))}J(Be)}function ve(Be,Ke){if(Ke.corked||Ke.bufferProcessing||Ke.destroyed||!Ke.constructed)return;let{buffered:ht,bufferedIndex:St,objectMode:xt}=Ke,Vt=ht.length-St;if(!Vt)return;let bt=St;if(Ke.bufferProcessing=!0,Vt>1&&Be._writev){Ke.pendingcb-=Vt-1;let $t=Ke.allNoop?Y:Oe=>{for(let ft=bt;ft<ht.length;++ft)ht[ft].callback(Oe)},Xe=Ke.allNoop&&bt===0?ht:r(ht,bt);Xe.allBuffers=Ke.allBuffers,ce(Be,Ke,!0,Ke.length,Xe,"",$t),J(Ke)}else{do{let{chunk:$t,encoding:Xe,callback:Oe}=ht[bt];ht[bt++]=null;let ft=xt?1:$t.length;ce(Be,Ke,!1,ft,$t,Xe,Oe)}while(bt<ht.length&&!Ke.writing);bt===ht.length?J(Ke):bt>256?(ht.splice(0,bt),Ke.bufferedIndex=0):Ke.bufferedIndex=bt}Ke.bufferProcessing=!1}$.prototype._write=function(Be,Ke,ht){if(this._writev)this._writev([{chunk:Be,encoding:Ke}],ht);else throw new C("_write()")},$.prototype._writev=null,$.prototype.end=function(Be,Ke,ht){let St=this._writableState;typeof Be=="function"?(ht=Be,Be=null,Ke=null):typeof Ke=="function"&&(ht=Ke,Ke=null);let xt;if(Be!=null){let Vt=ee(this,Be,Ke);Vt instanceof n&&(xt=Vt)}return St.corked&&(St.corked=1,this.uncork()),xt||(!St.errored&&!St.ending?(St.ending=!0,Ge(this,St,!0),St.ended=!0):St.finished?xt=new O("end"):St.destroyed&&(xt=new B("end"))),typeof ht=="function"&&(xt||St.finished?t.nextTick(ht,xt):St[X].push(ht)),this};function ne(Be){return Be.ending&&!Be.destroyed&&Be.constructed&&Be.length===0&&!Be.errored&&Be.buffered.length===0&&!Be.finished&&!Be.writing&&!Be.errorEmitted&&!Be.closeEmitted}function pe(Be,Ke){let ht=!1;function St(xt){if(ht){j(Be,xt??T());return}if(ht=!0,Ke.pendingcb--,xt){let Vt=Ke[X].splice(0);for(let bt=0;bt<Vt.length;bt++)Vt[bt](xt);j(Be,xt,Ke.sync)}else ne(Ke)&&(Ke.prefinished=!0,Be.emit("prefinish"),Ke.pendingcb++,t.nextTick(Re,Be,Ke))}Ke.sync=!0,Ke.pendingcb++;try{Be._final(St)}catch(xt){St(xt)}Ke.sync=!1}function Ae(Be,Ke){!Ke.prefinished&&!Ke.finalCalled&&(typeof Be._final=="function"&&!Ke.destroyed?(Ke.finalCalled=!0,pe(Be,Ke)):(Ke.prefinished=!0,Be.emit("prefinish")))}function Ge(Be,Ke,ht){ne(Ke)&&(Ae(Be,Ke),Ke.pendingcb===0&&(ht?(Ke.pendingcb++,t.nextTick((St,xt)=>{ne(xt)?Re(St,xt):xt.pendingcb--},Be,Ke)):ne(Ke)&&(Ke.pendingcb++,Re(Be,Ke))))}function Re(Be,Ke){Ke.pendingcb--,Ke.finished=!0;let ht=Ke[X].splice(0);for(let St=0;St<ht.length;St++)ht[St]();if(Be.emit("finish"),Ke.autoDestroy){let St=Be._readableState;(!St||St.autoDestroy&&(St.endEmitted||St.readable===!1))&&Be.destroy()}}o($.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(Be){this._writableState&&(this._writableState.destroyed=Be)}},writable:{__proto__:null,get(){let Be=this._writableState;return!!Be&&Be.writable!==!1&&!Be.destroyed&&!Be.errored&&!Be.ending&&!Be.ended},set(Be){this._writableState&&(this._writableState.writable=!!Be)}},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 Be=this._writableState;return Be?!Be.destroyed&&!Be.ending&&Be.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 De=x.destroy;$.prototype.destroy=function(Be,Ke){let ht=this._writableState;return!ht.destroyed&&(ht.bufferedIndex<ht.buffered.length||ht[X].length)&&t.nextTick(oe,ht),De.call(this,Be,Ke),this},$.prototype._undestroy=x.undestroy,$.prototype._destroy=function(Be,Ke){Ke(Be)},$.prototype[h.captureRejectionSymbol]=function(Be){this.destroy(Be)};var ze;function He(){return ze===void 0&&(ze={}),ze}$.fromWeb=function(Be,Ke){return He().newStreamWritableFromWritableStream(Be,Ke)},$.toWeb=function(Be){return He().newWritableStreamFromStreamWritable(Be)}}),PTn=Sn((i,e)=>{gn(),vn(),xn();var t=jO(),r=(ng(),Ch(ig)),{isReadable:n,isWritable:s,isIterable:a,isNodeStream:o,isReadableNodeStream:l,isWritableNodeStream:u,isDuplexNodeStream:c,isReadableStream:d,isWritableStream:h}=c9(),p=XF(),{AbortError:m,codes:{ERR_INVALID_ARG_TYPE:x,ERR_INVALID_RETURN_VALUE:v}}=N3(),{destroyer:y}=kH(),E=d9(),S=e3e(),C=Sit(),{createDeferredPromise:T}=by(),I=sSr(),B=globalThis.Blob||r.Blob,O=typeof B<"u"?function(X){return X instanceof B}:function(X){return!1},L=globalThis.AbortController||_te().AbortController,{FunctionPrototypeCall:k}=e0(),U=class extends E{constructor(X){super(X),(X==null?void 0:X.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(X==null?void 0:X.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};e.exports=function X(q,J){if(c(q))return q;if(l(q))return Y({readable:q});if(u(q))return Y({writable:q});if(o(q))return Y({writable:!1,readable:!1});if(d(q))return Y({readable:S.fromWeb(q)});if(h(q))return Y({writable:C.fromWeb(q)});if(typeof q=="function"){let{value:ee,write:ae,final:ce,destroy:re}=j(q);if(a(ee))return I(U,ee,{objectMode:!0,write:ae,final:ce,destroy:re});let se=ee==null?void 0:ee.then;if(typeof se=="function"){let fe,me=k(se,ee,oe=>{if(oe!=null)throw new v("nully","body",oe)},oe=>{y(fe,oe)});return fe=new U({objectMode:!0,readable:!1,write:ae,final(oe){ce(async()=>{try{await me,t.nextTick(oe,null)}catch(ve){t.nextTick(oe,ve)}})},destroy:re})}throw new v("Iterable, AsyncIterable or AsyncFunction",J,ee)}if(O(q))return X(q.arrayBuffer());if(a(q))return I(U,q,{objectMode:!0,writable:!1});if(d(q==null?void 0:q.readable)&&h(q==null?void 0:q.writable))return U.fromWeb(q);if(typeof(q==null?void 0:q.writable)=="object"||typeof(q==null?void 0:q.readable)=="object"){let ee=q!=null&&q.readable?l(q==null?void 0:q.readable)?q==null?void 0:q.readable:X(q.readable):void 0,ae=q!=null&&q.writable?u(q==null?void 0:q.writable)?q==null?void 0:q.writable:X(q.writable):void 0;return Y({readable:ee,writable:ae})}let $=q==null?void 0:q.then;if(typeof $=="function"){let ee;return k($,q,ae=>{ae!=null&&ee.push(ae),ee.push(null)},ae=>{y(ee,ae)}),ee=new U({objectMode:!0,writable:!1,read(){}})}throw new x(J,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],q)};function j(X){let{promise:q,resolve:J}=T(),$=new L,ee=$.signal;return{value:X(async function*(){for(;;){let ae=q;q=null;let{chunk:ce,done:re,cb:se}=await ae;if(t.nextTick(se),re)return;if(ee.aborted)throw new m(void 0,{cause:ee.reason});({promise:q,resolve:J}=T()),yield ce}}(),{signal:ee}),write(ae,ce,re){let se=J;J=null,se({chunk:ae,done:!1,cb:re})},final(ae){let ce=J;J=null,ce({done:!0,cb:ae})},destroy(ae,ce){$.abort(),ce(ae)}}}function Y(X){let q=X.readable&&typeof X.readable.read!="function"?S.wrap(X.readable):X.readable,J=X.writable,$=!!n(q),ee=!!s(J),ae,ce,re,se,fe;function me(oe){let ve=se;se=null,ve?ve(oe):oe&&fe.destroy(oe)}return fe=new U({readableObjectMode:!!(q!=null&&q.readableObjectMode),writableObjectMode:!!(J!=null&&J.writableObjectMode),readable:$,writable:ee}),ee&&(p(J,oe=>{ee=!1,oe&&y(q,oe),me(oe)}),fe._write=function(oe,ve,ne){J.write(oe,ve)?ne():ae=ne},fe._final=function(oe){J.end(),ce=oe},J.on("drain",function(){if(ae){let oe=ae;ae=null,oe()}}),J.on("finish",function(){if(ce){let oe=ce;ce=null,oe()}})),$&&(p(q,oe=>{$=!1,oe&&y(q,oe),me(oe)}),q.on("readable",function(){if(re){let oe=re;re=null,oe()}}),q.on("end",function(){fe.push(null)}),fe._read=function(){for(;;){let oe=q.read();if(oe===null){re=fe._read;return}if(!fe.push(oe))return}}),fe._destroy=function(oe,ve){!oe&&se!==null&&(oe=new m),re=null,ae=null,ce=null,se===null?ve(oe):(se=ve,y(J,oe),y(q,oe))},fe}}),d9=Sn((i,e)=>{gn(),vn(),xn();var{ObjectDefineProperties:t,ObjectGetOwnPropertyDescriptor:r,ObjectKeys:n,ObjectSetPrototypeOf:s}=e0();e.exports=l;var a=e3e(),o=Sit();s(l.prototype,a.prototype),s(l,a);{let h=n(o.prototype);for(let p=0;p<h.length;p++){let m=h[p];l.prototype[m]||(l.prototype[m]=o.prototype[m])}}function l(h){if(!(this instanceof l))return new l(h);a.call(this,h),o.call(this,h),h?(this.allowHalfOpen=h.allowHalfOpen!==!1,h.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),h.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}t(l.prototype,{writable:{__proto__:null,...r(o.prototype,"writable")},writableHighWaterMark:{__proto__:null,...r(o.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...r(o.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...r(o.prototype,"writableBuffer")},writableLength:{__proto__:null,...r(o.prototype,"writableLength")},writableFinished:{__proto__:null,...r(o.prototype,"writableFinished")},writableCorked:{__proto__:null,...r(o.prototype,"writableCorked")},writableEnded:{__proto__:null,...r(o.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...r(o.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(h){this._readableState&&this._writableState&&(this._readableState.destroyed=h,this._writableState.destroyed=h)}}});var u;function c(){return u===void 0&&(u={}),u}l.fromWeb=function(h,p){return c().newStreamDuplexFromReadableWritablePair(h,p)},l.toWeb=function(h){return c().newReadableWritablePairFromDuplex(h)};var d;l.from=function(h){return d||(d=PTn()),d(h,"body")}}),aSr=Sn((i,e)=>{gn(),vn(),xn();var{ObjectSetPrototypeOf:t,Symbol:r}=e0();e.exports=l;var{ERR_METHOD_NOT_IMPLEMENTED:n}=N3().codes,s=d9(),{getHighWaterMark:a}=$xe();t(l.prototype,s.prototype),t(l,s);var o=r("kCallback");function l(d){if(!(this instanceof l))return new l(d);let h=d?a(this,d,"readableHighWaterMark",!0):null;h===0&&(d={...d,highWaterMark:null,readableHighWaterMark:h,writableHighWaterMark:d.writableHighWaterMark||0}),s.call(this,d),this._readableState.sync=!1,this[o]=null,d&&(typeof d.transform=="function"&&(this._transform=d.transform),typeof d.flush=="function"&&(this._flush=d.flush)),this.on("prefinish",c)}function u(d){typeof this._flush=="function"&&!this.destroyed?this._flush((h,p)=>{if(h){d?d(h):this.destroy(h);return}p!=null&&this.push(p),this.push(null),d&&d()}):(this.push(null),d&&d())}function c(){this._final!==u&&u.call(this)}l.prototype._final=u,l.prototype._transform=function(d,h,p){throw new n("_transform()")},l.prototype._write=function(d,h,p){let m=this._readableState,x=this._writableState,v=m.length;this._transform(d,h,(y,E)=>{if(y){p(y);return}E!=null&&this.push(E),x.ended||v===m.length||m.length<m.highWaterMark?p():this[o]=p})},l.prototype._read=function(){if(this[o]){let d=this[o];this[o]=null,d()}}}),oSr=Sn((i,e)=>{gn(),vn(),xn();var{ObjectSetPrototypeOf:t}=e0();e.exports=n;var r=aSr();t(n.prototype,r.prototype),t(n,r);function n(s){if(!(this instanceof n))return new n(s);r.call(this,s)}n.prototype._transform=function(s,a,o){o(null,s)}}),Cit=Sn((i,e)=>{gn(),vn(),xn();var t=jO(),{ArrayIsArray:r,Promise:n,SymbolAsyncIterator:s,SymbolDispose:a}=e0(),o=XF(),{once:l}=by(),u=kH(),c=d9(),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:h,ERR_INVALID_RETURN_VALUE:p,ERR_MISSING_ARGS:m,ERR_STREAM_DESTROYED:x,ERR_STREAM_PREMATURE_CLOSE:v},AbortError:y}=N3(),{validateFunction:E,validateAbortSignal:S}=Ste(),{isIterable:C,isReadable:T,isReadableNodeStream:I,isNodeStream:B,isTransformStream:O,isWebStream:L,isReadableStream:k,isReadableFinished:U}=c9(),j=globalThis.AbortController||_te().AbortController,Y,X,q;function J(oe,ve,ne){let pe=!1;oe.on("close",()=>{pe=!0});let Ae=o(oe,{readable:ve,writable:ne},Ge=>{pe=!Ge});return{destroy:Ge=>{pe||(pe=!0,u.destroyer(oe,Ge||new x("pipe")))},cleanup:Ae}}function $(oe){return E(oe[oe.length-1],"streams[stream.length - 1]"),oe.pop()}function ee(oe){if(C(oe))return oe;if(I(oe))return ae(oe);throw new h("val",["Readable","Iterable","AsyncIterable"],oe)}async function*ae(oe){X||(X=e3e()),yield*X.prototype[s].call(oe)}async function ce(oe,ve,ne,{end:pe}){let Ae,Ge=null,Re=He=>{if(He&&(Ae=He),Ge){let Be=Ge;Ge=null,Be()}},De=()=>new n((He,Be)=>{Ae?Be(Ae):Ge=()=>{Ae?Be(Ae):He()}});ve.on("drain",Re);let ze=o(ve,{readable:!1},Re);try{ve.writableNeedDrain&&await De();for await(let He of oe)ve.write(He)||await De();pe&&(ve.end(),await De()),ne()}catch(He){ne(Ae!==He?d(Ae,He):He)}finally{ze(),ve.off("drain",Re)}}async function re(oe,ve,ne,{end:pe}){O(ve)&&(ve=ve.writable);let Ae=ve.getWriter();try{for await(let Ge of oe)await Ae.ready,Ae.write(Ge).catch(()=>{});await Ae.ready,pe&&await Ae.close(),ne()}catch(Ge){try{await Ae.abort(Ge),ne(Ge)}catch(Re){ne(Re)}}}function se(...oe){return fe(oe,l($(oe)))}function fe(oe,ve,ne){if(oe.length===1&&r(oe[0])&&(oe=oe[0]),oe.length<2)throw new m("streams");let pe=new j,Ae=pe.signal,Ge=ne==null?void 0:ne.signal,Re=[];S(Ge,"options.signal");function De(){xt(new y)}q=q||by().addAbortListener;let ze;Ge&&(ze=q(Ge,De));let He,Be,Ke=[],ht=0;function St(Xe){xt(Xe,--ht===0)}function xt(Xe,Oe){var ft;if(Xe&&(!He||He.code==="ERR_STREAM_PREMATURE_CLOSE")&&(He=Xe),!(!He&&!Oe)){for(;Ke.length;)Ke.shift()(He);(ft=ze)===null||ft===void 0||ft[a](),pe.abort(),Oe&&(He||Re.forEach(Ce=>Ce()),t.nextTick(ve,He,Be))}}let Vt;for(let Xe=0;Xe<oe.length;Xe++){let Oe=oe[Xe],ft=Xe<oe.length-1,Ce=Xe>0,Pe=ft||(ne==null?void 0:ne.end)!==!1,ke=Xe===oe.length-1;if(B(Oe)){let Ye=function(Me){Me&&Me.name!=="AbortError"&&Me.code!=="ERR_STREAM_PREMATURE_CLOSE"&&St(Me)};if(Pe){let{destroy:Me,cleanup:et}=J(Oe,ft,Ce);Ke.push(Me),T(Oe)&&ke&&Re.push(et)}Oe.on("error",Ye),T(Oe)&&ke&&Re.push(()=>{Oe.removeListener("error",Ye)})}if(Xe===0)if(typeof Oe=="function"){if(Vt=Oe({signal:Ae}),!C(Vt))throw new p("Iterable, AsyncIterable or Stream","source",Vt)}else C(Oe)||I(Oe)||O(Oe)?Vt=Oe:Vt=c.from(Oe);else if(typeof Oe=="function"){if(O(Vt)){var bt;Vt=ee((bt=Vt)===null||bt===void 0?void 0:bt.readable)}else Vt=ee(Vt);if(Vt=Oe(Vt,{signal:Ae}),ft){if(!C(Vt,!0))throw new p("AsyncIterable",`transform[${Xe-1}]`,Vt)}else{var $t;Y||(Y=oSr());let Ye=new Y({objectMode:!0}),Me=($t=Vt)===null||$t===void 0?void 0:$t.then;if(typeof Me=="function")ht++,Me.call(Vt,vt=>{Be=vt,vt!=null&&Ye.write(vt),Pe&&Ye.end(),t.nextTick(St)},vt=>{Ye.destroy(vt),t.nextTick(St,vt)});else if(C(Vt,!0))ht++,ce(Vt,Ye,St,{end:Pe});else if(k(Vt)||O(Vt)){let vt=Vt.readable||Vt;ht++,ce(vt,Ye,St,{end:Pe})}else throw new p("AsyncIterable or Promise","destination",Vt);Vt=Ye;let{destroy:et,cleanup:ot}=J(Vt,!1,!0);Ke.push(et),ke&&Re.push(ot)}}else if(B(Oe)){if(I(Vt)){ht+=2;let Ye=me(Vt,Oe,St,{end:Pe});T(Oe)&&ke&&Re.push(Ye)}else if(O(Vt)||k(Vt)){let Ye=Vt.readable||Vt;ht++,ce(Ye,Oe,St,{end:Pe})}else if(C(Vt))ht++,ce(Vt,Oe,St,{end:Pe});else throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Vt);Vt=Oe}else if(L(Oe)){if(I(Vt))ht++,re(ee(Vt),Oe,St,{end:Pe});else if(k(Vt)||C(Vt))ht++,re(Vt,Oe,St,{end:Pe});else if(O(Vt))ht++,re(Vt.readable,Oe,St,{end:Pe});else throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Vt);Vt=Oe}else Vt=c.from(Oe)}return(Ae!=null&&Ae.aborted||Ge!=null&&Ge.aborted)&&t.nextTick(De),Vt}function me(oe,ve,ne,{end:pe}){let Ae=!1;if(ve.on("close",()=>{Ae||ne(new v)}),oe.pipe(ve,{end:!1}),pe){let Ge=function(){Ae=!0,ve.end()};U(oe)?t.nextTick(Ge):oe.once("end",Ge)}else ne();return o(oe,{readable:!0,writable:!1},Ge=>{let Re=oe._readableState;Ge&&Ge.code==="ERR_STREAM_PREMATURE_CLOSE"&&Re&&Re.ended&&!Re.errored&&!Re.errorEmitted?oe.once("end",ne).once("error",ne):ne(Ge)}),o(ve,{readable:!1,writable:!0},ne)}e.exports={pipelineImpl:fe,pipeline:se}}),lSr=Sn((i,e)=>{gn(),vn(),xn();var{pipeline:t}=Cit(),r=d9(),{destroyer:n}=kH(),{isNodeStream:s,isReadable:a,isWritable:o,isWebStream:l,isTransformStream:u,isWritableStream:c,isReadableStream:d}=c9(),{AbortError:h,codes:{ERR_INVALID_ARG_VALUE:p,ERR_MISSING_ARGS:m}}=N3(),x=XF();e.exports=function(...v){if(v.length===0)throw new m("streams");if(v.length===1)return r.from(v[0]);let y=[...v];if(typeof v[0]=="function"&&(v[0]=r.from(v[0])),typeof v[v.length-1]=="function"){let j=v.length-1;v[j]=r.from(v[j])}for(let j=0;j<v.length;++j)if(!(!s(v[j])&&!l(v[j]))){if(j<v.length-1&&!(a(v[j])||d(v[j])||u(v[j])))throw new p(`streams[${j}]`,y[j],"must be readable");if(j>0&&!(o(v[j])||c(v[j])||u(v[j])))throw new p(`streams[${j}]`,y[j],"must be writable")}let E,S,C,T,I;function B(j){let Y=T;T=null,Y?Y(j):j?I.destroy(j):!U&&!k&&I.destroy()}let O=v[0],L=t(v,B),k=!!(o(O)||c(O)||u(O)),U=!!(a(L)||d(L)||u(L));if(I=new r({writableObjectMode:!!(O!=null&&O.writableObjectMode),readableObjectMode:!!(L!=null&&L.readableObjectMode),writable:k,readable:U}),k){if(s(O))I._write=function(Y,X,q){O.write(Y,X)?q():E=q},I._final=function(Y){O.end(),S=Y},O.on("drain",function(){if(E){let Y=E;E=null,Y()}});else if(l(O)){let Y=(u(O)?O.writable:O).getWriter();I._write=async function(X,q,J){try{await Y.ready,Y.write(X).catch(()=>{}),J()}catch($){J($)}},I._final=async function(X){try{await Y.ready,Y.close().catch(()=>{}),S=X}catch(q){X(q)}}}let j=u(L)?L.readable:L;x(j,()=>{if(S){let Y=S;S=null,Y()}})}if(U){if(s(L))L.on("readable",function(){if(C){let j=C;C=null,j()}}),L.on("end",function(){I.push(null)}),I._read=function(){for(;;){let j=L.read();if(j===null){C=I._read;return}if(!I.push(j))return}};else if(l(L)){let j=(u(L)?L.readable:L).getReader();I._read=async function(){for(;;)try{let{value:Y,done:X}=await j.read();if(!I.push(Y))return;if(X){I.push(null);return}}catch{return}}}}return I._destroy=function(j,Y){!j&&T!==null&&(j=new h),C=null,E=null,S=null,T===null?Y(j):(T=Y,s(L)&&n(L,j))},I}}),ITn=Sn((i,e)=>{gn(),vn(),xn();var t=globalThis.AbortController||_te().AbortController,{codes:{ERR_INVALID_ARG_VALUE:r,ERR_INVALID_ARG_TYPE:n,ERR_MISSING_ARGS:s,ERR_OUT_OF_RANGE:a},AbortError:o}=N3(),{validateAbortSignal:l,validateInteger:u,validateObject:c}=Ste(),d=e0().Symbol("kWeak"),h=e0().Symbol("kResistStopPropagation"),{finished:p}=XF(),m=lSr(),{addAbortSignalNoValidate:x}=Zxe(),{isWritable:v,isNodeStream:y}=c9(),{deprecate:E}=by(),{ArrayPrototypePush:S,Boolean:C,MathFloor:T,Number:I,NumberIsNaN:B,Promise:O,PromiseReject:L,PromiseResolve:k,PromisePrototypeThen:U,Symbol:j}=e0(),Y=j("kEmpty"),X=j("kEof");function q(Ge,Re){if(Re!=null&&c(Re,"options"),(Re==null?void 0:Re.signal)!=null&&l(Re.signal,"options.signal"),y(Ge)&&!v(Ge))throw new r("stream",Ge,"must be writable");let De=m(this,Ge);return Re!=null&&Re.signal&&x(Re.signal,De),De}function J(Ge,Re){if(typeof Ge!="function")throw new n("fn",["Function","AsyncFunction"],Ge);Re!=null&&c(Re,"options"),(Re==null?void 0:Re.signal)!=null&&l(Re.signal,"options.signal");let De=1;(Re==null?void 0:Re.concurrency)!=null&&(De=T(Re.concurrency));let ze=De-1;return(Re==null?void 0:Re.highWaterMark)!=null&&(ze=T(Re.highWaterMark)),u(De,"options.concurrency",1),u(ze,"options.highWaterMark",0),ze+=De,(async function*(){let He=by().AbortSignalAny([Re==null?void 0:Re.signal].filter(C)),Be=this,Ke=[],ht={signal:He},St,xt,Vt=!1,bt=0;function $t(){Vt=!0,Xe()}function Xe(){bt-=1,Oe()}function Oe(){xt&&!Vt&&bt<De&&Ke.length<ze&&(xt(),xt=null)}async function ft(){try{for await(let Ce of Be){if(Vt)return;if(He.aborted)throw new o;try{if(Ce=Ge(Ce,ht),Ce===Y)continue;Ce=k(Ce)}catch(Pe){Ce=L(Pe)}bt+=1,U(Ce,Xe,$t),Ke.push(Ce),St&&(St(),St=null),!Vt&&(Ke.length>=ze||bt>=De)&&await new O(Pe=>{xt=Pe})}Ke.push(X)}catch(Ce){let Pe=L(Ce);U(Pe,Xe,$t),Ke.push(Pe)}finally{Vt=!0,St&&(St(),St=null)}}ft();try{for(;;){for(;Ke.length>0;){let Ce=await Ke[0];if(Ce===X)return;if(He.aborted)throw new o;Ce!==Y&&(yield Ce),Ke.shift(),Oe()}await new O(Ce=>{St=Ce})}}finally{Vt=!0,xt&&(xt(),xt=null)}}).call(this)}function $(Ge=void 0){return Ge!=null&&c(Ge,"options"),(Ge==null?void 0:Ge.signal)!=null&&l(Ge.signal,"options.signal"),(async function*(){let Re=0;for await(let ze of this){var De;if(Ge!=null&&(De=Ge.signal)!==null&&De!==void 0&&De.aborted)throw new o({cause:Ge.signal.reason});yield[Re++,ze]}}).call(this)}async function ee(Ge,Re=void 0){for await(let De of se.call(this,Ge,Re))return!0;return!1}async function ae(Ge,Re=void 0){if(typeof Ge!="function")throw new n("fn",["Function","AsyncFunction"],Ge);return!await ee.call(this,async(...De)=>!await Ge(...De),Re)}async function ce(Ge,Re){for await(let De of se.call(this,Ge,Re))return De}async function re(Ge,Re){if(typeof Ge!="function")throw new n("fn",["Function","AsyncFunction"],Ge);async function De(ze,He){return await Ge(ze,He),Y}for await(let ze of J.call(this,De,Re));}function se(Ge,Re){if(typeof Ge!="function")throw new n("fn",["Function","AsyncFunction"],Ge);async function De(ze,He){return await Ge(ze,He)?ze:Y}return J.call(this,De,Re)}var fe=class extends s{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function me(Ge,Re,De){var ze;if(typeof Ge!="function")throw new n("reducer",["Function","AsyncFunction"],Ge);De!=null&&c(De,"options"),(De==null?void 0:De.signal)!=null&&l(De.signal,"options.signal");let He=arguments.length>1;if(De!=null&&(ze=De.signal)!==null&&ze!==void 0&&ze.aborted){let xt=new o(void 0,{cause:De.signal.reason});throw this.once("error",()=>{}),await p(this.destroy(xt)),xt}let Be=new t,Ke=Be.signal;if(De!=null&&De.signal){let xt={once:!0,[d]:this,[h]:!0};De.signal.addEventListener("abort",()=>Be.abort(),xt)}let ht=!1;try{for await(let xt of this){var St;if(ht=!0,De!=null&&(St=De.signal)!==null&&St!==void 0&&St.aborted)throw new o;He?Re=await Ge(Re,xt,{signal:Ke}):(Re=xt,He=!0)}if(!ht&&!He)throw new fe}finally{Be.abort()}return Re}async function oe(Ge){Ge!=null&&c(Ge,"options"),(Ge==null?void 0:Ge.signal)!=null&&l(Ge.signal,"options.signal");let Re=[];for await(let ze of this){var De;if(Ge!=null&&(De=Ge.signal)!==null&&De!==void 0&&De.aborted)throw new o(void 0,{cause:Ge.signal.reason});S(Re,ze)}return Re}function ve(Ge,Re){let De=J.call(this,Ge,Re);return(async function*(){for await(let ze of De)yield*ze}).call(this)}function ne(Ge){if(Ge=I(Ge),B(Ge))return 0;if(Ge<0)throw new a("number",">= 0",Ge);return Ge}function pe(Ge,Re=void 0){return Re!=null&&c(Re,"options"),(Re==null?void 0:Re.signal)!=null&&l(Re.signal,"options.signal"),Ge=ne(Ge),(async function*(){var De;if(Re!=null&&(De=Re.signal)!==null&&De!==void 0&&De.aborted)throw new o;for await(let He of this){var ze;if(Re!=null&&(ze=Re.signal)!==null&&ze!==void 0&&ze.aborted)throw new o;Ge--<=0&&(yield He)}}).call(this)}function Ae(Ge,Re=void 0){return Re!=null&&c(Re,"options"),(Re==null?void 0:Re.signal)!=null&&l(Re.signal,"options.signal"),Ge=ne(Ge),(async function*(){var De;if(Re!=null&&(De=Re.signal)!==null&&De!==void 0&&De.aborted)throw new o;for await(let He of this){var ze;if(Re!=null&&(ze=Re.signal)!==null&&ze!==void 0&&ze.aborted)throw new o;if(Ge-- >0&&(yield He),Ge<=0)return}}).call(this)}e.exports.streamReturningOperators={asIndexedPairs:E($,"readable.asIndexedPairs will be removed in a future version."),drop:pe,filter:se,flatMap:ve,map:J,take:Ae,compose:q},e.exports.promiseReturningOperators={every:ae,forEach:re,reduce:me,toArray:oe,some:ee,find:ce}}),uSr=Sn((i,e)=>{gn(),vn(),xn();var{ArrayPrototypePop:t,Promise:r}=e0(),{isIterable:n,isNodeStream:s,isWebStream:a}=c9(),{pipelineImpl:o}=Cit(),{finished:l}=XF();cSr();function u(...c){return new r((d,h)=>{let p,m,x=c[c.length-1];if(x&&typeof x=="object"&&!s(x)&&!n(x)&&!a(x)){let v=t(c);p=v.signal,m=v.end}o(c,(v,y)=>{v?h(v):d(y)},{signal:p,end:m})})}e.exports={finished:l,pipeline:u}}),cSr=Sn((i,e)=>{gn(),vn(),xn();var{Buffer:t}=(ng(),Ch(ig)),{ObjectDefineProperty:r,ObjectKeys:n,ReflectApply:s}=e0(),{promisify:{custom:a}}=by(),{streamReturningOperators:o,promiseReturningOperators:l}=ITn(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:u}}=N3(),c=lSr(),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:h}=$xe(),{pipeline:p}=Cit(),{destroyer:m}=kH(),x=XF(),v=uSr(),y=c9(),E=e.exports=Ait().Stream;E.isDestroyed=y.isDestroyed,E.isDisturbed=y.isDisturbed,E.isErrored=y.isErrored,E.isReadable=y.isReadable,E.isWritable=y.isWritable,E.Readable=e3e();for(let C of n(o)){let T=function(...B){if(new.target)throw u();return E.Readable.from(s(I,this,B))},I=o[C];r(T,"name",{__proto__:null,value:I.name}),r(T,"length",{__proto__:null,value:I.length}),r(E.Readable.prototype,C,{__proto__:null,value:T,enumerable:!1,configurable:!0,writable:!0})}for(let C of n(l)){let T=function(...B){if(new.target)throw u();return s(I,this,B)},I=l[C];r(T,"name",{__proto__:null,value:I.name}),r(T,"length",{__proto__:null,value:I.length}),r(E.Readable.prototype,C,{__proto__:null,value:T,enumerable:!1,configurable:!0,writable:!0})}E.Writable=Sit(),E.Duplex=d9(),E.Transform=aSr(),E.PassThrough=oSr(),E.pipeline=p;var{addAbortSignal:S}=Zxe();E.addAbortSignal=S,E.finished=x,E.destroy=m,E.compose=c,E.setDefaultHighWaterMark=d,E.getDefaultHighWaterMark=h,r(E,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return v}}),r(p,a,{__proto__:null,enumerable:!0,get(){return v.pipeline}}),r(x,a,{__proto__:null,enumerable:!0,get(){return v.finished}}),E.Stream=E,E._isUint8Array=function(C){return C instanceof Uint8Array},E._uint8ArrayToBuffer=function(C){return t.from(C.buffer,C.byteOffset,C.byteLength)}}),HO=Sn((i,e)=>{gn(),vn(),xn();var t=cSr(),r=uSr(),n=t.Readable.destroy;e.exports=t.Readable,e.exports._uint8ArrayToBuffer=t._uint8ArrayToBuffer,e.exports._isUint8Array=t._isUint8Array,e.exports.isDisturbed=t.isDisturbed,e.exports.isErrored=t.isErrored,e.exports.isReadable=t.isReadable,e.exports.Readable=t.Readable,e.exports.Writable=t.Writable,e.exports.Duplex=t.Duplex,e.exports.Transform=t.Transform,e.exports.PassThrough=t.PassThrough,e.exports.addAbortSignal=t.addAbortSignal,e.exports.finished=t.finished,e.exports.destroy=t.destroy,e.exports.destroy=n,e.exports.pipeline=t.pipeline,e.exports.compose=t.compose,Object.defineProperty(t,"promises",{configurable:!0,enumerable:!0,get(){return r}}),e.exports.Stream=t.Stream,e.exports.default=e.exports}),MTn=Sn((i,e)=>{gn(),vn(),xn(),typeof Object.create=="function"?e.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,r){if(r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}}}),BTn=Sn((i,e)=>{gn(),vn(),xn();var{Buffer:t}=(ng(),Ch(ig)),r=Symbol.for("BufferList");function n(s){if(!(this instanceof n))return new n(s);n._init.call(this,s)}n._init=function(s){Object.defineProperty(this,r,{value:!0}),this._bufs=[],this.length=0,s&&this.append(s)},n.prototype._new=function(s){return new n(s)},n.prototype._offset=function(s){if(s===0)return[0,0];let a=0;for(let o=0;o<this._bufs.length;o++){let l=a+this._bufs[o].length;if(s<l||o===this._bufs.length-1)return[o,s-a];a=l}},n.prototype._reverseOffset=function(s){let a=s[0],o=s[1];for(let l=0;l<a;l++)o+=this._bufs[l].length;return o},n.prototype.getBuffers=function(){return this._bufs},n.prototype.get=function(s){if(s>this.length||s<0)return;let a=this._offset(s);return this._bufs[a[0]][a[1]]},n.prototype.slice=function(s,a){return typeof s=="number"&&s<0&&(s+=this.length),typeof a=="number"&&a<0&&(a+=this.length),this.copy(null,0,s,a)},n.prototype.copy=function(s,a,o,l){if((typeof o!="number"||o<0)&&(o=0),(typeof l!="number"||l>this.length)&&(l=this.length),o>=this.length||l<=0)return s||t.alloc(0);let u=!!s,c=this._offset(o),d=l-o,h=d,p=u&&a||0,m=c[1];if(o===0&&l===this.length){if(!u)return this._bufs.length===1?this._bufs[0]:t.concat(this._bufs,this.length);for(let x=0;x<this._bufs.length;x++)this._bufs[x].copy(s,p),p+=this._bufs[x].length;return s}if(h<=this._bufs[c[0]].length-m)return u?this._bufs[c[0]].copy(s,a,m,m+h):this._bufs[c[0]].slice(m,m+h);u||(s=t.allocUnsafe(d));for(let x=c[0];x<this._bufs.length;x++){let v=this._bufs[x].length-m;if(h>v)this._bufs[x].copy(s,p,m),p+=v;else{this._bufs[x].copy(s,p,m,m+h),p+=v;break}h-=v,m&&(m=0)}return s.length>p?s.slice(0,p):s},n.prototype.shallowSlice=function(s,a){if(s=s||0,a=typeof a!="number"?this.length:a,s<0&&(s+=this.length),a<0&&(a+=this.length),s===a)return this._new();let o=this._offset(s),l=this._offset(a),u=this._bufs.slice(o[0],l[0]+1);return l[1]===0?u.pop():u[u.length-1]=u[u.length-1].slice(0,l[1]),o[1]!==0&&(u[0]=u[0].slice(o[1])),this._new(u)},n.prototype.toString=function(s,a,o){return this.slice(a,o).toString(s)},n.prototype.consume=function(s){if(s=Math.trunc(s),Number.isNaN(s)||s<=0)return this;for(;this._bufs.length;)if(s>=this._bufs[0].length)s-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(s),this.length-=s;break}return this},n.prototype.duplicate=function(){let s=this._new();for(let a=0;a<this._bufs.length;a++)s.append(this._bufs[a]);return s},n.prototype.append=function(s){return this._attach(s,n.prototype._appendBuffer)},n.prototype.prepend=function(s){return this._attach(s,n.prototype._prependBuffer,!0)},n.prototype._attach=function(s,a,o){if(s==null)return this;if(s.buffer)a.call(this,t.from(s.buffer,s.byteOffset,s.byteLength));else if(Array.isArray(s)){let[l,u]=o?[s.length-1,-1]:[0,1];for(let c=l;c>=0&&c<s.length;c+=u)this._attach(s[c],a,o)}else if(this._isBufferList(s)){let[l,u]=o?[s._bufs.length-1,-1]:[0,1];for(let c=l;c>=0&&c<s._bufs.length;c+=u)this._attach(s._bufs[c],a,o)}else typeof s=="number"&&(s=s.toString()),a.call(this,t.from(s));return this},n.prototype._appendBuffer=function(s){this._bufs.push(s),this.length+=s.length},n.prototype._prependBuffer=function(s){this._bufs.unshift(s),this.length+=s.length},n.prototype.indexOf=function(s,a,o){if(o===void 0&&typeof a=="string"&&(o=a,a=void 0),typeof s=="function"||Array.isArray(s))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof s=="number"?s=t.from([s]):typeof s=="string"?s=t.from(s,o):this._isBufferList(s)?s=s.slice():Array.isArray(s.buffer)?s=t.from(s.buffer,s.byteOffset,s.byteLength):t.isBuffer(s)||(s=t.from(s)),a=Number(a||0),isNaN(a)&&(a=0),a<0&&(a=this.length+a),a<0&&(a=0),s.length===0)return a>this.length?this.length:a;let l=this._offset(a),u=l[0],c=l[1];for(;u<this._bufs.length;u++){let d=this._bufs[u];for(;c<d.length;)if(d.length-c>=s.length){let h=d.indexOf(s,c);if(h!==-1)return this._reverseOffset([u,h]);c=d.length-s.length+1}else{let h=this._reverseOffset([u,c]);if(this._match(h,s))return h;c++}c=0}return-1},n.prototype._match=function(s,a){if(this.length-s<a.length)return!1;for(let o=0;o<a.length;o++)if(this.get(s+o)!==a[o])return!1;return!0},function(){let s={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 a in s)(function(o){s[o]===null?n.prototype[o]=function(l,u){return this.slice(l,l+u)[o](0,u)}:n.prototype[o]=function(l=0){return this.slice(l,l+s[o])[o](0)}})(a)}(),n.prototype._isBufferList=function(s){return s instanceof n||n.isBufferList(s)},n.isBufferList=function(s){return s!=null&&s[r]},e.exports=n}),OTn=Sn((i,e)=>{gn(),vn(),xn();var t=HO().Duplex,r=MTn(),n=BTn();function s(a){if(!(this instanceof s))return new s(a);if(typeof a=="function"){this._callback=a;let o=(function(l){this._callback&&(this._callback(l),this._callback=null)}).bind(this);this.on("pipe",function(l){l.on("error",o)}),this.on("unpipe",function(l){l.removeListener("error",o)}),a=null}n._init.call(this,a),t.call(this)}r(s,t),Object.assign(s.prototype,n.prototype),s.prototype._new=function(a){return new s(a)},s.prototype._write=function(a,o,l){this._appendBuffer(a),typeof l=="function"&&l()},s.prototype._read=function(a){if(!this.length)return this.push(null);a=Math.min(a,this.length),this.push(this.slice(0,a)),this.consume(a)},s.prototype.end=function(a){t.prototype.end.call(this,a),this._callback&&(this._callback(null,this.slice()),this._callback=null)},s.prototype._destroy=function(a,o){this._bufs.length=0,this.length=0,o(a)},s.prototype._isBufferList=function(a){return a instanceof s||a instanceof n||s.isBufferList(a)},s.isBufferList=n.isBufferList,e.exports=s,e.exports.BufferListStream=s,e.exports.BufferList=n}),LTn=Sn((i,e)=>{gn(),vn(),xn();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}};e.exports=t}),dSr=Sn((i,e)=>{gn(),vn(),xn();var t=e.exports,{Buffer:r}=(ng(),Ch(ig));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 s in t.requiredHeaderFlags){let a=t.requiredHeaderFlags[s];t.requiredHeaderFlagsErrors[s]="Invalid header flag bits, must be 0x"+a.toString(16)+" for "+t.types[s]+" packet"}t.codes={};for(let s in t.types){let a=t.types[s];t.codes[a]=s}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=r.from([t.SESSIONPRESENT_MASK]),t.CONNACK_HEADER=r.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=r.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 s in t.properties){let a=t.properties[s];t.propertiesCodes[a]=s}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 n(s){return[0,1,2].map(a=>[0,1].map(o=>[0,1].map(l=>{let u=r.alloc(1);return u.writeUInt8(t.codes[s]<<t.CMD_SHIFT|(o?t.DUP_MASK:0)|a<<t.QOS_SHIFT|l,0,!0),u})))}t.PUBLISH_HEADER=n("publish"),t.SUBSCRIBE_HEADER=n("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=n("unsubscribe"),t.ACKS={unsuback:n("unsuback"),puback:n("puback"),pubcomp:n("pubcomp"),pubrel:n("pubrel"),pubrec:n("pubrec")},t.SUBACK_HEADER=r.from([t.codes.suback<<t.CMD_SHIFT]),t.VERSION3=r.from([3]),t.VERSION4=r.from([4]),t.VERSION5=r.from([5]),t.VERSION131=r.from([131]),t.VERSION132=r.from([132]),t.QOS=[0,1,2].map(s=>r.from([s])),t.EMPTY={pingreq:r.from([t.codes.pingreq<<4,0]),pingresp:r.from([t.codes.pingresp<<4,0]),disconnect:r.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"}}),NTn=Sn((i,e)=>{gn(),vn(),xn();var t=1e3,r=t*60,n=r*60,s=n*24,a=s*7,o=s*365.25;e.exports=function(h,p){p=p||{};var m=typeof h;if(m==="string"&&h.length>0)return l(h);if(m==="number"&&isFinite(h))return p.long?c(h):u(h);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(h))};function l(h){if(h=String(h),!(h.length>100)){var p=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(h);if(p){var m=parseFloat(p[1]),x=(p[2]||"ms").toLowerCase();switch(x){case"years":case"year":case"yrs":case"yr":case"y":return m*o;case"weeks":case"week":case"w":return m*a;case"days":case"day":case"d":return m*s;case"hours":case"hour":case"hrs":case"hr":case"h":return m*n;case"minutes":case"minute":case"mins":case"min":case"m":return m*r;case"seconds":case"second":case"secs":case"sec":case"s":return m*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return m;default:return}}}}function u(h){var p=Math.abs(h);return p>=s?Math.round(h/s)+"d":p>=n?Math.round(h/n)+"h":p>=r?Math.round(h/r)+"m":p>=t?Math.round(h/t)+"s":h+"ms"}function c(h){var p=Math.abs(h);return p>=s?d(h,p,s,"day"):p>=n?d(h,p,n,"hour"):p>=r?d(h,p,r,"minute"):p>=t?d(h,p,t,"second"):h+" ms"}function d(h,p,m,x){var v=p>=m*1.5;return Math.round(h/m)+" "+x+(v?"s":"")}}),kTn=Sn((i,e)=>{gn(),vn(),xn();function t(r){s.debug=s,s.default=s,s.coerce=d,s.disable=u,s.enable=o,s.enabled=c,s.humanize=NTn(),s.destroy=h,Object.keys(r).forEach(p=>{s[p]=r[p]}),s.names=[],s.skips=[],s.formatters={};function n(p){let m=0;for(let x=0;x<p.length;x++)m=(m<<5)-m+p.charCodeAt(x),m|=0;return s.colors[Math.abs(m)%s.colors.length]}s.selectColor=n;function s(p){let m,x=null,v,y;function E(...S){if(!E.enabled)return;let C=E,T=Number(new Date),I=T-(m||T);C.diff=I,C.prev=m,C.curr=T,m=T,S[0]=s.coerce(S[0]),typeof S[0]!="string"&&S.unshift("%O");let B=0;S[0]=S[0].replace(/%([a-zA-Z%])/g,(O,L)=>{if(O==="%%")return"%";B++;let k=s.formatters[L];if(typeof k=="function"){let U=S[B];O=k.call(C,U),S.splice(B,1),B--}return O}),s.formatArgs.call(C,S),(C.log||s.log).apply(C,S)}return E.namespace=p,E.useColors=s.useColors(),E.color=s.selectColor(p),E.extend=a,E.destroy=s.destroy,Object.defineProperty(E,"enabled",{enumerable:!0,configurable:!1,get:()=>x!==null?x:(v!==s.namespaces&&(v=s.namespaces,y=s.enabled(p)),y),set:S=>{x=S}}),typeof s.init=="function"&&s.init(E),E}function a(p,m){let x=s(this.namespace+(typeof m>"u"?":":m)+p);return x.log=this.log,x}function o(p){s.save(p),s.namespaces=p,s.names=[],s.skips=[];let m=(typeof p=="string"?p:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let x of m)x[0]==="-"?s.skips.push(x.slice(1)):s.names.push(x)}function l(p,m){let x=0,v=0,y=-1,E=0;for(;x<p.length;)if(v<m.length&&(m[v]===p[x]||m[v]==="*"))m[v]==="*"?(y=v,E=x,v++):(x++,v++);else if(y!==-1)v=y+1,E++,x=E;else return!1;for(;v<m.length&&m[v]==="*";)v++;return v===m.length}function u(){let p=[...s.names,...s.skips.map(m=>"-"+m)].join(",");return s.enable(""),p}function c(p){for(let m of s.skips)if(l(p,m))return!1;for(let m of s.names)if(l(p,m))return!0;return!1}function d(p){return p instanceof Error?p.stack||p.message:p}function h(){}return s.enable(s.load()),s}e.exports=t}),h9=Sn((i,e)=>{gn(),vn(),xn(),i.formatArgs=r,i.save=n,i.load=s,i.useColors=t,i.storage=a(),i.destroy=(()=>{let l=!1;return()=>{l||(l=!0)}})(),i.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(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let l;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(l=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(l[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;let u="color: "+this.color;l.splice(1,0,u,"color: inherit");let c=0,d=0;l[0].replace(/%[a-zA-Z%]/g,h=>{h!=="%%"&&(c++,h==="%c"&&(d=c))}),l.splice(d,0,u)}i.log=console.debug||console.log||(()=>{});function n(l){try{l?i.storage.setItem("debug",l):i.storage.removeItem("debug")}catch{}}function s(){let l;try{l=i.storage.getItem("debug")||i.storage.getItem("DEBUG")}catch{}return!l&&typeof wd<"u"&&"env"in wd&&(l=wd.env.DEBUG),l}function a(){try{return localStorage}catch{}}e.exports=kTn()(i);var{formatters:o}=e.exports;o.j=function(l){try{return JSON.stringify(l)}catch(u){return"[UnexpectedJSONParseError]: "+u.message}}}),VTn=Sn((i,e)=>{gn(),vn(),xn();var t=OTn(),{EventEmitter:r}=(zO(),Ch(WF)),n=LTn(),s=dSr(),a=h9()("mqtt-packet:parser"),o=class D4t extends r{constructor(){super(),this.parser=this.constructor.parser}static parser(u){return this instanceof D4t?(this.settings=u||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new D4t().parser(u)}_resetState(){a("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new n,this.error=null,this._list=t(),this._stateCounter=0}parse(u){for(this.error&&this._resetState(),this._list.append(u),a("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++,a("parse: state complete. _stateCounter is now: %d",this._stateCounter),a("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return a("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){let u=this._list.readUInt8(0),c=u>>s.CMD_SHIFT;this.packet.cmd=s.types[c];let d=u&15,h=s.requiredHeaderFlags[c];return h!=null&&d!==h?this._emitError(new Error(s.requiredHeaderFlagsErrors[c])):(this.packet.retain=(u&s.RETAIN_MASK)!==0,this.packet.qos=u>>s.QOS_SHIFT&s.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=(u&s.DUP_MASK)!==0,a("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){let u=this._parseVarByteNum(!0);return u&&(this.packet.length=u.value,this._list.consume(u.bytes)),a("_parseLength %d",u.value),!!u}_parsePayload(){a("_parsePayload: payload %O",this._list);let u=!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"))}u=!0}return a("_parsePayload complete result: %s",u),u}_parseConnect(){a("_parseConnect");let u,c,d,h,p={},m=this.packet,x=this._parseString();if(x===null)return this._emitError(new Error("Cannot parse protocolId"));if(x!=="MQTT"&&x!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(m.protocolId=x,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(m.protocolVersion=this._list.readUInt8(this._pos),m.protocolVersion>=128&&(m.bridgeMode=!0,m.protocolVersion=m.protocolVersion-128),m.protocolVersion!==3&&m.protocolVersion!==4&&m.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"));p.username=this._list.readUInt8(this._pos)&s.USERNAME_MASK,p.password=this._list.readUInt8(this._pos)&s.PASSWORD_MASK,p.will=this._list.readUInt8(this._pos)&s.WILL_FLAG_MASK;let v=!!(this._list.readUInt8(this._pos)&s.WILL_RETAIN_MASK),y=(this._list.readUInt8(this._pos)&s.WILL_QOS_MASK)>>s.WILL_QOS_SHIFT;if(p.will)m.will={},m.will.retain=v,m.will.qos=y;else{if(v)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(y)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(m.clean=(this._list.readUInt8(this._pos)&s.CLEAN_SESSION_MASK)!==0,this._pos++,m.keepalive=this._parseNum(),m.keepalive===-1)return this._emitError(new Error("Packet too short"));if(m.protocolVersion===5){let S=this._parseProperties();Object.getOwnPropertyNames(S).length&&(m.properties=S)}let E=this._parseString();if(E===null)return this._emitError(new Error("Packet too short"));if(m.clientId=E,a("_parseConnect: packet.clientId: %s",m.clientId),p.will){if(m.protocolVersion===5){let S=this._parseProperties();Object.getOwnPropertyNames(S).length&&(m.will.properties=S)}if(u=this._parseString(),u===null)return this._emitError(new Error("Cannot parse will topic"));if(m.will.topic=u,a("_parseConnect: packet.will.topic: %s",m.will.topic),c=this._parseBuffer(),c===null)return this._emitError(new Error("Cannot parse will payload"));m.will.payload=c,a("_parseConnect: packet.will.paylaod: %s",m.will.payload)}if(p.username){if(h=this._parseString(),h===null)return this._emitError(new Error("Cannot parse username"));m.username=h,a("_parseConnect: packet.username: %s",m.username)}if(p.password){if(d=this._parseBuffer(),d===null)return this._emitError(new Error("Cannot parse password"));m.password=d}return this.settings=m,a("_parseConnect: complete"),m}_parseConnack(){a("_parseConnack");let u=this.packet;if(this._list.length<1)return null;let c=this._list.readUInt8(this._pos++);if(c>1)return this._emitError(new Error("Invalid connack flags, bits 7-1 must be set to 0"));if(u.sessionPresent=!!(c&s.SESSIONPRESENT_MASK),this.settings.protocolVersion===5)this._list.length>=2?u.reasonCode=this._list.readUInt8(this._pos++):u.reasonCode=0;else{if(this._list.length<2)return null;u.returnCode=this._list.readUInt8(this._pos++)}if(u.returnCode===-1||u.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){let d=this._parseProperties();Object.getOwnPropertyNames(d).length&&(u.properties=d)}a("_parseConnack: complete")}_parsePublish(){a("_parsePublish");let u=this.packet;if(u.topic=this._parseString(),u.topic===null)return this._emitError(new Error("Cannot parse topic"));if(!(u.qos>0&&!this._parseMessageId())){if(this.settings.protocolVersion===5){let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(u.properties=c)}u.payload=this._list.slice(this._pos,u.length),a("_parsePublish: payload from buffer list: %o",u.payload)}}_parseSubscribe(){a("_parseSubscribe");let u=this.packet,c,d,h,p,m,x,v;if(u.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let y=this._parseProperties();Object.getOwnPropertyNames(y).length&&(u.properties=y)}if(u.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<u.length;){if(c=this._parseString(),c===null)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=u.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(d=this._parseByte(),this.settings.protocolVersion===5){if(d&192)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(d&252)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(h=d&s.SUBSCRIBE_OPTIONS_QOS_MASK,h>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(x=(d>>s.SUBSCRIBE_OPTIONS_NL_SHIFT&s.SUBSCRIBE_OPTIONS_NL_MASK)!==0,m=(d>>s.SUBSCRIBE_OPTIONS_RAP_SHIFT&s.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,p=d>>s.SUBSCRIBE_OPTIONS_RH_SHIFT&s.SUBSCRIBE_OPTIONS_RH_MASK,p>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));v={topic:c,qos:h},this.settings.protocolVersion===5?(v.nl=x,v.rap=m,v.rh=p):this.settings.bridgeMode&&(v.rh=0,v.rap=!0,v.nl=!0),a("_parseSubscribe: push subscription `%s` to subscription",v),u.subscriptions.push(v)}}}_parseSuback(){a("_parseSuback");let u=this.packet;if(this.packet.granted=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(u.properties=c)}if(u.length<=0)return this._emitError(new Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){let c=this._list.readUInt8(this._pos++);if(this.settings.protocolVersion===5){if(!s.MQTT5_SUBACK_CODES[c])return this._emitError(new Error("Invalid suback code"))}else if(c>2&&c!==128)return this._emitError(new Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(c)}}}_parseUnsubscribe(){a("_parseUnsubscribe");let u=this.packet;if(u.unsubscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(u.properties=c)}if(u.length<=0)return this._emitError(new Error("Malformed unsubscribe, no payload specified"));for(;this._pos<u.length;){let c=this._parseString();if(c===null)return this._emitError(new Error("Cannot parse topic"));a("_parseUnsubscribe: push topic `%s` to unsubscriptions",c),u.unsubscriptions.push(c)}}}_parseUnsuback(){a("_parseUnsuback");let u=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if((this.settings.protocolVersion===3||this.settings.protocolVersion===4)&&u.length!==2)return this._emitError(new Error("Malformed unsuback, payload length must be 2"));if(u.length<=0)return this._emitError(new Error("Malformed unsuback, no payload specified"));if(this.settings.protocolVersion===5){let c=this._parseProperties();for(Object.getOwnPropertyNames(c).length&&(u.properties=c),u.granted=[];this._pos<this.packet.length;){let d=this._list.readUInt8(this._pos++);if(!s.MQTT5_UNSUBACK_CODES[d])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(d)}}}_parseConfirmation(){a("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);let u=this.packet;if(this._parseMessageId(),this.settings.protocolVersion===5){if(u.length>2){switch(u.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!s.MQTT5_PUBACK_PUBREC_CODES[u.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!s.MQTT5_PUBREL_PUBCOMP_CODES[u.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break}a("_parseConfirmation: packet.reasonCode `%d`",u.reasonCode)}else u.reasonCode=0;if(u.length>3){let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(u.properties=c)}}return!0}_parseDisconnect(){let u=this.packet;if(a("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?(u.reasonCode=this._parseByte(),s.MQTT5_DISCONNECT_CODES[u.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):u.reasonCode=0;let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(u.properties=c)}return a("_parseDisconnect result: true"),!0}_parseAuth(){a("_parseAuth");let u=this.packet;if(this.settings.protocolVersion!==5)return this._emitError(new Error("Not supported auth packet for this version MQTT"));if(u.reasonCode=this._parseByte(),!s.MQTT5_AUTH_CODES[u.reasonCode])return this._emitError(new Error("Invalid auth reason code"));let c=this._parseProperties();return Object.getOwnPropertyNames(c).length&&(u.properties=c),a("_parseAuth: result: true"),!0}_parseMessageId(){let u=this.packet;return u.messageId=this._parseNum(),u.messageId===null?(this._emitError(new Error("Cannot parse messageId")),!1):(a("_parseMessageId: packet.messageId %d",u.messageId),!0)}_parseString(u){let c=this._parseNum(),d=c+this._pos;if(c===-1||d>this._list.length||d>this.packet.length)return null;let h=this._list.toString("utf8",this._pos,d);return this._pos+=c,a("_parseString: result: %s",h),h}_parseStringPair(){return a("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){let u=this._parseNum(),c=u+this._pos;if(u===-1||c>this._list.length||c>this.packet.length)return null;let d=this._list.slice(this._pos,c);return this._pos+=u,a("_parseBuffer: result: %o",d),d}_parseNum(){if(this._list.length-this._pos<2)return-1;let u=this._list.readUInt16BE(this._pos);return this._pos+=2,a("_parseNum: result: %s",u),u}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;let u=this._list.readUInt32BE(this._pos);return this._pos+=4,a("_parse4ByteNum: result: %s",u),u}_parseVarByteNum(u){a("_parseVarByteNum");let c=4,d=0,h=1,p=0,m=!1,x,v=this._pos?this._pos:0;for(;d<c&&v+d<this._list.length;){if(x=this._list.readUInt8(v+d++),p+=h*(x&s.VARBYTEINT_MASK),h*=128,(x&s.VARBYTEINT_FIN_MASK)===0){m=!0;break}if(this._list.length<=d)break}return!m&&d===c&&this._list.length>=d&&this._emitError(new Error("Invalid variable byte integer")),v&&(this._pos+=d),m?u?m={bytes:d,value:p}:m=p:m=!1,a("_parseVarByteNum: result: %o",m),m}_parseByte(){let u;return this._pos<this._list.length&&(u=this._list.readUInt8(this._pos),this._pos++),a("_parseByte: result: %o",u),u}_parseByType(u){switch(a("_parseByType: type: %s",u),u){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(){a("_parseProperties");let u=this._parseVarByteNum(),c=this._pos+u,d={};for(;this._pos<c;){let h=this._parseByte();if(!h)return this._emitError(new Error("Cannot parse property code type")),!1;let p=s.propertiesCodes[h];if(!p)return this._emitError(new Error("Unknown property")),!1;if(p==="userProperties"){d[p]||(d[p]=Object.create(null));let m=this._parseByType(s.propertiesTypes[p]);if(d[p][m.name])if(Array.isArray(d[p][m.name]))d[p][m.name].push(m.value);else{let x=d[p][m.name];d[p][m.name]=[x],d[p][m.name].push(m.value)}else d[p][m.name]=m.value;continue}d[p]?Array.isArray(d[p])?d[p].push(this._parseByType(s.propertiesTypes[p])):(d[p]=[d[p]],d[p].push(this._parseByType(s.propertiesTypes[p]))):d[p]=this._parseByType(s.propertiesTypes[p])}return d}_newPacket(){return a("_newPacket"),this.packet&&(this._list.consume(this.packet.length),a("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d",this.packet.cmd,this.packet.payload,this.packet.length),this.emit("packet",this.packet)),a("_newPacket: new packet"),this.packet=new n,this._pos=0,!0}_emitError(u){a("_emitError",u),this.error=u,this.emit("error",u)}};e.exports=o}),UTn=Sn((i,e)=>{gn(),vn(),xn();var{Buffer:t}=(ng(),Ch(ig)),r=65536,n={},s=t.isBuffer(t.from([1,2]).subarray(0,1));function a(c){let d=t.allocUnsafe(2);return d.writeUInt8(c>>8,0),d.writeUInt8(c&255,1),d}function o(){for(let c=0;c<r;c++)n[c]=a(c)}function l(c){let d=0,h=0,p=t.allocUnsafe(4);do d=c%128|0,c=c/128|0,c>0&&(d=d|128),p.writeUInt8(d,h++);while(c>0&&h<4);return c>0&&(h=0),s?p.subarray(0,h):p.slice(0,h)}function u(c){let d=t.allocUnsafe(4);return d.writeUInt32BE(c,0),d}e.exports={cache:n,generateCache:o,generateNumber:a,genBufVariableByteInt:l,generate4ByteBuffer:u}}),GTn=Sn((i,e)=>{gn(),vn(),xn(),typeof wd>"u"||!wd.version||wd.version.indexOf("v0.")===0||wd.version.indexOf("v1.")===0&&wd.version.indexOf("v1.8.")!==0?e.exports={nextTick:t}:e.exports=wd;function t(r,n,s,a){if(typeof r!="function")throw new TypeError('"callback" argument must be a function');var o=arguments.length,l,u;switch(o){case 0:case 1:return wd.nextTick(r);case 2:return wd.nextTick(function(){r.call(null,n)});case 3:return wd.nextTick(function(){r.call(null,n,s)});case 4:return wd.nextTick(function(){r.call(null,n,s,a)});default:for(l=new Array(o-1),u=0;u<l.length;)l[u++]=arguments[u];return wd.nextTick(function(){r.apply(null,l)})}}}),hSr=Sn((i,e)=>{gn(),vn(),xn();var t=dSr(),{Buffer:r}=(ng(),Ch(ig)),n=r.allocUnsafe(0),s=r.from([0]),a=UTn(),o=GTn().nextTick,l=h9()("mqtt-packet:writeToStream"),u=a.cache,c=a.generateNumber,d=a.generateCache,h=a.genBufVariableByteInt,p=a.generate4ByteBuffer,m=$,x=!0;function v(ne,pe,Ae){switch(l("generate called"),pe.cork&&(pe.cork(),o(y,pe)),x&&(x=!1,d()),l("generate: packet.cmd: %s",ne.cmd),ne.cmd){case"connect":return E(ne,pe);case"connack":return S(ne,pe,Ae);case"publish":return C(ne,pe,Ae);case"puback":case"pubrec":case"pubrel":case"pubcomp":return T(ne,pe,Ae);case"subscribe":return I(ne,pe,Ae);case"suback":return B(ne,pe,Ae);case"unsubscribe":return O(ne,pe,Ae);case"unsuback":return L(ne,pe,Ae);case"pingreq":case"pingresp":return k(ne,pe);case"disconnect":return U(ne,pe,Ae);case"auth":return j(ne,pe,Ae);default:return pe.destroy(new Error("Unknown command")),!1}}Object.defineProperty(v,"cacheNumbers",{get(){return m===$},set(ne){ne?((!u||Object.keys(u).length===0)&&(x=!0),m=$):(x=!1,m=ee)}});function y(ne){ne.uncork()}function E(ne,pe,Ae){let Ge=ne||{},Re=Ge.protocolId||"MQTT",De=Ge.protocolVersion||4,ze=Ge.will,He=Ge.clean,Be=Ge.keepalive||0,Ke=Ge.clientId||"",ht=Ge.username,St=Ge.password,xt=Ge.properties;He===void 0&&(He=!0);let Vt=0;if(typeof Re!="string"&&!r.isBuffer(Re))return pe.destroy(new Error("Invalid protocolId")),!1;if(Vt+=Re.length+2,De!==3&&De!==4&&De!==5)return pe.destroy(new Error("Invalid protocol version")),!1;if(Vt+=1,(typeof Ke=="string"||r.isBuffer(Ke))&&(Ke||De>=4)&&(Ke||He))Vt+=r.byteLength(Ke)+2;else{if(De<4)return pe.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(He*1===0)return pe.destroy(new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof Be!="number"||Be<0||Be>65535||Be%1!==0)return pe.destroy(new Error("Invalid keepalive")),!1;Vt+=2,Vt+=1;let bt,$t;if(De===5){if(bt=re(pe,xt),!bt)return!1;Vt+=bt.length}if(ze){if(typeof ze!="object")return pe.destroy(new Error("Invalid will")),!1;if(!ze.topic||typeof ze.topic!="string")return pe.destroy(new Error("Invalid will topic")),!1;if(Vt+=r.byteLength(ze.topic)+2,Vt+=2,ze.payload)if(ze.payload.length>=0)typeof ze.payload=="string"?Vt+=r.byteLength(ze.payload):Vt+=ze.payload.length;else return pe.destroy(new Error("Invalid will payload")),!1;if($t={},De===5){if($t=re(pe,ze.properties),!$t)return!1;Vt+=$t.length}}let Xe=!1;if(ht!=null)if(ve(ht))Xe=!0,Vt+=r.byteLength(ht)+2;else return pe.destroy(new Error("Invalid username")),!1;if(St!=null){if(!Xe)return pe.destroy(new Error("Username is required to use password")),!1;if(ve(St))Vt+=oe(St)+2;else return pe.destroy(new Error("Invalid password")),!1}pe.write(t.CONNECT_HEADER),X(pe,Vt),ce(pe,Re),Ge.bridgeMode&&(De+=128),pe.write(De===131?t.VERSION131:De===132?t.VERSION132:De===4?t.VERSION4:De===5?t.VERSION5:t.VERSION3);let Oe=0;return Oe|=ht!=null?t.USERNAME_MASK:0,Oe|=St!=null?t.PASSWORD_MASK:0,Oe|=ze&&ze.retain?t.WILL_RETAIN_MASK:0,Oe|=ze&&ze.qos?ze.qos<<t.WILL_QOS_SHIFT:0,Oe|=ze?t.WILL_FLAG_MASK:0,Oe|=He?t.CLEAN_SESSION_MASK:0,pe.write(r.from([Oe])),m(pe,Be),De===5&&bt.write(),ce(pe,Ke),ze&&(De===5&&$t.write(),q(pe,ze.topic),ce(pe,ze.payload)),ht!=null&&ce(pe,ht),St!=null&&ce(pe,St),!0}function S(ne,pe,Ae){let Ge=Ae?Ae.protocolVersion:4,Re=ne||{},De=Ge===5?Re.reasonCode:Re.returnCode,ze=Re.properties,He=2;if(typeof De!="number")return pe.destroy(new Error("Invalid return code")),!1;let Be=null;if(Ge===5){if(Be=re(pe,ze),!Be)return!1;He+=Be.length}return pe.write(t.CONNACK_HEADER),X(pe,He),pe.write(Re.sessionPresent?t.SESSIONPRESENT_HEADER:s),pe.write(r.from([De])),Be==null||Be.write(),!0}function C(ne,pe,Ae){l("publish: packet: %o",ne);let Ge=Ae?Ae.protocolVersion:4,Re=ne||{},De=Re.qos||0,ze=Re.retain?t.RETAIN_MASK:0,He=Re.topic,Be=Re.payload||n,Ke=Re.messageId,ht=Re.properties,St=0;if(typeof He=="string")St+=r.byteLength(He)+2;else if(r.isBuffer(He))St+=He.length+2;else return pe.destroy(new Error("Invalid topic")),!1;if(r.isBuffer(Be)?St+=Be.length:St+=r.byteLength(Be),De&&typeof Ke!="number")return pe.destroy(new Error("Invalid messageId")),!1;De&&(St+=2);let xt=null;if(Ge===5){if(xt=re(pe,ht),!xt)return!1;St+=xt.length}return pe.write(t.PUBLISH_HEADER[De][Re.dup?1:0][ze?1:0]),X(pe,St),m(pe,oe(He)),pe.write(He),De>0&&m(pe,Ke),xt==null||xt.write(),l("publish: payload: %o",Be),pe.write(Be)}function T(ne,pe,Ae){let Ge=Ae?Ae.protocolVersion:4,Re=ne||{},De=Re.cmd||"puback",ze=Re.messageId,He=Re.dup&&De==="pubrel"?t.DUP_MASK:0,Be=0,Ke=Re.reasonCode,ht=Re.properties,St=Ge===5?3:2;if(De==="pubrel"&&(Be=1),typeof ze!="number")return pe.destroy(new Error("Invalid messageId")),!1;let xt=null;if(Ge===5&&typeof ht=="object"){if(xt=se(pe,ht,Ae,St),!xt)return!1;St+=xt.length}return pe.write(t.ACKS[De][Be][He][0]),St===3&&(St+=Ke!==0?1:-1),X(pe,St),m(pe,ze),Ge===5&&St!==2&&pe.write(r.from([Ke])),xt!==null?xt.write():St===4&&pe.write(r.from([0])),!0}function I(ne,pe,Ae){l("subscribe: packet: ");let Ge=Ae?Ae.protocolVersion:4,Re=ne||{},De=Re.dup?t.DUP_MASK:0,ze=Re.messageId,He=Re.subscriptions,Be=Re.properties,Ke=0;if(typeof ze!="number")return pe.destroy(new Error("Invalid messageId")),!1;Ke+=2;let ht=null;if(Ge===5){if(ht=re(pe,Be),!ht)return!1;Ke+=ht.length}if(typeof He=="object"&&He.length)for(let xt=0;xt<He.length;xt+=1){let Vt=He[xt].topic,bt=He[xt].qos;if(typeof Vt!="string")return pe.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if(typeof bt!="number")return pe.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(Ge===5){if(typeof(He[xt].nl||!1)!="boolean")return pe.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(He[xt].rap||!1)!="boolean")return pe.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;let $t=He[xt].rh||0;if(typeof $t!="number"||$t>2)return pe.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}Ke+=r.byteLength(Vt)+2+1}else return pe.destroy(new Error("Invalid subscriptions")),!1;l("subscribe: writing to stream: %o",t.SUBSCRIBE_HEADER),pe.write(t.SUBSCRIBE_HEADER[1][De?1:0][0]),X(pe,Ke),m(pe,ze),ht!==null&&ht.write();let St=!0;for(let xt of He){let Vt=xt.topic,bt=xt.qos,$t=+xt.nl,Xe=+xt.rap,Oe=xt.rh,ft;q(pe,Vt),ft=t.SUBSCRIBE_OPTIONS_QOS[bt],Ge===5&&(ft|=$t?t.SUBSCRIBE_OPTIONS_NL:0,ft|=Xe?t.SUBSCRIBE_OPTIONS_RAP:0,ft|=Oe?t.SUBSCRIBE_OPTIONS_RH[Oe]:0),St=pe.write(r.from([ft]))}return St}function B(ne,pe,Ae){let Ge=Ae?Ae.protocolVersion:4,Re=ne||{},De=Re.messageId,ze=Re.granted,He=Re.properties,Be=0;if(typeof De!="number")return pe.destroy(new Error("Invalid messageId")),!1;if(Be+=2,typeof ze=="object"&&ze.length)for(let ht=0;ht<ze.length;ht+=1){if(typeof ze[ht]!="number")return pe.destroy(new Error("Invalid qos vector")),!1;Be+=1}else return pe.destroy(new Error("Invalid qos vector")),!1;let Ke=null;if(Ge===5){if(Ke=se(pe,He,Ae,Be),!Ke)return!1;Be+=Ke.length}return pe.write(t.SUBACK_HEADER),X(pe,Be),m(pe,De),Ke!==null&&Ke.write(),pe.write(r.from(ze))}function O(ne,pe,Ae){let Ge=Ae?Ae.protocolVersion:4,Re=ne||{},De=Re.messageId,ze=Re.dup?t.DUP_MASK:0,He=Re.unsubscriptions,Be=Re.properties,Ke=0;if(typeof De!="number")return pe.destroy(new Error("Invalid messageId")),!1;if(Ke+=2,typeof He=="object"&&He.length)for(let xt=0;xt<He.length;xt+=1){if(typeof He[xt]!="string")return pe.destroy(new Error("Invalid unsubscriptions")),!1;Ke+=r.byteLength(He[xt])+2}else return pe.destroy(new Error("Invalid unsubscriptions")),!1;let ht=null;if(Ge===5){if(ht=re(pe,Be),!ht)return!1;Ke+=ht.length}pe.write(t.UNSUBSCRIBE_HEADER[1][ze?1:0][0]),X(pe,Ke),m(pe,De),ht!==null&&ht.write();let St=!0;for(let xt=0;xt<He.length;xt++)St=q(pe,He[xt]);return St}function L(ne,pe,Ae){let Ge=Ae?Ae.protocolVersion:4,Re=ne||{},De=Re.messageId,ze=Re.dup?t.DUP_MASK:0,He=Re.granted,Be=Re.properties,Ke=Re.cmd,ht=0,St=2;if(typeof De!="number")return pe.destroy(new Error("Invalid messageId")),!1;if(Ge===5)if(typeof He=="object"&&He.length)for(let Vt=0;Vt<He.length;Vt+=1){if(typeof He[Vt]!="number")return pe.destroy(new Error("Invalid qos vector")),!1;St+=1}else return pe.destroy(new Error("Invalid qos vector")),!1;let xt=null;if(Ge===5){if(xt=se(pe,Be,Ae,St),!xt)return!1;St+=xt.length}return pe.write(t.ACKS[Ke][ht][ze][0]),X(pe,St),m(pe,De),xt!==null&&xt.write(),Ge===5&&pe.write(r.from(He)),!0}function k(ne,pe,Ae){return pe.write(t.EMPTY[ne.cmd])}function U(ne,pe,Ae){let Ge=Ae?Ae.protocolVersion:4,Re=ne||{},De=Re.reasonCode,ze=Re.properties,He=Ge===5?1:0,Be=null;if(Ge===5){if(Be=se(pe,ze,Ae,He),!Be)return!1;He+=Be.length}return pe.write(r.from([t.codes.disconnect<<4])),X(pe,He),Ge===5&&pe.write(r.from([De])),Be!==null&&Be.write(),!0}function j(ne,pe,Ae){let Ge=Ae?Ae.protocolVersion:4,Re=ne||{},De=Re.reasonCode,ze=Re.properties,He=Ge===5?1:0;Ge!==5&&pe.destroy(new Error("Invalid mqtt version for auth packet"));let Be=se(pe,ze,Ae,He);return Be?(He+=Be.length,pe.write(r.from([t.codes.auth<<4])),X(pe,He),pe.write(r.from([De])),Be!==null&&Be.write(),!0):!1}var Y={};function X(ne,pe){if(pe>t.VARBYTEINT_MAX)return ne.destroy(new Error(`Invalid variable byte integer: ${pe}`)),!1;let Ae=Y[pe];return Ae||(Ae=h(pe),pe<16384&&(Y[pe]=Ae)),l("writeVarByteInt: writing to stream: %o",Ae),ne.write(Ae)}function q(ne,pe){let Ae=r.byteLength(pe);return m(ne,Ae),l("writeString: %s",pe),ne.write(pe,"utf8")}function J(ne,pe,Ae){q(ne,pe),q(ne,Ae)}function $(ne,pe){return l("writeNumberCached: number: %d",pe),l("writeNumberCached: %o",u[pe]),ne.write(u[pe])}function ee(ne,pe){let Ae=c(pe);return l("writeNumberGenerated: %o",Ae),ne.write(Ae)}function ae(ne,pe){let Ae=p(pe);return l("write4ByteNumber: %o",Ae),ne.write(Ae)}function ce(ne,pe){typeof pe=="string"?q(ne,pe):pe?(m(ne,pe.length),ne.write(pe)):m(ne,0)}function re(ne,pe){if(typeof pe!="object"||pe.length!=null)return{length:1,write(){me(ne,{},0)}};let Ae=0;function Ge(Re,De){let ze=t.propertiesTypes[Re],He=0;switch(ze){case"byte":{if(typeof De!="boolean")return ne.destroy(new Error(`Invalid ${Re}: ${De}`)),!1;He+=2;break}case"int8":{if(typeof De!="number"||De<0||De>255)return ne.destroy(new Error(`Invalid ${Re}: ${De}`)),!1;He+=2;break}case"binary":{if(De&&De===null)return ne.destroy(new Error(`Invalid ${Re}: ${De}`)),!1;He+=1+r.byteLength(De)+2;break}case"int16":{if(typeof De!="number"||De<0||De>65535)return ne.destroy(new Error(`Invalid ${Re}: ${De}`)),!1;He+=3;break}case"int32":{if(typeof De!="number"||De<0||De>4294967295)return ne.destroy(new Error(`Invalid ${Re}: ${De}`)),!1;He+=5;break}case"var":{if(typeof De!="number"||De<0||De>268435455)return ne.destroy(new Error(`Invalid ${Re}: ${De}`)),!1;He+=1+r.byteLength(h(De));break}case"string":{if(typeof De!="string")return ne.destroy(new Error(`Invalid ${Re}: ${De}`)),!1;He+=3+r.byteLength(De.toString());break}case"pair":{if(typeof De!="object")return ne.destroy(new Error(`Invalid ${Re}: ${De}`)),!1;He+=Object.getOwnPropertyNames(De).reduce((Be,Ke)=>{let ht=De[Ke];return Array.isArray(ht)?Be+=ht.reduce((St,xt)=>(St+=3+r.byteLength(Ke.toString())+2+r.byteLength(xt.toString()),St),0):Be+=3+r.byteLength(Ke.toString())+2+r.byteLength(De[Ke].toString()),Be},0);break}default:return ne.destroy(new Error(`Invalid property ${Re}: ${De}`)),!1}return He}if(pe)for(let Re in pe){let De=0,ze=0,He=pe[Re];if(He!==void 0){if(Array.isArray(He))for(let Be=0;Be<He.length;Be++){if(ze=Ge(Re,He[Be]),!ze)return!1;De+=ze}else{if(ze=Ge(Re,He),!ze)return!1;De=ze}if(!De)return!1;Ae+=De}}return{length:r.byteLength(h(Ae))+Ae,write(){me(ne,pe,Ae)}}}function se(ne,pe,Ae,Ge){let Re=["reasonString","userProperties"],De=Ae&&Ae.properties&&Ae.properties.maximumPacketSize?Ae.properties.maximumPacketSize:0,ze=re(ne,pe);if(De)for(;Ge+ze.length>De;){let He=Re.shift();if(He&&pe[He])delete pe[He],ze=re(ne,pe);else return!1}return ze}function fe(ne,pe,Ae){switch(t.propertiesTypes[pe]){case"byte":{ne.write(r.from([t.properties[pe]])),ne.write(r.from([+Ae]));break}case"int8":{ne.write(r.from([t.properties[pe]])),ne.write(r.from([Ae]));break}case"binary":{ne.write(r.from([t.properties[pe]])),ce(ne,Ae);break}case"int16":{ne.write(r.from([t.properties[pe]])),m(ne,Ae);break}case"int32":{ne.write(r.from([t.properties[pe]])),ae(ne,Ae);break}case"var":{ne.write(r.from([t.properties[pe]])),X(ne,Ae);break}case"string":{ne.write(r.from([t.properties[pe]])),q(ne,Ae);break}case"pair":{Object.getOwnPropertyNames(Ae).forEach(Ge=>{let Re=Ae[Ge];Array.isArray(Re)?Re.forEach(De=>{ne.write(r.from([t.properties[pe]])),J(ne,Ge.toString(),De.toString())}):(ne.write(r.from([t.properties[pe]])),J(ne,Ge.toString(),Re.toString()))});break}default:return ne.destroy(new Error(`Invalid property ${pe} value: ${Ae}`)),!1}}function me(ne,pe,Ae){X(ne,Ae);for(let Ge in pe)if(Object.prototype.hasOwnProperty.call(pe,Ge)&&pe[Ge]!=null){let Re=pe[Ge];if(Array.isArray(Re))for(let De=0;De<Re.length;De++)fe(ne,Ge,Re[De]);else fe(ne,Ge,Re)}}function oe(ne){return ne?ne instanceof r?ne.length:r.byteLength(ne):0}function ve(ne){return typeof ne=="string"||ne instanceof r}e.exports=v}),zTn=Sn((i,e)=>{gn(),vn(),xn();var t=hSr(),{EventEmitter:r}=(zO(),Ch(WF)),{Buffer:n}=(ng(),Ch(ig));function s(o,l){let u=new a;return t(o,u,l),u.concat()}var a=class extends r{constructor(){super(),this._array=new Array(20),this._i=0}write(o){return this._array[this._i++]=o,!0}concat(){let o=0,l=new Array(this._array.length),u=this._array,c=0,d;for(d=0;d<u.length&&u[d]!==void 0;d++)typeof u[d]!="string"?l[d]=u[d].length:l[d]=n.byteLength(u[d]),o+=l[d];let h=n.allocUnsafe(o);for(d=0;d<u.length&&u[d]!==void 0;d++)typeof u[d]!="string"?(u[d].copy(h,c),c+=l[d]):(h.write(u[d],c),c+=l[d]);return h}destroy(o){o&&this.emit("error",o)}};e.exports=s}),jTn=Sn(i=>{gn(),vn(),xn(),i.parser=VTn().parser,i.generate=zTn(),i.writeToStream=hSr()}),HTn=Sn((i,e)=>{gn(),vn(),xn(),e.exports=r;function t(s){return s instanceof Jxe?Jxe.from(s):new s.constructor(s.buffer.slice(),s.byteOffset,s.length)}function r(s){if(s=s||{},s.circles)return n(s);let a=new Map;if(a.set(Date,d=>new Date(d)),a.set(Map,(d,h)=>new Map(l(Array.from(d),h))),a.set(Set,(d,h)=>new Set(l(Array.from(d),h))),s.constructorHandlers)for(let d of s.constructorHandlers)a.set(d[0],d[1]);let o=null;return s.proto?c:u;function l(d,h){let p=Object.keys(d),m=new Array(p.length);for(let x=0;x<p.length;x++){let v=p[x],y=d[v];typeof y!="object"||y===null?m[v]=y:y.constructor!==Object&&(o=a.get(y.constructor))?m[v]=o(y,h):ArrayBuffer.isView(y)?m[v]=t(y):m[v]=h(y)}return m}function u(d){if(typeof d!="object"||d===null)return d;if(Array.isArray(d))return l(d,u);if(d.constructor!==Object&&(o=a.get(d.constructor)))return o(d,u);let h={};for(let p in d){if(Object.hasOwnProperty.call(d,p)===!1)continue;let m=d[p];typeof m!="object"||m===null?h[p]=m:m.constructor!==Object&&(o=a.get(m.constructor))?h[p]=o(m,u):ArrayBuffer.isView(m)?h[p]=t(m):h[p]=u(m)}return h}function c(d){if(typeof d!="object"||d===null)return d;if(Array.isArray(d))return l(d,c);if(d.constructor!==Object&&(o=a.get(d.constructor)))return o(d,c);let h={};for(let p in d){let m=d[p];typeof m!="object"||m===null?h[p]=m:m.constructor!==Object&&(o=a.get(m.constructor))?h[p]=o(m,c):ArrayBuffer.isView(m)?h[p]=t(m):h[p]=c(m)}return h}}function n(s){let a=[],o=[],l=new Map;if(l.set(Date,p=>new Date(p)),l.set(Map,(p,m)=>new Map(c(Array.from(p),m))),l.set(Set,(p,m)=>new Set(c(Array.from(p),m))),s.constructorHandlers)for(let p of s.constructorHandlers)l.set(p[0],p[1]);let u=null;return s.proto?h:d;function c(p,m){let x=Object.keys(p),v=new Array(x.length);for(let y=0;y<x.length;y++){let E=x[y],S=p[E];if(typeof S!="object"||S===null)v[E]=S;else if(S.constructor!==Object&&(u=l.get(S.constructor)))v[E]=u(S,m);else if(ArrayBuffer.isView(S))v[E]=t(S);else{let C=a.indexOf(S);C!==-1?v[E]=o[C]:v[E]=m(S)}}return v}function d(p){if(typeof p!="object"||p===null)return p;if(Array.isArray(p))return c(p,d);if(p.constructor!==Object&&(u=l.get(p.constructor)))return u(p,d);let m={};a.push(p),o.push(m);for(let x in p){if(Object.hasOwnProperty.call(p,x)===!1)continue;let v=p[x];if(typeof v!="object"||v===null)m[x]=v;else if(v.constructor!==Object&&(u=l.get(v.constructor)))m[x]=u(v,d);else if(ArrayBuffer.isView(v))m[x]=t(v);else{let y=a.indexOf(v);y!==-1?m[x]=o[y]:m[x]=d(v)}}return a.pop(),o.pop(),m}function h(p){if(typeof p!="object"||p===null)return p;if(Array.isArray(p))return c(p,h);if(p.constructor!==Object&&(u=l.get(p.constructor)))return u(p,h);let m={};a.push(p),o.push(m);for(let x in p){let v=p[x];if(typeof v!="object"||v===null)m[x]=v;else if(v.constructor!==Object&&(u=l.get(v.constructor)))m[x]=u(v,h);else if(ArrayBuffer.isView(v))m[x]=t(v);else{let y=a.indexOf(v);y!==-1?m[x]=o[y]:m[x]=h(v)}}return a.pop(),o.pop(),m}}}),WTn=Sn((i,e)=>{gn(),vn(),xn(),e.exports=HTn()()}),XTn=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"__esModule",{value:!0}),i.validateTopic=e,i.validateTopics=t;function e(r){let n=r.split("/");for(let s=0;s<n.length;s++)if(n[s]!=="+"){if(n[s]==="#")return s===n.length-1;if(n[s].indexOf("+")!==-1||n[s].indexOf("#")!==-1)return!1}return!0}function t(r){if(r.length===0)return"empty_topic_list";for(let n=0;n<r.length;n++)if(!e(r[n]))return r[n];return null}}),fSr=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"__esModule",{value:!0});var e=HO(),t={objectMode:!0},r={clean:!0},n=class{constructor(s){pr(this,"options");pr(this,"_inflights");this.options=s||{},this.options={...r,...s},this._inflights=new Map}put(s,a){return this._inflights.set(s.messageId,s),a&&a(),this}createStream(){let s=new e.Readable(t),a=[],o=!1,l=0;return this._inflights.forEach((u,c)=>{a.push(u)}),s._read=()=>{!o&&l<a.length?s.push(a[l++]):s.push(null)},s.destroy=u=>{if(!o)return o=!0,setTimeout(()=>{s.emit("close")},0),s},s}del(s,a){let o=this._inflights.get(s.messageId);return o?(this._inflights.delete(s.messageId),a(null,o)):a&&a(new Error("missing packet")),this}get(s,a){let o=this._inflights.get(s.messageId);return o?a(null,o):a&&a(new Error("missing packet")),this}close(s){this.options.clean&&(this._inflights=null),s&&s()}};i.default=n}),YTn=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"__esModule",{value:!0});var e=[0,16,128,131,135,144,145,151,153],t=(r,n,s)=>{r.log("handlePublish: packet %o",n),s=typeof s<"u"?s:r.noop;let a=n.topic.toString(),o=n.payload,{qos:l}=n,{messageId:u}=n,{options:c}=r;if(r.options.protocolVersion===5){let d;if(n.properties&&(d=n.properties.topicAlias),typeof d<"u")if(a.length===0)if(d>0&&d<=65535){let h=r.topicAliasRecv.getTopicByAlias(d);if(h)a=h,r.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",a,d);else{r.log("handlePublish :: unregistered topic alias. alias: %d",d),r.emit("error",new Error("Received unregistered Topic Alias"));return}}else{r.log("handlePublish :: topic alias out of range. alias: %d",d),r.emit("error",new Error("Received Topic Alias is out of range"));return}else if(r.topicAliasRecv.put(a,d))r.log("handlePublish :: registered topic: %s - alias: %d",a,d);else{r.log("handlePublish :: topic alias out of range. alias: %d",d),r.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(r.log("handlePublish: qos %d",l),l){case 2:{c.customHandleAcks(a,o,n,(d,h)=>{if(typeof d=="number"&&(h=d,d=null),d)return r.emit("error",d);if(e.indexOf(h)===-1)return r.emit("error",new Error("Wrong reason code for pubrec"));h?r._sendPacket({cmd:"pubrec",messageId:u,reasonCode:h},s):r.incomingStore.put(n,()=>{r._sendPacket({cmd:"pubrec",messageId:u},s)})});break}case 1:{c.customHandleAcks(a,o,n,(d,h)=>{if(typeof d=="number"&&(h=d,d=null),d)return r.emit("error",d);if(e.indexOf(h)===-1)return r.emit("error",new Error("Wrong reason code for puback"));h||r.emit("message",a,o,n),r.handleMessage(n,p=>{if(p)return s&&s(p);r._sendPacket({cmd:"puback",messageId:u,reasonCode:h},s)})});break}case 0:r.emit("message",a,o,n),r.handleMessage(n,s);break;default:r.log("handlePublish: unknown QoS. Doing nothing.");break}};i.default=t}),qTn=Sn((i,e)=>{e.exports={version:"5.14.0"}}),VH=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"__esModule",{value:!0}),i.MQTTJS_VERSION=i.nextTick=i.ErrorWithSubackPacket=i.ErrorWithReasonCode=void 0,i.applyMixin=r;var e=class wii extends Error{constructor(a,o){super(a);pr(this,"code");this.code=o,Object.setPrototypeOf(this,wii.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}};i.ErrorWithReasonCode=e;var t=class Fii extends Error{constructor(a,o){super(a);pr(this,"packet");this.packet=o,Object.setPrototypeOf(this,Fii.prototype),Object.getPrototypeOf(this).name="ErrorWithSubackPacket"}};i.ErrorWithSubackPacket=t;function r(n,s,a=!1){let o=[s];for(;;){let l=o[0],u=Object.getPrototypeOf(l);if(u!=null&&u.prototype)o.unshift(u);else break}for(let l of o)for(let u of Object.getOwnPropertyNames(l.prototype))(a||u!=="constructor")&&Object.defineProperty(n.prototype,u,Object.getOwnPropertyDescriptor(l.prototype,u)??Object.create(null))}i.nextTick=typeof(wd==null?void 0:wd.nextTick)=="function"?wd.nextTick:n=>{setTimeout(n,0)},i.MQTTJS_VERSION=qTn().version}),t3e=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"__esModule",{value:!0}),i.ReasonCodes=void 0;var e=VH();i.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=(r,n)=>{let{messageId:s}=n,a=n.cmd,o=null,l=r.outgoing[s]?r.outgoing[s].cb:null,u=null;if(!l){r.log("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(r.log("_handleAck :: packet type",a),a){case"pubcomp":case"puback":{let c=n.reasonCode;c&&c>0&&c!==16?(u=new e.ErrorWithReasonCode(`Publish error: ${i.ReasonCodes[c]}`,c),r._removeOutgoingAndStoreMessage(s,()=>{l(u,n)})):r._removeOutgoingAndStoreMessage(s,l);break}case"pubrec":{o={cmd:"pubrel",qos:2,messageId:s};let c=n.reasonCode;c&&c>0&&c!==16?(u=new e.ErrorWithReasonCode(`Publish error: ${i.ReasonCodes[c]}`,c),r._removeOutgoingAndStoreMessage(s,()=>{l(u,n)})):r._sendPacket(o);break}case"suback":{delete r.outgoing[s],r.messageIdProvider.deallocate(s);let c=n.granted;for(let d=0;d<c.length;d++){let h=c[d];if((h&128)!==0){u=new Error(`Subscribe error: ${i.ReasonCodes[h]}`),u.code=h;let p=r.messageIdToTopic[s];p&&p.forEach(m=>{delete r._resubscribeTopics[m]})}}delete r.messageIdToTopic[s],r._invokeStoreProcessingQueue(),l(u,n);break}case"unsuback":{delete r.outgoing[s],r.messageIdProvider.deallocate(s),r._invokeStoreProcessingQueue(),l(null,n);break}default:r.emit("error",new Error("unrecognized packet type"))}r.disconnecting&&Object.keys(r.outgoing).length===0&&r.emit("outgoingEmpty")};i.default=t}),QTn=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"__esModule",{value:!0});var e=VH(),t=t3e(),r=(n,s)=>{let{options:a}=n,o=a.protocolVersion,l=o===5?s.reasonCode:s.returnCode;if(o!==5){let u=new e.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${o}`,l);n.emit("error",u);return}n.handleAuth(s,(u,c)=>{if(u){n.emit("error",u);return}if(l===24)n.reconnecting=!1,n._sendPacket(c);else{let d=new e.ErrorWithReasonCode(`Connection refused: ${t.ReasonCodes[l]}`,l);n.emit("error",d)}})};i.default=r}),KTn=Sn(i=>{var p,m,x,v,y,E,S,C,T,I,B,O,L,k,U,j,Y,X,q,J,$,ee,ae,ce,re,se,fe,me,oe,E4t,ne,pe,Ae,Ge,Rii,De,ze,He,pP,mP,b4t,T_e,w_e,Zf,_4t,lae,gP,A4t,ft;gn(),vn(),xn(),Object.defineProperty(i,"__esModule",{value:!0}),i.LRUCache=void 0;var e=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,t=new Set,r=typeof wd=="object"&&wd?wd:{},n=(Ce,Pe,ke,Ye)=>{typeof r.emitWarning=="function"&&r.emitWarning(Ce,Pe,ke,Ye)},s=globalThis.AbortController,a=globalThis.AbortSignal;if(typeof s>"u"){a=class{constructor(){pr(this,"onabort");pr(this,"_onabort",[]);pr(this,"reason");pr(this,"aborted",!1)}addEventListener(ke,Ye){this._onabort.push(Ye)}},s=class{constructor(){pr(this,"signal",new a);Pe()}abort(ke){var Ye,Me;if(!this.signal.aborted){this.signal.reason=ke,this.signal.aborted=!0;for(let et of this.signal._onabort)et(ke);(Me=(Ye=this.signal).onabort)==null||Me.call(Ye,ke)}}};let Ce=((p=r.env)==null?void 0:p.LRU_CACHE_IGNORE_AC_WARNING)!=="1",Pe=()=>{Ce&&(Ce=!1,n("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",Pe))}}var o=Ce=>!t.has(Ce),l=Ce=>Ce&&Ce===Math.floor(Ce)&&Ce>0&&isFinite(Ce),u=Ce=>l(Ce)?Ce<=Math.pow(2,8)?Uint8Array:Ce<=Math.pow(2,16)?Uint16Array:Ce<=Math.pow(2,32)?Uint32Array:Ce<=Number.MAX_SAFE_INTEGER?c:null:null,c=class extends Array{constructor(Ce){super(Ce),this.fill(0)}},d=(m=class{constructor(Pe,ke){pr(this,"heap");pr(this,"length");if(!zr(m,x))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new ke(Pe),this.length=0}static create(Pe){let ke=u(Pe);if(!ke)return[];qo(m,x,!0);let Ye=new m(Pe,ke);return qo(m,x,!1),Ye}push(Pe){this.heap[this.length++]=Pe}pop(){return this.heap[--this.length]}},x=new WeakMap,vd(m,x,!1),m),h=(ft=class{constructor(Pe){vd(this,oe);vd(this,E);vd(this,S);vd(this,C);vd(this,T);vd(this,I);vd(this,B);pr(this,"ttl");pr(this,"ttlResolution");pr(this,"ttlAutopurge");pr(this,"updateAgeOnGet");pr(this,"updateAgeOnHas");pr(this,"allowStale");pr(this,"noDisposeOnSet");pr(this,"noUpdateTTL");pr(this,"maxEntrySize");pr(this,"sizeCalculation");pr(this,"noDeleteOnFetchRejection");pr(this,"noDeleteOnStaleGet");pr(this,"allowStaleOnFetchAbort");pr(this,"allowStaleOnFetchRejection");pr(this,"ignoreFetchAbort");vd(this,O);vd(this,L);vd(this,k);vd(this,U);vd(this,j);vd(this,Y);vd(this,X);vd(this,q);vd(this,J);vd(this,$);vd(this,ee);vd(this,ae);vd(this,ce);vd(this,re);vd(this,se);vd(this,fe);vd(this,me);vd(this,ne,()=>{});vd(this,pe,()=>{});vd(this,Ae,()=>{});vd(this,Ge,()=>!1);vd(this,De,Pe=>{});vd(this,ze,(Pe,ke,Ye)=>{});vd(this,He,(Pe,ke,Ye,Me)=>{if(Ye||Me)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});pr(this,v,"LRUCache");let{max:ke=0,ttl:Ye,ttlResolution:Me=1,ttlAutopurge:et,updateAgeOnGet:ot,updateAgeOnHas:vt,allowStale:At,dispose:cr,disposeAfter:Br,noDisposeOnSet:ei,noUpdateTTL:jt,maxSize:nt=0,maxEntrySize:Kr=0,sizeCalculation:Pr,fetchMethod:Dr,memoMethod:Vr,noDeleteOnFetchRejection:Fi,noDeleteOnStaleGet:Jn,allowStaleOnFetchRejection:Ps,allowStaleOnFetchAbort:wa,ignoreFetchAbort:Vs}=Pe;if(ke!==0&&!l(ke))throw new TypeError("max option must be a nonnegative integer");let Zt=ke?u(ke):Array;if(!Zt)throw new Error("invalid max value: "+ke);if(qo(this,E,ke),qo(this,S,nt),this.maxEntrySize=Kr||zr(this,S),this.sizeCalculation=Pr,this.sizeCalculation){if(!zr(this,S)&&!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(Vr!==void 0&&typeof Vr!="function")throw new TypeError("memoMethod must be a function if defined");if(qo(this,B,Vr),Dr!==void 0&&typeof Dr!="function")throw new TypeError("fetchMethod must be a function if specified");if(qo(this,I,Dr),qo(this,fe,!!Dr),qo(this,k,new Map),qo(this,U,new Array(ke).fill(void 0)),qo(this,j,new Array(ke).fill(void 0)),qo(this,Y,new Zt(ke)),qo(this,X,new Zt(ke)),qo(this,q,0),qo(this,J,0),qo(this,$,d.create(ke)),qo(this,O,0),qo(this,L,0),typeof cr=="function"&&qo(this,C,cr),typeof Br=="function"?(qo(this,T,Br),qo(this,ee,[])):(qo(this,T,void 0),qo(this,ee,void 0)),qo(this,se,!!zr(this,C)),qo(this,me,!!zr(this,T)),this.noDisposeOnSet=!!ei,this.noUpdateTTL=!!jt,this.noDeleteOnFetchRejection=!!Fi,this.allowStaleOnFetchRejection=!!Ps,this.allowStaleOnFetchAbort=!!wa,this.ignoreFetchAbort=!!Vs,this.maxEntrySize!==0){if(zr(this,S)!==0&&!l(zr(this,S)))throw new TypeError("maxSize must be a positive integer if specified");if(!l(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");ka(this,oe,Rii).call(this)}if(this.allowStale=!!At,this.noDeleteOnStaleGet=!!Jn,this.updateAgeOnGet=!!ot,this.updateAgeOnHas=!!vt,this.ttlResolution=l(Me)||Me===0?Me:1,this.ttlAutopurge=!!et,this.ttl=Ye||0,this.ttl){if(!l(this.ttl))throw new TypeError("ttl must be a positive integer if specified");ka(this,oe,E4t).call(this)}if(zr(this,E)===0&&this.ttl===0&&zr(this,S)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!zr(this,E)&&!zr(this,S)){let gr="LRU_CACHE_UNBOUNDED";o(gr)&&(t.add(gr),n("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",gr,ft))}}static unsafeExposeInternals(Pe){return{starts:zr(Pe,ce),ttls:zr(Pe,re),sizes:zr(Pe,ae),keyMap:zr(Pe,k),keyList:zr(Pe,U),valList:zr(Pe,j),next:zr(Pe,Y),prev:zr(Pe,X),get head(){return zr(Pe,q)},get tail(){return zr(Pe,J)},free:zr(Pe,$),isBackgroundFetch:ke=>{var Ye;return ka(Ye=Pe,oe,Zf).call(Ye,ke)},backgroundFetch:(ke,Ye,Me,et)=>{var ot;return ka(ot=Pe,oe,w_e).call(ot,ke,Ye,Me,et)},moveToTail:ke=>{var Ye;return ka(Ye=Pe,oe,lae).call(Ye,ke)},indexes:ke=>{var Ye;return ka(Ye=Pe,oe,pP).call(Ye,ke)},rindexes:ke=>{var Ye;return ka(Ye=Pe,oe,mP).call(Ye,ke)},isStale:ke=>{var Ye;return zr(Ye=Pe,Ge).call(Ye,ke)}}}get max(){return zr(this,E)}get maxSize(){return zr(this,S)}get calculatedSize(){return zr(this,L)}get size(){return zr(this,O)}get fetchMethod(){return zr(this,I)}get memoMethod(){return zr(this,B)}get dispose(){return zr(this,C)}get disposeAfter(){return zr(this,T)}getRemainingTTL(Pe){return zr(this,k).has(Pe)?1/0:0}*entries(){for(let Pe of ka(this,oe,pP).call(this))zr(this,j)[Pe]!==void 0&&zr(this,U)[Pe]!==void 0&&!ka(this,oe,Zf).call(this,zr(this,j)[Pe])&&(yield[zr(this,U)[Pe],zr(this,j)[Pe]])}*rentries(){for(let Pe of ka(this,oe,mP).call(this))zr(this,j)[Pe]!==void 0&&zr(this,U)[Pe]!==void 0&&!ka(this,oe,Zf).call(this,zr(this,j)[Pe])&&(yield[zr(this,U)[Pe],zr(this,j)[Pe]])}*keys(){for(let Pe of ka(this,oe,pP).call(this)){let ke=zr(this,U)[Pe];ke!==void 0&&!ka(this,oe,Zf).call(this,zr(this,j)[Pe])&&(yield ke)}}*rkeys(){for(let Pe of ka(this,oe,mP).call(this)){let ke=zr(this,U)[Pe];ke!==void 0&&!ka(this,oe,Zf).call(this,zr(this,j)[Pe])&&(yield ke)}}*values(){for(let Pe of ka(this,oe,pP).call(this))zr(this,j)[Pe]!==void 0&&!ka(this,oe,Zf).call(this,zr(this,j)[Pe])&&(yield zr(this,j)[Pe])}*rvalues(){for(let Pe of ka(this,oe,mP).call(this))zr(this,j)[Pe]!==void 0&&!ka(this,oe,Zf).call(this,zr(this,j)[Pe])&&(yield zr(this,j)[Pe])}[(y=Symbol.iterator,v=Symbol.toStringTag,y)](){return this.entries()}find(Pe,ke={}){for(let Ye of ka(this,oe,pP).call(this)){let Me=zr(this,j)[Ye],et=ka(this,oe,Zf).call(this,Me)?Me.__staleWhileFetching:Me;if(et!==void 0&&Pe(et,zr(this,U)[Ye],this))return this.get(zr(this,U)[Ye],ke)}}forEach(Pe,ke=this){for(let Ye of ka(this,oe,pP).call(this)){let Me=zr(this,j)[Ye],et=ka(this,oe,Zf).call(this,Me)?Me.__staleWhileFetching:Me;et!==void 0&&Pe.call(ke,et,zr(this,U)[Ye],this)}}rforEach(Pe,ke=this){for(let Ye of ka(this,oe,mP).call(this)){let Me=zr(this,j)[Ye],et=ka(this,oe,Zf).call(this,Me)?Me.__staleWhileFetching:Me;et!==void 0&&Pe.call(ke,et,zr(this,U)[Ye],this)}}purgeStale(){let Pe=!1;for(let ke of ka(this,oe,mP).call(this,{allowStale:!0}))zr(this,Ge).call(this,ke)&&(ka(this,oe,gP).call(this,zr(this,U)[ke],"expire"),Pe=!0);return Pe}info(Pe){let ke=zr(this,k).get(Pe);if(ke===void 0)return;let Ye=zr(this,j)[ke],Me=ka(this,oe,Zf).call(this,Ye)?Ye.__staleWhileFetching:Ye;if(Me===void 0)return;let et={value:Me};if(zr(this,re)&&zr(this,ce)){let ot=zr(this,re)[ke],vt=zr(this,ce)[ke];if(ot&&vt){let At=ot-(e.now()-vt);et.ttl=At,et.start=Date.now()}}return zr(this,ae)&&(et.size=zr(this,ae)[ke]),et}dump(){let Pe=[];for(let ke of ka(this,oe,pP).call(this,{allowStale:!0})){let Ye=zr(this,U)[ke],Me=zr(this,j)[ke],et=ka(this,oe,Zf).call(this,Me)?Me.__staleWhileFetching:Me;if(et===void 0||Ye===void 0)continue;let ot={value:et};if(zr(this,re)&&zr(this,ce)){ot.ttl=zr(this,re)[ke];let vt=e.now()-zr(this,ce)[ke];ot.start=Math.floor(Date.now()-vt)}zr(this,ae)&&(ot.size=zr(this,ae)[ke]),Pe.unshift([Ye,ot])}return Pe}load(Pe){this.clear();for(let[ke,Ye]of Pe){if(Ye.start){let Me=Date.now()-Ye.start;Ye.start=e.now()-Me}this.set(ke,Ye.value,Ye)}}set(Pe,ke,Ye={}){var jt,nt,Kr,Pr,Dr;if(ke===void 0)return this.delete(Pe),this;let{ttl:Me=this.ttl,start:et,noDisposeOnSet:ot=this.noDisposeOnSet,sizeCalculation:vt=this.sizeCalculation,status:At}=Ye,{noUpdateTTL:cr=this.noUpdateTTL}=Ye,Br=zr(this,He).call(this,Pe,ke,Ye.size||0,vt);if(this.maxEntrySize&&Br>this.maxEntrySize)return At&&(At.set="miss",At.maxEntrySizeExceeded=!0),ka(this,oe,gP).call(this,Pe,"set"),this;let ei=zr(this,O)===0?void 0:zr(this,k).get(Pe);if(ei===void 0)ei=zr(this,O)===0?zr(this,J):zr(this,$).length!==0?zr(this,$).pop():zr(this,O)===zr(this,E)?ka(this,oe,T_e).call(this,!1):zr(this,O),zr(this,U)[ei]=Pe,zr(this,j)[ei]=ke,zr(this,k).set(Pe,ei),zr(this,Y)[zr(this,J)]=ei,zr(this,X)[ei]=zr(this,J),qo(this,J,ei),A_e(this,O)._++,zr(this,ze).call(this,ei,Br,At),At&&(At.set="add"),cr=!1;else{ka(this,oe,lae).call(this,ei);let Vr=zr(this,j)[ei];if(ke!==Vr){if(zr(this,fe)&&ka(this,oe,Zf).call(this,Vr)){Vr.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:Fi}=Vr;Fi!==void 0&&!ot&&(zr(this,se)&&((jt=zr(this,C))==null||jt.call(this,Fi,Pe,"set")),zr(this,me)&&((nt=zr(this,ee))==null||nt.push([Fi,Pe,"set"])))}else ot||(zr(this,se)&&((Kr=zr(this,C))==null||Kr.call(this,Vr,Pe,"set")),zr(this,me)&&((Pr=zr(this,ee))==null||Pr.push([Vr,Pe,"set"])));if(zr(this,De).call(this,ei),zr(this,ze).call(this,ei,Br,At),zr(this,j)[ei]=ke,At){At.set="replace";let Fi=Vr&&ka(this,oe,Zf).call(this,Vr)?Vr.__staleWhileFetching:Vr;Fi!==void 0&&(At.oldValue=Fi)}}else At&&(At.set="update")}if(Me!==0&&!zr(this,re)&&ka(this,oe,E4t).call(this),zr(this,re)&&(cr||zr(this,Ae).call(this,ei,Me,et),At&&zr(this,pe).call(this,At,ei)),!ot&&zr(this,me)&&zr(this,ee)){let Vr=zr(this,ee),Fi;for(;Fi=Vr==null?void 0:Vr.shift();)(Dr=zr(this,T))==null||Dr.call(this,...Fi)}return this}pop(){var Pe;try{for(;zr(this,O);){let ke=zr(this,j)[zr(this,q)];if(ka(this,oe,T_e).call(this,!0),ka(this,oe,Zf).call(this,ke)){if(ke.__staleWhileFetching)return ke.__staleWhileFetching}else if(ke!==void 0)return ke}}finally{if(zr(this,me)&&zr(this,ee)){let ke=zr(this,ee),Ye;for(;Ye=ke==null?void 0:ke.shift();)(Pe=zr(this,T))==null||Pe.call(this,...Ye)}}}has(Pe,ke={}){let{updateAgeOnHas:Ye=this.updateAgeOnHas,status:Me}=ke,et=zr(this,k).get(Pe);if(et!==void 0){let ot=zr(this,j)[et];if(ka(this,oe,Zf).call(this,ot)&&ot.__staleWhileFetching===void 0)return!1;if(zr(this,Ge).call(this,et))Me&&(Me.has="stale",zr(this,pe).call(this,Me,et));else return Ye&&zr(this,ne).call(this,et),Me&&(Me.has="hit",zr(this,pe).call(this,Me,et)),!0}else Me&&(Me.has="miss");return!1}peek(Pe,ke={}){let{allowStale:Ye=this.allowStale}=ke,Me=zr(this,k).get(Pe);if(Me===void 0||!Ye&&zr(this,Ge).call(this,Me))return;let et=zr(this,j)[Me];return ka(this,oe,Zf).call(this,et)?et.__staleWhileFetching:et}async fetch(Pe,ke={}){let{allowStale:Ye=this.allowStale,updateAgeOnGet:Me=this.updateAgeOnGet,noDeleteOnStaleGet:et=this.noDeleteOnStaleGet,ttl:ot=this.ttl,noDisposeOnSet:vt=this.noDisposeOnSet,size:At=0,sizeCalculation:cr=this.sizeCalculation,noUpdateTTL:Br=this.noUpdateTTL,noDeleteOnFetchRejection:ei=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:jt=this.allowStaleOnFetchRejection,ignoreFetchAbort:nt=this.ignoreFetchAbort,allowStaleOnFetchAbort:Kr=this.allowStaleOnFetchAbort,context:Pr,forceRefresh:Dr=!1,status:Vr,signal:Fi}=ke;if(!zr(this,fe))return Vr&&(Vr.fetch="get"),this.get(Pe,{allowStale:Ye,updateAgeOnGet:Me,noDeleteOnStaleGet:et,status:Vr});let Jn={allowStale:Ye,updateAgeOnGet:Me,noDeleteOnStaleGet:et,ttl:ot,noDisposeOnSet:vt,size:At,sizeCalculation:cr,noUpdateTTL:Br,noDeleteOnFetchRejection:ei,allowStaleOnFetchRejection:jt,allowStaleOnFetchAbort:Kr,ignoreFetchAbort:nt,status:Vr,signal:Fi},Ps=zr(this,k).get(Pe);if(Ps===void 0){Vr&&(Vr.fetch="miss");let wa=ka(this,oe,w_e).call(this,Pe,Ps,Jn,Pr);return wa.__returned=wa}else{let wa=zr(this,j)[Ps];if(ka(this,oe,Zf).call(this,wa)){let Qi=Ye&&wa.__staleWhileFetching!==void 0;return Vr&&(Vr.fetch="inflight",Qi&&(Vr.returnedStale=!0)),Qi?wa.__staleWhileFetching:wa.__returned=wa}let Vs=zr(this,Ge).call(this,Ps);if(!Dr&&!Vs)return Vr&&(Vr.fetch="hit"),ka(this,oe,lae).call(this,Ps),Me&&zr(this,ne).call(this,Ps),Vr&&zr(this,pe).call(this,Vr,Ps),wa;let Zt=ka(this,oe,w_e).call(this,Pe,Ps,Jn,Pr),gr=Zt.__staleWhileFetching!==void 0&&Ye;return Vr&&(Vr.fetch=Vs?"stale":"refresh",gr&&Vs&&(Vr.returnedStale=!0)),gr?Zt.__staleWhileFetching:Zt.__returned=Zt}}async forceFetch(Pe,ke={}){let Ye=await this.fetch(Pe,ke);if(Ye===void 0)throw new Error("fetch() returned undefined");return Ye}memo(Pe,ke={}){let Ye=zr(this,B);if(!Ye)throw new Error("no memoMethod provided to constructor");let{context:Me,forceRefresh:et,...ot}=ke,vt=this.get(Pe,ot);if(!et&&vt!==void 0)return vt;let At=Ye(Pe,vt,{options:ot,context:Me});return this.set(Pe,At,ot),At}get(Pe,ke={}){let{allowStale:Ye=this.allowStale,updateAgeOnGet:Me=this.updateAgeOnGet,noDeleteOnStaleGet:et=this.noDeleteOnStaleGet,status:ot}=ke,vt=zr(this,k).get(Pe);if(vt!==void 0){let At=zr(this,j)[vt],cr=ka(this,oe,Zf).call(this,At);return ot&&zr(this,pe).call(this,ot,vt),zr(this,Ge).call(this,vt)?(ot&&(ot.get="stale"),cr?(ot&&Ye&&At.__staleWhileFetching!==void 0&&(ot.returnedStale=!0),Ye?At.__staleWhileFetching:void 0):(et||ka(this,oe,gP).call(this,Pe,"expire"),ot&&Ye&&(ot.returnedStale=!0),Ye?At:void 0)):(ot&&(ot.get="hit"),cr?At.__staleWhileFetching:(ka(this,oe,lae).call(this,vt),Me&&zr(this,ne).call(this,vt),At))}else ot&&(ot.get="miss")}delete(Pe){return ka(this,oe,gP).call(this,Pe,"delete")}clear(){return ka(this,oe,A4t).call(this,"delete")}},E=new WeakMap,S=new WeakMap,C=new WeakMap,T=new WeakMap,I=new WeakMap,B=new WeakMap,O=new WeakMap,L=new WeakMap,k=new WeakMap,U=new WeakMap,j=new WeakMap,Y=new WeakMap,X=new WeakMap,q=new WeakMap,J=new WeakMap,$=new WeakMap,ee=new WeakMap,ae=new WeakMap,ce=new WeakMap,re=new WeakMap,se=new WeakMap,fe=new WeakMap,me=new WeakMap,oe=new WeakSet,E4t=function(){let Pe=new c(zr(this,E)),ke=new c(zr(this,E));qo(this,re,Pe),qo(this,ce,ke),qo(this,Ae,(et,ot,vt=e.now())=>{if(ke[et]=ot!==0?vt:0,Pe[et]=ot,ot!==0&&this.ttlAutopurge){let At=setTimeout(()=>{zr(this,Ge).call(this,et)&&ka(this,oe,gP).call(this,zr(this,U)[et],"expire")},ot+1);At.unref&&At.unref()}}),qo(this,ne,et=>{ke[et]=Pe[et]!==0?e.now():0}),qo(this,pe,(et,ot)=>{if(Pe[ot]){let vt=Pe[ot],At=ke[ot];if(!vt||!At)return;et.ttl=vt,et.start=At,et.now=Ye||Me();let cr=et.now-At;et.remainingTTL=vt-cr}});let Ye=0,Me=()=>{let et=e.now();if(this.ttlResolution>0){Ye=et;let ot=setTimeout(()=>Ye=0,this.ttlResolution);ot.unref&&ot.unref()}return et};this.getRemainingTTL=et=>{let ot=zr(this,k).get(et);if(ot===void 0)return 0;let vt=Pe[ot],At=ke[ot];if(!vt||!At)return 1/0;let cr=(Ye||Me())-At;return vt-cr},qo(this,Ge,et=>{let ot=ke[et],vt=Pe[et];return!!vt&&!!ot&&(Ye||Me())-ot>vt})},ne=new WeakMap,pe=new WeakMap,Ae=new WeakMap,Ge=new WeakMap,Rii=function(){let Pe=new c(zr(this,E));qo(this,L,0),qo(this,ae,Pe),qo(this,De,ke=>{qo(this,L,zr(this,L)-Pe[ke]),Pe[ke]=0}),qo(this,He,(ke,Ye,Me,et)=>{if(ka(this,oe,Zf).call(this,Ye))return 0;if(!l(Me))if(et){if(typeof et!="function")throw new TypeError("sizeCalculation must be a function");if(Me=et(Ye,ke),!l(Me))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 Me}),qo(this,ze,(ke,Ye,Me)=>{if(Pe[ke]=Ye,zr(this,S)){let et=zr(this,S)-Pe[ke];for(;zr(this,L)>et;)ka(this,oe,T_e).call(this,!0)}qo(this,L,zr(this,L)+Pe[ke]),Me&&(Me.entrySize=Ye,Me.totalCalculatedSize=zr(this,L))})},De=new WeakMap,ze=new WeakMap,He=new WeakMap,pP=function*({allowStale:Pe=this.allowStale}={}){if(zr(this,O))for(let ke=zr(this,J);!(!ka(this,oe,b4t).call(this,ke)||((Pe||!zr(this,Ge).call(this,ke))&&(yield ke),ke===zr(this,q)));)ke=zr(this,X)[ke]},mP=function*({allowStale:Pe=this.allowStale}={}){if(zr(this,O))for(let ke=zr(this,q);!(!ka(this,oe,b4t).call(this,ke)||((Pe||!zr(this,Ge).call(this,ke))&&(yield ke),ke===zr(this,J)));)ke=zr(this,Y)[ke]},b4t=function(Pe){return Pe!==void 0&&zr(this,k).get(zr(this,U)[Pe])===Pe},T_e=function(Pe){var et,ot;let ke=zr(this,q),Ye=zr(this,U)[ke],Me=zr(this,j)[ke];return zr(this,fe)&&ka(this,oe,Zf).call(this,Me)?Me.__abortController.abort(new Error("evicted")):(zr(this,se)||zr(this,me))&&(zr(this,se)&&((et=zr(this,C))==null||et.call(this,Me,Ye,"evict")),zr(this,me)&&((ot=zr(this,ee))==null||ot.push([Me,Ye,"evict"]))),zr(this,De).call(this,ke),Pe&&(zr(this,U)[ke]=void 0,zr(this,j)[ke]=void 0,zr(this,$).push(ke)),zr(this,O)===1?(qo(this,q,qo(this,J,0)),zr(this,$).length=0):qo(this,q,zr(this,Y)[ke]),zr(this,k).delete(Ye),A_e(this,O)._--,ke},w_e=function(Pe,ke,Ye,Me){let et=ke===void 0?void 0:zr(this,j)[ke];if(ka(this,oe,Zf).call(this,et))return et;let ot=new s,{signal:vt}=Ye;vt==null||vt.addEventListener("abort",()=>ot.abort(vt.reason),{signal:ot.signal});let At={signal:ot.signal,options:Ye,context:Me},cr=(Pr,Dr=!1)=>{let{aborted:Vr}=ot.signal,Fi=Ye.ignoreFetchAbort&&Pr!==void 0;if(Ye.status&&(Vr&&!Dr?(Ye.status.fetchAborted=!0,Ye.status.fetchError=ot.signal.reason,Fi&&(Ye.status.fetchAbortIgnored=!0)):Ye.status.fetchResolved=!0),Vr&&!Fi&&!Dr)return ei(ot.signal.reason);let Jn=nt;return zr(this,j)[ke]===nt&&(Pr===void 0?Jn.__staleWhileFetching?zr(this,j)[ke]=Jn.__staleWhileFetching:ka(this,oe,gP).call(this,Pe,"fetch"):(Ye.status&&(Ye.status.fetchUpdated=!0),this.set(Pe,Pr,At.options))),Pr},Br=Pr=>(Ye.status&&(Ye.status.fetchRejected=!0,Ye.status.fetchError=Pr),ei(Pr)),ei=Pr=>{let{aborted:Dr}=ot.signal,Vr=Dr&&Ye.allowStaleOnFetchAbort,Fi=Vr||Ye.allowStaleOnFetchRejection,Jn=Fi||Ye.noDeleteOnFetchRejection,Ps=nt;if(zr(this,j)[ke]===nt&&(!Jn||Ps.__staleWhileFetching===void 0?ka(this,oe,gP).call(this,Pe,"fetch"):Vr||(zr(this,j)[ke]=Ps.__staleWhileFetching)),Fi)return Ye.status&&Ps.__staleWhileFetching!==void 0&&(Ye.status.returnedStale=!0),Ps.__staleWhileFetching;if(Ps.__returned===Ps)throw Pr},jt=(Pr,Dr)=>{var Fi;let Vr=(Fi=zr(this,I))==null?void 0:Fi.call(this,Pe,et,At);Vr&&Vr instanceof Promise&&Vr.then(Jn=>Pr(Jn===void 0?void 0:Jn),Dr),ot.signal.addEventListener("abort",()=>{(!Ye.ignoreFetchAbort||Ye.allowStaleOnFetchAbort)&&(Pr(void 0),Ye.allowStaleOnFetchAbort&&(Pr=Jn=>cr(Jn,!0)))})};Ye.status&&(Ye.status.fetchDispatched=!0);let nt=new Promise(jt).then(cr,Br),Kr=Object.assign(nt,{__abortController:ot,__staleWhileFetching:et,__returned:void 0});return ke===void 0?(this.set(Pe,Kr,{...At.options,status:void 0}),ke=zr(this,k).get(Pe)):zr(this,j)[ke]=Kr,Kr},Zf=function(Pe){if(!zr(this,fe))return!1;let ke=Pe;return!!ke&&ke instanceof Promise&&ke.hasOwnProperty("__staleWhileFetching")&&ke.__abortController instanceof s},_4t=function(Pe,ke){zr(this,X)[ke]=Pe,zr(this,Y)[Pe]=ke},lae=function(Pe){Pe!==zr(this,J)&&(Pe===zr(this,q)?qo(this,q,zr(this,Y)[Pe]):ka(this,oe,_4t).call(this,zr(this,X)[Pe],zr(this,Y)[Pe]),ka(this,oe,_4t).call(this,zr(this,J),Pe),qo(this,J,Pe))},gP=function(Pe,ke){var Me,et,ot,vt;let Ye=!1;if(zr(this,O)!==0){let At=zr(this,k).get(Pe);if(At!==void 0)if(Ye=!0,zr(this,O)===1)ka(this,oe,A4t).call(this,ke);else{zr(this,De).call(this,At);let cr=zr(this,j)[At];if(ka(this,oe,Zf).call(this,cr)?cr.__abortController.abort(new Error("deleted")):(zr(this,se)||zr(this,me))&&(zr(this,se)&&((Me=zr(this,C))==null||Me.call(this,cr,Pe,ke)),zr(this,me)&&((et=zr(this,ee))==null||et.push([cr,Pe,ke]))),zr(this,k).delete(Pe),zr(this,U)[At]=void 0,zr(this,j)[At]=void 0,At===zr(this,J))qo(this,J,zr(this,X)[At]);else if(At===zr(this,q))qo(this,q,zr(this,Y)[At]);else{let Br=zr(this,X)[At];zr(this,Y)[Br]=zr(this,Y)[At];let ei=zr(this,Y)[At];zr(this,X)[ei]=zr(this,X)[At]}A_e(this,O)._--,zr(this,$).push(At)}}if(zr(this,me)&&((ot=zr(this,ee))!=null&&ot.length)){let At=zr(this,ee),cr;for(;cr=At==null?void 0:At.shift();)(vt=zr(this,T))==null||vt.call(this,...cr)}return Ye},A4t=function(Pe){var ke,Ye,Me;for(let et of ka(this,oe,mP).call(this,{allowStale:!0})){let ot=zr(this,j)[et];if(ka(this,oe,Zf).call(this,ot))ot.__abortController.abort(new Error("deleted"));else{let vt=zr(this,U)[et];zr(this,se)&&((ke=zr(this,C))==null||ke.call(this,ot,vt,Pe)),zr(this,me)&&((Ye=zr(this,ee))==null||Ye.push([ot,vt,Pe]))}}if(zr(this,k).clear(),zr(this,j).fill(void 0),zr(this,U).fill(void 0),zr(this,re)&&zr(this,ce)&&(zr(this,re).fill(0),zr(this,ce).fill(0)),zr(this,ae)&&zr(this,ae).fill(0),qo(this,q,0),qo(this,J,0),zr(this,$).length=0,qo(this,L,0),qo(this,O,0),zr(this,me)&&zr(this,ee)){let et=zr(this,ee),ot;for(;ot=et==null?void 0:et.shift();)(Me=zr(this,T))==null||Me.call(this,...ot)}},ft);i.LRUCache=h}),f9=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"t",{value:!0}),i.ContainerIterator=i.Container=i.Base=void 0;var e=class{constructor(n=0){this.iteratorType=n}equals(n){return this.o===n.o}};i.ContainerIterator=e;var t=class{constructor(){this.i=0}get length(){return this.i}size(){return this.i}empty(){return this.i===0}};i.Base=t;var r=class extends t{};i.Container=r}),JTn=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"t",{value:!0}),i.default=void 0;var e=f9(),t=class extends e.Base{constructor(n=[]){super(),this.S=[];let s=this;n.forEach(function(a){s.push(a)})}clear(){this.i=0,this.S=[]}push(n){return this.S.push(n),this.i+=1,this.i}pop(){if(this.i!==0)return this.i-=1,this.S.pop()}top(){return this.S[this.i-1]}},r=t;i.default=r}),ZTn=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"t",{value:!0}),i.default=void 0;var e=f9(),t=class extends e.Base{constructor(n=[]){super(),this.j=0,this.q=[];let s=this;n.forEach(function(a){s.push(a)})}clear(){this.q=[],this.i=this.j=0}push(n){let s=this.q.length;if(this.j/s>.5&&this.j+this.i>=s&&s>4096){let a=this.i;for(let o=0;o<a;++o)this.q[o]=this.q[this.j+o];this.j=0,this.q[this.i]=n}else this.q[this.j+this.i]=n;return++this.i}pop(){if(this.i===0)return;let n=this.q[this.j++];return this.i-=1,n}front(){if(this.i!==0)return this.q[this.j]}},r=t;i.default=r}),$Tn=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"t",{value:!0}),i.default=void 0;var e=f9(),t=class extends e.Base{constructor(n=[],s=function(o,l){return o>l?-1:o<l?1:0},a=!0){if(super(),this.v=s,Array.isArray(n))this.C=a?[...n]:n;else{this.C=[];let l=this;n.forEach(function(u){l.C.push(u)})}this.i=this.C.length;let o=this.i>>1;for(let l=this.i-1>>1;l>=0;--l)this.k(l,o)}m(n){let s=this.C[n];for(;n>0;){let a=n-1>>1,o=this.C[a];if(this.v(o,s)<=0)break;this.C[n]=o,n=a}this.C[n]=s}k(n,s){let a=this.C[n];for(;n<s;){let o=n<<1|1,l=o+1,u=this.C[o];if(l<this.i&&this.v(u,this.C[l])>0&&(o=l,u=this.C[l]),this.v(u,a)>=0)break;this.C[n]=u,n=o}this.C[n]=a}clear(){this.i=0,this.C.length=0}push(n){this.C.push(n),this.m(this.i),this.i+=1}pop(){if(this.i===0)return;let n=this.C[0],s=this.C.pop();return this.i-=1,this.i&&(this.C[0]=s,this.k(0,this.i>>1)),n}top(){return this.C[0]}find(n){return this.C.indexOf(n)>=0}remove(n){let s=this.C.indexOf(n);return s<0?!1:(s===0?this.pop():s===this.i-1?(this.C.pop(),this.i-=1):(this.C.splice(s,1,this.C.pop()),this.i-=1,this.m(s),this.k(s,this.i>>1)),!0)}updateItem(n){let s=this.C.indexOf(n);return s<0?!1:(this.m(s),this.k(s,this.i>>1),!0)}toArray(){return[...this.C]}},r=t;i.default=r}),Tit=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"t",{value:!0}),i.default=void 0;var e=f9(),t=class extends e.Container{},r=t;i.default=r}),p9=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"t",{value:!0}),i.throwIteratorAccessError=e;function e(){throw new RangeError("Iterator access denied!")}}),pSr=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"t",{value:!0}),i.RandomIterator=void 0;var e=f9(),t=p9(),r=class extends e.ContainerIterator{constructor(n,s){super(s),this.o=n,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(n){this.container.setElementByPos(this.o,n)}};i.RandomIterator=r}),ewn=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"t",{value:!0}),i.default=void 0;var e=r(Tit()),t=pSr();function r(o){return o&&o.t?o:{default:o}}var n=class Pii extends t.RandomIterator{constructor(l,u,c){super(l,c),this.container=u}copy(){return new Pii(this.o,this.container,this.iteratorType)}},s=class extends e.default{constructor(o=[],l=!0){if(super(),Array.isArray(o))this.J=l?[...o]:o,this.i=o.length;else{this.J=[];let u=this;o.forEach(function(c){u.pushBack(c)})}}clear(){this.i=0,this.J.length=0}begin(){return new n(0,this)}end(){return new n(this.i,this)}rBegin(){return new n(this.i-1,this,1)}rEnd(){return new n(-1,this,1)}front(){return this.J[0]}back(){return this.J[this.i-1]}getElementByPos(o){if(o<0||o>this.i-1)throw new RangeError;return this.J[o]}eraseElementByPos(o){if(o<0||o>this.i-1)throw new RangeError;return this.J.splice(o,1),this.i-=1,this.i}eraseElementByValue(o){let l=0;for(let u=0;u<this.i;++u)this.J[u]!==o&&(this.J[l++]=this.J[u]);return this.i=this.J.length=l,this.i}eraseElementByIterator(o){let l=o.o;return o=o.next(),this.eraseElementByPos(l),o}pushBack(o){return this.J.push(o),this.i+=1,this.i}popBack(){if(this.i!==0)return this.i-=1,this.J.pop()}setElementByPos(o,l){if(o<0||o>this.i-1)throw new RangeError;this.J[o]=l}insert(o,l,u=1){if(o<0||o>this.i)throw new RangeError;return this.J.splice(o,0,...new Array(u).fill(l)),this.i+=u,this.i}find(o){for(let l=0;l<this.i;++l)if(this.J[l]===o)return new n(l,this);return this.end()}reverse(){this.J.reverse()}unique(){let o=1;for(let l=1;l<this.i;++l)this.J[l]!==this.J[l-1]&&(this.J[o++]=this.J[l]);return this.i=this.J.length=o,this.i}sort(o){this.J.sort(o)}forEach(o){for(let l=0;l<this.i;++l)o(this.J[l],l,this)}[Symbol.iterator](){return(function*(){yield*this.J}).bind(this)()}},a=s;i.default=a}),twn=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"t",{value:!0}),i.default=void 0;var e=n(Tit()),t=f9(),r=p9();function n(l){return l&&l.t?l:{default:l}}var s=class Iii extends t.ContainerIterator{constructor(u,c,d,h){super(h),this.o=u,this.h=c,this.container=d,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.L,this})}get pointer(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o.l}set pointer(u){this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o.l=u}copy(){return new Iii(this.o,this.h,this.container,this.iteratorType)}},a=class extends e.default{constructor(l=[]){super(),this.h={},this.p=this._=this.h.L=this.h.B=this.h;let u=this;l.forEach(function(c){u.pushBack(c)})}V(l){let{L:u,B:c}=l;u.B=c,c.L=u,l===this.p&&(this.p=c),l===this._&&(this._=u),this.i-=1}G(l,u){let c=u.B,d={l,L:u,B:c};u.B=d,c.L=d,u===this.h&&(this.p=d),c===this.h&&(this._=d),this.i+=1}clear(){this.i=0,this.p=this._=this.h.L=this.h.B=this.h}begin(){return new s(this.p,this.h,this)}end(){return new s(this.h,this.h,this)}rBegin(){return new s(this._,this.h,this,1)}rEnd(){return new s(this.h,this.h,this,1)}front(){return this.p.l}back(){return this._.l}getElementByPos(l){if(l<0||l>this.i-1)throw new RangeError;let u=this.p;for(;l--;)u=u.B;return u.l}eraseElementByPos(l){if(l<0||l>this.i-1)throw new RangeError;let u=this.p;for(;l--;)u=u.B;return this.V(u),this.i}eraseElementByValue(l){let u=this.p;for(;u!==this.h;)u.l===l&&this.V(u),u=u.B;return this.i}eraseElementByIterator(l){let u=l.o;return u===this.h&&(0,r.throwIteratorAccessError)(),l=l.next(),this.V(u),l}pushBack(l){return this.G(l,this._),this.i}popBack(){if(this.i===0)return;let l=this._.l;return this.V(this._),l}pushFront(l){return this.G(l,this.h),this.i}popFront(){if(this.i===0)return;let l=this.p.l;return this.V(this.p),l}setElementByPos(l,u){if(l<0||l>this.i-1)throw new RangeError;let c=this.p;for(;l--;)c=c.B;c.l=u}insert(l,u,c=1){if(l<0||l>this.i)throw new RangeError;if(c<=0)return this.i;if(l===0)for(;c--;)this.pushFront(u);else if(l===this.i)for(;c--;)this.pushBack(u);else{let d=this.p;for(let p=1;p<l;++p)d=d.B;let h=d.B;for(this.i+=c;c--;)d.B={l:u,L:d},d.B.L=d,d=d.B;d.B=h,h.L=d}return this.i}find(l){let u=this.p;for(;u!==this.h;){if(u.l===l)return new s(u,this.h,this);u=u.B}return this.end()}reverse(){if(this.i<=1)return;let l=this.p,u=this._,c=0;for(;c<<1<this.i;){let d=l.l;l.l=u.l,u.l=d,l=l.B,u=u.L,c+=1}}unique(){if(this.i<=1)return this.i;let l=this.p;for(;l!==this.h;){let u=l;for(;u.B!==this.h&&u.l===u.B.l;)u=u.B,this.i-=1;l.B=u.B,l.B.L=l,l=l.B}return this.i}sort(l){if(this.i<=1)return;let u=[];this.forEach(function(d){u.push(d)}),u.sort(l);let c=this.p;u.forEach(function(d){c.l=d,c=c.B})}merge(l){let u=this;if(this.i===0)l.forEach(function(c){u.pushBack(c)});else{let c=this.p;l.forEach(function(d){for(;c!==u.h&&c.l<=d;)c=c.B;u.G(d,c.L)})}return this.i}forEach(l){let u=this.p,c=0;for(;u!==this.h;)l(u.l,c++,this),u=u.B}[Symbol.iterator](){return(function*(){if(this.i===0)return;let l=this.p;for(;l!==this.h;)yield l.l,l=l.B}).bind(this)()}},o=a;i.default=o}),rwn=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"t",{value:!0}),i.default=void 0;var e=r(Tit()),t=pSr();function r(o){return o&&o.t?o:{default:o}}var n=class Mii extends t.RandomIterator{constructor(l,u,c){super(l,c),this.container=u}copy(){return new Mii(this.o,this.container,this.iteratorType)}},s=class extends e.default{constructor(o=[],l=4096){super(),this.j=0,this.D=0,this.R=0,this.N=0,this.P=0,this.A=[];let u=(()=>{if(typeof o.length=="number")return o.length;if(typeof o.size=="number")return o.size;if(typeof o.size=="function")return o.size();throw new TypeError("Cannot get the length or size of the container")})();this.F=l,this.P=Math.max(Math.ceil(u/this.F),1);for(let h=0;h<this.P;++h)this.A.push(new Array(this.F));let c=Math.ceil(u/this.F);this.j=this.R=(this.P>>1)-(c>>1),this.D=this.N=this.F-u%this.F>>1;let d=this;o.forEach(function(h){d.pushBack(h)})}T(){let o=[],l=Math.max(this.P>>1,1);for(let u=0;u<l;++u)o[u]=new Array(this.F);for(let u=this.j;u<this.P;++u)o[o.length]=this.A[u];for(let u=0;u<this.R;++u)o[o.length]=this.A[u];o[o.length]=[...this.A[this.R]],this.j=l,this.R=o.length-1;for(let u=0;u<l;++u)o[o.length]=new Array(this.F);this.A=o,this.P=o.length}O(o){let l=this.D+o+1,u=l%this.F,c=u-1,d=this.j+(l-u)/this.F;return u===0&&(d-=1),d%=this.P,c<0&&(c+=this.F),{curNodeBucketIndex:d,curNodePointerIndex:c}}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 n(0,this)}end(){return new n(this.i,this)}rBegin(){return new n(this.i-1,this,1)}rEnd(){return new n(-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(o){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]=o,this.i}popBack(){if(this.i===0)return;let o=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,o}pushFront(o){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]=o,this.i}popFront(){if(this.i===0)return;let o=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,o}getElementByPos(o){if(o<0||o>this.i-1)throw new RangeError;let{curNodeBucketIndex:l,curNodePointerIndex:u}=this.O(o);return this.A[l][u]}setElementByPos(o,l){if(o<0||o>this.i-1)throw new RangeError;let{curNodeBucketIndex:u,curNodePointerIndex:c}=this.O(o);this.A[u][c]=l}insert(o,l,u=1){if(o<0||o>this.i)throw new RangeError;if(o===0)for(;u--;)this.pushFront(l);else if(o===this.i)for(;u--;)this.pushBack(l);else{let c=[];for(let d=o;d<this.i;++d)c.push(this.getElementByPos(d));this.cut(o-1);for(let d=0;d<u;++d)this.pushBack(l);for(let d=0;d<c.length;++d)this.pushBack(c[d])}return this.i}cut(o){if(o<0)return this.clear(),0;let{curNodeBucketIndex:l,curNodePointerIndex:u}=this.O(o);return this.R=l,this.N=u,this.i=o+1,this.i}eraseElementByPos(o){if(o<0||o>this.i-1)throw new RangeError;if(o===0)this.popFront();else if(o===this.i-1)this.popBack();else{let l=[];for(let c=o+1;c<this.i;++c)l.push(this.getElementByPos(c));this.cut(o),this.popBack();let u=this;l.forEach(function(c){u.pushBack(c)})}return this.i}eraseElementByValue(o){if(this.i===0)return 0;let l=[];for(let c=0;c<this.i;++c){let d=this.getElementByPos(c);d!==o&&l.push(d)}let u=l.length;for(let c=0;c<u;++c)this.setElementByPos(c,l[c]);return this.cut(u-1)}eraseElementByIterator(o){let l=o.o;return this.eraseElementByPos(l),o=o.next(),o}find(o){for(let l=0;l<this.i;++l)if(this.getElementByPos(l)===o)return new n(l,this);return this.end()}reverse(){let o=0,l=this.i-1;for(;o<l;){let u=this.getElementByPos(o);this.setElementByPos(o,this.getElementByPos(l)),this.setElementByPos(l,u),o+=1,l-=1}}unique(){if(this.i<=1)return this.i;let o=1,l=this.getElementByPos(0);for(let u=1;u<this.i;++u){let c=this.getElementByPos(u);c!==l&&(l=c,this.setElementByPos(o++,c))}for(;this.i>o;)this.popBack();return this.i}sort(o){let l=[];for(let u=0;u<this.i;++u)l.push(this.getElementByPos(u));l.sort(o);for(let u=0;u<this.i;++u)this.setElementByPos(u,l[u])}shrinkToFit(){if(this.i===0)return;let o=[];this.forEach(function(l){o.push(l)}),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 l=0;l<this.P;++l)this.A.push(new Array(this.F));for(let l=0;l<o.length;++l)this.pushBack(o[l])}forEach(o){for(let l=0;l<this.i;++l)o(this.getElementByPos(l),l,this)}[Symbol.iterator](){return(function*(){for(let o=0;o<this.i;++o)yield this.getElementByPos(o)}).bind(this)()}},a=s;i.default=a}),iwn=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"t",{value:!0}),i.TreeNodeEnableIndex=i.TreeNode=void 0;var e=class{constructor(r,n){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=r,this.l=n}L(){let r=this;if(r.ee===1&&r.tt.tt===r)r=r.W;else if(r.U)for(r=r.U;r.W;)r=r.W;else{let n=r.tt;for(;n.U===r;)r=n,n=r.tt;r=n}return r}B(){let r=this;if(r.W){for(r=r.W;r.U;)r=r.U;return r}else{let n=r.tt;for(;n.W===r;)r=n,n=r.tt;return r.W!==n?n:r}}te(){let r=this.tt,n=this.W,s=n.U;return r.tt===this?r.tt=n:r.U===this?r.U=n:r.W=n,n.tt=r,n.U=this,this.tt=n,this.W=s,s&&(s.tt=this),n}se(){let r=this.tt,n=this.U,s=n.W;return r.tt===this?r.tt=n:r.U===this?r.U=n:r.W=n,n.tt=r,n.W=this,this.tt=n,this.U=s,s&&(s.tt=this),n}};i.TreeNode=e;var t=class extends e{constructor(){super(...arguments),this.rt=1}te(){let r=super.te();return this.ie(),r.ie(),r}se(){let r=super.se();return this.ie(),r.ie(),r}ie(){this.rt=1,this.U&&(this.rt+=this.U.rt),this.W&&(this.rt+=this.W.rt)}};i.TreeNodeEnableIndex=t}),mSr=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"t",{value:!0}),i.default=void 0;var e=iwn(),t=f9(),r=p9(),n=class extends t.Container{constructor(a=function(l,u){return l<u?-1:l>u?1:0},o=!1){super(),this.Y=void 0,this.v=a,o?(this.re=e.TreeNodeEnableIndex,this.M=function(l,u,c){let d=this.ne(l,u,c);if(d){let h=d.tt;for(;h!==this.h;)h.rt+=1,h=h.tt;let p=this.he(d);if(p){let{parentNode:m,grandParent:x,curNode:v}=p;m.ie(),x.ie(),v.ie()}}return this.i},this.V=function(l){let u=this.fe(l);for(;u!==this.h;)u.rt-=1,u=u.tt}):(this.re=e.TreeNode,this.M=function(l,u,c){let d=this.ne(l,u,c);return d&&this.he(d),this.i},this.V=this.fe),this.h=new this.re}X(a,o){let l=this.h;for(;a;){let u=this.v(a.u,o);if(u<0)a=a.W;else if(u>0)l=a,a=a.U;else return a}return l}Z(a,o){let l=this.h;for(;a;)this.v(a.u,o)<=0?a=a.W:(l=a,a=a.U);return l}$(a,o){let l=this.h;for(;a;){let u=this.v(a.u,o);if(u<0)l=a,a=a.W;else if(u>0)a=a.U;else return a}return l}rr(a,o){let l=this.h;for(;a;)this.v(a.u,o)<0?(l=a,a=a.W):a=a.U;return l}ue(a){for(;;){let o=a.tt;if(o===this.h)return;if(a.ee===1){a.ee=0;return}if(a===o.U){let l=o.W;if(l.ee===1)l.ee=0,o.ee=1,o===this.Y?this.Y=o.te():o.te();else if(l.W&&l.W.ee===1){l.ee=o.ee,o.ee=0,l.W.ee=0,o===this.Y?this.Y=o.te():o.te();return}else l.U&&l.U.ee===1?(l.ee=1,l.U.ee=0,l.se()):(l.ee=1,a=o)}else{let l=o.U;if(l.ee===1)l.ee=0,o.ee=1,o===this.Y?this.Y=o.se():o.se();else if(l.U&&l.U.ee===1){l.ee=o.ee,o.ee=0,l.U.ee=0,o===this.Y?this.Y=o.se():o.se();return}else l.W&&l.W.ee===1?(l.ee=1,l.W.ee=0,l.te()):(l.ee=1,a=o)}}}fe(a){if(this.i===1)return this.clear(),this.h;let o=a;for(;o.U||o.W;){if(o.W)for(o=o.W;o.U;)o=o.U;else o=o.U;[a.u,o.u]=[o.u,a.u],[a.l,o.l]=[o.l,a.l],a=o}this.h.U===o?this.h.U=o.tt:this.h.W===o&&(this.h.W=o.tt),this.ue(o);let l=o.tt;return o===l.U?l.U=void 0:l.W=void 0,this.i-=1,this.Y.ee=0,l}oe(a,o){return a===void 0?!1:this.oe(a.U,o)||o(a)?!0:this.oe(a.W,o)}he(a){for(;;){let o=a.tt;if(o.ee===0)return;let l=o.tt;if(o===l.U){let u=l.W;if(u&&u.ee===1){if(u.ee=o.ee=0,l===this.Y)return;l.ee=1,a=l;continue}else if(a===o.W){if(a.ee=0,a.U&&(a.U.tt=o),a.W&&(a.W.tt=l),o.W=a.U,l.U=a.W,a.U=o,a.W=l,l===this.Y)this.Y=a,this.h.tt=a;else{let c=l.tt;c.U===l?c.U=a:c.W=a}return a.tt=l.tt,o.tt=a,l.tt=a,l.ee=1,{parentNode:o,grandParent:l,curNode:a}}else o.ee=0,l===this.Y?this.Y=l.se():l.se(),l.ee=1}else{let u=l.U;if(u&&u.ee===1){if(u.ee=o.ee=0,l===this.Y)return;l.ee=1,a=l;continue}else if(a===o.U){if(a.ee=0,a.U&&(a.U.tt=l),a.W&&(a.W.tt=o),l.W=a.U,o.U=a.W,a.U=l,a.W=o,l===this.Y)this.Y=a,this.h.tt=a;else{let c=l.tt;c.U===l?c.U=a:c.W=a}return a.tt=l.tt,o.tt=a,l.tt=a,l.ee=1,{parentNode:o,grandParent:l,curNode:a}}else o.ee=0,l===this.Y?this.Y=l.te():l.te(),l.ee=1}return}}ne(a,o,l){if(this.Y===void 0){this.i+=1,this.Y=new this.re(a,o),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 u,c=this.h.U,d=this.v(c.u,a);if(d===0){c.l=o;return}else if(d>0)c.U=new this.re(a,o),c.U.tt=c,u=c.U,this.h.U=u;else{let h=this.h.W,p=this.v(h.u,a);if(p===0){h.l=o;return}else if(p<0)h.W=new this.re(a,o),h.W.tt=h,u=h.W,this.h.W=u;else{if(l!==void 0){let m=l.o;if(m!==this.h){let x=this.v(m.u,a);if(x===0){m.l=o;return}else if(x>0){let v=m.L(),y=this.v(v.u,a);if(y===0){v.l=o;return}else y<0&&(u=new this.re(a,o),v.W===void 0?(v.W=u,u.tt=v):(m.U=u,u.tt=m))}}}if(u===void 0)for(u=this.Y;;){let m=this.v(u.u,a);if(m>0){if(u.U===void 0){u.U=new this.re(a,o),u.U.tt=u,u=u.U;break}u=u.U}else if(m<0){if(u.W===void 0){u.W=new this.re(a,o),u.W.tt=u,u=u.W;break}u=u.W}else{u.l=o;return}}}}return this.i+=1,u}I(a,o){for(;a;){let l=this.v(a.u,o);if(l<0)a=a.W;else if(l>0)a=a.U;else return a}return a||this.h}clear(){this.i=0,this.Y=void 0,this.h.tt=void 0,this.h.U=this.h.W=void 0}updateKeyByIterator(a,o){let l=a.o;if(l===this.h&&(0,r.throwIteratorAccessError)(),this.i===1)return l.u=o,!0;if(l===this.h.U)return this.v(l.B().u,o)>0?(l.u=o,!0):!1;if(l===this.h.W)return this.v(l.L().u,o)<0?(l.u=o,!0):!1;let u=l.L().u;if(this.v(u,o)>=0)return!1;let c=l.B().u;return this.v(c,o)<=0?!1:(l.u=o,!0)}eraseElementByPos(a){if(a<0||a>this.i-1)throw new RangeError;let o=0,l=this;return this.oe(this.Y,function(u){return a===o?(l.V(u),!0):(o+=1,!1)}),this.i}eraseElementByKey(a){if(this.i===0)return!1;let o=this.I(this.Y,a);return o===this.h?!1:(this.V(o),!0)}eraseElementByIterator(a){let o=a.o;o===this.h&&(0,r.throwIteratorAccessError)();let l=o.W===void 0;return a.iteratorType===0?l&&a.next():(!l||o.U===void 0)&&a.next(),this.V(o),a}forEach(a){let o=0;for(let l of this)a(l,o++,this)}getElementByPos(a){if(a<0||a>this.i-1)throw new RangeError;let o,l=0;for(let u of this){if(l===a){o=u;break}l+=1}return o}getHeight(){if(this.i===0)return 0;let a=function(o){return o?Math.max(a(o.U),a(o.W))+1:0};return a(this.Y)}},s=n;i.default=s}),gSr=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"t",{value:!0}),i.default=void 0;var e=f9(),t=p9(),r=class extends e.ContainerIterator{constructor(s,a,o){super(o),this.o=s,this.h=a,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 s=this.o,a=this.h.tt;if(s===this.h)return a?a.rt-1:0;let o=0;for(s.U&&(o+=s.U.rt);s!==a;){let l=s.tt;s===l.W&&(o+=1,l.U&&(o+=l.U.rt)),s=l}return o}},n=r;i.default=n}),nwn=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"t",{value:!0}),i.default=void 0;var e=n(mSr()),t=n(gSr()),r=p9();function n(l){return l&&l.t?l:{default:l}}var s=class Bii extends t.default{constructor(u,c,d,h){super(u,c,h),this.container=d}get pointer(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o.u}copy(){return new Bii(this.o,this.h,this.container,this.iteratorType)}},a=class extends e.default{constructor(l=[],u,c){super(u,c);let d=this;l.forEach(function(h){d.insert(h)})}*K(l){l!==void 0&&(yield*this.K(l.U),yield l.u,yield*this.K(l.W))}begin(){return new s(this.h.U||this.h,this.h,this)}end(){return new s(this.h,this.h,this)}rBegin(){return new s(this.h.W||this.h,this.h,this,1)}rEnd(){return new s(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(l,u){return this.M(l,void 0,u)}find(l){let u=this.I(this.Y,l);return new s(u,this.h,this)}lowerBound(l){let u=this.X(this.Y,l);return new s(u,this.h,this)}upperBound(l){let u=this.Z(this.Y,l);return new s(u,this.h,this)}reverseLowerBound(l){let u=this.$(this.Y,l);return new s(u,this.h,this)}reverseUpperBound(l){let u=this.rr(this.Y,l);return new s(u,this.h,this)}union(l){let u=this;return l.forEach(function(c){u.insert(c)}),this.i}[Symbol.iterator](){return this.K(this.Y)}},o=a;i.default=o}),swn=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"t",{value:!0}),i.default=void 0;var e=n(mSr()),t=n(gSr()),r=p9();function n(l){return l&&l.t?l:{default:l}}var s=class Oii extends t.default{constructor(u,c,d,h){super(u,c,h),this.container=d}get pointer(){this.o===this.h&&(0,r.throwIteratorAccessError)();let u=this;return new Proxy([],{get(c,d){if(d==="0")return u.o.u;if(d==="1")return u.o.l},set(c,d,h){if(d!=="1")throw new TypeError("props must be 1");return u.o.l=h,!0}})}copy(){return new Oii(this.o,this.h,this.container,this.iteratorType)}},a=class extends e.default{constructor(l=[],u,c){super(u,c);let d=this;l.forEach(function(h){d.setElement(h[0],h[1])})}*K(l){l!==void 0&&(yield*this.K(l.U),yield[l.u,l.l],yield*this.K(l.W))}begin(){return new s(this.h.U||this.h,this.h,this)}end(){return new s(this.h,this.h,this)}rBegin(){return new s(this.h.W||this.h,this.h,this,1)}rEnd(){return new s(this.h,this.h,this,1)}front(){if(this.i===0)return;let l=this.h.U;return[l.u,l.l]}back(){if(this.i===0)return;let l=this.h.W;return[l.u,l.l]}lowerBound(l){let u=this.X(this.Y,l);return new s(u,this.h,this)}upperBound(l){let u=this.Z(this.Y,l);return new s(u,this.h,this)}reverseLowerBound(l){let u=this.$(this.Y,l);return new s(u,this.h,this)}reverseUpperBound(l){let u=this.rr(this.Y,l);return new s(u,this.h,this)}setElement(l,u,c){return this.M(l,u,c)}find(l){let u=this.I(this.Y,l);return new s(u,this.h,this)}getElementByKey(l){return this.I(this.Y,l).l}union(l){let u=this;return l.forEach(function(c){u.setElement(c[0],c[1])}),this.i}[Symbol.iterator](){return this.K(this.Y)}},o=a;i.default=o}),xSr=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"t",{value:!0}),i.default=e;function e(t){let r=typeof t;return r==="object"&&t!==null||r==="function"}}),vSr=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"t",{value:!0}),i.HashContainerIterator=i.HashContainer=void 0;var e=f9(),t=n(xSr()),r=p9();function n(o){return o&&o.t?o:{default:o}}var s=class extends e.ContainerIterator{constructor(o,l,u){super(u),this.o=o,this.h=l,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.L,this})}};i.HashContainerIterator=s;var a=class extends e.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(o){let{L:l,B:u}=o;l.B=u,u.L=l,o===this.p&&(this.p=u),o===this._&&(this._=l),this.i-=1}M(o,l,u){u===void 0&&(u=(0,t.default)(o));let c;if(u){let d=o[this.HASH_TAG];if(d!==void 0)return this.H[d].l=l,this.i;Object.defineProperty(o,this.HASH_TAG,{value:this.H.length,configurable:!0}),c={u:o,l,L:this._,B:this.h},this.H.push(c)}else{let d=this.g[o];if(d)return d.l=l,this.i;c={u:o,l,L:this._,B:this.h},this.g[o]=c}return this.i===0?(this.p=c,this.h.B=c):this._.B=c,this._=c,this.h.L=c,++this.i}I(o,l){if(l===void 0&&(l=(0,t.default)(o)),l){let u=o[this.HASH_TAG];return u===void 0?this.h:this.H[u]}else return this.g[o]||this.h}clear(){let o=this.HASH_TAG;this.H.forEach(function(l){delete l.u[o]}),this.H=[],this.g={},Object.setPrototypeOf(this.g,null),this.i=0,this.p=this._=this.h.L=this.h.B=this.h}eraseElementByKey(o,l){let u;if(l===void 0&&(l=(0,t.default)(o)),l){let c=o[this.HASH_TAG];if(c===void 0)return!1;delete o[this.HASH_TAG],u=this.H[c],delete this.H[c]}else{if(u=this.g[o],u===void 0)return!1;delete this.g[o]}return this.V(u),!0}eraseElementByIterator(o){let l=o.o;return l===this.h&&(0,r.throwIteratorAccessError)(),this.V(l),o.next()}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}};i.HashContainer=a}),awn=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"t",{value:!0}),i.default=void 0;var e=vSr(),t=p9(),r=class Lii extends e.HashContainerIterator{constructor(o,l,u,c){super(o,l,c),this.container=u}get pointer(){return this.o===this.h&&(0,t.throwIteratorAccessError)(),this.o.u}copy(){return new Lii(this.o,this.h,this.container,this.iteratorType)}},n=class extends e.HashContainer{constructor(a=[]){super();let o=this;a.forEach(function(l){o.insert(l)})}begin(){return new r(this.p,this.h,this)}end(){return new r(this.h,this.h,this)}rBegin(){return new r(this._,this.h,this,1)}rEnd(){return new r(this.h,this.h,this,1)}front(){return this.p.u}back(){return this._.u}insert(a,o){return this.M(a,void 0,o)}getElementByPos(a){if(a<0||a>this.i-1)throw new RangeError;let o=this.p;for(;a--;)o=o.B;return o.u}find(a,o){let l=this.I(a,o);return new r(l,this.h,this)}forEach(a){let o=0,l=this.p;for(;l!==this.h;)a(l.u,o++,this),l=l.B}[Symbol.iterator](){return(function*(){let a=this.p;for(;a!==this.h;)yield a.u,a=a.B}).bind(this)()}},s=n;i.default=s}),own=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"t",{value:!0}),i.default=void 0;var e=vSr(),t=n(xSr()),r=p9();function n(l){return l&&l.t?l:{default:l}}var s=class Nii extends e.HashContainerIterator{constructor(u,c,d,h){super(u,c,h),this.container=d}get pointer(){this.o===this.h&&(0,r.throwIteratorAccessError)();let u=this;return new Proxy([],{get(c,d){if(d==="0")return u.o.u;if(d==="1")return u.o.l},set(c,d,h){if(d!=="1")throw new TypeError("props must be 1");return u.o.l=h,!0}})}copy(){return new Nii(this.o,this.h,this.container,this.iteratorType)}},a=class extends e.HashContainer{constructor(l=[]){super();let u=this;l.forEach(function(c){u.setElement(c[0],c[1])})}begin(){return new s(this.p,this.h,this)}end(){return new s(this.h,this.h,this)}rBegin(){return new s(this._,this.h,this,1)}rEnd(){return new s(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(l,u,c){return this.M(l,u,c)}getElementByKey(l,u){if(u===void 0&&(u=(0,t.default)(l)),u){let d=l[this.HASH_TAG];return d!==void 0?this.H[d].l:void 0}let c=this.g[l];return c?c.l:void 0}getElementByPos(l){if(l<0||l>this.i-1)throw new RangeError;let u=this.p;for(;l--;)u=u.B;return[u.u,u.l]}find(l,u){let c=this.I(l,u);return new s(c,this.h,this)}forEach(l){let u=0,c=this.p;for(;c!==this.h;)l([c.u,c.l],u++,this),c=c.B}[Symbol.iterator](){return(function*(){let l=this.p;for(;l!==this.h;)yield[l.u,l.l],l=l.B}).bind(this)()}},o=a;i.default=o}),lwn=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"t",{value:!0}),Object.defineProperty(i,"Deque",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(i,"HashMap",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(i,"HashSet",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(i,"LinkList",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(i,"OrderedMap",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(i,"OrderedSet",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(i,"PriorityQueue",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(i,"Queue",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(i,"Stack",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(i,"Vector",{enumerable:!0,get:function(){return n.default}});var e=d(JTn()),t=d(ZTn()),r=d($Tn()),n=d(ewn()),s=d(twn()),a=d(rwn()),o=d(nwn()),l=d(swn()),u=d(awn()),c=d(own());function d(h){return h&&h.t?h:{default:h}}}),uwn=Sn((i,e)=>{gn(),vn(),xn();var t=lwn().OrderedSet,r=h9()("number-allocator:trace"),n=h9()("number-allocator:error");function s(o,l){this.low=o,this.high=l}s.prototype.equals=function(o){return this.low===o.low&&this.high===o.high},s.prototype.compare=function(o){return this.low<o.low&&this.high<o.low?-1:o.low<this.low&&o.high<this.low?1:0};function a(o,l){if(!(this instanceof a))return new a(o,l);this.min=o,this.max=l,this.ss=new t([],(u,c)=>u.compare(c)),r("Create"),this.clear()}a.prototype.firstVacant=function(){return this.ss.size()===0?null:this.ss.front().low},a.prototype.alloc=function(){if(this.ss.size()===0)return r("alloc():empty"),null;let o=this.ss.begin(),l=o.pointer.low,u=o.pointer.high,c=l;return c+1<=u?this.ss.updateKeyByIterator(o,new s(l+1,u)):this.ss.eraseElementByPos(0),r("alloc():"+c),c},a.prototype.use=function(o){let l=new s(o,o),u=this.ss.lowerBound(l);if(!u.equals(this.ss.end())){let c=u.pointer.low,d=u.pointer.high;return u.pointer.equals(l)?(this.ss.eraseElementByIterator(u),r("use():"+o),!0):c>o?!1:c===o?(this.ss.updateKeyByIterator(u,new s(c+1,d)),r("use():"+o),!0):d===o?(this.ss.updateKeyByIterator(u,new s(c,d-1)),r("use():"+o),!0):(this.ss.updateKeyByIterator(u,new s(o+1,d)),this.ss.insert(new s(c,o-1)),r("use():"+o),!0)}return r("use():failed"),!1},a.prototype.free=function(o){if(o<this.min||o>this.max){n("free():"+o+" is out of range");return}let l=new s(o,o),u=this.ss.upperBound(l);if(u.equals(this.ss.end())){if(u.equals(this.ss.begin())){this.ss.insert(l);return}u.pre();let c=u.pointer.high;u.pointer.high+1===o?this.ss.updateKeyByIterator(u,new s(c,o)):this.ss.insert(l)}else if(u.equals(this.ss.begin()))if(o+1===u.pointer.low){let c=u.pointer.high;this.ss.updateKeyByIterator(u,new s(o,c))}else this.ss.insert(l);else{let c=u.pointer.low,d=u.pointer.high;u.pre();let h=u.pointer.low;u.pointer.high+1===o?o+1===c?(this.ss.eraseElementByIterator(u),this.ss.updateKeyByIterator(u,new s(h,d))):this.ss.updateKeyByIterator(u,new s(h,o)):o+1===c?(this.ss.eraseElementByIterator(u.next()),this.ss.insert(new s(o,d))):this.ss.insert(l)}r("free():"+o)},a.prototype.clear=function(){r("clear()"),this.ss.clear(),this.ss.insert(new s(this.min,this.max))},a.prototype.intervalCount=function(){return this.ss.size()},a.prototype.dump=function(){for(let o of this.ss);},e.exports=a}),ySr=Sn((i,e)=>{gn(),vn(),xn();var t=uwn();e.exports.NumberAllocator=t}),cwn=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"__esModule",{value:!0});var e=KTn(),t=ySr(),r=class{constructor(n){pr(this,"aliasToTopic");pr(this,"topicToAlias");pr(this,"max");pr(this,"numberAllocator");pr(this,"length");n>0&&(this.aliasToTopic=new e.LRUCache({max:n}),this.topicToAlias={},this.numberAllocator=new t.NumberAllocator(1,n),this.max=n,this.length=0)}put(n,s){if(s===0||s>this.max)return!1;let a=this.aliasToTopic.get(s);return a&&delete this.topicToAlias[a],this.aliasToTopic.set(s,n),this.topicToAlias[n]=s,this.numberAllocator.use(s),this.length=this.aliasToTopic.size,!0}getTopicByAlias(n){return this.aliasToTopic.get(n)}getAliasByTopic(n){let s=this.topicToAlias[n];return typeof s<"u"&&this.aliasToTopic.get(s),s}clear(){this.aliasToTopic.clear(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0}getLruAlias(){return this.numberAllocator.firstVacant()||[...this.aliasToTopic.keys()][this.aliasToTopic.size-1]}};i.default=r}),dwn=Sn(i=>{gn(),vn(),xn();var e=i&&i.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(i,"__esModule",{value:!0});var t=t3e(),r=e(cwn()),n=VH(),s=(a,o)=>{a.log("_handleConnack");let{options:l}=a,u=l.protocolVersion===5?o.reasonCode:o.returnCode;if(clearTimeout(a.connackTimer),delete a.topicAliasSend,o.properties){if(o.properties.topicAliasMaximum){if(o.properties.topicAliasMaximum>65535){a.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}o.properties.topicAliasMaximum>0&&(a.topicAliasSend=new r.default(o.properties.topicAliasMaximum))}o.properties.serverKeepAlive&&l.keepalive&&(l.keepalive=o.properties.serverKeepAlive),o.properties.maximumPacketSize&&(l.properties||(l.properties={}),l.properties.maximumPacketSize=o.properties.maximumPacketSize)}if(u===0)a.reconnecting=!1,a._onConnect(o);else if(u>0){let c=new n.ErrorWithReasonCode(`Connection refused: ${t.ReasonCodes[u]}`,u);a.emit("error",c),a.options.reconnectOnConnackError&&a._cleanUp(!0)}};i.default=s}),hwn=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"__esModule",{value:!0});var e=(t,r,n)=>{t.log("handling pubrel packet");let s=typeof n<"u"?n:t.noop,{messageId:a}=r,o={cmd:"pubcomp",messageId:a};t.incomingStore.get(r,(l,u)=>{l?t._sendPacket(o,s):(t.emit("message",u.topic,u.payload,u),t.handleMessage(u,c=>{if(c)return s(c);t.incomingStore.del(u,t.noop),t._sendPacket(o,s)}))})};i.default=e}),fwn=Sn(i=>{gn(),vn(),xn();var e=i&&i.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(i,"__esModule",{value:!0});var t=e(YTn()),r=e(QTn()),n=e(dwn()),s=e(t3e()),a=e(hwn()),o=(l,u,c)=>{let{options:d}=l;if(d.protocolVersion===5&&d.properties&&d.properties.maximumPacketSize&&d.properties.maximumPacketSize<u.length)return l.emit("error",new Error(`exceeding packets size ${u.cmd}`)),l.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),l;switch(l.log("_handlePacket :: emitting packetreceive"),l.emit("packetreceive",u),u.cmd){case"publish":(0,t.default)(l,u,c);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":l.reschedulePing(),(0,s.default)(l,u),c();break;case"pubrel":l.reschedulePing(),(0,a.default)(l,u,c);break;case"connack":(0,n.default)(l,u),c();break;case"auth":l.reschedulePing(),(0,r.default)(l,u),c();break;case"pingresp":l.log("_handlePacket :: received pingresp"),l.reschedulePing(!0),c();break;case"disconnect":l.emit("disconnect",u),c();break;default:l.log("_handlePacket :: unknown command"),c();break}};i.default=o}),DSr=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"__esModule",{value:!0});var e=class{constructor(){pr(this,"nextId");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(){}};i.default=e}),pwn=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"__esModule",{value:!0});var e=class{constructor(t){pr(this,"aliasToTopic");pr(this,"max");pr(this,"length");this.aliasToTopic={},this.max=t}put(t,r){return r===0||r>this.max?!1:(this.aliasToTopic[r]=t,this.length=Object.keys(this.aliasToTopic).length,!0)}getTopicByAlias(t){return this.aliasToTopic[t]}clear(){this.aliasToTopic={}}};i.default=e}),mwn=Sn(i=>{gn(),vn(),xn();var e=i&&i.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(i,"__esModule",{value:!0}),i.TypedEventEmitter=void 0;var t=e((zO(),Ch(WF))),r=VH(),n=class{};i.TypedEventEmitter=n,(0,r.applyMixin)(n,t.default)}),r3e=Sn((i,e)=>{gn(),vn(),xn();function t(r){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}),gwn=Sn((i,e)=>{gn(),vn(),xn();var t=r3e().default;function r(n,s){if(t(n)!="object"||!n)return n;var a=n[Symbol.toPrimitive];if(a!==void 0){var o=a.call(n,s||"default");if(t(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(n)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}),xwn=Sn((i,e)=>{gn(),vn(),xn();var t=r3e().default,r=gwn();function n(s){var a=r(s,"string");return t(a)=="symbol"?a:a+""}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}),vwn=Sn((i,e)=>{gn(),vn(),xn();var t=xwn();function r(n,s,a){return(s=t(s))in n?Object.defineProperty(n,s,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[s]=a,n}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}),ywn=Sn((i,e)=>{gn(),vn(),xn();function t(r){if(Array.isArray(r))return r}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}),Dwn=Sn((i,e)=>{gn(),vn(),xn();function t(r,n){var s=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(s!=null){var a,o,l,u,c=[],d=!0,h=!1;try{if(l=(s=s.call(r)).next,n===0){if(Object(s)!==s)return;d=!1}else for(;!(d=(a=l.call(s)).done)&&(c.push(a.value),c.length!==n);d=!0);}catch(p){h=!0,o=p}finally{try{if(!d&&s.return!=null&&(u=s.return(),Object(u)!==u))return}finally{if(h)throw o}}return c}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}),Ewn=Sn((i,e)=>{gn(),vn(),xn();function t(r,n){(n==null||n>r.length)&&(n=r.length);for(var s=0,a=Array(n);s<n;s++)a[s]=r[s];return a}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}),bwn=Sn((i,e)=>{gn(),vn(),xn();var t=Ewn();function r(n,s){if(n){if(typeof n=="string")return t(n,s);var a={}.toString.call(n).slice(8,-1);return a==="Object"&&n.constructor&&(a=n.constructor.name),a==="Map"||a==="Set"?Array.from(n):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?t(n,s):void 0}}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}),_wn=Sn((i,e)=>{gn(),vn(),xn();function t(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
33380
33380
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}),Awn=Sn((i,e)=>{gn(),vn(),xn();var t=ywn(),r=Dwn(),n=bwn(),s=_wn();function a(o,l){return t(o)||r(o,l)||n(o,l)||s()}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports}),ESr=Sn((i,e)=>{gn(),vn(),xn(),function(t,r){typeof i=="object"&&typeof e<"u"?r(i):typeof define=="function"&&define.amd?define(["exports"],r):(t=typeof globalThis<"u"?globalThis:t||self,r(t.fastUniqueNumbers={}))}(i,function(t){var r=function(p){return function(m){var x=p(m);return m.add(x),x}},n=function(p){return function(m,x){return p.set(m,x),x}},s=Number.MAX_SAFE_INTEGER===void 0?9007199254740991:Number.MAX_SAFE_INTEGER,a=536870912,o=a*2,l=function(p,m){return function(x){var v=m.get(x),y=v===void 0?x.size:v<o?v+1:0;if(!x.has(y))return p(x,y);if(x.size<a){for(;x.has(y);)y=Math.floor(Math.random()*o);return p(x,y)}if(x.size>s)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;x.has(y);)y=Math.floor(Math.random()*s);return p(x,y)}},u=new WeakMap,c=n(u),d=l(c,u),h=r(d);t.addUniqueNumber=h,t.generateUniqueNumber=d})}),Swn=Sn((i,e)=>{gn(),vn(),xn();function t(n,s,a,o,l,u,c){try{var d=n[u](c),h=d.value}catch(p){return void a(p)}d.done?s(h):Promise.resolve(h).then(o,l)}function r(n){return function(){var s=this,a=arguments;return new Promise(function(o,l){var u=n.apply(s,a);function c(h){t(u,o,l,c,d,"next",h)}function d(h){t(u,o,l,c,d,"throw",h)}c(void 0)})}}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}),bSr=Sn((i,e)=>{gn(),vn(),xn();function t(r,n){this.v=r,this.k=n}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}),_Sr=Sn((i,e)=>{gn(),vn(),xn();function t(r,n,s,a){var o=Object.defineProperty;try{o({},"",{})}catch{o=0}e.exports=t=function(l,u,c,d){function h(p,m){t(l,p,function(x){return this._invoke(p,m,x)})}u?o?o(l,u,{value:c,enumerable:!d,configurable:!d,writable:!d}):l[u]=c:(h("next",0),h("throw",1),h("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n,s,a)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}),ASr=Sn((i,e)=>{gn(),vn(),xn();var t=_Sr();function r(){var n,s,a=typeof Symbol=="function"?Symbol:{},o=a.iterator||"@@iterator",l=a.toStringTag||"@@toStringTag";function u(y,E,S,C){var T=E&&E.prototype instanceof d?E:d,I=Object.create(T.prototype);return t(I,"_invoke",function(B,O,L){var k,U,j,Y=0,X=L||[],q=!1,J={p:0,n:0,v:n,a:$,f:$.bind(n,4),d:function(ee,ae){return k=ee,U=0,j=n,J.n=ae,c}};function $(ee,ae){for(U=ee,j=ae,s=0;!q&&Y&&!ce&&s<X.length;s++){var ce,re=X[s],se=J.p,fe=re[2];ee>3?(ce=fe===ae)&&(j=re[(U=re[4])?5:(U=3,3)],re[4]=re[5]=n):re[0]<=se&&((ce=ee<2&&se<re[1])?(U=0,J.v=ae,J.n=re[1]):se<fe&&(ce=ee<3||re[0]>ae||ae>fe)&&(re[4]=ee,re[5]=ae,J.n=fe,U=0))}if(ce||ee>1)return c;throw q=!0,ae}return function(ee,ae,ce){if(Y>1)throw TypeError("Generator is already running");for(q&&ae===1&&$(ae,ce),U=ae,j=ce;(s=U<2?n:j)||!q;){k||(U?U<3?(U>1&&(J.n=-1),$(U,j)):J.n=j:J.v=j);try{if(Y=2,k){if(U||(ee="next"),s=k[ee]){if(!(s=s.call(k,j)))throw TypeError("iterator result is not an object");if(!s.done)return s;j=s.value,U<2&&(U=0)}else U===1&&(s=k.return)&&s.call(k),U<2&&(j=TypeError("The iterator does not provide a '"+ee+"' method"),U=1);k=n}else if((s=(q=J.n<0)?j:B.call(O,J))!==c)break}catch(re){k=n,U=1,j=re}finally{Y=1}}return{value:s,done:q}}}(y,S,C),!0),I}var c={};function d(){}function h(){}function p(){}s=Object.getPrototypeOf;var m=[][o]?s(s([][o]())):(t(s={},o,function(){return this}),s),x=p.prototype=d.prototype=Object.create(m);function v(y){return Object.setPrototypeOf?Object.setPrototypeOf(y,p):(y.__proto__=p,t(y,l,"GeneratorFunction")),y.prototype=Object.create(x),y}return h.prototype=p,t(x,"constructor",p),t(p,"constructor",h),h.displayName="GeneratorFunction",t(p,l,"GeneratorFunction"),t(x),t(x,l,"Generator"),t(x,o,function(){return this}),t(x,"toString",function(){return"[object Generator]"}),(e.exports=r=function(){return{w:u,m:v}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}),SSr=Sn((i,e)=>{gn(),vn(),xn();var t=bSr(),r=_Sr();function n(s,a){function o(u,c,d,h){try{var p=s[u](c),m=p.value;return m instanceof t?a.resolve(m.v).then(function(x){o("next",x,d,h)},function(x){o("throw",x,d,h)}):a.resolve(m).then(function(x){p.value=x,d(p)},function(x){return o("throw",x,d,h)})}catch(x){h(x)}}var l;this.next||(r(n.prototype),r(n.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),r(this,"_invoke",function(u,c,d){function h(){return new a(function(p,m){o(u,d,p,m)})}return l=l?l.then(h,h):h()},!0)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}),CSr=Sn((i,e)=>{gn(),vn(),xn();var t=ASr(),r=SSr();function n(s,a,o,l,u){return new r(t().w(s,a,o,l),u||Promise)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}),Cwn=Sn((i,e)=>{gn(),vn(),xn();var t=CSr();function r(n,s,a,o,l){var u=t(n,s,a,o,l);return u.next().then(function(c){return c.done?c.value:u.next()})}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}),Twn=Sn((i,e)=>{gn(),vn(),xn();function t(r){var n=Object(r),s=[];for(var a in n)s.unshift(a);return function o(){for(;s.length;)if((a=s.pop())in n)return o.value=a,o.done=!1,o;return o.done=!0,o}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}),wwn=Sn((i,e)=>{gn(),vn(),xn();var t=r3e().default;function r(n){if(n!=null){var s=n[typeof Symbol=="function"&&Symbol.iterator||"@@iterator"],a=0;if(s)return s.call(n);if(typeof n.next=="function")return n;if(!isNaN(n.length))return{next:function(){return n&&a>=n.length&&(n=void 0),{value:n&&n[a++],done:!n}}}}throw new TypeError(t(n)+" is not iterable")}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}),Fwn=Sn((i,e)=>{gn(),vn(),xn();var t=bSr(),r=ASr(),n=Cwn(),s=CSr(),a=SSr(),o=Twn(),l=wwn();function u(){var c=r(),d=c.m(u),h=(Object.getPrototypeOf?Object.getPrototypeOf(d):d.__proto__).constructor;function p(v){var y=typeof v=="function"&&v.constructor;return!!y&&(y===h||(y.displayName||y.name)==="GeneratorFunction")}var m={throw:1,return:2,break:3,continue:3};function x(v){var y,E;return function(S){y||(y={stop:function(){return E(S.a,2)},catch:function(){return S.v},abrupt:function(C,T){return E(S.a,m[C],T)},delegateYield:function(C,T,I){return y.resultName=T,E(S.d,l(C),I)},finish:function(C){return E(S.f,C)}},E=function(C,T,I){S.p=y.prev,S.n=y.next;try{return C(T,I)}finally{y.next=S.n}}),y.resultName&&(y[y.resultName]=S.v,y.resultName=void 0),y.sent=S.v,y.next=S.n;try{return v.call(this,y)}finally{S.p=y.prev,S.n=y.next}}}return(e.exports=u=function(){return{wrap:function(v,y,E,S){return c.w(x(v),y,E,S&&S.reverse())},isGeneratorFunction:p,mark:c.m,awrap:function(v,y){return new t(v,y)},AsyncIterator:a,async:function(v,y,E,S,C){return(p(y)?s:n)(x(v),y,E,S,C)},keys:o,values:l}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=u,e.exports.__esModule=!0,e.exports.default=e.exports}),Rwn=Sn((i,e)=>{gn(),vn(),xn();var t=Fwn()();e.exports=t;try{regeneratorRuntime=t}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}),Pwn=Sn((i,e)=>{gn(),vn(),xn(),function(t,r){typeof i=="object"&&typeof e<"u"?r(i,vwn(),Awn(),ESr(),Swn(),Rwn()):typeof define=="function"&&define.amd?define(["exports","@babel/runtime/helpers/defineProperty","@babel/runtime/helpers/slicedToArray","fast-unique-numbers","@babel/runtime/helpers/asyncToGenerator","@babel/runtime/regenerator"],r):(t=typeof globalThis<"u"?globalThis:t||self,r(t.brokerFactory={},t._defineProperty,t._slicedToArray,t.fastUniqueNumbers,t._asyncToGenerator,t._regeneratorRuntime))}(i,function(t,r,n,s,a,o){var l=function(E){return typeof E.start=="function"},u=new WeakMap;function c(E,S){var C=Object.keys(E);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(E);S&&(T=T.filter(function(I){return Object.getOwnPropertyDescriptor(E,I).enumerable})),C.push.apply(C,T)}return C}function d(E){for(var S=1;S<arguments.length;S++){var C=arguments[S]!=null?arguments[S]:{};S%2?c(Object(C),!0).forEach(function(T){r(E,T,C[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(C)):c(Object(C)).forEach(function(T){Object.defineProperty(E,T,Object.getOwnPropertyDescriptor(C,T))})}return E}var h=function(E){return d(d({},E),{},{connect:function(S){var C=S.call;return a(o.mark(function T(){var I,B,O,L;return o.wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return I=new MessageChannel,B=I.port1,O=I.port2,k.next=1,C("connect",{port:B},[B]);case 1:return L=k.sent,u.set(O,L),k.abrupt("return",O);case 2:case"end":return k.stop()}},T)}))},disconnect:function(S){var C=S.call;return function(){var T=a(o.mark(function I(B){var O;return o.wrap(function(L){for(;;)switch(L.prev=L.next){case 0:if(O=u.get(B),O!==void 0){L.next=1;break}throw new Error("The given port is not connected.");case 1:return L.next=2,C("disconnect",{portId:O});case 2:case"end":return L.stop()}},I)}));return function(I){return T.apply(this,arguments)}}()},isSupported:function(S){var C=S.call;return function(){return C("isSupported")}}})};function p(E,S){var C=Object.keys(E);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(E);S&&(T=T.filter(function(I){return Object.getOwnPropertyDescriptor(E,I).enumerable})),C.push.apply(C,T)}return C}function m(E){for(var S=1;S<arguments.length;S++){var C=arguments[S]!=null?arguments[S]:{};S%2?p(Object(C),!0).forEach(function(T){r(E,T,C[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(C)):p(Object(C)).forEach(function(T){Object.defineProperty(E,T,Object.getOwnPropertyDescriptor(C,T))})}return E}var x=new WeakMap,v=function(E){if(x.has(E))return x.get(E);var S=new Map;return x.set(E,S),S},y=function(E){var S=h(E);return function(C){var T=v(C);C.addEventListener("message",function(X){var q=X.data,J=q.id;if(J!==null&&T.has(J)){var $=T.get(J),ee=$.reject,ae=$.resolve;T.delete(J),q.error===void 0?ae(q.result):ee(new Error(q.error.message))}}),l(C)&&C.start();for(var I=function(X){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return new Promise(function($,ee){var ae=s.generateUniqueNumber(T);T.set(ae,{reject:ee,resolve:$}),q===null?C.postMessage({id:ae,method:X},J):C.postMessage({id:ae,method:X,params:q},J)})},B=function(X,q){var J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];C.postMessage({id:null,method:X,params:q},J)},O={},L=0,k=Object.entries(S);L<k.length;L++){var U=n(k[L],2),j=U[0],Y=U[1];O=m(m({},O),{},r({},j,Y({call:I,notify:B})))}return m({},O)}};t.createBroker=y})}),Iwn=Sn((i,e)=>{gn(),vn(),xn(),function(t,r){typeof i=="object"&&typeof e<"u"?r(i,r3e(),Pwn(),ESr()):typeof define=="function"&&define.amd?define(["exports","@babel/runtime/helpers/typeof","broker-factory","fast-unique-numbers"],r):(t=typeof globalThis<"u"?globalThis:t||self,r(t.workerTimersBroker={},t._typeof,t.brokerFactory,t.fastUniqueNumbers))}(i,function(t,r,n,s){var a=new Map([[0,null]]),o=new Map([[0,null]]),l=n.createBroker({clearInterval:function(c){var d=c.call;return function(h){r(a.get(h))==="symbol"&&(a.set(h,null),d("clear",{timerId:h,timerType:"interval"}).then(function(){a.delete(h)}))}},clearTimeout:function(c){var d=c.call;return function(h){r(o.get(h))==="symbol"&&(o.set(h,null),d("clear",{timerId:h,timerType:"timeout"}).then(function(){o.delete(h)}))}},setInterval:function(c){var d=c.call;return function(h){for(var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,m=arguments.length,x=new Array(m>2?m-2:0),v=2;v<m;v++)x[v-2]=arguments[v];var y=Symbol(),E=s.generateUniqueNumber(a);a.set(E,y);var S=function(){return d("set",{delay:p,now:performance.timeOrigin+performance.now(),timerId:E,timerType:"interval"}).then(function(){var C=a.get(E);if(C===void 0)throw new Error("The timer is in an undefined state.");C===y&&(h.apply(void 0,x),a.get(E)===y&&S())})};return S(),E}},setTimeout:function(c){var d=c.call;return function(h){for(var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,m=arguments.length,x=new Array(m>2?m-2:0),v=2;v<m;v++)x[v-2]=arguments[v];var y=Symbol(),E=s.generateUniqueNumber(o);return o.set(E,y),d("set",{delay:p,now:performance.timeOrigin+performance.now(),timerId:E,timerType:"timeout"}).then(function(){var S=o.get(E);if(S===void 0)throw new Error("The timer is in an undefined state.");S===y&&(o.delete(E),h.apply(void 0,x))}),E}}}),u=function(c){var d=new Worker(c);return l(d)};t.load=u,t.wrap=l})}),Mwn=Sn((i,e)=>{gn(),vn(),xn(),function(t,r){typeof i=="object"&&typeof e<"u"?r(i,Iwn()):typeof define=="function"&&define.amd?define(["exports","worker-timers-broker"],r):(t=typeof globalThis<"u"?globalThis:t||self,r(t.workerTimers={},t.workerTimersBroker))}(i,function(t,r){var n=function(d,h){var p=null;return function(){if(p!==null)return p;var m=new Blob([h],{type:"application/javascript; charset=utf-8"}),x=URL.createObjectURL(m);return p=d(x),setTimeout(function(){return URL.revokeObjectURL(x)}),p}},s=`(()=>{var e={45:(e,t,r)=>{var n=r(738).default;e.exports=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},79:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n},e.exports.__esModule=!0,e.exports.default=e.exports},122:(e,t,r)=>{var n=r(79);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},156:e=>{e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,u,a,i=[],s=!0,c=!1;try{if(u=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=u.call(r)).done)&&(i.push(n.value),i.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return i}},e.exports.__esModule=!0,e.exports.default=e.exports},172:e=>{e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},293:e=>{function t(e,t,r,n,o,u,a){try{var i=e[u](a),s=i.value}catch(e){return void r(e)}i.done?t(s):Promise.resolve(s).then(n,o)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(o,u){var a=e.apply(r,n);function i(e){t(a,o,u,i,s,"next",e)}function s(e){t(a,o,u,i,s,"throw",e)}i(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},373:e=>{e.exports=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},389:function(e,t){!function(e){"use strict";var t=function(e){return function(t){var r=e(t);return t.add(r),r}},r=function(e){return function(t,r){return e.set(t,r),r}},n=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,o=536870912,u=2*o,a=function(e,t){return function(r){var a=t.get(r),i=void 0===a?r.size:a<u?a+1:0;if(!r.has(i))return e(r,i);if(r.size<o){for(;r.has(i);)i=Math.floor(Math.random()*u);return e(r,i)}if(r.size>n)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;r.has(i);)i=Math.floor(Math.random()*n);return e(r,i)}},i=new WeakMap,s=r(i),c=a(s,i),f=t(c);e.addUniqueNumber=f,e.generateUniqueNumber=c}(t)},472:function(e,t,r){!function(e,t,r,n){"use strict";var o=function(e,t){return function(r){var o=t.get(r);if(void 0===o)return Promise.resolve(!1);var u=n(o,2),a=u[0],i=u[1];return e(a),t.delete(r),i(!1),Promise.resolve(!0)}},u=function(e,t){var r=function(n,o,u,a){var i=n-e.now();i>0?o.set(a,[t(r,i,n,o,u,a),u]):(o.delete(a),u(!0))};return r},a=function(e,t,r,n){return function(o,u,a){var i=o+u-t.timeOrigin,s=i-t.now();return new Promise((function(t){e.set(a,[r(n,s,i,e,t,a),t])}))}},i=new Map,s=o(globalThis.clearTimeout,i),c=new Map,f=o(globalThis.clearTimeout,c),l=u(performance,globalThis.setTimeout),p=a(i,performance,globalThis.setTimeout,l),d=a(c,performance,globalThis.setTimeout,l);r.createWorker(self,{clear:function(){var r=e(t.mark((function e(r){var n,o,u;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.timerId,o=r.timerType,e.next=1,"interval"===o?s(n):f(n);case 1:return u=e.sent,e.abrupt("return",{result:u});case 2:case"end":return e.stop()}}),e)})));function n(e){return r.apply(this,arguments)}return n}(),set:function(){var r=e(t.mark((function e(r){var n,o,u,a,i;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.delay,o=r.now,u=r.timerId,a=r.timerType,e.next=1,("interval"===a?p:d)(n,o,u);case 1:return i=e.sent,e.abrupt("return",{result:i});case 2:case"end":return e.stop()}}),e)})));function n(e){return r.apply(this,arguments)}return n}()})}(r(293),r(756),r(623),r(715))},546:e=>{function t(r,n,o,u){var a=Object.defineProperty;try{a({},"",{})}catch(r){a=0}e.exports=t=function(e,r,n,o){if(r)a?a(e,r,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[r]=n;else{var u=function(r,n){t(e,r,(function(e){return this._invoke(r,n,e)}))};u("next",0),u("throw",1),u("return",2)}},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n,o,u)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},579:(e,t,r)=>{var n=r(738).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(n(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},623:function(e,t,r){!function(e,t,r,n,o){"use strict";var u={INTERNAL_ERROR:-32603,INVALID_PARAMS:-32602,METHOD_NOT_FOUND:-32601},a=function(e,t){return Object.assign(new Error(e),{status:t})},i=function(e){return a('The requested method called "'.concat(e,'" is not supported.'),u.METHOD_NOT_FOUND)},s=function(e){return a('The handler of the method called "'.concat(e,'" returned no required result.'),u.INTERNAL_ERROR)},c=function(e){return a('The handler of the method called "'.concat(e,'" returned an unexpected result.'),u.INTERNAL_ERROR)},f=function(e){return a('The specified parameter called "portId" with the given value "'.concat(e,'" does not identify a port connected to this worker.'),u.INVALID_PARAMS)},l=function(e,n){return function(){var o=t(r.mark((function t(o){var u,a,f,l,p,d,v,x,y,b,h,m,_,g,w;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(u=o.data,a=u.id,f=u.method,l=u.params,p=n[f],t.prev=1,void 0!==p){t.next=2;break}throw i(f);case 2:if(void 0!==(d=void 0===l?p():p(l))){t.next=3;break}throw s(f);case 3:if(!(d instanceof Promise)){t.next=5;break}return t.next=4,d;case 4:g=t.sent,t.next=6;break;case 5:g=d;case 6:if(v=g,null!==a){t.next=8;break}if(void 0===v.result){t.next=7;break}throw c(f);case 7:t.next=10;break;case 8:if(void 0!==v.result){t.next=9;break}throw c(f);case 9:x=v.result,y=v.transferables,b=void 0===y?[]:y,e.postMessage({id:a,result:x},b);case 10:t.next=12;break;case 11:t.prev=11,w=t.catch(1),h=w.message,m=w.status,_=void 0===m?-32603:m,e.postMessage({error:{code:_,message:h},id:a});case 12:case"end":return t.stop()}}),t,null,[[1,11]])})));return function(e){return o.apply(this,arguments)}}()},p=function(){return new Promise((function(e){var t=new ArrayBuffer(0),r=new MessageChannel,n=r.port1,o=r.port2;n.onmessage=function(t){var r=t.data;return e(null!==r)},o.postMessage(t,[t])}))};function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var x=new Map,y=function(e,n,u){return v(v({},n),{},{connect:function(t){var r=t.port;r.start();var u=e(r,n),a=o.generateUniqueNumber(x);return x.set(a,(function(){u(),r.close(),x.delete(a)})),{result:a}},disconnect:function(e){var t=e.portId,r=x.get(t);if(void 0===r)throw f(t);return r(),{result:null}},isSupported:function(){var e=t(r.mark((function e(){var t,n,o;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,p();case 1:if(!e.sent){e.next=5;break}if(!((t=u())instanceof Promise)){e.next=3;break}return e.next=2,t;case 2:o=e.sent,e.next=4;break;case 3:o=t;case 4:return n=o,e.abrupt("return",{result:n});case 5:return e.abrupt("return",{result:!1});case 6:case"end":return e.stop()}}),e)})));function n(){return e.apply(this,arguments)}return n}()})},b=function(e,t){var r=y(b,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0}),n=l(e,r);return e.addEventListener("message",n),function(){return e.removeEventListener("message",n)}};e.createWorker=b,e.isSupported=p}(t,r(293),r(756),r(693),r(389))},633:(e,t,r)=>{var n=r(172),o=r(993),u=r(869),a=r(887),i=r(791),s=r(373),c=r(579);function f(){"use strict";var t=o(),r=t.m(f),l=(Object.getPrototypeOf?Object.getPrototypeOf(r):r.__proto__).constructor;function p(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===l||"GeneratorFunction"===(t.displayName||t.name))}var d={throw:1,return:2,break:3,continue:3};function v(e){var t,r;return function(n){t||(t={stop:function(){return r(n.a,2)},catch:function(){return n.v},abrupt:function(e,t){return r(n.a,d[e],t)},delegateYield:function(e,o,u){return t.resultName=o,r(n.d,c(e),u)},finish:function(e){return r(n.f,e)}},r=function(e,r,o){n.p=t.prev,n.n=t.next;try{return e(r,o)}finally{t.next=n.n}}),t.resultName&&(t[t.resultName]=n.v,t.resultName=void 0),t.sent=n.v,t.next=n.n;try{return e.call(this,t)}finally{n.p=t.prev,n.n=t.next}}}return(e.exports=f=function(){return{wrap:function(e,r,n,o){return t.w(v(e),r,n,o&&o.reverse())},isGeneratorFunction:p,mark:t.m,awrap:function(e,t){return new n(e,t)},AsyncIterator:i,async:function(e,t,r,n,o){return(p(t)?a:u)(v(e),t,r,n,o)},keys:s,values:c}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=f,e.exports.__esModule=!0,e.exports.default=e.exports},693:(e,t,r)=>{var n=r(736);e.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},715:(e,t,r)=>{var n=r(987),o=r(156),u=r(122),a=r(752);e.exports=function(e,t){return n(e)||o(e,t)||u(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},736:(e,t,r)=>{var n=r(738).default,o=r(45);e.exports=function(e){var t=o(e,"string");return"symbol"==n(t)?t:t+""},e.exports.__esModule=!0,e.exports.default=e.exports},738:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},752:e=>{e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},756:(e,t,r)=>{var n=r(633)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},791:(e,t,r)=>{var n=r(172),o=r(546);e.exports=function e(t,r){function u(e,o,a,i){try{var s=t[e](o),c=s.value;return c instanceof n?r.resolve(c.v).then((function(e){u("next",e,a,i)}),(function(e){u("throw",e,a,i)})):r.resolve(c).then((function(e){s.value=e,a(s)}),(function(e){return u("throw",e,a,i)}))}catch(e){i(e)}}var a;this.next||(o(e.prototype),o(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",(function(){return this}))),o(this,"_invoke",(function(e,t,n){function o(){return new r((function(t,r){u(e,n,t,r)}))}return a=a?a.then(o,o):o()}),!0)},e.exports.__esModule=!0,e.exports.default=e.exports},869:(e,t,r)=>{var n=r(887);e.exports=function(e,t,r,o,u){var a=n(e,t,r,o,u);return a.next().then((function(e){return e.done?e.value:a.next()}))},e.exports.__esModule=!0,e.exports.default=e.exports},887:(e,t,r)=>{var n=r(993),o=r(791);e.exports=function(e,t,r,u,a){return new o(n().w(e,t,r,u),a||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},987:e=>{e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},993:(e,t,r)=>{var n=r(546);function o(){var t,r,u="function"==typeof Symbol?Symbol:{},a=u.iterator||"@@iterator",i=u.toStringTag||"@@toStringTag";function s(e,o,u,a){var i=o&&o.prototype instanceof f?o:f,s=Object.create(i.prototype);return n(s,"_invoke",function(e,n,o){var u,a,i,s=0,f=o||[],l=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return u=e,a=0,i=t,p.n=r,c}};function d(e,n){for(a=e,i=n,r=0;!l&&s&&!o&&r<f.length;r++){var o,u=f[r],d=p.p,v=u[2];e>3?(o=v===n)&&(i=u[(a=u[4])?5:(a=3,3)],u[4]=u[5]=t):u[0]<=d&&((o=e<2&&d<u[1])?(a=0,p.v=n,p.n=u[1]):d<v&&(o=e<3||u[0]>n||n>v)&&(u[4]=e,u[5]=n,p.n=v,a=0))}if(o||e>1)return c;throw l=!0,n}return function(o,f,v){if(s>1)throw TypeError("Generator is already running");for(l&&1===f&&d(f,v),a=f,i=v;(r=a<2?t:i)||!l;){u||(a?a<3?(a>1&&(p.n=-1),d(a,i)):p.n=i:p.v=i);try{if(s=2,u){if(a||(o="next"),r=u[o]){if(!(r=r.call(u,i)))throw TypeError("iterator result is not an object");if(!r.done)return r;i=r.value,a<2&&(a=0)}else 1===a&&(r=u.return)&&r.call(u),a<2&&(i=TypeError("The iterator does not provide a '"+o+"' method"),a=1);u=t}else if((r=(l=p.n<0)?i:e.call(n,p))!==c)break}catch(e){u=t,a=1,i=e}finally{s=1}}return{value:r,done:l}}}(e,u,a),!0),s}var c={};function f(){}function l(){}function p(){}r=Object.getPrototypeOf;var d=[][a]?r(r([][a]())):(n(r={},a,(function(){return this})),r),v=p.prototype=f.prototype=Object.create(d);function x(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,n(e,i,"GeneratorFunction")),e.prototype=Object.create(v),e}return l.prototype=p,n(v,"constructor",p),n(p,"constructor",l),l.displayName="GeneratorFunction",n(p,i,"GeneratorFunction"),n(v),n(v,i,"Generator"),n(v,a,(function(){return this})),n(v,"toString",(function(){return"[object Generator]"})),(e.exports=o=function(){return{w:s,m:x}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var u=t[n]={exports:{}};return e[n].call(u.exports,u,u.exports,r),u.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";r(472)})()})();`,a=n(r.load,s),o=function(d){return a().clearInterval(d)},l=function(d){return a().clearTimeout(d)},u=function(){var d;return(d=a()).setInterval.apply(d,arguments)},c=function(){var d;return(d=a()).setTimeout.apply(d,arguments)};t.clearInterval=o,t.clearTimeout=l,t.setInterval=u,t.setTimeout=c})}),i3e=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"__esModule",{value:!0}),i.isReactNativeBrowser=i.isWebWorker=void 0;var e=()=>{var s;return typeof window<"u"?typeof navigator<"u"&&((s=navigator.userAgent)==null?void 0:s.toLowerCase().indexOf(" electron/"))>-1&&(wd!=null&&wd.versions)?!Object.prototype.hasOwnProperty.call(wd.versions,"electron"):typeof window.document<"u":!1},t=()=>{var s,a;return!!(typeof self=="object"&&((a=(s=self==null?void 0:self.constructor)==null?void 0:s.name)!=null&&a.includes("WorkerGlobalScope")))},r=()=>typeof navigator<"u"&&navigator.product==="ReactNative",n=e()||t()||r();i.isWebWorker=t(),i.isReactNativeBrowser=r(),i.default=n}),Bwn=Sn(i=>{gn(),vn(),xn();var e=i&&i.__createBinding||(Object.create?function(u,c,d,h){h===void 0&&(h=d);var p=Object.getOwnPropertyDescriptor(c,d);(!p||("get"in p?!c.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return c[d]}}),Object.defineProperty(u,h,p)}:function(u,c,d,h){h===void 0&&(h=d),u[h]=c[d]}),t=i&&i.__setModuleDefault||(Object.create?function(u,c){Object.defineProperty(u,"default",{enumerable:!0,value:c})}:function(u,c){u.default=c}),r=i&&i.__importStar||function(){var u=function(c){return u=Object.getOwnPropertyNames||function(d){var h=[];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(h[h.length]=p);return h},u(c)};return function(c){if(c&&c.__esModule)return c;var d={};if(c!=null)for(var h=u(c),p=0;p<h.length;p++)h[p]!=="default"&&e(d,c,h[p]);return t(d,c),d}}();Object.defineProperty(i,"__esModule",{value:!0});var n=Mwn(),s=r(i3e()),a={set:n.setInterval,clear:n.clearInterval},o={set:(u,c)=>setInterval(u,c),clear:u=>clearInterval(u)},l=u=>{switch(u){case"native":return o;case"worker":return a;case"auto":default:return s.default&&!s.isWebWorker&&!s.isReactNativeBrowser?a:o}};i.default=l}),TSr=Sn(i=>{gn(),vn(),xn();var e=i&&i.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(i,"__esModule",{value:!0});var t=e(Bwn()),r=class{constructor(n,s){pr(this,"_keepalive");pr(this,"timerId");pr(this,"timer");pr(this,"destroyed",!1);pr(this,"counter");pr(this,"client");pr(this,"_keepaliveTimeoutTimestamp");pr(this,"_intervalEvery");this.client=n,this.timer=typeof s=="object"&&"set"in s&&"clear"in s?s:(0,t.default)(s),this.setKeepalive(n.options.keepalive)}get keepaliveTimeoutTimestamp(){return this._keepaliveTimeoutTimestamp}get intervalEvery(){return this._intervalEvery}get keepalive(){return this._keepalive}clear(){this.timerId&&(this.timer.clear(this.timerId),this.timerId=null)}setKeepalive(n){if(n*=1e3,isNaN(n)||n<=0||n>2147483647)throw new Error(`Keepalive value must be an integer between 0 and 2147483647. Provided value is ${n}`);this._keepalive=n,this.reschedule(),this.client.log(`KeepaliveManager: set keepalive to ${n}ms`)}destroy(){this.clear(),this.destroyed=!0}reschedule(){if(this.destroyed)return;this.clear(),this.counter=0;let n=Math.ceil(this._keepalive*1.5);this._keepaliveTimeoutTimestamp=Date.now()+n,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)}};i.default=r}),wit=Sn(i=>{var T;gn(),vn(),xn();var e=i&&i.__createBinding||(Object.create?function(I,B,O,L){L===void 0&&(L=O);var k=Object.getOwnPropertyDescriptor(B,O);(!k||("get"in k?!B.__esModule:k.writable||k.configurable))&&(k={enumerable:!0,get:function(){return B[O]}}),Object.defineProperty(I,L,k)}:function(I,B,O,L){L===void 0&&(L=O),I[L]=B[O]}),t=i&&i.__setModuleDefault||(Object.create?function(I,B){Object.defineProperty(I,"default",{enumerable:!0,value:B})}:function(I,B){I.default=B}),r=i&&i.__importStar||function(){var I=function(B){return I=Object.getOwnPropertyNames||function(O){var L=[];for(var k in O)Object.prototype.hasOwnProperty.call(O,k)&&(L[L.length]=k);return L},I(B)};return function(B){if(B&&B.__esModule)return B;var O={};if(B!=null)for(var L=I(B),k=0;k<L.length;k++)L[k]!=="default"&&e(O,B,L[k]);return t(O,B),O}}(),n=i&&i.__importDefault||function(I){return I&&I.__esModule?I:{default:I}};Object.defineProperty(i,"__esModule",{value:!0});var s=n(jTn()),a=HO(),o=n(WTn()),l=n(h9()),u=r(XTn()),c=n(fSr()),d=n(fwn()),h=n(DSr()),p=n(pwn()),m=VH(),x=mwn(),v=n(TSr()),y=r(i3e()),E=globalThis.setImmediate||((...I)=>{let B=I.shift();(0,m.nextTick)(()=>{B(...I)})}),S={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0,subscribeBatchSize:null,writeCache:!0,timerVariant:"auto"},C=(T=class extends x.TypedEventEmitter{constructor(O,L){super();pr(this,"connected");pr(this,"disconnecting");pr(this,"disconnected");pr(this,"reconnecting");pr(this,"incomingStore");pr(this,"outgoingStore");pr(this,"options");pr(this,"queueQoSZero");pr(this,"_reconnectCount");pr(this,"log");pr(this,"messageIdProvider");pr(this,"outgoing");pr(this,"messageIdToTopic");pr(this,"noop");pr(this,"keepaliveManager");pr(this,"stream");pr(this,"queue");pr(this,"streamBuilder");pr(this,"_resubscribeTopics");pr(this,"connackTimer");pr(this,"reconnectTimer");pr(this,"_storeProcessing");pr(this,"_packetIdsDuringStoreProcessing");pr(this,"_storeProcessingQueue");pr(this,"_firstConnection");pr(this,"topicAliasRecv");pr(this,"topicAliasSend");pr(this,"_deferredReconnect");pr(this,"connackPacket");this.options=L||{};for(let k in S)typeof this.options[k]>"u"?this.options[k]=S[k]:this.options[k]=L[k];this.log=this.options.log||(0,l.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: version:",T.VERSION),y.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",y.default?"browser":"node"),this.log("MqttClient :: options.protocol",L.protocol),this.log("MqttClient :: options.protocolVersion",L.protocolVersion),this.log("MqttClient :: options.username",L.username),this.log("MqttClient :: options.keepalive",L.keepalive),this.log("MqttClient :: options.reconnectPeriod",L.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",L.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",L.properties?L.properties.topicAliasMaximum:void 0),this.options.clientId=typeof L.clientId=="string"?L.clientId:T.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=L.protocolVersion===5&&L.customHandleAcks?L.customHandleAcks:(...k)=>{k[3](null,0)},this.options.writeCache||(s.default.writeToStream.cacheNumbers=!1),this.streamBuilder=O,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new h.default:this.options.messageIdProvider,this.outgoingStore=L.outgoingStore||new c.default,this.incomingStore=L.incomingStore||new c.default,this.queueQoSZero=L.queueQoSZero===void 0?!0:L.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,L.properties&&L.properties.topicAliasMaximum>0&&(L.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new p.default(L.properties.topicAliasMaximum)),this.on("connect",()=>{let{queue:k}=this,U=()=>{let j=k.shift();this.log("deliver :: entry %o",j);let Y=null;if(!j){this._resubscribe();return}Y=j.packet,this.log("deliver :: call _sendPacket for %o",Y);let X=!0;Y.messageId&&Y.messageId!==0&&(this.messageIdProvider.register(Y.messageId)||(X=!1)),X?this._sendPacket(Y,q=>{j.cb&&j.cb(q),U()}):(this.log("messageId: %d has already used. The message is skipped and removed.",Y.messageId),U())};this.log("connect :: sending queued packets"),U()}),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())}static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}handleAuth(O,L){L()}handleMessage(O,L){L()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}connect(){var J;let O=new a.Writable,L=s.default.parser(this.options),k=null,U=[];this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this.disconnected&&!this.reconnecting&&(this.incomingStore=this.options.incomingStore||new c.default,this.outgoingStore=this.options.outgoingStore||new c.default,this.disconnecting=!1,this.disconnected=!1),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),L.on("packet",$=>{this.log("parser :: on packet push to packets array."),U.push($)});let j=()=>{this.log("work :: getting next packet in queue");let $=U.shift();if($)this.log("work :: packet pulled from queue"),(0,d.default)(this,$,Y);else{this.log("work :: no packets in queue");let ee=k;k=null,this.log("work :: done flag is %s",!!ee),ee&&ee()}},Y=()=>{if(U.length)(0,m.nextTick)(j);else{let $=k;k=null,$()}};O._write=($,ee,ae)=>{k=ae,this.log("writable stream :: parsing buffer"),L.parse($),j()};let X=$=>{this.log("streamErrorHandler :: error",$.message),$.code?(this.log("streamErrorHandler :: emitting error"),this.emit("error",$)):this.noop($)};this.log("connect :: pipe stream to writable stream"),this.stream.pipe(O),this.stream.on("error",X),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 q={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&&(q.will={...this.options.will,payload:(J=this.options.will)==null?void 0:J.payload}),this.topicAliasRecv&&(q.properties||(q.properties={}),this.topicAliasRecv&&(q.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket(q),L.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 $={cmd:"auth",reasonCode:0,...this.options.authPacket};this._writePacket($)}}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(O,L,k,U){this.log("publish :: message `%s` to topic `%s`",L,O);let{options:j}=this;typeof k=="function"&&(U=k,k=null),k=k||{},k={qos:0,retain:!1,dup:!1,...k};let{qos:Y,retain:X,dup:q,properties:J,cbStorePut:$}=k;if(this._checkDisconnecting(U))return this;let ee=()=>{let ae=0;if((Y===1||Y===2)&&(ae=this._nextId(),ae===null))return this.log("No messageId left"),!1;let ce={cmd:"publish",topic:O,payload:L,qos:Y,retain:X,messageId:ae,dup:q};switch(j.protocolVersion===5&&(ce.properties=J),this.log("publish :: qos",Y),Y){case 1:case 2:this.outgoing[ce.messageId]={volatile:!1,cb:U||this.noop},this.log("MqttClient:publish: packet cmd: %s",ce.cmd),this._sendPacket(ce,void 0,$);break;default:this.log("MqttClient:publish: packet cmd: %s",ce.cmd),this._sendPacket(ce,U,$);break}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!ee())&&this._storeProcessingQueue.push({invoke:ee,cbStorePut:k.cbStorePut,callback:U}),this}publishAsync(O,L,k){return new Promise((U,j)=>{this.publish(O,L,k,(Y,X)=>{Y?j(Y):U(X)})})}subscribe(O,L,k){let U=this.options.protocolVersion;typeof L=="function"&&(k=L),k=k||this.noop;let j=!1,Y=[];typeof O=="string"?(O=[O],Y=O):Array.isArray(O)?Y=O:typeof O=="object"&&(j=O.resubscribe,delete O.resubscribe,Y=Object.keys(O));let X=u.validateTopics(Y);if(X!==null)return E(k,new Error(`Invalid topic ${X}`)),this;if(this._checkDisconnecting(k))return this.log("subscribe: discconecting true"),this;let q={qos:0};U===5&&(q.nl=!1,q.rap=!1,q.rh=0),L={...q,...L};let{properties:J}=L,$=[],ee=(re,se)=>{if(se=se||L,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,re)||this._resubscribeTopics[re].qos<se.qos||j){let fe={topic:re,qos:se.qos};U===5&&(fe.nl=se.nl,fe.rap=se.rap,fe.rh=se.rh,fe.properties=J),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",fe.topic,fe.qos),$.push(fe)}};if(Array.isArray(O)?O.forEach(re=>{this.log("subscribe: array topic %s",re),ee(re)}):Object.keys(O).forEach(re=>{this.log("subscribe: object topic %s, %o",re,O[re]),ee(re,O[re])}),!$.length)return k(null,[]),this;let ae=(re,se)=>{let fe={cmd:"subscribe",subscriptions:re,messageId:se};if(J&&(fe.properties=J),this.options.resubscribe){this.log("subscribe :: resubscribe true");let oe=[];re.forEach(ve=>{if(this.options.reconnectPeriod>0){let ne={qos:ve.qos};U===5&&(ne.nl=ve.nl||!1,ne.rap=ve.rap||!1,ne.rh=ve.rh||0,ne.properties=ve.properties),this._resubscribeTopics[ve.topic]=ne,oe.push(ve.topic)}}),this.messageIdToTopic[fe.messageId]=oe}let me=new Promise((oe,ve)=>{this.outgoing[fe.messageId]={volatile:!0,cb(ne,pe){if(!ne){let{granted:Ae}=pe;for(let Ge=0;Ge<Ae.length;Ge+=1)re[Ge].qos=Ae[Ge]}ne?ve(new m.ErrorWithSubackPacket(ne.message,pe)):oe(pe)}}});return this.log("subscribe :: call _sendPacket"),this._sendPacket(fe),me},ce=()=>{let re=this.options.subscribeBatchSize??$.length,se=[];for(let fe=0;fe<$.length;fe+=re){let me=$.slice(fe,fe+re),oe=this._nextId();if(oe===null)return this.log("No messageId left"),!1;se.push(ae(me,oe))}return Promise.all(se).then(fe=>{k(null,$,fe.at(-1))}).catch(fe=>{k(fe,$,fe.packet)}),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!ce())&&this._storeProcessingQueue.push({invoke:ce,callback:k}),this}subscribeAsync(O,L){return new Promise((k,U)=>{this.subscribe(O,L,(j,Y)=>{j?U(j):k(Y)})})}unsubscribe(O,L,k){typeof O=="string"&&(O=[O]),typeof L=="function"&&(k=L),k=k||this.noop;let U=u.validateTopics(O);if(U!==null)return E(k,new Error(`Invalid topic ${U}`)),this;if(this._checkDisconnecting(k))return this;let j=()=>{let Y=this._nextId();if(Y===null)return this.log("No messageId left"),!1;let X={cmd:"unsubscribe",messageId:Y,unsubscriptions:[]};return typeof O=="string"?X.unsubscriptions=[O]:Array.isArray(O)&&(X.unsubscriptions=O),this.options.resubscribe&&X.unsubscriptions.forEach(q=>{delete this._resubscribeTopics[q]}),typeof L=="object"&&L.properties&&(X.properties=L.properties),this.outgoing[X.messageId]={volatile:!0,cb:k},this.log("unsubscribe: call _sendPacket"),this._sendPacket(X),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!j())&&this._storeProcessingQueue.push({invoke:j,callback:k}),this}unsubscribeAsync(O,L){return new Promise((k,U)=>{this.unsubscribe(O,L,(j,Y)=>{j?U(j):k(Y)})})}end(O,L,k){this.log("end :: (%s)",this.options.clientId),(O==null||typeof O!="boolean")&&(k=k||L,L=O,O=!1),typeof L!="object"&&(k=k||L,L=null),this.log("end :: cb? %s",!!k),(!k||typeof k!="function")&&(k=this.noop);let U=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this.incomingStore.close(Y=>{this.outgoingStore.close(X=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),k){let q=Y||X;this.log("end :: closeStores: invoking callback with args"),k(q)}})}),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,O),this._cleanUp(O,()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),(0,m.nextTick)(U)},L)};return this.disconnecting?(k(),this):(this._clearReconnect(),this.disconnecting=!0,!O&&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(O,L){return new Promise((k,U)=>{this.end(O,L,j=>{j?U(j):k()})})}removeOutgoingMessage(O){if(this.outgoing[O]){let{cb:L}=this.outgoing[O];this._removeOutgoingAndStoreMessage(O,()=>{L(new Error("Message removed"))})}return this}reconnect(O){this.log("client reconnect");let L=()=>{O?(this.options.incomingStore=O.incomingStore,this.options.outgoingStore=O.outgoingStore):(this.options.incomingStore=null,this.options.outgoingStore=null),this.incomingStore=this.options.incomingStore||new c.default,this.outgoingStore=this.options.outgoingStore||new c.default,this.disconnecting=!1,this.disconnected=!1,this._deferredReconnect=null,this._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=L:L(),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(O=>{this.outgoing[O].volatile&&typeof this.outgoing[O].cb=="function"&&(this.outgoing[O].cb(new Error("Connection closed")),delete this.outgoing[O])}))}_flush(){this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach(O=>{typeof this.outgoing[O].cb=="function"&&(this.outgoing[O].cb(new Error("Connection closed")),delete this.outgoing[O])}))}_removeTopicAliasAndRecoverTopicName(O){let L;O.properties&&(L=O.properties.topicAlias);let k=O.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",L,k),k.length===0){if(typeof L>"u")return new Error("Unregistered Topic Alias");if(k=this.topicAliasSend.getTopicByAlias(L),typeof k>"u")return new Error("Unregistered Topic Alias");O.topic=k}L&&delete O.properties.topicAlias}_checkDisconnecting(O){return this.disconnecting&&(O&&O!==this.noop?O(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(O,L,k={}){if(L&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",L)),this.log("_cleanUp :: forced? %s",O),O)this.options.reconnectPeriod===0&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{let U={cmd:"disconnect",...k};this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(U,()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),E(()=>{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(),L&&!this.connected&&(this.log("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",L),L())}_storeAndSend(O,L,k){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",O.cmd);let U=O,j;if(U.cmd==="publish"&&(U=(0,o.default)(O),j=this._removeTopicAliasAndRecoverTopicName(U),j))return L&&L(j);this.outgoingStore.put(U,Y=>{if(Y)return L&&L(Y);k(),this._writePacket(O,L)})}_applyTopicAlias(O){if(this.options.protocolVersion===5&&O.cmd==="publish"){let L;O.properties&&(L=O.properties.topicAlias);let k=O.topic.toString();if(this.topicAliasSend)if(L){if(k.length!==0&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",k,L),!this.topicAliasSend.put(k,L)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",k,L),new Error("Sending Topic Alias out of range")}else k.length!==0&&(this.options.autoAssignTopicAlias?(L=this.topicAliasSend.getAliasByTopic(k),L?(O.topic="",O.properties={...O.properties,topicAlias:L},this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",k,L)):(L=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(k,L),O.properties={...O.properties,topicAlias:L},this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",k,L))):this.options.autoUseTopicAlias&&(L=this.topicAliasSend.getAliasByTopic(k),L&&(O.topic="",O.properties={...O.properties,topicAlias:L},this.log("applyTopicAlias :: auto use topic: %s - alias: %d",k,L))));else if(L)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",k,L),new Error("Sending Topic Alias out of range")}}_noop(O){this.log("noop ::",O)}_writePacket(O,L){this.log("_writePacket :: packet: %O",O),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",O),this.log("_writePacket :: writing to stream");let k=s.default.writeToStream(O,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",k),!k&&L&&L!==this.noop?(this.log("_writePacket :: handle events on `drain` once through callback."),this.stream.once("drain",L)):L&&(this.log("_writePacket :: invoking cb"),L())}_sendPacket(O,L,k,U){this.log("_sendPacket :: (%s) :: start",this.options.clientId),k=k||this.noop,L=L||this.noop;let j=this._applyTopicAlias(O);if(j){L(j);return}if(!this.connected){if(O.cmd==="auth"){this._writePacket(O,L);return}this.log("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(O,L,k);return}if(U){this._writePacket(O,L);return}switch(O.cmd){case"publish":break;case"pubrel":this._storeAndSend(O,L,k);return;default:this._writePacket(O,L);return}switch(O.qos){case 2:case 1:this._storeAndSend(O,L,k);break;case 0:default:this._writePacket(O,L);break}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}_storePacket(O,L,k){this.log("_storePacket :: packet: %o",O),this.log("_storePacket :: cb? %s",!!L),k=k||this.noop;let U=O;if(U.cmd==="publish"){U=(0,o.default)(O);let Y=this._removeTopicAliasAndRecoverTopicName(U);if(Y)return L&&L(Y)}let j=U.qos||0;j===0&&this.queueQoSZero||U.cmd!=="publish"?this.queue.push({packet:U,cb:L}):j>0?(L=this.outgoing[U.messageId]?this.outgoing[U.messageId].cb:null,this.outgoingStore.put(U,Y=>{if(Y)return L&&L(Y);k()})):L&&L(new Error("No connection to broker"))}_setupKeepaliveManager(){this.log("_setupKeepaliveManager :: keepalive %d (seconds)",this.options.keepalive),!this.keepaliveManager&&this.options.keepalive&&(this.keepaliveManager=new v.default(this,this.options.timerVariant))}_destroyKeepaliveManager(){this.keepaliveManager&&(this.log("_destroyKeepaliveManager :: destroying keepalive manager"),this.keepaliveManager.destroy(),this.keepaliveManager=null)}reschedulePing(O=!1){this.keepaliveManager&&this.options.keepalive&&(O||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 O=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion>=4&&!this.connackPacket.sessionPresent)&&O.length>0)if(this.options.resubscribe)if(this.options.protocolVersion===5){this.log("_resubscribe: protocolVersion 5");for(let L=0;L<O.length;L++){let k={};k[O[L]]=this._resubscribeTopics[O[L]],k.resubscribe=!0,this.subscribe(k,{properties:k[O[L]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1}_onConnect(O){if(this.disconnected){this.emit("connect",O);return}this.connackPacket=O,this.messageIdProvider.clear(),this._setupKeepaliveManager(),this.connected=!0;let L=()=>{let k=this.outgoingStore.createStream(),U=()=>{k.destroy(),k=null,this._flushStoreProcessingQueue(),j()},j=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",U),k.on("error",X=>{j(),this._flushStoreProcessingQueue(),this.removeListener("close",U),this.emit("error",X)});let Y=()=>{if(!k)return;let X=k.read(1),q;if(!X){k.once("readable",Y);return}if(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[X.messageId]){Y();return}!this.disconnecting&&!this.reconnectTimer?(q=this.outgoing[X.messageId]?this.outgoing[X.messageId].cb:null,this.outgoing[X.messageId]={volatile:!1,cb(J,$){q&&q(J,$),Y()}},this._packetIdsDuringStoreProcessing[X.messageId]=!0,this.messageIdProvider.register(X.messageId)?this._sendPacket(X,void 0,void 0,!0):this.log("messageId: %d has already used.",X.messageId)):k.destroy&&k.destroy()};k.on("end",()=>{let X=!0;for(let q in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[q]){X=!1;break}this.removeListener("close",U),X?(j(),this._invokeAllStoreProcessingQueue(),this.emit("connect",O)):L()}),Y()};L()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){let O=this._storeProcessingQueue[0];if(O&&O.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(let O of this._storeProcessingQueue)O.cbStorePut&&O.cbStorePut(new Error("Connection closed")),O.callback&&O.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)}_removeOutgoingAndStoreMessage(O,L){delete this.outgoing[O],this.outgoingStore.del({messageId:O},(k,U)=>{L(k,U),this.messageIdProvider.deallocate(O),this._invokeStoreProcessingQueue()})}},pr(T,"VERSION",m.MQTTJS_VERSION),T);i.default=C}),Own=Sn(i=>{gn(),vn(),xn(),Object.defineProperty(i,"__esModule",{value:!0});var e=ySr(),t=class{constructor(){pr(this,"numberAllocator");pr(this,"lastId");this.numberAllocator=new e.NumberAllocator(1,65535)}allocate(){return this.lastId=this.numberAllocator.alloc(),this.lastId}getLastAllocated(){return this.lastId}register(r){return this.numberAllocator.use(r)}deallocate(r){this.numberAllocator.free(r)}clear(){this.numberAllocator.clear()}};i.default=t});function Lwn(){if(Fit)return n3e;Fit=!0;let i=2147483647,e=36,t=1,r=26,n=38,s=700,a=72,o=128,l="-",u=/^xn--/,c=/[^\0-\x7F]/,d=/[\x2E\u3002\uFF0E\uFF61]/g,h={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=e-t,m=Math.floor,x=String.fromCharCode;function v(k){throw new RangeError(h[k])}function y(k,U){let j=[],Y=k.length;for(;Y--;)j[Y]=U(k[Y]);return j}function E(k,U){let j=k.split("@"),Y="";j.length>1&&(Y=j[0]+"@",k=j[1]),k=k.replace(d,".");let X=k.split("."),q=y(X,U).join(".");return Y+q}function S(k){let U=[],j=0,Y=k.length;for(;j<Y;){let X=k.charCodeAt(j++);if(X>=55296&&X<=56319&&j<Y){let q=k.charCodeAt(j++);(q&64512)==56320?U.push(((X&1023)<<10)+(q&1023)+65536):(U.push(X),j--)}else U.push(X)}return U}let C=k=>String.fromCodePoint(...k),T=function(k){return k>=48&&k<58?26+(k-48):k>=65&&k<91?k-65:k>=97&&k<123?k-97:e},I=function(k,U){return k+22+75*(k<26)-((U!=0)<<5)},B=function(k,U,j){let Y=0;for(k=j?m(k/s):k>>1,k+=m(k/U);k>p*r>>1;Y+=e)k=m(k/p);return m(Y+(p+1)*k/(k+n))},O=function(k){let U=[],j=k.length,Y=0,X=o,q=a,J=k.lastIndexOf(l);J<0&&(J=0);for(let $=0;$<J;++$)k.charCodeAt($)>=128&&v("not-basic"),U.push(k.charCodeAt($));for(let $=J>0?J+1:0;$<j;){let ee=Y;for(let ce=1,re=e;;re+=e){$>=j&&v("invalid-input");let se=T(k.charCodeAt($++));se>=e&&v("invalid-input"),se>m((i-Y)/ce)&&v("overflow"),Y+=se*ce;let fe=re<=q?t:re>=q+r?r:re-q;if(se<fe)break;let me=e-fe;ce>m(i/me)&&v("overflow"),ce*=me}let ae=U.length+1;q=B(Y-ee,ae,ee==0),m(Y/ae)>i-X&&v("overflow"),X+=m(Y/ae),Y%=ae,U.splice(Y++,0,X)}return String.fromCodePoint(...U)},L=function(k){let U=[];k=S(k);let j=k.length,Y=o,X=0,q=a;for(let ee of k)ee<128&&U.push(x(ee));let J=U.length,$=J;for(J&&U.push(l);$<j;){let ee=i;for(let ce of k)ce>=Y&&ce<ee&&(ee=ce);let ae=$+1;ee-Y>m((i-X)/ae)&&v("overflow"),X+=(ee-Y)*ae,Y=ee;for(let ce of k)if(ce<Y&&++X>i&&v("overflow"),ce===Y){let re=X;for(let se=e;;se+=e){let fe=se<=q?t:se>=q+r?r:se-q;if(re<fe)break;let me=re-fe,oe=e-fe;U.push(x(I(fe+me%oe,0))),re=m(me/oe)}U.push(x(I(re,0))),q=B(X,ae,$===J),X=0,++$}++X,++Y}return U.join("")};return n3e={version:"2.3.1",ucs2:{decode:S,encode:C},decode:O,encode:L,toASCII:function(k){return E(k,function(U){return c.test(U)?"xn--"+L(U):U})},toUnicode:function(k){return E(k,function(U){return u.test(U)?O(U.slice(4).toLowerCase()):U})}},n3e}var n3e,Fit,YF,Nwn=Ey(()=>{gn(),vn(),xn(),n3e={},Fit=!1,YF=Lwn(),YF.decode,YF.encode,YF.toASCII,YF.toUnicode,YF.ucs2,YF.version});function kwn(){return Mit||(Mit=!0,Iit=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var i={},e=Symbol("test"),t=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(t)!=="[object Symbol]")return!1;var r=42;i[e]=r;for(e in i)return!1;if(typeof Object.keys=="function"&&Object.keys(i).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(i).length!==0)return!1;var n=Object.getOwnPropertySymbols(i);if(n.length!==1||n[0]!==e||!Object.prototype.propertyIsEnumerable.call(i,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(i,e);if(s.value!==r||s.enumerable!==!0)return!1}return!0}),Iit}function Vwn(){return Oit||(Oit=!0,Bit=Error),Bit}function Uwn(){return Nit||(Nit=!0,Lit=EvalError),Lit}function Gwn(){return Vit||(Vit=!0,kit=RangeError),kit}function zwn(){return Git||(Git=!0,Uit=ReferenceError),Uit}function wSr(){return jit||(jit=!0,zit=SyntaxError),zit}function Cte(){return Wit||(Wit=!0,Hit=TypeError),Hit}function jwn(){return Yit||(Yit=!0,Xit=URIError),Xit}function Hwn(){if(qit)return s3e;qit=!0;var i=typeof Symbol<"u"&&Symbol,e=kwn();return s3e=function(){return typeof i!="function"||typeof Symbol!="function"||typeof i("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},s3e}function Wwn(){if(Qit)return a3e;Qit=!0;var i={__proto__:null,foo:{}},e=Object;return a3e=function(){return{__proto__:i}.foo===i.foo&&!(i instanceof e)},a3e}function Xwn(){if(Kit)return o3e;Kit=!0;var i="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,t=Math.max,r="[object Function]",n=function(o,l){for(var u=[],c=0;c<o.length;c+=1)u[c]=o[c];for(var d=0;d<l.length;d+=1)u[d+o.length]=l[d];return u},s=function(o,l){for(var u=[],c=l,d=0;c<o.length;c+=1,d+=1)u[d]=o[c];return u},a=function(o,l){for(var u="",c=0;c<o.length;c+=1)u+=o[c],c+1<o.length&&(u+=l);return u};return o3e=function(o){var l=this;if(typeof l!="function"||e.apply(l)!==r)throw new TypeError(i+l);for(var u=s(arguments,1),c,d=function(){if(this instanceof c){var v=l.apply(this,n(u,arguments));return Object(v)===v?v:this}return l.apply(o,n(u,arguments))},h=t(0,l.length-u.length),p=[],m=0;m<h;m++)p[m]="$"+m;if(c=Function("binder","return function ("+a(p,",")+"){ return binder.apply(this,arguments); }")(d),l.prototype){var x=function(){};x.prototype=l.prototype,c.prototype=new x,x.prototype=null}return c},o3e}function Rit(){if(Jit)return l3e;Jit=!0;var i=Xwn();return l3e=Function.prototype.bind||i,l3e}function Ywn(){if(Zit)return u3e;Zit=!0;var i=Function.prototype.call,e=Object.prototype.hasOwnProperty,t=Rit();return u3e=t.call(i,e),u3e}function UH(){if($it)return c3e;$it=!0;var i,e=Vwn(),t=Uwn(),r=Gwn(),n=zwn(),s=wSr(),a=Cte(),o=jwn(),l=Function,u=function($){try{return l('"use strict"; return ('+$+").constructor;")()}catch{}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch{c=null}var d=function(){throw new a},h=c?function(){try{return arguments.callee,d}catch{try{return c(arguments,"callee").get}catch{return d}}}():d,p=Hwn()(),m=Wwn()(),x=Object.getPrototypeOf||(m?function($){return $.__proto__}:null),v={},y=typeof Uint8Array>"u"||!x?i:x(Uint8Array),E={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?i:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?i:ArrayBuffer,"%ArrayIteratorPrototype%":p&&x?x([][Symbol.iterator]()):i,"%AsyncFromSyncIteratorPrototype%":i,"%AsyncFunction%":v,"%AsyncGenerator%":v,"%AsyncGeneratorFunction%":v,"%AsyncIteratorPrototype%":v,"%Atomics%":typeof Atomics>"u"?i:Atomics,"%BigInt%":typeof BigInt>"u"?i:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?i:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?i:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?i:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":e,"%eval%":eval,"%EvalError%":t,"%Float32Array%":typeof Float32Array>"u"?i:Float32Array,"%Float64Array%":typeof Float64Array>"u"?i:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?i:FinalizationRegistry,"%Function%":l,"%GeneratorFunction%":v,"%Int8Array%":typeof Int8Array>"u"?i:Int8Array,"%Int16Array%":typeof Int16Array>"u"?i:Int16Array,"%Int32Array%":typeof Int32Array>"u"?i:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":p&&x?x(x([][Symbol.iterator]())):i,"%JSON%":typeof JSON=="object"?JSON:i,"%Map%":typeof Map>"u"?i:Map,"%MapIteratorPrototype%":typeof Map>"u"||!p||!x?i:x(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?i:Promise,"%Proxy%":typeof Proxy>"u"?i:Proxy,"%RangeError%":r,"%ReferenceError%":n,"%Reflect%":typeof Reflect>"u"?i:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?i:Set,"%SetIteratorPrototype%":typeof Set>"u"||!p||!x?i:x(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?i:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":p&&x?x(""[Symbol.iterator]()):i,"%Symbol%":p?Symbol:i,"%SyntaxError%":s,"%ThrowTypeError%":h,"%TypedArray%":y,"%TypeError%":a,"%Uint8Array%":typeof Uint8Array>"u"?i:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?i:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?i:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?i:Uint32Array,"%URIError%":o,"%WeakMap%":typeof WeakMap>"u"?i:WeakMap,"%WeakRef%":typeof WeakRef>"u"?i:WeakRef,"%WeakSet%":typeof WeakSet>"u"?i:WeakSet};if(x)try{null.error}catch($){var S=x(x($));E["%Error.prototype%"]=S}var C=function $(ee){var ae;if(ee==="%AsyncFunction%")ae=u("async function () {}");else if(ee==="%GeneratorFunction%")ae=u("function* () {}");else if(ee==="%AsyncGeneratorFunction%")ae=u("async function* () {}");else if(ee==="%AsyncGenerator%"){var ce=$("%AsyncGeneratorFunction%");ce&&(ae=ce.prototype)}else if(ee==="%AsyncIteratorPrototype%"){var re=$("%AsyncGenerator%");re&&x&&(ae=x(re.prototype))}return E[ee]=ae,ae},T={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},I=Rit(),B=Ywn(),O=I.call(Function.call,Array.prototype.concat),L=I.call(Function.apply,Array.prototype.splice),k=I.call(Function.call,String.prototype.replace),U=I.call(Function.call,String.prototype.slice),j=I.call(Function.call,RegExp.prototype.exec),Y=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,X=/\\(\\)?/g,q=function($){var ee=U($,0,1),ae=U($,-1);if(ee==="%"&&ae!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(ae==="%"&&ee!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var ce=[];return k($,Y,function(re,se,fe,me){ce[ce.length]=fe?k(me,X,"$1"):se||re}),ce},J=function($,ee){var ae=$,ce;if(B(T,ae)&&(ce=T[ae],ae="%"+ce[0]+"%"),B(E,ae)){var re=E[ae];if(re===v&&(re=C(ae)),typeof re>"u"&&!ee)throw new a("intrinsic "+$+" exists, but is not available. Please file an issue!");return{alias:ce,name:ae,value:re}}throw new s("intrinsic "+$+" does not exist!")};return c3e=function($,ee){if(typeof $!="string"||$.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ee!="boolean")throw new a('"allowMissing" argument must be a boolean');if(j(/^%?[^%]*%?$/,$)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var ae=q($),ce=ae.length>0?ae[0]:"",re=J("%"+ce+"%",ee),se=re.name,fe=re.value,me=!1,oe=re.alias;oe&&(ce=oe[0],L(ae,O([0,1],oe)));for(var ve=1,ne=!0;ve<ae.length;ve+=1){var pe=ae[ve],Ae=U(pe,0,1),Ge=U(pe,-1);if((Ae==='"'||Ae==="'"||Ae==="`"||Ge==='"'||Ge==="'"||Ge==="`")&&Ae!==Ge)throw new s("property names with quotes must have matching quotes");if((pe==="constructor"||!ne)&&(me=!0),ce+="."+pe,se="%"+ce+"%",B(E,se))fe=E[se];else if(fe!=null){if(!(pe in fe)){if(!ee)throw new a("base intrinsic for "+$+" exists, but the property is not available.");return}if(c&&ve+1>=ae.length){var Re=c(fe,pe);ne=!!Re,ne&&"get"in Re&&!("originalValue"in Re.get)?fe=Re.get:fe=fe[pe]}else ne=B(fe,pe),fe=fe[pe];ne&&!me&&(E[se]=fe)}}return fe},c3e}function Pit(){if(ent)return d3e;ent=!0;var i=UH(),e=i("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return d3e=e,d3e}function FSr(){if(tnt)return h3e;tnt=!0;var i=UH(),e=i("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return h3e=e,h3e}function qwn(){if(rnt)return f3e;rnt=!0;var i=Pit(),e=wSr(),t=Cte(),r=FSr();return f3e=function(n,s,a){if(!n||typeof n!="object"&&typeof n!="function")throw new t("`obj` must be an object or a function`");if(typeof s!="string"&&typeof s!="symbol")throw new t("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new t("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new t("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new t("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new t("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,d=!!r&&r(n,s);if(i)i(n,s,{configurable:u===null&&d?d.configurable:!u,enumerable:o===null&&d?d.enumerable:!o,value:a,writable:l===null&&d?d.writable:!l});else if(c||!o&&!l&&!u)n[s]=a;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},f3e}function Qwn(){if(int)return p3e;int=!0;var i=Pit(),e=function(){return!!i};return e.hasArrayLengthDefineBug=function(){if(!i)return null;try{return i([],"length",{value:1}).length!==1}catch{return!0}},p3e=e,p3e}function Kwn(){if(nnt)return m3e;nnt=!0;var i=UH(),e=qwn(),t=Qwn()(),r=FSr(),n=Cte(),s=i("%Math.floor%");return m3e=function(a,o){if(typeof a!="function")throw new n("`fn` is not a function");if(typeof o!="number"||o<0||o>4294967295||s(o)!==o)throw new n("`length` must be a positive 32-bit integer");var l=arguments.length>2&&!!arguments[2],u=!0,c=!0;if("length"in a&&r){var d=r(a,"length");d&&!d.configurable&&(u=!1),d&&!d.writable&&(c=!1)}return(u||c||!l)&&(t?e(a,"length",o,!0,!0):e(a,"length",o)),a},m3e}function Jwn(){if(snt)return GH;snt=!0;var i=Rit(),e=UH(),t=Kwn(),r=Cte(),n=e("%Function.prototype.apply%"),s=e("%Function.prototype.call%"),a=e("%Reflect.apply%",!0)||i.call(s,n),o=Pit(),l=e("%Math.max%");GH=function(c){if(typeof c!="function")throw new r("a function is required");var d=a(i,s,arguments);return t(d,1+l(0,c.length-(arguments.length-1)),!0)};var u=function(){return a(i,n,arguments)};return o?o(GH,"apply",{value:u}):GH.apply=u,GH}function Zwn(){if(ant)return g3e;ant=!0;var i=UH(),e=Jwn(),t=e(i("String.prototype.indexOf"));return g3e=function(r,n){var s=i(r,!!n);return typeof s=="function"&&t(r,".prototype.")>-1?e(s):s},g3e}var Iit,Mit,Bit,Oit,Lit,Nit,kit,Vit,Uit,Git,zit,jit,Hit,Wit,Xit,Yit,s3e,qit,a3e,Qit,o3e,Kit,l3e,Jit,u3e,Zit,c3e,$it,d3e,ent,h3e,tnt,f3e,rnt,p3e,int,m3e,nnt,GH,snt,g3e,ant,$wn=Ey(()=>{gn(),vn(),xn(),Iit={},Mit=!1,Bit={},Oit=!1,Lit={},Nit=!1,kit={},Vit=!1,Uit={},Git=!1,zit={},jit=!1,Hit={},Wit=!1,Xit={},Yit=!1,s3e={},qit=!1,a3e={},Qit=!1,o3e={},Kit=!1,l3e={},Jit=!1,u3e={},Zit=!1,c3e={},$it=!1,d3e={},ent=!1,h3e={},tnt=!1,f3e={},rnt=!1,p3e={},int=!1,m3e={},nnt=!1,GH={},snt=!1,g3e={},ant=!1});function ont(i){throw new Error("Node.js process "+i+" is not supported by JSPM core outside of Node.js")}function eFn(){!WO||!XO||(WO=!1,XO.length?eS=XO.concat(eS):Tte=-1,eS.length&&RSr())}function RSr(){if(!WO){var i=setTimeout(eFn,0);WO=!0;for(var e=eS.length;e;){for(XO=eS,eS=[];++Tte<e;)XO&&XO[Tte].run();Tte=-1,e=eS.length}XO=null,WO=!1,clearTimeout(i)}}function tFn(i){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];eS.push(new PSr(i,e)),eS.length===1&&!WO&&setTimeout(RSr,0)}function PSr(i,e){this.fun=i,this.array=e}function gx(){}function rFn(i){ont("_linkedBinding")}function iFn(i){ont("dlopen")}function nFn(){return[]}function sFn(){return[]}function aFn(i,e){if(!i)throw new Error(e||"assertion error")}function oFn(){return!1}function lFn(){return m9.now()/1e3}function lnt(i){var e=Math.floor((Date.now()-m9.now())*.001),t=m9.now()*.001,r=Math.floor(t)+e,n=Math.floor(t%1*1e9);return i&&(r=r-i[0],n=n-i[1],n<0&&(r--,n+=v3e)),[r,n]}function qF(){return cnt}function uFn(i){return[]}var eS,WO,XO,Tte,ISr,MSr,BSr,OSr,LSr,NSr,kSr,VSr,USr,GSr,zSr,jSr,HSr,WSr,XSr,YSr,qSr,QSr,KSr,JSr,ZSr,x3e,$Sr,eCr,tCr,rCr,iCr,nCr,sCr,aCr,oCr,lCr,uCr,cCr,dCr,hCr,fCr,pCr,mCr,gCr,xCr,vCr,yCr,DCr,ECr,bCr,_Cr,m9,unt,v3e,ACr,SCr,CCr,TCr,wCr,FCr,RCr,PCr,ICr,MCr,BCr,cnt,OCr=Ey(()=>{gn(),vn(),xn(),eS=[],WO=!1,Tte=-1,PSr.prototype.run=function(){this.fun.apply(null,this.array)},ISr="browser",MSr="x64",BSr="browser",OSr={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},LSr=["/usr/bin/node"],NSr=[],kSr="v16.8.0",VSr={},USr=function(i,e){},GSr=function(i){ont("binding")},zSr=function(i){return 0},jSr=function(){return"/"},HSr=function(i){},WSr={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},XSr=gx,YSr=[],qSr={},QSr=!1,KSr={},JSr=gx,ZSr=gx,x3e=function(){return{}},$Sr=x3e,eCr=x3e,tCr=gx,rCr=gx,iCr=gx,nCr={},sCr={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},aCr=gx,oCr=gx,lCr=gx,uCr=gx,cCr=gx,dCr=gx,hCr=gx,fCr=void 0,pCr=void 0,mCr=void 0,gCr=gx,xCr=2,vCr=1,yCr="/bin/usr/node",DCr=9229,ECr="node",bCr=[],_Cr=gx,m9={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0},m9.now===void 0&&(unt=Date.now(),m9.timing&&m9.timing.navigationStart&&(unt=m9.timing.navigationStart),m9.now=()=>Date.now()-unt),v3e=1e9,lnt.bigint=function(i){var e=lnt(i);return typeof BigInt>"u"?e[0]*v3e+e[1]:BigInt(e[0]*v3e)+BigInt(e[1])},ACr=10,SCr={},CCr=0,TCr=qF,wCr=qF,FCr=qF,RCr=qF,PCr=qF,ICr=gx,MCr=qF,BCr=qF,cnt={version:kSr,versions:VSr,arch:MSr,platform:BSr,release:WSr,_rawDebug:XSr,moduleLoadList:YSr,binding:GSr,_linkedBinding:rFn,_events:SCr,_eventsCount:CCr,_maxListeners:ACr,on:qF,addListener:TCr,once:wCr,off:FCr,removeListener:RCr,removeAllListeners:PCr,emit:ICr,prependListener:MCr,prependOnceListener:BCr,listeners:uFn,domain:qSr,_exiting:QSr,config:KSr,dlopen:iFn,uptime:lFn,_getActiveRequests:nFn,_getActiveHandles:sFn,reallyExit:JSr,_kill:ZSr,cpuUsage:x3e,resourceUsage:$Sr,memoryUsage:eCr,kill:tCr,exit:rCr,openStdin:iCr,allowedNodeEnvironmentFlags:nCr,assert:aFn,features:sCr,_fatalExceptions:aCr,setUncaughtExceptionCaptureCallback:oCr,hasUncaughtExceptionCaptureCallback:oFn,emitWarning:USr,nextTick:tFn,_tickCallback:lCr,_debugProcess:uCr,_debugEnd:cCr,_startProfilerIdleNotifier:dCr,_stopProfilerIdleNotifier:hCr,stdout:fCr,stdin:mCr,stderr:pCr,abort:gCr,umask:zSr,chdir:HSr,cwd:jSr,env:OSr,title:ISr,argv:LSr,execArgv:NSr,pid:xCr,ppid:vCr,execPath:yCr,debugPort:DCr,hrtime:lnt,argv0:ECr,_preload_modules:bCr,setSourceMapsEnabled:_Cr}});function cFn(){if(dnt)return y3e;dnt=!0;var i=cnt;function e(s){if(typeof s!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(s))}function t(s,a){for(var o="",l=0,u=-1,c=0,d,h=0;h<=s.length;++h){if(h<s.length)d=s.charCodeAt(h);else{if(d===47)break;d=47}if(d===47){if(!(u===h-1||c===1))if(u!==h-1&&c===2){if(o.length<2||l!==2||o.charCodeAt(o.length-1)!==46||o.charCodeAt(o.length-2)!==46){if(o.length>2){var p=o.lastIndexOf("/");if(p!==o.length-1){p===-1?(o="",l=0):(o=o.slice(0,p),l=o.length-1-o.lastIndexOf("/")),u=h,c=0;continue}}else if(o.length===2||o.length===1){o="",l=0,u=h,c=0;continue}}a&&(o.length>0?o+="/..":o="..",l=2)}else o.length>0?o+="/"+s.slice(u+1,h):o=s.slice(u+1,h),l=h-u-1;u=h,c=0}else d===46&&c!==-1?++c:c=-1}return o}function r(s,a){var o=a.dir||a.root,l=a.base||(a.name||"")+(a.ext||"");return o?o===a.root?o+l:o+s+l:l}var n={resolve:function(){for(var s="",a=!1,o,l=arguments.length-1;l>=-1&&!a;l--){var u;l>=0?u=arguments[l]:(o===void 0&&(o=i.cwd()),u=o),e(u),u.length!==0&&(s=u+"/"+s,a=u.charCodeAt(0)===47)}return s=t(s,!a),a?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(s){if(e(s),s.length===0)return".";var a=s.charCodeAt(0)===47,o=s.charCodeAt(s.length-1)===47;return s=t(s,!a),s.length===0&&!a&&(s="."),s.length>0&&o&&(s+="/"),a?"/"+s:s},isAbsolute:function(s){return e(s),s.length>0&&s.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var s,a=0;a<arguments.length;++a){var o=arguments[a];e(o),o.length>0&&(s===void 0?s=o:s+="/"+o)}return s===void 0?".":n.normalize(s)},relative:function(s,a){if(e(s),e(a),s===a||(s=n.resolve(s),a=n.resolve(a),s===a))return"";for(var o=1;o<s.length&&s.charCodeAt(o)===47;++o);for(var l=s.length,u=l-o,c=1;c<a.length&&a.charCodeAt(c)===47;++c);for(var d=a.length,h=d-c,p=u<h?u:h,m=-1,x=0;x<=p;++x){if(x===p){if(h>p){if(a.charCodeAt(c+x)===47)return a.slice(c+x+1);if(x===0)return a.slice(c+x)}else u>p&&(s.charCodeAt(o+x)===47?m=x:x===0&&(m=0));break}var v=s.charCodeAt(o+x),y=a.charCodeAt(c+x);if(v!==y)break;v===47&&(m=x)}var E="";for(x=o+m+1;x<=l;++x)(x===l||s.charCodeAt(x)===47)&&(E.length===0?E+="..":E+="/..");return E.length>0?E+a.slice(c+m):(c+=m,a.charCodeAt(c)===47&&++c,a.slice(c))},_makeLong:function(s){return s},dirname:function(s){if(e(s),s.length===0)return".";for(var a=s.charCodeAt(0),o=a===47,l=-1,u=!0,c=s.length-1;c>=1;--c)if(a=s.charCodeAt(c),a===47){if(!u){l=c;break}}else u=!1;return l===-1?o?"/":".":o&&l===1?"//":s.slice(0,l)},basename:function(s,a){if(a!==void 0&&typeof a!="string")throw new TypeError('"ext" argument must be a string');e(s);var o=0,l=-1,u=!0,c;if(a!==void 0&&a.length>0&&a.length<=s.length){if(a.length===s.length&&a===s)return"";var d=a.length-1,h=-1;for(c=s.length-1;c>=0;--c){var p=s.charCodeAt(c);if(p===47){if(!u){o=c+1;break}}else h===-1&&(u=!1,h=c+1),d>=0&&(p===a.charCodeAt(d)?--d===-1&&(l=c):(d=-1,l=h))}return o===l?l=h:l===-1&&(l=s.length),s.slice(o,l)}else{for(c=s.length-1;c>=0;--c)if(s.charCodeAt(c)===47){if(!u){o=c+1;break}}else l===-1&&(u=!1,l=c+1);return l===-1?"":s.slice(o,l)}},extname:function(s){e(s);for(var a=-1,o=0,l=-1,u=!0,c=0,d=s.length-1;d>=0;--d){var h=s.charCodeAt(d);if(h===47){if(!u){o=d+1;break}continue}l===-1&&(u=!1,l=d+1),h===46?a===-1?a=d:c!==1&&(c=1):a!==-1&&(c=-1)}return a===-1||l===-1||c===0||c===1&&a===l-1&&a===o+1?"":s.slice(a,l)},format:function(s){if(s===null||typeof s!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof s);return r("/",s)},parse:function(s){e(s);var a={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return a;var o=s.charCodeAt(0),l=o===47,u;l?(a.root="/",u=1):u=0;for(var c=-1,d=0,h=-1,p=!0,m=s.length-1,x=0;m>=u;--m){if(o=s.charCodeAt(m),o===47){if(!p){d=m+1;break}continue}h===-1&&(p=!1,h=m+1),o===46?c===-1?c=m:x!==1&&(x=1):c!==-1&&(x=-1)}return c===-1||h===-1||x===0||x===1&&c===h-1&&c===d+1?h!==-1&&(d===0&&l?a.base=a.name=s.slice(1,h):a.base=a.name=s.slice(d,h)):(d===0&&l?(a.name=s.slice(1,c),a.base=s.slice(1,h)):(a.name=s.slice(d,c),a.base=s.slice(d,h)),a.ext=s.slice(c,h)),d>0?a.dir=s.slice(0,d-1):l&&(a.dir="/"),a},sep:"/",delimiter:":",win32:null,posix:null};return n.posix=n,y3e=n,y3e}var y3e,dnt,hnt,dFn=Ey(()=>{gn(),vn(),xn(),OCr(),y3e={},dnt=!1,hnt=cFn()}),LCr={};OH(LCr,{URL:()=>YCr,Url:()=>zCr,default:()=>xx,fileURLToPath:()=>kCr,format:()=>jCr,parse:()=>XCr,pathToFileURL:()=>VCr,resolve:()=>HCr,resolveObject:()=>WCr});function hFn(){if(pnt)return D3e;pnt=!0;var i=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,t=i&&e&&typeof e.get=="function"?e.get:null,r=i&&Map.prototype.forEach,n=typeof Set=="function"&&Set.prototype,s=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,a=n&&s&&typeof s.get=="function"?s.get:null,o=n&&Set.prototype.forEach,l=typeof WeakMap=="function"&&WeakMap.prototype,u=l?WeakMap.prototype.has:null,c=typeof WeakSet=="function"&&WeakSet.prototype,d=c?WeakSet.prototype.has:null,h=typeof WeakRef=="function"&&WeakRef.prototype,p=h?WeakRef.prototype.deref:null,m=Boolean.prototype.valueOf,x=Object.prototype.toString,v=Function.prototype.toString,y=String.prototype.match,E=String.prototype.slice,S=String.prototype.replace,C=String.prototype.toUpperCase,T=String.prototype.toLowerCase,I=RegExp.prototype.test,B=Array.prototype.concat,O=Array.prototype.join,L=Array.prototype.slice,k=Math.floor,U=typeof BigInt=="function"?BigInt.prototype.valueOf:null,j=Object.getOwnPropertySymbols,Y=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,X=typeof Symbol=="function"&&typeof Symbol.iterator=="object",q=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===X||!0)?Symbol.toStringTag:null,J=Object.prototype.propertyIsEnumerable,$=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(vt){return vt.__proto__}:null);function ee(vt,At){if(vt===1/0||vt===-1/0||vt!==vt||vt&&vt>-1e3&&vt<1e3||I.call(/e/,At))return At;var cr=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof vt=="number"){var Br=vt<0?-k(-vt):k(vt);if(Br!==vt){var ei=String(Br),jt=E.call(At,ei.length+1);return S.call(ei,cr,"$&_")+"."+S.call(S.call(jt,/([0-9]{3})/g,"$&_"),/_$/,"")}}return S.call(At,cr,"$&_")}var ae=UCr,ce=ae.custom,re=Re(ce)?ce:null;D3e=function vt(At,cr,Br,ei){var jt=cr||{};if(He(jt,"quoteStyle")&&jt.quoteStyle!=="single"&&jt.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(He(jt,"maxStringLength")&&(typeof jt.maxStringLength=="number"?jt.maxStringLength<0&&jt.maxStringLength!==1/0:jt.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var nt=He(jt,"customInspect")?jt.customInspect:!0;if(typeof nt!="boolean"&&nt!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(He(jt,"indent")&&jt.indent!==null&&jt.indent!==" "&&!(parseInt(jt.indent,10)===jt.indent&&jt.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(He(jt,"numericSeparator")&&typeof jt.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Kr=jt.numericSeparator;if(typeof At>"u")return"undefined";if(At===null)return"null";if(typeof At=="boolean")return At?"true":"false";if(typeof At=="string")return Oe(At,jt);if(typeof At=="number"){if(At===0)return 1/0/At>0?"0":"-0";var Pr=String(At);return Kr?ee(At,Pr):Pr}if(typeof At=="bigint"){var Dr=String(At)+"n";return Kr?ee(At,Dr):Dr}var Vr=typeof jt.depth>"u"?5:jt.depth;if(typeof Br>"u"&&(Br=0),Br>=Vr&&Vr>0&&typeof At=="object")return me(At)?"[Array]":"[Object]";var Fi=Me(jt,Br);if(typeof ei>"u")ei=[];else if(ht(ei,At)>=0)return"[Circular]";function Jn(mi,Wi,Tr){if(Wi&&(ei=L.call(ei),ei.push(Wi)),Tr){var wi={depth:jt.depth};return He(jt,"quoteStyle")&&(wi.quoteStyle=jt.quoteStyle),vt(mi,wi,Br+1,ei)}return vt(mi,jt,Br+1,ei)}if(typeof At=="function"&&!ve(At)){var Ps=Ke(At),wa=ot(At,Jn);return"[Function"+(Ps?": "+Ps:" (anonymous)")+"]"+(wa.length>0?" { "+O.call(wa,", ")+" }":"")}if(Re(At)){var Vs=X?S.call(String(At),/^(Symbol\(.*\))_[^)]*$/,"$1"):Y.call(At);return typeof At=="object"&&!X?Ce(Vs):Vs}if(Xe(At)){for(var Zt="<"+T.call(String(At.nodeName)),gr=At.attributes||[],Qi=0;Qi<gr.length;Qi++)Zt+=" "+gr[Qi].name+"="+se(fe(gr[Qi].value),"double",jt);return Zt+=">",At.childNodes&&At.childNodes.length&&(Zt+="..."),Zt+="</"+T.call(String(At.nodeName))+">",Zt}if(me(At)){if(At.length===0)return"[]";var kn=ot(At,Jn);return Fi&&!Ye(kn)?"["+et(kn,Fi)+"]":"[ "+O.call(kn,", ")+" ]"}if(ne(At)){var ds=ot(At,Jn);return!("cause"in Error.prototype)&&"cause"in At&&!J.call(At,"cause")?"{ ["+String(At)+"] "+O.call(B.call("[cause]: "+Jn(At.cause),ds),", ")+" }":ds.length===0?"["+String(At)+"]":"{ ["+String(At)+"] "+O.call(ds,", ")+" }"}if(typeof At=="object"&&nt){if(re&&typeof At[re]=="function"&&ae)return ae(At,{depth:Vr-Br});if(nt!=="symbol"&&typeof At.inspect=="function")return At.inspect()}if(St(At)){var ao=[];return r&&r.call(At,function(mi,Wi){ao.push(Jn(Wi,At,!0)+" => "+Jn(mi,At))}),ke("Map",t.call(At),ao,Fi)}if(bt(At)){var as=[];return o&&o.call(At,function(mi){as.push(Jn(mi,At))}),ke("Set",a.call(At),as,Fi)}if(xt(At))return Pe("WeakMap");if($t(At))return Pe("WeakSet");if(Vt(At))return Pe("WeakRef");if(Ae(At))return Ce(Jn(Number(At)));if(De(At))return Ce(Jn(U.call(At)));if(Ge(At))return Ce(m.call(At));if(pe(At))return Ce(Jn(String(At)));if(typeof window<"u"&&At===window)return"{ [object Window] }";if(typeof globalThis<"u"&&At===globalThis||typeof E3e<"u"&&At===E3e)return"{ [object globalThis] }";if(!oe(At)&&!ve(At)){var vs=ot(At,Jn),Bc=$?$(At)===Object.prototype:At instanceof Object||At.constructor===Object,Mu=At instanceof Object?"":"null prototype",ed=!Bc&&q&&Object(At)===At&&q in At?E.call(Be(At),8,-1):Mu?"Object":"",pd=Bc||typeof At.constructor!="function"?"":At.constructor.name?At.constructor.name+" ":"",_r=pd+(ed||Mu?"["+O.call(B.call([],ed||[],Mu||[]),": ")+"] ":"");return vs.length===0?_r+"{}":Fi?_r+"{"+et(vs,Fi)+"}":_r+"{ "+O.call(vs,", ")+" }"}return String(At)};function se(vt,At,cr){var Br=(cr.quoteStyle||At)==="double"?'"':"'";return Br+vt+Br}function fe(vt){return S.call(String(vt),/"/g,"&quot;")}function me(vt){return Be(vt)==="[object Array]"&&(!q||!(typeof vt=="object"&&q in vt))}function oe(vt){return Be(vt)==="[object Date]"&&(!q||!(typeof vt=="object"&&q in vt))}function ve(vt){return Be(vt)==="[object RegExp]"&&(!q||!(typeof vt=="object"&&q in vt))}function ne(vt){return Be(vt)==="[object Error]"&&(!q||!(typeof vt=="object"&&q in vt))}function pe(vt){return Be(vt)==="[object String]"&&(!q||!(typeof vt=="object"&&q in vt))}function Ae(vt){return Be(vt)==="[object Number]"&&(!q||!(typeof vt=="object"&&q in vt))}function Ge(vt){return Be(vt)==="[object Boolean]"&&(!q||!(typeof vt=="object"&&q in vt))}function Re(vt){if(X)return vt&&typeof vt=="object"&&vt instanceof Symbol;if(typeof vt=="symbol")return!0;if(!vt||typeof vt!="object"||!Y)return!1;try{return Y.call(vt),!0}catch{}return!1}function De(vt){if(!vt||typeof vt!="object"||!U)return!1;try{return U.call(vt),!0}catch{}return!1}var ze=Object.prototype.hasOwnProperty||function(vt){return vt in(this||E3e)};function He(vt,At){return ze.call(vt,At)}function Be(vt){return x.call(vt)}function Ke(vt){if(vt.name)return vt.name;var At=y.call(v.call(vt),/^function\s*([\w$]+)/);return At?At[1]:null}function ht(vt,At){if(vt.indexOf)return vt.indexOf(At);for(var cr=0,Br=vt.length;cr<Br;cr++)if(vt[cr]===At)return cr;return-1}function St(vt){if(!t||!vt||typeof vt!="object")return!1;try{t.call(vt);try{a.call(vt)}catch{return!0}return vt instanceof Map}catch{}return!1}function xt(vt){if(!u||!vt||typeof vt!="object")return!1;try{u.call(vt,u);try{d.call(vt,d)}catch{return!0}return vt instanceof WeakMap}catch{}return!1}function Vt(vt){if(!p||!vt||typeof vt!="object")return!1;try{return p.call(vt),!0}catch{}return!1}function bt(vt){if(!a||!vt||typeof vt!="object")return!1;try{a.call(vt);try{t.call(vt)}catch{return!0}return vt instanceof Set}catch{}return!1}function $t(vt){if(!d||!vt||typeof vt!="object")return!1;try{d.call(vt,d);try{u.call(vt,u)}catch{return!0}return vt instanceof WeakSet}catch{}return!1}function Xe(vt){return!vt||typeof vt!="object"?!1:typeof HTMLElement<"u"&&vt instanceof HTMLElement?!0:typeof vt.nodeName=="string"&&typeof vt.getAttribute=="function"}function Oe(vt,At){if(vt.length>At.maxStringLength){var cr=vt.length-At.maxStringLength,Br="... "+cr+" more character"+(cr>1?"s":"");return Oe(E.call(vt,0,At.maxStringLength),At)+Br}var ei=S.call(S.call(vt,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,ft);return se(ei,"single",At)}function ft(vt){var At=vt.charCodeAt(0),cr={8:"b",9:"t",10:"n",12:"f",13:"r"}[At];return cr?"\\"+cr:"\\x"+(At<16?"0":"")+C.call(At.toString(16))}function Ce(vt){return"Object("+vt+")"}function Pe(vt){return vt+" { ? }"}function ke(vt,At,cr,Br){var ei=Br?et(cr,Br):O.call(cr,", ");return vt+" ("+At+") {"+ei+"}"}function Ye(vt){for(var At=0;At<vt.length;At++)if(ht(vt[At],`
33381
33381
  `)>=0)return!1;return!0}function Me(vt,At){var cr;if(vt.indent===" ")cr=" ";else if(typeof vt.indent=="number"&&vt.indent>0)cr=O.call(Array(vt.indent+1)," ");else return null;return{base:cr,prev:O.call(Array(At+1),cr)}}function et(vt,At){if(vt.length===0)return"";var cr=`
@@ -33392,7 +33392,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
33392
33392
 
33393
33393
  @babel/runtime/helpers/regenerator.js:
33394
33394
  (*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE *)
33395
- */const hL=class hL{constructor(){pr(this,"connections",new Map);pr(this,"connectionConfigs",new Map)}static getInstance(){return hL.instance||(hL.instance=new hL),hL.instance}generateConnectionKey(e){return JSON.stringify(e)}async getOrCreateConnection(e,t){const r=this.generateConnectionKey(e),n=this.connections.get(r);if(n&&n.isConnected())return n;this.connections.entries().forEach(([a])=>{const o=JSON.parse(a);o.uuid===e.uuid&&this.closeConnection(o)});const s=new CFn(e,t);this.connections.set(r,s),this.connectionConfigs.set(r,e);try{await s.connect()}catch{}return s}hasConnection(e){const t=this.generateConnectionKey(e),r=this.connections.get(t);return r!==void 0&&r.isConnected()}getAllConnections(){return new Map(this.connections)}closeConnection(e){const t=this.generateConnectionKey(e),r=this.connections.get(t);return r?(r.disconnect(),this.connections.delete(t),this.connectionConfigs.delete(t),!0):!1}closeAllConnections(){for(const[e,t]of this.connections)t.disconnect(),this.connections.delete(e),this.connectionConfigs.delete(e);return this.connections.clear(),this.connectionConfigs.clear(),!0}};pr(hL,"instance");let KF=hL;const p5r={getInstance:()=>KF.getInstance(),hasConnection:i=>KF.getInstance().hasConnection(i),closeConnection:i=>KF.getInstance().closeConnection(i),closeAllConnections:()=>{KF.getInstance().closeAllConnections()},removeConnectionByUUID:i=>{const e=KF.getInstance();e.getAllConnections().entries().forEach(([r])=>{const n=JSON.parse(r);n.uuid.includes(i)&&e.closeConnection(n)})}};class CFn{constructor(e,t={}){pr(this,"client",null);pr(this,"config");pr(this,"callbacks");pr(this,"connectionState","disconnected");pr(this,"subscriptions",new Map);this.config=e,this.callbacks=t}async connect(){return new Promise((e,t)=>{if(this.client&&this.client.connected){e();return}this.connectionState="connecting";const r={clientId:Su(),username:this.config.username,password:this.config.password,keepalive:this.config.keepalive||60,reconnectPeriod:this.config.reconnectPeriod||0,connectTimeout:this.config.connectTimeout||3e4,clean:this.config.clean!==!1,rejectUnauthorized:this.config.rejectUnauthorized!==!1},n=`${this.config.protocol}://${this.config.host}:${this.config.port}${this.config.endpoint}`;try{this.client=SFn.connect(n,r),this.client.on("connect",()=>{this.connectionState="connected",this.resubscribeTopics(),this.callbacks.onConnect&&this.callbacks.onConnect(),e()}),this.client.on("disconnect",()=>{this.connectionState="disconnected",this.callbacks.onDisconnect&&this.callbacks.onDisconnect()}),this.client.on("close",()=>{this.connectionState="disconnected",this.callbacks.onClose&&this.callbacks.onClose(),t(new Error("MQTT连接关闭"))}),this.client.on("error",s=>{this.connectionState="error",this.callbacks.onError&&this.callbacks.onError(s),t(s)}),this.client.on("message",(s,a)=>{this.callbacks.onMessage&&this.callbacks.onMessage(s,a);const o=this.subscriptions.get(s);o&&o.callback(s,a)}),this.client.on("reconnect",()=>{this.connectionState="reconnecting",this.callbacks.onReconnect&&this.callbacks.onReconnect()})}catch(s){this.connectionState="error",t(s)}})}disconnect(){this.client&&(this.client.end(!0),this.client=null,this.connectionState="disconnected")}subscribe(e,t=0,r){return new Promise((n,s)=>{if(!this.client||!this.client.connected){s(new Error("MQTT客户端未连接"));return}const a={qos:t};this.client.subscribe(e,a,o=>{o?s(o):(r&&this.subscriptions.set(e,{qos:t,callback:r}),n())})})}isConnected(){return this.client!==null&&this.client.connected}getConnectionState(){return this.connectionState}resubscribeTopics(){for(const[e,t]of this.subscriptions)this.subscribe(e,t.qos,t.callback).catch(r=>{})}}function TFn(i,e){return KF.getInstance().getOrCreateConnection(i,e)}const wFn=async(i,e,t)=>{try{const{protocol:r,endpoint:n,host:s,port:a,username:o,password:l,keepalive:u,clean:c,topic:d,qos:h}=i.source.mqtt;(await TFn({uuid:i.id,protocol:r,endpoint:n,host:s,port:a,username:o,password:l,keepalive:u,clean:c,topic:d,qos:h},{onConnect:()=>{t(jl.noneData(i.id))},onError:m=>{t(jl.noneData(i.id))},onDisconnect:()=>{t(jl.noneData(i.id))},onReconnect:()=>{t(jl.noneData(i.id))},onClose:()=>{t(jl.noneData(i.id))}})).subscribe(d,h,(m,x)=>{pl.processData(i.source,JSON.parse(x.toString()),i.id,e).then(v=>{t(v)}).catch(()=>{t(jl.noneData(i.id))})})}catch{t(jl.noneData(i.id))}},fL=class fL{constructor(){pr(this,"connections",new Map);pr(this,"connectionConfigs",new Map);pr(this,"pendingConnections",new Map)}static getInstance(){return fL.instance||(fL.instance=new fL),fL.instance}generateConnectionKey(e){return JSON.stringify(e)}async getOrCreateConnection(e,t){const r=this.generateConnectionKey(e),n=this.connections.get(r);if(n&&n.isConnected())return n;const s=Array.from(this.pendingConnections.entries()).find(([l])=>{try{return JSON.parse(l).uuid===e.uuid}catch{return!1}});if(s)try{return await s[1]}catch{}let a=0;Array.from(this.connections.entries()).forEach(([l,u])=>{try{JSON.parse(l).uuid===e.uuid&&(u.disconnect(),this.connections.delete(l),this.connectionConfigs.delete(l),a++)}catch{}}),Array.from(this.pendingConnections.keys()).forEach(l=>{try{JSON.parse(l).uuid===e.uuid&&this.pendingConnections.delete(l)}catch{}});const o=(async()=>{try{const l=new FFn(e,t);return await l.connect(),this.connections.set(r,l),this.connectionConfigs.set(r,e),l}catch(l){throw l}finally{this.pendingConnections.delete(r)}})();return this.pendingConnections.set(r,o),o}hasConnection(e){const t=this.generateConnectionKey(e),r=this.connections.get(t);return r!==void 0&&r.isConnected()}getAllConnections(){return new Map(this.connections)}closeConnection(e){const t=this.generateConnectionKey(e),r=this.connections.get(t);return r?(r.disconnect(),this.connections.delete(t),this.connectionConfigs.delete(t),this.pendingConnections.delete(t),!0):!1}closeAllConnections(){for(const[e,t]of this.connections)t.disconnect(),this.connections.delete(e),this.connectionConfigs.delete(e);return this.connections.clear(),this.connectionConfigs.clear(),this.pendingConnections.clear(),!0}};pr(fL,"instance");let g9=fL;const m5r={getInstance:()=>g9.getInstance(),hasConnection:i=>g9.getInstance().hasConnection(i),closeConnection:i=>g9.getInstance().closeConnection(i),closeAllConnections:()=>{g9.getInstance().closeAllConnections()},removeConnectionByUUID:i=>{const e=g9.getInstance();e.getAllConnections().entries().forEach(([r])=>{const n=JSON.parse(r);n.uuid.includes(i)&&e.closeConnection(n)})},forceCleanAll:()=>{const i=g9.getInstance(),e=i.getAllConnections();Array.from(e.entries()).forEach(([t,r])=>{try{const n=JSON.parse(t);r.disconnect()}catch{}}),i.closeAllConnections()}};class FFn{constructor(e,t={}){pr(this,"client",null);pr(this,"config");pr(this,"callbacks");pr(this,"connectionState","disconnected");pr(this,"reconnectAttempts",0);pr(this,"reconnectTimer",null);pr(this,"connectTimer",null);pr(this,"isManualDisconnect",!1);this.config=e,this.callbacks=t}async connect(){return new Promise((e,t)=>{if(this.client&&this.client.readyState===WebSocket.OPEN){e();return}this.connectionState="connecting";try{this.config.protocols?this.client=new WebSocket(this.config.url,this.config.protocols):this.client=new WebSocket(this.config.url),this.config.binaryType&&(this.client.binaryType=this.config.binaryType),this.config.timeout&&(this.connectTimer=setTimeout(()=>{this.client&&this.client.readyState===WebSocket.CONNECTING&&(this.client.close(),t(new Error("WebSocket连接超时")))},this.config.timeout)),this.client.onopen=()=>{if(this.connectTimer&&(clearTimeout(this.connectTimer),this.connectTimer=null),this.connectionState="connected",this.reconnectAttempts=0,this.isManualDisconnect=!1,this.config.isMessage&&this.config.message&&this.client&&this.client.readyState===WebSocket.OPEN)try{const r=typeof this.config.message=="string"?this.config.message:JSON.stringify(this.config.message);this.client.send(r)}catch{}this.callbacks.onOpen&&this.callbacks.onOpen(),e()},this.client.onclose=()=>{this.connectTimer&&(clearTimeout(this.connectTimer),this.connectTimer=null),this.connectionState="disconnected",!this.isManualDisconnect&&(this.callbacks.onClose&&this.callbacks.onClose(),this.config.reconnect&&this.reconnectAttempts<(this.config.maxReconnectAttempts||1/0)&&this.handleReconnect())},this.client.onmessage=r=>{if(this.callbacks.onMessage){let n=r.data;if(typeof n=="string")try{n=JSON.parse(n)}catch{}this.callbacks.onMessage(n)}},this.client.onerror=r=>{this.connectTimer&&(clearTimeout(this.connectTimer),this.connectTimer=null),this.connectionState="error",this.callbacks.onError&&this.callbacks.onError(r),t(r)}}catch(r){this.connectionState="error",t(r)}})}disconnect(){this.isManualDisconnect=!0,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.connectTimer&&(clearTimeout(this.connectTimer),this.connectTimer=null),this.client&&(this.client.close(),this.client=null,this.connectionState="disconnected")}send(e){if(this.client&&this.client.readyState===WebSocket.OPEN){const t=typeof e=="string"?e:JSON.stringify(e);this.client.send(t)}}isConnected(){return this.client!==null&&this.client.readyState===WebSocket.OPEN}getConnectionState(){return this.connectionState}handleReconnect(){this.reconnectAttempts>=(this.config.maxReconnectAttempts||1/0)||(this.connectionState="reconnecting",this.reconnectAttempts++,this.callbacks.onReconnect&&this.callbacks.onReconnect(),this.reconnectTimer=setTimeout(()=>{this.connect().catch(e=>{})},this.config.reconnectInterval||3e3))}}function RFn(i,e){return g9.getInstance().getOrCreateConnection(i,e)}const PFn=async(i,e,t)=>{try{const{url:r,protocols:n,reconnect:s,reconnectInterval:a,maxReconnectAttempts:o,message:l,isMessage:u,headers:c,isHeaders:d,binaryType:h,timeout:p}=i.source.websocket;if(!r||r.trim()===""){t(jl.noneData(i.id));return}await RFn({uuid:i.id,url:r,protocols:n,reconnect:s,reconnectInterval:a,maxReconnectAttempts:o,message:l,isMessage:u,headers:c,isHeaders:d,binaryType:h,timeout:p},{onOpen:()=>{t(jl.noneData(i.id))},onError:m=>{t(jl.noneData(i.id))},onClose:()=>{t(jl.noneData(i.id))},onReconnect:()=>{t(jl.noneData(i.id))},onMessage:m=>{pl.processData(i.source,m,i.id,e).then(x=>{t(x)}).catch(()=>{t(jl.noneData(i.id))})}})}catch{t(jl.noneData(i.id))}},IFn=(i,e,t,r)=>{if(!Ht.isArray(i))return i;let n=null;return n=i.map((s,a)=>{const o={};return t&&a===0&&(e=MFn(s,e)),Object.keys(e).forEach(l=>{const u=e[l];u.alias?o[u.alias]=s[u.mapping]:o[u.name]=s[u.mapping]}),r&&(o.userdata=s),o}),{mappedData:n,finalMapping:e}},MFn=(i,e)=>{const t=[];return i??(i=[]),Object.keys(i).forEach(r=>{const n=e.find(s=>s.name===r);n?t.push({alias:n.alias,name:r,label:r,mapping:n.mapping}):t.push({alias:r,name:r,label:r,mapping:r})}),t},BFn=(i,e)=>i&&i.reduce((t,r)=>{let n="default";e&&e.find(a=>a.name==="series")&&(n=r[e.find(a=>a.name==="series").name],delete r[e.find(a=>a.name==="series").name]);const s=t.find(a=>a.key===n);return s?s.data.push(r):t.push({key:n,data:[r]}),t},[]),pL=class pL{static addParser(e,t){this.parsers.add({type:e,parser:t})}static getParser(e){const t=Array.from(this.parsers).find(r=>r.type===e);return t==null?void 0:t.parser}static parse({sources:e,callback:t=a=>a||[],noUseMapping:r=!1,isInterval:n=!0,isEditor:s=!1}){try{if(e.length<=0)throw new Error("未找到数据源");e.forEach(a=>{this.handleDataSourceExecution(a,t,r,n,s)})}catch{t(null)}}static handleDataSourceExecution(e,t,r,n,s){if(s){this.executeDataSource(e,t,r,n,s);return}const{id:a,pid:o}=e;if(this.initializeDataSourceState(a),this.checkAndExecuteWaitingChildren(a),o&&o.toString()!=="-1"){const l=this.dataSourceStatePool.get(o);if(!l){this.waitingPool.set(a,{item:e,callback:t,noUseMapping:r,isInterval:n,isEditor:s});return}l.status==="completed"?this.executeDataSource(e,t,r,n,s):(this.waitingPool.set(a,{item:e,callback:t,noUseMapping:r,isInterval:n,isEditor:s}),l.callbacks.push(()=>{this.waitingPool.delete(a),this.executeDataSource(e,t,r,n,s)}))}else this.executeDataSource(e,t,r,n,s)}static initializeDataSourceState(e){this.dataSourceStatePool.has(e)||this.dataSourceStatePool.set(e,{id:e,status:"pending",callbacks:[]})}static markDataSourceExecuting(e){const t=this.dataSourceStatePool.get(e);t&&(t.status="executing")}static markDataSourceCompleted(e){const t=this.dataSourceStatePool.get(e);if(t){t.status="completed";const r=[...t.callbacks];t.callbacks=[],r.forEach(n=>{try{n()}catch{}})}}static checkAndExecuteWaitingChildren(e){if(!this.waitingPool.size)return;const t=[];this.waitingPool.forEach((r,n)=>{r.item.pid===e&&t.push({id:n,...r})});for(const r of t){const n=this.dataSourceStatePool.get(e);n&&(n.status==="completed"?(this.waitingPool.delete(r.id),this.executeDataSource(r.item,r.callback,r.noUseMapping,r.isInterval,r.isEditor)):n.callbacks.push(()=>{this.waitingPool.delete(r.id),this.executeDataSource(r.item,r.callback,r.noUseMapping,r.isInterval,r.isEditor)}))}}static executeDataSource(e,t,r,n,s){if(s){this.executeTask(e,r,s,a=>{t(a)});return}this.markDataSourceExecuting(e.id),this.setupInterval(e,n,r,s,t),this.executeTask(e,r,s,a=>{t(a),this.markDataSourceCompleted(e.id)})}static setupInterval(e,t,r,n,s){if(!t)return;const a=this.timerPool.get(e.id);if(a&&(clearInterval(a),this.timerPool.delete(e.id)),e.source.isAutoUpdate){const o=setInterval(()=>{this.markDataSourceExecuting(e.id),this.executeTask(e,r,n,l=>{s(l),this.markDataSourceCompleted(e.id)})},e.source.autoUpdateTime*1e3);this.timerPool.set(e.id,o)}}static executeTask(e,t,r,n){const s=e,{source:a}=s,o=this.getParser(a.type);o&&o(s,t,l=>{if(r){n(l);return}t?(drt(s.source.storage,l.noMappingData),n(l.noMappingData)):(drt(s.source.storage,l.finalKeyData),n(l.finalKeyData))})}static processData(e,t,r,n){const{filter:s,mapping:a,dynamicMapping:o,isUserdata:l}=Ht.cloneDeep(e);return new Promise(function(u){const c=t;pL.filterData(s,t).then(d=>{const h={id:r,finalKeyData:{id:r,data:null},finalUserData:{id:r,data:null},filteredData:{id:r,data:d},rawData:{id:r,data:c},noMappingData:null};if(n)h.finalUserData.data=d,h.noMappingData=d;else{const{mappedData:p,finalMapping:m}=IFn(d,a,o,l);h.finalKeyData.data=p!=null&&p.length?BFn(p,m):d,h.finalUserData.data=p!=null&&p.length?p:d}u(h)})})}static async filterData(e,t){if(!Ht.isString(e))return t;try{let r=e.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,"");r=jl.replaceStringVariables(r);const n=`
33395
+ */const hL=class hL{constructor(){pr(this,"connections",new Map);pr(this,"connectionConfigs",new Map)}static getInstance(){return hL.instance||(hL.instance=new hL),hL.instance}generateConnectionKey(e){return JSON.stringify(e)}async getOrCreateConnection(e,t){const r=this.generateConnectionKey(e),n=this.connections.get(r);if(n&&n.isConnected())return n;this.connections.entries().forEach(([a])=>{const o=JSON.parse(a);o.uuid===e.uuid&&this.closeConnection(o)});const s=new CFn(e,t);this.connections.set(r,s),this.connectionConfigs.set(r,e);try{await s.connect()}catch{}return s}hasConnection(e){const t=this.generateConnectionKey(e),r=this.connections.get(t);return r!==void 0&&r.isConnected()}getAllConnections(){return new Map(this.connections)}closeConnection(e){const t=this.generateConnectionKey(e),r=this.connections.get(t);return r?(r.disconnect(),this.connections.delete(t),this.connectionConfigs.delete(t),!0):!1}closeAllConnections(){for(const[e,t]of this.connections)t.disconnect(),this.connections.delete(e),this.connectionConfigs.delete(e);return this.connections.clear(),this.connectionConfigs.clear(),!0}};pr(hL,"instance");let KF=hL;const p5r={getInstance:()=>KF.getInstance(),hasConnection:i=>KF.getInstance().hasConnection(i),closeConnection:i=>KF.getInstance().closeConnection(i),closeAllConnections:()=>{KF.getInstance().closeAllConnections()},removeConnectionByUUID:i=>{const e=KF.getInstance();e.getAllConnections().entries().forEach(([r])=>{const n=JSON.parse(r);n.uuid.includes(i)&&e.closeConnection(n)})}};class CFn{constructor(e,t={}){pr(this,"client",null);pr(this,"config");pr(this,"callbacks");pr(this,"connectionState","disconnected");pr(this,"subscriptions",new Map);this.config=e,this.callbacks=t}async connect(){return new Promise((e,t)=>{if(this.client&&this.client.connected){e();return}this.connectionState="connecting";const r={clientId:Su(),username:this.config.username,password:this.config.password,keepalive:this.config.keepalive||60,reconnectPeriod:this.config.reconnectPeriod||0,connectTimeout:this.config.connectTimeout||3e4,clean:this.config.clean!==!1,rejectUnauthorized:this.config.rejectUnauthorized!==!1},n=`${this.config.protocol}://${this.config.host}:${this.config.port}${this.config.endpoint}`;try{this.client=SFn.connect(n,r),this.client.on("connect",()=>{this.connectionState="connected",this.resubscribeTopics(),this.callbacks.onConnect&&this.callbacks.onConnect(),e()}),this.client.on("disconnect",()=>{this.connectionState="disconnected",this.callbacks.onDisconnect&&this.callbacks.onDisconnect()}),this.client.on("close",()=>{this.connectionState="disconnected",this.callbacks.onClose&&this.callbacks.onClose(),t(new Error("MQTT连接关闭"))}),this.client.on("error",s=>{this.connectionState="error",this.callbacks.onError&&this.callbacks.onError(s),t(s)}),this.client.on("message",(s,a)=>{this.callbacks.onMessage&&this.callbacks.onMessage(s,a);const o=this.subscriptions.get(s);o&&o.callback(s,a)}),this.client.on("reconnect",()=>{this.connectionState="reconnecting",this.callbacks.onReconnect&&this.callbacks.onReconnect()})}catch(s){this.connectionState="error",t(s)}})}disconnect(){this.client&&(this.client.end(!0),this.client=null,this.connectionState="disconnected")}subscribe(e,t=0,r){return new Promise((n,s)=>{if(!this.client||!this.client.connected){s(new Error("MQTT客户端未连接"));return}const a={qos:t};this.client.subscribe(e,a,o=>{o?s(o):(r&&this.subscriptions.set(e,{qos:t,callback:r}),n())})})}isConnected(){return this.client!==null&&this.client.connected}getConnectionState(){return this.connectionState}resubscribeTopics(){for(const[e,t]of this.subscriptions)this.subscribe(e,t.qos,t.callback).catch(r=>{})}}function TFn(i,e){return KF.getInstance().getOrCreateConnection(i,e)}const wFn=async(i,e,t)=>{try{const{protocol:r,endpoint:n,host:s,port:a,username:o,password:l,keepalive:u,clean:c,topic:d,qos:h}=i.source.mqtt;(await TFn({uuid:i.id,protocol:r,endpoint:n,host:s,port:a,username:o,password:l,keepalive:u,clean:c,topic:d,qos:h},{onConnect:()=>{t(jl.noneData(i.id))},onError:m=>{t(jl.noneData(i.id))},onDisconnect:()=>{t(jl.noneData(i.id))},onReconnect:()=>{t(jl.noneData(i.id))},onClose:()=>{t(jl.noneData(i.id))}})).subscribe(d,h,(m,x)=>{pl.processData(i.source,JSON.parse(x.toString()),i.id,e).then(v=>{t(v)}).catch(()=>{t(jl.noneData(i.id))})})}catch{t(jl.noneData(i.id))}},fL=class fL{constructor(){pr(this,"connections",new Map);pr(this,"connectionConfigs",new Map);pr(this,"pendingConnections",new Map)}static getInstance(){return fL.instance||(fL.instance=new fL),fL.instance}generateConnectionKey(e){return JSON.stringify(e)}async getOrCreateConnection(e,t){const r=this.generateConnectionKey(e),n=this.connections.get(r);if(n&&n.isConnected())return n;const s=Array.from(this.pendingConnections.entries()).find(([l])=>{try{return JSON.parse(l).uuid===e.uuid}catch{return!1}});if(s)try{return await s[1]}catch{}let a=0;Array.from(this.connections.entries()).forEach(([l,u])=>{try{JSON.parse(l).uuid===e.uuid&&(u.disconnect(),this.connections.delete(l),this.connectionConfigs.delete(l),a++)}catch{}}),Array.from(this.pendingConnections.keys()).forEach(l=>{try{JSON.parse(l).uuid===e.uuid&&this.pendingConnections.delete(l)}catch{}});const o=(async()=>{try{const l=new FFn(e,t);return await l.connect(),this.connections.set(r,l),this.connectionConfigs.set(r,e),l}catch(l){throw l}finally{this.pendingConnections.delete(r)}})();return this.pendingConnections.set(r,o),o}hasConnection(e){const t=this.generateConnectionKey(e),r=this.connections.get(t);return r!==void 0&&r.isConnected()}getAllConnections(){return new Map(this.connections)}closeConnection(e){const t=this.generateConnectionKey(e),r=this.connections.get(t);return r?(r.disconnect(),this.connections.delete(t),this.connectionConfigs.delete(t),this.pendingConnections.delete(t),!0):!1}closeAllConnections(){for(const[e,t]of this.connections)t.disconnect(),this.connections.delete(e),this.connectionConfigs.delete(e);return this.connections.clear(),this.connectionConfigs.clear(),this.pendingConnections.clear(),!0}};pr(fL,"instance");let g9=fL;const m5r={getInstance:()=>g9.getInstance(),hasConnection:i=>g9.getInstance().hasConnection(i),closeConnection:i=>g9.getInstance().closeConnection(i),closeAllConnections:()=>{g9.getInstance().closeAllConnections()},removeConnectionByUUID:i=>{const e=g9.getInstance();e.getAllConnections().entries().forEach(([r])=>{const n=JSON.parse(r);n.uuid.includes(i)&&e.closeConnection(n)})},forceCleanAll:()=>{const i=g9.getInstance(),e=i.getAllConnections();Array.from(e.entries()).forEach(([t,r])=>{try{const n=JSON.parse(t);r.disconnect()}catch{}}),i.closeAllConnections()}};class FFn{constructor(e,t={}){pr(this,"client",null);pr(this,"config");pr(this,"callbacks");pr(this,"connectionState","disconnected");pr(this,"reconnectAttempts",0);pr(this,"reconnectTimer",null);pr(this,"connectTimer",null);pr(this,"isManualDisconnect",!1);this.config=e,this.callbacks=t}async connect(){return new Promise((e,t)=>{if(this.client&&this.client.readyState===WebSocket.OPEN){e();return}this.connectionState="connecting";try{this.config.protocols?this.client=new WebSocket(this.config.url,this.config.protocols):this.client=new WebSocket(this.config.url),this.config.binaryType&&(this.client.binaryType=this.config.binaryType),this.config.timeout&&(this.connectTimer=setTimeout(()=>{this.client&&this.client.readyState===WebSocket.CONNECTING&&(this.client.close(),t(new Error("WebSocket连接超时")))},this.config.timeout)),this.client.onopen=()=>{if(this.connectTimer&&(clearTimeout(this.connectTimer),this.connectTimer=null),this.connectionState="connected",this.reconnectAttempts=0,this.isManualDisconnect=!1,this.config.isMessage&&this.config.message&&this.client&&this.client.readyState===WebSocket.OPEN)try{const r=typeof this.config.message=="string"?this.config.message:JSON.stringify(this.config.message);this.client.send(r)}catch{}this.callbacks.onOpen&&this.callbacks.onOpen(),e()},this.client.onclose=()=>{this.connectTimer&&(clearTimeout(this.connectTimer),this.connectTimer=null),this.connectionState="disconnected",!this.isManualDisconnect&&(this.callbacks.onClose&&this.callbacks.onClose(),this.config.reconnect&&this.reconnectAttempts<(this.config.maxReconnectAttempts||1/0)&&this.handleReconnect())},this.client.onmessage=r=>{if(this.callbacks.onMessage){let n=r.data;if(typeof n=="string")try{n=JSON.parse(n)}catch{}this.callbacks.onMessage(n)}},this.client.onerror=r=>{this.connectTimer&&(clearTimeout(this.connectTimer),this.connectTimer=null),this.connectionState="error",this.callbacks.onError&&this.callbacks.onError(r),t(r)}}catch(r){this.connectionState="error",t(r)}})}disconnect(){this.isManualDisconnect=!0,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.connectTimer&&(clearTimeout(this.connectTimer),this.connectTimer=null),this.client&&(this.client.close(),this.client=null,this.connectionState="disconnected")}send(e){if(this.client&&this.client.readyState===WebSocket.OPEN){const t=typeof e=="string"?e:JSON.stringify(e);this.client.send(t)}}isConnected(){return this.client!==null&&this.client.readyState===WebSocket.OPEN}getConnectionState(){return this.connectionState}handleReconnect(){this.reconnectAttempts>=(this.config.maxReconnectAttempts||1/0)||(this.connectionState="reconnecting",this.reconnectAttempts++,this.callbacks.onReconnect&&this.callbacks.onReconnect(),this.reconnectTimer=setTimeout(()=>{this.connect().catch(e=>{})},this.config.reconnectInterval||3e3))}}function RFn(i,e){return g9.getInstance().getOrCreateConnection(i,e)}const PFn=async(i,e,t)=>{try{const{url:r,protocols:n,reconnect:s,reconnectInterval:a,maxReconnectAttempts:o,message:l,isMessage:u,headers:c,isHeaders:d,binaryType:h,timeout:p}=i.source.websocket;if(!r||r.trim()===""){t(jl.noneData(i.id));return}await RFn({uuid:i.id,url:r,protocols:n,reconnect:s,reconnectInterval:a,maxReconnectAttempts:o,message:l,isMessage:u,headers:c,isHeaders:d,binaryType:h,timeout:p},{onOpen:()=>{t(jl.noneData(i.id))},onError:m=>{t(jl.noneData(i.id))},onClose:()=>{t(jl.noneData(i.id))},onReconnect:()=>{t(jl.noneData(i.id))},onMessage:m=>{pl.processData(i.source,m,i.id,e).then(x=>{t(x)}).catch(()=>{t(jl.noneData(i.id))})}})}catch{t(jl.noneData(i.id))}},IFn=(i,e,t,r)=>{if(!Ht.isArray(i))return i;let n=null;return n=i.map((s,a)=>{const o={};return t&&a===0&&(e=MFn(s,e)),Object.keys(e).forEach(l=>{const u=e[l];u.alias?o[u.alias]=s[u.mapping]:o[u.name]=s[u.mapping]}),r&&(o.userdata=s),o}),{mappedData:n,finalMapping:e}},MFn=(i,e)=>{const t=[];return i??(i=[]),Object.keys(i).forEach(r=>{const n=e.find(s=>s.name===r);n?t.push({alias:n.alias,name:r,label:r,mapping:n.mapping}):t.push({alias:r,name:r,label:r,mapping:r})}),t},BFn=(i,e)=>i&&i.reduce((t,r)=>{let n="default";e&&e.find(a=>a.name==="series")&&(n=r[e.find(a=>a.name==="series").name],delete r[e.find(a=>a.name==="series").name]);const s=t.find(a=>a.key===n);return s?s.data.push(r):t.push({key:n,data:[r]}),t},[]),pL=class pL{static addParser(e,t){this.parsers.add({type:e,parser:t})}static getParser(e){const t=Array.from(this.parsers).find(r=>r.type===e);return t==null?void 0:t.parser}static parse({sources:e,callback:t=a=>a||[],noUseMapping:r=!1,isInterval:n=!0,isEditor:s=!1}){try{if(e.length<=0)throw new Error("未找到数据源");e.forEach(a=>{this.handleDataSourceExecution(a,t,r,n,s)})}catch{t(null)}}static handleDataSourceExecution(e,t,r,n,s){if(s){this.executeDataSource(e,t,r,n,s);return}const{id:a,pid:o}=e;if(this.initializeDataSourceState(a),this.checkAndExecuteWaitingChildren(a),o&&o.toString()!=="-1"){const l=this.dataSourceStatePool.get(o);if(!l){this.waitingPool.set(a,{item:e,callback:t,noUseMapping:r,isInterval:n,isEditor:s});return}l.status==="completed"?this.executeDataSource(e,t,r,n,s):(this.waitingPool.set(a,{item:e,callback:t,noUseMapping:r,isInterval:n,isEditor:s}),l.callbacks.push(()=>{this.waitingPool.delete(a),this.executeDataSource(e,t,r,n,s)}))}else this.executeDataSource(e,t,r,n,s)}static initializeDataSourceState(e){this.dataSourceStatePool.has(e)||this.dataSourceStatePool.set(e,{id:e,status:"pending",callbacks:[]})}static markDataSourceExecuting(e){const t=this.dataSourceStatePool.get(e);t&&(t.status="executing")}static markDataSourceCompleted(e){const t=this.dataSourceStatePool.get(e);if(t){t.status="completed";const r=[...t.callbacks];t.callbacks=[],r.forEach(n=>{try{n()}catch{}})}}static checkAndExecuteWaitingChildren(e){if(!this.waitingPool.size)return;const t=[];this.waitingPool.forEach((r,n)=>{r.item.pid===e&&t.push({id:n,...r})});for(const r of t){const n=this.dataSourceStatePool.get(e);n&&(n.status==="completed"?(this.waitingPool.delete(r.id),this.executeDataSource(r.item,r.callback,r.noUseMapping,r.isInterval,r.isEditor)):n.callbacks.push(()=>{this.waitingPool.delete(r.id),this.executeDataSource(r.item,r.callback,r.noUseMapping,r.isInterval,r.isEditor)}))}}static executeDataSource(e,t,r,n,s){if(s){this.executeTask(e,r,s,a=>{t(a)});return}this.markDataSourceExecuting(e.id),this.setupInterval(e,n,r,s,t),this.executeTask(e,r,s,a=>{t(a),this.markDataSourceCompleted(e.id)})}static setupInterval(e,t,r,n,s){if(!t)return;const a=this.timerPool.get(e.id);if(a&&(clearInterval(a),this.timerPool.delete(e.id)),e.source.isAutoUpdate){const o=setInterval(()=>{this.markDataSourceExecuting(e.id),this.executeTask(e,r,n,l=>{s(l),this.markDataSourceCompleted(e.id)})},e.source.autoUpdateTime*1e3);this.timerPool.set(e.id,o)}}static executeTask(e,t,r,n){const s=e,{source:a}=s,o=this.getParser(a.type);o&&o(s,t,l=>{if(r){n(l);return}t?(drt(s.source.storage,l.noMappingData),n(l.noMappingData)):(drt(s.source.storage,l.finalKeyData),n(l.finalKeyData))})}static processData(e,t,r,n){const{filter:s,mapping:a,dynamicMapping:o,isUserdata:l}=Ht.cloneDeep(e);return new Promise(function(u){const c=t;pL.filterData(s,t).then(d=>{var p;const h={id:r,finalKeyData:{id:r,data:null},finalUserData:{id:r,data:null},filteredData:{id:r,data:d},rawData:{id:r,data:c},noMappingData:null};if(n)h.finalUserData.data=h.noMappingData=d;else{const m=IFn(d,a,o,l),x=!!((p=m.mappedData)!=null&&p.length);h.finalKeyData.data=x?BFn(m.mappedData,m.finalMapping):d,h.finalUserData.data=x?m.mappedData:d}u(h)})})}static async filterData(e,t){if(!Ht.isString(e))return t;try{let r=e.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,"");r=jl.replaceStringVariables(r);const n=`
33396
33396
  ${r}
33397
33397
  if (typeof filter !== 'function') {
33398
33398
  throw new Error('filter function is not defined in the provided code');