earthsdk3-cesium 3.6.2 → 3.6.4

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.
@@ -571,7 +571,7 @@ class CityShaderInstance extends xbsj['xr-base-utils'].Destroyable {
571
571
  //material.diffuse = vec3(0.0, 0.0, 1.0);
572
572
  //material.diffuse.g = -fsInput.attributes.positionEC.z / 1.0e4;
573
573
  }
574
- `});this._customShader=o}update(){alert("暂未实现!")}get customShader(){return this._customShader}}const lE=(t,i)=>{if(!t)return;const e=6378137*Math.PI/180,[n,o,s]=t,l=1/(e*Math.cos(o*Math.PI/180));return[i[0]/l,i[1]/l,i[2]]},cE=(t,i)=>{const e=6378137*Math.PI/180,[n,o,s]=t,r=i,c=1/(e*Math.cos(o*Math.PI/180));return[n+c*r[0],o+c*r[1],s+r[2]]};function gh(t){return`rgba(${t[0]*255},${t[1]*255},${t[2]*255},${t[3]})`}function hE(t,i){const e=Reflect.has(t,"value"),n=Reflect.has(t,"minValue"),o=Reflect.has(t,"maxValue");try{const s=typeof t.value=="string"?`'${t.value}'`:t.value;if(e)return[`\${${i}} === `+s,gh(t.rgba)];if(n&&o)return[`\${${i}} >= ${t.minValue} && \${${i}} <= ${t.maxValue}`,gh(t.rgba)];if(n)return[`\${${i}} >= ${t.minValue}`,gh(t.rgba)];if(o)return[`\${${i}} <= ${t.maxValue}`,gh(t.rgba)];if(!e&&!n&&!o)throw new Error(`Feature Color JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, rgba值为0~1且必须存在!`)}catch(s){throw new Error(`Feature Color JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, rgba值为0~1且必须存在! ${s}`)}}function uE(t,i){const e=Reflect.has(t,"value"),n=Reflect.has(t,"minValue"),o=Reflect.has(t,"maxValue");try{const s=typeof t.value=="string"?`'${t.value}'`:t.value;if(e)return[`\${${i}} === `+s,t.visable.toString()];if(n&&o)return[`\${${i}} >= ${t.minValue} && \${${i}} <= ${t.maxValue}`,t.visable.toString()];if(n)return[`\${${i}} >= ${t.minValue}`,t.visable.toString()];if(o)return[`\${${i}} <= ${t.maxValue}`,t.visable.toString()];if(!e&&!n&&!o)throw new Error(`Feature Visable JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, visable必须存在!`)}catch(s){throw new Error(`Feature Visable JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, visable必须存在! ${s}`)}}const Wi=class Wi extends Jt{constructor(e,n){super(e,n);m(this,"_czm3DTiles");m(this,"_clippingPlanes");m(this,"_flattenedPlane");m(this,"_styleColor",this.dv(a.react(void 0)));m(this,"_highlightStyleColor",this.dv(a.react(void 0)));m(this,"_styleVisable",this.dv(a.react(void 0)));this._flattenedPlane=this.dv(new Wn(n,e.id)),this._czm3DTiles=this.dv(new be(n,this,e.id)),this._clippingPlanes=this.dv(new Ds(n,e.id));const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this._czm3DTiles;this.ad(e.setMaterialEvent.don(c=>{s.setMaterial(c)}));{const c=()=>{s.origin&&(e.offset||(e.offset=[0,0,0]),s.position=cE(s.origin,e.offset))};c(),this.d(e.offsetChanged.don(c)),this.d(s.originChanged.don(c))}{const c=()=>{if(!s.position)return;const d=s.position.map((p,f)=>{if(s.origin)return p-s.origin[f]});s.origin&&(e.offset=lE(s.origin,d))};c();const u=this.ad(a.createNextAnimateFrameEvent(s.positionChanged));this.d(u.don(c))}const r=this._clippingPlanes,l=this._flattenedPlane;this.d(e.setFeatureColorEvent.don((c,u)=>{const p=u.reverse().map(f=>hE(f,c));this.setFeatureColor(p)})),this.d(e.setFeatureVisableEvent.don((c,u)=>{const p=u.reverse().map(f=>uE(f,c));this.setFeatureVisable(p)})),this.d(e.resetFeatureStyleEvent.don(()=>{this.resetFeatureStyle()})),this.d(e.highlightFeatureEvent.don((c,u)=>{this.highlightFeature(c,u)})),this.d(e.highlightFeatureAndFlyToEvent.don((c,u,d,p)=>{d&&this.highlightFeature(c,d);const f=new h.Cartesian3(u[0],u[1],u[2]),g=new h.BoundingSphere(f,u[3]);o.camera.flyToBoundingSphere(g,{duration:p??1})})),Wi.strokeFeaturePostProcess.register(this),this.ad(()=>{Wi.strokeFeaturePostProcess.unregister(this)}),this.ad(e.strokeFeatureEvent.don((c,u)=>{u&&Wi.strokeFeaturePostProcess.setStrokeColor(u),Wi.strokeFeaturePostProcess.setStrokeSelect(this,c)})),this.d(s.czmTilesetReadyEvent.don(c=>{const u=d=>{if(c.style=void 0,d.length===0)return;const p=[...d],f=[],g=[];let v;p.forEach(y=>{Array.isArray(y.condition)?(f.push({condition:y.condition,color:y.color??[1,1,1,1]}),g.push({condition:y.condition,show:y.show??!0})):(f.push({condition:[y.condition],color:y.color??[1,1,1,1]}),g.push({condition:[y.condition],show:y.show??!0}))});{const y=(P,C)=>{try{let S;return f.forEach(A=>{if(S===void 0){const E=nE(A,P);E.length>0&&!E.includes(!1)&&(S=eE(A.color,C))}}),S||h.Color.clone(h.Color.WHITE,C)}catch{return h.Color.clone(h.Color.WHITE,C)}},w=P=>{try{let C;return g.forEach(S=>{if(C===void 0){const A=oE(S,P);A.length>0&&!A.includes(!1)&&(C=S.show)}}),C!==void 0?C:!0}catch{return!0}};v=new h.Cesium3DTileStyle({color:{evaluateColor:function(P,C){return y(P,C)}},show:{evaluate:function(P){return w(P)}}})}c.style=v};this.d(e.setFeatureStyleEvent.don(d=>{u(d)})),this.d(e.resetFeatureStyleEvent.don(()=>{c.style=void 0}));{const d=this,p=[],f=c.tileLoad.addEventListener(function(v){try{const w=v.content.getFeature(0),C=w.getPropertyIds().map(E=>{const R=w.getProperty(E);return{key:E,type:typeof R}}),S=p.map(E=>E.key),A=C.filter(E=>!S.includes(E.key));p.push(...A)}catch{}});this.d(()=>{f()});const g=async()=>{try{p.length>0?e._featureTableResultEvent.emit(p):e._featureTableResultEvent.emit(void 0)}catch(v){console.warn(`CzmES3DTileset GetFeatureTable: ${v}`),e._featureTableResultEvent.emit(void 0)}};d.d(e.getFeatureTableEvent.don(()=>{g()}))}{const d=p=>{s.tileset.featureIdLabel=`featureId_${p}`};this.ad(e.featureIdLabelChanged.don(p=>{d(p)}))}})),this.d(s.czmTilesetReadyEvent.don((c,u)=>{e.supportEdit=s.supportEdit,e.tilesetReady.emit(c)})),s.absoluteClippingPlanes=!0,s.czmFlattenedPlaneId=this.flattenedPlane.id,e.flattenedPlaneId=this.flattenedPlane.id,s.clippingPlanesId=this.clippingPlanes.id,this.d(a.track([l,"enabled"],[e,"flattenedPlaneEnabled"])),this.d(a.track([r,"enabled"],[e,"clippingPlaneEnabled"])),this.d(a.track([r,"planeIds"],[e,"clippingPlaneIds"])),this.d(a.track([r,"unionClippingRegions"],[e,"unionClippingRegions"])),this.d(a.track([r,"edgeColor"],[e,"clippingPlaneEdgeColor"])),this.d(a.track([r,"edgeWidth"],[e,"clippingPlaneEdgeWidth"])),this.d(e.clippingPlaneIdChanged.don(()=>{s.clippingPlanesId=e.clippingPlaneId})),this.d(e.excavateIdChanged.don(()=>{s.clippingPolygonsId=e.excavateId}));{const c=()=>{typeof e.url=="string"?e.url=a.ESSceneObject.context.getStrFromEnv(e.url):e.url&&(e.url.url=a.ESSceneObject.context.getStrFromEnv(e.url.url)),s.url=e.url};c(),this.d(e.urlChanged.don(c))}this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([s,"colorBlendMode"],[e,"colorBlendMode"])),this.d(a.track([s,"cacheBytes"],[e,"cacheBytes"])),this.d(a.track([s,"maximumCacheOverflowBytes"],[e,"cacheBytes"])),this.d(a.track([s,"allowPicking"],[e,"allowPicking"])),this.d(a.bind([s,"imageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(a.track([s,"environmentMapManager"],[e,"czmEnvironmentMapManager"])),this.d(a.track([s,"maximumScreenSpaceError"],[e,"maximumScreenSpaceError"])),this.d(a.track([s,"maximumMemoryUsage"],[e,"czmMaximumMemoryUsage"])),this.d(a.track([s,"classificationType"],[e,"czmClassificationType"])),this.d(a.track([s,"styleJson"],[e,"czmStyleJson"])),this.d(a.bind([s,"rotation"],[e,"rotation"])),this.d(a.track([s,"backFaceCulling"],[e,"czmBackFaceCulling"])),this.d(a.track([s,"debugShowBoundingVolume"],[e,"czmDebugShowBoundingVolume"])),this.d(a.track([s,"debugShowContentBoundingVolume"],[e,"czmDebugShowContentBoundingVolume"])),this.d(a.track([s,"skipLevelOfDetail"],[e,"czmSkipLevelOfDetail"])),this.ad(a.bind([s,"splitDirection"],[e,"splitDirection"]));{const c=u=>{e.czmEnvironmentMapManager=e.czmEnvironmentMapManager?{...e.czmEnvironmentMapManager,atmosphereScatteringIntensity:u}:{atmosphereScatteringIntensity:u}};c(e.czmAtmosphereScatteringIntensity),c(e.czmLuminanceAtZenith),this.ad(e.czmAtmosphereScatteringIntensityChanged.don(u=>c(u))),this.ad(e.czmLuminanceAtZenithChanged.don(u=>c(u)))}{const c=()=>{var u,d;(u=e.czmEnvironmentMapManager)!=null&&u.atmosphereScatteringIntensity&&(e.czmAtmosphereScatteringIntensity=e.czmLuminanceAtZenith=(d=e.czmEnvironmentMapManager)==null?void 0:d.atmosphereScatteringIntensity)};c(),this.ad(e.czmEnvironmentMapManagerChanged.don(c))}{const c=()=>{const u=e.materialMode??a.ES3DTileset.defaults.materialMode;Cy=e.materialParams.baseColor??[1,1,1],u==="normal"?s.customShaderInstanceClass=void 0:u==="technology"&&(s.customShaderInstanceClass=void 0,s.customShaderInstanceClass=aE)};this.d(e.materialModeChanged.don(u=>{c()})),this.d(e.materialParamsChanged.don(()=>{c()})),c()}}get czm3DTiles(){return this._czm3DTiles}get clippingPlanes(){return this._clippingPlanes}get flattenedPlane(){return this._flattenedPlane}get styleColor(){return this._styleColor.value}set styleColor(e){this._styleColor.value=e}get highlightStyleColor(){return this._highlightStyleColor.value}set highlightStyleColor(e){this._highlightStyleColor.value=e}get styleVisable(){return this._styleVisable.value}set styleVisable(e){this._styleVisable.value=e}highlightFeature(e,n){const o=n??"rgba(255,0,0,1)",l=["${id} === "+(typeof e=="string"?`'${e}'`:e),o];let c={};const u=this.styleColor?[l,...this.styleColor]:[l];this.styleVisable?c={show:{conditions:[...this.styleVisable]},color:{conditions:[...u]}}:c={color:{conditions:[...u]}},console.log("style",c),this._czm3DTiles.styleJson=c,this.highlightStyleColor=[...l]}setFeatureColor(e){const n=this.highlightStyleColor,o=this.styleColor?[...e,...this.styleColor]:[...e];let s={};this.styleVisable?n?s={show:{conditions:[...this.styleVisable]},color:{conditions:[...o,n]}}:s={show:{conditions:[...this.styleVisable]},color:{conditions:[...o]}}:n?s={color:{conditions:[...o,n]}}:s={color:{conditions:[...o]}},console.log("style",s),this._czm3DTiles.styleJson=s,this.styleColor=[...o]}setFeatureVisable(e){let n={};const o=this.highlightStyleColor,s=this.styleVisable?[...e,...this.styleVisable]:[...e];this.styleColor?o?n={show:{conditions:[...s]},color:{conditions:[o,...this.styleColor]}}:n={show:{conditions:[...s]},color:{conditions:[...this.styleColor]}}:o?n={show:{conditions:[...s]},color:{conditions:[o]}}:n={show:{conditions:[...s]}},console.log("style",n),this._czm3DTiles.styleJson=n,this.styleVisable=[...s]}resetFeatureStyle(){this.czm3DTiles.styleJson=void 0,this.styleColor=void 0,this.highlightStyleColor=void 0,this.styleVisable=void 0}flyTo(e,n){const{sceneObject:o,czmViewer:s,czm3DTiles:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e&&e*1e3),o.flyOverEvent.emit(n,"over",s),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czm3DTiles:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.flyTo(e&&e*1e3),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(Wi,"type",Wi.register("ESCesiumViewer",a.ES3DTileset.type,Wi)),m(Wi,"strokeFeaturePostProcess",new jA);let Rs=Wi;const Ea=class Ea extends me{constructor(e,n){super(e,n);m(this,"_czmModelPrimitive");if(!n.viewer){console.warn("viewer is undefined!");return}const s=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/warning/warning_b.glb"),r=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/warning/warning_a.glb");this._czmModelPrimitive=this.dv(new ct(this.czmViewer,this.sceneObject.id));const l=this._czmModelPrimitive;this.d(l.readyEvent.don(c=>{e.readyEvent.emit(c)})),this.ad(a.bind([l,"position"],[e,"position"])),this.ad(je([l,"rotation"],[e,"rotation"])),this.ad(a.track([l,"show"],[e,"show"])),l.activeAnimationsAnimateWhilePaused=!0,l.activeAnimationsJson=[{index:0,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration * 2"}];{const c=this.dv(a.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),u=()=>{e.allowPicking&&!e.editing?l.allowPicking=!0:l.allowPicking=!1};u(),this.d(c.don(u))}{const c=()=>{const u=e.mode;u==="circle"?l.url=s:(u==="cylinder"||u===void 0)&&(l.url=r)};c(),this.dispose(e.modeChanged.disposableOn(()=>{c()}))}{const c=()=>{const d=e.radius??a.ESAlarm.defaults.radius;l.scale=[d*e.scale[0],d*e.scale[1],d*e.scale[2]]};c();const u=this.dv(a.createNextAnimateFrameEvent(e.radiusChanged,e.scaleChanged));this.dispose(u.disposableOn(()=>{c()}))}}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmModelPrimitive:r}=this;return!s.actived||!s.viewer?!1:o.flyToParam||o.flyInParam?super.flyTo(e,n):(r&&Rt(s,o,n,e,r,!0),!0)}};m(Ea,"type",Ea.register("ESCesiumViewer",a.ESAlarm.type,Ea));let Ud=Ea;const dE={scan:`
574
+ `});this._customShader=o}update(){alert("暂未实现!")}get customShader(){return this._customShader}}const lE=(t,i)=>{if(!t)return;const e=6378137*Math.PI/180,[n,o,s]=t,l=1/(e*Math.cos(o*Math.PI/180));return[i[0]/l,i[1]/l,i[2]]},cE=(t,i)=>{const e=6378137*Math.PI/180,[n,o,s]=t,r=i,c=1/(e*Math.cos(o*Math.PI/180));return[n+c*r[0],o+c*r[1],s+r[2]]};function gh(t){return`rgba(${t[0]*255},${t[1]*255},${t[2]*255},${t[3]})`}function hE(t,i){const e=Reflect.has(t,"value"),n=Reflect.has(t,"minValue"),o=Reflect.has(t,"maxValue");try{const s=typeof t.value=="string"?`'${t.value}'`:t.value;if(e)return[`\${${i}} === `+s,gh(t.rgba)];if(n&&o)return[`\${${i}} >= ${t.minValue} && \${${i}} <= ${t.maxValue}`,gh(t.rgba)];if(n)return[`\${${i}} >= ${t.minValue}`,gh(t.rgba)];if(o)return[`\${${i}} <= ${t.maxValue}`,gh(t.rgba)];if(!e&&!n&&!o)throw new Error(`Feature Color JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, rgba值为0~1且必须存在!`)}catch(s){throw new Error(`Feature Color JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, rgba值为0~1且必须存在! ${s}`)}}function uE(t,i){const e=Reflect.has(t,"value"),n=Reflect.has(t,"minValue"),o=Reflect.has(t,"maxValue");try{const s=typeof t.value=="string"?`'${t.value}'`:t.value;if(e)return[`\${${i}} === `+s,t.visable.toString()];if(n&&o)return[`\${${i}} >= ${t.minValue} && \${${i}} <= ${t.maxValue}`,t.visable.toString()];if(n)return[`\${${i}} >= ${t.minValue}`,t.visable.toString()];if(o)return[`\${${i}} <= ${t.maxValue}`,t.visable.toString()];if(!e&&!n&&!o)throw new Error(`Feature Visable JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, visable必须存在!`)}catch(s){throw new Error(`Feature Visable JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, visable必须存在! ${s}`)}}const Wi=class Wi extends Jt{constructor(e,n){super(e,n);m(this,"_czm3DTiles");m(this,"_clippingPlanes");m(this,"_flattenedPlane");m(this,"_styleColor",this.dv(a.react(void 0)));m(this,"_highlightStyleColor",this.dv(a.react(void 0)));m(this,"_styleVisable",this.dv(a.react(void 0)));this._flattenedPlane=this.dv(new Wn(n,e.id)),this._czm3DTiles=this.dv(new be(n,this,e.id)),this._clippingPlanes=this.dv(new Ds(n,e.id));const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this._czm3DTiles;this.ad(e.setMaterialEvent.don(c=>{s.setMaterial(c)}));{const c=()=>{s.origin&&(e.offset||(e.offset=[0,0,0]),s.position=cE(s.origin,e.offset))};c(),this.d(e.offsetChanged.don(c)),this.d(s.originChanged.don(c))}{const c=()=>{if(!s.position)return;const d=s.position.map((p,f)=>{if(s.origin)return p-s.origin[f]});s.origin&&(e.offset=lE(s.origin,d))};c();const u=this.ad(a.createNextAnimateFrameEvent(s.positionChanged));this.d(u.don(c))}const r=this._clippingPlanes,l=this._flattenedPlane;this.d(e.setFeatureColorEvent.don((c,u)=>{const p=u.reverse().map(f=>hE(f,c));this.setFeatureColor(p)})),this.d(e.setFeatureVisableEvent.don((c,u)=>{const p=u.reverse().map(f=>uE(f,c));this.setFeatureVisable(p)})),this.d(e.resetFeatureStyleEvent.don(()=>{this.resetFeatureStyle()})),this.d(e.highlightFeatureEvent.don((c,u)=>{this.highlightFeature(c,u)})),this.d(e.highlightFeatureAndFlyToEvent.don((c,u,d,p)=>{d&&this.highlightFeature(c,d);const f=new h.Cartesian3(u[0],u[1],u[2]),g=new h.BoundingSphere(f,u[3]);o.camera.flyToBoundingSphere(g,{duration:p??1})})),Wi.strokeFeaturePostProcess.register(this),this.ad(()=>{Wi.strokeFeaturePostProcess.unregister(this)}),this.ad(e.strokeFeatureEvent.don((c,u)=>{u&&Wi.strokeFeaturePostProcess.setStrokeColor(u),Wi.strokeFeaturePostProcess.setStrokeSelect(this,c)})),this.d(s.czmTilesetReadyEvent.don(c=>{const u=d=>{if(c.style=void 0,d.length===0)return;const p=[...d],f=[],g=[];let v;p.forEach(y=>{Array.isArray(y.condition)?(f.push({condition:y.condition,color:y.color??[1,1,1,1]}),g.push({condition:y.condition,show:y.show??!0})):(f.push({condition:[y.condition],color:y.color??[1,1,1,1]}),g.push({condition:[y.condition],show:y.show??!0}))});{const y=(P,C)=>{try{let S;return f.forEach(A=>{if(S===void 0){const E=nE(A,P);E.length>0&&!E.includes(!1)&&(S=eE(A.color,C))}}),S||h.Color.clone(h.Color.WHITE,C)}catch{return h.Color.clone(h.Color.WHITE,C)}},w=P=>{try{let C;return g.forEach(S=>{if(C===void 0){const A=oE(S,P);A.length>0&&!A.includes(!1)&&(C=S.show)}}),C!==void 0?C:!0}catch{return!0}};v=new h.Cesium3DTileStyle({color:{evaluateColor:function(P,C){return y(P,C)}},show:{evaluate:function(P){return w(P)}}})}c.style=v};this.d(e.setFeatureStyleEvent.don(d=>{u(d)})),this.d(e.resetFeatureStyleEvent.don(()=>{c.style=void 0}));{const d=this,p=[],f=c.tileLoad.addEventListener(function(v){try{const w=v.content.getFeature(0),C=w.getPropertyIds().map(E=>{const R=w.getProperty(E);return{key:E,type:typeof R}}),S=p.map(E=>E.key),A=C.filter(E=>!S.includes(E.key));p.push(...A)}catch{}});this.d(()=>{f()});const g=async()=>{try{p.length>0?e._featureTableResultEvent.emit(p):e._featureTableResultEvent.emit(void 0)}catch(v){console.warn(`CzmES3DTileset GetFeatureTable: ${v}`),e._featureTableResultEvent.emit(void 0)}};d.d(e.getFeatureTableEvent.don(()=>{g()}))}{const d=p=>{s.tileset.featureIdLabel=`featureId_${p}`};this.ad(e.featureIdLabelChanged.don(p=>{d(p)}))}})),this.d(s.czmTilesetReadyEvent.don((c,u)=>{e.supportEdit=s.supportEdit,e.tilesetReady.emit(c)})),s.absoluteClippingPlanes=!0,s.czmFlattenedPlaneId=this.flattenedPlane.id,e.flattenedPlaneId=this.flattenedPlane.id,s.clippingPlanesId=this.clippingPlanes.id,this.d(a.track([l,"enabled"],[e,"flattenedPlaneEnabled"])),this.d(a.track([r,"enabled"],[e,"clippingPlaneEnabled"])),this.d(a.track([r,"planeIds"],[e,"clippingPlaneIds"])),this.d(a.track([r,"unionClippingRegions"],[e,"unionClippingRegions"])),this.d(a.track([r,"edgeColor"],[e,"clippingPlaneEdgeColor"])),this.d(a.track([r,"edgeWidth"],[e,"clippingPlaneEdgeWidth"])),this.d(e.clippingPlaneIdChanged.don(()=>{s.clippingPlanesId=e.clippingPlaneId})),this.d(e.excavateIdChanged.don(()=>{s.clippingPolygonsId=e.excavateId}));{const c=()=>{typeof e.url=="string"?e.url=a.ESSceneObject.context.getStrFromEnv(e.url):e.url&&(e.url.url=a.ESSceneObject.context.getStrFromEnv(e.url.url)),s.url=e.url};c(),this.d(e.urlChanged.don(c))}this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([s,"colorBlendMode"],[e,"colorBlendMode"])),this.d(a.track([s,"cacheBytes"],[e,"cacheBytes"])),this.d(a.track([s,"maximumCacheOverflowBytes"],[e,"cacheBytes"])),this.d(a.track([s,"allowPicking"],[e,"allowPicking"])),this.d(a.bind([s,"imageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(a.track([s,"environmentMapManager"],[e,"czmEnvironmentMapManager"])),this.d(a.track([s,"maximumScreenSpaceError"],[e,"maximumScreenSpaceError"])),this.d(a.track([s,"maximumMemoryUsage"],[e,"czmMaximumMemoryUsage"])),this.d(a.track([s,"classificationType"],[e,"czmClassificationType"])),this.d(a.track([s,"styleJson"],[e,"czmStyleJson"])),this.d(a.bind([s,"rotation"],[e,"rotation"])),this.d(a.track([s,"backFaceCulling"],[e,"czmBackFaceCulling"])),this.d(a.track([s,"debugShowBoundingVolume"],[e,"czmDebugShowBoundingVolume"])),this.d(a.track([s,"debugShowContentBoundingVolume"],[e,"czmDebugShowContentBoundingVolume"])),this.d(a.track([s,"skipLevelOfDetail"],[e,"czmSkipLevelOfDetail"])),this.ad(a.bind([s,"splitDirection"],[e,"splitDirection"])),this.ad(a.createEventsCallFunc(e.czmDebugWireframeChanged,()=>{s.enableDebugWireframe=e.czmDebugWireframe,s.debugWireframe=e.czmDebugWireframe},{immediate:!0}));{const c=u=>{e.czmEnvironmentMapManager=e.czmEnvironmentMapManager?{...e.czmEnvironmentMapManager,atmosphereScatteringIntensity:u}:{atmosphereScatteringIntensity:u}};c(e.czmAtmosphereScatteringIntensity),c(e.czmLuminanceAtZenith),this.ad(e.czmAtmosphereScatteringIntensityChanged.don(u=>c(u))),this.ad(e.czmLuminanceAtZenithChanged.don(u=>c(u)))}{const c=()=>{var u,d;(u=e.czmEnvironmentMapManager)!=null&&u.atmosphereScatteringIntensity&&(e.czmAtmosphereScatteringIntensity=e.czmLuminanceAtZenith=(d=e.czmEnvironmentMapManager)==null?void 0:d.atmosphereScatteringIntensity)};c(),this.ad(e.czmEnvironmentMapManagerChanged.don(c))}{const c=()=>{const u=e.materialMode??a.ES3DTileset.defaults.materialMode;Cy=e.materialParams.baseColor??[1,1,1],u==="normal"?s.customShaderInstanceClass=void 0:u==="technology"&&(s.customShaderInstanceClass=void 0,s.customShaderInstanceClass=aE)};this.d(e.materialModeChanged.don(u=>{c()})),this.d(e.materialParamsChanged.don(()=>{c()})),c()}}get czm3DTiles(){return this._czm3DTiles}get clippingPlanes(){return this._clippingPlanes}get flattenedPlane(){return this._flattenedPlane}get styleColor(){return this._styleColor.value}set styleColor(e){this._styleColor.value=e}get highlightStyleColor(){return this._highlightStyleColor.value}set highlightStyleColor(e){this._highlightStyleColor.value=e}get styleVisable(){return this._styleVisable.value}set styleVisable(e){this._styleVisable.value=e}highlightFeature(e,n){const o=n??"rgba(255,0,0,1)",l=["${id} === "+(typeof e=="string"?`'${e}'`:e),o];let c={};const u=this.styleColor?[l,...this.styleColor]:[l];this.styleVisable?c={show:{conditions:[...this.styleVisable]},color:{conditions:[...u]}}:c={color:{conditions:[...u]}},console.log("style",c),this._czm3DTiles.styleJson=c,this.highlightStyleColor=[...l]}setFeatureColor(e){const n=this.highlightStyleColor,o=this.styleColor?[...e,...this.styleColor]:[...e];let s={};this.styleVisable?n?s={show:{conditions:[...this.styleVisable]},color:{conditions:[...o,n]}}:s={show:{conditions:[...this.styleVisable]},color:{conditions:[...o]}}:n?s={color:{conditions:[...o,n]}}:s={color:{conditions:[...o]}},console.log("style",s),this._czm3DTiles.styleJson=s,this.styleColor=[...o]}setFeatureVisable(e){let n={};const o=this.highlightStyleColor,s=this.styleVisable?[...e,...this.styleVisable]:[...e];this.styleColor?o?n={show:{conditions:[...s]},color:{conditions:[o,...this.styleColor]}}:n={show:{conditions:[...s]},color:{conditions:[...this.styleColor]}}:o?n={show:{conditions:[...s]},color:{conditions:[o]}}:n={show:{conditions:[...s]}},console.log("style",n),this._czm3DTiles.styleJson=n,this.styleVisable=[...s]}resetFeatureStyle(){this.czm3DTiles.styleJson=void 0,this.styleColor=void 0,this.highlightStyleColor=void 0,this.styleVisable=void 0}flyTo(e,n){const{sceneObject:o,czmViewer:s,czm3DTiles:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e&&e*1e3),o.flyOverEvent.emit(n,"over",s),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czm3DTiles:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.flyTo(e&&e*1e3),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(Wi,"type",Wi.register("ESCesiumViewer",a.ES3DTileset.type,Wi)),m(Wi,"strokeFeaturePostProcess",new jA);let Rs=Wi;const Ea=class Ea extends me{constructor(e,n){super(e,n);m(this,"_czmModelPrimitive");if(!n.viewer){console.warn("viewer is undefined!");return}const s=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/warning/warning_b.glb"),r=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/warning/warning_a.glb");this._czmModelPrimitive=this.dv(new ct(this.czmViewer,this.sceneObject.id));const l=this._czmModelPrimitive;this.d(l.readyEvent.don(c=>{e.readyEvent.emit(c)})),this.ad(a.bind([l,"position"],[e,"position"])),this.ad(je([l,"rotation"],[e,"rotation"])),this.ad(a.track([l,"show"],[e,"show"])),l.activeAnimationsAnimateWhilePaused=!0,l.activeAnimationsJson=[{index:0,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration * 2"}];{const c=this.dv(a.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),u=()=>{e.allowPicking&&!e.editing?l.allowPicking=!0:l.allowPicking=!1};u(),this.d(c.don(u))}{const c=()=>{const u=e.mode;u==="circle"?l.url=s:(u==="cylinder"||u===void 0)&&(l.url=r)};c(),this.dispose(e.modeChanged.disposableOn(()=>{c()}))}{const c=()=>{const d=e.radius??a.ESAlarm.defaults.radius;l.scale=[d*e.scale[0],d*e.scale[1],d*e.scale[2]]};c();const u=this.dv(a.createNextAnimateFrameEvent(e.radiusChanged,e.scaleChanged));this.dispose(u.disposableOn(()=>{c()}))}}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmModelPrimitive:r}=this;return!s.actived||!s.viewer?!1:o.flyToParam||o.flyInParam?super.flyTo(e,n):(r&&Rt(s,o,n,e,r,!0),!0)}};m(Ea,"type",Ea.register("ESCesiumViewer",a.ESAlarm.type,Ea));let Ud=Ea;const dE={scan:`
575
575
  in vec2 v_st;
576
576
  uniform vec4 u_color;
577
577
  void main()
@@ -1992,7 +1992,7 @@ return material;
1992
1992
  material.alpha = fragColor.a;
1993
1993
 
1994
1994
  return material;
1995
- }`},translucent:!0});function TL(){Object.defineProperties(h.Billboard.prototype,{_positionFromParent:{get(){return!1},set(t){}}})}zF(),LF(),NF(),WF(),GF(),UF(),HF(),FF(),ez(),tz(),nz(),xz(),TL(),h.Camera.DEFAULT_VIEW_RECTANGLE=h.Rectangle.fromDegrees(70,5,140,55);function IL(){return new Promise((t,i)=>h.GroundPolylinePrimitive.initializeTerrainHeights().then(t))}class ML extends a.Destroyable{constructor(i,e,n,o){super();const s=()=>{e.setStatus("Raw");const{viewer:l}=e;if(l){const c=Ke(l);if(c&&(c.destroy(),Ig(l,void 0)),h.defined(l)){l.entities.removeAll(),l.dataSources.removeAll(),l.imageryLayers.removeAll(),l.scene.primitives.removeAll(),l.scene.groundPrimitives.removeAll(),l.scene.postProcessStages.removeAll();let u=l.scene.context._originalGLContext;u.canvas.width=u.canvas.height=1,u.getExtension("WEBGL_lose_context").loseContext(),u=null}l.destroy(),n(void 0)}};this.d(s);const r=this.dv(a.createProcessingFromAsyncFunc(async(l,c)=>{e.setStatus("Creating"),e.setStatusLog("正在创建Cesium视口...");const u=RF;await l.promise(IL());const d=await l.promise(a.createCancelablePromise(u(c,o)));d.scene._xbsjOriginSkyAtmosphere=d.scene.skyAtmosphere,d.scene._xbsjOriginSkyBox=d.scene.skyBox,d.scene.renderError.removeEventListener(d.cesiumWidget._onRenderError),d.clockViewModel.currentTime=h.JulianDate.fromDate(new Date(e.currentTime)),this.dispose(e.currentTimeChanged.disposableOn(()=>{if(e.currentTime===void 0)return;const p=h.JulianDate.fromDate(new Date(e.currentTime));h.JulianDate.equals(p,d.clockViewModel.currentTime)||(d.clockViewModel.currentTime=p)})),this.dispose(Ci(d.clockViewModel,"currentTime",p=>{const f=h.JulianDate.toDate(d.clockViewModel.currentTime).getTime();f!==e.currentTime&&(e.currentTime=f)}));{const p=new kC(d,e);Ig(d,p)}e.setStatus("Created"),e.setStatusLog("成功创建Cesium视口!"),n(d)}));r.start(i),r.errorEvent.don(l=>{console.error(l),e.setStatus("Error"),e.setStatusLog("创建Cesium视口失败!")})}}const DL=new h.EllipsoidTerrainProvider;class WC extends a.Destroyable{constructor(e){super();m(this,"_terrainMap",new Map);m(this,"_nextAnimateFrame",this.dv(a.createNextAnimateFrame()));m(this,"selectedTerrain");this._viewer=e;const n=this._viewer,o=n.scene.globe.terrainProviderChanged.addEventListener(()=>{this.selectedTerrain&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit())});this.ad(()=>{o&&o()}),this.dispose(this._changed.disposableOn(()=>{this.selectedTerrain=void 0;let s=Number.MIN_SAFE_INTEGER;for(let r of this._terrainMap.keys())r.sceneObject.activate=!1,(r.sceneObject.show??!0)&&r.sceneObject.zIndex>=s&&(this.selectedTerrain&&console.warn(`存在多个terrain,只能显示一个,当前terrian:${this.selectedTerrain.sceneObject.name}(${this.selectedTerrain.sceneObject.id}), 即将被替换成${r.sceneObject.name}(${r.sceneObject.id})`),s=r.sceneObject.zIndex,this.selectedTerrain=r);this.selectedTerrain&&!this.selectedTerrain.provider&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit()),n.scene.terrainProvider=(this.selectedTerrain&&this.selectedTerrain.provider)??DL}))}_makeDirty(){this._nextAnimateFrame.restartIfNotRunning()}get _changed(){return this._nextAnimateFrame.completeEvent}add(e){if(this._terrainMap.has(e)){console.warn("this._terrainMap.has(imagery)");return}const n=new a.Destroyable;n.dispose(e.providerChanged.disposableOn(()=>this._makeDirty())),n.dispose(e.sceneObject.showChanged.disposableOn(()=>this._makeDirty())),this._terrainMap.set(e,()=>n.destroy()),this._makeDirty();const o=this.ad(a.createNextAnimateFrameEvent(e.sceneObject.zIndexChanged));this.d(o.don(()=>{this._changed.emit()}))}delete(e){if(!this._terrainMap.has(e)){console.warn("!this._imageriesMap.has(imagery)");return}const n=this._terrainMap.get(e);if(!n){console.error("!disposeFunc");return}n(),this._terrainMap.delete(e),this.selectedTerrain===e&&(this.selectedTerrain=void 0),this._makeDirty()}}class GC extends a.Destroyable{constructor(e){super();m(this,"_labelMap",{div:new Map,canvas:new Map});this._viewer=e,this.d(e.scene.camera.changed.addEventListener(()=>{this._updateZOrder()}))}add(e){const n=e instanceof Ue?"div":"canvas";if(this._labelMap[n].has(e)){console.warn(`this._labelMap[${n}].has(poi)`,e);return}const o=new a.Destroyable;{const s=o.dv(a.createNextAnimateFrameEvent(e.zOrderChanged,e.positionChanged));o.dispose(s.don(()=>{this._updateZOrder()}))}this._labelMap[n].set(e,()=>o.destroy()),this._updateZOrder()}delete(e){const n=e instanceof Ue?"div":"canvas";if(!this._labelMap[n].has(e)){console.warn(`!this._labelMap[${n}].has(poi)`,e);return}const o=this._labelMap[n].get(e);if(!o){console.error("!disposeFunc");return}o(),this._labelMap[n].delete(e),this._updateZOrder()}_updateZOrder(){for(const e in this._labelMap)Object.prototype.hasOwnProperty.call(this._labelMap,e)&&this._updateLabelZOrder(this._labelMap[e],e)}_updateLabelZOrder(e,n){const o={};for(const l of e.keys())o[l.zOrder]||(o[l.zOrder]=new Map),o[l.zOrder].set(l,l instanceof Ue?l.czmDivPoi?l.czmDivPoi.depth:0:l.canvasObj?l.canvasObj.czmCanvasPoi.depth:0);const s=Object.keys(o).sort((l,c)=>n=="div"?Number(c)-Number(l):Number(l)-Number(c));let r=e.size;for(let l=0;l<s.length;l++)new Map([...o[s[l]]].sort((u,d)=>Number(d[1])-Number(u[1]))).forEach((u,d)=>{d instanceof Ue&&d.czmDivPoi&&(d.czmDivPoi.zOrder=r),d instanceof qi&&d.canvasObj&&(d.canvasObj.czmCanvasPoi.zOrder=r),r--})}}class RL extends a.Destroyable{constructor(e){super();m(this,"_czmImageryLayerWrappers",new Set);m(this,"_zIndexChangedEvent",this.dv(new a.Event));this._viewer=e,this.d(this._zIndexChangedEvent.don(()=>{const n=[...this.czmImageryLayerWrappers.values()];n.sort((o,s)=>{const r=o.czmImageryWrapper.imagery.zIndex??a.ESImageryLayer.defaults.zIndex,l=s.czmImageryWrapper.imagery.zIndex??a.ESImageryLayer.defaults.zIndex;return r-l});for(const o of n)this.viewer.imageryLayers.raiseToTop(o.imageryLayer)}))}get viewer(){return this._viewer}get czmImageryLayerWrappers(){return this._czmImageryLayerWrappers}add(e){this._czmImageryLayerWrappers.add(e),this.viewer.imageryLayers.add(e.imageryLayer),this.zIndexChange()}delete(e){this.viewer.imageryLayers.remove(e.imageryLayer,!1),this._czmImageryLayerWrappers.delete(e)}zIndexChange(){this._zIndexChangedEvent.emit()}}class FL extends a.Destroyable{constructor(e){super();m(this,"_imageryLayer");if(this._czmImageryWrapper=e,!this._czmImageryWrapper.imagery.layer)throw new Error("this._czmCzmImageryWrapper.imagery.czmImagery");this._imageryLayer=this._czmImageryWrapper.imagery.layer;const{czmImageryWrapper:n}=this,o=n.manager.czmImageriesManager;o.add(this),this.d(()=>o.delete(this)),this.d(this._czmImageryWrapper.imagery.zIndexChanged.don(()=>o.zIndexChange()))}get imageryLayer(){return this._imageryLayer}get czmImageryWrapper(){return this._czmImageryWrapper}}class zL extends a.Destroyable{constructor(e){super();m(this,"_objResetting");this._czmImageryWrapper=e,this._objResetting=this.dv(new a.ObjResettingWithEvent(this.czmImageryWrapper.imagery.showChanged,()=>{if(this.czmImageryWrapper.imagery.show??!0)return new FL(this.czmImageryWrapper)}))}get czmImageryWrapper(){return this._czmImageryWrapper}get objResetting(){return this._objResetting}}class LL extends a.Destroyable{constructor(e,n){super();m(this,"_czmImageryLayerWrapperObjResetting");this._imagery=e,this._manager=n,this._czmImageryLayerWrapperObjResetting=this.dv(new a.ObjResettingWithEvent(this.imagery.layerChanged,()=>{if(this.imagery.layer)return new zL(this)}))}get imagery(){return this._imagery}get manager(){return this._manager}get czmImageryLayerWrapperObjResetting(){return this._czmImageryLayerWrapperObjResetting}}class UC extends a.Destroyable{constructor(e){super();m(this,"_czmImageryWrappers",new Set);m(this,"_czmImageryLayersManager");this._viewer=e,this._czmImageryLayersManager=this.dv(new RL(this.viewer))}get czmImageryWrappers(){return this._czmImageryWrappers}get czmImageriesManager(){return this._czmImageryLayersManager}get viewer(){return this._viewer}add(e){for(let n of this.czmImageryWrappers)if(n.imagery===e){console.warn("imageriesManager add error: has already added!",e);return}this.czmImageryWrappers.add(new LL(e,this))}has(e){for(let n of this.czmImageryWrappers)if(n.imagery===e)return!0;return!1}delete(e){for(const n of this.czmImageryWrappers)if(n.imagery===e){this.czmImageryWrappers.delete(n);return}console.warn("imageriesManager delete error!",e)}}class HC extends a.Destroyable{constructor(e){super();m(this,"_pause",this.disposeVar(a.react(!1)));m(this,"_pickPositionTasks",[]);m(this,"_pickTasks",[]);m(this,"pickHeightMustGreaterThanZero",!0);m(this,"objectsToExclude",[]);const n=e.viewer;{this.dispose(()=>{this._pickPositionTasks.length>0&&(this._pickPositionTasks.forEach(l=>l[3]("CzmViewer销毁,任务不再执行!")),this._pickPositionTasks.length=0),this._pickTasks.length>0&&(this._pickTasks.forEach(l=>l[4]("CzmViewer销毁,任务不再执行!")),this._pickTasks.length=0)});const o=()=>{const l=[...this._pickPositionTasks];this._pickPositionTasks.length=0;for(let u of l){const[d,p,f,g]=u;try{(async()=>{const{scene:v,camera:y}=n,w=Pe(d),P=y.getPickRay(w);if(P){let E;if(p?E=await v.pickFromRayMostDetailed(P,this.objectsToExclude):E=v.pickFromRay(P,this.objectsToExclude),E&&E.position){const R=se(E.position);return R?f(R):g(new Error("positionFromCartesian failed"))}if(!(v.terrainProvider instanceof h.EllipsoidTerrainProvider)){const R=v.globe.pick(P,v);if(!R)return g(new Error("scene.globe.pick failed"));const N=se(R);return N?(this.pickHeightMustGreaterThanZero&&N[2]<0&&(N[2]=0),f(N)):g(new Error("positionFromCartesian failed"))}}const C=v.terrainProvider instanceof h.EllipsoidTerrainProvider?v.terrainProvider.tilingScheme.ellipsoid:n.scene.globe.ellipsoid,S=n.camera.pickEllipsoid(Pe(d),C);if(!S)return g(new Error("Pick failed"));const A=se(S);return A?f(A):g(new Error("positionFromCartesian failed"))})()}catch(v){g(v)}}const c=[...this._pickTasks];this._pickTasks.length=0;for(let u of c){const[d,p,f,g,v]=u;e.pickCustomAttachedInfo=f;try{(async()=>{var E,R,N,B;let y=n.scene.pick(Pe(d),p&&p[0],p&&p[1]);!y&&h.defined(n.scene.globe)&&(y=await NL(n,Pe(d)));let w;if(y&&y instanceof h.Cesium3DTileFeature){w={};try{y&&y.getPropertyIds().forEach(G=>{w&&(w[G]=y.getProperty(G))})}catch(V){console.warn(V)}}if(!y){const{left:V,top:G}=e.container.getBoundingClientRect();y=(E=document.elementFromPoint(d[0]+V,d[1]+G))==null?void 0:E.closest("[data-es-scene-object-id]")}let P;y&&(y.id&&y.id instanceof h.Entity&&y.id.ESSceneObjectID?P=y.id.ESSceneObjectID:y.primitive&&y.primitive.ESSceneObjectID?P=y.primitive.ESSceneObjectID:y.collection&&y.collection.ESSceneObjectID?P=y.collection.ESSceneObjectID:Array.isArray(y)&&y[0]instanceof h.ImageryLayerFeatureInfo?P=y[0].imageryLayer.ESSceneObjectID:y instanceof HTMLElement&&(P=y.dataset.esSceneObjectId));let C=P?a.ESSceneObject.getSceneObject(P):void 0;C&&C.parentID&&(C=a.ESSceneObject.getSceneObject(C.parentID));let S={};if(C&&Reflect.has(C,"allowPicking")&&Reflect.has(C,"pickedEvent")&&(C.allowPicking??!1)){if(C instanceof a.ESEntityCluster){const V=new h.JulianDate;S=y.id instanceof h.Entity?{name:y.id.label.text.getValue(V),properties:(R=y.id.properties)==null?void 0:R.getValue(V),coordinates:wr(y.id.position.getValue(V))}:(N=y.id)==null?void 0:N.map(G=>{var z;return{name:G.id,properties:(z=G.properties)==null?void 0:z.getValue(V),coordinates:wr(G.position.getValue(V))}})}else if(C instanceof a.ESGeoJson){const V=new h.JulianDate;let G,z,O;y.id.entityCollection?(G=y.id.polygon?"Polygon":y.id.polyline?"LineString":"Point",O=((B=y.id.properties)==null?void 0:B.getValue(V))??{},z=G=="Point"?se(y.id.position.getValue(V)):G=="LineString"?y.id.polyline.positions.getValue(V).map(_=>se(_)):yu(y.id.polygon.hierarchy.getValue(V))):(y.primitive instanceof h.Billboard||y.primitive instanceof h.Label)&&(G="Point",typeof y.id=="object"&&(O=y.id),z=se(y.primitive.position)),S=C.pickedInfoType=="FeatureCollection"||C.pickedInfoType=="Feature"?{type:"Feature",geometry:{type:G,coordinates:z},properties:O}:{type:G,coordinates:z,properties:O}}else if(C instanceof a.ESGltfModel){let V;Reflect.has(y,"featureId")?V=y.featureId:Reflect.has(y,"instanceId")&&(V=y.instanceId),V&&(y.id=y.primitive.structuralMetadata.getPropertyTable(0).getProperty(y.instanceId,"id"))}C.pickedEvent.emit(new a.ESJPickedResult(y,C,w,S,f,d))}C&&Reflect.has(C,"allowPicking")&&!C.allowPicking&&g(new a.ESJPickedResult);const A=new a.ESJPickedResult(y,C,w,S,f,d);g(A)})()}catch(y){v(y)}}};let s=n.scene.postRender.addEventListener(o);const r=()=>{s&&s(),s=void 0};this.ad(r),this.ad(this.pauseChanged.don(l=>{l?r():s=n.scene.postRender.addEventListener(o)}))}}get pause(){return this._pause.value}set pause(e){this._pause.value=e}get pauseChanged(){return this._pause.changed}pickPosition(e){return new Promise((n,o)=>{this._pickPositionTasks.push([e,!0,n,o])})}quickPickPosition(e){return new Promise((n,o)=>{this._pickPositionTasks.push([e,!1,n,o])})}pick(e,n,o){return new Promise((s,r)=>{this._pickTasks.push([e,n,o,s,r])})}}function NL(t,i){const e=t.scene,n=e.camera.getPickRay(i);if(!n)return;const o=e.imageryLayers.pickImageryLayerFeatures(n,e);if(h.defined(o))return o}class OL extends a.Destroyable{constructor(e){super();m(this,"_enabled",this.disposeVar(a.react(!1)));m(this,"_cursorPosition",a.react(void 0));m(this,"quickPickPosition",!0);let n=new a.Destroyable;const o=()=>{n&&(n.destroy(),n=void 0)};this.dispose(o);const s=()=>{if(o(),!this._enabled.value||!e)return;const r=Ke(e);if(!r)return;n=new a.Destroyable;const l=n.disposeVar(a.react(void 0)),c=n.disposeVar(a.createNextAnimateFrameEvent(l.changed));n.dispose(r.czmViewer.pointerMoveEvent.disposableOn(d=>{d.pointerEvent&&(l.value=a.getDomEventCurrentTargetPos(d.pointerEvent))}));const u=n.disposeVar(a.createProcessingFromAsyncFunc(async d=>{if(r.pickingManager&&l.value)if(this.quickPickPosition){const p=await d.promise(a.createCancelablePromise(r.pickingManager.quickPickPosition(l.value)));this._cursorPosition.value=p}else{const p=await d.promise(a.createCancelablePromise(r.pickingManager.pickPosition(l.value)));this._cursorPosition.value=p}}));n.dispose(c.disposableOn(()=>{u.restart()}))};s(),this.dispose(this._enabled.changed.disposableOn(s))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}class BL extends a.Destroyable{constructor(){super();m(this,"cache",new Map);m(this,"maxSize",300);m(this,"_deleteTileEvent",this.disposeVar(new a.Event))}get deleteTileEvent(){return this._deleteTileEvent}deleteTile(e,n){this._deleteTileEvent.emit(e,n)}has(e,n){const o=this.cache.get(e);return n?(o==null?void 0:o.has(n))??!1:!!o}get(e,n){const o=this.cache.get(e);if(!o)return;if(!n)return o;const s=o.get(n);return s&&(o.delete(n),o.set(n,s)),s}set(e,n,o){let s=this.get(e);if(s||(s=new Map,this.cache.set(e,s)),s.set(n,o),s.size>=this.maxSize){const r=s.keys().next().value;r&&this.remove(e,r)}}remove(e,n){const o=e instanceof xh?e.sceneObject.id:e;let s=this.get(o);s&&(n?(s.delete(n),s.size===0&&this.cache.delete(o)):this.cache.delete(o),this.deleteTile(o,n))}}class $C extends a.Destroyable{constructor(e){super();m(this,"x");m(this,"y");m(this,"z");m(this,"tileKey");m(this,"parent",null);m(this,"children",new Set);m(this,"data",new Map);m(this,"state",ar.UNLOADED);this.tileKey=e,[this.z,this.x,this.y]=e.split("-").map(Number)}fillParentAndChildren(e){var o;const n=`${this.z-1}-${Math.floor(this.x/2)}-${Math.floor(this.y/2)}`;this.parent=e.get(n)??null,(o=this.parent)==null||o.children.add(this)}}class VL extends a.Destroyable{constructor(e,n,o){super();m(this,"workers",[]);m(this,"queue",[]);m(this,"destroyed",!1);const s=navigator.hardwareConcurrency||4;let r;n?n>s?(console.warn(`创建线程超过CPU核心数,已限制为${s-1}`),r=s-1):r=n:r=Math.max(1,s-1);for(let l=0;l<r;l++)this.workers.push(new Worker(e,o));this.ad(()=>{this.destroyed=!0;for(const l of this.queue)l(null);this.queue.length=0;for(const l of this.workers)l.terminate();this.workers.length=0})}acquire(){return this.destroyed?Promise.reject("WorkerPool destroyed"):new Promise(e=>{this.workers.length>0?e(this.workers.pop()):this.queue.push(e)})}release(e){this.destroyed||(this.queue.length>0?this.queue.shift()(e):this.workers.push(e))}}function ln(t,i){if(typeof t=="string"){const e=[...t.matchAll(/\{([^}]+)\}/g)].map(n=>n[1]);return e.length===0?null:e.length===1?e[0]:e}if(t&&typeof t=="object"&&Array.isArray(t.stops)){let e=t.stops[0][1];for(const[n,o]of t.stops)i>=n&&(e=o);return ln(e,i)}if(Array.isArray(t))switch(t[0]){case"get":{const n=t[1];return typeof n=="string"?n:null}case"step":{let n=t[2];for(let o=3;o<t.length;o+=2){const s=t[o],r=t[o+1];i>=s&&(n=r)}return ln(n,i)}case"case":{for(let n=2;n<t.length;n+=2){if(n===t.length-1)return ln(t[n],i);const o=t[n],s=ln(o,i);if(s)return s}return null}case"match":{const n=new Set;for(let o=3;o<t.length;o+=2){const s=t[o],r=ln(s,i);r&&(Array.isArray(r)?r.forEach(l=>n.add(l)):n.add(r))}return n.size?[...n]:null}case"concat":{const n=new Set;for(let o=1;o<t.length;o++){const s=ln(t[o],i);s&&(Array.isArray(s)?s.forEach(r=>n.add(r)):n.add(s))}return n.size?[...n]:null}case"format":{const n=new Set;for(let o=1;o<t.length;o+=2){const s=ln(t[o],i);s&&(Array.isArray(s)?s.forEach(r=>n.add(r)):n.add(s))}return n.size?[...n]:null}}return null}function WL(t){const i=new Map;for(const e in t){const n=t[e],o=new Set,s=n.points,r=n.pointProps;for(let g=0;g<s.length;g+=3){const v=g/3;o.add({type:"Feature",geometry:{type:"Point",coordinates:[s[g],s[g+1]]},properties:r[v]||{}})}const l=n.lines,c=n.lineOffsets,u=n.lineProps;for(let g=0;g<c.length;g++){const v=c[g]*3,y=g+1<c.length?c[g+1]*3:l.length,w=[];for(let P=v;P<y;P+=3)w.push([l[P],l[P+1]]);o.add({type:"Feature",geometry:{type:"LineString",coordinates:w},properties:u[g]||{}})}const d=n.polygons,p=n.polygonOffsets,f=n.polygonProps;for(let g=0;g<p.length;g++){const v=p[g]*3,y=g+1<p.length?p[g+1]*3:d.length,w=[];for(let P=v;P<y;P+=3)w.push([d[P],d[P+1]]);o.add({type:"Feature",geometry:{type:"Polygon",coordinates:[w]},properties:f[g]||{}})}i.set(e,o)}return i}class GL extends a.Destroyable{constructor(e){super();m(this,"pendingRequests",new Map);m(this,"sourcesMap",new Map);m(this,"workerPool");m(this,"tileSchemes",new Map);this.tilesCache=e,this.workerPool=new VL(new URL("data:video/mp2t;base64,Ly8vIDxyZWZlcmVuY2UgbGliPSJXZWJXb3JrZXIiIC8+DQppbXBvcnQgUGJmIGZyb20gInBiZiI7DQppbXBvcnQgeyBWZWN0b3JUaWxlIH0gZnJvbSAiQG1hcGJveC92ZWN0b3ItdGlsZSI7DQoNCnNlbGYub25tZXNzYWdlID0gYXN5bmMgKGUpID0+IHsNCiAgICBjb25zdCB7IHR5cGUsIHVybCwgeCwgeSwgeiB9ID0gZS5kYXRhOw0KICAgIGlmICh0eXBlICE9PSAiZmV0Y2giKSByZXR1cm47DQoNCiAgICB0cnkgew0KICAgICAgICBjb25zdCBidWZmZXIgPSBhd2FpdCAoYXdhaXQgZmV0Y2godXJsKSkuYXJyYXlCdWZmZXIoKTsNCiAgICAgICAgY29uc3QgdGlsZSA9IG5ldyBWZWN0b3JUaWxlKG5ldyBQYmYoYnVmZmVyKSk7DQoNCiAgICAgICAgY29uc3QgdGlsZURhdGE6IFJlY29yZDxzdHJpbmcsIGFueT4gPSB7fTsNCg0KICAgICAgICBmb3IgKGNvbnN0IGxheWVyTmFtZSBpbiB0aWxlLmxheWVycykgew0KICAgICAgICAgICAgY29uc3QgbGF5ZXIgPSB0aWxlLmxheWVyc1tsYXllck5hbWVdOw0KICAgICAgICAgICAgY29uc3QgZXh0ZW50ID0gbGF5ZXIuZXh0ZW50IHx8IDQwOTY7DQoNCiAgICAgICAgICAgIGNvbnN0IHBvaW50czogbnVtYmVyW10gPSBbXTsNCiAgICAgICAgICAgIGNvbnN0IHBvaW50UHJvcHM6IGFueVtdID0gW107DQoNCiAgICAgICAgICAgIGNvbnN0IGxpbmVzOiBudW1iZXJbXSA9IFtdOw0KICAgICAgICAgICAgY29uc3QgbGluZU9mZnNldHM6IG51bWJlcltdID0gW107DQogICAgICAgICAgICBjb25zdCBsaW5lUHJvcHM6IGFueVtdID0gW107DQoNCiAgICAgICAgICAgIGNvbnN0IHBvbHlnb25zOiBudW1iZXJbXSA9IFtdOw0KICAgICAgICAgICAgY29uc3QgcG9seWdvbk9mZnNldHM6IG51bWJlcltdID0gW107DQogICAgICAgICAgICBjb25zdCBwb2x5Z29uUHJvcHM6IGFueVtdID0gW107DQoNCiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbGF5ZXIubGVuZ3RoOyBpKyspIHsNCiAgICAgICAgICAgICAgICBjb25zdCBmID0gbGF5ZXIuZmVhdHVyZShpKTsNCiAgICAgICAgICAgICAgICBjb25zdCBnZW9tID0gZi5sb2FkR2VvbWV0cnkoKTsNCiAgICAgICAgICAgICAgICBjb25zdCB0ID0gZi50eXBlOw0KICAgICAgICAgICAgICAgIGNvbnN0IHByb3BlcnRpZXMgPSBmLnByb3BlcnRpZXMgfHwge307DQoNCiAgICAgICAgICAgICAgICBpZiAodCA9PT0gMSkgeyAvLyBQb2ludA0KICAgICAgICAgICAgICAgICAgICBsZXQgc3ggPSAwLCBzeSA9IDAsIGNudCA9IDA7DQogICAgICAgICAgICAgICAgICAgIGZvciAoY29uc3QgcmluZyBvZiBnZW9tKQ0KICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChjb25zdCBwIG9mIHJpbmcpIHsgc3ggKz0gcC54OyBzeSArPSBwLnk7IGNudCsrOyB9DQogICAgICAgICAgICAgICAgICAgIGlmIChjbnQgPT09IDApIGNvbnRpbnVlOw0KICAgICAgICAgICAgICAgICAgICBjb25zdCB7IGxvbiwgbGF0IH0gPSB0aWxlUGl4ZWxUb0xvbkxhdChzeCAvIGNudCwgc3kgLyBjbnQsIGV4dGVudCwgeCwgeSwgeik7DQogICAgICAgICAgICAgICAgICAgIHBvaW50cy5wdXNoKGxvbiwgbGF0LCAwKTsNCiAgICAgICAgICAgICAgICAgICAgcG9pbnRQcm9wcy5wdXNoKHByb3BlcnRpZXMpOw0KDQogICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0ID09PSAyKSB7IC8vIExpbmUNCiAgICAgICAgICAgICAgICAgICAgbGluZU9mZnNldHMucHVzaChsaW5lcy5sZW5ndGggLyAzKTsNCiAgICAgICAgICAgICAgICAgICAgZm9yIChjb25zdCByaW5nIG9mIGdlb20pDQogICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGNvbnN0IHAgb2YgcmluZykgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHsgbG9uLCBsYXQgfSA9IHRpbGVQaXhlbFRvTG9uTGF0KHAueCwgcC55LCBleHRlbnQsIHgsIHksIHopOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVzLnB1c2gobG9uLCBsYXQsIDApOw0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICBsaW5lUHJvcHMucHVzaChwcm9wZXJ0aWVzKTsNCg0KICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodCA9PT0gMykgeyAvLyBQb2x5Z29uDQogICAgICAgICAgICAgICAgICAgIHBvbHlnb25PZmZzZXRzLnB1c2gocG9seWdvbnMubGVuZ3RoIC8gMyk7DQogICAgICAgICAgICAgICAgICAgIGZvciAoY29uc3QgcmluZyBvZiBnZW9tKQ0KICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChjb25zdCBwIG9mIHJpbmcpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB7IGxvbiwgbGF0IH0gPSB0aWxlUGl4ZWxUb0xvbkxhdChwLngsIHAueSwgZXh0ZW50LCB4LCB5LCB6KTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb2x5Z29ucy5wdXNoKGxvbiwgbGF0LCAwKTsNCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgcG9seWdvblByb3BzLnB1c2gocHJvcGVydGllcyk7DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICB0aWxlRGF0YVtsYXllck5hbWVdID0gew0KICAgICAgICAgICAgICAgIHBvaW50czogbmV3IEZsb2F0MzJBcnJheShwb2ludHMpLA0KICAgICAgICAgICAgICAgIHBvaW50UHJvcHMsDQogICAgICAgICAgICAgICAgbGluZXM6IG5ldyBGbG9hdDMyQXJyYXkobGluZXMpLA0KICAgICAgICAgICAgICAgIGxpbmVPZmZzZXRzOiBuZXcgVWludDMyQXJyYXkobGluZU9mZnNldHMpLA0KICAgICAgICAgICAgICAgIGxpbmVQcm9wcywNCiAgICAgICAgICAgICAgICBwb2x5Z29uczogbmV3IEZsb2F0MzJBcnJheShwb2x5Z29ucyksDQogICAgICAgICAgICAgICAgcG9seWdvbk9mZnNldHM6IG5ldyBVaW50MzJBcnJheShwb2x5Z29uT2Zmc2V0cyksDQogICAgICAgICAgICAgICAgcG9seWdvblByb3BzDQogICAgICAgICAgICB9Ow0KICAgICAgICB9DQoNCiAgICAgICAgLy8g5pS26ZuGIGJ1ZmZlciB0cmFuc2ZlcmFibGUNCiAgICAgICAgY29uc3QgdHJhbnNmZXJzOiBBcnJheUJ1ZmZlcltdID0gW107DQogICAgICAgIGZvciAoY29uc3QgbGF5ZXJOYW1lIGluIHRpbGVEYXRhKSB7DQogICAgICAgICAgICBjb25zdCBsYXllciA9IHRpbGVEYXRhW2xheWVyTmFtZV07DQogICAgICAgICAgICB0cmFuc2ZlcnMucHVzaChsYXllci5wb2ludHMuYnVmZmVyLCBsYXllci5saW5lcy5idWZmZXIsIGxheWVyLmxpbmVPZmZzZXRzLmJ1ZmZlciwNCiAgICAgICAgICAgICAgICBsYXllci5wb2x5Z29ucy5idWZmZXIsIGxheWVyLnBvbHlnb25PZmZzZXRzLmJ1ZmZlcik7DQogICAgICAgIH0NCg0KICAgICAgICBzZWxmLnBvc3RNZXNzYWdlKHsgdXJsLCB0aWxlRGF0YSB9LCB0cmFuc2ZlcnMpOw0KDQogICAgfSBjYXRjaCAoZXJyKSB7DQogICAgICAgIHNlbGYucG9zdE1lc3NhZ2UoeyB1cmwsIGVycm9yOiAoZXJyIGFzIEVycm9yKS5tZXNzYWdlIH0pOw0KICAgIH0NCn07DQovLyAtLS0tLS0tLS0tLS0tLS0tLS0g5Yeg5L2V5LyY5YyWIC0tLS0tLS0tLS0tLS0tLS0tLQ0KDQpmdW5jdGlvbiBzaW1wbGlmeVJpbmcocmluZzogYW55W10pIHsNCiAgICBjb25zdCBvdXQ6IGFueSA9IFtdOw0KICAgIGNvbnN0IG4gPSByaW5nLmxlbmd0aDsNCiAgICBpZiAobiA8PSAyKSByZXR1cm4gcmluZzsNCg0KICAgIG91dC5wdXNoKHJpbmdbMF0pOw0KDQogICAgZm9yIChsZXQgaSA9IDE7IGkgPCBuIC0gMTsgaSsrKSB7DQogICAgICAgIGNvbnN0IEEgPSBvdXRbb3V0Lmxlbmd0aCAtIDFdOw0KICAgICAgICBjb25zdCBCID0gcmluZ1tpXTsNCiAgICAgICAgY29uc3QgQyA9IHJpbmdbaSArIDFdOw0KDQogICAgICAgIGlmIChBLnggPT09IEIueCAmJiBBLnkgPT09IEIueSkgY29udGludWU7DQogICAgICAgIGlmIChpc0NvbGluZWFyKEEueCwgQS55LCBCLngsIEIueSwgQy54LCBDLnkpKSBjb250aW51ZTsNCg0KICAgICAgICBvdXQucHVzaChCKTsNCiAgICB9DQoNCiAgICBvdXQucHVzaChyaW5nW24gLSAxXSk7DQogICAgcmV0dXJuIG91dDsNCn0NCg0KZnVuY3Rpb24gY2xlYW5Qb2x5Z29uKHJpbmdzOiBhbnlbXSkgew0KICAgIHJldHVybiByaW5ncy5tYXAocmluZyA9PiB7DQogICAgICAgIGlmIChyaW5nLmxlbmd0aCA+IDIpIHsNCiAgICAgICAgICAgIGNvbnN0IEEgPSByaW5nWzBdOw0KICAgICAgICAgICAgY29uc3QgQiA9IHJpbmdbcmluZy5sZW5ndGggLSAxXTsNCiAgICAgICAgICAgIGlmIChBLnggPT09IEIueCAmJiBBLnkgPT09IEIueSkgcmluZyA9IHJpbmcuc2xpY2UoMCwgLTEpOw0KICAgICAgICB9DQogICAgICAgIHJldHVybiBzaW1wbGlmeVJpbmcocmluZyk7DQogICAgfSk7DQp9DQoNCmZ1bmN0aW9uIGlzQ29saW5lYXIoYXgsIGF5LCBieCwgYnksIGN4LCBjeSkgew0KICAgIHJldHVybiAoYnggLSBheCkgKiAoY3kgLSBieSkgPT09IChieSAtIGF5KSAqIChjeCAtIGJ4KTsNCn0NCg0KLy8gLS0tLS0tLS0tLS0tLS0tLS0tIOe7j+e6rOW6pui9rOaNoiAtLS0tLS0tLS0tLS0tLS0tLS0NCg0KZnVuY3Rpb24gY29udmVydFRvTG9uTGF0KGdlb20sIHQsIGV4dGVudCwgeCwgeSwgeikgew0KICAgIGlmICh0ID09PSAxKSB7DQogICAgICAgIGxldCBzeCA9IDAsIHN5ID0gMCwgY250ID0gMDsNCiAgICAgICAgZm9yIChjb25zdCByaW5nIG9mIGdlb20pDQogICAgICAgICAgICBmb3IgKGNvbnN0IHAgb2YgcmluZykgeyBzeCArPSBwLng7IHN5ICs9IHAueTsgY250Kys7IH0NCiAgICAgICAgY29uc3QgbGwgPSB0aWxlUGl4ZWxUb0xvbkxhdChzeCAvIGNudCwgc3kgLyBjbnQsIGV4dGVudCwgeCwgeSwgeik7DQogICAgICAgIHJldHVybiBbbGwubG9uLCBsbC5sYXRdOw0KICAgIH0NCg0KICAgIGlmICh0ID09PSAyKSB7DQogICAgICAgIGNvbnN0IGFycjogYW55W10gPSBbXTsNCiAgICAgICAgZm9yIChjb25zdCByaW5nIG9mIGdlb20pDQogICAgICAgICAgICBmb3IgKGNvbnN0IHAgb2YgcmluZykgew0KICAgICAgICAgICAgICAgIGNvbnN0IGxsID0gdGlsZVBpeGVsVG9Mb25MYXQocC54LCBwLnksIGV4dGVudCwgeCwgeSwgeik7DQogICAgICAgICAgICAgICAgYXJyLnB1c2goW2xsLmxvbiwgbGwubGF0XSk7DQogICAgICAgICAgICB9DQogICAgICAgIHJldHVybiBhcnI7DQogICAgfQ0KDQogICAgaWYgKHQgPT09IDMpIHsNCiAgICAgICAgcmV0dXJuIGdlb20ubWFwKHJpbmcgPT4NCiAgICAgICAgICAgIHJpbmcubWFwKHAgPT4gew0KICAgICAgICAgICAgICAgIGNvbnN0IGxsID0gdGlsZVBpeGVsVG9Mb25MYXQocC54LCBwLnksIGV4dGVudCwgeCwgeSwgeik7DQogICAgICAgICAgICAgICAgcmV0dXJuIFtsbC5sb24sIGxsLmxhdF07DQogICAgICAgICAgICB9KQ0KICAgICAgICApOw0KICAgIH0NCn0NCg0KZnVuY3Rpb24gdGlsZVBpeGVsVG9Mb25MYXQocHgsIHB5LCBleHRlbnQsIHRpbGVYLCB0aWxlWSwgeikgew0KICAgIGNvbnN0IG4gPSBNYXRoLnBvdygyLCB6KTsNCiAgICBjb25zdCB4Tm9ybSA9ICh0aWxlWCArIHB4IC8gZXh0ZW50KSAvIG47DQogICAgY29uc3QgeU5vcm0gPSAodGlsZVkgKyBweSAvIGV4dGVudCkgLyBuOw0KICAgIGNvbnN0IGxvbiA9IHhOb3JtICogMzYwIC0gMTgwOw0KICAgIGNvbnN0IGxhdCA9IE1hdGguYXRhbihNYXRoLnNpbmgoTWF0aC5QSSAqICgxIC0gMiAqIHlOb3JtKSkpICogMTgwIC8gTWF0aC5QSTsNCiAgICByZXR1cm4geyBsb24sIGxhdCB9Ow0KfQ==",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Gi&&Gi.tagName.toUpperCase()==="SCRIPT"&&Gi.src||new URL("earthsdk3-cesium.umd.cjs",document.baseURI).href),10,{type:"module"})}add(e){const n=e.sceneObject.id,o=e.mvtLayerJson.mainJson,s=e.sceneObject.scheme??"xyz";let r=this.sourcesMap.get(n),l=this.tileSchemes.get(n);if(r||(r=new Map,this.sourcesMap.set(n,r)),(!l||s!=l)&&this.tileSchemes.set(n,s),typeof o=="string")r.set("customSource",{tiles:[o],type:"vector"});else if(typeof o=="object"){const c=o.sources;for(const u in c){const d=c[u];d.type==="vector"&&Reflect.has(d,"tiles")&&r.set(u,d)}}}remove(e){const n=e.sceneObject.id;this.sourcesMap.delete(n),this.tileSchemes.delete(n),this.pendingRequests.delete(n)}async fetchTile(e,n){return new Promise(async o=>{var g,v,y,w;if((g=this.pendingRequests.get(e))!=null&&g.has(n))return o(void 0);(v=this.pendingRequests.get(e))==null||v.add(n);const[s,r,l]=n.split("-").map(Number),u=this.tileSchemes.get(e)==="tms"?Math.pow(2,s)-l-1:l,d=this.tilesCache.get(e,n)??new $C(n),p=this.sourcesMap.get(e);if(!p)return d.state=ar.FAILED,o(d);const f=Array.from(p.keys()).pop();for(const[P,C]of p.entries()){d.state=ar.LOADING;const S=Array.isArray(C.tiles)?C.tiles:[C.tiles];for(const A of S){if(d.state=ar.PROCESSING,!A.includes("{z}")||C.maxzoom&&s>C.maxzoom||C.minzoom&&s<C.minzoom)continue;const E=A.replace("{z}",s.toString()).replace("{x}",r.toString()).replace("{y}",u.toString());try{const R=await this.fetchUrl(E,r,l,s);if(d.data.set(P,R),P===f)return(y=this.pendingRequests.get(e))==null||y.delete(n),((w=this.pendingRequests.get(e))==null?void 0:w.size)===0&&this.pendingRequests.delete(e),d.state=ar.READY,o(d)}catch(R){console.error(`Failed to load tile ${n}:`,R)}}}})}fetchUrl(e,n,o,s){return new TextDecoder,new Promise((r,l)=>{this.workerPool.acquire().then(c=>{const u=d=>{const p=d.data;if(p.url!==e)return;if(c.removeEventListener("message",u),this.workerPool.release(c),p.error)return l(new Error(p.error));const f=WL(p.tileData);r(f)};c.addEventListener("message",u),c.postMessage({type:"fetch",url:e,x:n,y:o,z:s})})})}}class UL extends a.Destroyable{constructor(e,n){super();m(this,"renderedTiles",new Map);this.screenManager=e,this.styleManager=n}renderTile(e,n){var l;const o=new Set,s=this.styleManager.getStyle(e);if(!s)return;for(const c of s){const u=Number.parseInt(n.tileKey.split("-")[0]);if(!((c.maxzoom||c.minzoom)&&(c.maxzoom&&u>c.maxzoom||c.minzoom&&u<c.minzoom)))for(const d of((l=n.data.get(c.source))==null?void 0:l.get(c["source-layer"]??""))||[]){let p=d.geometry.coordinates;d.geometry.type.includes("Point")||(p=WI(d.geometry).geometry.coordinates);let f,g;if(c.labelStyle){const v=ln(c.labelStyle.text,u);f=this.screenManager.addLabel(e,"VectorTile",c.labelStyle,{position:p,name:typeof v=="string"?d.properties[v]:Array.isArray(v)?v.map(w=>d.properties[w]).join(""):"",index:c.id+d.properties.osm_id}).screenObjectId}if(c.billboardStyle){const v=ln(c.billboardStyle.text,u);g=this.screenManager.addImage(e,"VectorTile",c.billboardStyle,{position:p,name:typeof v=="string"?d.properties[v]:Array.isArray(v)?v.map(w=>d.properties[w]).join(""):"",index:c.id+d.properties.osm_id}).screenObjectId}f&&!o.has(f)&&o.add(f),g&&!o.has(g)&&o.add(g)}}let r=this.renderedTiles.get(e);r||(r=new Map,this.renderedTiles.set(e,r)),r.set(n.tileKey,o)}update(e,n,o){var s;if(typeof n=="string"){const r=(s=this.renderedTiles.get(e))==null?void 0:s.get(n);r&&this.screenManager.update("VectorTile",e,r,{all:{show:o}})}else this.screenManager.update("VectorTile",e,n,{all:{show:o}})}remove(e,n){const o=this.renderedTiles.get(e);if(n){const s=o==null?void 0:o.get(n);s&&(this.screenManager.remove("VectorTile",e,s),o==null||o.delete(n),(o==null?void 0:o.size)===0&&this.renderedTiles.delete(e))}else{const s=o==null?void 0:o.values();if(s){const r=new Set([...s].flatMap(l=>[...l]));this.screenManager.remove("VectorTile",e,r,!0),this.renderedTiles.delete(e)}}}removeAll(){const e=this.renderedTiles.keys();for(const n of e)this.remove(n)}}const HL=new h.Cartesian2;class $L extends a.Destroyable{constructor(){super();m(this,"defaultStyle",new Map);m(this,"defaultSprite",new Map)}async add(e){var o;if(typeof e.mvtLayerJson.mainJson!="string"&&((o=e.mvtLayerJson.mainJson)!=null&&o.sprite)){const s=e.mvtLayerJson.mainJson.sprite;let r=await h.Resource.fetchJson({url:s+".json"});r=await qL(s+".png",r),r&&this.defaultSprite.set(e.sceneObject.id,[s+".png",r])}const n=e.mvtLayerJson.pointJson;for(const s of n)this.setDefaultStyle(e.sceneObject.id,this.getStyleFromMVTLayers(e.sceneObject.id,s))}remove(e){this.defaultStyle.delete(e.sceneObject.id)}setDefaultStyle(e,n){let o=this.defaultStyle.get(e);o||(o=new Set,this.defaultStyle.set(e,o)),o.add(n)}getStyle(e){return this.defaultStyle.get(e)??new Set}getStyleFromMVTLayers(e,n){const o={id:n.id,type:n.type,source:n.source,"source-layer":n["source-layer"],labelStyle:void 0,billboardStyle:void 0,polygonStyle:void 0,polylineStyle:void 0};if(Reflect.has(n,"minzoom")&&(o.minzoom=n.minzoom),Reflect.has(n,"maxzoom")&&(o.maxzoom=n.maxzoom),Reflect.has(n,"type")&&n.type==="symbol"&&Reflect.has(n,"layout")){const s=n.layout;if(Reflect.has(s,"icon-image")){const r=o.billboardStyle={},l=this.defaultSprite.get(e);l&&l[1][s["icon-image"]]?(r.image=l[0],r.imageSubRegion=new h.BoundingRectangle(l[1][s["icon-image"]].x,l[1][s["icon-image"]].y,l[1][s["icon-image"]].width,l[1][s["icon-image"]].height)):r.image=s["icon-image"];const{horizontalOrigin:c,verticalOrigin:u}=qC(s["icon-anchor"]??"center");if(r.horizontalOrigin=c,r.verticalOrigin=u,Reflect.has(n,"paint")){const d=n.paint;r.color=h.Color.fromCssColorString(d["icon-color"]??"#000000").withAlpha(d["icon-opacity"]??1)}r.rotation=h.Math.toRadians(s["icon-rotate"]??0),r.scale=s["icon-size"]??1,r.pixelOffset=h.Cartesian2.multiplyByScalar(h.Cartesian2.fromArray(s["icon-offset"]??[0,0]),r.scale,HL),r.show=(s.visibility??"visible")==="visible"}if(Reflect.has(s,"text-field")){const r=o.labelStyle={};r.text=s["text-field"];const{horizontalOrigin:l,verticalOrigin:c}=qC(s["text-anchor"]??"center");if(r.horizontalOrigin=l,r.verticalOrigin=c,Reflect.has(n,"paint")){const d=n.paint;r.fillColor=h.Color.fromCssColorString(d["text-color"]??"#000000").withAlpha(d["text-opacity"]??1),d["text-halo-color"]&&(r.outlineColor=h.Color.fromCssColorString(d["text-halo-color"])),d["text-halo-width"]&&(r.outlineWidth=d["text-halo-width"]),(d["text-halo-color"]||d["text-halo-width"])&&(r.style=h.LabelStyle.FILL_AND_OUTLINE)}const u=s["text-font"]?typeof s["text-font"]=="string"?[s["text-font"]]:s["text-font"]:["Open Sans Regular","Arial Unicode MS Regular"];r.font=`${s["text-size"]??16}px `+u.map(d=>`"${d}"`).join(", "),r.pixelOffset=XL(s),r.show=(s.visibility??"visible")==="visible"}}return o}}function qC(t){let i=h.HorizontalOrigin.CENTER,e=h.VerticalOrigin.CENTER;switch(t){case"center":break;case"left":i=h.HorizontalOrigin.LEFT;break;case"right":i=h.HorizontalOrigin.RIGHT;break;case"top":e=h.VerticalOrigin.TOP;break;case"bottom":e=h.VerticalOrigin.BOTTOM;break;case"top-left":i=h.HorizontalOrigin.LEFT,e=h.VerticalOrigin.TOP;break;case"top-right":i=h.HorizontalOrigin.RIGHT,e=h.VerticalOrigin.TOP;break;case"bottom-left":i=h.HorizontalOrigin.LEFT,e=h.VerticalOrigin.BOTTOM;break;case"bottom-right":i=h.HorizontalOrigin.RIGHT,e=h.VerticalOrigin.BOTTOM;break}return{horizontalOrigin:i,verticalOrigin:e}}async function qL(t,i){const{width:e,height:n}=await Pn(t,!1),o={};for(const s in i)if(Object.prototype.hasOwnProperty.call(i,s)){const r=i[s];o[s]={width:r.width,height:r.height,x:r.x,y:n-r.y-r.height,pixelRatio:r.pixelRatio}}return o}function XL(t){const i=t["text-offset"]||[0,0],e=t["text-size"]||16;return new h.Cartesian2(i[0]*e,i[1]*e)}class YL extends a.Destroyable{constructor(){super();m(this,"callbacks",new Map)}registerEvent(e,n,o){var r;const s=`${e}-${n}`;this.callbacks.has(s)||this.callbacks.set(s,new Set),(r=this.callbacks.get(s))==null||r.add(o)}dispatchEvent(e){var o;const n=`${e.tileKey}-${e.type}`;(o=this.callbacks.get(n))==null||o.forEach(s=>s(e.data))}}var ar=(t=>(t[t.UNLOADED=0]="UNLOADED",t[t.LOADING=1]="LOADING",t[t.PROCESSING=2]="PROCESSING",t[t.READY=3]="READY",t[t.EXPIRED=4]="EXPIRED",t[t.FAILED=5]="FAILED",t))(ar||{});class ZL extends a.Destroyable{constructor(e){super();m(this,"czmESMVTLayers",new Map);m(this,"tilesCache",new BL);m(this,"tileLoader",new GL(this.tilesCache));m(this,"tileRenderer");m(this,"styleManager",new $L);m(this,"eventManager",new YL);m(this,"lastImageryTileMap",new Map);this.viewer=e;const n=Ke(e);n&&(this.tileRenderer=new UL(n.screenManager,this.styleManager)),this.ad(this.tilesCache.deleteTileEvent.don((r,l)=>{this.tileRenderer.remove(r,l)}));let o=performance.now();const s=e.scene.preUpdate.addEventListener(()=>{const r=performance.now();r-o>60&&(o=r,this.czmESMVTLayers.size>0&&this.refreshVisibleTiles())});this.ad(()=>s&&s())}async add(e){if(this.czmESMVTLayers.has(e.sceneObject.id)){console.log(`ESMVTLayer${e.sceneObject.id}已经添加过,跳过本次添加`);return}this.czmESMVTLayers.set(e.sceneObject.id,e),this.tileLoader.add(e),await this.styleManager.add(e),this.refreshVisibleTiles(!0)}remove(e){this.czmESMVTLayers.delete(e.sceneObject.id),this.tileLoader.remove(e),this.styleManager.remove(e),this.tilesCache.remove(e)}refreshVisibleTiles(e){const n=this.viewer;if(!n)return;const o=new Map;for(const[s,r]of this.czmESMVTLayers.entries()){if(!r)continue;const l={tilingScheme:{type:"WebMercatorTilingScheme"},rectangle:r.sceneObject.rectangle,tileHeight:r.sceneObject.tileSize,tileWidth:r.sceneObject.tileSize,maximumLevel:r.sceneObject.maximumLevel,minimumLevel:r.sceneObject.minimumLevel},c=new Set;wm(n.scene.globe._surface._tilesToRender,n.scene.terrainProvider,l).forEach(u=>c.add(`${u.level}-${u.x}-${u.y}`)),!o.has(s)&&o.set(s,c)}this.updateTiles(o,e)}updateTiles(e,n){var o,s;for(const r of this.czmESMVTLayers.keys()){const l=e.get(r)??new Set,c=this.lastImageryTileMap.get(r);if(c&&QL(l,c)&&!n)continue;this.lastImageryTileMap.set(r,l);const u=new Set(((o=this.tilesCache.get(r))==null?void 0:o.keys())??[]),d=new Set,p=new Set;for(const f of u){const g=(s=this.tileRenderer.renderedTiles.get(r))==null?void 0:s.get(f);if(!(!g||g.size==0))if(l.has(f))for(const v of g)d.add(v);else for(const v of g)p.add(v)}for(const f of d)p.delete(f);this.tileRenderer.update(r,p,!1),this.tileRenderer.update(r,d,!0);for(const f of l)u.has(f)||(this.tilesCache.set(r,f,new $C(f)),this.tileLoader.fetchTile(r,f).then(g=>{!g||!this.tilesCache.has(r,f)||(this.tilesCache.set(r,f,g),g.fillParentAndChildren(this.tilesCache.get(r)??new Map),this.tileRenderer.renderTile(r,g))}))}}}function QL(t,i){if(t.size!==i.size)return!1;for(const e of t)if(!i.has(e))return!1;return!0}new h.WebMercatorTilingScheme;const XC=["label","billboard","rectangle"];class kL extends a.Destroyable{constructor(e,n){super();m(this,"id",a.createGuid());m(this,"position",h.Cartesian3.ZERO);m(this,"label");m(this,"billboard");m(this,"rectangle");m(this,"zOrder");m(this,"labelRefCount",1);m(this,"billboardRefCount",1);m(this,"rectangleRefCount",1);m(this,"_showEvent",this.disposeVar(new a.Event));this.id=e,this.position=n,this.ad(this.showEvent.don(o=>{this.updateShow(o)}))}get showEvent(){return this._showEvent}show(e){this._showEvent.emit(e)}updateShow(e){this.label&&(this.label.show=e),this.billboard&&(this.billboard.show=e)}}class KL extends a.Destroyable{constructor(e){super();m(this,"objects",new Map);m(this,"screenManager");m(this,"czmViewer");m(this,"viewer");this.screenManager=e,this.czmViewer=e.czmViewer,this.viewer=e.viewer,this.ad(()=>{this.objects.clear()})}layerIsEffective(){return this.objects.size>0}addLabel(e,n,o){const s=this.makeScreenObjectId(e,o.index??a.createGuid()),r=Se(o.position),l=this.getOrCreateObject(s,r);if(this.screenManager.avoidanceManager.enable&&(n.show=!1),l.label)return l.labelRefCount++,l.label.show=n.show??!0,s;const c=this.screenManager.labelCollection.get({...n,position:r,id:o.properties??s,text:o.name});return c.ESSceneObjectID=e,l.label=c,l.zOrder=o.zOrder,s}addImage(e,n,o){const s=this.makeScreenObjectId(e,o.index??a.createGuid()),r=Se(o.position),l=this.getOrCreateObject(s,r);if(this.screenManager.avoidanceManager.enable&&(n.show=!1),l.billboard)return l.billboardRefCount++,l.billboard.show=n.show??!0,s;const c=this.screenManager.billboardCollection.get({...n,position:r,id:o.properties??s});return c.ESSceneObjectID=e,l.billboard=c,l.zOrder=o.zOrder,s}addRectangle(e,n,o,s){const r=this.makeScreenObjectId(e,o.index??a.createGuid()),l=Se(o.position),c=this.getOrCreateObject(r,l);if(this.screenManager.avoidanceManager.enable&&(n.show=!1),c.rectangle)return c.rectangleRefCount++,r;const u=this.screenManager.rectangleCollection.add({...a.getElementBounds(n.element),...n,id:o.properties??r,position:l,callback:s});return s(!0),c.rectangle=u,c.zOrder=o.zOrder,r}update(e,n){const o=Object.keys(n).length==1&&n.all&&Object.keys(n.all).length==1&&Reflect.has(n.all,"show"),s=new Map;for(const c of XC)s.set(c,Object.assign({},n[c],(n==null?void 0:n.all)??{}));const r=this.screenManager.avoidanceManager.enable,l=e instanceof Set?e:new Set([e]);for(const[c,u]of s)for(const d of l){const p=this.objects.get(d);if(!p)continue;const f=p[c];if(f){if(o){if(r&&u.show||f.show==u.show)continue;f.show=u.show;continue}for(const g in u)if(g!=="position"&&g!=="id"){if(r&&g=="show"&&u[g]||f[g]==u[g])continue;f[g]=u[g]}}}return!0}remove(e,n=!1){const o=e instanceof Set?e:typeof e=="string"?new Set([e]):e;if(o instanceof Set){for(const s of o){const r=this.objects.get(s);r&&(r.label&&(r.labelRefCount>1&&!n?r.labelRefCount--:(this.screenManager.labelCollection.release(r.label),r.label=void 0)),r.billboard&&(r.billboardRefCount>1&&!n?r.billboardRefCount--:(this.screenManager.billboardCollection.release(r.billboard),r.billboard=void 0)),r.rectangle&&(r.rectangleRefCount>1&&!n?r.rectangleRefCount--:(this.screenManager.rectangleCollection.remove(r.rectangle),r.rectangle=void 0)),this.tryDeleteEmpty(s))}return!0}else{for(const s of Object.keys(o)){const r=o[s]instanceof Set?o[s]:new Set([o[s]]);for(const l of r){if(!l)continue;const c=this.objects.get(l);if(c){if(c[`${s}RefCount`]>1&&!n)c[`${s}RefCount`]--;else{const u=c[s];u&&(this.screenManager.collectionMap[s].remove(u),c[s]=void 0)}this.tryDeleteEmpty(l)}}}return!0}}makeScreenObjectId(e,n){return`${e}_${n}`}getOrCreateObject(e,n){let o=this.objects.get(e);return o||(o=new kL(e,n),this.objects.set(e,o)),o}tryDeleteEmpty(e){const n=this.objects.get(e);n&&!n.label&&!n.billboard&&!n.rectangle&&this.objects.delete(e)}}function JL(t,i){const e=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER];for(const n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&XC.includes(n)){const o=i[n];if(!o)continue;let s,r,l,c;if(o instanceof h.Label||o instanceof h.Billboard){const u=o.computeScreenSpacePosition(t.scene);({x:s,y:r,width:l,height:c}=h[o instanceof h.Label?"Label":"Billboard"].getScreenSpaceBoundingBox(o,u))}else({x:s,y:r,width:l,height:c}=o);if(isNaN(s)||isNaN(r)||isNaN(l)||isNaN(c))continue;e[0]=Math.min(e[0],s),e[1]=Math.min(e[1],r),e[2]=Math.max(e[2],s+l),e[3]=Math.max(e[3],r+c)}return new h.Rectangle(...e)}class jL extends a.Destroyable{constructor(e){super();m(this,"rectangleCollisionCheck",new h.RectangleCollisionChecker);m(this,"screenManager");m(this,"enable",!1);m(this,"forceRebuildNext",!1);m(this,"avoidanceLayers",[]);m(this,"_processingQueue",[]);m(this,"_isProcessing",!1);m(this,"BATCH_SIZE",1e3);m(this,"_cache",new Map);m(this,"_lastCameraState",{});m(this,"CAMERA_MOVE_THRESHOLD",5e-4);this.screenManager=e,this.ad(()=>{this.rectangleCollisionCheck._tree.clear(),this._cache.clear(),this._processingQueue.length=0})}update(){if(this.avoidanceLayers.length==0)return;const e=this._shouldForceRebuild();this._buildProcessingQueue(e),this._isProcessing||(this._isProcessing=!0,requestAnimationFrame(()=>this._processBatch()))}setAvoidanceLayer(){for(let e=0;e<this.avoidanceLayers.length;e++){const n=this.screenManager.getLayer(this.avoidanceLayers[e]);n.layerIsEffective()&&n.objects.forEach((o,s)=>{o.show(!this.enable)})}this.forceRebuildNext=!0}updateAvoidanceLayer(e,n){this.enable=(e==null?void 0:e.enabled)??!1,n?e!=null&&e.enabled?this.avoidanceLayers.includes(n)||this.avoidanceLayers.push(n):this.avoidanceLayers=this.avoidanceLayers.filter(o=>o!=n):e!=null&&e.enabled?this.avoidanceLayers=Array.from(this.screenManager.layers.keys()):(this.setAvoidanceLayer(),this.avoidanceLayers=[]),this.setAvoidanceLayer()}_shouldForceRebuild(){if(this.forceRebuildNext)return this.forceRebuildNext=!1,this._updateLastCameraState(),!0;const e=this.screenManager.viewer.camera,n=e.positionWC,o=e.directionWC,s=this._lastCameraState.position,r=this._lastCameraState.direction;if(!s||!r)return this._updateLastCameraState(),!0;const l=h.Cartesian3.distanceSquared(n,s),c=h.Cartesian3.distanceSquared(o,r);return l>this.CAMERA_MOVE_THRESHOLD||c>this.CAMERA_MOVE_THRESHOLD?(this._updateLastCameraState(),!0):!1}_updateLastCameraState(){const e=this.screenManager.viewer.camera;this._lastCameraState.position=h.Cartesian3.clone(e.positionWC),this._lastCameraState.direction=h.Cartesian3.clone(e.directionWC)}_buildProcessingQueue(e){e&&(this.rectangleCollisionCheck._tree.clear(),this._cache.clear()),this._processingQueue.length=0;for(let n=0;n<this.avoidanceLayers.length;n++){const o=this.screenManager.getLayer(this.avoidanceLayers[n]);o.layerIsEffective()&&o.objects.forEach((s,r)=>{this._processingQueue.push(s)})}this._processingQueue.sort((n,o)=>(o.zOrder||0)-(n.zOrder||0))}_processBatch(){performance.now();const e=this._processingQueue,n=this.BATCH_SIZE;let o=0;for(;e.length>0&&o<n;){const s=e.shift();this._updateSingleObject(s),o++}e.length>0?requestAnimationFrame(()=>this._processBatch()):this._isProcessing=!1}_updateSingleObject(e){try{if(!this.screenManager.czmViewer.isPointVisible(e.position)){e.show(!1),this._cache.has(e.id.toString())&&this._cache.delete(e.id.toString());return}const n=e.id.toString(),o=this._cache.get(n),s=h.Cartesian3.clone(e.position);let r;if(o&&h.Cartesian3.equalsEpsilon(o.worldPos,s,1e-6))r=o.rect,this.rectangleCollisionCheck.remove(n,r);else{if(r=JL(this.screenManager.viewer,e),isNaN(r.width)||isNaN(r.height)){e.show(!1),this._cache.has(e.id.toString())&&this._cache.delete(e.id.toString());return}this._cache.set(n,{rect:r,worldPos:s,lastFrame:Date.now()})}this.rectangleCollisionCheck.collides(r)?e.show(!1):(e.show(!0),this.rectangleCollisionCheck.insert(e.id.toString(),r))}catch(n){console.error("ScreenManager update object error",n)}}}class YC extends a.Destroyable{constructor(){super();m(this,"_collection",[]);this.ad(()=>this._collection=[])}get length(){return this._collection.length}add(e){return this._collection.push(e),e._index=this._collection.length,e}remove(e){this._collection[e._index]=void 0}}class ZC extends a.Destroyable{constructor(e,n=500,o={minPoolRatio:.1}){super();m(this,"_pool",[]);m(this,"_minPoolRatio");m(this,"_initialSize");this._collection=e,this._initialSize=n,this._minPoolRatio=o.minPoolRatio??.1;for(let s=0;s<n;s++){const r=this._collection.add({show:!1,position:new h.Cartesian3(0,0,0)});this._pool.push(r)}this.ad(()=>{for(const s of this._pool)this.removeFromCollection(s);this._pool.length=0})}get(e,n){if(typeof e=="number"){const o=e,s=n,r=[];for(let l=0;l<o;l++){const c=this._getOne();this.update(c,s),r.push(c)}return r}else{const o=this._getOne();return this.update(o,e),o}}release(e){if(Array.isArray(e))for(const n of e)n.show=!1,this._pool.push(n);else e.show=!1,this._pool.push(e);this._dynamicRecycle()}update(e,n){if(n){Object.assign(e,n);for(const o in n)if(Object.prototype.hasOwnProperty.call(n,o)){const s=n[o];Reflect.has(e,o)&&(e[o]=s)}Reflect.has(e,"imageSubRegion")&&e.setImageSubRegion(n.image,n.imageSubRegion)}}get available(){return this._pool.length}removeFromCollection(e){this._collection instanceof h.LabelCollection?this._collection.remove(e):this._collection instanceof h.BillboardCollection&&this._collection.remove(e)}_getOne(){if(this._pool.length>0)return this._pool.pop();{const e=this._collection.add({show:!1,position:new h.Cartesian3(0,0,0)});return this._dynamicRecycle(),e}}_dynamicRecycle(){const e=this._collection.length,n=Math.max(this._initialSize,Math.floor(e*this._minPoolRatio));for(;this._pool.length>n;){const o=this._pool.pop();this.removeFromCollection(o)}}}class QC extends a.Destroyable{constructor(e){super();m(this,"layers",new Map);m(this,"czmViewer");m(this,"viewer");m(this,"avoidanceManager");m(this,"labelCollection");m(this,"billboardCollection");m(this,"rectangleCollection",this.ad(new YC));m(this,"canvasCollection",this.ad(new YC));m(this,"collectionMap");m(this,"_refreshEvent",this.ad(new a.Event));this.czmViewer=e,this.viewer=e.viewer,this.avoidanceManager=this.ad(new jL(this));const n=new h.LabelCollection({scene:this.viewer.scene}),o=new h.BillboardCollection({scene:this.viewer.scene});this.labelCollection=new ZC(n,500),this.billboardCollection=new ZC(o,500),this.viewer.scene.primitives.add(n),this.viewer.scene.primitives.add(o),this.collectionMap={label:n,billboard:o,rectangle:this.rectangleCollection},this.ad(a.createEventsCallFunc([this.czmViewer.cameraChanged,this.refreshEvent],()=>{this.avoidanceManager.update()},{immediate:!0})),this.ad(()=>{this.layers.forEach(s=>s.destroy()),this.layers.clear(),n.removeAll(),o.removeAll(),this.viewer.scene.primitives.remove(n),this.viewer.scene.primitives.remove(o)})}get refreshEvent(){return this._refreshEvent}refresh(){this._refreshEvent.emit()}getLayer(e){let n=this.layers.get(e);return n||(n=new KL(this),this.layers.set(e,n),this.avoidanceManager.enable&&this.avoidanceManager.updateAvoidanceLayer({enabled:!0})),n}addLabel(e,n,o,s){const l=this.getLayer(n).addLabel(e,o,s);return this.refresh(),{layer:n,id:e,screenObjectId:l}}addImage(e,n,o,s){const l=this.getLayer(n).addImage(e,o,s);return this.refresh(),{layer:n,id:e,screenObjectId:l}}addRectangle(e,n,o,s,r){const c=this.getLayer(n).addRectangle(e,o,s,r);return this.refresh(),{layer:n,id:e,screenObjectId:c}}update(e,n,o,s){const r=this.getLayer(e);return o instanceof Set&&o.size===0?!1:(r.update(o,s),this.refresh(),!0)}remove(e,n,o,s=!1){const r=this.getLayer(e);if(!r.remove(o,s)){console.warn(`屏幕管理器,删除${n}下的内容失败!`);return}!r.layerIsEffective()&&!r.isDestroyed()&&(r.destroy(),this.layers.delete(e)),this.refresh()}setRules(e,n){Reflect.has(e,"avoidance")&&this.avoidanceManager.updateAvoidanceLayer(e.avoidance,n),this.refresh()}}function Ke(t){return a.getExtProp(t,"_viewerExtensions")}function Ig(t,i){a.setExtProp(t,"_viewerExtensions",i)}class kC extends a.Destroyable{constructor(e,n){super();m(this,"_imageriesManager");m(this,"_terrainManager");m(this,"_labelManager");m(this,"_pickingManager");m(this,"_poiContext");m(this,"_cursorPositionInfo");m(this,"_screenManager");m(this,"_vectorTIlesManager");this._viewer=e,this._czmViewer=n,this._imageriesManager=this.dv(new UC(this.viewer)),this._terrainManager=this.dv(new WC(this.viewer)),this._labelManager=this.dv(new GC(this.viewer)),this._poiContext=this.disposeVar(new zm(this._viewer)),this._cursorPositionInfo=this.disposeVar(new OL(this._viewer)),this.ad(n.viewerChanged.don(()=>{this._pickingManager=this.dv(new HC(n)),this._screenManager=this.ad(new QC(n)),this._vectorTIlesManager=this.ad(new ZL(n.viewer)),this.ad(a.createEventsCallFunc(this.czmViewer.textAvoidanceChanged,()=>{this.screenManager.setRules({avoidance:{enabled:this.czmViewer.textAvoidance}})},{immediate:!0}))}))}get viewer(){return this._viewer}get czmViewer(){return this._czmViewer}get imageriesManager(){return this._imageriesManager}get terrainManager(){return this._terrainManager}get labelManager(){return this._labelManager}get pickingManager(){return this._pickingManager}get poiContext(){return this._poiContext}get cursorPositionInfo(){return this._cursorPositionInfo}get screenManager(){return this._screenManager}get vectorTIlesManager(){return this._vectorTIlesManager}}var KC=new h.Cartesian3,JC=new h.Cartesian3;function jC(t,i,e){let n=h.Matrix4.clone(t.transform);t.lookAtTransform(h.Matrix4.IDENTITY);var o=t.positionCartographic.height,s=t.positionWC,r=h.Cartesian3.normalize(s,KC),l=h.Cartesian3.dot(t.direction,r);if(l>-.9&&l<.9)var c=h.Cartesian3.cross(t.direction,r,JC);else var c=h.Cartesian3.cross(t.up,r,JC);var u=c;if(e){var d=h.Cartesian3.cross(r,c,KC);u=d}var p=h.Cartesian3.magnitude(s);t.rotate(u,i/p);var f=t.positionCartographic,g=f.longitude,v=f.latitude;h.Cartesian3.fromRadians(g,v,o,void 0,t.position),t.lookAtTransform(n)}function e_(t,i){jC(t,i,!1)}function t_(t,i){jC(t,-i,!0)}class eN extends a.Destroyable{constructor(e){super();m(this,"_actions",{MoveForward:!1,MoveBackword:!1,MoveLeft:!1,MoveRight:!1});this._running=e;const{controller:n}=this,{viewer:o}=n.firstPersonController,{camera:s}=o;this.dispose(this.running.keyStatus.currentKeyIdsChanged.disposableOn(()=>{this._updateActions()})),this.dispose(this.controller.keyDownEvent.disposableOn(r=>{const{keyStatusMap:l}=this.running.keyboardCameraController;l[r.code]==="SpeedUp"?this.controller.speed=this.controller.speed*2:l[r.code]==="SpeedDown"&&(this.controller.speed=this.controller.speed*.5)})),this.dispose(this.controller.keyDownEvent.disposableOn(r=>{const{keyStatusMap:l}=this.running.keyboardCameraController;l[r.code]==="SwitchAlwaysWithCamera"&&(this.controller.alwaysWithCamera=!this.controller.alwaysWithCamera)}));{const{actions:r}=this;let l=Date.now();const c=()=>{const u=Date.now(),d=u-l;l=u;const p=this.controller.speed;r.WithCamera||this.controller.alwaysWithCamera?(r.MoveForward&&s.moveForward(d*p),r.MoveBackword&&s.moveBackward(d*p),r.MoveLeft&&s.moveLeft(d*p),r.MoveRight&&s.moveRight(d*p)):(r.MoveForward&&e_(s,d*p),r.MoveBackword&&e_(s,-d*p),r.MoveLeft&&t_(s,-d*p),r.MoveRight&&t_(s,d*p));{const{rotateSpeed:f}=this.controller,g=h.Math.toRadians(f*d);r.RotateRight?s.lookRight(g):r.RotateLeft?s.lookRight(-g):r.RotateUp?s.lookDown(-g):r.RotateDown&&s.lookDown(g)}};o.scene.preUpdate.addEventListener(c),this.dispose(()=>o.scene.preUpdate.removeEventListener(c))}}get running(){return this._running}get controller(){return this.running.keyboardCameraController}get actions(){return this._actions}_resetActions(){const e=Object.keys(this._actions);for(let n of e)this._actions[n]=!1}_updateActions(){const{running:e}=this,{keyStatus:n}=e,{actions:o}=this;this._resetActions();const{keyStatusMap:s}=this.running.keyboardCameraController;for(let r of n.currentKeyIds)o[s[r]]=!0}}class Xh extends a.Destroyable{constructor(e){super();m(this,"_currentKeyIds",new Set);m(this,"_currentKeyIdsChanged",this.dv(new a.Event));m(this,"_debug",this.dv(a.react(!1)));m(this,"_debugResetting",this.dv(new a.ObjResettingWithEvent(this.debugChanged,()=>{if(this.debug)return new class extends a.Destroyable{constructor(e){super();const n=()=>{console.log([...e.currentKeyIds].join(`
1995
+ }`},translucent:!0});function TL(){Object.defineProperties(h.Billboard.prototype,{_positionFromParent:{get(){return!1},set(t){}}})}zF(),LF(),NF(),WF(),GF(),UF(),HF(),FF(),ez(),tz(),nz(),xz(),TL(),h.Camera.DEFAULT_VIEW_RECTANGLE=h.Rectangle.fromDegrees(70,5,140,55);function IL(){return new Promise((t,i)=>h.GroundPolylinePrimitive.initializeTerrainHeights().then(t))}class ML extends a.Destroyable{constructor(i,e,n,o){super();const s=()=>{e.setStatus("Raw");const{viewer:l}=e;if(l){const c=Ke(l);if(c&&(c.destroy(),Ig(l,void 0)),h.defined(l)){l.entities.removeAll(),l.dataSources.removeAll(),l.imageryLayers.removeAll(),l.scene.primitives.removeAll(),l.scene.groundPrimitives.removeAll(),l.scene.postProcessStages.removeAll();let u=l.scene.context._originalGLContext;u.canvas.width=u.canvas.height=1,u.getExtension("WEBGL_lose_context").loseContext(),u=null}l.destroy(),n(void 0)}};this.d(s);const r=this.dv(a.createProcessingFromAsyncFunc(async(l,c)=>{e.setStatus("Creating"),e.setStatusLog("正在创建Cesium视口...");const u=RF;await l.promise(IL());const d=await l.promise(a.createCancelablePromise(u(c,o)));d.scene._xbsjOriginSkyAtmosphere=d.scene.skyAtmosphere,d.scene._xbsjOriginSkyBox=d.scene.skyBox,d.scene.renderError.removeEventListener(d.cesiumWidget._onRenderError),d.clockViewModel.currentTime=h.JulianDate.fromDate(new Date(e.currentTime)),this.dispose(e.currentTimeChanged.disposableOn(()=>{if(e.currentTime===void 0)return;const p=h.JulianDate.fromDate(new Date(e.currentTime));h.JulianDate.equals(p,d.clockViewModel.currentTime)||(d.clockViewModel.currentTime=p)})),this.dispose(Ci(d.clockViewModel,"currentTime",p=>{const f=h.JulianDate.toDate(d.clockViewModel.currentTime).getTime();f!==e.currentTime&&(e.currentTime=f)}));{const p=new kC(d,e);Ig(d,p)}e.setStatus("Created"),e.setStatusLog("成功创建Cesium视口!"),n(d)}));r.start(i),r.errorEvent.don(l=>{console.error(l),e.setStatus("Error"),e.setStatusLog("创建Cesium视口失败!")})}}const DL=new h.EllipsoidTerrainProvider;class WC extends a.Destroyable{constructor(e){super();m(this,"_terrainMap",new Map);m(this,"_nextAnimateFrame",this.dv(a.createNextAnimateFrame()));m(this,"selectedTerrain");this._viewer=e;const n=this._viewer,o=n.scene.globe.terrainProviderChanged.addEventListener(()=>{this.selectedTerrain&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit())});this.ad(()=>{o&&o()}),this.dispose(this._changed.disposableOn(()=>{this.selectedTerrain=void 0;let s=Number.MIN_SAFE_INTEGER;for(let r of this._terrainMap.keys())r.sceneObject.activate=!1,(r.sceneObject.show??!0)&&r.sceneObject.zIndex>=s&&(this.selectedTerrain&&console.warn(`存在多个terrain,只能显示一个,当前terrian:${this.selectedTerrain.sceneObject.name}(${this.selectedTerrain.sceneObject.id}), 即将被替换成${r.sceneObject.name}(${r.sceneObject.id})`),s=r.sceneObject.zIndex,this.selectedTerrain=r);this.selectedTerrain&&!this.selectedTerrain.provider&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit()),n.scene.terrainProvider=(this.selectedTerrain&&this.selectedTerrain.provider)??DL}))}_makeDirty(){this._nextAnimateFrame.restartIfNotRunning()}get _changed(){return this._nextAnimateFrame.completeEvent}add(e){if(this._terrainMap.has(e)){console.warn("this._terrainMap.has(imagery)");return}const n=new a.Destroyable;n.dispose(e.providerChanged.disposableOn(()=>this._makeDirty())),n.dispose(e.sceneObject.showChanged.disposableOn(()=>this._makeDirty())),this._terrainMap.set(e,()=>n.destroy()),this._makeDirty();const o=this.ad(a.createNextAnimateFrameEvent(e.sceneObject.zIndexChanged));this.d(o.don(()=>{this._changed.emit()}))}delete(e){if(!this._terrainMap.has(e)){console.warn("!this._imageriesMap.has(imagery)");return}const n=this._terrainMap.get(e);if(!n){console.error("!disposeFunc");return}n(),this._terrainMap.delete(e),this.selectedTerrain===e&&(this.selectedTerrain=void 0),this._makeDirty()}}class GC extends a.Destroyable{constructor(e){super();m(this,"_labelMap",{div:new Map,canvas:new Map});this._viewer=e,this.d(e.scene.camera.changed.addEventListener(()=>{this._updateZOrder()}))}add(e){const n=e instanceof Ue?"div":"canvas";if(this._labelMap[n].has(e)){console.warn(`this._labelMap[${n}].has(poi)`,e);return}const o=new a.Destroyable;{const s=o.dv(a.createNextAnimateFrameEvent(e.zOrderChanged,e.positionChanged));o.dispose(s.don(()=>{this._updateZOrder()}))}this._labelMap[n].set(e,()=>o.destroy()),this._updateZOrder()}delete(e){const n=e instanceof Ue?"div":"canvas";if(!this._labelMap[n].has(e)){console.warn(`!this._labelMap[${n}].has(poi)`,e);return}const o=this._labelMap[n].get(e);if(!o){console.error("!disposeFunc");return}o(),this._labelMap[n].delete(e),this._updateZOrder()}_updateZOrder(){for(const e in this._labelMap)Object.prototype.hasOwnProperty.call(this._labelMap,e)&&this._updateLabelZOrder(this._labelMap[e],e)}_updateLabelZOrder(e,n){const o={};for(const l of e.keys())o[l.zOrder]||(o[l.zOrder]=new Map),o[l.zOrder].set(l,l instanceof Ue?l.czmDivPoi?l.czmDivPoi.depth:0:l.canvasObj?l.canvasObj.czmCanvasPoi.depth:0);const s=Object.keys(o).sort((l,c)=>n=="div"?Number(c)-Number(l):Number(l)-Number(c));let r=e.size;for(let l=0;l<s.length;l++)new Map([...o[s[l]]].sort((u,d)=>Number(d[1])-Number(u[1]))).forEach((u,d)=>{d instanceof Ue&&d.czmDivPoi&&(d.czmDivPoi.zOrder=r),d instanceof qi&&d.canvasObj&&(d.canvasObj.czmCanvasPoi.zOrder=r),r--})}}class RL extends a.Destroyable{constructor(e){super();m(this,"_czmImageryLayerWrappers",new Set);m(this,"_zIndexChangedEvent",this.dv(new a.Event));this._viewer=e,this.d(this._zIndexChangedEvent.don(()=>{const n=[...this.czmImageryLayerWrappers.values()];n.sort((o,s)=>{const r=o.czmImageryWrapper.imagery.zIndex??a.ESImageryLayer.defaults.zIndex,l=s.czmImageryWrapper.imagery.zIndex??a.ESImageryLayer.defaults.zIndex;return r-l});for(const o of n)this.viewer.imageryLayers.raiseToTop(o.imageryLayer)}))}get viewer(){return this._viewer}get czmImageryLayerWrappers(){return this._czmImageryLayerWrappers}add(e){this._czmImageryLayerWrappers.add(e),this.viewer.imageryLayers.add(e.imageryLayer),this.zIndexChange()}delete(e){this.viewer.imageryLayers.remove(e.imageryLayer,!1),this._czmImageryLayerWrappers.delete(e)}zIndexChange(){this._zIndexChangedEvent.emit()}}class FL extends a.Destroyable{constructor(e){super();m(this,"_imageryLayer");if(this._czmImageryWrapper=e,!this._czmImageryWrapper.imagery.layer)throw new Error("this._czmCzmImageryWrapper.imagery.czmImagery");this._imageryLayer=this._czmImageryWrapper.imagery.layer;const{czmImageryWrapper:n}=this,o=n.manager.czmImageriesManager;o.add(this),this.d(()=>o.delete(this)),this.d(this._czmImageryWrapper.imagery.zIndexChanged.don(()=>o.zIndexChange()))}get imageryLayer(){return this._imageryLayer}get czmImageryWrapper(){return this._czmImageryWrapper}}class zL extends a.Destroyable{constructor(e){super();m(this,"_objResetting");this._czmImageryWrapper=e,this._objResetting=this.dv(new a.ObjResettingWithEvent(this.czmImageryWrapper.imagery.showChanged,()=>{if(this.czmImageryWrapper.imagery.show??!0)return new FL(this.czmImageryWrapper)}))}get czmImageryWrapper(){return this._czmImageryWrapper}get objResetting(){return this._objResetting}}class LL extends a.Destroyable{constructor(e,n){super();m(this,"_czmImageryLayerWrapperObjResetting");this._imagery=e,this._manager=n,this._czmImageryLayerWrapperObjResetting=this.dv(new a.ObjResettingWithEvent(this.imagery.layerChanged,()=>{if(this.imagery.layer)return new zL(this)}))}get imagery(){return this._imagery}get manager(){return this._manager}get czmImageryLayerWrapperObjResetting(){return this._czmImageryLayerWrapperObjResetting}}class UC extends a.Destroyable{constructor(e){super();m(this,"_czmImageryWrappers",new Set);m(this,"_czmImageryLayersManager");this._viewer=e,this._czmImageryLayersManager=this.dv(new RL(this.viewer))}get czmImageryWrappers(){return this._czmImageryWrappers}get czmImageriesManager(){return this._czmImageryLayersManager}get viewer(){return this._viewer}add(e){for(let n of this.czmImageryWrappers)if(n.imagery===e){console.warn("imageriesManager add error: has already added!",e);return}this.czmImageryWrappers.add(new LL(e,this))}has(e){for(let n of this.czmImageryWrappers)if(n.imagery===e)return!0;return!1}delete(e){for(const n of this.czmImageryWrappers)if(n.imagery===e){this.czmImageryWrappers.delete(n);return}console.warn("imageriesManager delete error!",e)}}class HC extends a.Destroyable{constructor(e){super();m(this,"_pause",this.disposeVar(a.react(!1)));m(this,"_pickPositionTasks",[]);m(this,"_pickTasks",[]);m(this,"pickHeightMustGreaterThanZero",!0);m(this,"objectsToExclude",[]);const n=e.viewer;{this.dispose(()=>{this._pickPositionTasks.length>0&&(this._pickPositionTasks.forEach(l=>l[3]("CzmViewer销毁,任务不再执行!")),this._pickPositionTasks.length=0),this._pickTasks.length>0&&(this._pickTasks.forEach(l=>l[4]("CzmViewer销毁,任务不再执行!")),this._pickTasks.length=0)});const o=()=>{const l=[...this._pickPositionTasks];this._pickPositionTasks.length=0;for(let u of l){const[d,p,f,g]=u;try{(async()=>{const{scene:v,camera:y}=n,w=Pe(d),P=y.getPickRay(w);if(P){let E;if(p?E=await v.pickFromRayMostDetailed(P,this.objectsToExclude):E=v.pickFromRay(P,this.objectsToExclude),E&&E.position){const R=se(E.position);return R?f(R):g(new Error("positionFromCartesian failed"))}if(!(v.terrainProvider instanceof h.EllipsoidTerrainProvider)){const R=v.globe.pick(P,v);if(!R)return g(new Error("scene.globe.pick failed"));const N=se(R);return N?(this.pickHeightMustGreaterThanZero&&N[2]<0&&(N[2]=0),f(N)):g(new Error("positionFromCartesian failed"))}}const C=v.terrainProvider instanceof h.EllipsoidTerrainProvider?v.terrainProvider.tilingScheme.ellipsoid:n.scene.globe.ellipsoid,S=n.camera.pickEllipsoid(Pe(d),C);if(!S)return g(new Error("Pick failed"));const A=se(S);return A?f(A):g(new Error("positionFromCartesian failed"))})()}catch(v){g(v)}}const c=[...this._pickTasks];this._pickTasks.length=0;for(let u of c){const[d,p,f,g,v]=u;e.pickCustomAttachedInfo=f;try{(async()=>{var E,R,N,B;let y=n.scene.pick(Pe(d),p&&p[0],p&&p[1]);!y&&h.defined(n.scene.globe)&&(y=await NL(n,Pe(d)));let w;if(y&&y instanceof h.Cesium3DTileFeature){w={};try{y&&y.getPropertyIds().forEach(G=>{w&&(w[G]=y.getProperty(G))})}catch(V){console.warn(V)}}if(!y){const{left:V,top:G}=e.container.getBoundingClientRect();y=(E=document.elementFromPoint(d[0]+V,d[1]+G))==null?void 0:E.closest("[data-es-scene-object-id]")}let P;y&&(y.id&&y.id instanceof h.Entity&&y.id.ESSceneObjectID?P=y.id.ESSceneObjectID:y.primitive&&y.primitive.ESSceneObjectID?P=y.primitive.ESSceneObjectID:y.collection&&y.collection.ESSceneObjectID?P=y.collection.ESSceneObjectID:Array.isArray(y)&&y[0]instanceof h.ImageryLayerFeatureInfo?P=y[0].imageryLayer.ESSceneObjectID:y instanceof HTMLElement&&(P=y.dataset.esSceneObjectId));let C=P?a.ESSceneObject.getSceneObject(P):void 0;C&&C.parentID&&(C=a.ESSceneObject.getSceneObject(C.parentID));let S={};if(C&&Reflect.has(C,"allowPicking")&&Reflect.has(C,"pickedEvent")&&(C.allowPicking??!1)){if(C instanceof a.ESEntityCluster){const V=new h.JulianDate;S=y.id instanceof h.Entity?{name:y.id.label.text.getValue(V),properties:(R=y.id.properties)==null?void 0:R.getValue(V),coordinates:wr(y.id.position.getValue(V))}:(N=y.id)==null?void 0:N.map(G=>{var z;return{name:G.id,properties:(z=G.properties)==null?void 0:z.getValue(V),coordinates:wr(G.position.getValue(V))}})}else if(C instanceof a.ESGeoJson){const V=new h.JulianDate;let G,z,O;y.id.entityCollection?(G=y.id.polygon?"Polygon":y.id.polyline?"LineString":"Point",O=((B=y.id.properties)==null?void 0:B.getValue(V))??{},z=G=="Point"?se(y.id.position.getValue(V)):G=="LineString"?y.id.polyline.positions.getValue(V).map(_=>se(_)):yu(y.id.polygon.hierarchy.getValue(V))):(y.primitive instanceof h.Billboard||y.primitive instanceof h.Label)&&(G="Point",typeof y.id=="object"&&(O=y.id),z=se(y.primitive.position)),S=C.pickedInfoType=="FeatureCollection"||C.pickedInfoType=="Feature"?{type:"Feature",geometry:{type:G,coordinates:z},properties:O}:{type:G,coordinates:z,properties:O}}else if(C instanceof a.ESGltfModel){let V;Reflect.has(y,"featureId")?V=y.featureId:Reflect.has(y,"instanceId")&&(V=y.instanceId),V&&(y.id=y.primitive.structuralMetadata.getPropertyTable(0).getProperty(y.instanceId,"id"))}C.pickedEvent.emit(new a.ESJPickedResult(y,C,w,S,f,d))}C&&Reflect.has(C,"allowPicking")&&!C.allowPicking&&g(new a.ESJPickedResult);const A=new a.ESJPickedResult(y,C,w,S,f,d);g(A)})()}catch(y){v(y)}}};let s=n.scene.postRender.addEventListener(o);const r=()=>{s&&s(),s=void 0};this.ad(r),this.ad(this.pauseChanged.don(l=>{l?r():s=n.scene.postRender.addEventListener(o)}))}}get pause(){return this._pause.value}set pause(e){this._pause.value=e}get pauseChanged(){return this._pause.changed}pickPosition(e){return new Promise((n,o)=>{this._pickPositionTasks.push([e,!0,n,o])})}quickPickPosition(e){return new Promise((n,o)=>{this._pickPositionTasks.push([e,!1,n,o])})}pick(e,n,o){return new Promise((s,r)=>{this._pickTasks.push([e,n,o,s,r])})}}function NL(t,i){const e=t.scene,n=e.camera.getPickRay(i);if(!n)return;const o=e.imageryLayers.pickImageryLayerFeatures(n,e);if(h.defined(o))return o}class OL extends a.Destroyable{constructor(e){super();m(this,"_enabled",this.disposeVar(a.react(!1)));m(this,"_cursorPosition",a.react(void 0));m(this,"quickPickPosition",!0);let n=new a.Destroyable;const o=()=>{n&&(n.destroy(),n=void 0)};this.dispose(o);const s=()=>{if(o(),!this._enabled.value||!e)return;const r=Ke(e);if(!r)return;n=new a.Destroyable;const l=n.disposeVar(a.react(void 0)),c=n.disposeVar(a.createNextAnimateFrameEvent(l.changed));n.dispose(r.czmViewer.pointerMoveEvent.disposableOn(d=>{d.pointerEvent&&(l.value=a.getDomEventCurrentTargetPos(d.pointerEvent))}));const u=n.disposeVar(a.createProcessingFromAsyncFunc(async d=>{if(r.pickingManager&&l.value)if(this.quickPickPosition){const p=await d.promise(a.createCancelablePromise(r.pickingManager.quickPickPosition(l.value)));this._cursorPosition.value=p}else{const p=await d.promise(a.createCancelablePromise(r.pickingManager.pickPosition(l.value)));this._cursorPosition.value=p}}));n.dispose(c.disposableOn(()=>{u.restart()}))};s(),this.dispose(this._enabled.changed.disposableOn(s))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}class BL extends a.Destroyable{constructor(){super();m(this,"cache",new Map);m(this,"maxSize",300);m(this,"_deleteTileEvent",this.disposeVar(new a.Event))}get deleteTileEvent(){return this._deleteTileEvent}deleteTile(e,n){this._deleteTileEvent.emit(e,n)}has(e,n){const o=this.cache.get(e);return n?(o==null?void 0:o.has(n))??!1:!!o}get(e,n){const o=this.cache.get(e);if(!o)return;if(!n)return o;const s=o.get(n);return s&&(o.delete(n),o.set(n,s)),s}set(e,n,o){let s=this.get(e);if(s||(s=new Map,this.cache.set(e,s)),s.set(n,o),s.size>=this.maxSize){const r=s.keys().next().value;r&&this.remove(e,r)}}remove(e,n){const o=e instanceof xh?e.sceneObject.id:e;let s=this.get(o);s&&(n?(s.delete(n),s.size===0&&this.cache.delete(o)):this.cache.delete(o),this.deleteTile(o,n))}}class $C extends a.Destroyable{constructor(e){super();m(this,"x");m(this,"y");m(this,"z");m(this,"tileKey");m(this,"parent",null);m(this,"children",new Set);m(this,"data",new Map);m(this,"state",ar.UNLOADED);this.tileKey=e,[this.z,this.x,this.y]=e.split("-").map(Number)}fillParentAndChildren(e){var o;const n=`${this.z-1}-${Math.floor(this.x/2)}-${Math.floor(this.y/2)}`;this.parent=e.get(n)??null,(o=this.parent)==null||o.children.add(this)}}class VL extends a.Destroyable{constructor(e,n,o){super();m(this,"workers",[]);m(this,"queue",[]);m(this,"destroyed",!1);const s=navigator.hardwareConcurrency||4;let r;n?n>s?(console.warn(`创建线程超过CPU核心数,已限制为${s-1}`),r=s-1):r=n:r=Math.max(1,s-1);for(let l=0;l<r;l++)this.workers.push(new Worker(e,o));this.ad(()=>{this.destroyed=!0;for(const l of this.queue)l(null);this.queue.length=0;for(const l of this.workers)l.terminate();this.workers.length=0})}acquire(){return this.destroyed?Promise.reject("WorkerPool destroyed"):new Promise(e=>{this.workers.length>0?e(this.workers.pop()):this.queue.push(e)})}release(e){this.destroyed||(this.queue.length>0?this.queue.shift()(e):this.workers.push(e))}}function ln(t,i){if(typeof t=="string"){const e=[...t.matchAll(/\{([^}]+)\}/g)].map(n=>n[1]);return e.length===0?null:e.length===1?e[0]:e}if(t&&typeof t=="object"&&Array.isArray(t.stops)){let e=t.stops[0][1];for(const[n,o]of t.stops)i>=n&&(e=o);return ln(e,i)}if(Array.isArray(t))switch(t[0]){case"get":{const n=t[1];return typeof n=="string"?n:null}case"step":{let n=t[2];for(let o=3;o<t.length;o+=2){const s=t[o],r=t[o+1];i>=s&&(n=r)}return ln(n,i)}case"case":{for(let n=2;n<t.length;n+=2){if(n===t.length-1)return ln(t[n],i);const o=t[n],s=ln(o,i);if(s)return s}return null}case"match":{const n=new Set;for(let o=3;o<t.length;o+=2){const s=t[o],r=ln(s,i);r&&(Array.isArray(r)?r.forEach(l=>n.add(l)):n.add(r))}return n.size?[...n]:null}case"concat":{const n=new Set;for(let o=1;o<t.length;o++){const s=ln(t[o],i);s&&(Array.isArray(s)?s.forEach(r=>n.add(r)):n.add(s))}return n.size?[...n]:null}case"format":{const n=new Set;for(let o=1;o<t.length;o+=2){const s=ln(t[o],i);s&&(Array.isArray(s)?s.forEach(r=>n.add(r)):n.add(s))}return n.size?[...n]:null}}return null}function WL(t){const i=new Map;for(const e in t){const n=t[e],o=new Set,s=n.points,r=n.pointProps;for(let g=0;g<s.length;g+=3){const v=g/3;o.add({type:"Feature",geometry:{type:"Point",coordinates:[s[g],s[g+1]]},properties:r[v]||{}})}const l=n.lines,c=n.lineOffsets,u=n.lineProps;for(let g=0;g<c.length;g++){const v=c[g]*3,y=g+1<c.length?c[g+1]*3:l.length,w=[];for(let P=v;P<y;P+=3)w.push([l[P],l[P+1]]);o.add({type:"Feature",geometry:{type:"LineString",coordinates:w},properties:u[g]||{}})}const d=n.polygons,p=n.polygonOffsets,f=n.polygonProps;for(let g=0;g<p.length;g++){const v=p[g]*3,y=g+1<p.length?p[g+1]*3:d.length,w=[];for(let P=v;P<y;P+=3)w.push([d[P],d[P+1]]);o.add({type:"Feature",geometry:{type:"Polygon",coordinates:[w]},properties:f[g]||{}})}i.set(e,o)}return i}class GL extends a.Destroyable{constructor(e){super();m(this,"pendingRequests",new Map);m(this,"sourcesMap",new Map);m(this,"workerPool");m(this,"tileSchemes",new Map);this.tilesCache=e,this.workerPool=new VL(new URL("data:video/mp2t;base64,Ly8vIDxyZWZlcmVuY2UgbGliPSJXZWJXb3JrZXIiIC8+DQppbXBvcnQgUGJmIGZyb20gInBiZiI7DQppbXBvcnQgeyBWZWN0b3JUaWxlIH0gZnJvbSAiQG1hcGJveC92ZWN0b3ItdGlsZSI7DQoNCnNlbGYub25tZXNzYWdlID0gYXN5bmMgKGUpID0+IHsNCiAgICBjb25zdCB7IHR5cGUsIHVybCwgeCwgeSwgeiB9ID0gZS5kYXRhOw0KICAgIGlmICh0eXBlICE9PSAiZmV0Y2giKSByZXR1cm47DQoNCiAgICB0cnkgew0KICAgICAgICBjb25zdCBidWZmZXIgPSBhd2FpdCAoYXdhaXQgZmV0Y2godXJsKSkuYXJyYXlCdWZmZXIoKTsNCiAgICAgICAgY29uc3QgdGlsZSA9IG5ldyBWZWN0b3JUaWxlKG5ldyBQYmYoYnVmZmVyKSk7DQoNCiAgICAgICAgY29uc3QgdGlsZURhdGE6IFJlY29yZDxzdHJpbmcsIGFueT4gPSB7fTsNCg0KICAgICAgICBmb3IgKGNvbnN0IGxheWVyTmFtZSBpbiB0aWxlLmxheWVycykgew0KICAgICAgICAgICAgY29uc3QgbGF5ZXIgPSB0aWxlLmxheWVyc1tsYXllck5hbWVdOw0KICAgICAgICAgICAgY29uc3QgZXh0ZW50ID0gbGF5ZXIuZXh0ZW50IHx8IDQwOTY7DQoNCiAgICAgICAgICAgIGNvbnN0IHBvaW50czogbnVtYmVyW10gPSBbXTsNCiAgICAgICAgICAgIGNvbnN0IHBvaW50UHJvcHM6IGFueVtdID0gW107DQoNCiAgICAgICAgICAgIGNvbnN0IGxpbmVzOiBudW1iZXJbXSA9IFtdOw0KICAgICAgICAgICAgY29uc3QgbGluZU9mZnNldHM6IG51bWJlcltdID0gW107DQogICAgICAgICAgICBjb25zdCBsaW5lUHJvcHM6IGFueVtdID0gW107DQoNCiAgICAgICAgICAgIGNvbnN0IHBvbHlnb25zOiBudW1iZXJbXSA9IFtdOw0KICAgICAgICAgICAgY29uc3QgcG9seWdvbk9mZnNldHM6IG51bWJlcltdID0gW107DQogICAgICAgICAgICBjb25zdCBwb2x5Z29uUHJvcHM6IGFueVtdID0gW107DQoNCiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbGF5ZXIubGVuZ3RoOyBpKyspIHsNCiAgICAgICAgICAgICAgICBjb25zdCBmID0gbGF5ZXIuZmVhdHVyZShpKTsNCiAgICAgICAgICAgICAgICBjb25zdCBnZW9tID0gZi5sb2FkR2VvbWV0cnkoKTsNCiAgICAgICAgICAgICAgICBjb25zdCB0ID0gZi50eXBlOw0KICAgICAgICAgICAgICAgIGNvbnN0IHByb3BlcnRpZXMgPSBmLnByb3BlcnRpZXMgfHwge307DQoNCiAgICAgICAgICAgICAgICBpZiAodCA9PT0gMSkgeyAvLyBQb2ludA0KICAgICAgICAgICAgICAgICAgICBsZXQgc3ggPSAwLCBzeSA9IDAsIGNudCA9IDA7DQogICAgICAgICAgICAgICAgICAgIGZvciAoY29uc3QgcmluZyBvZiBnZW9tKQ0KICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChjb25zdCBwIG9mIHJpbmcpIHsgc3ggKz0gcC54OyBzeSArPSBwLnk7IGNudCsrOyB9DQogICAgICAgICAgICAgICAgICAgIGlmIChjbnQgPT09IDApIGNvbnRpbnVlOw0KICAgICAgICAgICAgICAgICAgICBjb25zdCB7IGxvbiwgbGF0IH0gPSB0aWxlUGl4ZWxUb0xvbkxhdChzeCAvIGNudCwgc3kgLyBjbnQsIGV4dGVudCwgeCwgeSwgeik7DQogICAgICAgICAgICAgICAgICAgIHBvaW50cy5wdXNoKGxvbiwgbGF0LCAwKTsNCiAgICAgICAgICAgICAgICAgICAgcG9pbnRQcm9wcy5wdXNoKHByb3BlcnRpZXMpOw0KDQogICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0ID09PSAyKSB7IC8vIExpbmUNCiAgICAgICAgICAgICAgICAgICAgbGluZU9mZnNldHMucHVzaChsaW5lcy5sZW5ndGggLyAzKTsNCiAgICAgICAgICAgICAgICAgICAgZm9yIChjb25zdCByaW5nIG9mIGdlb20pDQogICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGNvbnN0IHAgb2YgcmluZykgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHsgbG9uLCBsYXQgfSA9IHRpbGVQaXhlbFRvTG9uTGF0KHAueCwgcC55LCBleHRlbnQsIHgsIHksIHopOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVzLnB1c2gobG9uLCBsYXQsIDApOw0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICBsaW5lUHJvcHMucHVzaChwcm9wZXJ0aWVzKTsNCg0KICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodCA9PT0gMykgeyAvLyBQb2x5Z29uDQogICAgICAgICAgICAgICAgICAgIHBvbHlnb25PZmZzZXRzLnB1c2gocG9seWdvbnMubGVuZ3RoIC8gMyk7DQogICAgICAgICAgICAgICAgICAgIGZvciAoY29uc3QgcmluZyBvZiBnZW9tKQ0KICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChjb25zdCBwIG9mIHJpbmcpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB7IGxvbiwgbGF0IH0gPSB0aWxlUGl4ZWxUb0xvbkxhdChwLngsIHAueSwgZXh0ZW50LCB4LCB5LCB6KTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb2x5Z29ucy5wdXNoKGxvbiwgbGF0LCAwKTsNCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgcG9seWdvblByb3BzLnB1c2gocHJvcGVydGllcyk7DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICB0aWxlRGF0YVtsYXllck5hbWVdID0gew0KICAgICAgICAgICAgICAgIHBvaW50czogbmV3IEZsb2F0MzJBcnJheShwb2ludHMpLA0KICAgICAgICAgICAgICAgIHBvaW50UHJvcHMsDQogICAgICAgICAgICAgICAgbGluZXM6IG5ldyBGbG9hdDMyQXJyYXkobGluZXMpLA0KICAgICAgICAgICAgICAgIGxpbmVPZmZzZXRzOiBuZXcgVWludDMyQXJyYXkobGluZU9mZnNldHMpLA0KICAgICAgICAgICAgICAgIGxpbmVQcm9wcywNCiAgICAgICAgICAgICAgICBwb2x5Z29uczogbmV3IEZsb2F0MzJBcnJheShwb2x5Z29ucyksDQogICAgICAgICAgICAgICAgcG9seWdvbk9mZnNldHM6IG5ldyBVaW50MzJBcnJheShwb2x5Z29uT2Zmc2V0cyksDQogICAgICAgICAgICAgICAgcG9seWdvblByb3BzDQogICAgICAgICAgICB9Ow0KICAgICAgICB9DQoNCiAgICAgICAgLy8g5pS26ZuGIGJ1ZmZlciB0cmFuc2ZlcmFibGUNCiAgICAgICAgY29uc3QgdHJhbnNmZXJzOiBBcnJheUJ1ZmZlcltdID0gW107DQogICAgICAgIGZvciAoY29uc3QgbGF5ZXJOYW1lIGluIHRpbGVEYXRhKSB7DQogICAgICAgICAgICBjb25zdCBsYXllciA9IHRpbGVEYXRhW2xheWVyTmFtZV07DQogICAgICAgICAgICB0cmFuc2ZlcnMucHVzaChsYXllci5wb2ludHMuYnVmZmVyLCBsYXllci5saW5lcy5idWZmZXIsIGxheWVyLmxpbmVPZmZzZXRzLmJ1ZmZlciwNCiAgICAgICAgICAgICAgICBsYXllci5wb2x5Z29ucy5idWZmZXIsIGxheWVyLnBvbHlnb25PZmZzZXRzLmJ1ZmZlcik7DQogICAgICAgIH0NCg0KICAgICAgICBzZWxmLnBvc3RNZXNzYWdlKHsgdXJsLCB0aWxlRGF0YSB9LCB0cmFuc2ZlcnMpOw0KDQogICAgfSBjYXRjaCAoZXJyKSB7DQogICAgICAgIHNlbGYucG9zdE1lc3NhZ2UoeyB1cmwsIGVycm9yOiAoZXJyIGFzIEVycm9yKS5tZXNzYWdlIH0pOw0KICAgIH0NCn07DQovLyAtLS0tLS0tLS0tLS0tLS0tLS0g5Yeg5L2V5LyY5YyWIC0tLS0tLS0tLS0tLS0tLS0tLQ0KDQpmdW5jdGlvbiBzaW1wbGlmeVJpbmcocmluZzogYW55W10pIHsNCiAgICBjb25zdCBvdXQ6IGFueSA9IFtdOw0KICAgIGNvbnN0IG4gPSByaW5nLmxlbmd0aDsNCiAgICBpZiAobiA8PSAyKSByZXR1cm4gcmluZzsNCg0KICAgIG91dC5wdXNoKHJpbmdbMF0pOw0KDQogICAgZm9yIChsZXQgaSA9IDE7IGkgPCBuIC0gMTsgaSsrKSB7DQogICAgICAgIGNvbnN0IEEgPSBvdXRbb3V0Lmxlbmd0aCAtIDFdOw0KICAgICAgICBjb25zdCBCID0gcmluZ1tpXTsNCiAgICAgICAgY29uc3QgQyA9IHJpbmdbaSArIDFdOw0KDQogICAgICAgIGlmIChBLnggPT09IEIueCAmJiBBLnkgPT09IEIueSkgY29udGludWU7DQogICAgICAgIGlmIChpc0NvbGluZWFyKEEueCwgQS55LCBCLngsIEIueSwgQy54LCBDLnkpKSBjb250aW51ZTsNCg0KICAgICAgICBvdXQucHVzaChCKTsNCiAgICB9DQoNCiAgICBvdXQucHVzaChyaW5nW24gLSAxXSk7DQogICAgcmV0dXJuIG91dDsNCn0NCg0KZnVuY3Rpb24gY2xlYW5Qb2x5Z29uKHJpbmdzOiBhbnlbXSkgew0KICAgIHJldHVybiByaW5ncy5tYXAocmluZyA9PiB7DQogICAgICAgIGlmIChyaW5nLmxlbmd0aCA+IDIpIHsNCiAgICAgICAgICAgIGNvbnN0IEEgPSByaW5nWzBdOw0KICAgICAgICAgICAgY29uc3QgQiA9IHJpbmdbcmluZy5sZW5ndGggLSAxXTsNCiAgICAgICAgICAgIGlmIChBLnggPT09IEIueCAmJiBBLnkgPT09IEIueSkgcmluZyA9IHJpbmcuc2xpY2UoMCwgLTEpOw0KICAgICAgICB9DQogICAgICAgIHJldHVybiBzaW1wbGlmeVJpbmcocmluZyk7DQogICAgfSk7DQp9DQoNCmZ1bmN0aW9uIGlzQ29saW5lYXIoYXgsIGF5LCBieCwgYnksIGN4LCBjeSkgew0KICAgIHJldHVybiAoYnggLSBheCkgKiAoY3kgLSBieSkgPT09IChieSAtIGF5KSAqIChjeCAtIGJ4KTsNCn0NCg0KLy8gLS0tLS0tLS0tLS0tLS0tLS0tIOe7j+e6rOW6pui9rOaNoiAtLS0tLS0tLS0tLS0tLS0tLS0NCg0KZnVuY3Rpb24gY29udmVydFRvTG9uTGF0KGdlb20sIHQsIGV4dGVudCwgeCwgeSwgeikgew0KICAgIGlmICh0ID09PSAxKSB7DQogICAgICAgIGxldCBzeCA9IDAsIHN5ID0gMCwgY250ID0gMDsNCiAgICAgICAgZm9yIChjb25zdCByaW5nIG9mIGdlb20pDQogICAgICAgICAgICBmb3IgKGNvbnN0IHAgb2YgcmluZykgeyBzeCArPSBwLng7IHN5ICs9IHAueTsgY250Kys7IH0NCiAgICAgICAgY29uc3QgbGwgPSB0aWxlUGl4ZWxUb0xvbkxhdChzeCAvIGNudCwgc3kgLyBjbnQsIGV4dGVudCwgeCwgeSwgeik7DQogICAgICAgIHJldHVybiBbbGwubG9uLCBsbC5sYXRdOw0KICAgIH0NCg0KICAgIGlmICh0ID09PSAyKSB7DQogICAgICAgIGNvbnN0IGFycjogYW55W10gPSBbXTsNCiAgICAgICAgZm9yIChjb25zdCByaW5nIG9mIGdlb20pDQogICAgICAgICAgICBmb3IgKGNvbnN0IHAgb2YgcmluZykgew0KICAgICAgICAgICAgICAgIGNvbnN0IGxsID0gdGlsZVBpeGVsVG9Mb25MYXQocC54LCBwLnksIGV4dGVudCwgeCwgeSwgeik7DQogICAgICAgICAgICAgICAgYXJyLnB1c2goW2xsLmxvbiwgbGwubGF0XSk7DQogICAgICAgICAgICB9DQogICAgICAgIHJldHVybiBhcnI7DQogICAgfQ0KDQogICAgaWYgKHQgPT09IDMpIHsNCiAgICAgICAgcmV0dXJuIGdlb20ubWFwKHJpbmcgPT4NCiAgICAgICAgICAgIHJpbmcubWFwKHAgPT4gew0KICAgICAgICAgICAgICAgIGNvbnN0IGxsID0gdGlsZVBpeGVsVG9Mb25MYXQocC54LCBwLnksIGV4dGVudCwgeCwgeSwgeik7DQogICAgICAgICAgICAgICAgcmV0dXJuIFtsbC5sb24sIGxsLmxhdF07DQogICAgICAgICAgICB9KQ0KICAgICAgICApOw0KICAgIH0NCn0NCg0KZnVuY3Rpb24gdGlsZVBpeGVsVG9Mb25MYXQocHgsIHB5LCBleHRlbnQsIHRpbGVYLCB0aWxlWSwgeikgew0KICAgIGNvbnN0IG4gPSBNYXRoLnBvdygyLCB6KTsNCiAgICBjb25zdCB4Tm9ybSA9ICh0aWxlWCArIHB4IC8gZXh0ZW50KSAvIG47DQogICAgY29uc3QgeU5vcm0gPSAodGlsZVkgKyBweSAvIGV4dGVudCkgLyBuOw0KICAgIGNvbnN0IGxvbiA9IHhOb3JtICogMzYwIC0gMTgwOw0KICAgIGNvbnN0IGxhdCA9IE1hdGguYXRhbihNYXRoLnNpbmgoTWF0aC5QSSAqICgxIC0gMiAqIHlOb3JtKSkpICogMTgwIC8gTWF0aC5QSTsNCiAgICByZXR1cm4geyBsb24sIGxhdCB9Ow0KfQ==",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Gi&&Gi.tagName.toUpperCase()==="SCRIPT"&&Gi.src||new URL("earthsdk3-cesium.umd.cjs",document.baseURI).href),10,{type:"module"})}add(e){const n=e.sceneObject.id,o=e.mvtLayerJson.mainJson,s=e.sceneObject.scheme??"xyz";let r=this.sourcesMap.get(n),l=this.tileSchemes.get(n);if(r||(r=new Map,this.sourcesMap.set(n,r)),(!l||s!=l)&&this.tileSchemes.set(n,s),typeof o=="string")r.set("customSource",{tiles:[o],type:"vector"});else if(typeof o=="object"){const c=o.sources;for(const u in c){const d=c[u];d.type==="vector"&&Reflect.has(d,"tiles")&&r.set(u,d)}}}remove(e){const n=e.sceneObject.id;this.sourcesMap.delete(n),this.tileSchemes.delete(n),this.pendingRequests.delete(n)}async fetchTile(e,n){return new Promise(async o=>{var g,v,y,w;if((g=this.pendingRequests.get(e))!=null&&g.has(n))return o(void 0);(v=this.pendingRequests.get(e))==null||v.add(n);const[s,r,l]=n.split("-").map(Number),u=this.tileSchemes.get(e)==="tms"?Math.pow(2,s)-l-1:l,d=this.tilesCache.get(e,n)??new $C(n),p=this.sourcesMap.get(e);if(!p)return d.state=ar.FAILED,o(d);const f=Array.from(p.keys()).pop();for(const[P,C]of p.entries()){d.state=ar.LOADING;const S=Array.isArray(C.tiles)?C.tiles:[C.tiles];for(const A of S){if(d.state=ar.PROCESSING,!A.includes("{z}")||C.maxzoom&&s>C.maxzoom||C.minzoom&&s<C.minzoom)continue;const E=A.replace("{z}",s.toString()).replace("{x}",r.toString()).replace("{y}",u.toString());try{const R=await this.fetchUrl(E,r,l,s);if(d.data.set(P,R),P===f)return(y=this.pendingRequests.get(e))==null||y.delete(n),((w=this.pendingRequests.get(e))==null?void 0:w.size)===0&&this.pendingRequests.delete(e),d.state=ar.READY,o(d)}catch(R){console.error(`Failed to load tile ${n}:`,R)}}}})}fetchUrl(e,n,o,s){return new TextDecoder,new Promise((r,l)=>{this.workerPool.acquire().then(c=>{const u=d=>{const p=d.data;if(p.url!==e)return;if(c.removeEventListener("message",u),this.workerPool.release(c),p.error)return l(new Error(p.error));const f=WL(p.tileData);r(f)};c.addEventListener("message",u),c.postMessage({type:"fetch",url:e,x:n,y:o,z:s})})})}}class UL extends a.Destroyable{constructor(e,n){super();m(this,"renderedTiles",new Map);this.screenManager=e,this.styleManager=n}renderTile(e,n){var l;const o=new Set,s=this.styleManager.getStyle(e);if(!s)return;for(const c of s){const u=Number.parseInt(n.tileKey.split("-")[0]);if(!((c.maxzoom||c.minzoom)&&(c.maxzoom&&u>c.maxzoom||c.minzoom&&u<c.minzoom)))for(const d of((l=n.data.get(c.source))==null?void 0:l.get(c["source-layer"]??""))||[]){let p=d.geometry.coordinates;d.geometry.type.includes("Point")||(p=WI(d.geometry).geometry.coordinates);let f,g;if(c.labelStyle){const v=ln(c.labelStyle.text,u);f=this.screenManager.addLabel(e,"VectorTile",c.labelStyle,{position:p,name:typeof v=="string"?d.properties[v]:Array.isArray(v)?v.map(w=>d.properties[w]).join(""):"",index:c.id+d.properties.osm_id}).screenObjectId}if(c.billboardStyle){const v=ln(c.billboardStyle.text,u);g=this.screenManager.addImage(e,"VectorTile",c.billboardStyle,{position:p,name:typeof v=="string"?d.properties[v]:Array.isArray(v)?v.map(w=>d.properties[w]).join(""):"",index:c.id+d.properties.osm_id}).screenObjectId}f&&!o.has(f)&&o.add(f),g&&!o.has(g)&&o.add(g)}}let r=this.renderedTiles.get(e);r||(r=new Map,this.renderedTiles.set(e,r)),r.set(n.tileKey,o)}update(e,n,o){var s;if(typeof n=="string"){const r=(s=this.renderedTiles.get(e))==null?void 0:s.get(n);r&&this.screenManager.update("VectorTile",e,r,{all:{show:o}})}else this.screenManager.update("VectorTile",e,n,{all:{show:o}})}remove(e,n){const o=this.renderedTiles.get(e);if(n){const s=o==null?void 0:o.get(n);s&&(this.screenManager.remove("VectorTile",e,s),o==null||o.delete(n),(o==null?void 0:o.size)===0&&this.renderedTiles.delete(e))}else{const s=o==null?void 0:o.values();if(s){const r=new Set([...s].flatMap(l=>[...l]));this.screenManager.remove("VectorTile",e,r,!0),this.renderedTiles.delete(e)}}}removeAll(){const e=this.renderedTiles.keys();for(const n of e)this.remove(n)}}const HL=new h.Cartesian2;class $L extends a.Destroyable{constructor(){super();m(this,"defaultStyle",new Map);m(this,"defaultSprite",new Map)}async add(e){var o;if(typeof e.mvtLayerJson.mainJson!="string"&&((o=e.mvtLayerJson.mainJson)!=null&&o.sprite)){const s=e.mvtLayerJson.mainJson.sprite;let r=await h.Resource.fetchJson({url:s+".json"});r=await qL(s+".png",r),r&&this.defaultSprite.set(e.sceneObject.id,[s+".png",r])}const n=e.mvtLayerJson.pointJson;for(const s of n)this.setDefaultStyle(e.sceneObject.id,this.getStyleFromMVTLayers(e.sceneObject.id,s))}remove(e){this.defaultStyle.delete(e.sceneObject.id)}setDefaultStyle(e,n){let o=this.defaultStyle.get(e);o||(o=new Set,this.defaultStyle.set(e,o)),o.add(n)}getStyle(e){return this.defaultStyle.get(e)??new Set}getStyleFromMVTLayers(e,n){const o={id:n.id,type:n.type,source:n.source,"source-layer":n["source-layer"],labelStyle:void 0,billboardStyle:void 0,polygonStyle:void 0,polylineStyle:void 0};if(Reflect.has(n,"minzoom")&&(o.minzoom=n.minzoom),Reflect.has(n,"maxzoom")&&(o.maxzoom=n.maxzoom),Reflect.has(n,"type")&&n.type==="symbol"&&Reflect.has(n,"layout")){const s=n.layout;if(Reflect.has(s,"icon-image")){const r=o.billboardStyle={},l=this.defaultSprite.get(e);l&&l[1][s["icon-image"]]?(r.image=l[0],r.imageSubRegion=new h.BoundingRectangle(l[1][s["icon-image"]].x,l[1][s["icon-image"]].y,l[1][s["icon-image"]].width,l[1][s["icon-image"]].height)):r.image=s["icon-image"];const{horizontalOrigin:c,verticalOrigin:u}=qC(s["icon-anchor"]??"center");if(r.horizontalOrigin=c,r.verticalOrigin=u,Reflect.has(n,"paint")){const d=n.paint;r.color=h.Color.fromCssColorString(d["icon-color"]??"#000000").withAlpha(d["icon-opacity"]??1)}r.rotation=h.Math.toRadians(s["icon-rotate"]??0),r.scale=s["icon-size"]??1,r.pixelOffset=h.Cartesian2.multiplyByScalar(h.Cartesian2.fromArray(s["icon-offset"]??[0,0]),r.scale,HL),r.show=(s.visibility??"visible")==="visible"}if(Reflect.has(s,"text-field")){const r=o.labelStyle={};r.text=s["text-field"];const{horizontalOrigin:l,verticalOrigin:c}=qC(s["text-anchor"]??"center");if(r.horizontalOrigin=l,r.verticalOrigin=c,Reflect.has(n,"paint")){const d=n.paint;r.fillColor=h.Color.fromCssColorString(d["text-color"]??"#000000").withAlpha(d["text-opacity"]??1),d["text-halo-color"]&&(r.outlineColor=h.Color.fromCssColorString(d["text-halo-color"])),d["text-halo-width"]&&(r.outlineWidth=d["text-halo-width"]),(d["text-halo-color"]||d["text-halo-width"])&&(r.style=h.LabelStyle.FILL_AND_OUTLINE)}const u=s["text-font"]?typeof s["text-font"]=="string"?[s["text-font"]]:s["text-font"]:["Open Sans Regular","Arial Unicode MS Regular"];r.font=`${s["text-size"]??16}px `+u.map(d=>`"${d}"`).join(", "),r.pixelOffset=XL(s),r.show=(s.visibility??"visible")==="visible"}}return o}}function qC(t){let i=h.HorizontalOrigin.CENTER,e=h.VerticalOrigin.CENTER;switch(t){case"center":break;case"left":i=h.HorizontalOrigin.LEFT;break;case"right":i=h.HorizontalOrigin.RIGHT;break;case"top":e=h.VerticalOrigin.TOP;break;case"bottom":e=h.VerticalOrigin.BOTTOM;break;case"top-left":i=h.HorizontalOrigin.LEFT,e=h.VerticalOrigin.TOP;break;case"top-right":i=h.HorizontalOrigin.RIGHT,e=h.VerticalOrigin.TOP;break;case"bottom-left":i=h.HorizontalOrigin.LEFT,e=h.VerticalOrigin.BOTTOM;break;case"bottom-right":i=h.HorizontalOrigin.RIGHT,e=h.VerticalOrigin.BOTTOM;break}return{horizontalOrigin:i,verticalOrigin:e}}async function qL(t,i){const{width:e,height:n}=await Pn(t,!1),o={};for(const s in i)if(Object.prototype.hasOwnProperty.call(i,s)){const r=i[s];o[s]={width:r.width,height:r.height,x:r.x,y:n-r.y-r.height,pixelRatio:r.pixelRatio}}return o}function XL(t){const i=t["text-offset"]||[0,0],e=t["text-size"]||16;return new h.Cartesian2(i[0]*e,i[1]*e)}class YL extends a.Destroyable{constructor(){super();m(this,"callbacks",new Map)}registerEvent(e,n,o){var r;const s=`${e}-${n}`;this.callbacks.has(s)||this.callbacks.set(s,new Set),(r=this.callbacks.get(s))==null||r.add(o)}dispatchEvent(e){var o;const n=`${e.tileKey}-${e.type}`;(o=this.callbacks.get(n))==null||o.forEach(s=>s(e.data))}}var ar=(t=>(t[t.UNLOADED=0]="UNLOADED",t[t.LOADING=1]="LOADING",t[t.PROCESSING=2]="PROCESSING",t[t.READY=3]="READY",t[t.EXPIRED=4]="EXPIRED",t[t.FAILED=5]="FAILED",t))(ar||{});class ZL extends a.Destroyable{constructor(e){super();m(this,"czmESMVTLayers",new Map);m(this,"tilesCache",new BL);m(this,"tileLoader",new GL(this.tilesCache));m(this,"tileRenderer");m(this,"styleManager",new $L);m(this,"eventManager",new YL);m(this,"lastImageryTileMap",new Map);this.viewer=e;const n=Ke(e);n&&(this.tileRenderer=new UL(n.screenManager,this.styleManager)),this.ad(this.tilesCache.deleteTileEvent.don((r,l)=>{this.tileRenderer.remove(r,l)}));let o=performance.now();const s=e.scene.preUpdate.addEventListener(()=>{const r=performance.now();r-o>60&&(o=r,this.czmESMVTLayers.size>0&&this.refreshVisibleTiles())});this.ad(()=>s&&s())}async add(e){if(this.czmESMVTLayers.has(e.sceneObject.id)){console.log(`ESMVTLayer${e.sceneObject.id}已经添加过,跳过本次添加`);return}this.czmESMVTLayers.set(e.sceneObject.id,e),this.tileLoader.add(e),await this.styleManager.add(e),this.refreshVisibleTiles(!0)}remove(e){this.czmESMVTLayers.delete(e.sceneObject.id),this.tileLoader.remove(e),this.styleManager.remove(e),this.tilesCache.remove(e)}refreshVisibleTiles(e){const n=this.viewer;if(!n)return;const o=new Map;for(const[s,r]of this.czmESMVTLayers.entries()){if(!r)continue;const l={tilingScheme:{type:"WebMercatorTilingScheme"},rectangle:r.sceneObject.rectangle,tileHeight:r.sceneObject.tileSize,tileWidth:r.sceneObject.tileSize,maximumLevel:r.sceneObject.maximumLevel,minimumLevel:r.sceneObject.minimumLevel},c=new Set;wm(n.scene.globe._surface._tilesToRender,n.scene.terrainProvider,l).forEach(u=>c.add(`${u.level}-${u.x}-${u.y}`)),!o.has(s)&&o.set(s,c)}this.updateTiles(o,e)}updateTiles(e,n){var o,s;for(const r of this.czmESMVTLayers.keys()){const l=e.get(r)??new Set,c=this.lastImageryTileMap.get(r);if(c&&QL(l,c)&&!n)continue;this.lastImageryTileMap.set(r,l);const u=new Set(((o=this.tilesCache.get(r))==null?void 0:o.keys())??[]),d=new Set,p=new Set;for(const f of u){const g=(s=this.tileRenderer.renderedTiles.get(r))==null?void 0:s.get(f);if(!(!g||g.size==0))if(l.has(f))for(const v of g)d.add(v);else for(const v of g)p.add(v)}for(const f of d)p.delete(f);this.tileRenderer.update(r,p,!1),this.tileRenderer.update(r,d,!0);for(const f of l)u.has(f)||(this.tilesCache.set(r,f,new $C(f)),this.tileLoader.fetchTile(r,f).then(g=>{!g||!this.tilesCache.has(r,f)||(this.tilesCache.set(r,f,g),g.fillParentAndChildren(this.tilesCache.get(r)??new Map),this.tileRenderer.renderTile(r,g))}))}}}function QL(t,i){if(t.size!==i.size)return!1;for(const e of t)if(!i.has(e))return!1;return!0}new h.WebMercatorTilingScheme;const XC=["label","billboard","rectangle"];class kL extends a.Destroyable{constructor(e,n){super();m(this,"id",a.createGuid());m(this,"position",h.Cartesian3.ZERO);m(this,"label");m(this,"billboard");m(this,"rectangle");m(this,"zOrder");m(this,"labelRefCount",1);m(this,"billboardRefCount",1);m(this,"rectangleRefCount",1);m(this,"_showEvent",this.disposeVar(new a.Event));this.id=e,this.position=n,this.ad(this.showEvent.don(o=>{this.updateShow(o)}))}get showEvent(){return this._showEvent}show(e){this._showEvent.emit(e)}updateShow(e){this.label&&(this.label.show=e),this.billboard&&(this.billboard.show=e)}}class KL extends a.Destroyable{constructor(e){super();m(this,"objects",new Map);m(this,"screenManager");m(this,"czmViewer");m(this,"viewer");this.screenManager=e,this.czmViewer=e.czmViewer,this.viewer=e.viewer,this.ad(()=>{this.objects.clear()})}layerIsEffective(){return this.objects.size>0}addLabel(e,n,o){const s=this.makeScreenObjectId(e,o.index??a.createGuid()),r=Se(o.position),l=this.getOrCreateObject(s,r);if(this.screenManager.avoidanceManager.enable&&(n.show=!1),l.label)return l.labelRefCount++,l.label.show=n.show??!0,s;const c=this.screenManager.labelCollection.get({...n,position:r,id:o.properties??s,text:o.name});return c.ESSceneObjectID=e,l.label=c,l.zOrder=o.zOrder,s}addImage(e,n,o){const s=this.makeScreenObjectId(e,o.index??a.createGuid()),r=Se(o.position),l=this.getOrCreateObject(s,r);if(this.screenManager.avoidanceManager.enable&&(n.show=!1),l.billboard)return l.billboardRefCount++,l.billboard.show=n.show??!0,s;const c=this.screenManager.billboardCollection.get({...n,position:r,id:o.properties??s});return c.ESSceneObjectID=e,l.billboard=c,l.zOrder=o.zOrder,s}addRectangle(e,n,o,s){const r=this.makeScreenObjectId(e,o.index??a.createGuid()),l=Se(o.position),c=this.getOrCreateObject(r,l);if(this.screenManager.avoidanceManager.enable&&(n.show=!1),c.rectangle)return c.rectangleRefCount++,r;const u=this.screenManager.rectangleCollection.add({...a.getElementBounds(n.element),...n,id:o.properties??r,position:l,callback:s});return s(!0),c.rectangle=u,c.zOrder=o.zOrder,r}update(e,n){const o=Object.keys(n).length==1&&n.all&&Object.keys(n.all).length==1&&Reflect.has(n.all,"show"),s=new Map;for(const c of XC)s.set(c,Object.assign({},n[c],(n==null?void 0:n.all)??{}));const r=this.screenManager.avoidanceManager.enable,l=e instanceof Set?e:new Set([e]);for(const[c,u]of s)for(const d of l){const p=this.objects.get(d);if(!p)continue;const f=p[c];if(f){if(o){if(r&&u.show||f.show==u.show)continue;f.show=u.show;continue}for(const g in u)if(g!=="position"&&g!=="id"){if(r&&g=="show"&&u[g]||f[g]==u[g])continue;f[g]=u[g]}}}return!0}remove(e,n=!1){const o=e instanceof Set?e:typeof e=="string"?new Set([e]):e;if(o instanceof Set){for(const s of o){const r=this.objects.get(s);r&&(r.label&&(r.labelRefCount>1&&!n?r.labelRefCount--:(this.screenManager.labelCollection.release(r.label),r.label=void 0)),r.billboard&&(r.billboardRefCount>1&&!n?r.billboardRefCount--:(this.screenManager.billboardCollection.release(r.billboard),r.billboard=void 0)),r.rectangle&&(r.rectangleRefCount>1&&!n?r.rectangleRefCount--:(this.screenManager.rectangleCollection.remove(r.rectangle),r.rectangle=void 0)),this.tryDeleteEmpty(s))}return!0}else{for(const s of Object.keys(o)){const r=o[s]instanceof Set?o[s]:new Set([o[s]]);for(const l of r){if(!l)continue;const c=this.objects.get(l);if(c){if(c[`${s}RefCount`]>1&&!n)c[`${s}RefCount`]--;else{const u=c[s];u&&(this.screenManager.collectionMap[s].remove(u),c[s]=void 0)}this.tryDeleteEmpty(l)}}}return!0}}makeScreenObjectId(e,n){return`${e}_${n}`}getOrCreateObject(e,n){let o=this.objects.get(e);return o||(o=new kL(e,n),this.objects.set(e,o)),o}tryDeleteEmpty(e){const n=this.objects.get(e);n&&!n.label&&!n.billboard&&!n.rectangle&&this.objects.delete(e)}}function JL(t,i){const e=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER];for(const n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&XC.includes(n)){const o=i[n];if(!o)continue;let s,r,l,c;if(o instanceof h.Label||o instanceof h.Billboard){const u=o.computeScreenSpacePosition(t.scene);({x:s,y:r,width:l,height:c}=h[o instanceof h.Label?"Label":"Billboard"].getScreenSpaceBoundingBox(o,u))}else({x:s,y:r,width:l,height:c}=o);if(isNaN(s)||isNaN(r)||isNaN(l)||isNaN(c))continue;e[0]=Math.min(e[0],s),e[1]=Math.min(e[1],r),e[2]=Math.max(e[2],s+l),e[3]=Math.max(e[3],r+c)}return new h.Rectangle(...e)}class jL extends a.Destroyable{constructor(e){super();m(this,"rectangleCollisionCheck",new h.RectangleCollisionChecker);m(this,"screenManager");m(this,"enable",!1);m(this,"forceRebuildNext",!1);m(this,"avoidanceLayers",[]);m(this,"_processingQueue",[]);m(this,"_isProcessing",!1);m(this,"BATCH_SIZE",1e3);m(this,"_cache",new Map);m(this,"_lastCameraState",{});m(this,"CAMERA_MOVE_THRESHOLD",5e-4);this.screenManager=e,this.ad(()=>{this.rectangleCollisionCheck._tree.clear(),this._cache.clear(),this._processingQueue.length=0})}update(){if(this.avoidanceLayers.length==0)return;const e=this._shouldForceRebuild();this._buildProcessingQueue(e),this._isProcessing||(this._isProcessing=!0,requestAnimationFrame(()=>this._processBatch()))}setAvoidanceLayer(){for(let e=0;e<this.avoidanceLayers.length;e++){const n=this.screenManager.getLayer(this.avoidanceLayers[e]);n.layerIsEffective()&&n.objects.forEach((o,s)=>{o.show(!this.enable)})}this.forceRebuildNext=!0}updateAvoidanceLayer(e,n){this.enable=(e==null?void 0:e.enabled)??!1,n?e!=null&&e.enabled?this.avoidanceLayers.includes(n)||this.avoidanceLayers.push(n):this.avoidanceLayers=this.avoidanceLayers.filter(o=>o!=n):e!=null&&e.enabled?this.avoidanceLayers=Array.from(this.screenManager.layers.keys()):(this.setAvoidanceLayer(),this.avoidanceLayers=[]),this.setAvoidanceLayer()}_shouldForceRebuild(){if(this.forceRebuildNext)return this.forceRebuildNext=!1,this._updateLastCameraState(),!0;const e=this.screenManager.viewer.camera,n=e.positionWC,o=e.directionWC,s=this._lastCameraState.position,r=this._lastCameraState.direction;if(!s||!r)return this._updateLastCameraState(),!0;const l=h.Cartesian3.distanceSquared(n,s),c=h.Cartesian3.distanceSquared(o,r);return l>this.CAMERA_MOVE_THRESHOLD||c>this.CAMERA_MOVE_THRESHOLD?(this._updateLastCameraState(),!0):!1}_updateLastCameraState(){const e=this.screenManager.viewer.camera;this._lastCameraState.position=h.Cartesian3.clone(e.positionWC),this._lastCameraState.direction=h.Cartesian3.clone(e.directionWC)}_buildProcessingQueue(e){e&&(this.rectangleCollisionCheck._tree.clear(),this._cache.clear()),this._processingQueue.length=0;for(let n=0;n<this.avoidanceLayers.length;n++){const o=this.screenManager.getLayer(this.avoidanceLayers[n]);o.layerIsEffective()&&o.objects.forEach((s,r)=>{this._processingQueue.push(s)})}this._processingQueue.sort((n,o)=>(o.zOrder||0)-(n.zOrder||0))}_processBatch(){performance.now();const e=this._processingQueue,n=this.BATCH_SIZE;let o=0;for(;e.length>0&&o<n;){const s=e.shift();this._updateSingleObject(s),o++}e.length>0?requestAnimationFrame(()=>this._processBatch()):this._isProcessing=!1}_updateSingleObject(e){try{if(!this.screenManager.czmViewer.isPointVisible(e.position)){e.show(!1),this._cache.has(e.id.toString())&&this._cache.delete(e.id.toString());return}const n=e.id.toString(),o=this._cache.get(n),s=h.Cartesian3.clone(e.position);let r;if(o&&h.Cartesian3.equalsEpsilon(o.worldPos,s,1e-6))r=o.rect,this.rectangleCollisionCheck.remove(n,r);else{if(r=JL(this.screenManager.viewer,e),isNaN(r.width)||isNaN(r.height)){e.show(!1),this._cache.has(e.id.toString())&&this._cache.delete(e.id.toString());return}this._cache.set(n,{rect:r,worldPos:s,lastFrame:Date.now()})}this.rectangleCollisionCheck.collides(r)?e.show(!1):(e.show(!0),this.rectangleCollisionCheck.insert(e.id.toString(),r))}catch(n){console.error("ScreenManager update object error",n)}}}class YC extends a.Destroyable{constructor(){super();m(this,"_collection",[]);this.ad(()=>this._collection=[])}get length(){return this._collection.length}add(e){return this._collection.push(e),e._index=this._collection.length,e}remove(e){this._collection[e._index]=void 0}}class ZC extends a.Destroyable{constructor(e,n=500,o={minPoolRatio:.1}){super();m(this,"_pool",[]);m(this,"_minPoolRatio");m(this,"_initialSize");this._collection=e,this._initialSize=n,this._minPoolRatio=o.minPoolRatio??.1;for(let s=0;s<n;s++){const r=this._collection.add({show:!1,position:new h.Cartesian3(0,0,0)});this._pool.push(r)}this.ad(()=>{for(const s of this._pool)this.removeFromCollection(s);this._pool.length=0})}get(e,n){if(typeof e=="number"){const o=e,s=n,r=[];for(let l=0;l<o;l++){const c=this._getOne();this.update(c,s),r.push(c)}return r}else{const o=this._getOne();return this.update(o,e),o}}release(e){if(Array.isArray(e))for(const n of e)n.show=!1,this._pool.push(n);else e.show=!1,this._pool.push(e);this._dynamicRecycle()}update(e,n){if(n){Object.assign(e,n);for(const o in n)if(Object.prototype.hasOwnProperty.call(n,o)){const s=n[o];Reflect.has(e,o)&&(e[o]=s)}Reflect.has(e,"imageSubRegion")&&e.setImageSubRegion(n.image,n.imageSubRegion)}}get available(){return this._pool.length}removeFromCollection(e){this._collection instanceof h.LabelCollection?this._collection.remove(e):this._collection instanceof h.BillboardCollection&&this._collection.remove(e)}_getOne(){if(this._pool.length>0)return this._pool.pop();{const e=this._collection.add({show:!1,position:new h.Cartesian3(0,0,0)});return this._dynamicRecycle(),e}}_dynamicRecycle(){const e=this._collection.length,n=Math.max(this._initialSize,Math.floor(e*this._minPoolRatio));for(;this._pool.length>n;){const o=this._pool.pop();this.removeFromCollection(o)}}}class QC extends a.Destroyable{constructor(e){super();m(this,"layers",new Map);m(this,"czmViewer");m(this,"viewer");m(this,"avoidanceManager");m(this,"labelCollection");m(this,"billboardCollection");m(this,"rectangleCollection",this.ad(new YC));m(this,"canvasCollection",this.ad(new YC));m(this,"collectionMap");m(this,"_refreshEvent",this.ad(new a.Event));this.czmViewer=e,this.viewer=e.viewer,this.avoidanceManager=this.ad(new jL(this));const n=new h.LabelCollection({scene:this.viewer.scene}),o=new h.BillboardCollection({scene:this.viewer.scene});this.labelCollection=new ZC(n,500),this.billboardCollection=new ZC(o,500),this.viewer.scene.primitives.add(n),this.viewer.scene.primitives.add(o),this.collectionMap={label:n,billboard:o,rectangle:this.rectangleCollection},this.ad(a.createEventsCallFunc([this.czmViewer.cameraChanged,this.refreshEvent],()=>{this.avoidanceManager.update()},{immediate:!0})),this.ad(()=>{this.layers.forEach(s=>s.destroy()),this.layers.clear(),n.removeAll(),o.removeAll(),this.viewer.scene.primitives.remove(n),this.viewer.scene.primitives.remove(o)})}get refreshEvent(){return this._refreshEvent}refresh(){this._refreshEvent.emit()}getLayer(e){let n=this.layers.get(e);return n||(n=new KL(this),this.layers.set(e,n),this.avoidanceManager.enable&&this.avoidanceManager.updateAvoidanceLayer({enabled:!0})),n}addLabel(e,n,o,s){const l=this.getLayer(n).addLabel(e,o,s);return this.refresh(),{layer:n,id:e,screenObjectId:l}}addImage(e,n,o,s){const l=this.getLayer(n).addImage(e,o,s);return this.refresh(),{layer:n,id:e,screenObjectId:l}}addRectangle(e,n,o,s,r){const c=this.getLayer(n).addRectangle(e,o,s,r);return this.refresh(),{layer:n,id:e,screenObjectId:c}}update(e,n,o,s){const r=this.getLayer(e);return o instanceof Set&&o.size===0?!1:(r.update(o,s),this.refresh(),!0)}remove(e,n,o,s=!1){const r=this.getLayer(e);if(!r.remove(o,s)){console.warn(`屏幕管理器,删除${n}下的内容失败!`);return}!r.layerIsEffective()&&!r.isDestroyed()&&(r.destroy(),this.layers.delete(e)),this.refresh()}setRules(e,n){Reflect.has(e,"avoidance")&&this.avoidanceManager.updateAvoidanceLayer(e.avoidance,n),this.refresh()}}function Ke(t){return a.getExtProp(t,"_viewerExtensions")}function Ig(t,i){a.setExtProp(t,"_viewerExtensions",i)}class kC extends a.Destroyable{constructor(e,n){super();m(this,"_imageriesManager");m(this,"_terrainManager");m(this,"_labelManager");m(this,"_pickingManager");m(this,"_poiContext");m(this,"_cursorPositionInfo");m(this,"_screenManager");m(this,"_vectorTIlesManager");this._viewer=e,this._czmViewer=n,this._imageriesManager=this.dv(new UC(this.viewer)),this._terrainManager=this.dv(new WC(this.viewer)),this._labelManager=this.dv(new GC(this.viewer)),this._poiContext=this.disposeVar(new zm(this._viewer)),this._cursorPositionInfo=this.disposeVar(new OL(this._viewer)),this.ad(n.viewerChanged.don(()=>{this._pickingManager=this.dv(new HC(n)),this._screenManager=this.ad(new QC(n)),this._vectorTIlesManager=this.ad(new ZL(n.viewer)),this.ad(a.createEventsCallFunc(this.czmViewer.textAvoidanceChanged,()=>{this.screenManager.setRules({avoidance:{enabled:this.czmViewer.textAvoidance}})},{immediate:!0}))},void 0,!0))}get viewer(){return this._viewer}get czmViewer(){return this._czmViewer}get imageriesManager(){return this._imageriesManager}get terrainManager(){return this._terrainManager}get labelManager(){return this._labelManager}get pickingManager(){return this._pickingManager}get poiContext(){return this._poiContext}get cursorPositionInfo(){return this._cursorPositionInfo}get screenManager(){return this._screenManager}get vectorTIlesManager(){return this._vectorTIlesManager}}var KC=new h.Cartesian3,JC=new h.Cartesian3;function jC(t,i,e){let n=h.Matrix4.clone(t.transform);t.lookAtTransform(h.Matrix4.IDENTITY);var o=t.positionCartographic.height,s=t.positionWC,r=h.Cartesian3.normalize(s,KC),l=h.Cartesian3.dot(t.direction,r);if(l>-.9&&l<.9)var c=h.Cartesian3.cross(t.direction,r,JC);else var c=h.Cartesian3.cross(t.up,r,JC);var u=c;if(e){var d=h.Cartesian3.cross(r,c,KC);u=d}var p=h.Cartesian3.magnitude(s);t.rotate(u,i/p);var f=t.positionCartographic,g=f.longitude,v=f.latitude;h.Cartesian3.fromRadians(g,v,o,void 0,t.position),t.lookAtTransform(n)}function e_(t,i){jC(t,i,!1)}function t_(t,i){jC(t,-i,!0)}class eN extends a.Destroyable{constructor(e){super();m(this,"_actions",{MoveForward:!1,MoveBackword:!1,MoveLeft:!1,MoveRight:!1});this._running=e;const{controller:n}=this,{viewer:o}=n.firstPersonController,{camera:s}=o;this.dispose(this.running.keyStatus.currentKeyIdsChanged.disposableOn(()=>{this._updateActions()})),this.dispose(this.controller.keyDownEvent.disposableOn(r=>{const{keyStatusMap:l}=this.running.keyboardCameraController;l[r.code]==="SpeedUp"?this.controller.speed=this.controller.speed*2:l[r.code]==="SpeedDown"&&(this.controller.speed=this.controller.speed*.5)})),this.dispose(this.controller.keyDownEvent.disposableOn(r=>{const{keyStatusMap:l}=this.running.keyboardCameraController;l[r.code]==="SwitchAlwaysWithCamera"&&(this.controller.alwaysWithCamera=!this.controller.alwaysWithCamera)}));{const{actions:r}=this;let l=Date.now();const c=()=>{const u=Date.now(),d=u-l;l=u;const p=this.controller.speed;r.WithCamera||this.controller.alwaysWithCamera?(r.MoveForward&&s.moveForward(d*p),r.MoveBackword&&s.moveBackward(d*p),r.MoveLeft&&s.moveLeft(d*p),r.MoveRight&&s.moveRight(d*p)):(r.MoveForward&&e_(s,d*p),r.MoveBackword&&e_(s,-d*p),r.MoveLeft&&t_(s,-d*p),r.MoveRight&&t_(s,d*p));{const{rotateSpeed:f}=this.controller,g=h.Math.toRadians(f*d);r.RotateRight?s.lookRight(g):r.RotateLeft?s.lookRight(-g):r.RotateUp?s.lookDown(-g):r.RotateDown&&s.lookDown(g)}};o.scene.preUpdate.addEventListener(c),this.dispose(()=>o.scene.preUpdate.removeEventListener(c))}}get running(){return this._running}get controller(){return this.running.keyboardCameraController}get actions(){return this._actions}_resetActions(){const e=Object.keys(this._actions);for(let n of e)this._actions[n]=!1}_updateActions(){const{running:e}=this,{keyStatus:n}=e,{actions:o}=this;this._resetActions();const{keyStatusMap:s}=this.running.keyboardCameraController;for(let r of n.currentKeyIds)o[s[r]]=!0}}class Xh extends a.Destroyable{constructor(e){super();m(this,"_currentKeyIds",new Set);m(this,"_currentKeyIdsChanged",this.dv(new a.Event));m(this,"_debug",this.dv(a.react(!1)));m(this,"_debugResetting",this.dv(new a.ObjResettingWithEvent(this.debugChanged,()=>{if(this.debug)return new class extends a.Destroyable{constructor(e){super();const n=()=>{console.log([...e.currentKeyIds].join(`
1996
1996
  `))};n(),this.d(e.currentKeyIdsChanged.don(n))}}(this)})));this._keyboardCameraControllerRunning=e;const{keyboardCameraController:n}=this._keyboardCameraControllerRunning;{const o=s=>{const r=Xh.getKeyId(s);this._currentKeyIds.has(r)||(this._currentKeyIds.add(r),this._currentKeyIdsChanged.emit())};this.d(n.keyDownEvent.don(o))}{const o=s=>{const r=Xh.getKeyId(s);this._currentKeyIds.has(r)&&(this._currentKeyIds.delete(r),this._currentKeyIdsChanged.emit())};this.d(n.keyUpEvent.don(o))}{const o=()=>{this._currentKeyIds.clear(),this._currentKeyIdsChanged.emit()};this.d(n.abortEvent.don(o))}}static getKeyId(e){return e.code}get currentKeyIds(){return this._currentKeyIds}get currentKeyIdsChanged(){return this._currentKeyIdsChanged}get debug(){return this._debug.value}set debug(e){this._debug.value=e}get debugChanged(){return this._debug.changed}}class tN extends a.Destroyable{constructor(e){super();m(this,"_keyStatus");m(this,"_cameraOp");this._keyboardCameraController=e,this._keyStatus=this.dv(new Xh(this)),this._cameraOp=this.dv(new eN(this))}get keyboardCameraController(){return this._keyboardCameraController}get keyStatus(){return this._keyStatus}get cameraOp(){return this._cameraOp}}const jh=class jh extends a.Destroyable{constructor(e){super();m(this,"_enabled",this.dv(a.react(!1)));m(this,"_keyStatusMap",this.dv(a.react(jh.defaultKeyStatusMap)));m(this,"_speed",this.dv(a.react(1)));m(this,"_rotateSpeed",this.dv(a.react(.01)));m(this,"_alwaysWithCamera",this.dv(a.react(!1)));m(this,"_keyDownEvent",this.dv(new a.Event));m(this,"_keyUpEvent",this.dv(new a.Event));m(this,"_abortEvent",this.dv(new a.Event));this._firstPersonController=e,this.dv(new a.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new tN(this)}))}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get keyStatusMap(){return this._keyStatusMap.value}set keyStatusMap(e){this._keyStatusMap.value=e}get keyStatusMapChanged(){return this._keyStatusMap.changed}get speed(){return this._speed.value}set speed(e){this._speed.value=e}get speedChanged(){return this._speed.changed}get rotateSpeed(){return this._rotateSpeed.value}set rotateSpeed(e){this._rotateSpeed.value=e}get rotateSpeedChanged(){return this._rotateSpeed.changed}get alwaysWithCamera(){return this._alwaysWithCamera.value}set alwaysWithCamera(e){this._alwaysWithCamera.value=e}get alwaysWithCameraChanged(){return this._alwaysWithCamera.changed}get keyDownEvent(){return this._keyDownEvent}keyDown(e){this._keyDownEvent.emit(e)}get keyUpEvent(){return this._keyUpEvent}keyUp(e){this._keyUpEvent.emit(e)}get abortEvent(){return this._abortEvent}abort(){this._abortEvent.emit()}};m(jh,"defaultKeyStatusMap",{ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"MoveLeft",ArrowRight:"MoveRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"});let Yh=jh;function iN(t,i){t.lookRight(h.Math.toRadians(i.movementX)*.1),t.lookDown(h.Math.toRadians(i.movementY)*.1);const e=t.pitch,n=h.Math.clamp(e,-h.Math.PI_OVER_TWO,h.Math.PI_OVER_TWO);n!==e&&t.setView({destination:t.positionWC,orientation:{heading:t.heading,pitch:n,roll:t.roll}})}class nN extends a.Destroyable{constructor(i,e){super(),this._firstPersonController=i,this._mouseCameraController=e;const{canvas:n}=this._firstPersonController.viewer;{const o=s=>{const{camera:r}=this._firstPersonController.viewer.scene;iN(r,s)};n.addEventListener("pointermove",o),this.dispose(()=>n.removeEventListener("pointermove",o))}}}const eu=class eu extends a.Destroyable{constructor(e){super();m(this,"_mouseMoving",this.dv(new nN(this.firstPersonController,this.mouseCameraController)));this._mouseCameraController=e;const{viewer:n}=this.firstPersonController;this.mouseCameraController.enableViewerOriginInputs(!1),this.dispose(()=>this.mouseCameraController.enableViewerOriginInputs(!0)),Element.prototype.setPointerCapture=()=>{},this.dispose(()=>Element.prototype.setPointerCapture=eu.origin_setPointerCapture);const o=n.canvas;o.requestPointerLock(),this.dispose(()=>document.exitPointerLock());{const s=()=>{document.pointerLockElement!==o&&(this.firstPersonController.mouseEnabled=!1)};document.addEventListener("pointerlockchange",s,!1),this.dispose(()=>document.removeEventListener("pointerlockchange",s,!1))}{const s=()=>{this.firstPersonController.mouseEnabled=!1,console.log("Error locking pointer")};document.addEventListener("pointerlockerror",s)}}get mouseCameraController(){return this._mouseCameraController}get firstPersonController(){return this.mouseCameraController.firstPersonController}get mouseMoving(){return this._mouseMoving}};m(eu,"origin_setPointerCapture",Element.prototype.setPointerCapture);let Mg=eu;class oN extends a.Destroyable{constructor(e){super();m(this,"_enabled",this.dv(a.react(!1)));m(this,"enableViewerOriginInputs",e=>{e?this.firstPersonController.czmViewer.incrementDisabledInputStack():this.firstPersonController.czmViewer.decrementDisabledInputStack()});m(this,"_mouseResetting",this.dv(new a.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new Mg(this)})));this._firstPersonController=e}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get mouseResetting(){return this._mouseResetting}}class sN extends a.Destroyable{constructor(e){super();m(this,"viewer");m(this,"_mouseCameraController",this.dv(new oN(this)));m(this,"_keyboardCameraController",this.dv(new Yh(this)));if(this._viewer=e,!this._viewer.viewer)throw new Error("Cesium.Viewer不存在!");this.viewer=this._viewer.viewer}get czmViewer(){return this._viewer}get mouseCameraController(){return this._mouseCameraController}get mouseEnabled(){return this.mouseCameraController.enabled}set mouseEnabled(e){this.mouseCameraController.enabled=e}get mouseEnabledChanged(){return this.mouseCameraController.enabledChanged}get keyboardCameraController(){return this._keyboardCameraController}get keyboardEnabled(){return this.keyboardCameraController.enabled}set keyboardEnabled(e){this.keyboardCameraController.enabled=e}get keyboardEnabledChanged(){return this.keyboardCameraController.enabledChanged}}function i_(t){t.removeInputAction(h.ScreenSpaceEventType.LEFT_DOWN),t.removeInputAction(h.ScreenSpaceEventType.RIGHT_DOWN),t.removeInputAction(h.ScreenSpaceEventType.MIDDLE_DOWN),t.removeInputAction(h.ScreenSpaceEventType.MOUSE_MOVE),t.removeInputAction(h.ScreenSpaceEventType.LEFT_UP),t.removeInputAction(h.ScreenSpaceEventType.RIGHT_UP),t.removeInputAction(h.ScreenSpaceEventType.MIDDLE_UP)}function Dg(t,i,e,n=void 0){const s=t.camera,r=new h.Cartesian2;r.x=i.startPosition.x,r.y=0;const l=new h.Cartesian2;l.x=i.endPosition.x,l.y=0;let c=s.getPickRay(r,new h.Ray),u=s.getPickRay(l,new h.Ray),d=0,p,f;if(!c||!u)return;s.frustum instanceof h.OrthographicFrustum?(p=c.origin,f=u.origin,h.Cartesian3.add(s.direction,p,p),h.Cartesian3.add(s.direction,f,f),h.Cartesian3.subtract(p,s.position,p),h.Cartesian3.subtract(f,s.position,f),h.Cartesian3.normalize(p,p),h.Cartesian3.normalize(f,f)):(p=c.direction,f=u.direction);let g=h.Cartesian3.dot(p,f);g<1&&(d=Math.acos(g)),d=i.startPosition.x>i.endPosition.x?d:-d;const v=e._horizontalRotationAxis;if(h.defined(n)?s.look(n,-d):h.defined(v)?s.look(v,-d):s.lookLeft(d),r.x=0,r.y=i.startPosition.y,l.x=0,l.y=i.endPosition.y,c=s.getPickRay(r,new h.Ray),u=s.getPickRay(l,new h.Ray),d=0,!(!c||!u))if(s.frustum instanceof h.OrthographicFrustum?(p=c.origin,f=u.origin,h.Cartesian3.add(s.direction,p,p),h.Cartesian3.add(s.direction,f,f),h.Cartesian3.subtract(p,s.position,p),h.Cartesian3.subtract(f,s.position,f),h.Cartesian3.normalize(p,p),h.Cartesian3.normalize(f,f)):(p=c.direction,f=u.direction),g=h.Cartesian3.dot(p,f),g<1&&(d=Math.acos(g)),d=i.startPosition.y>i.endPosition.y?d:-d,n=n??v,h.defined(n)){const y=s.direction,w=h.Cartesian3.negate(n,new h.Cartesian3),P=h.Cartesian3.equalsEpsilon(y,n,h.Math.EPSILON2),C=h.Cartesian3.equalsEpsilon(y,w,h.Math.EPSILON2);if(!P&&!C){g=h.Cartesian3.dot(y,n);let S=h.Math.acosClamped(g);d>0&&d>S&&(d=S-h.Math.EPSILON4),g=h.Cartesian3.dot(y,w),S=h.Math.acosClamped(g),d<0&&-d>S&&(d=-S+h.Math.EPSILON4);const A=h.Cartesian3.cross(n,y,new h.Cartesian3);s.look(A,d)}else(P&&d<0||C&&d>0)&&s.look(s.right,-d)}else s.lookUp(d)}class rN extends a.Destroyable{constructor(i,e){super();const n=e.viewer;if(!n)throw new Error("viewer is undefined");let o=!0;this.d(i.positionChanged.don(()=>o=!0)),this.d(i.rotationChanged.don(()=>o=!0)),this.d(i.offsetHeightChanged.don(()=>o=!0)),this.d(i.viewDistanceChanged.don(()=>o=!0)),this.d(i.offsetRotationChanged.don(()=>o=!0)),this.d(i.relativeRotationChanged.don(()=>o=!0));const s=[0,0,0],r=[0,0,0];this.d(n.clock.onTick.addEventListener(()=>{if(!o)return;if(o=!1,!i.position){console.warn("相机控制器未能设置位置,无法启用!");return}if(i.viewDistance===void 0){console.warn("相机控制器未能设置视距,将自动设置视距!");const p=Se(i.position),f=n.camera.positionWC,g=h.Cartesian3.distance(p,f);i.viewDistance=g}a.Vector.clone(i.position,r),i.offsetHeight&&(r[2]+=i.offsetHeight);const{rotation:l,offsetRotation:c=Bi.defaults.offsetRotation}=i,u=[...c];a.Vector.set(s,0,0,0),l&&(i.relativeRotation??Bi.defaults.relativeRotation)&&(a.Vector.add(l,s,s),u[0]+=90),a.Vector.add(u,s,s);const d={distance:i.viewDistance,heading:s[0],pitch:s[1],flyDuration:0,hDelta:0,pDelta:0};e.flyTo(d,r)})),e.incrementDisabledInputStack(),this.d(()=>{e.decrementDisabledInputStack()}),this.d(e.pointerMoveEvent.don(l=>{const c=l==null?void 0:l.pointerEvent;if(c&&i.enabledRotationInput&&(c.buttons===1||c.buttons===2)){const{movementX:u,movementY:d}=c;i.offsetRotation=a.Vector.add(i.offsetRotation??Bi.defaults.offsetRotation,[u*.2,d*-.2,0])}})),this.d(e.wheelEvent.don(l=>{if(!i.enabledScaleInput)return;const c=l.deltaY,d=Math.max(1,i.viewDistance)*(c*.001);i.viewDistance=i.viewDistance+d}))}}class Bi extends a.Destroyable{constructor(e){super();m(this,"_resetWithCameraEvent",this.dv(new a.Event));const n=e.viewer;if(!n)throw new Error("viewer is undefined");const o=this;let s;const r=()=>{s&&(s.destroy(),s=void 0)};this.d(r);const l=()=>{r(),o.enabled&&(s=new rN(o,e))};l(),this.d(o.enabledChanged.don(l)),this.d(o.resetWithCameraEvent.don(c=>{if(!e.actived)return;const u=jo(n.camera);if(!u)return;const d=o.rotation;o.offsetRotation=[u[0]-(o.relativeRotation?d[0]:90),u[1]-(o.relativeRotation?d[1]:0),u[2]-(o.relativeRotation?d[2]:0)]}))}get resetWithCameraEvent(){return this._resetWithCameraEvent}resetWithCamera(e){this._resetWithCameraEvent.emit(e)}}m(Bi,"defaults",{position:[116.39,39.9,0],rotation:[0,0,0],offsetRotation:[0,-60,0],relativeRotation:!0}),(t=>{t.createDefaultProps=()=>({enabled:!1,showTarget:!1,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArrayWithUndefined(void 0),rotationEditing:!1,viewDistance:1e3,offsetHeight:0,offsetRotation:a.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,relativeRotation:!0})})(Bi||(Bi={})),a.extendClassProps(Bi.prototype,Bi.createDefaultProps);class ga extends a.Destroyable{constructor(e){super();m(this,"_geoCameraController");m(this,"_geoPolylinePath");this._geoCameraController=this.dv(new Bi(e)),this._geoPolylinePath=this.dv(new Ms(e)),this._geoPolylinePath.show=!1,this._geoPolylinePath.currentTime=0;const n=()=>{(this.usePathPosition??!0)&&(this._geoCameraController.position=this._geoPolylinePath.currentPosition),(this.usePathRotation??!0)&&(this._geoCameraController.rotation=this._geoPolylinePath.currentRotation)};n(),this.d(this._geoPolylinePath.currentPositionChanged.don(n)),this.d(this._geoPolylinePath.currentRotationChanged.don(n)),this.dispose(a.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dispose(a.bind([this._geoCameraController,"viewDistance"],[this,"viewDistance"])),this.dispose(a.bind([this._geoCameraController,"offsetHeight"],[this,"offsetHeight"])),this.dispose(a.bind([this._geoCameraController,"offsetRotation"],[this,"offsetRotation"])),this.dispose(a.track([this._geoCameraController,"enabledRotationInput"],[this,"enabledRotationInput"])),this.dispose(a.track([this._geoCameraController,"enabledScaleInput"],[this,"enabledScaleInput"])),this.dv(new a.ObjResettingWithEvent(this.lineModeChanged,()=>{if(this.lineMode!==void 0){if(this.lineMode==="auto")return new aN(this,e);if(this.lineMode==="manual")return new lN(this,e)}}))}get geoCameraController(){return this._geoCameraController}get polylinePath(){return this._geoPolylinePath}get position(){return this._geoCameraController.position}get positionChanged(){return this._geoCameraController.positionChanged}get rotation(){return this._geoCameraController.rotation}get roataionChanged(){return this._geoCameraController.rotationChanged}}(t=>{t.createDefaultProps=()=>({enabled:!1,usePathPosition:!0,usePathRotation:!0,viewDistance:1e3,offsetHeight:0,offsetRotation:a.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,lineMode:void 0})})(ga||(ga={})),a.extendClassProps(ga.prototype,ga.createDefaultProps);class aN extends a.Destroyable{constructor(i,e){if(super(),!e.viewer)throw new Error("viewer is undefined");i.offsetRotation=[-90,0,0]}}class lN extends a.Destroyable{constructor(i,e){if(super(),!e.viewer)throw new Error("viewer is undefined");const o=s=>{(s.key==="w"||s.key==="s")&&(i.polylinePath.playing=s.type==="keydown",i.polylinePath.speed=s.key==="w"||s.type==="keyup"?1:-1)};this.dispose(e.keyDownEvent.don(o)),this.dispose(e.keyUpEvent.don(o))}}class cN extends a.Destroyable{constructor(i,e){super();const n=e.positionPropertyName??"position",o=e.positionChangedPropertyName??n+"Changed",s=e.rotationPropertyName??"rotation",r=e.rotationChangedPropertyName??s+"Changed",l=(e.positionTracking??!0)&&Reflect.has(i,n)&&Reflect.has(i,o),c=(e.rotationTracking??!0)&&Reflect.has(i,s)&&Reflect.has(i,r);if(!(!l&&!c)){if(l){const u=()=>{e.geoCameraController.position=i[n]};u();const d=i[o];this.d(d.don(u))}if(c){const u=()=>{e.geoCameraController.rotation=i[s]};u();const d=i[o];this.d(d.don(u))}}}}class hN extends a.Destroyable{constructor(i,e){super();const n=this.dv(new a.ESSceneObjectWithId);n.id=i;const o=this.dv(a.createNextAnimateFrameEvent(e.enabledChanged,e.positionTrackingChanged,e.rotationTrackingChanged,e.positionPropertyNameChanged,e.positionChangedPropertyNameChanged,e.rotationPropertyNameChanged,e.rotationChangedPropertyNameChanged,n.sceneObjectChanged));this.disposeVar(new a.ObjResettingWithEvent(o,()=>{const{sceneObject:s}=n;if(!(!e.enabled||!s))return new cN(s,e)}))}}class ma extends a.Destroyable{constructor(e){super();m(this,"_geoCameraController");this._geoCameraController=this.dv(new Bi(e)),this.d(a.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dv(new a.ObjResettingWithEvent(this.sceneObjectIdChanged,()=>{if(this.sceneObjectId)return new hN(this.sceneObjectId,this)}))}get geoCameraController(){return this._geoCameraController}}(t=>{t.createDefaultProps=()=>({enabled:void 0,sceneObjectId:void 0,positionTracking:void 0,rotationTracking:void 0,positionPropertyName:void 0,positionChangedPropertyName:void 0,rotationPropertyName:void 0,rotationChangedPropertyName:void 0})})(ma||(ma={})),a.extendClassProps(ma.prototype,ma.createDefaultProps);class uN extends a.Destroyable{constructor(e){super();m(this,"height",1e7);m(this,"cycle",60);m(this,"latitude",38*3.1415926/18);m(this,"_running",!1);m(this,"_sseh");m(this,"_eventDisposer");m(this,"leftDownCancel",!0);this._viewer=e,this._sseh=this.dv(new h.ScreenSpaceEventHandler(this._viewer.canvas)),this._sseh.setInputAction(()=>{this.leftDownCancel&&this.cancel()},h.ScreenSpaceEventType.LEFT_DOWN),this.d(()=>{this.cancel()})}get viewer(){return this._viewer}get sseh(){return this._sseh}start(){if(this._running)return;const e=this._viewer.camera,n=e.positionCartographic;e.flyTo({destination:h.Cartesian3.fromRadians(n.longitude,this.latitude,this.height),orientation:{heading:0,pitch:-.5*h.Math.PI,roll:0},complete:()=>{this._running=!0;var o=void 0;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((s,r)=>{if(!o){o=new Date().getTime();return}const l=(new Date().getTime()-o)/1e3,c=e.positionCartographic.longitude+l*h.Math.PI*2/this.cycle;e.setView({destination:h.Cartesian3.fromRadians(c,this.latitude,this.height),orientation:{heading:0,pitch:-.5*h.Math.PI,roll:0}}),o=new Date().getTime()})},duration:.5})}cancel(){this._running&&(this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1)}}class dN extends a.Destroyable{constructor(e){super();m(this,"_height",this.dv(a.react(1e7)));m(this,"_cycle",this.dv(a.react(60)));m(this,"_latitude",this.dv(a.react(38)));m(this,"_inner");this._czmViewer=e;const n=this._czmViewer.viewer;if(!n)throw new Error("未初始化viewer");this._inner=this.dv(new uN(n)),this._inner.leftDownCancel=!1;{const o=()=>{this._inner.height=this.height,this._inner.cycle=this.cycle,this._inner.latitude=this.latitude*Math.PI/180};o(),this.d(this.heightChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.latitudeChanged.don(o))}}get height(){return this._height.value}set height(e){this._height.value=e}get heightChanged(){return this._height.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get latitude(){return this._latitude.value}set latitude(e){this._latitude.value=e}get latitudeChanged(){return this._latitude.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class pN extends a.Destroyable{constructor(e){super();m(this,"_position",this.dv(a.reactArrayWithUndefined(void 0)));m(this,"_distance",this.dv(a.react(5e4)));m(this,"_cycle",this.dv(a.react(60)));m(this,"_heading",this.dv(a.react(0)));m(this,"_pitch",this.dv(a.react(-30)));m(this,"_transform");m(this,"_headingRadius");m(this,"_pitchRadius");m(this,"_running",!1);m(this,"_sseh");m(this,"_eventDisposer");this._viewer=e;const n=this.viewer.scene,o=this.viewer.camera;this._sseh=this.dv(new h.ScreenSpaceEventHandler(this.viewer.canvas)),this.d(()=>{this.cancel()});{const s=()=>{let r;if(this.position==null){var l=o.getPickRay(new h.Cartesian2(n.canvas.width*.5,n.canvas.height*.5));if(!l)return;r=n.globe.pick(l,n)}else r=h.Cartesian3.fromDegrees(...this.position);r&&(this._transform=h.Transforms.eastNorthUpToFixedFrame(r),this.start())};s(),this.d(this.positionChanged.don(s))}{const s=()=>{this._headingRadius=h.Math.toRadians(this.heading)};s(),this.d(this.headingChanged.don(s))}{const s=()=>{this._pitchRadius=h.Math.toRadians(this.pitch)};s(),this.d(this.pitchChanged.don(s))}}get viewer(){return this._viewer}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get sseh(){return this._sseh}start(){if(this._running)return;const e=this.viewer.camera;e.lookAtTransform(this._transform);var n=this.distance*Math.sin(this._pitchRadius),o=this.distance*Math.cos(this._pitchRadius),s=new h.Cartesian3(0,n,o);e.flyTo({destination:h.Matrix4.multiplyByPoint(this._transform,s,new h.Cartesian3),orientation:{heading:this._headingRadius,pitch:this._pitchRadius,roll:0},endTransform:this._transform,complete:()=>{this._running=!0;let r;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((l,c)=>{if(!r){r=new Date().getTime();return}const u=(new Date().getTime()-r)/1e3;this._headingRadius+=u*h.Math.PI*2/this.cycle,e.lookAtTransform(this._transform,new h.HeadingPitchRange(this._headingRadius,this._pitchRadius,this.distance)),r=new Date().getTime()})},duration:.5,maximumHeight:e.positionCartographic.height})}cancel(){if(!this._running)return;this.viewer.camera.lookAtTransform(h.Matrix4.IDENTITY),this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1}}class fN extends a.Destroyable{constructor(e){super();m(this,"_position",this.dv(a.reactArrayWithUndefined(void 0)));m(this,"_distance",this.dv(a.react(5e4)));m(this,"_cycle",this.dv(a.react(60)));m(this,"_heading",this.dv(a.react(0)));m(this,"_pitch",this.dv(a.react(-30)));m(this,"_inner");this._czmViewer=e;const n=this._czmViewer.viewer;if(!n)throw new Error("viewer is undefined");this._inner=this.dv(new pN(n));{const o=()=>{this.inner.distance=this.distance,this.inner.cycle=this.cycle,this.inner.position=this.position,this.inner.heading=this.heading,this.inner.pitch=this.pitch};o(),this.d(this.distanceChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.positionChanged.don(o)),this.d(this.headingChanged.don(o)),this.d(this.pitchChanged.don(o))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class gN extends a.Destroyable{constructor(e){super();m(this,"_firstPersonController");m(this,"_rotateGlobe");m(this,"_rotatePoint");m(this,"_followController");m(this,"_pathCameraController");m(this,"_handler");this._viewer=e;{this._firstPersonController=this.dv(new sN(e)),this.d(this._viewer.keyDownEvent.don(n=>this._firstPersonController.keyboardCameraController.keyDown(n))),this.d(this._viewer.keyUpEvent.don(n=>this._firstPersonController.keyboardCameraController.keyUp(n)));{const{subContainer:n}=this._viewer;if(!n)throw new Error("_firstPersonControllerInit error!");const o=()=>this._firstPersonController.keyboardCameraController.abort();n.addEventListener("blur",o,!1),this.d(()=>n.removeEventListener("blur",o,!1))}this._firstPersonController.keyboardEnabled=!1,this._firstPersonController.mouseEnabled=!1,this._firstPersonController.keyboardCameraController.speed=.006,this._firstPersonController.keyboardCameraController.rotateSpeed=.05,this._firstPersonController.keyboardCameraController.alwaysWithCamera=!1,this._firstPersonController.keyboardCameraController.keyStatusMap=Yh.defaultKeyStatusMap,this.d(this._firstPersonController.keyboardEnabledChanged.don(()=>{var n;(n=this._viewer.subContainer)==null||n.focus()}))}this._rotateGlobe=this.dv(new dN(e)),this._rotatePoint=this.dv(new fN(e)),this._followController=this.dv(new ma(e)),this._pathCameraController=this.dv(new ga(e))}get firstPersonController(){return this._firstPersonController}get rotateGlobe(){return this._rotateGlobe}get rotatePoint(){return this._rotatePoint}get followController(){return this._followController}get pathCameraController(){return this._pathCameraController}resetNavigation(){this._firstPersonController.keyboardEnabled=!1,this._rotateGlobe.cancel(),this._rotatePoint.cancel(),this._followController.enabled=!1,this._followController.sceneObjectId=void 0,this._followController.geoCameraController.offsetRotation=[-90,0,0],this._followController.geoCameraController.viewDistance=0,this._pathCameraController.enabled=!1,this._pathCameraController.polylinePath.playing=!1,this._pathCameraController.polylinePath.currentTime=0,this._pathCameraController.polylinePath.loop=!1,this._pathCameraController.geoCameraController.offsetHeight=0,this._pathCameraController.polylinePath.positions=void 0,this._pathCameraController.lineMode=void 0}changeToMap(){this.resetNavigation(),this._changedMouseEvent("Map")}changeToWalk(e,n=4.2,o=1.6){this.resetNavigation();const s=this._viewer.navigationMode!="Walk";this._changedMouseEvent("Walk");const r=this._viewer.getCameraInfo(),l=[(r==null?void 0:r.rotation[0])??0,0,0];this._viewer.getHeightByLonLat(e[0],e[1]).then(c=>{s?this._viewer.flyIn([e[0],e[1],(c??0)+o],l):this._viewer.viewer&&(this._viewer.viewer.camera.position=h.Cartesian3.fromDegrees(e[0],e[1],(c??0)+o)),this.firstPersonController.keyboardEnabled=!0,this.firstPersonController.keyboardCameraController.speed=.006,this.firstPersonController.keyboardCameraController.rotateSpeed=.05,this.firstPersonController.keyboardCameraController.keyStatusMap={ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"RotateLeft",ArrowRight:"RotateRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"}})}changeToRotateGlobe(e=38,n=1e7,o=60){this.resetNavigation(),this._changedMouseEvent("RotateGlobe"),this._rotateGlobe.latitude=e,this._rotateGlobe.height=n,this._rotateGlobe.cycle=o,this._rotateGlobe.start()}changeToRotatePoint(e,n=5e4,o=60,s=0,r=-30){this.resetNavigation(),this._changedMouseEvent("RotatePoint"),this._rotatePoint.position=e,this._rotatePoint.distance=n,this._rotatePoint.cycle=o,this._rotatePoint.heading=s,this._rotatePoint.pitch=r,this._rotatePoint.start()}changeToFollow(e,n=0,o=0,s=-30,r=!0){this.resetNavigation(),this._changedMouseEvent("Follow"),this._followController.sceneObjectId=e,this._followController.geoCameraController.offsetRotation=[o,s,0],this._followController.geoCameraController.relativeRotation=r,n!==0?this._followController.geoCameraController.viewDistance=n:this._followController.geoCameraController.viewDistance=1e3,this._followController.enabled=!0}changeToLine(e,n=10,o=10,s=!0,r=10,l="auto"){this.resetNavigation(),this._changedMouseEvent("Line");const c=l==="auto",u=a.ESSceneObject.getSceneObjById(e);if(!u)return;const{points:d}=u;if(!d)return;const p=a.getDistancesFromPositions(d,"NONE"),f=p[p.length-1];this._pathCameraController.viewDistance=0,this._pathCameraController.polylinePath.positions=[...d],this._pathCameraController.polylinePath.duration=f/n*1e3,this._pathCameraController.polylinePath.loop=s,this._pathCameraController.offsetHeight=o;const g=pm(d);this._pathCameraController.polylinePath.rotationRadius=!c||g==!1?[0]:g.map(v=>v/r*n),this._pathCameraController.enabledRotationInput=!c,this._pathCameraController.enabledScaleInput=!1,this._pathCameraController.polylinePath.playing=c,this._pathCameraController.lineMode=l,this._pathCameraController.enabled=!0}_changedMouseEvent(e){const n=this._viewer.viewer;if(!n)return;this._handler||(this._handler=new h.ScreenSpaceEventHandler(n.scene.canvas));const o=this._handler,s=n.scene.screenSpaceCameraController;this.d(()=>{o&&i_(o)}),e=="Walk"||e=="RotateGlobe"?(s.lookEventTypes=void 0,s.rotateEventTypes=void 0,s.tiltEventTypes=void 0,s.zoomEventTypes=void 0,s.translateEventTypes=void 0,o&&e=="Walk"&&(o.setInputAction(r=>{o.setInputAction(l=>{Dg(n.scene,l,s)},h.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(l=>{o.removeInputAction(h.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(h.ScreenSpaceEventType.LEFT_UP)},h.ScreenSpaceEventType.LEFT_UP)},h.ScreenSpaceEventType.LEFT_DOWN),o.setInputAction(r=>{o.setInputAction(l=>{Dg(n.scene,l,s)},h.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(l=>{o.removeInputAction(h.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(h.ScreenSpaceEventType.RIGHT_UP)},h.ScreenSpaceEventType.RIGHT_UP)},h.ScreenSpaceEventType.RIGHT_DOWN),o.setInputAction(r=>{o.setInputAction(l=>{Dg(n.scene,l,s)},h.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(l=>{o.removeInputAction(h.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(h.ScreenSpaceEventType.MIDDLE_UP)},h.ScreenSpaceEventType.MIDDLE_UP)},h.ScreenSpaceEventType.MIDDLE_DOWN))):(o&&i_(o),s.lookEventTypes=h.CameraEventType.RIGHT_DRAG,s.rotateEventTypes=h.CameraEventType.LEFT_DRAG,s.tiltEventTypes=[h.CameraEventType.MIDDLE_DRAG,h.CameraEventType.PINCH,{eventType:h.CameraEventType.LEFT_DRAG,modifier:h.KeyboardEventModifier.CTRL},{eventType:h.CameraEventType.RIGHT_DRAG,modifier:h.KeyboardEventModifier.CTRL}],s.translateEventTypes=h.CameraEventType.LEFT_DRAG,s.zoomEventTypes=[h.CameraEventType.WHEEL,h.CameraEventType.PINCH,{eventType:h.CameraEventType.RIGHT_DRAG,modifier:h.KeyboardEventModifier.SHIFT}])}}const mN=[{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3558367297943,39.93163726456884,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30223283037274,39.92688664316035,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.43707387584969,39.922782714050356,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.27929428317248,39.895318074706246,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36181901056395,39.89720944386167,3553.618347252562]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.40050587550184,39.87565113086582,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.31629153797958,39.88888615917464,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.38662084727662,39.93026695192356,5222.983612030221]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.35985958294472,39.879559968940974,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30061281533665,39.86521469244785,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.33589491695909,39.85251691437225,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3978491755026,39.92191230041099,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.404556165088,39.901554635269065,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3371677114933,39.90666589456628,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30329238580244,39.90598342431921,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.25047545555285,39.927295935589235,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33129680063607,39.98205319015022,5500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.38241622722414,39.864780790627634,5800]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.24126681456984,39.85629130246847,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.4476299820832,39.9015287845667,5233.181711832771]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33116617802452,39.824241891065384,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.15206905891218,39.90872966468676,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.24197212869294,39.88630968655299,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.43381133281572,39.96058832885812,5700]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.21635435523064,39.966450178376924,7e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.17908072725879,39.87211951629164,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.32516866705241,39.94534681561764,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36086721251684,39.948381883306446,3400]}];class vN extends a.Destroyable{constructor(e){super();m(this,"_show",this.dv(a.react(!1)));m(this,"cloudsPostProcess");const n=e.viewer;if(!n)throw new Error("Cesium Viewer is not initialized");const o=new h.CloudCollection;n.scene.primitives.add(o),this.dispose(()=>n.scene.primitives.remove(o));{const s=()=>{o.show=this.show};s(),this.dispose(this.showChanged.disposableOn(s))}{const s=l=>({slice:l.slice,brightness:l.brightness,scale:Pe(l.scale),maximumSize:hi(l.maximumSize),color:te(l.color),position:Se(l.position)});(()=>{o.removeAll();for(let l of mN)o.add(s(l))})()}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}class va extends a.Destroyable{constructor(i){super();const e=i.viewer;if(!e){console.warn("viewer is undefined!");return}const n=e.scene.postProcessStages.add(h.PostProcessStageLibrary.createDepthOfFieldStage());this.d(()=>e.scene.postProcessStages.remove(n));{const o=()=>{n.enabled=this.show};o(),this.d(this.showChanged.don(o))}{const o=()=>{n.uniforms.fogByDistance=this.focalDistance};o(),this.d(this.focalDistanceChanged.don(o))}{const o=()=>{n.uniforms.delta=this.delta};o(),this.d(this.deltaChanged.don(o))}{const o=()=>{n.uniforms.sigma=this.sigma};o(),this.d(this.sigmaChanged.don(o))}{const o=()=>{n.uniforms.stepSize=this.stepSize};o(),this.d(this.stepSizeChanged.don(o))}}}(t=>{t.createDefaultProps=()=>({show:!1,focalDistance:87,delta:1,sigma:3.78,stepSize:2.46})})(va||(va={})),a.extendClassProps(va.prototype,va.createDefaultProps);const yN=`
1997
1997
  float getDistance(sampler2D depthTexture, vec2 texCoords)
1998
1998
  {
@@ -2292,10 +2292,10 @@ async function initCesiumViewer(container, czmViewer) {
2292
2292
  `;function lO(){const t="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
2293
2293
  github地址:https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/Ion.js#L7
2294
2294
  gitee地址:${t}
2295
- `;console.log(e);const n=globalThis.prompt(e,t);n&&globalThis.open(n,"_blank")}const lt=class lt extends a.ESViewer{constructor(e){super(e);m(this,"_disabledInputStack",this.disposeVar(a.react(0)));m(this,"_viewer",this.dv(a.react(void 0)));m(this,"_viewerInstance");m(this,"_viewerLegend");m(this,"pickCustomAttachedInfo");m(this,"_fps",this.dv(a.react(0)));m(this,"_notSupportEditingCount",this.disposeVar(a.react(0)));m(this,"_editingSystem",$h);m(this,"_moveObjectsProcess",this.ad(xC()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new AF(this)),this.ad(new EF(this)),this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new DF(this)})),this._viewerLegend=this.dv(new iO(this)),this._viewerInstance=this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new zg(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=te([1,1,1,1]))}));const n=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new a.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new ML(this.subContainer,this,o=>this._viewer.value=o,n.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&Ke(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,n,o){if(!this.extensions)return;const{pickingManager:s}=this.extensions;return await s.pick(e,void 0,n)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:n}=this;if(!n)return;const o=h.Cartographic.fromDegrees(e[0],e[1],e[2],lt.getHeightsScartchCarto);return n.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Ht(e),rotation:jo(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:n}=this.viewer;if(!n||!e)return;const o=h.Cartesian3.fromDegrees(...e),s=h.Transforms.eastNorthUpToFixedFrame(o),r=h.Matrix4.inverse(s,new h.Matrix4),l=h.Matrix4.multiplyByPoint(r,n.positionWC,new h.Cartesian3),c=h.Cartesian3.magnitude(l);let u=-Math.asin(l.z/c);u=h.Math.toDegrees(u);let d=h.Math.PI_OVER_TWO-Math.atan(l.y/l.x);l.x>0&&(d+=l.y<0?-h.Math.PI:h.Math.PI),d=h.Math.toDegrees(d);const p=jo(n),f=p[0]-d,g=p[1]-u;return{distance:c,heading:d,pitch:u,flyDuration:1,hDelta:f,pDelta:g}}flyIn(e,n,o,s="default"){var c;const r={position:e,rotation:n,duration:(o??1)*1e3},l=(c=this.viewer)==null?void 0:c.camera;return l&&Er(l,r,s)}flyTo(e,n,o="default"){var g;const{distance:s,heading:r,pitch:l,flyDuration:c,hDelta:u,pDelta:d}=e,p={position:n,viewDistance:s,rotation:[r,l,0],duration:c*1e3,hdelta:u,pdelta:d},f=(g=this.viewer)==null?void 0:g.camera;return f&&Er(f,p,o)}flyToBoundingSphere(e,n,o=1){var p;const s=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],r=a.getGeoBoundingSphereFromPositions(s);if(!r)return;const{center:l,radius:c}=r,u={position:l,viewDistance:n??c,rotation:[0,-90,0],duration:o*1e3},d=(p=this.viewer)==null?void 0:p.camera;return d&&Er(d,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Ht(e),rotation:jo(e)}}transformFlyParam(e,n){if("position"in n){const o=h.Cartesian3.fromDegrees(...e),s=h.Transforms.eastNorthUpToFixedFrame(o),r=h.Matrix4.inverse(s,new h.Matrix4),l=h.Matrix4.multiplyByPoint(r,Se(n.position),new h.Cartesian3),c=h.Cartesian3.magnitude(l);let u=-Math.asin(l.z/c);u=h.Math.toDegrees(u);let d=h.Math.PI_OVER_TWO-Math.atan(l.y/l.x);l.x>0&&(d+=l.y<0?-h.Math.PI:h.Math.PI),d=h.Math.toDegrees(d);const p=n.rotation[0]-d,f=n.rotation[1]-u;return{distance:c,heading:d,pitch:u,flyDuration:n.flyDuration??1,hDelta:p,pDelta:f}}else{const o=Se(e);let s={heading:h.Math.toRadians(n.heading),pitch:h.Math.toRadians(n.pitch),roll:0};const r=new h.HeadingPitchRoll;if(n.distance){r.heading=s.heading,r.pitch=s.pitch,r.roll=0,r.heading-=h.Math.PI_OVER_TWO;const c=h.Transforms.headingPitchRollToFixedFrame(o,r,void 0,void 0),u=h.Matrix4.multiplyByPointAsVector(c,h.Cartesian3.UNIT_X,new h.Cartesian3);h.Cartesian3.multiplyByScalar(u,n.distance,u),h.Cartesian3.subtract(o,u,o)}n.hDelta&&(s.heading+=h.Math.toRadians(n.hDelta)),n.pDelta&&(s.pitch+=h.Math.toRadians(n.pDelta));const l=se(o);return l?{position:l,rotation:[h.Math.toDegrees(s.heading),h.Math.toDegrees(s.pitch),h.Math.toDegrees(s.roll)],flyDuration:n.flyDuration??1}:void 0}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,n=4.2,o=1.6){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToWalk(e,n,o),this._navigationMode.value="Walk"}changeToMap(){var e,n;(n=(e=this._viewerInstance)==null?void 0:e.obj)==null||n.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,n,o){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToRotateGlobe(e,n,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,n,o,s,r,l){var c,u;(u=(c=this._viewerInstance)==null?void 0:c.obj)==null||u.navigationManager.changeToLine(e,n,o,s,r,l),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToRotatePoint(e,n,o,s,r),this._navigationMode.value="RotatePoint"}changeToFollow(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToFollow(e,n,o,s,r),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=globalThis.g_XE3CopyRights??{};return e.cesium={version:h.VERSION},e}async getHeightByLonLat(e,n,o){if(!this.viewer)return null;const s=h.Cartographic.fromDegrees(e,n,void 0,lt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(s)??null}async getHeightsByLonLats(e,n){const o=e.map(r=>this.getHeightByLonLat(...r));return await Promise.all(o)}async capture(e,n){if(this.viewer)return await xm(this.viewer.scene,e,n)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(Se(e));if(n)return[n.x,n.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,n,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const s=e.components.main??e;s&&n!=null&&(s.editingID=`${o.callSource}_${a.createGuid()}`,this._editingSystem.create(this,s,n,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const n=[],o=a.createGuid();for(let s=0;s<e.length;s++){const r=e[s],l=r.components.main??r;l.editingID=o,l&&n.push(l)}this._moveObjectsProcess.restart(void 0,this,n,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=lt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!lt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=lt.latestDefaultAccessToken}positionsToLocalPositions(e,n){return Dt(e,n)}localPositionsToPositions(e,n){return Cn(e,n)}isPointVisible(e){if(!this.viewer)return!1;const n=e instanceof h.Cartesian3?e:Se(e),o=new h.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(n))return!1;const s=this.viewer.scene.cartesianToCanvasCoordinates(n);return!(!s||s.x<0||s.y<0)}getESProperties(){const e={...super.getESProperties()},n=lt.defaults;return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",aO,rO,!0),new a.FunctionProperty([],()=>lt.getCesiumIonToken(),[],"获取官方token"),new a.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new a.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new a.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new a.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new a.GroupProperty([],"Viewer","Viewer"),new a.NumberProperty([this,"resolutionScale"],"分辨率比率",n.resolutionScale,!0),new a.NumberProperty([this,"msaaSamples"],"msaaSamples",n.msaaSamples,!0),new a.BooleanProperty([this,"shadows"]),new a.GroupProperty([],"比例尺","比例尺(Legend)"),new a.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new a.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new a.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new a.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new a.GroupProperty([],"场景","场景(Scene)"),new a.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new a.GroupProperty([],"Globe","Globe"),new a.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",n.sceneGlobeShadows,!0),new a.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new a.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new a.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new a.BooleanProperty([this,"sceneGlobeShowSkirts"]),new a.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new a.ColorProperty([this,"sceneGlobeBaseColor"]),new a.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new a.JsonProperty([this,"sceneGlobeClippingPlanes"]),new a.StringProperty([this,"sceneGlobeClippingPlanesId"]),new a.JsonProperty([this,"sceneGlobeClippingPolygons"]),new a.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new a.GroupProperty([],"underground","underground"),new a.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new a.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new a.GroupProperty([],"Translucency","Translucency"),new a.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",n.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",n.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",n.sceneGlobeTranslucencyRectangle,!0),new a.GroupProperty([],"Sun","Sun"),new a.BooleanProperty([this,"sun"],"sun",n.sun,!0),new a.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new a.GroupProperty([],"Moon","Moon"),new a.BooleanProperty([this,"moon"],"moon",n.moon,!0),new a.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",n.sceneMoonTextureUrl,!0),new a.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",n.sceneMoonOnlySunLighting,!0),new a.GroupProperty([],"SkyBox","SkyBox"),new a.BooleanProperty([this,"sceneSkyBoxShow"]),new a.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new a.GroupProperty([],"Background","Background"),new a.BooleanProperty([this,"xbsjUseBackground"]),new a.StringProperty([this,"xbsjBackgroundImageUri"]),new a.ColorProperty([this,"xbsjBackgroundColor"]),new a.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new a.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new a.ColorProperty([this,"sceneBackgroundColor"]),new a.GroupProperty([],"Fog","Fog"),new a.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",n.sceneFogEnabled,!0),new a.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",n.sceneFogDensity,!0),new a.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",n.sceneFogScreenSpaceErrorFactor,!0),new a.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",n.sceneFogMinimumBrightness,!0),new a.GroupProperty([],"Sscc","Sscc"),new a.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",n.sceneSsccEnableInputs,!0),new a.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",n.sceneSsccEnableCollisionDetection,!0),new a.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",n.sceneSsccZoomFactor,!0),new a.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new a.GroupProperty([],"后处理","后处理"),new a.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new a.GroupProperty([],"环境遮蔽","环境遮蔽"),new a.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new a.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new a.GroupProperty([],"Bloom","Bloom"),new a.BooleanProperty([this,"scenePpsBloomEnabled"]),new a.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new a.NumberProperty([this,"scenePpsBloomContrast"]),new a.NumberProperty([this,"scenePpsBloomBrightness"]),new a.NumberProperty([this,"scenePpsBloomDelta"]),new a.NumberProperty([this,"scenePpsBloomSigma"]),new a.NumberProperty([this,"scenePpsBloomStepSize"]),new a.GroupProperty([],"调试","调试"),new a.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",n.sceneDebugShowFramesPerSecond,!0),new a.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",n.sceneDebugShowCommands,!0),new a.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",n.sceneDebugShowFrustums,!0),new a.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",n.sceneDebugShowFrustumPlanes,!0),new a.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",n.sceneDebugShowDepthFrustum,!0),new a.GroupProperty([],"Inspector","Inspector"),new a.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",n.showCesiumInspector,!0),new a.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",n.cesiumInspectorWireframe,!0),new a.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",n.showCesium3DTilesInspector,!0)]}}};m(lt,"type",lt.register("ESCesiumViewer",lt)),m(lt,"getCesiumIonToken",lO),m(lt,"currentDefaultAccessToken",h.Ion.defaultAccessToken),m(lt,"latestDefaultAccessToken"),m(lt,"ObjectsToExcludeWrapper",MF),m(lt,"defaults",{...a.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyRectangle:[-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966].map(e=>180*e/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:h.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mz.jpg")},xbsjLocalBoxSources:{positiveX:"${earthsdk3-assets-script-dir}/assets/img/skybox/east.jpg",negativeX:"${earthsdk3-assets-script-dir}/assets/img/skybox/west.jpg",positiveY:"${earthsdk3-assets-script-dir}/assets/img/skybox/bottom.jpg",negativeY:"${earthsdk3-assets-script-dir}/assets/img/skybox/top.jpg",positiveZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/north.jpg",negativeZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/south.jpg"},sceneFogEnabled:!0,sceneFogDensity:2e-4,sceneFogScreenSpaceErrorFactor:2,sceneFogMinimumBrightness:.03,sceneSsccEnableInputs:!0,sceneSsccEnableCollisionDetection:!0,sceneSsccZoomFactor:5,scenePpsfxaaEnabled:!0,sceneDebugShowFramesPerSecond:!1,sceneDebugShowCommands:!1,sceneDebugShowFrustums:!1,sceneDebugShowFrustumPlanes:!1,sceneDebugShowDepthFrustum:1,showCesiumInspector:!1,cesiumInspectorWireframe:!1,showCesium3DTilesInspector:!1,particleGlobalControl:!1}),m(lt,"getHeightsScartchCarto",new h.Cartographic);let Me=lt;(t=>{t.createDefaultProps=()=>({...a.ESViewer.createDefaultProps(),...sO()})})(Me||(Me={})),a.extendClassProps(Me.prototype,Me.createDefaultProps),I.copyright=void 0;try{const t="earthsdk3-cesium",i="3.6.2",e="2025-12-04T02:08:23.000Z",n="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="b951704c9cc2a53b6d53468e08f41aec0794d4c0",l=((Date.now()-1764814103e3)/36e5).toFixed(1),c=`%c🌏 ${t}%c ${i}.${s.slice(0,8)}.${e} (距今${l}个小时)
2295
+ `;console.log(e);const n=globalThis.prompt(e,t);n&&globalThis.open(n,"_blank")}const lt=class lt extends a.ESViewer{constructor(e){super(e);m(this,"_disabledInputStack",this.disposeVar(a.react(0)));m(this,"_viewer",this.dv(a.react(void 0)));m(this,"_viewerInstance");m(this,"_viewerLegend");m(this,"pickCustomAttachedInfo");m(this,"_fps",this.dv(a.react(0)));m(this,"_notSupportEditingCount",this.disposeVar(a.react(0)));m(this,"_editingSystem",$h);m(this,"_moveObjectsProcess",this.ad(xC()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new AF(this)),this.ad(new EF(this)),this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new DF(this)})),this._viewerLegend=this.dv(new iO(this)),this._viewerInstance=this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new zg(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=te([1,1,1,1]))}));const n=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new a.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new ML(this.subContainer,this,o=>this._viewer.value=o,n.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&Ke(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,n,o){if(!this.extensions)return;const{pickingManager:s}=this.extensions;return await s.pick(e,void 0,n)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:n}=this;if(!n)return;const o=h.Cartographic.fromDegrees(e[0],e[1],e[2],lt.getHeightsScartchCarto);return n.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Ht(e),rotation:jo(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:n}=this.viewer;if(!n||!e)return;const o=h.Cartesian3.fromDegrees(...e),s=h.Transforms.eastNorthUpToFixedFrame(o),r=h.Matrix4.inverse(s,new h.Matrix4),l=h.Matrix4.multiplyByPoint(r,n.positionWC,new h.Cartesian3),c=h.Cartesian3.magnitude(l);let u=-Math.asin(l.z/c);u=h.Math.toDegrees(u);let d=h.Math.PI_OVER_TWO-Math.atan(l.y/l.x);l.x>0&&(d+=l.y<0?-h.Math.PI:h.Math.PI),d=h.Math.toDegrees(d);const p=jo(n),f=p[0]-d,g=p[1]-u;return{distance:c,heading:d,pitch:u,flyDuration:1,hDelta:f,pDelta:g}}flyIn(e,n,o,s="default"){var c;const r={position:e,rotation:n,duration:(o??1)*1e3},l=(c=this.viewer)==null?void 0:c.camera;return l&&Er(l,r,s)}flyTo(e,n,o="default"){var g;const{distance:s,heading:r,pitch:l,flyDuration:c,hDelta:u,pDelta:d}=e,p={position:n,viewDistance:s,rotation:[r,l,0],duration:c*1e3,hdelta:u,pdelta:d},f=(g=this.viewer)==null?void 0:g.camera;return f&&Er(f,p,o)}flyToBoundingSphere(e,n,o=1){var p;const s=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],r=a.getGeoBoundingSphereFromPositions(s);if(!r)return;const{center:l,radius:c}=r,u={position:l,viewDistance:n??c,rotation:[0,-90,0],duration:o*1e3},d=(p=this.viewer)==null?void 0:p.camera;return d&&Er(d,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Ht(e),rotation:jo(e)}}transformFlyParam(e,n){if("position"in n){const o=h.Cartesian3.fromDegrees(...e),s=h.Transforms.eastNorthUpToFixedFrame(o),r=h.Matrix4.inverse(s,new h.Matrix4),l=h.Matrix4.multiplyByPoint(r,Se(n.position),new h.Cartesian3),c=h.Cartesian3.magnitude(l);let u=-Math.asin(l.z/c);u=h.Math.toDegrees(u);let d=h.Math.PI_OVER_TWO-Math.atan(l.y/l.x);l.x>0&&(d+=l.y<0?-h.Math.PI:h.Math.PI),d=h.Math.toDegrees(d);const p=n.rotation[0]-d,f=n.rotation[1]-u;return{distance:c,heading:d,pitch:u,flyDuration:n.flyDuration??1,hDelta:p,pDelta:f}}else{const o=Se(e);let s={heading:h.Math.toRadians(n.heading),pitch:h.Math.toRadians(n.pitch),roll:0};const r=new h.HeadingPitchRoll;if(n.distance){r.heading=s.heading,r.pitch=s.pitch,r.roll=0,r.heading-=h.Math.PI_OVER_TWO;const c=h.Transforms.headingPitchRollToFixedFrame(o,r,void 0,void 0),u=h.Matrix4.multiplyByPointAsVector(c,h.Cartesian3.UNIT_X,new h.Cartesian3);h.Cartesian3.multiplyByScalar(u,n.distance,u),h.Cartesian3.subtract(o,u,o)}n.hDelta&&(s.heading+=h.Math.toRadians(n.hDelta)),n.pDelta&&(s.pitch+=h.Math.toRadians(n.pDelta));const l=se(o);return l?{position:l,rotation:[h.Math.toDegrees(s.heading),h.Math.toDegrees(s.pitch),h.Math.toDegrees(s.roll)],flyDuration:n.flyDuration??1}:void 0}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,n=4.2,o=1.6){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToWalk(e,n,o),this._navigationMode.value="Walk"}changeToMap(){var e,n;(n=(e=this._viewerInstance)==null?void 0:e.obj)==null||n.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,n,o){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToRotateGlobe(e,n,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,n,o,s,r,l){var c,u;(u=(c=this._viewerInstance)==null?void 0:c.obj)==null||u.navigationManager.changeToLine(e,n,o,s,r,l),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToRotatePoint(e,n,o,s,r),this._navigationMode.value="RotatePoint"}changeToFollow(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToFollow(e,n,o,s,r),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=globalThis.g_XE3CopyRights??{};return e.cesium={version:h.VERSION},e}async getHeightByLonLat(e,n,o){if(!this.viewer)return null;const s=h.Cartographic.fromDegrees(e,n,void 0,lt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(s)??null}async getHeightsByLonLats(e,n){const o=e.map(r=>this.getHeightByLonLat(...r));return await Promise.all(o)}async capture(e,n){if(this.viewer)return await xm(this.viewer.scene,e,n)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(Se(e));if(n)return[n.x,n.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,n,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const s=e.components.main??e;s&&n!=null&&(s.editingID=`${o.callSource}_${a.createGuid()}`,this._editingSystem.create(this,s,n,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const n=[],o=a.createGuid();for(let s=0;s<e.length;s++){const r=e[s],l=r.components.main??r;l.editingID=o,l&&n.push(l)}this._moveObjectsProcess.restart(void 0,this,n,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=lt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!lt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=lt.latestDefaultAccessToken}positionsToLocalPositions(e,n){return Dt(e,n)}localPositionsToPositions(e,n){return Cn(e,n)}isPointVisible(e){if(!this.viewer)return!1;const n=e instanceof h.Cartesian3?e:Se(e),o=new h.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(n))return!1;const s=this.viewer.scene.cartesianToCanvasCoordinates(n);return!(!s||s.x<0||s.y<0)}getESProperties(){const e={...super.getESProperties()},n=lt.defaults;return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",aO,rO,!0),new a.FunctionProperty([],()=>lt.getCesiumIonToken(),[],"获取官方token"),new a.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new a.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new a.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new a.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new a.GroupProperty([],"Viewer","Viewer"),new a.NumberProperty([this,"resolutionScale"],"分辨率比率",n.resolutionScale,!0),new a.NumberProperty([this,"msaaSamples"],"msaaSamples",n.msaaSamples,!0),new a.BooleanProperty([this,"shadows"]),new a.GroupProperty([],"比例尺","比例尺(Legend)"),new a.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new a.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new a.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new a.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new a.GroupProperty([],"场景","场景(Scene)"),new a.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new a.GroupProperty([],"Globe","Globe"),new a.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",n.sceneGlobeShadows,!0),new a.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new a.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new a.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new a.BooleanProperty([this,"sceneGlobeShowSkirts"]),new a.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new a.ColorProperty([this,"sceneGlobeBaseColor"]),new a.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new a.JsonProperty([this,"sceneGlobeClippingPlanes"]),new a.StringProperty([this,"sceneGlobeClippingPlanesId"]),new a.JsonProperty([this,"sceneGlobeClippingPolygons"]),new a.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new a.GroupProperty([],"underground","underground"),new a.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new a.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new a.GroupProperty([],"Translucency","Translucency"),new a.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",n.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",n.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",n.sceneGlobeTranslucencyRectangle,!0),new a.GroupProperty([],"Sun","Sun"),new a.BooleanProperty([this,"sun"],"sun",n.sun,!0),new a.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new a.GroupProperty([],"Moon","Moon"),new a.BooleanProperty([this,"moon"],"moon",n.moon,!0),new a.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",n.sceneMoonTextureUrl,!0),new a.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",n.sceneMoonOnlySunLighting,!0),new a.GroupProperty([],"SkyBox","SkyBox"),new a.BooleanProperty([this,"sceneSkyBoxShow"]),new a.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new a.GroupProperty([],"Background","Background"),new a.BooleanProperty([this,"xbsjUseBackground"]),new a.StringProperty([this,"xbsjBackgroundImageUri"]),new a.ColorProperty([this,"xbsjBackgroundColor"]),new a.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new a.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new a.ColorProperty([this,"sceneBackgroundColor"]),new a.GroupProperty([],"Fog","Fog"),new a.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",n.sceneFogEnabled,!0),new a.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",n.sceneFogDensity,!0),new a.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",n.sceneFogScreenSpaceErrorFactor,!0),new a.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",n.sceneFogMinimumBrightness,!0),new a.GroupProperty([],"Sscc","Sscc"),new a.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",n.sceneSsccEnableInputs,!0),new a.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",n.sceneSsccEnableCollisionDetection,!0),new a.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",n.sceneSsccZoomFactor,!0),new a.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new a.GroupProperty([],"后处理","后处理"),new a.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new a.GroupProperty([],"环境遮蔽","环境遮蔽"),new a.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new a.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new a.GroupProperty([],"Bloom","Bloom"),new a.BooleanProperty([this,"scenePpsBloomEnabled"]),new a.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new a.NumberProperty([this,"scenePpsBloomContrast"]),new a.NumberProperty([this,"scenePpsBloomBrightness"]),new a.NumberProperty([this,"scenePpsBloomDelta"]),new a.NumberProperty([this,"scenePpsBloomSigma"]),new a.NumberProperty([this,"scenePpsBloomStepSize"]),new a.GroupProperty([],"调试","调试"),new a.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",n.sceneDebugShowFramesPerSecond,!0),new a.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",n.sceneDebugShowCommands,!0),new a.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",n.sceneDebugShowFrustums,!0),new a.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",n.sceneDebugShowFrustumPlanes,!0),new a.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",n.sceneDebugShowDepthFrustum,!0),new a.GroupProperty([],"Inspector","Inspector"),new a.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",n.showCesiumInspector,!0),new a.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",n.cesiumInspectorWireframe,!0),new a.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",n.showCesium3DTilesInspector,!0)]}}};m(lt,"type",lt.register("ESCesiumViewer",lt)),m(lt,"getCesiumIonToken",lO),m(lt,"currentDefaultAccessToken",h.Ion.defaultAccessToken),m(lt,"latestDefaultAccessToken"),m(lt,"ObjectsToExcludeWrapper",MF),m(lt,"defaults",{...a.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyRectangle:[-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966].map(e=>180*e/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:h.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mz.jpg")},xbsjLocalBoxSources:{positiveX:"${earthsdk3-assets-script-dir}/assets/img/skybox/east.jpg",negativeX:"${earthsdk3-assets-script-dir}/assets/img/skybox/west.jpg",positiveY:"${earthsdk3-assets-script-dir}/assets/img/skybox/bottom.jpg",negativeY:"${earthsdk3-assets-script-dir}/assets/img/skybox/top.jpg",positiveZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/north.jpg",negativeZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/south.jpg"},sceneFogEnabled:!0,sceneFogDensity:2e-4,sceneFogScreenSpaceErrorFactor:2,sceneFogMinimumBrightness:.03,sceneSsccEnableInputs:!0,sceneSsccEnableCollisionDetection:!0,sceneSsccZoomFactor:5,scenePpsfxaaEnabled:!0,sceneDebugShowFramesPerSecond:!1,sceneDebugShowCommands:!1,sceneDebugShowFrustums:!1,sceneDebugShowFrustumPlanes:!1,sceneDebugShowDepthFrustum:1,showCesiumInspector:!1,cesiumInspectorWireframe:!1,showCesium3DTilesInspector:!1,particleGlobalControl:!1}),m(lt,"getHeightsScartchCarto",new h.Cartographic);let Me=lt;(t=>{t.createDefaultProps=()=>({...a.ESViewer.createDefaultProps(),...sO()})})(Me||(Me={})),a.extendClassProps(Me.prototype,Me.createDefaultProps),I.copyright=void 0;try{const t="earthsdk3-cesium",i="3.6.4",e="2025-12-22T03:34:00.000Z",n="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="863ef89ba4141454ba3f0d3ed6a0449491cd8a2b",l=((Date.now()-176637444e4)/36e5).toFixed(1),c=`%c🌏 ${t}%c ${i}.${s.slice(0,8)}.${e} (距今${l}个小时)
2296
2296
  %c${o?o+`
2297
2297
  `:""}当前网站正在使用${t},此软件版权归${n}所有
2298
- `;I.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","b951704c9cc2a53b6d53468e08f41aec0794d4c0")},get info(){return c},get date(){return"2025-12-04T02:08:23.000Z"},get author(){return"suplyang"},get version(){return"3.6.2"},get name(){return"earthsdk3-cesium"},get commitId(){return"b951704c9cc2a53b6d53468e08f41aec0794d4c0"},print(){console.info(this.info,`
2298
+ `;I.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","863ef89ba4141454ba3f0d3ed6a0449491cd8a2b")},get info(){return c},get date(){return"2025-12-22T03:34:00.000Z"},get author(){return"suplyang"},get version(){return"3.6.4"},get name(){return"earthsdk3-cesium"},get commitId(){return"863ef89ba4141454ba3f0d3ed6a0449491cd8a2b"},print(){console.info(this.info,`
2299
2299
  font-size: 18px;
2300
2300
  font-weight: 1000;
2301
2301
  line-height: 1;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/CzmObjects/general/CzmES3DTileset/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAEtE,OAAO,EAAkD,WAAW,EAAyJ,MAAM,WAAW,CAAC;AAC/O,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,cAAc,cAAc,CAAC;AAkI7B,qBAAa,cAAc,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,CAAE,SAAQ,iBAAiB,CAAC,CAAC,CAAC;IAEzF,MAAM,CAAC,QAAQ,CAAC,IAAI,SAAwF;IAE5G,MAAM,CAAC,wBAAwB,2BAAkC;IAEjE,OAAO,CAAC,WAAW,CAAa;IAChC,IAAI,UAAU,eAA8B;IAE5C,OAAO,CAAC,eAAe,CAAC;IACxB,IAAI,cAAc,QAAmC;IAErD,OAAO,CAAC,eAAe,CAAC;IACxB,IAAI,cAAc,QAAmC;IAErD,OAAO,CAAC,WAAW,CAA6D;IAChF,IAAI,UAAU,IACQ,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,SAAS,CADD;IACnD,IAAI,UAAU,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,SAAS,EAAqC;IAEzF,OAAO,CAAC,oBAAoB,CAA2D;IACvF,IAAI,mBAAmB,IACQ,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CADU;IACrE,IAAI,mBAAmB,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,EAA8C;IAEzG,OAAO,CAAC,aAAa,CAA6D;IAClF,IAAI,YAAY,IACQ,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,SAAS,CADC;IACvD,IAAI,YAAY,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,SAAS,EAAuC;IAE7F,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM;IAmBpD;;;;;OAKG;IACH,eAAe,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE;IAgC/C,iBAAiB,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE;IAgCjD,iBAAiB;gBAML,WAAW,EAAE,CAAC,EAAE,SAAS,EAAE,cAAc;IAuV5C,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,EAAE,EAAE,MAAM;IAW9C,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO;CAWpE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/CzmObjects/general/CzmES3DTileset/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAEtE,OAAO,EAAwE,WAAW,EAAyJ,MAAM,WAAW,CAAC;AACrQ,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,cAAc,cAAc,CAAC;AAkI7B,qBAAa,cAAc,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,CAAE,SAAQ,iBAAiB,CAAC,CAAC,CAAC;IAEzF,MAAM,CAAC,QAAQ,CAAC,IAAI,SAAwF;IAE5G,MAAM,CAAC,wBAAwB,2BAAkC;IAEjE,OAAO,CAAC,WAAW,CAAa;IAChC,IAAI,UAAU,eAA8B;IAE5C,OAAO,CAAC,eAAe,CAAC;IACxB,IAAI,cAAc,QAAmC;IAErD,OAAO,CAAC,eAAe,CAAC;IACxB,IAAI,cAAc,QAAmC;IAErD,OAAO,CAAC,WAAW,CAA6D;IAChF,IAAI,UAAU,IACQ,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,SAAS,CADD;IACnD,IAAI,UAAU,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,SAAS,EAAqC;IAEzF,OAAO,CAAC,oBAAoB,CAA2D;IACvF,IAAI,mBAAmB,IACQ,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CADU;IACrE,IAAI,mBAAmB,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,EAA8C;IAEzG,OAAO,CAAC,aAAa,CAA6D;IAClF,IAAI,YAAY,IACQ,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,SAAS,CADC;IACvD,IAAI,YAAY,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,SAAS,EAAuC;IAE7F,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM;IAmBpD;;;;;OAKG;IACH,eAAe,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE;IAgC/C,iBAAiB,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE;IAgCjD,iBAAiB;gBAML,WAAW,EAAE,CAAC,EAAE,SAAS,EAAE,cAAc;IA+V5C,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,EAAE,EAAE,MAAM;IAW9C,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO;CAWpE"}
@@ -1 +1 @@
1
- {"version":3,"file":"ScreenLayer.d.ts","sourceRoot":"","sources":["../../../../../src/ESCesiumViewer/ViewerExtensions/ScreenManager/ScreenLayer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,WAAW,EAAoB,cAAc,EAAE,MAAM,WAAW,CAAC;AACtF,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACpG,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAqB,MAAM,gBAAgB,CAAC;AACnF;;;;GAIG;AACH,qBAAa,WAAY,SAAQ,WAAW;IACxC,OAAO,EAAE,GAAG,CAAC,cAAc,EAAE,YAAY,CAAC,CAAa;IACvD,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,EAAE,cAAc,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;gBACV,aAAa,EAAE,aAAa;IAUxC;;;OAGG;IACH,gBAAgB;IAIhB;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,mBAAmB;IA0B7E;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,mBAAmB;IA0BjF;;;;;;;;;;;;OAYG;IACH,YAAY,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,UAAU,EAAE,mBAAmB,EAAE,QAAQ,EAAE,QAAQ;IAyBhH;;;;;;;;OAQG;IACH,MAAM,CACF,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,EACrC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,gBAAgB,GAAG,KAAK,EAAE,QAAQ,GAAG,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IAmCtG;;;;OAIG;IACH,MAAM,CAAC,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,GAAE,OAAe;IA2D/H,gBAAgB;IAChB,OAAO,CAAC,kBAAkB;IAG1B,yBAAyB;IACzB,OAAO,CAAC,iBAAiB;IAQzB,qCAAqC;IACrC,OAAO,CAAC,cAAc;CAOzB"}
1
+ {"version":3,"file":"ScreenLayer.d.ts","sourceRoot":"","sources":["../../../../../src/ESCesiumViewer/ViewerExtensions/ScreenManager/ScreenLayer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,WAAW,EAAoB,cAAc,EAAE,MAAM,WAAW,CAAC;AACtF,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACpG,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAqB,MAAM,gBAAgB,CAAC;AACnF;;;;GAIG;AACH,qBAAa,WAAY,SAAQ,WAAW;IACxC,OAAO,EAAE,GAAG,CAAC,cAAc,EAAE,YAAY,CAAC,CAAa;IACvD,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,EAAE,cAAc,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;gBACV,aAAa,EAAE,aAAa;IAUxC;;;OAGG;IACH,gBAAgB;IAIhB;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,mBAAmB;IA2B7E;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,mBAAmB;IA2BjF;;;;;;;;;;;;OAYG;IACH,YAAY,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,UAAU,EAAE,mBAAmB,EAAE,QAAQ,EAAE,QAAQ;IA0BhH;;;;;;;;OAQG;IACH,MAAM,CACF,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,EACrC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,gBAAgB,GAAG,KAAK,EAAE,QAAQ,GAAG,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IAmCtG;;;;OAIG;IACH,MAAM,CAAC,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,GAAE,OAAe;IA2D/H,gBAAgB;IAChB,OAAO,CAAC,kBAAkB;IAG1B,yBAAyB;IACzB,OAAO,CAAC,iBAAiB;IAQzB,qCAAqC;IACrC,OAAO,CAAC,cAAc;CAOzB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "earthsdk3-cesium",
3
- "version": "3.6.2",
3
+ "version": "3.6.4",
4
4
  "description": "地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",
5
5
  "type": "module",
6
6
  "main": "./dist/earthsdk3-cesium.umd.cjs",