@shjjs/visual-ui 3.0.5 → 3.0.7

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
@@ -32659,7 +32659,7 @@ void main() {
32659
32659
  `,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(Yt.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&&Yt.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">
32660
32660
  <span class="label">${c}</span>
32661
32661
  <img src="${t.map}" style="width:${t.width}px; height:${t.height}px;" >
32662
- </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&&Yt.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&&Yt.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(Yt.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(()=>Yt.cloneDeep(i.option.map.depth),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&n()}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.scene.defaultMapAdcode),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&n()}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.scene.translateX),(s,a)=>{try{if(!Yt.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(()=>Yt.cloneDeep(i.option.scene.translateY),(s,a)=>{try{if(!Yt.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(()=>Yt.cloneDeep(i.option.scene.translateZ),(s,a)=>{try{if(!Yt.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(()=>Yt.cloneDeep(i.option.orbitControls),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&e.value.camera.setControls(s)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.scene.z),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&(e.value.scene.position.z=s)}catch{}},{deep:!0}),i.option.map.backgroundImg&&(Ai(()=>Yt.cloneDeep(i.option.map.backgroundImg.show),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&e.value.createMapBackgroundImg(!1)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.map.backgroundImg.src),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&e.value.mapBackgroundImgMaterial&&e.value.createMapBackgroundImg(!1)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.map.backgroundImg.alphaMap),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&e.value.mapBackgroundImgMaterial&&e.value.createMapBackgroundImg(!1)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.map.backgroundImg.color),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&e.value.mapBackgroundImgMaterial&&(e.value.mapBackgroundImgMaterial.color=new Ts(s))}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.map.backgroundImg.opacity),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&e.value.mapBackgroundImgMaterial&&(e.value.mapBackgroundImgMaterial.opacity=s)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.map.backgroundImg.rotation),(s,a)=>{try{!Yt.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(()=>Yt.cloneDeep(i.option.map.backgroundImg.position),(s,a)=>{try{!Yt.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(()=>Yt.cloneDeep(i.option.map.backgroundImg.scale),(s,a)=>{try{!Yt.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(()=>Yt.cloneDeep(i.option.scene.background),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&(e.value.scene.background=new Ts(s))}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.scene.isBackground),(s,a)=>{try{!Yt.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(()=>Yt.cloneDeep(i.option.map.lineColor),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&(e.value.provinceLineMaterial.color=new Ts(s))}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.map.mirrorShow),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&(e.value.groundMirror.visible=s)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.map.arealabel),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&e.value.setAreaLabelStyle(s)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.map.titleLabel),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&e.value.setMapTitleLabelStyle(s)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.map.topMaterial),async(s,a)=>{try{if(!Yt.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(()=>Yt.cloneDeep(i.option.map.sideMaterial),(s,a)=>{try{if(!Yt.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(()=>Yt.cloneDeep(i.option.map.storkeAnimation),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&e.value.createAreaMapStorke(s,!1)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.particle),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&e6r(e.value,s)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.floor.gaoguang),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&(e.value.gaoguangMesh.visible=s.show,e.value.gaoguangMesh.material.color=new Ts(s.color))}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.floor.quan),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&(e.value.quan.visible=s.show,e.value.quan.material.color=new Ts(s.color))}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.floor.gridRipple),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&$Ar(e.value,s)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.floor.rotateBorder),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&ZAr(e.value,s,!1)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.light.ambientLight),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&r6r(e.value,s)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.light.directionalLight),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&i6r(e.value,s,i.option.debugger)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.light.pointLight1),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&n6r(e.value,s,i.option.debugger)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.light.pointLight2),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&s6r(e.value,s,i.option.debugger)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.debugger),(s,a)=>{try{!Yt.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(()=>Yt.cloneDeep(i.option.camera.position),(s,a)=>{try{if(!Yt.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(()=>Yt.cloneDeep(i.option.camera.target),(s,a)=>{try{if(!Yt.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(()=>Yt.cloneDeep(i.option.widgets.filter(s=>s.type==="bar")),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&s.length===a.length&&s.forEach(o=>{e.value.createBar(o,void 0,!1)})}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.widgets.filter(s=>s.type==="scatter")),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&s.length===a.length&&s.forEach(o=>{e.value.createScatter(o,void 0,!1)})}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.widgets.filter(s=>s.type==="flyline")),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&s.length===a.length&&s.forEach(o=>{e.value.createFlyLine(o,void 0,!1)})}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.widgets.filter(s=>s.type==="regionalLevel")),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&s.length===a.length&&s.forEach(o=>{e.value.createRegionalLevel(o,void 0,!1)})}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.sources),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&r(!1)}catch{}},{deep:!0})},o6r="2.0.0",h9n=i=>{const e=Yt.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((q,W)=>{pl.parse({sources:[i.sources[W]],callback:X=>{try{q&&q.type==="bar"&&s.value.createBar(q,X.data[0].data,!0,j),q&&q.type==="scatter"&&s.value.createScatter(q,X.data[0].data,!0,j),q&&q.type==="flyline"&&s.value.createFlyLine(q,X.data[0].data,!0,j),q&&q.type==="regionalLevel"&&s.value.createRegionalLevel(q,X.data[0].data,!0,j),j&&(s.value.createBarTimeLine(),s.value.createScatterTimeLine(),s.value.createFlyLineTimeLine(),s.value.createRegionalLevelTimeLine()),n("on-data-change",X),bi.parseEvents(i.useEvents,"on-data-change",X)}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:W=>{n("on-area-mouseover",W),bi.parseEvents(i.useEvents,"on-area-mouseover",W)},onAreaMouseout:W=>{n("on-area-mouseout",W),bi.parseEvents(i.useEvents,"on-area-mouseout",W)},onLoadChild:W=>{if(n("on-area-click",W),bi.parseEvents(i.useEvents,"on-area-click",W),W.adcode!==c.present&&j.scene.isDrilling&&j.scene.defaultMapAdcode!==1){n("on-drill-down",W),bi.parseEvents(i.useEvents,"on-drill-down",W);const X=Yt.cloneDeep(j);X.scene.defaultMapAdcode=W.adcode,s.value=m(X),c.push(W.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:W=>{n("on-bar-click",W),bi.parseEvents(i.useEvents,"on-bar-click",W)},onClickScatter:W=>{n("on-scatter-click",W),bi.parseEvents(i.useEvents,"on-scatter-click",W)},onClickFlyline:W=>{n("on-flyline-click",W),bi.parseEvents(i.useEvents,"on-flyline-click",W)}})),x=()=>{if(!u.value)return;const{clientWidth:j,clientHeight:q}=u.value;!j||!q||(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=Yt.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,q,W)=>{ju.timeline().add(ju.to(s.value.camera.instance.position,{duration:2,delay:0,x:j,y:q,z:W,ease:"circ.out"}))};e({refresh:()=>h(),refreshView:()=>h(),refreshData:()=>h(),goBack:()=>v(),setCameraPosition:(j,q,W)=>E(j,q,W)});const S=Aai(),C=Wt(),T=j=>{if(C.value&&j){const q=`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":q}}return{}},I=Wt(Yt.cloneDeep(r.value.widgets)),B=fi(()=>{try{const j=I.value.filter(q=>q.type==="regionalLevel");return j.length>0?j[0].isHide?null:j[0]:null}catch{return null}});Ai(()=>Yt.cloneDeep(r.value.widgets),(j,q)=>{try{!Yt.isEqual(j,q)&&s.value&&(I.value=Yt.cloneDeep(r.value.widgets))}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(I.value.filter(j=>j.type==="bar")),(j,q)=>{try{!Yt.isEqual(j,q)&&s.value&&j.length===q.length&&j.forEach(W=>{s.value.createBar(W,void 0,!1)})}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(I.value.filter(j=>j.type==="scatter")),(j,q)=>{try{!Yt.isEqual(j,q)&&s.value&&j.length===q.length&&j.forEach(W=>{s.value.createScatter(W,void 0,!1)})}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(I.value.filter(j=>j.type==="flyline")),(j,q)=>{try{!Yt.isEqual(j,q)&&s.value&&j.length===q.length&&j.forEach(W=>{s.value.createFlyLine(W,void 0,!1)})}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(I.value.filter(j=>j.type==="regionalLevel")),(j,q)=>{try{!Yt.isEqual(j,q)&&s.value&&j.length===q.length&&j.forEach(W=>{s.value.createRegionalLevel(W,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(q=>!q.isHide);I.value.forEach(q=>q.isHide=j)}catch{}},k=j=>{const q=`url(${j.backgroundImage})`,W=`url(${U(j.hover.backgroundImage)})`,X=`url(${U(j.active.backgroundImage)})`;return{...Qo.json2cssObject(j),...Qo.json2cssObject(j.hover,"hover"),...Qo.json2cssObject(j.active,"active"),"background-image":q,"--hover-background-image":W,"--active-background-image":X}},U=j=>!j.startsWith("http")&&!j.startsWith("//")?"../"+j:j;return(j,q)=>(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,(W,X)=>(Gt(),Wr("div",{key:X,class:"item"},[tn("div",{class:"color",style:Va({backgroundColor:W.color})},null,4),tn("span",p9n,jd(W.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(W=>!W.isHide)}]),style:Va(k(r.value.widgetControlStyle)),onClick:L},jd(I.value.every(W=>!W.isHide)?"隐藏":"显示")+"/全部 ",7),(Gt(!0),Wr(ia,null,ou(I.value,W=>(Gt(),Wr("div",{key:W.id,class:Xa(["control-button",{active:!W.isHide}]),style:Va(k(r.value.widgetControlStyle)),onClick:X=>O(W)},jd(W.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-673277b1"]])),u6r="2.0.0",v9n=i=>{const e=Yt.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=Yt.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=Yt.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=Yt.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";/*!
32662
+ </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&&Yt.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&&Yt.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(Yt.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(()=>Yt.cloneDeep(i.option.map.depth),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&n()}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.scene.defaultMapAdcode),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&n()}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.scene.translateX),(s,a)=>{try{if(!Yt.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(()=>Yt.cloneDeep(i.option.scene.translateY),(s,a)=>{try{if(!Yt.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(()=>Yt.cloneDeep(i.option.scene.translateZ),(s,a)=>{try{if(!Yt.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(()=>Yt.cloneDeep(i.option.orbitControls),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&e.value.camera.setControls(s)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.scene.z),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&(e.value.scene.position.z=s)}catch{}},{deep:!0}),i.option.map.backgroundImg&&(Ai(()=>Yt.cloneDeep(i.option.map.backgroundImg.show),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&e.value.createMapBackgroundImg(!1)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.map.backgroundImg.src),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&e.value.mapBackgroundImgMaterial&&e.value.createMapBackgroundImg(!1)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.map.backgroundImg.alphaMap),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&e.value.mapBackgroundImgMaterial&&e.value.createMapBackgroundImg(!1)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.map.backgroundImg.color),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&e.value.mapBackgroundImgMaterial&&(e.value.mapBackgroundImgMaterial.color=new Ts(s))}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.map.backgroundImg.opacity),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&e.value.mapBackgroundImgMaterial&&(e.value.mapBackgroundImgMaterial.opacity=s)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.map.backgroundImg.rotation),(s,a)=>{try{!Yt.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(()=>Yt.cloneDeep(i.option.map.backgroundImg.position),(s,a)=>{try{!Yt.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(()=>Yt.cloneDeep(i.option.map.backgroundImg.scale),(s,a)=>{try{!Yt.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(()=>Yt.cloneDeep(i.option.scene.background),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&(e.value.scene.background=new Ts(s))}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.scene.isBackground),(s,a)=>{try{!Yt.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(()=>Yt.cloneDeep(i.option.map.lineColor),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&(e.value.provinceLineMaterial.color=new Ts(s))}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.map.mirrorShow),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&(e.value.groundMirror.visible=s)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.map.arealabel),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&e.value.setAreaLabelStyle(s)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.map.titleLabel),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&e.value.setMapTitleLabelStyle(s)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.map.topMaterial),async(s,a)=>{try{if(!Yt.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(()=>Yt.cloneDeep(i.option.map.sideMaterial),(s,a)=>{try{if(!Yt.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(()=>Yt.cloneDeep(i.option.map.storkeAnimation),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&e.value.createAreaMapStorke(s,!1)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.particle),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&e6r(e.value,s)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.floor.gaoguang),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&(e.value.gaoguangMesh.visible=s.show,e.value.gaoguangMesh.material.color=new Ts(s.color))}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.floor.quan),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&(e.value.quan.visible=s.show,e.value.quan.material.color=new Ts(s.color))}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.floor.gridRipple),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&$Ar(e.value,s)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.floor.rotateBorder),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&ZAr(e.value,s,!1)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.light.ambientLight),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&r6r(e.value,s)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.light.directionalLight),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&i6r(e.value,s,i.option.debugger)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.light.pointLight1),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&n6r(e.value,s,i.option.debugger)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.light.pointLight2),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&s6r(e.value,s,i.option.debugger)}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.debugger),(s,a)=>{try{!Yt.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(()=>Yt.cloneDeep(i.option.camera.position),(s,a)=>{try{if(!Yt.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(()=>Yt.cloneDeep(i.option.camera.target),(s,a)=>{try{if(!Yt.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(()=>Yt.cloneDeep(i.option.widgets.filter(s=>s.type==="bar")),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&s.length===a.length&&s.forEach(o=>{e.value.createBar(o,void 0,!1)})}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.widgets.filter(s=>s.type==="scatter")),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&s.length===a.length&&s.forEach(o=>{e.value.createScatter(o,void 0,!1)})}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.widgets.filter(s=>s.type==="flyline")),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&s.length===a.length&&s.forEach(o=>{e.value.createFlyLine(o,void 0,!1)})}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.option.widgets.filter(s=>s.type==="regionalLevel")),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&s.length===a.length&&s.forEach(o=>{e.value.createRegionalLevel(o,void 0,!1)})}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(i.sources),(s,a)=>{try{!Yt.isEqual(s,a)&&e.value&&r(!1)}catch{}},{deep:!0})},o6r="2.0.0",h9n=i=>{const e=Yt.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((q,W)=>{pl.parse({sources:[i.sources[W]],callback:X=>{try{q&&q.type==="bar"&&s.value.createBar(q,X.data[0].data,!0,j),q&&q.type==="scatter"&&s.value.createScatter(q,X.data[0].data,!0,j),q&&q.type==="flyline"&&s.value.createFlyLine(q,X.data[0].data,!0,j),q&&q.type==="regionalLevel"&&s.value.createRegionalLevel(q,X.data[0].data,!0,j),j&&(s.value.createBarTimeLine(),s.value.createScatterTimeLine(),s.value.createFlyLineTimeLine(),s.value.createRegionalLevelTimeLine()),n("on-data-change",X),bi.parseEvents(i.useEvents,"on-data-change",X)}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:W=>{n("on-area-mouseover",W),bi.parseEvents(i.useEvents,"on-area-mouseover",W)},onAreaMouseout:W=>{n("on-area-mouseout",W),bi.parseEvents(i.useEvents,"on-area-mouseout",W)},onLoadChild:W=>{if(n("on-area-click",W),bi.parseEvents(i.useEvents,"on-area-click",W),W.adcode!==c.present&&j.scene.isDrilling&&j.scene.defaultMapAdcode!==1){n("on-drill-down",W),bi.parseEvents(i.useEvents,"on-drill-down",W);const X=Yt.cloneDeep(j);X.scene.defaultMapAdcode=W.adcode,s.value=m(X),c.push(W.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:W=>{n("on-bar-click",W),bi.parseEvents(i.useEvents,"on-bar-click",W)},onClickScatter:W=>{n("on-scatter-click",W),bi.parseEvents(i.useEvents,"on-scatter-click",W)},onClickFlyline:W=>{n("on-flyline-click",W),bi.parseEvents(i.useEvents,"on-flyline-click",W)}})),x=()=>{if(!u.value)return;const{clientWidth:j,clientHeight:q}=u.value;!j||!q||(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=Yt.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,q,W)=>{ju.timeline().add(ju.to(s.value.camera.instance.position,{duration:2,delay:0,x:j,y:q,z:W,ease:"circ.out"}))};e({refresh:()=>h(),refreshView:()=>h(),refreshData:()=>h(),goBack:()=>v(),setCameraPosition:(j,q,W)=>E(j,q,W)});const S=Aai(),C=Wt(),T=j=>{if(C.value&&j){const q=`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":q}}return{}},I=Wt(Yt.cloneDeep(r.value.widgets)),B=fi(()=>{try{const j=I.value.filter(q=>q.type==="regionalLevel");return j.length>0?j[0].isHide?null:j[0]:null}catch{return null}});Ai(()=>Yt.cloneDeep(r.value.widgets),(j,q)=>{try{!Yt.isEqual(j,q)&&s.value&&(I.value=Yt.cloneDeep(r.value.widgets))}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(I.value.filter(j=>j.type==="bar")),(j,q)=>{try{!Yt.isEqual(j,q)&&s.value&&j.length===q.length&&j.forEach(W=>{s.value.createBar(W,void 0,!1)})}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(I.value.filter(j=>j.type==="scatter")),(j,q)=>{try{!Yt.isEqual(j,q)&&s.value&&j.length===q.length&&j.forEach(W=>{s.value.createScatter(W,void 0,!1)})}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(I.value.filter(j=>j.type==="flyline")),(j,q)=>{try{!Yt.isEqual(j,q)&&s.value&&j.length===q.length&&j.forEach(W=>{s.value.createFlyLine(W,void 0,!1)})}catch{}},{deep:!0}),Ai(()=>Yt.cloneDeep(I.value.filter(j=>j.type==="regionalLevel")),(j,q)=>{try{!Yt.isEqual(j,q)&&s.value&&j.length===q.length&&j.forEach(W=>{s.value.createRegionalLevel(W,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(q=>!q.isHide);I.value.forEach(q=>q.isHide=j)}catch{}},k=j=>{const q=`url(${j.backgroundImage})`,W=`url(${U(j.hover.backgroundImage)})`,X=`url(${U(j.active.backgroundImage)})`;return{...Qo.json2cssObject(j),...Qo.json2cssObject(j.hover,"hover"),...Qo.json2cssObject(j.active,"active"),"background-image":q,"--hover-background-image":W,"--active-background-image":X}},U=j=>!j.startsWith("http")&&!j.startsWith("//")?"../"+j:j;return(j,q)=>(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,(W,X)=>(Gt(),Wr("div",{key:X,class:"item"},[tn("div",{class:"color",style:Va({backgroundColor:W.color})},null,4),tn("span",p9n,jd(W.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(W=>!W.isHide)}]),style:Va(k(r.value.widgetControlStyle)),onClick:L},jd(I.value.every(W=>!W.isHide)?"隐藏":"显示")+"/全部 ",7),(Gt(!0),Wr(ia,null,ou(I.value,W=>(Gt(),Wr("div",{key:W.id,class:Xa(["control-button",{active:!W.isHide}]),style:Va(k(r.value.widgetControlStyle)),onClick:X=>O(W)},jd(W.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-91478c10"]])),u6r="2.0.0",v9n=i=>{const e=Yt.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=Yt.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=Yt.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=Yt.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
32663
  * vue-router v4.5.1
32664
32664
  * (c) 2025 Eduardo San Martin Morote
32665
32665
  * @license MIT
@@ -33389,7 +33389,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
33389
33389
 
33390
33390
  @babel/runtime/helpers/regenerator.js:
33391
33391
  (*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE *)
33392
- */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(!Yt.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}),n},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=>{var u;if(r){n(l);return}!t&&((u=s.source.mapping)!=null&&u.length)?(drt(s.source.storage,l.finalKeyData),n(l.finalKeyData)):(drt(s.source.storage,l.noMappingData),n(l.noMappingData))})}static processData(e,t,r,n){const{filter:s,mapping:a,dynamicMapping:o,isUserdata:l}=Yt.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&&a.length){const p=IFn(d,a,o,l);h.finalKeyData.data=p.length?BFn(p,a):d,h.finalUserData.data=p.length?p:d}else h.finalUserData.data=d,h.noMappingData=d;u(h)})})}static async filterData(e,t){if(!Yt.isString(e))return t;try{let r=e.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,"");r=jl.replaceStringVariables(r);const n=`
33392
+ */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(!Yt.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}=Yt.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(!Yt.isString(e))return t;try{let r=e.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,"");r=jl.replaceStringVariables(r);const n=`
33393
33393
  ${r}
33394
33394
  if (typeof filter !== 'function') {
33395
33395
  throw new Error('filter function is not defined in the provided code');