earthsdk3-cesium 3.5.0 → 3.6.0-beta.1

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.
@@ -198,7 +198,7 @@ void main()
198
198
  out_FragColor = imageColor * u_color;
199
199
  }
200
200
  `,mP={type:"LocalAxisedBoundingBox",data:{min:[0,-1,0],max:[1,0,0]}},gP={depthTest:{enabled:!0},cull:{enabled:!0,face:1029},depthMask:!1,blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},yP={u_image:{type:"image",uri:""},u_color:[1,1,0,1]},vP={position:{typedArray:new Float32Array([0,0,0,0,-1,0,1,-1,0,0,0,0,1,-1,0,1,0,0]),componentsPerAttribute:3},normal:{typedArray:new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1]),componentsPerAttribute:3},textureCoordinates:{typedArray:new Float32Array([0,1,0,0,1,0,0,1,1,0,1,1]),componentsPerAttribute:2}},wP=new Uint16Array([0,1,2,3,4,5]),bP={position:{typedArray:new Float32Array([0,0,0,0,-1,0,1,-1,0,0,0,0,1,-1,0,1,0,0,0,0,0,0,-1,0,1,-1,0,0,0,0,1,-1,0,1,0,0]),componentsPerAttribute:3},normal:{typedArray:new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1]),componentsPerAttribute:3},textureCoordinates:{typedArray:new Float32Array([0,1,0,0,1,0,0,1,1,0,1,1,1,1,1,0,0,0,1,1,0,0,0,1]),componentsPerAttribute:2}},xP=new Uint16Array([0,1,2,3,4,5,8,7,6,11,10,9]);function _P(t){const n={};for(let e of Object.keys(t)){const{typedArray:i,componentsPerAttribute:o,usage:r,normalize:a}=t[e];n[e]={typedArray:{type:i.constructor.name,array:[...i.values()]},componentsPerAttribute:o,usage:r,normalize:a}}return n}function CP(t){const n={};for(let e of Object.keys(t)){const{typedArray:{type:i,array:o},componentsPerAttribute:r,usage:a,normalize:s}=t[e];n[e]={typedArray:new globalThis[i](o),componentsPerAttribute:r,usage:a,normalize:s}}return n}function SP(t){return{type:t.constructor.name,array:[...t.values()]}}function EP(t){const{type:n,array:e}=t;return new globalThis[n](e)}function PP(t){t.length%3===0&&console.warn("当前传入的索引不是3的倍数,可能不是三角片的索引!");const n=t.length/3|0,e=new Array(n*6);for(let i=0;i<n;++i)e[i*6+0]=t[i*3+0],e[i*6+1]=t[i*3+1],e[i*6+2]=t[i*3+2],e[i*6+3]=t[i*3+1],e[i*6+4]=t[i*3+2],e[i*6+5]=t[i*3+0];return e}class BP extends c.Destroyable{constructor(){super(...arguments);L(this,"_show",this.disposeVar(c.react(!0)))}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}function TP(t){if(t instanceof Float32Array)return b.ComponentDatatype.FLOAT;if(t instanceof Int8Array)return b.ComponentDatatype.BYTE;if(t instanceof Uint8Array)return b.ComponentDatatype.UNSIGNED_BYTE;if(t instanceof Int16Array)return b.ComponentDatatype.SHORT;if(t instanceof Uint16Array)return b.ComponentDatatype.UNSIGNED_SHORT;if(t instanceof Int32Array)return b.ComponentDatatype.INT;if(t instanceof Uint32Array)return b.ComponentDatatype.UNSIGNED_INT;throw t instanceof Float64Array?(console.error("暂不支持Float64Array"),new Error("暂不支持Float64Array")):(console.error("不支持的TypedArray!"),new Error("不支持的TypedArray!"))}function IP(t){if(t instanceof Uint8Array)return b.IndexDatatype.UNSIGNED_BYTE;if(t instanceof Uint16Array)return b.IndexDatatype.UNSIGNED_SHORT;if(t instanceof Uint32Array)return b.IndexDatatype.UNSIGNED_INT;throw console.error("不支持的TypedArray!"),new Error("不支持的TypedArray!")}function FP(t,n){if(t===n)return!0;const e=Object.keys(t),i=Object.keys(n);return!(e.length!==i.length||e.some((o,r)=>i[r]!==o)||e.some((o,r)=>t[o]!==n[o]))}function MP(t,n){return t.componentDatatype!==n.componentDatatype||t.componentsPerAttribute!==n.componentsPerAttribute||t.index!==n.index||t.normalize!==n.normalize?!1:t.vertexBuffer===n.vertexBuffer}function DP(t,n){if(t===n)return!0;if(t.usage!==n.usage||t.componentsPerAttribute!==n.componentsPerAttribute||t.normalize!==n.normalize)return!1;if(t.typedArray===n.typedArray)return!0;if(t.typedArray.byteLength!==n.typedArray.byteLength)return!1;const e=n.typedArray;return!!t.typedArray.every((i,o)=>i===e[o])}class ol extends BP{constructor(e,i){super();L(this,"_updateEvent",this.disposeVar(new c.Event));L(this,"_drawCommand");L(this,"_ESSceneObjectID",this.disposeVar(c.react(c.createGuid())));this._scene=e,i&&(this.ESSceneObjectID=i);const o=this._scene,{context:r}=o;let a=!1,s=!1,l=!1,u=!1,A=!1,h,f,d,p,g,v,y;this.dispose(()=>{p&&(p.destroy(),p=void 0),v&&(v.destroy(),v=void 0),g&&(g.destroy(),g=void 0),y&&(y=void 0,this._drawCommand=y)}),this.dispose(this.passChanged.disposableOn(()=>y&&(y.pass=this.pass))),this.dispose(this.attributesChanged.disposableOn(()=>a=!0)),this.dispose(this.uniformMapChanged.disposableOn(()=>y&&(y.uniformMap=this.uniformMap))),this.dispose(this.modelMatrixChanged.disposableOn(()=>y&&(y.modelMatrix=this.modelMatrix))),this.dispose(this.renderStateChanged.disposableOn(()=>{y&&(y=void 0,A=!0)})),this.dispose(this.primitiveTypeChanged.disposableOn(()=>y&&(y.primitiveType=this.primitiveType))),this.dispose(this.indexTypedArrayChanged.disposableOn(()=>s=!0)),this.dispose(this.vertexShaderSourceChanged.disposableOn(()=>u=!0)),this.dispose(this.fragmentShaderSourceChanged.disposableOn(()=>u=!0)),this.dispose(this.occludeChanged.disposableOn(()=>y&&(y.occlude=this.occlude))),this.dispose(this.countChanged.disposableOn(()=>y&&(y.count=this.count))),this.dispose(this.offsetChanged.disposableOn(()=>y&&(y.offset=this.offset))),this.dispose(this.instanceCountChanged.disposableOn(()=>y&&(y.instanceCount=this.instanceCount))),this.dispose(this.castShadowsChanged.disposableOn(()=>y&&(y.castShadows=this.castShadows))),this.dispose(this.receiveShadowsChanged.disposableOn(()=>y&&(y.receiveShadows=this.receiveShadows))),this.dispose(this.executeInClosestFrustumChanged.disposableOn(()=>y&&(y.executeInClosestFrustum=this.executeInClosestFrustum))),this.dispose(this.debugShowBoundingVolumeChanged.disposableOn(()=>y&&(y.debugShowBoundingVolume=this.debugShowBoundingVolume))),this.dispose(this.debugOverlappingFrustumsChanged.disposableOn(()=>y&&(y.debugOverlappingFrustums=this.debugOverlappingFrustums))),this.dispose(this.pickOnlyChanged.disposableOn(()=>y&&(y.pickOnly=this.pickOnly))),this.dispose(this.depthForTranslucentClassificationChanged.disposableOn(()=>y&&(y.depthForTranslucentClassification=this.depthForTranslucentClassification)));const m=()=>{y&&(y.boundingVolume?y.cull=this.cull??!0:y.cull=!1)};m(),this.dispose(this.cullChanged.disposableOn(m)),this.dispose(this.boundingVolumeChanged.disposableOn(()=>{y&&(y.boundingVolume=this.boundingVolume),m()}));const x=this.disposeVar(new c.ObjResettingWithEvent(this.allowPickingChanged,()=>r.createPickId({primitive:this})));this.dispose(this.allowPickingChanged.disposableOn(()=>{u=!0,y&&(y.pickId=this.allowPicking?"xbsjPickColor220823":void 0)}));const _=E=>{const{attributes:B,indexTypedArray:P}=this;if(a&&B){a=!1;const I={},M={},F=[];let S=0;for(let[T,w]of Object.entries(B)){const C=S++,{typedArray:D,componentsPerAttribute:R,usage:U=b.BufferUsage.STATIC_DRAW,normalize:O=!1}=w;if(!D){console.warn(`CzmCustomPrimitive attribute[${T}] typedeArray is undefined!`);continue}I[T]=C;let z;const k=f&&f[T]?c.getExtProp(f[T],"_originAttribute"):void 0;k&&DP(k,w)?(z=f[T],delete f[T],M[T]=z):k&&k.typedArray!==w.typedArray&&k.typedArray.byteLength===w.typedArray.byteLength&&k.usage===w.usage?(z=f[T],z.copyFromArrayView(w.typedArray),delete f[T],M[T]=z,c.setExtProp(M[T],"_originAttribute",w)):(z=b.Buffer.createVertexBuffer({context:r,typedArray:D,usage:U}),z.vertexArrayDestroyable=!1,M[T]=z,c.setExtProp(M[T],"_originAttribute",w)),F.push({index:C,vertexBuffer:z,componentsPerAttribute:R,normalize:O,componentDatatype:TP(D)})}if(f)for(let T of Object.values(f))T.destroy();(!d||d.length!==F.length||d.some((T,w)=>!MP(T,F[w])))&&(l=!0),f=M,d=F,I&&(!h||!FP(I,h))&&(h=I,u=!0,l=!0)}if(s&&(s=!1,p&&(p.destroy(),p=void 0),p=P?b.Buffer.createIndexBuffer({context:r,typedArray:P,usage:b.BufferUsage.STATIC_DRAW,indexDatatype:IP(P)}):void 0,p&&(p.vertexArrayDestroyable=!1),l=!0),l&&(l=!1,g&&(g.destroy(),g=void 0),d&&h&&(g=new b.VertexArray({context:r,attributes:d,attributeLocations:h,bufferUsage:b.BufferUsage.STATIC_DRAW,indexBuffer:p}),y?y.vertexArray=g:A=!0)),u){u=!1;const I=x.obj;let M;if(I){const{red:F,green:S,blue:T,alpha:w}=I.color;M=`const vec4 xbsjPickColor220823 = ${`vec4(${F.toFixed(6)}, ${S.toFixed(6)}, ${T.toFixed(6)}, ${w.toFixed(6)})`};
201
- `}else M="";h&&(v=b.ShaderProgram.fromCache({context:r,vertexShaderSource:new b.ShaderSource({sources:[this.vertexShaderSource]}),fragmentShaderSource:new b.ShaderSource({sources:[M,this.fragmentShaderSource]}),attributeLocations:h}),y?y.shaderProgram=v:A=!0)}A&&(A=!1,y||g&&v&&(y=new b.DrawCommand({vertexArray:g,primitiveType:this.primitiveType,renderState:b.RenderState.fromCache(this.renderState),shaderProgram:v,owner:this,uniformMap:this.uniformMap,pass:this.pass,modelMatrix:this.modelMatrix,boundingVolume:this.boundingVolume,cull:this.cull,occlude:this.occlude,count:this.count,offset:this.offset,instanceCount:this.instanceCount,castShadows:this.castShadows,receiveShadows:this.receiveShadows,pickId:this.allowPicking?"xbsjPickColor220823":void 0,pickOnly:this.pickOnly,debugShowBoundingVolume:this.debugShowBoundingVolume,depthForTranslucentClassification:this.depthForTranslucentClassification}),this._drawCommand=y,y.debugOverlappingFrustums=this.debugOverlappingFrustums,y.executeInClosestFrustum=this.executeInClosestFrustum)),y&&E.commandList.push(y)};this.dispose(this._updateEvent.disposableOn(_))}get drawCommand(){return this._drawCommand}get ESSceneObjectID(){return this._ESSceneObjectID.value}set ESSceneObjectID(e){this._ESSceneObjectID.value=e}get ESSceneObjectIDChanged(){return this._ESSceneObjectID.changed}update(e){this.show&&this._updateEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({modelMatrix:c.react(new b.Matrix4,b.Matrix4.equals,b.Matrix4.clone),boundingVolume:void 0,pass:b.Pass.OPAQUE,attributes:{},cull:!0,occlude:!0,count:void 0,offset:0,indexTypedArray:void 0,instanceCount:0,vertexShaderSource:"",fragmentShaderSource:"",castShadows:!1,receiveShadows:!1,uniformMap:{},renderState:{},primitiveType:b.PrimitiveType.TRIANGLES,executeInClosestFrustum:!1,owner:void 0,debugShowBoundingVolume:!1,debugOverlappingFrustums:0,allowPicking:void 0,pickOnly:!1,depthForTranslucentClassification:!1})})(ol||(ol={})),c.extendClassProps(ol.prototype,ol.createDefaultProps);function RP(t){let n,e;if(t instanceof b.BoundingSphere)e=Ue(t.center),n=t.radius*5;else if(t instanceof b.BoundingRectangle){const{x:i,y:o,width:r,height:a}=t,s=b.Rectangle.fromRadians(i,o,i+r,o+a),l=b.BoundingSphere.fromRectangle2D(s);e=Ue(l.center),n=l.radius*5}else if(t instanceof b.OrientedBoundingBox){e=Ue(t.center);const i=t.halfAxes,o=c.Vector.magnitude([i[0],i[1],i[2]]),r=c.Vector.magnitude([i[3],i[4],i[5]]),a=c.Vector.magnitude([i[6],i[7],i[8]]);n=Math.max(o,r,a)*5}if(!(!e||n===void 0))return[e,n]}const vt=class vt extends c.Destroyable{constructor(e,i){super();L(this,"_attributes",this.disposeVar(c.react(void 0)));L(this,"_indexTypedArray",this.disposeVar(c.react(void 0)));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_sceneScaleEvent",this.disposeVar(new c.Event));L(this,"_nativePrimitive");L(this,"_lastCzmPickResult");L(this,"_czmViewVisibleDistanceRangeControl");L(this,"_id",this.disposeVar(c.react(c.createGuid())));this._czmViewer=e,i&&(this.id=i),this._czmViewVisibleDistanceRangeControl=this.disposeVar(new fo(this.czmViewer,[this,"viewDistanceRange"],[this,"position"]));const o=e.viewer;if(!o)return;this.dispose(c.track([this._czmViewVisibleDistanceRangeControl,"debug"],[this,"viewDistanceDebug"]));const{scene:r}=o,{context:a}=r,s=o.scene.primitives.add(new ol(o.scene,i));this._nativePrimitive=s,this.dispose(()=>o.scene.primitives.remove(s));{const A=this.disposeVar(c.createNextAnimateFrameEvent(this.allowPickingDepthChanged));this.disposeVar(new c.ObjResettingWithEvent(A,()=>{if(!this.allowPickingDepth)return this.allowPickingDepth?void 0:new ot.ObjectsToExcludeWrapper(this.czmViewer,[s])}))}const l=c.react(void 0);{const A=()=>{let h;if(this.position&&this.pixelSize){const f=b.Cartesian3.fromDegrees(...this.position);f&&(h=Ni(o.scene,f,this.pixelSize),h&&(this.maximumScale!==void 0&&h>this.maximumScale&&(h=this.maximumScale),this.minimumScale!==void 0&&h<this.minimumScale&&(h=this.minimumScale)))}l.value=h};A(),this.dispose(o.scene.preUpdate.addEventListener(A))}{const A=()=>{this.sceneScaleEvent.emit(l.value,this.czmViewer)};A(),this.dispose(l.changed.disposableOn(A))}this.disposeVar(new _0(e,[this,"showSceneScale"],[this,"position"],l));{const A=()=>{s.show=(this.show??!0)&&this.visibleAlpha>0};A(),this.dispose(this.showChanged.disposableOn(A)),this.dispose(this.visibleAlphaChanged.disposableOn(A))}const u=this.disposeVar(c.react(void 0));{const A=()=>{const f=st({localScale:this.localScale,initialRotation:"yForwardzUp",localRotation:this.localRotation,localPosition:this.localPosition,localModelMatrix:this.localModelMatrix,sceneScaleFromPixelSize:l.value,scale:this.scale,rotation:this.rotation,position:this.position,modelMatrix:this.modelMatrix});if(!f){console.warn("computeCzmModelMatrix error!");return}u.value=f,s.modelMatrix=f};A();let h=!0;this.dispose(this.showChanged.disposableOn(()=>h=!0)),this.dispose(this.localPositionChanged.disposableOn(()=>h=!0)),this.dispose(this.localRotationChanged.disposableOn(()=>h=!0)),this.dispose(this.localScaleChanged.disposableOn(()=>h=!0)),this.dispose(this.localModelMatrixChanged.disposableOn(()=>h=!0)),this.dispose(this.positionChanged.disposableOn(()=>h=!0)),this.dispose(this.rotationChanged.disposableOn(()=>h=!0)),this.dispose(this.scaleChanged.disposableOn(()=>h=!0)),this.dispose(this.modelMatrixChanged.disposableOn(()=>h=!0)),this.dispose(l.changed.disposableOn(()=>h=!0)),this.dispose(o.scene.preUpdate.addEventListener(()=>{h&&(h&&(h=!1),A())}))}{const A=()=>{const{boundingVolume:d=vt.defaultBoundingVolume}=this;if(!d){s.boundingVolume=void 0;return}if(d.type==="BoundingRectangle"){s.boundingVolume=b.BoundingRectangle.fromRectangle(b.Rectangle.fromDegrees(...d.data));return}if(d.type==="BoundingSphere"){s.boundingVolume=new b.BoundingSphere(b.Cartesian3.fromDegrees(...d.data.center),d.data.radius);return}},h=()=>{const{boundingVolume:d=vt.defaultBoundingVolume}=this;if(!d){s.boundingVolume=void 0;return}if(d.type==="LocalBoundingSphere"){const p=u.value??b.Matrix4.IDENTITY,g=b.Matrix4.multiplyByPoint(p,b.Cartesian3.fromArray(d.data.center),new b.Cartesian3);s.boundingVolume=new b.BoundingSphere(g,d.data.radius);return}if(d.type==="LocalAxisedBoundingBox"){const p=u.value??b.Matrix4.IDENTITY,{min:g,max:v}=d.data,y=new b.Cartesian3(.5*(g[0]+v[0]),.5*(g[1]+v[1]),.5*(g[2]+v[2])),m=b.Matrix4.multiplyByPoint(p,y,y),x=new b.Cartesian3(.5*(v[0]-g[0]),.5*(v[1]-g[1]),.5*(v[2]-g[2]));x.x=x.x===0?1:x.x,x.y=x.y===0?1:x.y,x.z=x.z===0?1:x.z;const _=new b.Matrix3(x.x,0,0,0,x.y,0,0,0,x.z),E=b.Matrix4.getMatrix3(p,new b.Matrix3),B=b.Matrix3.multiply(E,_,E);s.boundingVolume=new b.OrientedBoundingBox(m,B);return}},f=()=>{A(),h()};f(),this.dispose(this.boundingVolumeChanged.disposableOn(f)),this.dispose(u.changed.disposableOn(h))}this.dispose(c.track([s,"allowPicking"],[this,"allowPicking"]));{const A=()=>{s.indexTypedArray=this.indexTypedArray??vt.defaultIndexTypedArray};A(),this.dispose(this.indexTypedArrayChanged.disposableOn(A))}{const A=()=>{s.attributes=this.attributes??vt.defaultAttribute};A(),this.dispose(this.attributesChanged.disposableOn(A))}{const A=()=>{s.renderState=this.renderState??vt.defaultRenderState};A(),this.dispose(this.renderStateChanged.disposableOn(A))}{const A=()=>{s.vertexShaderSource=this.vertexShaderSource??vt.defaultVertexShaderSource};A(),this.dispose(this.vertexShaderSourceChanged.disposableOn(A))}{const A=()=>{s.fragmentShaderSource=this.fragmentShaderSource??vt.defaultFragmentShaderSource};A(),this.dispose(this.fragmentShaderSourceChanged.disposableOn(A))}{const A=()=>s.cull=this.cull??!0;A(),this.dispose(this.cullChanged.disposableOn(A))}{const A=()=>s.pass=b.Pass[this.pass??"TRANSLUCENT"];A(),this.dispose(this.passChanged.disposableOn(A))}{const A=()=>s.primitiveType=b.PrimitiveType[this.primitiveType??"TRIANGLES"];A(),this.dispose(this.primitiveTypeChanged.disposableOn(A))}{const A=()=>s.occlude=this.occlude??!0,h=()=>s.count=this.count,f=()=>s.offset=this.offset??0,d=()=>s.instanceCount=this.instanceCount??0,p=()=>s.castShadows=this.castShadows??!1,g=()=>s.receiveShadows=this.receiveShadows??!1;A(),h(),f(),d(),p(),g(),this.dispose(this.occludeChanged.disposableOn(A)),this.dispose(this.countChanged.disposableOn(h)),this.dispose(this.offsetChanged.disposableOn(f)),this.dispose(this.instanceCountChanged.disposableOn(d)),this.dispose(this.castShadowsChanged.disposableOn(p)),this.dispose(this.receiveShadowsChanged.disposableOn(g))}{const A=()=>s.executeInClosestFrustum=this.executeInClosestFrustum??!1,h=()=>s.debugShowBoundingVolume=this.debugShowBoundingVolume??!1,f=()=>s.debugOverlappingFrustums=this.debugOverlappingFrustums??0,d=()=>s.pickOnly=this.pickOnly??!1,p=()=>s.depthForTranslucentClassification=this.depthForTranslucentClassification??!1;A(),h(),f(),d(),p(),this.dispose(this.executeInClosestFrustumChanged.disposableOn(A)),this.dispose(this.debugShowBoundingVolumeChanged.disposableOn(h)),this.dispose(this.debugOverlappingFrustumsChanged.disposableOn(f)),this.dispose(this.pickOnlyChanged.disposableOn(d)),this.dispose(this.depthForTranslucentClassificationChanged.disposableOn(p))}{const A=new Map;this.dispose(()=>{for(let g of A.values())g&&g.destroy();A.clear()});const h=new Map;this.dispose(()=>{for(let g of h.values())g.destroy();h.clear()});let f;const d=()=>{if(f){for(let g of Object.values(f))g.destroy();f=void 0}};this.dispose(d);const p=()=>{const g={},v=this.uniformMap??vt.defaultUniformMap;d(),f={};let y=[];for(let m of Object.keys(v)){const x=v[m];if(x==null){console.error(`updateUniformMap [${m}] error: !uniformValue`);continue}if(Array.isArray(x)){const _=x.length,B=(_===2?b.Cartesian2:_===3?b.Cartesian3:b.Cartesian4).fromArray(x);g[m]=()=>B}else if(typeof x=="number")g[m]=()=>x;else if("type"in x&&x.type==="image"){const _=new At(e);_.enabled=!0,_.uri=x.uri,_.uriType="img",f[m]=_,g[m]=()=>_.texture?_.texture:a.defaultTexture}else"type"in x&&x.type==="texture"&&(x.id||console.warn(`uniform变量设置错误:${m} 的配置中id未设置或者无效!id为${x.id}`),g[m]=()=>{const _=window.czmTexture[x.id];return _?_.texture:a.defaultTexture})}g.u_xe2VisibleAlpha=()=>this.visibleAlpha,s.uniformMap=g;for(let m of A.keys())if(!y.includes(m)){const x=A.get(m);x==null||x.destroy(),A.delete(m)}for(let m of h.keys())if(!y.includes(m)){const x=h.get(m);x==null||x.destroy(),h.delete(m)}};p(),this.dispose(this.uniformMapChanged.disposableOn(p))}this.dispose(this.flyToEvent.disposableOn(A=>{if(!s.boundingVolume){console.warn("CzmCustomPrimitive没有设置boundingVolume属性,无法飞入(flyTo)!");return}const h=RP(s.boundingVolume);if(!h){console.warn("无法计算viewDistance!");return}const[f,d]=h;Fe(o,f,d,void 0,A)}))}get attributesJson(){return this.attributes&&_P(this.attributes)}set attributesJson(e){const i=JSON.stringify(this.attributesJson),o=JSON.stringify(e);i!==o&&(this.attributes=e&&CP(e))}get attributesJsonChanged(){return this.attributesChanged}get indexTypedArrayJson(){return this.indexTypedArray&&SP(this.indexTypedArray)}set indexTypedArrayJson(e){const i=JSON.stringify(this.indexTypedArrayJson),o=JSON.stringify(e);i!==o&&(this.indexTypedArray=e&&EP(e))}get indexTypedArrayJsonChanged(){return this.indexTypedArrayChanged}get attributes(){return this._attributes.value}set attributes(e){this._attributes.value=e}get attributesChanged(){return this._attributes.changed}get indexTypedArray(){return this._indexTypedArray.value}set indexTypedArray(e){this._indexTypedArray.value=e}get indexTypedArrayChanged(){return this._indexTypedArray.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get sceneScaleEvent(){return this._sceneScaleEvent}get czmViewer(){return this._czmViewer}get nativePrimitive(){return this._nativePrimitive}get czmViewerVisibleDistanceRangeControl(){return this._czmViewVisibleDistanceRangeControl}get visibleAlpha(){return this._czmViewVisibleDistanceRangeControl.visibleAlpha}get visibleAlphaChanged(){return this._czmViewVisibleDistanceRangeControl.visibleAlphaChanged}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}setUniformMap(e){if(Object.entries(e).some(([o,r])=>(console.warn(`setUniformMap error: key: ${o} value: ${r}`),r===null)))return;const i={...this.uniformMap??{},...e};this.uniformMap=i}setLocalBoundingSphere(e,i=[0,0,0]){if(!Number.isFinite(e)||e<=0){console.warn(`!Number.isFinite(radius) || radius <= 0 radius: ${e}`);return}this.boundingVolume={type:"LocalBoundingSphere",data:{center:i,radius:e}}}setLocalAxisedBoundingBox(e,i){if(e.some(o=>!Number.isFinite(o))||i.some(o=>!Number.isFinite(o))){console.warn(`setLocalAxisedBoundingBox error, min: ${e.toString()}, max: ${i.toString()}`);return}this.boundingVolume={type:"LocalAxisedBoundingBox",data:{min:e,max:i}}}computeLocalAxisedBoundingBoxFromAttribute(e="a_position"){if(!this.attributes||!this.attributes[e]){console.warn(`attributes[${e}]不存在!无法获取!`);return}const i=this.attributes[e];if(!("typedArray"in i)||!(i.typedArray instanceof Float32Array)){console.warn(`!('typedArray' in posAttribute) || !(posAttribute.typedArray instanceof Float32Array) attributeName: ${e}`);return}if(!("componentsPerAttribute"in i)||i.componentsPerAttribute!==3){console.warn(`!('componentsPerAttribute' in posAttribute) || posAttribute.componentsPerAttribute !== 3 attributeName: ${e}`);return}const{min:o,max:r}=vt.getMinMaxPosition(i.typedArray);if(!o.some(a=>!Number.isFinite(a)||r.some(s=>!Number.isFinite(s))))return{min:o,max:r}}};L(vt,"defaultRenderState",gP),L(vt,"defaultVertexShaderSource",pP),L(vt,"defaultFragmentShaderSource",dP),L(vt,"defaultUniformMap",yP),L(vt,"defaultBoundingVolume",mP),L(vt,"defaultAttribute",vP),L(vt,"defaultIndexTypedArray",wP),L(vt,"defaultDsAttribute",bP),L(vt,"defaultDsIndexTypedArray",xP),L(vt,"triangleIndicesToLine",PP),L(vt,"defaults",{position:[116.39,39.9,0],rotation:[0,0,0],scale:[1,1,1],modelMatrix:[-.8957893500750183,-.4444788412198901,0,0,.28511078894078473,-.5746037485691958,.7671651518152995,0,-.3409886777031455,.68721837274483,.6414496315691579,0,-2.1778739967047274e6,4389222053178148e-9,4.0694736755001387e6,1],viewDistanceRange:[1e3,1e4,3e4,6e4]}),L(vt,"getMinMaxPosition",c.getMinMaxPosition);let at=vt;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:!1,allowPickingDepth:!0,position:c.reactArrayWithUndefined(void 0),rotation:c.reactArrayWithUndefined(void 0),scale:c.reactArrayWithUndefined(void 0),maximumScale:void 0,minimumScale:void 0,pixelSize:void 0,showSceneScale:void 0,modelMatrix:c.reactArrayWithUndefined(void 0),cull:c.react(void 0),boundingVolume:c.reactJson(void 0),renderState:c.reactJson(void 0),primitiveType:void 0,pass:void 0,vertexShaderSource:void 0,fragmentShaderSource:void 0,uniformMap:c.reactJson(void 0),localPosition:c.reactArrayWithUndefined(void 0),localRotation:c.reactArrayWithUndefined(void 0),localScale:c.reactArrayWithUndefined(void 0),localModelMatrix:c.reactArrayWithUndefined(void 0),occlude:void 0,count:void 0,offset:void 0,instanceCount:void 0,castShadows:void 0,receiveShadows:void 0,executeInClosestFrustum:void 0,debugShowBoundingVolume:void 0,debugOverlappingFrustums:void 0,pickOnly:void 0,depthForTranslucentClassification:void 0,viewDistanceRange:c.reactArrayWithUndefined(void 0),viewDistanceDebug:!1})})(at||(at={})),c.extendClassProps(at.prototype,at.createDefaultProps);class UP extends c.PosFloatDiv{constructor(){super(),this.contentDiv.style.backgroundColor="rgba(0, 0, 0, 0.8)",this.contentDiv.style.borderRadius="3px",this.contentDiv.style.color="rgb(255, 255, 255)",this.contentDiv.style.padding="1px 5px 1px 5px",this.contentDiv.style.fontSize="12px",this.contentDiv.style.whiteSpace="nowrap",this.contentDiv.innerText="未定义光标信息!",this.originRatioX=0,this.originRatioY=0,this.originOffsetX=-16}}class OP extends c.Destroyable{constructor(e,i){super();L(this,"_cursorDiv");L(this,"_pointerOut",this.disposeVar(c.react(!0)));L(this,"_show",this.disposeVar(c.react(!0)));this._cursorDiv=new c.DivPoi(i,e),this.dispose(()=>this._cursorDiv.destroy());const o=s=>{const[l,u]=c.getDomEventCurrentTargetPos(s);this._cursorDiv.floatDiv.winPos=[l,u],this._pointerOut.value=!1};e.addEventListener("pointermove",o),this.dispose(()=>e.removeEventListener("pointermove",o));const r=s=>{this._pointerOut.value=!0};e.addEventListener("pointerout",r),this.dispose(()=>e.removeEventListener("pointerout",r)),e.addEventListener("pointerleave",r),this.dispose(()=>e.removeEventListener("pointerleave",r)),e.addEventListener("pointercancel",r),this.dispose(()=>e.removeEventListener("pointercancel",r));const a=()=>{this._cursorDiv.show=this.show&&!this._pointerOut.value};a(),this.dispose(this.showChanged.disposableOn(a)),this.dispose(this._pointerOut.changed.disposableOn(a))}set show(e){this._show.value=e}get show(){return this._show.value}get showChanged(){return this._show.changed}reset(){this._pointerOut.value=!0}get cursorDiv(){return this._cursorDiv}set text(e){this._cursorDiv.floatDiv.contentDiv.innerText=e}get text(){return this._cursorDiv.floatDiv.contentDiv.innerText}}class LP extends c.Destroyable{constructor(e,i){super();L(this,"_show",this.disposeVar(c.react(!0)));L(this,"_winPosFromCartesian");L(this,"_near",this.disposeVar(c.react(0)));L(this,"_far",this.disposeVar(c.react(Number.POSITIVE_INFINITY)));L(this,"_actualShow",this.disposeVar(c.react(!1)));this._czmPoisContext=e;const{viewer:o,cameraChanged:r}=this._czmPoisContext;this._winPosFromCartesian=i||this.disposeVar(new Ch(o,!0,r));let a=0,s=Number.POSITIVE_INFINITY;this.dispose(this._near.changed.disposableOn(u=>a=u*u)),this.dispose(this._far.changed.disposableOn(u=>s=u*u));const l=this.disposeVar(c.createNextMicroTaskEvent(this._near.changed,this._far.changed,this._show.changed,this._winPosFromCartesian.changed,r.changed));this.dispose(l.disposableOn(()=>{if(!this.show){this._actualShow.value=!1;return}const u=b.Cartesian3.distanceSquared(o.camera.positionWC,this._winPosFromCartesian.cartesian),A=u>=a&&u<=s;this._actualShow.value=A&&this._winPosFromCartesian.winPosValid&&!this._czmPoisContext.isPointOccludedByEarth(this._winPosFromCartesian.cartesian)}))}get actualShowChanged(){return this._actualShow.changed}get actualShow(){return this._actualShow.value}set cartesian(e){this._winPosFromCartesian.cartesian=e}get cartesian(){return this._winPosFromCartesian.cartesian}get winPosFromCartesian(){return this._winPosFromCartesian}set show(e){this._show.value=e}get show(){return this._show.value}set near(e){this._near.value=e}get near(){return this._near.value}set far(e){this._far.value=e}get far(){return this._far.value}}class Op extends LP{constructor(e,i,o){super(i,o);L(this,"_canvasPoi");L(this,"_zOrderChanged");L(this,"_zOrder");L(this,"depth",0);const{canvasPrimitivesContext:r}=this._czmPoisContext;this._canvasPoi=this.disposeVar(new e(r));const a=()=>{if(this.actualShow&&this.winPosFromCartesian.winPosValid){const{left:s,top:l,depth:u}=this.winPosFromCartesian.winPos;this._canvasPoi.winPos=[s,l],this.depth=u,this._canvasPoi.depth=this.zOrder??u,this._canvasPoi.show=!0}else this._canvasPoi.show=!1};this.d(this.zOrderChanged.don(()=>{a()})),this.dispose(this.winPosFromCartesian.changed.disposableOn(()=>{a()})),this.dispose(this.actualShowChanged.disposableOn(s=>{this._canvasPoi.show=s,a()}))}get canvasPoi(){return this._canvasPoi}set zOrder(e){this._zOrder!==e&&(this._zOrder=e,this.zOrderChanged.emit())}get zOrder(){return this._zOrder}get zOrderChanged(){return this._zOrderChanged||(this._zOrderChanged=new c.Event),this._zOrderChanged}}class Lp extends c.Destroyable{constructor(e,i,o){super();L(this,"_divPoi");L(this,"_show",!0);L(this,"_occludedByEarth",!0);L(this,"_winPosFromCartesian");L(this,"_zOrderChanged");L(this,"_zOrder");L(this,"depth",0);this._czmPoisContext=i;const{viewer:r,divContainer:a,cameraChanged:s}=this._czmPoisContext;this._winPosFromCartesian=o||this.disposeVar(new Ch(r,!0,s)),this._divPoi=new c.DivPoi(e,a),this.dispose(()=>this._divPoi.destroy()),this.dispose(this._winPosFromCartesian.changed.disposableOn((l,u)=>{this._occludedByEarth=!l||this._czmPoisContext.isPointOccludedByEarth(this._winPosFromCartesian.cartesian);const{left:A,top:h,depth:f}=u,{floatDiv:d}=this._divPoi;d.winPos=[A,h],this.depth=Math.round((1-f)*1e11),d.element.style.zIndex=`${this.zOrder||this.depth}`,this._updateShow()})),this.d(this.zOrderChanged.don(()=>{const{floatDiv:l}=this._divPoi;l.element.style.zIndex=`${this.zOrder||this.depth}`,this._updateShow()}))}get divPoi(){return this._divPoi}_updateShow(){this._divPoi.show=this._show&&!this._occludedByEarth&&this._winPosFromCartesian.winPosValid}set cartesian(e){this._winPosFromCartesian.cartesian=e}get cartesian(){return this._winPosFromCartesian.cartesian}get winPosFromCartesian(){return this._winPosFromCartesian}set show(e){this._show!==e&&(this._show=e,this._updateShow())}get show(){return this._show}set zOrder(e){this._zOrder!==e&&(this._zOrder=e,this.zOrderChanged.emit())}get zOrder(){return this._zOrder}get zOrderChanged(){return this._zOrderChanged||(this._zOrderChanged=new c.Event),this._zOrderChanged}}class zP extends c.Destroyable{constructor(e,i,o,r){super();L(this,"_czmCanvasPoi");L(this,"_czmDivPoi");L(this,"_show",!0);L(this,"_winPosFromCartesian");L(this,"_switchTransition");L(this,"_status","Canvas");L(this,"_statusChanged");this._czmPoisContext=o;const{viewer:a,cameraChanged:s}=this._czmPoisContext;this._winPosFromCartesian=r||this.disposeVar(new Ch(a,!0,s)),this._czmCanvasPoi=new Op(e,this._czmPoisContext,this._winPosFromCartesian),this.dispose(()=>this._czmCanvasPoi.destroy()),this._czmDivPoi=new Lp(i,this._czmPoisContext,this._winPosFromCartesian),this.dispose(()=>this._czmDivPoi.destroy()),this._switchTransition=new c.Transition(300),this.dispose(this._switchTransition.currentChanged.disposableOn((l,u)=>{this._updateShow(),this._czmCanvasPoi.canvasPoi.opacity=1-u,this._czmDivPoi.divPoi.floatDiv.opacity=u})),this._updateShow()}_updateShow(){this._czmCanvasPoi.show=this._show&&this._switchTransition.current<1,this._czmDivPoi.show=this._show&&this._switchTransition.current>0}set show(e){this._show!==e&&(this._show=e,this._updateShow())}get show(){return this._show}set cartesian(e){this._winPosFromCartesian.cartesian=e}get cartesian(){return this._winPosFromCartesian.cartesian}get winPosFromCartesian(){return this._winPosFromCartesian}set status(e){this._status!==e&&(this._status=e,this._switchTransition.target=this._status==="Canvas"?0:1,this._statusChanged&&this._statusChanged.emit(this._status))}get status(){return this._status}get statusChanged(){return this._statusChanged||(this._statusChanged=new c.Event),this._statusChanged}get czmCanvasPoi(){return this._czmCanvasPoi}get czmDivPoi(){return this._czmDivPoi}}class U0 extends c.Destroyable{constructor(e,i=!0){super();L(this,"_divContainer");L(this,"_canvasPrimitivesContext");L(this,"_isPointOccludedByEarth");L(this,"_poiClickedEvent");L(this,"_clickEvent",this.disposeVar(new c.Event));L(this,"_dbclickEvent",this.disposeVar(new c.Event));L(this,"_downEvent",this.disposeVar(new c.Event));L(this,"_upEvent",this.disposeVar(new c.Event));L(this,"_moveEvent",this.disposeVar(new c.Event));L(this,"_outEvent",this.disposeVar(new c.Event));L(this,"_cameraChanged");this._viewer=e,this._useInnerInteraction=i,this._cameraChanged=new xh(this._viewer.scene);const o=this._viewer.canvas.parentElement;this._divContainer=o;const r=document.createElement("div");r.style.position="absolute",r.style.left="0px",r.style.top="0px",r.style.width="100%",r.style.height="100%",r.style.pointerEvents="none",o.appendChild(r),this.dispose(()=>{o.removeChild(r)});const a=new c.CanvasPrimitivesContext;this._canvasPrimitivesContext=a,this.dispose(()=>{this._canvasPrimitivesContext.destroy()}),r.appendChild(a.element);{const h=new b.EllipsoidalOccluder(b.Ellipsoid.WGS84,new b.Cartesian3),f=new xh(this._viewer.scene);this.dispose(()=>f.destroy());const d=()=>h.cameraPosition=this._viewer.camera.positionWC;this.dispose(f.changed.disposableOn(d)),d();const p=g=>!h.isPointVisible(g);this._isPointOccludedByEarth=p}this.dispose(this._clickEvent.disposableOn((h,f,d)=>{const p=a.pick(h,f,1,1);if(p.length>0){this._poiClickedEvent&&this._poiClickedEvent.emit(!0);const{poi:g,tag:v}=p[0];for(let y of a.pois)y===g?y.hasClickEvent()&&y.clickEvent.emit(h,f,v,y,d):y.hasClickOutEvent()&&y.clickOutEvent.emit(h,f,"",y,d)}else{this._poiClickedEvent&&this._poiClickedEvent.emit(!1);for(let g of a.pois)g.hasClickOutEvent()&&g.clickOutEvent.emit(h,f,"",g,d)}})),this.dispose(this._dbclickEvent.disposableOn((h,f,d)=>{const p=a.pick(h,f,1,1);if(p.length>0){this._poiClickedEvent&&this._poiClickedEvent.emit(!0);const{poi:g,tag:v}=p[0];for(let y of a.pois)y===g?y.hasDbclickEvent()&&y.dbclickEvent.emit(h,f,v,y,d):y.hasDbclickOutEvent()&&y.dbclickOutEvent.emit(h,f,"",y,d)}else{this._poiClickedEvent&&this._poiClickedEvent.emit(!1);for(let g of a.pois)g.hasDbclickOutEvent()&&g.dbclickOutEvent.emit(h,f,"",g,d)}}));let s;this.dispose(this._downEvent.disposableOn((h,f)=>{s&&(s.actived=!1);const d=a.pick(h,f,1,1);if(d.length>0){const{poi:p,tag:g}=d[0];p instanceof c.CanvasPoi&&(p.actived=!0,s=p)}})),this.dispose(this._upEvent.disposableOn(()=>{s&&(s.actived=!1,s=void 0)}));let l;function u(h){l!==h&&(l&&(l.hovered=!1),l=h,l&&(l.hovered=!0))}const A=this._moveEvent.disposableOn((h,f)=>{let d;const p=a.pick(h,f,1,1);if(p.length>0){const g=p[0].poi;g instanceof c.CanvasPrimitive&&(d=g)}u(d)});if(this.dispose(A),this.dispose(this._outEvent.disposableOn((h,f,d)=>{u(void 0)})),this._useInnerInteraction){const h=this._viewer.canvas.parentElement,f=this.disposeVar(c.DomElementEvent.create(h,"pointerdown")),d=this.disposeVar(c.DomElementEvent.create(h,"pointermove")),p=this.disposeVar(c.DomElementEvent.create(h,"pointerup")),g=this.disposeVar(c.DomElementEvent.create(h,"pointerout")),v=this.disposeVar(new c.PointerClick),y=this.disposeVar(new c.PointerHover);this.dispose(f.disposableOn(m=>v.pointerDown(m))),this.dispose(d.disposableOn(m=>v.pointerMove(m))),this.dispose(p.disposableOn(m=>v.pointerUp(m))),this.dispose(g.disposableOn(m=>v.pointerOut(m))),this.dispose(f.disposableOn(m=>y.pointerDown(m))),this.dispose(d.disposableOn(m=>y.pointerMove(m))),this.dispose(p.disposableOn(m=>y.pointerUp(m))),this.dispose(g.disposableOn(m=>y.pointerOut(m))),this.dispose(v.clickEvent.disposableOn(m=>{const[x,_]=c.getDomEventCurrentTargetPos(m);m.button===0?this._clickEvent.emit(x,_,m):m.button===2&&this._clickEvent.emit(x,_,m)})),this.dispose(v.dbclickEvent.disposableOn(m=>{const[x,_]=c.getDomEventCurrentTargetPos(m);m.button===0&&this._dbclickEvent.emit(x,_,m)})),this.dispose(f.disposableOn(m=>{const[x,_]=c.getDomEventCurrentTargetPos(m);m.button===0&&this._downEvent.emit(x,_,m)})),this.dispose(p.disposableOn(m=>{const[x,_]=c.getDomEventCurrentTargetPos(m);m.button===0&&this._upEvent.emit(x,_,m)})),this.dispose(d.disposableOn(m=>{const[x,_]=c.getDomEventCurrentTargetPos(m);this._moveEvent.emit(x,_,m)})),this.dispose(g.disposableOn(m=>{const[x,_]=c.getDomEventCurrentTargetPos(m);this._outEvent.emit(x,_,m)}))}}get useInnerInteraction(){return this._useInnerInteraction}get divContainer(){return this._divContainer}get canvasPrimitivesContext(){return this._canvasPrimitivesContext}get viewer(){return this._viewer}get cameraChanged(){return this._cameraChanged}isPointOccludedByEarth(e){return this._isPointOccludedByEarth(e)}get poiClickedEvent(){return this._poiClickedEvent||(this._poiClickedEvent=new c.Event),this._poiClickedEvent}pointerClick(...e){this._useInnerInteraction?console.warn("当前使用内置交互(useInnerInteraction为true),此函数无效!"):this._clickEvent.emit(...e)}pointerDbclick(...e){this._useInnerInteraction?console.warn("当前使用内置交互(useInnerInteraction为true),此函数无效!"):this._dbclickEvent.emit(...e)}pointerDown(...e){this._useInnerInteraction?console.warn("当前使用内置交互(useInnerInteraction为true),此函数无效!"):this._downEvent.emit(...e)}pointerUp(...e){this._useInnerInteraction?console.warn("当前使用内置交互(useInnerInteraction为true),此函数无效!"):this._upEvent.emit(...e)}pointerMove(...e){this._useInnerInteraction?console.warn("当前使用内置交互(useInnerInteraction为true),此函数无效!"):this._moveEvent.emit(...e)}}class Wi extends c.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new c.Event));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_clickEvent",this.disposeVar(new c.Event));L(this,"_clickOutEvent",this.disposeVar(new c.Event));L(this,"_dblclickEvent",this.disposeVar(new c.Event));L(this,"_dblclickOutEvent",this.disposeVar(new c.Event));L(this,"_canvasPoiClassAndCreateFunc",c.react(void 0));L(this,"_czmViewVisibleDistanceRangeControl");L(this,"_canvasObj");L(this,"_id",this.disposeVar(c.react(c.createGuid())));i&&(this.id=i),this._czmViewVisibleDistanceRangeControl=this.disposeVar(new fo(e,[this,"viewDistanceRange"],[this,"position"])),this.dispose(c.track([this._czmViewVisibleDistanceRangeControl,"debug"],[this,"viewDistanceDebug"]));const o=e.viewer;if(!o)return;const r=Qn(o);if(!r)return;const{poiContext:a,labelManager:s}=r;s.add(this),this.d(()=>{s.delete(this)}),a&&(this._canvasObj=this.disposeVar(new c.ObjResettingWithEvent(this.canvasPoiClassAndCreateFuncChanged,()=>{if(!this.canvasPoiClassAndCreateFunc)return;const[l,u]=this.canvasPoiClassAndCreateFunc;return new kP(this,l,a,o,u)})))}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get clickEvent(){return this._clickEvent}get clickOutEvent(){return this._clickOutEvent}get dblclickEvent(){return this._dblclickEvent}get dblclickOutEvent(){return this._dblclickOutEvent}get canvasPoiClassAndCreateFunc(){return this._canvasPoiClassAndCreateFunc.value}set canvasPoiClassAndCreateFunc(e){this._canvasPoiClassAndCreateFunc.value=e}get canvasPoiClassAndCreateFuncChanged(){return this._canvasPoiClassAndCreateFunc.changed}get czmViewerVisibleDistanceRangeControl(){return this._czmViewVisibleDistanceRangeControl}get visibleAlpha(){return this._czmViewVisibleDistanceRangeControl.visibleAlpha}get visibleAlphaChanged(){return this._czmViewVisibleDistanceRangeControl.visibleAlphaChanged}get canvasObj(){var e;return(e=this._canvasObj)==null?void 0:e.obj}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}L(Wi,"defaults",{viewDistanceRange:[1e3,1e4,3e4,6e4]}),(t=>{t.createDefaultProps=()=>({show:!0,enabled:!0,position:c.reactArrayWithUndefined(void 0),positionEditing:!1,viewDistanceRange:c.reactArrayWithUndefined(void 0),viewDistanceDebug:!1,zOrder:0})})(Wi||(Wi={})),c.extendClassProps(Wi.prototype,Wi.createDefaultProps);class kP extends c.Destroyable{constructor(e,i,o,r,a){super();L(this,"czmCanvasPoi");const s=this.czmCanvasPoi=this.disposeVar(new Op(i,o));this.disposeVar(a(s.canvasPoi,e.visibleAlphaChanged));{const l=()=>{e.position&&(s.cartesian=ut(e.position))};l(),this.dispose(e.positionChanged.disposableOn(l))}{const l=()=>{s.show=(e.show??!0)&&!!e.position&&e.visibleAlpha>0};l();const u=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.positionChanged,e.visibleAlphaChanged));this.dispose(u.disposableOn(l))}this.dispose(e.flyToEvent.disposableOn(()=>{if(!e.position){console.warn("GeoPoint当前没有位置信息,无法飞入!");return}let l=1e3;if(e.viewDistanceRange){const[u,A,h,f]=e.viewDistanceRange;l=(A+h)*.5}Fe(r,e.position,l,void 0,1e3)}))}}class QP extends c.Destroyable{constructor(n,e){super();const i=this.disposeVar(c.createNextAnimateFrameEvent(n.showChanged,n.positionChanged,n.fgColorChanged,n.bgColorChanged,n.tooltipChanged,n.tooltipShowChanged,n.titleChanged,n.sizeChanged,n.originRatioAndOffsetChanged,n.opacityChanged,n.scaleChanged)),o=()=>{e.fgColor=n.fgColor??[1,1,1,1],e.bgColor=n.bgColor??[.3,.3,.3,.8],e.tooltip=n.tooltip??"",e.tooltipShow=n.tooltipShow??!0,e.title=n.title??"",e.size=n.size??[32,32],e.originRatioAndOffset=n.originRatioAndOffset??[.5,1,0,0],e.hovered=n.hovered??!1,e.opacity=n.opacity??1,e._scale=n.scale??1};o(),this.dispose(i.disposableOn(o));const r=this.disposeVar(c.ESSceneObject.context.createEnvStrReact([n,"imageUri"],"${earthsdk3-assets-script-dir}/assets/img/location.png")),a=this.disposeVar(c.createProcessingFromAsyncFunc(async(u,A)=>{const h=await u.promise(c.fetchImage(A));e.image=h})),s=()=>{if(!r.value)return;const u=r.value.trim();u!==""&&a.restart(void 0,u)};s(),this.dispose(r.changed.disposableOn(s));const l=this.disposeVar(new c.Event);this.dispose(e.clickEvent.disposableOn((u,A,h,f,d)=>{(n.enabled??!0)&&l.emit(d)})),this.dispose(l.don(u=>{n.clickEvent.emit(u)})),this.dispose(e.clickOutEvent.disposableOn((u,A,h,f,d)=>{(n.enabled??!0)&&n.clickOutEvent.emit(d)})),this.dispose(e.dbclickEvent.disposableOn((u,A,h,f,d)=>{(n.enabled??!0)&&n.dbclickEvent.emit(d)})),this.dispose(e.dbclickOutEvent.disposableOn((u,A,h,f,d)=>{(n.enabled??!0)&&n.dbclickOutEvent.emit(d)})),this.dispose(c.bind([n,"hovered"],[e,"hovered"])),this.ad(c.bind([e,"isHoverZoom"],[n,"isHoverZoom"]))}}function VP(t,n){const[e,i,o]=n,r=`${e}-${i}-${o}`;let a=c.getExtProp(t,r);return a||(a=c.imageToCanvas(t),c.setCanvasUniformColor(a,n),c.setExtProp(t,r,a)),a}class NP extends c.CanvasPoi{constructor(e,i,o=[32,32],r=[.5,1,0,0],a="#F00F"){super(e);L(this,"_tooltip","");L(this,"_title","");L(this,"__scale",[1,1]);L(this,"_tooltipAlpha",0);L(this,"_bgColor",[.3,.3,.3,.8]);L(this,"_bgColorHexStr",c.getColorHexStr(this._bgColor));L(this,"_fgColor",[1,1,1,1]);L(this,"_fgColorHexStr",c.getColorHexStr(this._fgColor));L(this,"_tooltipShow",this.disposeVar(c.react(!0)));L(this,"_isHoverZoom",this.disposeVar(c.react(!1)));this._image=i,this._size=o,this._originRatioAndOffset=r,this._defaultColorStr=a;const s=new c.Transition(100),l=new c.Transition(100);this.dispose(()=>{s.destroy(),l.destroy()});const u=()=>{this._clickEvent&&!this._clickEvent.empty&&(this.isHoverZoom&&(this.hovered?(this._scale[0]*=1.5,this._scale[1]*=1.5):(this._scale[0]/=1.5,this._scale[1]/=1.5)),this._tooltipAlpha=s.current)};this.dispose(this.activedChanged.disposableOn(h=>{l.target=h?1:0,this.needRedraw()}));const A=()=>{const h=this.tooltipShow&&this.hovered;s.target=h?1:0,u(),this.needRedraw()};this.dispose(this.hoveredChanged.disposableOn(A)),this.dispose(this.tooltipShowChanged.disposableOn(A)),this.dispose(this.selectedChanged.disposableOn(()=>{this.needRedraw()}))}get tooltipShow(){return this._tooltipShow.value}set tooltipShow(e){this._tooltipShow.value=e}get tooltipShowChanged(){return this._tooltipShow.changed}get isHoverZoom(){return this._isHoverZoom.value}set isHoverZoom(e){this._isHoverZoom.value=e}get isHoverZoomChanged(){return this._isHoverZoom.changed}set size(e){const[i,o]=e,[r,a]=this._size;(r!==i||a!==o)&&(this._size[0]=i,this._size[1]=o,this.needRedraw(),this.needPickRedraw())}get size(){return this._size}set _scale(e){const[i,o]=e,[r,a]=this.__scale;(r!==i||a!==o)&&(this.__scale[0]=i,this.__scale[1]=o,this.needRedraw(),this.needPickRedraw())}get _scale(){return this.__scale}set fgColor(e){if(!this._fgColor.every((i,o)=>e[o]===i)){const[i,o,r,a]=e;this._fgColor.splice(0,4,i,o,r,a),this._fgColorHexStr=c.getColorHexStr(this._fgColor),this.needRedraw()}}get fgColor(){return this._fgColor}set bgColor(e){if(!this._bgColor.every((i,o)=>e[o]===i)){const[i,o,r,a]=e;this._bgColor.splice(0,4,i,o,r,a),this._bgColorHexStr=c.getColorHexStr(this._bgColor),this.needRedraw()}}get bgColor(){return this._bgColor}set originRatioAndOffset(e){const[i,o,r,a]=this._originRatioAndOffset,[s,l,u,A]=e;(i!==s||o!==l||r!==u||a!==A)&&(this._originRatioAndOffset.splice(0,4,s,l,u,A),this.needRedraw(),this.needPickRedraw())}get originRatioAndOffset(){return this._originRatioAndOffset}set image(e){this._image!==e&&(this._image=e,this.needRedraw())}get image(){return this._image}set defaultColorStr(e){this._defaultColorStr!==e&&(this._defaultColorStr=e,this.needRedraw())}get defaultColorStr(){return this._defaultColorStr}set tooltip(e){this._tooltip!==e&&(this._tooltip=e,this.needRedraw())}get tooltip(){return this._tooltip}set title(e){this._title!==e&&(this._title=e,this.needRedraw())}get title(){return this._title}draw(e){if(!this._show)return;const[i,o]=this._winPos,r=this._size[0]*this.__scale[0],a=this._size[1]*this.__scale[1],{left:s,top:l,right:u,bottom:A}=c.getDrawRect([i,o],this._size,this.__scale,this._originRatioAndOffset),h=e.globalAlpha;if(e.globalAlpha=this.opacity,this._image){if(this.selected){const f=VP(this._image,[1,0,0]),{left:d,top:p}=c.getDrawRect([i,o],[r+6,a+6],[1,1],this._originRatioAndOffset);e.drawImage(f,d,p,r+6,a+6)}e.drawImage(this._image,s,l,r,a)}else e.fillStyle=this._fgColorHexStr,e.fillRect(s,l,r,a);if(this._title!==""&&c.drawTextBlock(e,i+20,o-16,[0,.5,0,0],this._title,"14px Arial",4,this._fgColorHexStr,this._bgColorHexStr),e.globalAlpha=h,this._hovered&&this._tooltip!==""){const f=e.globalAlpha;e.globalAlpha=this._tooltipAlpha,c.drawTextBlock(e,(s+u)*.5,l-5,[.5,1,0,0],this._tooltip,"12px Arial",4,this._fgColorHexStr,this._bgColorHexStr),e.globalAlpha=f}}drawForPick(e,i){if(!this._show)return;const[o,r]=this._winPos,a=i("default"),s=this._size[0]*this.__scale[0],l=this._size[1]*this.__scale[1],{left:u,top:A}=c.getDrawRect([o,r],this._size,this.__scale,this._originRatioAndOffset);e.fillStyle=a,e.fillRect(u,A,s,l)}}class yi extends c.Destroyable{constructor(e){super();L(this,"_pickedEvent",this.disposeVar(new c.Event));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_clickEvent",this.disposeVar(new c.Event));L(this,"_clickOutEvent",this.disposeVar(new c.Event));L(this,"_dbclickEvent",this.disposeVar(new c.Event));L(this,"_dbclickOutEvent",this.disposeVar(new c.Event));L(this,"_clickFunc",this.disposeVar(c.react(void 0)));L(this,"_clickFuncInit",(()=>{this.dispose(this.clickEvent.disposableOn(e=>this.clickFunc&&this.clickFunc(e)))})());L(this,"_geoCanvasPoi");if(this._geoCanvasPoi=this.disposeVar(new Wi(e)),!e.viewer)return;const{geoCanvasPoi:o}=this;o.canvasPoiClassAndCreateFunc=[NP,r=>new QP(this,r)],this.dispose(c.bind([o,"show"],[this,"show"])),this.dispose(c.bind([o,"enabled"],[this,"enabled"])),this.dispose(c.bind([o,"position"],[this,"position"])),this.dispose(c.bind([o,"positionEditing"],[this,"positionEditing"])),this.dispose(c.track([o,"viewDistanceRange"],[this,"viewDistanceRange"])),this.dispose(c.track([o,"viewDistanceDebug"],[this,"viewDistanceDebug"])),this.dispose(c.track([o,"zOrder"],[this,"zOrder"])),this.dispose(this.flyToEvent.disposableOn(r=>{o.flyTo(r)})),this.dispose(this._clickEvent.disposableOn(r=>{this.pickOnClick&&this.pickedEvent.emit(new c.ESJPickedResult({type:"viewerPicking",pointerEvent:r}))}));{const r=()=>{const a=Sp(this.clickFuncStr,["event"]);a&&(this.clickFunc=a)};r(),this.dispose(this.clickFuncStrChanged.disposableOn(r))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get clickEvent(){return this._clickEvent}get clickOutEvent(){return this._clickOutEvent}get dbclickEvent(){return this._dbclickEvent}get dbclickOutEvent(){return this._dbclickOutEvent}get clickFunc(){return this._clickFunc.value}set clickFunc(e){this._clickFunc.value=e}get clickFuncChanged(){return this._clickFunc.changed}get geoCanvasPoi(){return this._geoCanvasPoi}}L(yi,"defaults",{viewDistanceRange:[1e3,1e4,3e4,6e4],scale:[1,1]}),(t=>{t.createDefaultProps=()=>({show:!0,enabled:!0,position:c.reactArrayWithUndefined(void 0),positionEditing:!1,fgColor:c.reactArray([1,1,1,1]),bgColor:c.reactArray([0,0,0,0]),tooltip:"",tooltipShow:!0,title:"",size:c.reactArray([32,32]),scale:c.reactArray([1,1]),originRatioAndOffset:c.reactArray([.5,1,0,0]),hovered:!1,imageUri:"${earthsdk3-assets-script-dir}/assets/img/location.png",opacity:1,viewDistanceRange:c.reactArrayWithUndefined(void 0),viewDistanceDebug:!1,pickOnClick:!1,clickFuncStr:"",zOrder:0,isHoverZoom:!1})})(yi||(yi={})),c.extendClassProps(yi.prototype,yi.createDefaultProps);class Es extends c.Destroyable{constructor(e){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_commandEvent",this.disposeVar(new c.Event));L(this,"_dbclickEvent",this.disposeVar(new c.Event));const i=this;let o=Number.POSITIVE_INFINITY;this.dispose(this.enabledChanged.disposableOn(p=>{o=p??!1?Date.now():Number.POSITIVE_INFINITY}));const r=this.disposeVar(new c.Transition(100));r.reset(0);const a=this.disposeVar(c.createTimeoutWithStartValues(()=>r.target=0,1e3)),s=this.disposeVar(c.createTimeoutWithStartValues(()=>r.target=1,1e3)),l=this.disposeVar(new yi(e));l.originRatioAndOffset=[.5,.5,0,0],this.dispose(c.track([l,"tooltip"],[i,"title"]));{const p=()=>{l.size=this.mainPoiSize??[12,12]};p(),this.dispose(this.mainPoiSizeChanged.disposableOn(p))}{const p=()=>{l.fgColor=this.mainPoiFgColor??[1,1,1,1]};p(),this.dispose(this.mainPoiFgColorChanged.disposableOn(p))}{const p=()=>{l.bgColor=this.mainPoiBgColor??[0,0,0,.6]};p(),this.dispose(this.mainPoiBgColorChanged.disposableOn(p))}const u=this.disposeVar(c.createNextAnimateFrameEvent(i.showChanged,i.positionChanged,i.descriptionChanged,i.titleChanged,i.imageUriChanged)),A=()=>{l.show=i.show??!0,l.imageUri=i.imageUri??"${earthsdk3-assets-script-dir}/assets/img/point-yellow.png",l.position=i.position};A(),this.dispose(u.disposableOn(A)),this.dispose(c.bind([l,"position"],[this,"position"])),this.dispose(c.bind([l,"positionEditing"],[this,"positionEditing"])),this.dispose(this._flyToEvent.disposableOn(p=>l.flyTo(p)));const h=[],f=()=>{h.forEach(p=>{p.destroy()}),h.length=0};this.dispose(f);const d=()=>{f();const{commands:p}=i;if(!p)return;const g=p.length,v=50,y=0,m=-(g*v*Math.PI/180)*.5;for(let x=0;x<g;++x){const[_,E,B,P]=p[x],I=m+v*(x+.5)*Math.PI/180,M=Math.sin(I)*y,F=Math.cos(I)*y,S=new yi(e);S.imageUri=P,S.tooltip=E,S.bgColor=[0,0,0,.6],S.fgColor=[1,1,1,1],S.size=[24,24],S.dispose(c.track([S,"position"],[i,"position"])),S.originRatioAndOffset=[.5,.5,-M,F],S.show=!1,S.opacity=0,S.dispose(S.opacityChanged.disposableOn(T=>S.show=(T??1)>0)),S.dispose(S.clickEvent.disposableOn(T=>i.commandEvent.emit(_,T))),S.dispose(S.hoveredChanged.disposableOn(T=>T?a.cancel():a.restart())),S.dispose(r.currentChanged.disposableOn(T=>S.enabled=T===1)),h.push(S)}};d(),this.dispose(i.commandsChanged.disposableOn(d)),this.dispose(l.hoveredChanged.disposableOn(p=>p?a.cancel():a.restart())),this.dispose(l.hoveredChanged.disposableOn(p=>p?i.enabled&&s.restart():s.cancel())),this.dispose(r.currentChanged.disposableOn(p=>{const g=h.length,v=50,y=p*35,m=-(g*v*Math.PI/180)*.5;for(let x=0;x<g;++x){const _=m+v*(x+.5)*Math.PI/180,E=Math.sin(_)*y,B=Math.cos(_)*y;h[x].originRatioAndOffset=[.5,.5,-E,B],h[x].opacity=p}})),this.dispose(l.clickEvent.disposableOn(p=>{if(!i.enabled)return;const g=p.__xbsj_listenerTime__;if(!(g!==void 0&&o>g))if(p.button===0)if(i.clickCommandName)i.commandEvent.emit(i.clickCommandName,p);else{if(r.current>0&&r.current<1)return;r.target=r.target===1?0:1}else p.button===2&&i.rightClickCommandName&&i.commandEvent.emit(i.rightClickCommandName,p)})),this.dispose(l.clickOutEvent.disposableOn(()=>{i.enabled&&(r.target=0)})),this.dispose(i.commandEvent.disposableOn(()=>r.target=0)),this.dispose(l.dbclickEvent.disposableOn(p=>{if(!i.enabled)return;const g=p.__xbsj_listenerTime__;g!==void 0&&o>g||(i.dbclickEvent.emit(p),s.isRunning&&a.cancel(),r.target=0)})),this.dispose(r.targetChanged.disposableOn(p=>p===1?a.restart():a.cancel())),this.dispose(r.targetChanged.disposableOn(p=>p===1&&s.cancel())),this.dispose(r.targetChanged.disposableOn(p=>l.tooltipShow=p===0))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get commandEvent(){return this._commandEvent}get dbclickEvent(){return this._dbclickEvent}}(t=>{t.createDefaultProps=()=>({show:!0,enabled:!0,position:c.reactArrayWithUndefined(void 0),positionEditing:!1,title:"",description:"",imageUri:"${earthsdk3-assets-script-dir}/assets/img/point-yellow.png",commands:c.reactDeepArrayWithUndefined(void 0,(n,e)=>n.every((i,o)=>i===e[o]),n=>[...n]),clickCommandName:"",rightClickCommandName:"",mainPoiSize:c.reactArrayWithUndefined(void 0),mainPoiBgColor:c.reactArrayWithUndefined(void 0),mainPoiFgColor:c.reactArrayWithUndefined(void 0)})})(Es||(Es={})),c.extendClassProps(Es.prototype,Es.createDefaultProps);const zp=`class MyDiv {
201
+ `}else M="";h&&(v=b.ShaderProgram.fromCache({context:r,vertexShaderSource:new b.ShaderSource({sources:[this.vertexShaderSource]}),fragmentShaderSource:new b.ShaderSource({sources:[M,this.fragmentShaderSource]}),attributeLocations:h}),y?y.shaderProgram=v:A=!0)}A&&(A=!1,y||g&&v&&(y=new b.DrawCommand({vertexArray:g,primitiveType:this.primitiveType,renderState:b.RenderState.fromCache(this.renderState),shaderProgram:v,owner:this,uniformMap:this.uniformMap,pass:this.pass,modelMatrix:this.modelMatrix,boundingVolume:this.boundingVolume,cull:this.cull,occlude:this.occlude,count:this.count,offset:this.offset,instanceCount:this.instanceCount,castShadows:this.castShadows,receiveShadows:this.receiveShadows,pickId:this.allowPicking?"xbsjPickColor220823":void 0,pickOnly:this.pickOnly,debugShowBoundingVolume:this.debugShowBoundingVolume,depthForTranslucentClassification:this.depthForTranslucentClassification}),this._drawCommand=y,y.debugOverlappingFrustums=this.debugOverlappingFrustums,y.executeInClosestFrustum=this.executeInClosestFrustum)),y&&E.commandList.push(y)};this.dispose(this._updateEvent.disposableOn(_))}get drawCommand(){return this._drawCommand}get ESSceneObjectID(){return this._ESSceneObjectID.value}set ESSceneObjectID(e){this._ESSceneObjectID.value=e}get ESSceneObjectIDChanged(){return this._ESSceneObjectID.changed}update(e){this.show&&this._updateEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({modelMatrix:c.react(new b.Matrix4,b.Matrix4.equals,b.Matrix4.clone),boundingVolume:void 0,pass:b.Pass.OPAQUE,attributes:{},cull:!0,occlude:!0,count:void 0,offset:0,indexTypedArray:void 0,instanceCount:0,vertexShaderSource:"",fragmentShaderSource:"",castShadows:!1,receiveShadows:!1,uniformMap:{},renderState:{},primitiveType:b.PrimitiveType.TRIANGLES,executeInClosestFrustum:!1,owner:void 0,debugShowBoundingVolume:!1,debugOverlappingFrustums:0,allowPicking:void 0,pickOnly:!1,depthForTranslucentClassification:!1})})(ol||(ol={})),c.extendClassProps(ol.prototype,ol.createDefaultProps);function RP(t){let n,e;if(t instanceof b.BoundingSphere)e=Ue(t.center),n=t.radius*5;else if(t instanceof b.BoundingRectangle){const{x:i,y:o,width:r,height:a}=t,s=b.Rectangle.fromRadians(i,o,i+r,o+a),l=b.BoundingSphere.fromRectangle2D(s);e=Ue(l.center),n=l.radius*5}else if(t instanceof b.OrientedBoundingBox){e=Ue(t.center);const i=t.halfAxes,o=c.Vector.magnitude([i[0],i[1],i[2]]),r=c.Vector.magnitude([i[3],i[4],i[5]]),a=c.Vector.magnitude([i[6],i[7],i[8]]);n=Math.max(o,r,a)*5}if(!(!e||n===void 0))return[e,n]}const vt=class vt extends c.Destroyable{constructor(e,i){super();L(this,"_attributes",this.disposeVar(c.react(void 0)));L(this,"_indexTypedArray",this.disposeVar(c.react(void 0)));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_sceneScaleEvent",this.disposeVar(new c.Event));L(this,"_nativePrimitive");L(this,"_lastCzmPickResult");L(this,"_czmViewVisibleDistanceRangeControl");L(this,"_id",this.disposeVar(c.react(c.createGuid())));this._czmViewer=e,i&&(this.id=i),this._czmViewVisibleDistanceRangeControl=this.disposeVar(new fo(this.czmViewer,[this,"viewDistanceRange"],[this,"position"]));const o=e.viewer;if(!o)return;this.dispose(c.track([this._czmViewVisibleDistanceRangeControl,"debug"],[this,"viewDistanceDebug"]));const{scene:r}=o,{context:a}=r,s=o.scene.primitives.add(new ol(o.scene,i));this._nativePrimitive=s,this.dispose(()=>o.scene.primitives.remove(s));{const A=this.disposeVar(c.createNextAnimateFrameEvent(this.allowPickingDepthChanged));this.disposeVar(new c.ObjResettingWithEvent(A,()=>{if(!this.allowPickingDepth)return this.allowPickingDepth?void 0:new ot.ObjectsToExcludeWrapper(this.czmViewer,[s])}))}const l=c.react(void 0);{const A=()=>{let h;if(this.position&&this.pixelSize){const f=b.Cartesian3.fromDegrees(...this.position);f&&(h=Ni(o.scene,f,this.pixelSize),h&&(this.maximumScale!==void 0&&h>this.maximumScale&&(h=this.maximumScale),this.minimumScale!==void 0&&h<this.minimumScale&&(h=this.minimumScale)))}l.value=h};A(),this.dispose(o.scene.preUpdate.addEventListener(A))}{const A=()=>{this.sceneScaleEvent.emit(l.value,this.czmViewer)};A(),this.dispose(l.changed.disposableOn(A))}this.disposeVar(new _0(e,[this,"showSceneScale"],[this,"position"],l));{const A=()=>{s.show=(this.show??!0)&&this.visibleAlpha>0};A(),this.dispose(this.showChanged.disposableOn(A)),this.dispose(this.visibleAlphaChanged.disposableOn(A))}const u=this.disposeVar(c.react(void 0));{const A=()=>{const f=st({localScale:this.localScale,initialRotation:"yForwardzUp",localRotation:this.localRotation,localPosition:this.localPosition,localModelMatrix:this.localModelMatrix,sceneScaleFromPixelSize:l.value,scale:this.scale,rotation:this.rotation,position:this.position,modelMatrix:this.modelMatrix});if(!f){console.warn("computeCzmModelMatrix error!");return}u.value=f,s.modelMatrix=f};A();let h=!0;this.dispose(this.showChanged.disposableOn(()=>h=!0)),this.dispose(this.localPositionChanged.disposableOn(()=>h=!0)),this.dispose(this.localRotationChanged.disposableOn(()=>h=!0)),this.dispose(this.localScaleChanged.disposableOn(()=>h=!0)),this.dispose(this.localModelMatrixChanged.disposableOn(()=>h=!0)),this.dispose(this.positionChanged.disposableOn(()=>h=!0)),this.dispose(this.rotationChanged.disposableOn(()=>h=!0)),this.dispose(this.scaleChanged.disposableOn(()=>h=!0)),this.dispose(this.modelMatrixChanged.disposableOn(()=>h=!0)),this.dispose(l.changed.disposableOn(()=>h=!0)),this.dispose(o.scene.preUpdate.addEventListener(()=>{h&&(h&&(h=!1),A())}))}{const A=()=>{const{boundingVolume:d=vt.defaultBoundingVolume}=this;if(!d){s.boundingVolume=void 0;return}if(d.type==="BoundingRectangle"){s.boundingVolume=b.BoundingRectangle.fromRectangle(b.Rectangle.fromDegrees(...d.data));return}if(d.type==="BoundingSphere"){s.boundingVolume=new b.BoundingSphere(b.Cartesian3.fromDegrees(...d.data.center),d.data.radius);return}},h=()=>{const{boundingVolume:d=vt.defaultBoundingVolume}=this;if(!d){s.boundingVolume=void 0;return}if(d.type==="LocalBoundingSphere"){const p=u.value??b.Matrix4.IDENTITY,g=b.Matrix4.multiplyByPoint(p,b.Cartesian3.fromArray(d.data.center),new b.Cartesian3);s.boundingVolume=new b.BoundingSphere(g,d.data.radius);return}if(d.type==="LocalAxisedBoundingBox"){const p=u.value??b.Matrix4.IDENTITY,{min:g,max:v}=d.data,y=new b.Cartesian3(.5*(g[0]+v[0]),.5*(g[1]+v[1]),.5*(g[2]+v[2])),m=b.Matrix4.multiplyByPoint(p,y,y),x=new b.Cartesian3(.5*(v[0]-g[0]),.5*(v[1]-g[1]),.5*(v[2]-g[2]));x.x=x.x===0?1:x.x,x.y=x.y===0?1:x.y,x.z=x.z===0?1:x.z;const _=new b.Matrix3(x.x,0,0,0,x.y,0,0,0,x.z),E=b.Matrix4.getMatrix3(p,new b.Matrix3),B=b.Matrix3.multiply(E,_,E);s.boundingVolume=new b.OrientedBoundingBox(m,B);return}},f=()=>{A(),h()};f(),this.dispose(this.boundingVolumeChanged.disposableOn(f)),this.dispose(u.changed.disposableOn(h))}this.dispose(c.track([s,"allowPicking"],[this,"allowPicking"]));{const A=()=>{s.indexTypedArray=this.indexTypedArray??vt.defaultIndexTypedArray};A(),this.dispose(this.indexTypedArrayChanged.disposableOn(A))}{const A=()=>{s.attributes=this.attributes??vt.defaultAttribute};A(),this.dispose(this.attributesChanged.disposableOn(A))}{const A=()=>{s.renderState=this.renderState??vt.defaultRenderState};A(),this.dispose(this.renderStateChanged.disposableOn(A))}{const A=()=>{s.vertexShaderSource=this.vertexShaderSource??vt.defaultVertexShaderSource};A(),this.dispose(this.vertexShaderSourceChanged.disposableOn(A))}{const A=()=>{s.fragmentShaderSource=this.fragmentShaderSource??vt.defaultFragmentShaderSource};A(),this.dispose(this.fragmentShaderSourceChanged.disposableOn(A))}{const A=()=>s.cull=this.cull??!0;A(),this.dispose(this.cullChanged.disposableOn(A))}{const A=()=>s.pass=b.Pass[this.pass??"TRANSLUCENT"];A(),this.dispose(this.passChanged.disposableOn(A))}{const A=()=>s.primitiveType=b.PrimitiveType[this.primitiveType??"TRIANGLES"];A(),this.dispose(this.primitiveTypeChanged.disposableOn(A))}{const A=()=>s.occlude=this.occlude??!0,h=()=>s.count=this.count,f=()=>s.offset=this.offset??0,d=()=>s.instanceCount=this.instanceCount??0,p=()=>s.castShadows=this.castShadows??!1,g=()=>s.receiveShadows=this.receiveShadows??!1;A(),h(),f(),d(),p(),g(),this.dispose(this.occludeChanged.disposableOn(A)),this.dispose(this.countChanged.disposableOn(h)),this.dispose(this.offsetChanged.disposableOn(f)),this.dispose(this.instanceCountChanged.disposableOn(d)),this.dispose(this.castShadowsChanged.disposableOn(p)),this.dispose(this.receiveShadowsChanged.disposableOn(g))}{const A=()=>s.executeInClosestFrustum=this.executeInClosestFrustum??!1,h=()=>s.debugShowBoundingVolume=this.debugShowBoundingVolume??!1,f=()=>s.debugOverlappingFrustums=this.debugOverlappingFrustums??0,d=()=>s.pickOnly=this.pickOnly??!1,p=()=>s.depthForTranslucentClassification=this.depthForTranslucentClassification??!1;A(),h(),f(),d(),p(),this.dispose(this.executeInClosestFrustumChanged.disposableOn(A)),this.dispose(this.debugShowBoundingVolumeChanged.disposableOn(h)),this.dispose(this.debugOverlappingFrustumsChanged.disposableOn(f)),this.dispose(this.pickOnlyChanged.disposableOn(d)),this.dispose(this.depthForTranslucentClassificationChanged.disposableOn(p))}{const A=new Map;this.dispose(()=>{for(let g of A.values())g&&g.destroy();A.clear()});const h=new Map;this.dispose(()=>{for(let g of h.values())g.destroy();h.clear()});let f;const d=()=>{if(f){for(let g of Object.values(f))g.destroy();f=void 0}};this.dispose(d);const p=()=>{const g={},v=this.uniformMap??vt.defaultUniformMap;d(),f={};let y=[];for(let m of Object.keys(v)){const x=v[m];if(x==null){console.error(`updateUniformMap [${m}] error: !uniformValue`);continue}if(Array.isArray(x)){const _=x.length,B=(_===2?b.Cartesian2:_===3?b.Cartesian3:b.Cartesian4).fromArray(x);g[m]=()=>B}else if(typeof x=="number")g[m]=()=>x;else if("type"in x&&x.type==="image"){const _=new At(e);_.enabled=!0,_.uri=x.uri,_.uriType="img",f[m]=_,g[m]=()=>_.texture?_.texture:a.defaultTexture}else"type"in x&&x.type==="texture"&&(x.id||console.warn(`uniform变量设置错误:${m} 的配置中id未设置或者无效!id为${x.id}`),g[m]=()=>{const _=window.czmTexture[x.id];return _?_.texture:a.defaultTexture})}g.u_xe2VisibleAlpha=()=>this.visibleAlpha,s.uniformMap=g;for(let m of A.keys())if(!y.includes(m)){const x=A.get(m);x==null||x.destroy(),A.delete(m)}for(let m of h.keys())if(!y.includes(m)){const x=h.get(m);x==null||x.destroy(),h.delete(m)}};p(),this.dispose(this.uniformMapChanged.disposableOn(p))}this.dispose(this.flyToEvent.disposableOn(A=>{if(!s.boundingVolume){console.warn("CzmCustomPrimitive没有设置boundingVolume属性,无法飞入(flyTo)!");return}const h=RP(s.boundingVolume);if(!h){console.warn("无法计算viewDistance!");return}const[f,d]=h;Fe(o,f,d,void 0,A)}))}get attributesJson(){return this.attributes&&_P(this.attributes)}set attributesJson(e){const i=JSON.stringify(this.attributesJson),o=JSON.stringify(e);i!==o&&(this.attributes=e&&CP(e))}get attributesJsonChanged(){return this.attributesChanged}get indexTypedArrayJson(){return this.indexTypedArray&&SP(this.indexTypedArray)}set indexTypedArrayJson(e){const i=JSON.stringify(this.indexTypedArrayJson),o=JSON.stringify(e);i!==o&&(this.indexTypedArray=e&&EP(e))}get indexTypedArrayJsonChanged(){return this.indexTypedArrayChanged}get attributes(){return this._attributes.value}set attributes(e){this._attributes.value=e}get attributesChanged(){return this._attributes.changed}get indexTypedArray(){return this._indexTypedArray.value}set indexTypedArray(e){this._indexTypedArray.value=e}get indexTypedArrayChanged(){return this._indexTypedArray.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get sceneScaleEvent(){return this._sceneScaleEvent}get czmViewer(){return this._czmViewer}get nativePrimitive(){return this._nativePrimitive}get czmViewerVisibleDistanceRangeControl(){return this._czmViewVisibleDistanceRangeControl}get visibleAlpha(){return this._czmViewVisibleDistanceRangeControl.visibleAlpha}get visibleAlphaChanged(){return this._czmViewVisibleDistanceRangeControl.visibleAlphaChanged}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}setUniformMap(e){if(Object.entries(e).some(([o,r])=>(console.warn(`setUniformMap error: key: ${o} value: ${r}`),r===null)))return;const i={...this.uniformMap??{},...e};this.uniformMap=i}setLocalBoundingSphere(e,i=[0,0,0]){if(!Number.isFinite(e)||e<=0){console.warn(`!Number.isFinite(radius) || radius <= 0 radius: ${e}`);return}this.boundingVolume={type:"LocalBoundingSphere",data:{center:i,radius:e}}}setLocalAxisedBoundingBox(e,i){if(e.some(o=>!Number.isFinite(o))||i.some(o=>!Number.isFinite(o))){console.warn(`setLocalAxisedBoundingBox error, min: ${e.toString()}, max: ${i.toString()}`);return}this.boundingVolume={type:"LocalAxisedBoundingBox",data:{min:e,max:i}}}computeLocalAxisedBoundingBoxFromAttribute(e="a_position"){if(!this.attributes||!this.attributes[e]){console.warn(`attributes[${e}]不存在!无法获取!`);return}const i=this.attributes[e];if(!("typedArray"in i)||!(i.typedArray instanceof Float32Array)){console.warn(`!('typedArray' in posAttribute) || !(posAttribute.typedArray instanceof Float32Array) attributeName: ${e}`);return}if(!("componentsPerAttribute"in i)||i.componentsPerAttribute!==3){console.warn(`!('componentsPerAttribute' in posAttribute) || posAttribute.componentsPerAttribute !== 3 attributeName: ${e}`);return}const{min:o,max:r}=vt.getMinMaxPosition(i.typedArray);if(!o.some(a=>!Number.isFinite(a)||r.some(s=>!Number.isFinite(s))))return{min:o,max:r}}};L(vt,"defaultRenderState",gP),L(vt,"defaultVertexShaderSource",pP),L(vt,"defaultFragmentShaderSource",dP),L(vt,"defaultUniformMap",yP),L(vt,"defaultBoundingVolume",mP),L(vt,"defaultAttribute",vP),L(vt,"defaultIndexTypedArray",wP),L(vt,"defaultDsAttribute",bP),L(vt,"defaultDsIndexTypedArray",xP),L(vt,"triangleIndicesToLine",PP),L(vt,"defaults",{position:[116.39,39.9,0],rotation:[0,0,0],scale:[1,1,1],modelMatrix:[-.8957893500750183,-.4444788412198901,0,0,.28511078894078473,-.5746037485691958,.7671651518152995,0,-.3409886777031455,.68721837274483,.6414496315691579,0,-2.1778739967047274e6,4389222053178148e-9,4.0694736755001387e6,1],viewDistanceRange:[1e3,1e4,3e4,6e4]}),L(vt,"getMinMaxPosition",c.getMinMaxPosition);let at=vt;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:!1,allowPickingDepth:!0,position:c.reactArrayWithUndefined(void 0),rotation:c.reactArrayWithUndefined(void 0),scale:c.reactArrayWithUndefined(void 0),maximumScale:void 0,minimumScale:void 0,pixelSize:void 0,showSceneScale:void 0,modelMatrix:c.reactArrayWithUndefined(void 0),cull:c.react(void 0),boundingVolume:c.reactJson(void 0),renderState:c.reactJson(void 0),primitiveType:void 0,pass:void 0,vertexShaderSource:void 0,fragmentShaderSource:void 0,uniformMap:c.reactJson(void 0),localPosition:c.reactArrayWithUndefined(void 0),localRotation:c.reactArrayWithUndefined(void 0),localScale:c.reactArrayWithUndefined(void 0),localModelMatrix:c.reactArrayWithUndefined(void 0),occlude:void 0,count:void 0,offset:void 0,instanceCount:void 0,castShadows:void 0,receiveShadows:void 0,executeInClosestFrustum:void 0,debugShowBoundingVolume:void 0,debugOverlappingFrustums:void 0,pickOnly:void 0,depthForTranslucentClassification:void 0,viewDistanceRange:c.reactArrayWithUndefined(void 0),viewDistanceDebug:!1})})(at||(at={})),c.extendClassProps(at.prototype,at.createDefaultProps);class UP extends c.PosFloatDiv{constructor(){super(),this.contentDiv.style.backgroundColor="rgba(0, 0, 0, 0.8)",this.contentDiv.style.borderRadius="3px",this.contentDiv.style.color="rgb(255, 255, 255)",this.contentDiv.style.padding="1px 5px 1px 5px",this.contentDiv.style.fontSize="12px",this.contentDiv.style.whiteSpace="nowrap",this.contentDiv.innerText="未定义光标信息!",this.originRatioX=0,this.originRatioY=0,this.originOffsetX=-16}}class OP extends c.Destroyable{constructor(e,i){super();L(this,"_cursorDiv");L(this,"_pointerOut",this.disposeVar(c.react(!0)));L(this,"_show",this.disposeVar(c.react(!0)));this._cursorDiv=new c.DivPoi(i,e),this.dispose(()=>this._cursorDiv.destroy());const o=s=>{const[l,u]=c.getDomEventCurrentTargetPos(s);this._cursorDiv.floatDiv.winPos=[l,u],this._pointerOut.value=!1};e.addEventListener("pointermove",o),this.dispose(()=>e.removeEventListener("pointermove",o));const r=s=>{this._pointerOut.value=!0};e.addEventListener("pointerout",r),this.dispose(()=>e.removeEventListener("pointerout",r)),e.addEventListener("pointerleave",r),this.dispose(()=>e.removeEventListener("pointerleave",r)),e.addEventListener("pointercancel",r),this.dispose(()=>e.removeEventListener("pointercancel",r));const a=()=>{this._cursorDiv.show=this.show&&!this._pointerOut.value};a(),this.dispose(this.showChanged.disposableOn(a)),this.dispose(this._pointerOut.changed.disposableOn(a))}set show(e){this._show.value=e}get show(){return this._show.value}get showChanged(){return this._show.changed}reset(){this._pointerOut.value=!0}get cursorDiv(){return this._cursorDiv}set text(e){this._cursorDiv.floatDiv.contentDiv.innerText=e}get text(){return this._cursorDiv.floatDiv.contentDiv.innerText}}class LP extends c.Destroyable{constructor(e,i){super();L(this,"_show",this.disposeVar(c.react(!0)));L(this,"_winPosFromCartesian");L(this,"_near",this.disposeVar(c.react(0)));L(this,"_far",this.disposeVar(c.react(Number.POSITIVE_INFINITY)));L(this,"_actualShow",this.disposeVar(c.react(!1)));this._czmPoisContext=e;const{viewer:o,cameraChanged:r}=this._czmPoisContext;this._winPosFromCartesian=i||this.disposeVar(new Ch(o,!0,r));let a=0,s=Number.POSITIVE_INFINITY;this.dispose(this._near.changed.disposableOn(u=>a=u*u)),this.dispose(this._far.changed.disposableOn(u=>s=u*u));const l=this.disposeVar(c.createNextMicroTaskEvent(this._near.changed,this._far.changed,this._show.changed,this._winPosFromCartesian.changed,r.changed));this.dispose(l.disposableOn(()=>{if(!this.show){this._actualShow.value=!1;return}const u=b.Cartesian3.distanceSquared(o.camera.positionWC,this._winPosFromCartesian.cartesian),A=u>=a&&u<=s;this._actualShow.value=A&&this._winPosFromCartesian.winPosValid&&!this._czmPoisContext.isPointOccludedByEarth(this._winPosFromCartesian.cartesian)}))}get actualShowChanged(){return this._actualShow.changed}get actualShow(){return this._actualShow.value}set cartesian(e){this._winPosFromCartesian.cartesian=e}get cartesian(){return this._winPosFromCartesian.cartesian}get winPosFromCartesian(){return this._winPosFromCartesian}set show(e){this._show.value=e}get show(){return this._show.value}set near(e){this._near.value=e}get near(){return this._near.value}set far(e){this._far.value=e}get far(){return this._far.value}}class Op extends LP{constructor(e,i,o){super(i,o);L(this,"_canvasPoi");L(this,"_zOrderChanged");L(this,"_zOrder");L(this,"depth",0);const{canvasPrimitivesContext:r}=this._czmPoisContext;this._canvasPoi=this.disposeVar(new e(r));const a=()=>{if(this.actualShow&&this.winPosFromCartesian.winPosValid){const{left:s,top:l,depth:u}=this.winPosFromCartesian.winPos;this._canvasPoi.winPos=[s,l],this.depth=u,this._canvasPoi.depth=this.zOrder??u,this._canvasPoi.show=!0}else this._canvasPoi.show=!1};this.d(this.zOrderChanged.don(()=>{a()})),this.dispose(this.winPosFromCartesian.changed.disposableOn(()=>{a()})),this.dispose(this.actualShowChanged.disposableOn(s=>{this._canvasPoi.show=s,a()}))}get canvasPoi(){return this._canvasPoi}set zOrder(e){this._zOrder!==e&&(this._zOrder=e,this.zOrderChanged.emit())}get zOrder(){return this._zOrder}get zOrderChanged(){return this._zOrderChanged||(this._zOrderChanged=new c.Event),this._zOrderChanged}}class Lp extends c.Destroyable{constructor(e,i,o){super();L(this,"_divPoi");L(this,"_show",!0);L(this,"_occludedByEarth",!0);L(this,"_winPosFromCartesian");L(this,"_zOrderChanged");L(this,"_zOrder");L(this,"depth",0);this._czmPoisContext=i;const{viewer:r,divContainer:a,cameraChanged:s}=this._czmPoisContext;this._winPosFromCartesian=o||this.disposeVar(new Ch(r,!0,s)),this._divPoi=new c.DivPoi(e,a),this.dispose(()=>this._divPoi.destroy()),this.dispose(this._winPosFromCartesian.changed.disposableOn((l,u)=>{this._occludedByEarth=!l||this._czmPoisContext.isPointOccludedByEarth(this._winPosFromCartesian.cartesian);const{left:A,top:h,depth:f}=u,{floatDiv:d}=this._divPoi;d.winPos=[A,h],this.depth=Math.round((1-f)*1e11),d.element.style.zIndex=`${this.zOrder||this.depth}`,this._updateShow()})),this.d(this.zOrderChanged.don(()=>{const{floatDiv:l}=this._divPoi;l.element.style.zIndex=`${this.zOrder||this.depth}`,this._updateShow()}))}get divPoi(){return this._divPoi}_updateShow(){this._divPoi.show=this._show&&!this._occludedByEarth&&this._winPosFromCartesian.winPosValid}set cartesian(e){this._winPosFromCartesian.cartesian=e}get cartesian(){return this._winPosFromCartesian.cartesian}get winPosFromCartesian(){return this._winPosFromCartesian}set show(e){this._show!==e&&(this._show=e,this._updateShow())}get show(){return this._show}set zOrder(e){this._zOrder!==e&&(this._zOrder=e,this.zOrderChanged.emit())}get zOrder(){return this._zOrder}get zOrderChanged(){return this._zOrderChanged||(this._zOrderChanged=new c.Event),this._zOrderChanged}}class zP extends c.Destroyable{constructor(e,i,o,r){super();L(this,"_czmCanvasPoi");L(this,"_czmDivPoi");L(this,"_show",!0);L(this,"_winPosFromCartesian");L(this,"_switchTransition");L(this,"_status","Canvas");L(this,"_statusChanged");this._czmPoisContext=o;const{viewer:a,cameraChanged:s}=this._czmPoisContext;this._winPosFromCartesian=r||this.disposeVar(new Ch(a,!0,s)),this._czmCanvasPoi=new Op(e,this._czmPoisContext,this._winPosFromCartesian),this.dispose(()=>this._czmCanvasPoi.destroy()),this._czmDivPoi=new Lp(i,this._czmPoisContext,this._winPosFromCartesian),this.dispose(()=>this._czmDivPoi.destroy()),this._switchTransition=new c.Transition(300),this.dispose(this._switchTransition.currentChanged.disposableOn((l,u)=>{this._updateShow(),this._czmCanvasPoi.canvasPoi.opacity=1-u,this._czmDivPoi.divPoi.floatDiv.opacity=u})),this._updateShow()}_updateShow(){this._czmCanvasPoi.show=this._show&&this._switchTransition.current<1,this._czmDivPoi.show=this._show&&this._switchTransition.current>0}set show(e){this._show!==e&&(this._show=e,this._updateShow())}get show(){return this._show}set cartesian(e){this._winPosFromCartesian.cartesian=e}get cartesian(){return this._winPosFromCartesian.cartesian}get winPosFromCartesian(){return this._winPosFromCartesian}set status(e){this._status!==e&&(this._status=e,this._switchTransition.target=this._status==="Canvas"?0:1,this._statusChanged&&this._statusChanged.emit(this._status))}get status(){return this._status}get statusChanged(){return this._statusChanged||(this._statusChanged=new c.Event),this._statusChanged}get czmCanvasPoi(){return this._czmCanvasPoi}get czmDivPoi(){return this._czmDivPoi}}class U0 extends c.Destroyable{constructor(e,i=!0){super();L(this,"_divContainer");L(this,"_canvasPrimitivesContext");L(this,"_isPointOccludedByEarth");L(this,"_poiClickedEvent");L(this,"_clickEvent",this.disposeVar(new c.Event));L(this,"_dbclickEvent",this.disposeVar(new c.Event));L(this,"_downEvent",this.disposeVar(new c.Event));L(this,"_upEvent",this.disposeVar(new c.Event));L(this,"_moveEvent",this.disposeVar(new c.Event));L(this,"_outEvent",this.disposeVar(new c.Event));L(this,"_cameraChanged");this._viewer=e,this._useInnerInteraction=i,this._cameraChanged=new xh(this._viewer.scene);const o=this._viewer.canvas.parentElement;this._divContainer=o;const r=document.createElement("div");r.style.position="absolute",r.style.left="0px",r.style.top="0px",r.style.width="100%",r.style.height="100%",r.style.pointerEvents="none",o.appendChild(r),this.dispose(()=>{o.removeChild(r)});const a=new c.CanvasPrimitivesContext;this._canvasPrimitivesContext=a,this.dispose(()=>{this._canvasPrimitivesContext.destroy()}),r.appendChild(a.element);{const h=new b.EllipsoidalOccluder(b.Ellipsoid.WGS84,new b.Cartesian3),f=new xh(this._viewer.scene);this.dispose(()=>f.destroy());const d=()=>h.cameraPosition=this._viewer.camera.positionWC;this.dispose(f.changed.disposableOn(d)),d();const p=g=>!h.isPointVisible(g);this._isPointOccludedByEarth=p}this.dispose(this._clickEvent.disposableOn((h,f,d)=>{const p=a.pick(h,f,1,1);if(p.length>0){this._poiClickedEvent&&this._poiClickedEvent.emit(!0);const{poi:g,tag:v}=p[0];for(let y of a.pois)y===g?y.hasClickEvent()&&y.clickEvent.emit(h,f,v,y,d):y.hasClickOutEvent()&&y.clickOutEvent.emit(h,f,"",y,d)}else{this._poiClickedEvent&&this._poiClickedEvent.emit(!1);for(let g of a.pois)g.hasClickOutEvent()&&g.clickOutEvent.emit(h,f,"",g,d)}})),this.dispose(this._dbclickEvent.disposableOn((h,f,d)=>{const p=a.pick(h,f,1,1);if(p.length>0){this._poiClickedEvent&&this._poiClickedEvent.emit(!0);const{poi:g,tag:v}=p[0];for(let y of a.pois)y===g?y.hasDbclickEvent()&&y.dbclickEvent.emit(h,f,v,y,d):y.hasDbclickOutEvent()&&y.dbclickOutEvent.emit(h,f,"",y,d)}else{this._poiClickedEvent&&this._poiClickedEvent.emit(!1);for(let g of a.pois)g.hasDbclickOutEvent()&&g.dbclickOutEvent.emit(h,f,"",g,d)}}));let s;this.dispose(this._downEvent.disposableOn((h,f)=>{s&&(s.actived=!1);const d=a.pick(h,f,1,1);if(d.length>0){const{poi:p,tag:g}=d[0];p instanceof c.CanvasPoi&&(p.actived=!0,s=p)}})),this.dispose(this._upEvent.disposableOn(()=>{s&&(s.actived=!1,s=void 0)}));let l;function u(h){l!==h&&(l&&(l.hovered=!1),l=h,l&&(l.hovered=!0))}const A=this._moveEvent.disposableOn((h,f)=>{let d;const p=a.pick(h,f,1,1);if(p.length>0){const g=p[0].poi;g instanceof c.CanvasPrimitive&&(d=g)}u(d)});if(this.dispose(A),this.dispose(this._outEvent.disposableOn((h,f,d)=>{u(void 0)})),this._useInnerInteraction){const h=this._viewer.canvas.parentElement,f=this.disposeVar(c.DomElementEvent.create(h,"pointerdown")),d=this.disposeVar(c.DomElementEvent.create(h,"pointermove")),p=this.disposeVar(c.DomElementEvent.create(h,"pointerup")),g=this.disposeVar(c.DomElementEvent.create(h,"pointerout")),v=this.disposeVar(new c.PointerClick),y=this.disposeVar(new c.PointerHover);this.dispose(f.disposableOn(m=>v.pointerDown(m))),this.dispose(d.disposableOn(m=>v.pointerMove(m))),this.dispose(p.disposableOn(m=>v.pointerUp(m))),this.dispose(g.disposableOn(m=>v.pointerOut(m))),this.dispose(f.disposableOn(m=>y.pointerDown(m))),this.dispose(d.disposableOn(m=>y.pointerMove(m))),this.dispose(p.disposableOn(m=>y.pointerUp(m))),this.dispose(g.disposableOn(m=>y.pointerOut(m))),this.dispose(v.clickEvent.disposableOn(m=>{const[x,_]=c.getDomEventCurrentTargetPos(m);m.button===0?this._clickEvent.emit(x,_,m):m.button===2&&this._clickEvent.emit(x,_,m)})),this.dispose(v.dbclickEvent.disposableOn(m=>{const[x,_]=c.getDomEventCurrentTargetPos(m);m.button===0&&this._dbclickEvent.emit(x,_,m)})),this.dispose(f.disposableOn(m=>{const[x,_]=c.getDomEventCurrentTargetPos(m);m.button===0&&this._downEvent.emit(x,_,m)})),this.dispose(p.disposableOn(m=>{const[x,_]=c.getDomEventCurrentTargetPos(m);m.button===0&&this._upEvent.emit(x,_,m)})),this.dispose(d.disposableOn(m=>{const[x,_]=c.getDomEventCurrentTargetPos(m);this._moveEvent.emit(x,_,m)})),this.dispose(g.disposableOn(m=>{const[x,_]=c.getDomEventCurrentTargetPos(m);this._outEvent.emit(x,_,m)}))}}get useInnerInteraction(){return this._useInnerInteraction}get divContainer(){return this._divContainer}get canvasPrimitivesContext(){return this._canvasPrimitivesContext}get viewer(){return this._viewer}get cameraChanged(){return this._cameraChanged}isPointOccludedByEarth(e){return this._isPointOccludedByEarth(e)}get poiClickedEvent(){return this._poiClickedEvent||(this._poiClickedEvent=new c.Event),this._poiClickedEvent}pointerClick(...e){this._useInnerInteraction?console.warn("当前使用内置交互(useInnerInteraction为true),此函数无效!"):this._clickEvent.emit(...e)}pointerDbclick(...e){this._useInnerInteraction?console.warn("当前使用内置交互(useInnerInteraction为true),此函数无效!"):this._dbclickEvent.emit(...e)}pointerDown(...e){this._useInnerInteraction?console.warn("当前使用内置交互(useInnerInteraction为true),此函数无效!"):this._downEvent.emit(...e)}pointerUp(...e){this._useInnerInteraction?console.warn("当前使用内置交互(useInnerInteraction为true),此函数无效!"):this._upEvent.emit(...e)}pointerMove(...e){this._useInnerInteraction?console.warn("当前使用内置交互(useInnerInteraction为true),此函数无效!"):this._moveEvent.emit(...e)}}class Wi extends c.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new c.Event));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_clickEvent",this.disposeVar(new c.Event));L(this,"_clickOutEvent",this.disposeVar(new c.Event));L(this,"_dblclickEvent",this.disposeVar(new c.Event));L(this,"_dblclickOutEvent",this.disposeVar(new c.Event));L(this,"_canvasPoiClassAndCreateFunc",c.react(void 0));L(this,"_czmViewVisibleDistanceRangeControl");L(this,"_canvasObj");L(this,"_id",this.disposeVar(c.react(c.createGuid())));i&&(this.id=i),this._czmViewVisibleDistanceRangeControl=this.disposeVar(new fo(e,[this,"viewDistanceRange"],[this,"position"])),this.dispose(c.track([this._czmViewVisibleDistanceRangeControl,"debug"],[this,"viewDistanceDebug"]));const o=e.viewer;if(!o)return;const r=Qn(o);if(!r)return;const{poiContext:a,labelManager:s}=r;s.add(this),this.d(()=>{s.delete(this)}),a&&(this._canvasObj=this.disposeVar(new c.ObjResettingWithEvent(this.canvasPoiClassAndCreateFuncChanged,()=>{if(!this.canvasPoiClassAndCreateFunc)return;const[l,u]=this.canvasPoiClassAndCreateFunc;return new kP(this,l,a,o,u)})))}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get clickEvent(){return this._clickEvent}get clickOutEvent(){return this._clickOutEvent}get dblclickEvent(){return this._dblclickEvent}get dblclickOutEvent(){return this._dblclickOutEvent}get canvasPoiClassAndCreateFunc(){return this._canvasPoiClassAndCreateFunc.value}set canvasPoiClassAndCreateFunc(e){this._canvasPoiClassAndCreateFunc.value=e}get canvasPoiClassAndCreateFuncChanged(){return this._canvasPoiClassAndCreateFunc.changed}get czmViewerVisibleDistanceRangeControl(){return this._czmViewVisibleDistanceRangeControl}get visibleAlpha(){return this._czmViewVisibleDistanceRangeControl.visibleAlpha}get visibleAlphaChanged(){return this._czmViewVisibleDistanceRangeControl.visibleAlphaChanged}get canvasObj(){var e;return(e=this._canvasObj)==null?void 0:e.obj}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}L(Wi,"defaults",{viewDistanceRange:[1e3,1e4,3e4,6e4]}),(t=>{t.createDefaultProps=()=>({show:!0,enabled:!0,position:c.reactArrayWithUndefined(void 0),positionEditing:!1,viewDistanceRange:c.reactArrayWithUndefined(void 0),viewDistanceDebug:!1,zOrder:0})})(Wi||(Wi={})),c.extendClassProps(Wi.prototype,Wi.createDefaultProps);class kP extends c.Destroyable{constructor(e,i,o,r,a){super();L(this,"czmCanvasPoi");const s=this.czmCanvasPoi=this.disposeVar(new Op(i,o));this.disposeVar(a(s.canvasPoi,e.visibleAlphaChanged));{const l=()=>{e.position&&(s.cartesian=ut(e.position))};l(),this.dispose(e.positionChanged.disposableOn(l))}{const l=()=>{s.show=(e.show??!0)&&!!e.position&&e.visibleAlpha>0};l();const u=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.positionChanged,e.visibleAlphaChanged));this.dispose(u.disposableOn(l))}this.dispose(e.flyToEvent.disposableOn(()=>{if(!e.position){console.warn("GeoPoint当前没有位置信息,无法飞入!");return}let l=1e3;if(e.viewDistanceRange){const[u,A,h,f]=e.viewDistanceRange;l=(A+h)*.5}Fe(r,e.position,l,void 0,1e3)}))}}class QP extends c.Destroyable{constructor(n,e){super();const i=this.disposeVar(c.createNextAnimateFrameEvent(n.showChanged,n.positionChanged,n.fgColorChanged,n.bgColorChanged,n.tooltipChanged,n.tooltipShowChanged,n.titleChanged,n.sizeChanged,n.originRatioAndOffsetChanged,n.opacityChanged,n.scaleChanged)),o=()=>{e.fgColor=n.fgColor??[1,1,1,1],e.bgColor=n.bgColor??[.3,.3,.3,.8],e.tooltip=n.tooltip??"",e.tooltipShow=n.tooltipShow??!0,e.title=n.title??"",e.size=n.size??[32,32],e.originRatioAndOffset=n.originRatioAndOffset??[.5,1,0,0],e.hovered=n.hovered??!1,e.opacity=n.opacity??1,e._scale=n.scale??1};o(),this.dispose(i.disposableOn(o));const r=this.disposeVar(c.ESSceneObject.context.createEnvStrReact([n,"imageUri"],"${earthsdk3-assets-script-dir}/assets/img/location.png")),a=this.disposeVar(c.createProcessingFromAsyncFunc(async(u,A)=>{const h=await u.promise(c.fetchImage(A));e.image=h})),s=()=>{if(!r.value)return;const u=r.value.trim();u!==""&&a.restart(void 0,u)};s(),this.dispose(r.changed.disposableOn(s));const l=this.disposeVar(new c.Event);this.dispose(e.clickEvent.disposableOn((u,A,h,f,d)=>{(n.enabled??!0)&&l.emit(d)})),this.dispose(l.don(u=>{n.clickEvent.emit(u)})),this.dispose(e.clickOutEvent.disposableOn((u,A,h,f,d)=>{(n.enabled??!0)&&n.clickOutEvent.emit(d)})),this.dispose(e.dbclickEvent.disposableOn((u,A,h,f,d)=>{(n.enabled??!0)&&n.dbclickEvent.emit(d)})),this.dispose(e.dbclickOutEvent.disposableOn((u,A,h,f,d)=>{(n.enabled??!0)&&n.dbclickOutEvent.emit(d)})),this.dispose(c.bind([n,"hovered"],[e,"hovered"])),this.ad(c.bind([e,"isHoverZoom"],[n,"isHoverZoom"])),this.ad(c.bind([e,"hoverHighlight"],[n,"hoverHighlight"]))}}function VP(t,n){const[e,i,o]=n,r=`${e}-${i}-${o}`;let a=c.getExtProp(t,r);return a||(a=c.imageToCanvas(t),c.setCanvasUniformColor(a,n),c.setExtProp(t,r,a)),a}class NP extends c.CanvasPoi{constructor(e,i,o=[32,32],r=[.5,1,0,0],a="#F00F"){super(e);L(this,"_tooltip","");L(this,"_title","");L(this,"__scale",[1,1]);L(this,"_tooltipAlpha",0);L(this,"_bgColor",[.3,.3,.3,.8]);L(this,"_bgColorHexStr",c.getColorHexStr(this._bgColor));L(this,"_fgColor",[1,1,1,1]);L(this,"_fgColorHexStr",c.getColorHexStr(this._fgColor));L(this,"_tooltipShow",this.disposeVar(c.react(!0)));L(this,"_isHoverZoom",this.disposeVar(c.react(!1)));L(this,"_hoverHighlight",this.disposeVar(c.react(!1)));this._image=i,this._size=o,this._originRatioAndOffset=r,this._defaultColorStr=a;const s=new c.Transition(100),l=new c.Transition(100);this.dispose(()=>{s.destroy(),l.destroy()});const u=()=>{this._clickEvent&&!this._clickEvent.empty&&(this.isHoverZoom&&(this.hovered?(this._scale[0]*=1.5,this._scale[1]*=1.5):(this._scale[0]/=1.5,this._scale[1]/=1.5)),this._tooltipAlpha=s.current)};this.dispose(this.activedChanged.disposableOn(h=>{l.target=h?1:0,this.needRedraw()}));const A=()=>{const h=this.tooltipShow&&this.hovered;s.target=h?1:0,u(),this.hoverHighlight&&(this.hovered?this.selected=!0:this.selected=!1),this.needRedraw()};this.dispose(this.hoveredChanged.disposableOn(A)),this.dispose(this.tooltipShowChanged.disposableOn(A)),this.dispose(this.selectedChanged.disposableOn(()=>{this.needRedraw()}))}get tooltipShow(){return this._tooltipShow.value}set tooltipShow(e){this._tooltipShow.value=e}get tooltipShowChanged(){return this._tooltipShow.changed}get isHoverZoom(){return this._isHoverZoom.value}set isHoverZoom(e){this._isHoverZoom.value=e}get isHoverZoomChanged(){return this._isHoverZoom.changed}get hoverHighlight(){return this._hoverHighlight.value}set hoverHighlight(e){this._hoverHighlight.value=e}get hoverHighlightChanged(){return this._hoverHighlight.changed}set size(e){const[i,o]=e,[r,a]=this._size;(r!==i||a!==o)&&(this._size[0]=i,this._size[1]=o,this.needRedraw(),this.needPickRedraw())}get size(){return this._size}set _scale(e){const[i,o]=e,[r,a]=this.__scale;(r!==i||a!==o)&&(this.__scale[0]=i,this.__scale[1]=o,this.needRedraw(),this.needPickRedraw())}get _scale(){return this.__scale}set fgColor(e){if(!this._fgColor.every((i,o)=>e[o]===i)){const[i,o,r,a]=e;this._fgColor.splice(0,4,i,o,r,a),this._fgColorHexStr=c.getColorHexStr(this._fgColor),this.needRedraw()}}get fgColor(){return this._fgColor}set bgColor(e){if(!this._bgColor.every((i,o)=>e[o]===i)){const[i,o,r,a]=e;this._bgColor.splice(0,4,i,o,r,a),this._bgColorHexStr=c.getColorHexStr(this._bgColor),this.needRedraw()}}get bgColor(){return this._bgColor}set originRatioAndOffset(e){const[i,o,r,a]=this._originRatioAndOffset,[s,l,u,A]=e;(i!==s||o!==l||r!==u||a!==A)&&(this._originRatioAndOffset.splice(0,4,s,l,u,A),this.needRedraw(),this.needPickRedraw())}get originRatioAndOffset(){return this._originRatioAndOffset}set image(e){this._image!==e&&(this._image=e,this.needRedraw())}get image(){return this._image}set defaultColorStr(e){this._defaultColorStr!==e&&(this._defaultColorStr=e,this.needRedraw())}get defaultColorStr(){return this._defaultColorStr}set tooltip(e){this._tooltip!==e&&(this._tooltip=e,this.needRedraw())}get tooltip(){return this._tooltip}set title(e){this._title!==e&&(this._title=e,this.needRedraw())}get title(){return this._title}draw(e){if(!this._show)return;const[i,o]=this._winPos,r=this._size[0]*this.__scale[0],a=this._size[1]*this.__scale[1],{left:s,top:l,right:u,bottom:A}=c.getDrawRect([i,o],this._size,this.__scale,this._originRatioAndOffset),h=e.globalAlpha;if(e.globalAlpha=this.opacity,this._image){if(this.selected){const f=VP(this._image,[1,0,0]),{left:d,top:p}=c.getDrawRect([i,o],[r+6,a+6],[1,1],this._originRatioAndOffset);e.drawImage(f,d,p,r+6,a+6)}e.drawImage(this._image,s,l,r,a)}else e.fillStyle=this._fgColorHexStr,e.fillRect(s,l,r,a);if(this._title!==""&&c.drawTextBlock(e,i+20,o-16,[0,.5,0,0],this._title,"14px Arial",4,this._fgColorHexStr,this._bgColorHexStr),e.globalAlpha=h,this._hovered&&this._tooltip!==""){const f=e.globalAlpha;e.globalAlpha=this._tooltipAlpha,c.drawTextBlock(e,(s+u)*.5,l-5,[.5,1,0,0],this._tooltip,"12px Arial",4,this._fgColorHexStr,this._bgColorHexStr),e.globalAlpha=f}}drawForPick(e,i){if(!this._show)return;const[o,r]=this._winPos,a=i("default"),s=this._size[0]*this.__scale[0],l=this._size[1]*this.__scale[1],{left:u,top:A}=c.getDrawRect([o,r],this._size,this.__scale,this._originRatioAndOffset);e.fillStyle=a,e.fillRect(u,A,s,l)}}class yi extends c.Destroyable{constructor(e){super();L(this,"_pickedEvent",this.disposeVar(new c.Event));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_clickEvent",this.disposeVar(new c.Event));L(this,"_clickOutEvent",this.disposeVar(new c.Event));L(this,"_dbclickEvent",this.disposeVar(new c.Event));L(this,"_dbclickOutEvent",this.disposeVar(new c.Event));L(this,"_clickFunc",this.disposeVar(c.react(void 0)));L(this,"_clickFuncInit",(()=>{this.dispose(this.clickEvent.disposableOn(e=>this.clickFunc&&this.clickFunc(e)))})());L(this,"_geoCanvasPoi");if(this._geoCanvasPoi=this.disposeVar(new Wi(e)),!e.viewer)return;const{geoCanvasPoi:o}=this;o.canvasPoiClassAndCreateFunc=[NP,r=>new QP(this,r)],this.dispose(c.bind([o,"show"],[this,"show"])),this.dispose(c.bind([o,"enabled"],[this,"enabled"])),this.dispose(c.bind([o,"position"],[this,"position"])),this.dispose(c.bind([o,"positionEditing"],[this,"positionEditing"])),this.dispose(c.track([o,"viewDistanceRange"],[this,"viewDistanceRange"])),this.dispose(c.track([o,"viewDistanceDebug"],[this,"viewDistanceDebug"])),this.dispose(c.track([o,"zOrder"],[this,"zOrder"])),this.dispose(this.flyToEvent.disposableOn(r=>{o.flyTo(r)})),this.dispose(this._clickEvent.disposableOn(r=>{this.pickOnClick&&this.pickedEvent.emit(new c.ESJPickedResult({type:"viewerPicking",pointerEvent:r}))}));{const r=()=>{const a=Sp(this.clickFuncStr,["event"]);a&&(this.clickFunc=a)};r(),this.dispose(this.clickFuncStrChanged.disposableOn(r))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get clickEvent(){return this._clickEvent}get clickOutEvent(){return this._clickOutEvent}get dbclickEvent(){return this._dbclickEvent}get dbclickOutEvent(){return this._dbclickOutEvent}get clickFunc(){return this._clickFunc.value}set clickFunc(e){this._clickFunc.value=e}get clickFuncChanged(){return this._clickFunc.changed}get geoCanvasPoi(){return this._geoCanvasPoi}}L(yi,"defaults",{viewDistanceRange:[1e3,1e4,3e4,6e4],scale:[1,1]}),(t=>{t.createDefaultProps=()=>({show:!0,enabled:!0,position:c.reactArrayWithUndefined(void 0),positionEditing:!1,fgColor:c.reactArray([1,1,1,1]),bgColor:c.reactArray([0,0,0,0]),tooltip:"",tooltipShow:!0,title:"",size:c.reactArray([32,32]),scale:c.reactArray([1,1]),originRatioAndOffset:c.reactArray([.5,1,0,0]),hovered:!1,imageUri:"${earthsdk3-assets-script-dir}/assets/img/location.png",opacity:1,viewDistanceRange:c.reactArrayWithUndefined(void 0),viewDistanceDebug:!1,pickOnClick:!1,clickFuncStr:"",zOrder:0,isHoverZoom:!1,hoverHighlight:!1})})(yi||(yi={})),c.extendClassProps(yi.prototype,yi.createDefaultProps);class Es extends c.Destroyable{constructor(e){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_commandEvent",this.disposeVar(new c.Event));L(this,"_dbclickEvent",this.disposeVar(new c.Event));const i=this;let o=Number.POSITIVE_INFINITY;this.dispose(this.enabledChanged.disposableOn(p=>{o=p??!1?Date.now():Number.POSITIVE_INFINITY}));const r=this.disposeVar(new c.Transition(100));r.reset(0);const a=this.disposeVar(c.createTimeoutWithStartValues(()=>r.target=0,1e3)),s=this.disposeVar(c.createTimeoutWithStartValues(()=>r.target=1,1e3)),l=this.disposeVar(new yi(e));l.originRatioAndOffset=[.5,.5,0,0],this.dispose(c.track([l,"tooltip"],[i,"title"]));{const p=()=>{l.size=this.mainPoiSize??[12,12]};p(),this.dispose(this.mainPoiSizeChanged.disposableOn(p))}{const p=()=>{l.fgColor=this.mainPoiFgColor??[1,1,1,1]};p(),this.dispose(this.mainPoiFgColorChanged.disposableOn(p))}{const p=()=>{l.bgColor=this.mainPoiBgColor??[0,0,0,.6]};p(),this.dispose(this.mainPoiBgColorChanged.disposableOn(p))}const u=this.disposeVar(c.createNextAnimateFrameEvent(i.showChanged,i.positionChanged,i.descriptionChanged,i.titleChanged,i.imageUriChanged)),A=()=>{l.show=i.show??!0,l.imageUri=i.imageUri??"${earthsdk3-assets-script-dir}/assets/img/point-yellow.png",l.position=i.position};A(),this.dispose(u.disposableOn(A)),this.dispose(c.bind([l,"position"],[this,"position"])),this.dispose(c.bind([l,"positionEditing"],[this,"positionEditing"])),this.dispose(this._flyToEvent.disposableOn(p=>l.flyTo(p)));const h=[],f=()=>{h.forEach(p=>{p.destroy()}),h.length=0};this.dispose(f);const d=()=>{f();const{commands:p}=i;if(!p)return;const g=p.length,v=50,y=0,m=-(g*v*Math.PI/180)*.5;for(let x=0;x<g;++x){const[_,E,B,P]=p[x],I=m+v*(x+.5)*Math.PI/180,M=Math.sin(I)*y,F=Math.cos(I)*y,S=new yi(e);S.imageUri=P,S.tooltip=E,S.bgColor=[0,0,0,.6],S.fgColor=[1,1,1,1],S.size=[24,24],S.dispose(c.track([S,"position"],[i,"position"])),S.originRatioAndOffset=[.5,.5,-M,F],S.show=!1,S.opacity=0,S.dispose(S.opacityChanged.disposableOn(T=>S.show=(T??1)>0)),S.dispose(S.clickEvent.disposableOn(T=>i.commandEvent.emit(_,T))),S.dispose(S.hoveredChanged.disposableOn(T=>T?a.cancel():a.restart())),S.dispose(r.currentChanged.disposableOn(T=>S.enabled=T===1)),h.push(S)}};d(),this.dispose(i.commandsChanged.disposableOn(d)),this.dispose(l.hoveredChanged.disposableOn(p=>p?a.cancel():a.restart())),this.dispose(l.hoveredChanged.disposableOn(p=>p?i.enabled&&s.restart():s.cancel())),this.dispose(r.currentChanged.disposableOn(p=>{const g=h.length,v=50,y=p*35,m=-(g*v*Math.PI/180)*.5;for(let x=0;x<g;++x){const _=m+v*(x+.5)*Math.PI/180,E=Math.sin(_)*y,B=Math.cos(_)*y;h[x].originRatioAndOffset=[.5,.5,-E,B],h[x].opacity=p}})),this.dispose(l.clickEvent.disposableOn(p=>{if(!i.enabled)return;const g=p.__xbsj_listenerTime__;if(!(g!==void 0&&o>g))if(p.button===0)if(i.clickCommandName)i.commandEvent.emit(i.clickCommandName,p);else{if(r.current>0&&r.current<1)return;r.target=r.target===1?0:1}else p.button===2&&i.rightClickCommandName&&i.commandEvent.emit(i.rightClickCommandName,p)})),this.dispose(l.clickOutEvent.disposableOn(()=>{i.enabled&&(r.target=0)})),this.dispose(i.commandEvent.disposableOn(()=>r.target=0)),this.dispose(l.dbclickEvent.disposableOn(p=>{if(!i.enabled)return;const g=p.__xbsj_listenerTime__;g!==void 0&&o>g||(i.dbclickEvent.emit(p),s.isRunning&&a.cancel(),r.target=0)})),this.dispose(r.targetChanged.disposableOn(p=>p===1?a.restart():a.cancel())),this.dispose(r.targetChanged.disposableOn(p=>p===1&&s.cancel())),this.dispose(r.targetChanged.disposableOn(p=>l.tooltipShow=p===0))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get commandEvent(){return this._commandEvent}get dbclickEvent(){return this._dbclickEvent}}(t=>{t.createDefaultProps=()=>({show:!0,enabled:!0,position:c.reactArrayWithUndefined(void 0),positionEditing:!1,title:"",description:"",imageUri:"${earthsdk3-assets-script-dir}/assets/img/point-yellow.png",commands:c.reactDeepArrayWithUndefined(void 0,(n,e)=>n.every((i,o)=>i===e[o]),n=>[...n]),clickCommandName:"",rightClickCommandName:"",mainPoiSize:c.reactArrayWithUndefined(void 0),mainPoiBgColor:c.reactArrayWithUndefined(void 0),mainPoiFgColor:c.reactArrayWithUndefined(void 0)})})(Es||(Es={})),c.extendClassProps(Es.prototype,Es.createDefaultProps);const zp=`class MyDiv {
202
202
  // container是Poi的div
203
203
  // geoCustomDivPoi指向当前的GeoCustomDivPoi场景对象
204
204
  // viewer指定当前的视口
@@ -3101,7 +3101,7 @@ export type IndexJsonType = {
3101
3101
  \`\`\`
3102
3102
  ${kx}
3103
3103
  \`\`\`
3104
- `,xt=class xt extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_loadFuncReact",this.disposeVar(c.react(void 0)));L(this,"_dataSource",this.disposeVar(c.react(void 0)));L(this,"_data");L(this,"_defaultHeight",{});L(this,"_defaultBoundingSphere",new b.BoundingSphere);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}let r=()=>{this.dataSource&&o.dataSources.remove(this.dataSource,!0),this.dataSource=void 0,this._data=void 0};this.dispose(()=>{r()});{const a=this.dv(c.createProcessingFromAsyncFunc(async u=>{this.dataSource&&r(),this.url&&(typeof this.url=="object"?this._data=this.url:c.isJSON(this.url)?this._data=JSON.parse(this.url):await fetch(c.ESSceneObject.context.getStrFromEnv(this.url)).then(A=>A.json()).then(A=>{this._data=A}).catch(A=>{console.warn("ESGeoJson数据加载失败",A)}),this.dataSource=await b.GeoJsonDataSource.load(this._data),o.dataSources.add(this.dataSource).then(A=>{var f,d;const h=[];for(const p of A.entities.values)if(b.Entity.prototype&&(p.ESSceneObjectID=i),this._isEntityShow(p,e),p.polygon&&h.push(...(f=p.polygon.hierarchy)==null?void 0:f.getValue(b.JulianDate.now()).positions),p.polyline&&h.push(...(d=p.polyline.positions)==null?void 0:d.getValue(b.JulianDate.now())),p.position){const g=p.position.getValue(b.JulianDate.now());g&&h.push(g)}this._defaultBoundingSphere=b.BoundingSphere.fromPoints(h)}))})),s=()=>{a.isRunning&&a.cancel(),a.restart()};s();const l=this.dv(c.createNextAnimateFrameEvent(this.loadFunChanged,this.urlChanged));this.dispose(l.don(s))}{const a=()=>{var l,u;if(this.dataSource)if(this.dataSource.show=this.show,this.loadFun)try{this.loadFun(this.dataSource)}catch(A){console.error(A)}else{const A=this.dataSource.entities.values;for(let h=0;h<A.length;h++){const f=A[h];if(f.polygon){this._defaultHeight[f.id]||(this._defaultHeight[f.id]=(l=f.polygon.height)==null?void 0:l.getValue(b.JulianDate.now())),f.polygon.height=this.fillGround?void 0:new b.ConstantProperty(this._defaultHeight[f.id]),f.polygon.perPositionHeight=new b.ConstantProperty(!this.fillGround),f.polygon.heightReference=new b.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?b.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?b.HeightReference.CLAMP_TO_GROUND:b.HeightReference.RELATIVE_TO_GROUND),f.polygon.show=new b.ConstantProperty(this.filled??xt.defaults.filled),f.polygon.material=new b.ColorMaterialProperty(new b.Color(...this.fillColor??xt.defaults.fillColor)),f.polygon.outline=new b.ConstantProperty(!1),f.polygon.classificationType=b.ClassificationType[this.classificationType.toUpperCase()],f.polyline=new b.PolylineGraphics;const d=JSON.parse(JSON.stringify((u=f.polygon.hierarchy)==null?void 0:u.getValue(b.JulianDate.now()).positions));b.Cartesian3.equals(d[0],d[d.length-1])||d.push(d[0]),f.polyline.positions=d,f.polyline.classificationType=b.ClassificationType[this.classificationType.toUpperCase()]}if(f.polyline&&(f.polyline.classificationType=b.ClassificationType[this.classificationType.toUpperCase()],f.polyline.show=new b.ConstantProperty(this.stroked??xt.defaults.stroked),f.polyline.width=new b.ConstantProperty(this.strokeWidth??xt.defaults.strokeWidth),f.polyline.material=new b.ColorMaterialProperty(new b.Color(...this.strokeColor??xt.defaults.strokeColor)),f.polyline.clampToGround=new b.ConstantProperty(this.strokeGround)),f.billboard){f.billboard.show=new b.ConstantProperty(this.imageShow??xt.defaults.imageShow),f.billboard.width=new b.ConstantProperty(this.imageSize?this.imageSize[0]:xt.defaults.imageSize[0]),f.billboard.height=new b.ConstantProperty(this.imageSize?this.imageSize[1]:xt.defaults.imageSize[1]);const d=this.imageUrl?typeof this.imageUrl=="string"?this.imageUrl:this.imageUrl.url:xt.defaults.imageUrl;f.billboard.image=new b.ConstantProperty(c.ESSceneObject.context.getStrFromEnv(d)),f.billboard.horizontalOrigin=new b.ConstantProperty(b.HorizontalOrigin.LEFT),f.billboard.verticalOrigin=new b.ConstantProperty(b.VerticalOrigin.TOP),f.billboard.heightReference=new b.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?b.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?b.HeightReference.CLAMP_TO_GROUND:b.HeightReference.RELATIVE_TO_GROUND);const p=this.imageAnchor??xt.defaults.imageAnchor,g=this.imageOffset??xt.defaults.imageOffset;if(f.billboard.pixelOffset=new b.ConstantProperty(b.Cartesian2.fromArray([-p[0]*f.billboard.width.getValue(b.JulianDate.now())+g[0],-p[1]*f.billboard.height.getValue(b.JulianDate.now())+g[1]])),f.label=new b.LabelGraphics,!f.label)return;f.label.show=new b.ConstantProperty(this.textShow??xt.defaults.textShow),f.label.heightReference=new b.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?b.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?b.HeightReference.CLAMP_TO_GROUND:b.HeightReference.RELATIVE_TO_GROUND),f.label.text=new b.ConstantProperty(this.textProperty&&this.textProperty!==""&&f.properties&&f.properties[this.textProperty]?f.properties[this.textProperty].getValue():this.textDefaultText??xt.defaults.textDefaultText),f.label.fillColor=new b.ConstantProperty(new b.Color(...this.textColor??xt.defaults.textColor)),f.label.showBackground=new b.ConstantProperty(this.textBackgroundColor!=null);const v=this.textFontSize&&this.textFontSize!=0?this.textFontSize:xt.defaults.textFontSize,y=this.textOffset??xt.defaults.textOffset;f.label.backgroundColor=new b.ConstantProperty(new b.Color(...this.textBackgroundColor??xt.defaults.textBackgroundColor)),f.label.font=new b.ConstantProperty(`${this.textFontStyle} ${this.textFontWeight} ${v}px ${this.textFontFamily??xt.defaults.textFontFamily}`),f.label.horizontalOrigin=new b.ConstantProperty(b.HorizontalOrigin.LEFT),f.label.verticalOrigin=new b.ConstantProperty(b.VerticalOrigin.TOP),f.label.eyeOffset=new b.ConstantProperty(b.Cartesian3.fromArray([0,0,-1]));const m=this.textAnchor??xt.defaults.textAnchor;f.label.pixelOffset=new b.ConstantProperty(b.Cartesian2.fromArray([-m[0]*((this.textBackgroundColor?-14:0)+this._getTextPixelWidth(f.label.text.getValue(b.JulianDate.now()),f.label.font.getValue(b.JulianDate.now())))+y[0],-m[1]*((this.textBackgroundColor?10:0)+v)+y[1]]))}}}};a();const s=this.dv(c.createNextAnimateFrameEvent(this._dataSource.changed,this.showChanged,this.strokedChanged,this.strokeWidthChanged,this.strokeWidthTypeChanged,this.strokeColorChanged,this.strokeMaterialChanged,this.strokeMaterialParamsChanged,this.strokeGroundChanged,this.filledChanged,this.fillColorChanged,this.fillMaterialChanged,this.fillMaterialParamsChanged,this.fillGroundChanged,this.imageShowChanged,this.imageUrlChanged,this.imageSizeChanged,this.imageAnchorChanged,this.imageOffsetChanged,this.textShowChanged,this.textPropertyChanged,this.textDefaultTextChanged,this.textColorChanged,this.textBackgroundColorChanged,this.textFontFamilyChanged,this.textFontSizeChanged,this.textFontStyleChanged,this.textFontWeightChanged,this.textAnchorChanged,this.textOffsetChanged,this.heightReferenceChanged,this.classificationTypeChanged));this.dispose(s.don(a))}{const a=()=>{if(!this.dataSource)return;const l=this.dataSource.entities.values;for(let u=0;u<l.length;u++){const A=l[u];this._isEntityShow(A,e)}};a();const s=this.ad(c.createNextAnimateFrameEvent(this.minFeatureVisibleDistanceChanged,this.maxFeatureVisibleDistanceChanged,e.cameraChanged,this.showChanged));this.ad(s.don(a))}{const a=()=>{if(this.loadFuncStr)try{const s=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=s}catch(s){console.error(s),this.loadFun=void 0}else this.loadFun=void 0};a(),this.dispose(this.loadFuncStrChanged.disposableOn(a))}this.dispose(this.flyToEvent.disposableOn(a=>{e.actived&&this.dataSource&&(a!==void 0?o.flyTo(this.dataSource,{duration:a/1e3}).then(s=>{s||o.camera.flyToBoundingSphere(this._defaultBoundingSphere,{duration:a/1e3})}):o.flyTo(this.dataSource).then(s=>{s||o.camera.flyToBoundingSphere(this._defaultBoundingSphere)}))}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get loadFun(){return this._loadFuncReact.value}set loadFun(e){this._loadFuncReact.value=e}get loadFunChanged(){return this._loadFuncReact.changed}get dataSource(){return this._dataSource.value}set dataSource(e){this._dataSource.value=e}_getTextPixelWidth(e,i="16px sans-serif"){const r=document.createElement("canvas").getContext("2d");return r.font=i,r.measureText(e).width}_isEntityShow(e,i){var o;if(this.minFeatureVisibleDistance==0&&this.maxFeatureVisibleDistance==0){e.show=this.show;return}if((o=i.viewer)!=null&&o.camera&&this.show){let r;if(e.polygon&&e.polygon.hierarchy)r=c.getMinMaxCorner(e.polygon.hierarchy.getValue(b.JulianDate.now()).positions.map(l=>Ue(l))).center;else if(e.polyline&&e.polyline.positions)r=c.getMinMaxCorner(e.polyline.positions.getValue(b.JulianDate.now()).map(l=>Ue(l))).center;else if(e.position){const l=e.position.getValue(b.JulianDate.now());l&&(r=Ue(l))}if(!r||isNaN(r[0]))return;const a=c.getDistancesFromPositions([r,Fn(i.viewer.camera)],"NONE")[0];let s=!1;this.minFeatureVisibleDistance<this.maxFeatureVisibleDistance?s=this.minFeatureVisibleDistance<a&&a<this.maxFeatureVisibleDistance:this.maxFeatureVisibleDistance==0?s=a>this.minFeatureVisibleDistance:this.minFeatureVisibleDistance==0&&(s=a<this.maxFeatureVisibleDistance),e.show=this.show&&s}}};L(xt,"defaults",{show:!0,allowPicking:!0,url:Qx,defaultLoadFuncStr:kx,defaultLoadFuncDocStr:pO,data:AO,dataMd:fO,stroked:!0,strokeWidth:1,strokeWidthType:"world",strokeColor:[.79,.91,.06,1],strokeMaterial:"",strokeMaterialParams:{},strokeGround:!1,filled:!0,fillColor:[.79,.91,.06,.2],fillMaterial:"",fillMaterialParams:{},fillGround:!1,imageShow:!0,imageUrl:"${earthsdk3-assets-script-dir}/assets/misc/location.png",imageSize:[64,64],imageAnchor:[.5,1],imageOffset:[0,0],textShow:!0,textProperty:"",textDefaultText:"默认标注",textColor:[1,1,1,1],textBackgroundColor:[.79,.91,.06,1],textFontFamily:"Arial",textFontSize:16,textFontWeight:"normal",textFontStyle:"normal",textAnchor:[.5,1],textOffset:[0,0],strokeWidthTypes:[["screen","screen"],["world","world"]],minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReferences:[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]]});let Ko=xt;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:void 0,loadFuncStr:void 0,url:void 0,stroked:void 0,strokeWidth:void 0,strokeWidthType:"world",strokeColor:c.reactArrayWithUndefined(void 0),strokeMaterial:void 0,strokeMaterialParams:c.reactJsonWithUndefined(void 0),strokeGround:void 0,filled:void 0,fillColor:c.reactArrayWithUndefined(void 0),fillMaterial:void 0,fillMaterialParams:c.reactJsonWithUndefined(void 0),fillGround:void 0,imageShow:void 0,imageUrl:void 0,imageSize:c.reactArrayWithUndefined(void 0),imageAnchor:c.reactArrayWithUndefined(void 0),imageOffset:c.reactArrayWithUndefined(void 0),textShow:void 0,textProperty:void 0,textDefaultText:void 0,textColor:c.reactArrayWithUndefined(void 0),textBackgroundColor:c.reactArrayWithUndefined(void 0),textFontFamily:void 0,textFontSize:void 0,textFontStyle:void 0,textFontWeight:void 0,textAnchor:c.reactArrayWithUndefined(void 0),textOffset:c.reactArrayWithUndefined(void 0),minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReference:"NONE",classificationType:"TERRAIN"})})(Ko||(Ko={})),c.extendClassProps(Ko.prototype,Ko.createDefaultProps);const Ju=class Ju extends Nn{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}const o=this.ad(new Ko(e,n.id));this.ad(c.track([o,"show"],[n,"show"])),this.ad(c.track([o,"allowPicking"],[n,"allowPicking"])),this.ad(c.track([o,"loadFuncStr"],[n,"loadFuncStr"])),this.ad(c.track([o,"url"],[n,"features"])),this.ad(c.track([o,"stroked"],[n,"stroked"])),this.ad(c.track([o,"strokeWidth"],[n,"strokeWidth"])),this.ad(c.track([o,"strokeWidthType"],[n,"strokeWidthType"])),this.ad(c.track([o,"strokeColor"],[n,"strokeColor"])),this.ad(c.track([o,"strokeMaterial"],[n,"strokeMaterial"])),this.ad(c.track([o,"strokeMaterialParams"],[n,"strokeMaterialParams"])),this.ad(c.track([o,"strokeGround"],[n,"strokeGround"])),this.ad(c.track([o,"filled"],[n,"filled"])),this.ad(c.track([o,"fillColor"],[n,"fillColor"])),this.ad(c.track([o,"fillMaterial"],[n,"fillMaterial"])),this.ad(c.track([o,"fillMaterialParams"],[n,"fillMaterialParams"])),this.ad(c.track([o,"fillGround"],[n,"fillGround"])),this.ad(c.track([o,"imageShow"],[n,"imageShow"])),this.ad(c.track([o,"imageUrl"],[n,"imageUrl"])),this.ad(c.track([o,"imageSize"],[n,"imageSize"])),this.ad(c.track([o,"imageAnchor"],[n,"imageAnchor"])),this.ad(c.track([o,"imageOffset"],[n,"imageOffset"])),this.ad(c.track([o,"textShow"],[n,"textShow"])),this.ad(c.track([o,"textProperty"],[n,"textProperty"])),this.ad(c.track([o,"textDefaultText"],[n,"textDefaultText"])),this.ad(c.track([o,"textColor"],[n,"textColor"])),this.ad(c.track([o,"textBackgroundColor"],[n,"textBackgroundColor"])),this.ad(c.track([o,"textFontFamily"],[n,"textFontFamily"])),this.ad(c.track([o,"textFontSize"],[n,"textFontSize"])),this.ad(c.track([o,"textFontStyle"],[n,"textFontStyle"])),this.ad(c.track([o,"textFontWeight"],[n,"textFontWeight"])),this.ad(c.track([o,"textAnchor"],[n,"textAnchor"])),this.ad(c.track([o,"textOffset"],[n,"textOffset"])),this.ad(c.track([o,"minFeatureVisibleDistance"],[n,"minFeatureVisibleDistance"])),this.ad(c.track([o,"maxFeatureVisibleDistance"],[n,"maxFeatureVisibleDistance"])),this.ad(c.track([o,"heightReference"],[n,"heightReference"])),this.ad(c.track([o,"classificationType"],[n,"classificationType"])),this.ad(n.flyToEvent.disposableOn(r=>{if(e.actived){if(n.flyInParam){const{position:a,rotation:s,flyDuration:l}=n.flyInParam;return Fe(e.viewer,a,void 0,s,l),!0}o.flyTo(r&&r*1e3)}}));{const r=async(a,s,l)=>{if(!e.actived)return;const u=JSON.parse(JSON.stringify(this._getFeatureByIndexOrProperties(a,s)));if(!(!u||!(u!=null&&u.positions)))if(u.type=="Point"||u.type=="MultiPoint")Gn(e,n,this.id,await this._calculateFeatureHeight(u.type=="MultiPoint"?u.positions.flat():u.positions,n.heightReference,e),1e3,l);else{const A=u.type=="Polygon"||u.type=="MultiPolygon"||u.type=="MultiLineString";let h=[];A?h=u.positions.flat(u.type=="MultiPolygon"?2:1).map(g=>this._calculateFeatureHeight(g,n.fillGround?"CLAMP_TO_GROUND":"NONE",e)):h=u.positions.map(g=>this._calculateFeatureHeight(g,n.strokeGround?"CLAMP_TO_GROUND":"NONE",e));const{minPos:f,maxPos:d,center:p}=c.getMinMaxCorner(h);Gn(e,n,this.id,p,c.getDistancesFromPositions([f,d],"NONE")[0],l)}};this.d(n.flyToFeatureEvent.don((a,s,l)=>r(a,s,l))),this.d(n.flyToFeatureIndexEvent.don((a,s)=>r(a,void 0,s)))}}_getFeatureByIndexOrProperties(n,e){var a,s,l,u,A,h,f,d;const{sceneObject:i}=this,o=i.features;if(!o)return;const r=Reflect.get(o,"features")||Reflect.get(o,"geometries");if(r){if(e){let p=r.find(g=>(g==null?void 0:g.properties[n])==e);return{type:p!=null&&p.coordinates?p.type:(a=p==null?void 0:p.geometry)==null?void 0:a.type,positions:(p==null?void 0:p.coordinates)||((s=p==null?void 0:p.geometry)==null?void 0:s.coordinates)}}else if(typeof n=="number")return{type:(l=r[n])!=null&&l.coordinates?r[n].type:(A=(u=r[n])==null?void 0:u.geometry)==null?void 0:A.type,positions:((h=r[n])==null?void 0:h.coordinates)||((d=(f=r[n])==null?void 0:f.geometry)==null?void 0:d.coordinates)}}}async _calculateFeatureHeight(n,e,i){const o=[...n];return e=="NONE"?o[2]=o[2]??0:e=="CLAMP_TO_GROUND"||!o[2]?o[2]=await i.getTerrainHeight(o)??0:o[2]+=await i.getTerrainHeight(o)??0,o}};L(Ju,"type",Ju.register("ESCesiumViewer",c.ESGeoJson.type,Ju));let lg=Ju;const ec=class ec extends on{constructor(e,i){super(e,i);L(this,"_czmGeoESRectangle");L(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new Ye(i,e.id)),this._czmGeoESRectangle=this.disposeVar(new Ci(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoESRectangle,a=this._geoPolyline;a.arcType="RHUMB",this.dispose(c.track([a,"color"],[e,"strokeColor"])),this.dispose(c.track([a,"width"],[e,"strokeWidth"])),this.dispose(c.track([a,"ground"],[e,"strokeGround"])),this.dispose(c.track([r,"ground"],[e,"fillGround"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"]));{const s=()=>{a.show=e.show&&e.stroked,r.show=e.show&&e.filled};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged));this.dispose(l.disposableOn(s))}{const s=()=>{e.filled?r.material={type:"Color",color:e.fillColor}:r.material=void 0};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(s))}{const s=()=>{const l=e.points;if(l&&l.length>=2){const{minPos:u,maxPos:A}=c.getMinMaxCorner(l);r.rectangle=[u[0],u[1],A[0],A[1]],r.height=l[0][2],r.extrudedHeight=l[0][2];const h=l.map(g=>(l&&(g[2]=l[0][2]),g)),f=h[0],d=h[1],p=[f,[f[0],d[1],f[2]],d,[d[0],f[1],d[2]]];a.positions=[...p,f]}else r.rectangle=void 0,a.positions=void 0,r.height=0,r.extrudedHeight=0};s(),this.dispose(e.pointsChanged.disposableOn(()=>s()))}}get czmGeoESRectangle(){return this._czmGeoESRectangle}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmGeoESRectangle:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}};L(ec,"type",ec.register("ESCesiumViewer",c.ESGeoRectangle.type,ec));let ug=ec;class Zl extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_geoPolygon");this._geoPolygon=this.disposeVar(new zr(e,i));const{geoPolygon:o}=this;this.dispose(c.bind([o,"allowPicking"],[this,"allowPicking"])),this.dispose(this.flyToEvent.disposableOn(a=>{o.flyTo(a)})),this.dispose(c.bind([o,"show"],[this,"show"])),this.dispose(c.bind([o,"fill"],[this,"filled"])),this.dispose(c.bind([o,"strokeGround"],[this,"strokeGround"])),this.dispose(c.bind([o,"ground"],[this,"ground"])),this.dispose(c.bind([o,"outline"],[this,"outline"])),this.dispose(c.bind([o,"outlineColor"],[this,"outlineColor"])),this.dispose(c.bind([o,"outlineWidth"],[this,"outlineWidth"])),this.dispose(c.bind([o,"color"],[this,"color"])),this.dispose(c.bind([o,"depth"],[this,"depth"]));const r=()=>{if(this.positions&&this.positions.length>=2){const a=Tp([...this.positions,this.positions[0]]);o.positions=a}else o.positions=void 0};r(),this.dispose(this.positionsChanged.disposableOn(r))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolygon(){return this._geoPolygon}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,strokeGround:!1,ground:!1,outline:!1,filled:!0,outlineColor:c.reactArray([1,1,1,1]),outlineWidth:1,color:c.reactArrayWithUndefined([1,1,1,.5]),positions:c.reactPositions(void 0),depth:0})})(Zl||(Zl={})),c.extendClassProps(Zl.prototype,Zl.createDefaultProps);const tc=class tc extends on{constructor(e,i){super(e,i);L(this,"_geoSmoothPolygon");if(this._geoSmoothPolygon=this.disposeVar(new Zl(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._geoSmoothPolygon;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"outline"],[e,"stroked"])),this.dispose(c.track([r,"outlineColor"],[e,"strokeColor"])),this.dispose(c.track([r,"outlineWidth"],[e,"strokeWidth"])),this.dispose(c.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(c.track([r,"filled"],[e,"filled"])),this.dispose(c.track([r,"color"],[e,"fillColor"])),this.dispose(c.track([r,"ground"],[e,"ground"]));{const a=()=>{r.ground=e.ground||e.fillGround};a();const s=this.dv(c.createNextAnimateFrameEvent(e.groundChanged,e.fillGroundChanged));this.d(s.don(a))}{const a=()=>{r.color=e.filled?e.fillColor:Kl.defaults.fillStyle.color};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(s.disposableOn(a))}this.dispose(c.track([r,"depth"],[e,"depth"]))}get geoSmoothPolygon(){return this._geoSmoothPolygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoSmoothPolygon:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoSmoothPolygon:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(tc,"type",tc.register("ESCesiumViewer",Kl.type,tc));let cg=tc;const nc=class nc extends He{constructor(e,i){super(e,i);L(this,"_czmModel");const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModel=this.dv(new Ht(i,e.id));const r=this._czmModel;this.d(r.readyEvent.don(s=>{var l;r.activeAnimationsJson=(l=r.gltf.animations)==null?void 0:l.map((u,A)=>({index:A,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration * 2"})),e.czmModelReadyEvent.emit(s),e.readyEvent.emit(s)})),this.ad(new Bh(o,this._czmModel)),this.d(c.track([r,"show"],[e,"show"])),this.d(c.track([r,"color"],[e,"czmColor"])),this.d(c.track([r,"nativeMaximumScale"],[e,"czmMaximumScale"])),this.d(c.track([r,"nativeMinimumPixelSize"],[e,"czmMinimumPixelSize"])),this.d(c.bind([r,"position"],[e,"position"])),this.d(c.track([r,"nativeScale"],[e,"czmNativeScale"])),this.d(c.track([r,"scale"],[e,"scale"])),this.ad(c.track([r,"imageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(c.track([r,"environmentMapManager"],[e,"czmEnvironmentMapManager"]));{const s=l=>{e.czmEnvironmentMapManager=e.czmEnvironmentMapManager?{...e.czmEnvironmentMapManager,atmosphereScatteringIntensity:l}:{atmosphereScatteringIntensity:l}};s(e.czmAtmosphereScatteringIntensity),this.ad(e.czmAtmosphereScatteringIntensityChanged.don(l=>s(l)))}{const s=()=>{var l,u;(l=e.czmEnvironmentMapManager)!=null&&l.atmosphereScatteringIntensity&&(e.czmAtmosphereScatteringIntensity=(u=e.czmEnvironmentMapManager)==null?void 0:u.atmosphereScatteringIntensity)};s(),this.ad(e.czmEnvironmentMapManagerChanged.don(s))}{const s=()=>{const l=[...e.rotation??[0,0,0]];l[0]+=e.instances&&e.instances.length!=0?0:90,r.rotation=l};s(),this.d(e.rotationChanged.don(s));{const l=()=>{if(s(),!e.instances){r.instances=e.instances;return}r.instances=e.instances.map(u=>{const A=JSON.parse(JSON.stringify(u));return!A.rotation&&(A.rotation=[0,0,0]),A.rotation[0]+=90,A})};l(),this.ad(e.instancesChanged.don(l))}}this.ad(e.setMaterialEvent.don(s=>{r.setMaterial(s)}));{const s=()=>{const l=[...r.rotation];l[0]-=e.instances&&e.instances.length!=0?0:90,e.rotation=l};s(),this.d(r.rotationChanged.don(s))}{const s=this.dv(c.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),l=()=>{e.allowPicking&&!e.editing?r.allowPicking=!0:r.allowPicking=!1};l(),this.d(s.don(l))}const a=()=>{var s;r.url=c.ESSceneObject.context.getStrFromEnv(Th(typeof e.url=="string"?e.url:((s=e.url)==null?void 0:s.url)??c.ESGltfModel.defaults.url))};a(),this.d(e.urlChanged.don(a)),this.d(e.setNodePositionEvent.don((s,l)=>{r.setNodeTranslation(s,l)})),this.d(e.setNodeRotationEvent.don((s,l)=>{r.setNodeRotation(s,l)})),this.d(e.setNodeScaleEvent.don((s,l)=>{r.setNodeScale(s,l)})),this.d(e.printDebugInfoEvent.don(()=>{r.printDebugInfo()}))}get model(){return this._czmModel}flyTo(e,i){const{sceneObject:o,czmViewer:r,model:a}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):(a&&wn(r,o,i,e,a,!0),!!a):!1}};L(nc,"type",nc.register("ESCesiumViewer",c.ESGltfModel.type,nc));let hg=nc;function Vx(t,n){const e=t[0]-n[0],i=t[1]-n[1],o=t[2]-n[2];return Math.sqrt(e*e+i*i+o*o)}class $l extends c.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new c.Event));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_distance",this.disposeVar(c.react(0)));L(this,"_surfaceDistance",this.disposeVar(c.react(0)));L(this,"_height",this.disposeVar(c.react(0)));L(this,"_middlePosition",this.disposeVar(c.reactArrayWithUndefined(void 0)));L(this,"_heightPosition",this.disposeVar(c.reactArrayWithUndefined(void 0)));const o=()=>{if(this.positions)if(this.positions.length>=2)if(this._middlePosition.value=[this.positions[0][0],this.positions[0][1],this.positions[1][2]],this._heightPosition.value=[this.positions[0][0],this.positions[0][1],.5*(this.positions[1][2]+this.positions[0][2])],this.arcType===void 0||this.arcType==="GEODESIC"){const a=this._surfaceDistance.value=c.geoDistance(this.positions[0],this.positions[1]),s=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(a*a+s*s)}else if(this.arcType==="RHUMB"){const a=this._surfaceDistance.value=c.geoRhumbDistance(this.positions[0],this.positions[1]),s=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(a*a+s*s)}else if(this.arcType==="NONE"){const a=c.lbhToXyz(this.positions[0]),s=c.lbhToXyz(this.positions[1]);this._distance.value=Vx(a,s),this._surfaceDistance.value=Vx(c.lbhToXyz(this._middlePosition.value),s),this._height.value=this.positions[1][2]-this.positions[0][2]}else console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`);else this._heightPosition.value=void 0,this._distance.value=0,this._surfaceDistance.value=0,this._height.value=0};o();const r=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged));this.dispose(r.disposableOn(o));{const a=this.disposeVar(new Ye(e,i));a.ground=!1,a.loop=!1,this.dispose(c.track([a,"allowPicking"],[this,"allowPicking"])),this.dispose(c.bind([a,"arcType"],[this,"arcType"])),this.dispose(c.bind([a,"color"],[this,"color"])),this.dispose(c.bind([a,"dashLength"],[this,"dashLength"])),this.dispose(c.bind([a,"dashPattern"],[this,"dashPattern"])),this.dispose(c.bind([a,"gapColor"],[this,"gapColor"])),this.dispose(c.bind([a,"hasArrow"],[this,"hasArrow"])),this.dispose(c.bind([a,"hasDash"],[this,"hasDash"])),this.dispose(c.bind([a,"show"],[this,"show"])),this.dispose(c.bind([a,"width"],[this,"width"])),this.dispose(c.bind([a,"depthTest"],[this,"depthTest"]));{a.loop=!0;const l=()=>{if(this.positions&&this.positions.length===2){const[u,A]=this.positions;a.positions=[u,A,[u[0],u[1],A[2]]]}else a.positions=void 0};l(),this.dispose(this.positionsChanged.disposableOn(l))}this.dispose(this.flyToEvent.disposableOn(l=>{e.actived&&a.flyTo(l)}));const s=this.disposeVar(new wt(e,i));this.dispose(c.track([s,"shadowDom"],[this,"shadowDom"])),this.dispose(c.track([s,"cssAllInitial"],[this,"cssAllInitial"])),this.dispose(c.track([s,"show"],[this,"show"]));{const l=()=>{s.position=this.heightPosition};l(),this.dispose(this.heightPositionChanged.disposableOn(l))}{const l=()=>{s.innerHTML=xo(`高度: ${Ih(this.height)}`,0)};l(),this.dispose(this.heightChanged.disposableOn(l))}this.ad(s.pickedEvent.don(l=>{Gi(l)===0&&this.pickedEvent.emit(l)}))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}get surfaceDistance(){return this._surfaceDistance.value}get surfaceDistanceChanged(){return this._surfaceDistance.changed}get height(){return this._height.value}get heightChanged(){return this._height.changed}get middlePosition(){return this._middlePosition.value}get middlePositionChanged(){return this._middlePosition.changed}get heightPosition(){return this._heightPosition.value}get heightPositionChanged(){return this._heightPosition.changed}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:c.reactPositions(void 0),width:1,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.reactArrayWithUndefined([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1})})($l||($l={})),c.extendClassProps($l.prototype,$l.createDefaultProps);const ic=class ic extends on{constructor(e,i){super(e,i);L(this,"_geoHeightMeasurement");if(this._geoHeightMeasurement=this.disposeVar(new $l(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmHeightMeasurement:r}=this;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"]));{const a=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.width=e.strokeWidth,r.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):u==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):(r.hasDash=!1,r.hasArrow=!1);const A=e.strokeStyle;if(A.material==="hasDash"&&A.materialParams)try{const h=A.materialParams;Reflect.has(h,"gapColor")&&(r.gapColor=h.gapColor??[0,0,0,0]),Reflect.has(h,"dashLength")&&(r.dashLength=h.dashLength),Reflect.has(h,"dashPattern")&&(r.dashPattern=h.dashPattern)}catch(h){console.error(h)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(s.disposableOn(a))}this.dispose(r.pickedEvent.disposableOn(a=>{Gi(a)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(a)}))}get czmHeightMeasurement(){return this._geoHeightMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmHeightMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmHeightMeasurement:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(ic,"type",ic.register("ESCesiumViewer",c.ESHeightMeasurement.type,ic));let Ag=ic;const fg={czmAnimationsStand:[{index:0,name:"Stand",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],czmAnimationsWalk:[{index:2,name:"Walk",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],czmAnimationsRun:[{index:1,name:"Run",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}]},rc=class rc extends He{constructor(e,i){super(e,i);L(this,"_czmModelPrimitive");const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModelPrimitive=this.disposeVar(new Ht(i,this.sceneObject.id));const r=this._czmModelPrimitive;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(Mt([r,"rotation"],[e,"rotation"])),this.dispose(c.bind([r,"scale"],[e,"scale"])),this.d(r.readyEvent.don(g=>{e.readyEvent.emit(g)}));{const g=this.dv(c.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),v=()=>{e.allowPicking&&!e.editing?r.allowPicking=!0:r.allowPicking=!1};v(),this.d(g.don(v))}const a=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/worker.glb"),s=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/police.glb"),l=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/pedestrian.glb"),u=c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/Stranger.glb"),A=c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsMan.glb"),h=c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsWoman.glb"),f=()=>{switch(e.mode){case"worker":r.url=a;break;case"police":r.url=s;break;case"pedestrian":r.url=l;break;case"stranger":r.url=u;break;case"suitMan":r.url=A;break;case"suitWoman":r.url=h;break;default:r.url=a;break}};this.dispose(e.modeChanged.disposableOn(()=>{f()})),f();const d=()=>{const g=e.animation??c.ESHuman.defaults.animation;if(!e.show){r.activeAnimationsJson=void 0;return}g==="walking"?r.activeAnimationsJson=fg.czmAnimationsWalk:g==="standing"?r.activeAnimationsJson=fg.czmAnimationsStand:g==="running"&&(r.activeAnimationsJson=fg.czmAnimationsRun)};d();const p=this.ad(c.createNextAnimateFrameEvent(e.showChanged,e.animationChanged));this.dispose(p.disposableOn(()=>d())),this.ad(new Bh(o,r))}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmModelPrimitive:a}=this;return!r.actived||!r.viewer?!1:o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):(a&&wn(r,o,i,e,a,!0),!!a)}};L(rc,"type",rc.register("ESCesiumViewer",c.ESHuman.type,rc));let pg=rc;class Nx extends c.Destroyable{constructor(e,i){super();L(this,"_czmGeoCanvasImagePoi");L(this,"flyTo",(e,i)=>{if(this.czmGeoCanvasImagePoi.position){Fe(this.czmViewer.viewer,this.czmGeoCanvasImagePoi.position,1e3,Hn,e);return}this.czmGeoCanvasImagePoi.flyTo(e&&e*1e3)});this.sceneObject=e,this.czmViewer=i,this._czmGeoCanvasImagePoi=this.disposeVar(new yi(i));const o=this._czmGeoCanvasImagePoi;o.pickOnClick=!0,this.d(o.pickedEvent.don(r=>{(e.allowPicking??!1)&&e.pickedEvent.emit(r)}));{const r=A=>{let h=A;return A.includes("inner://")&&(h="${earthsdk3-assets-script-dir}/assets/img/points/"+A.split("inner://")[1]),c.ESSceneObject.context.getStrFromEnv(Th(h))},a=()=>{const A=r(typeof e.url=="string"?e.url:e.url.url);if(o.imageUri=A,e.sizeByContent){const f=new Image;f.src=A,f.onload=()=>{o.size=[f.width,f.height]}}else{const f=e.size;o.size=[...f]}},s=this.disposeVar(c.createNextAnimateFrameEvent(e.urlChanged,e.sizeByContentChanged,e.sizeChanged));this.dispose(s.disposableOn(()=>a())),a(),this.d(c.track([o,"zOrder"],[e,"zOrder"])),this.dispose(c.track([o,"show"],[e,"show"])),this.dispose(c.bind([o,"position"],[e,"position"])),this.ad(c.bind([o,"isHoverZoom"],[e,"isHoverZoom"]));{const A=()=>{o.scale=[e.scale[1],e.scale[2]]};A(),this.dispose(e.scaleChanged.don(A))}const l=()=>{const A=e.anchor,h=e.offset;A?o.originRatioAndOffset=[...A,-h[0],-h[1]]:o.originRatioAndOffset=[0,0,0,0]},u=this.ad(c.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(u.disposableOn(()=>l())),l(),this.dispose(o.clickEvent.disposableOn(A=>{const{offsetX:h,offsetY:f}=A,p={type:A.button===0?"leftClick":A.button===2?"rightClick":void 0,add:{mousePos:[h,f]}};e.widgetEvent.emit(p)})),this.dispose(o.hoveredChanged.disposableOn(A=>{if(A===void 0)return;const h={type:A?"mouseEnter":"mouseLeave"};e.widgetEvent.emit(h)}))}}get czmGeoCanvasImagePoi(){return this._czmGeoCanvasImagePoi}}class Hx extends c.Destroyable{constructor(e,i,o){super();L(this,"_czmGeoImageModel");L(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});L(this,"_isPointEvent",!1);L(this,"flyTo",(e,i)=>{if(this.czmGeoImageModel.position)return Gn(this.czmViewer,this.sceneObject,i,this.sceneObject.position,Math.max(...this.czmGeoImageModel.size),e,!0);this.czmGeoImageModel.flyTo(e&&e*1e3)});this.sceneObject=e,this.czmViewer=i,this._czmGeoImageModel=this.disposeVar(new $i(i,e.id));const r=this._czmGeoImageModel;this.ad(i.clickEvent.don(f=>{const d=f==null?void 0:f.pointerEvent;d&&(this._isPointEvent=!0,this._eventInfo={type:d.button==0?"leftClick":d.button==2?"rightClick":"leftClick",add:{mousePos:[d.offsetX,d.offsetY]}})})),this.d(e.pickedEvent.don(f=>{var d,p,g;f.screenPosition&&this._isPointEvent&&f.attachedInfo!="innerHoverEvent"&&((d=this._eventInfo.add)!=null&&d.mousePos)&&Math.abs(f.screenPosition[0]-((p=this._eventInfo.add)==null?void 0:p.mousePos[0]))<1&&Math.abs(f.screenPosition[1]-((g=this._eventInfo.add)==null?void 0:g.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),c.registerCreatedEventUpdate(this,e,()=>{const f=i.getEngineObject(e);this.ad(f.lastHoverResultChanged.don((d,p)=>{(d==null?void 0:d.sceneObject)==(p==null?void 0:p.sceneObject)||(d==null?void 0:d.sceneObject)!=e&&(p==null?void 0:p.sceneObject)!=e||(d!=null&&d.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:d==null?void 0:d.screenPosition}},d.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&d.sceneObject.id==e.id&&(r.scale=[r.scale[0]*1.5,r.scale[1]*1.5])),p!=null&&p.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:d==null?void 0:d.screenPosition}},p.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&p.sceneObject.id==e.id&&(r.scale=[r.scale[0]/1.5,r.scale[1]/1.5])))}))});const a=e.sizeByContent,l=(f=>{let d=f;return f.includes("inner://")&&(d="${earthsdk3-assets-script-dir}/assets/img/points/"+f.split("inner://")[1]),c.ESSceneObject.context.getStrFromEnv(Th(d))})(typeof o.sceneObject.url=="string"?o.sceneObject.url:o.sceneObject.url.url),u=new Image;u.src=l,u.onload=()=>{if(a)r.size=[u.width/100,u.height/100];else{const f=e.size;r.size=[f[0]/100,f[1]/100]}},r.uri=l,this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),r.pixelSize=void 0,r.useAxis="XZ";{const f=()=>{r.scale=[e.scale[1],e.scale[2]]};f(),this.d(e.scaleChanged.don(f))}{const f=()=>{e.rotationType===0&&(r.rotationMode="WithProp",this.d(Mt([r,"rotation"],[e,"rotation"]))),e.rotationType===1&&(r.rotationMode="WithCamera"),e.rotationType===2&&(r.rotationMode="WithCameraOnlyZ")};f(),this.dispose(e.rotationTypeChanged.disposableOn(f))}const A=()=>{const f=e.anchor,d=e.offset;f?r.originRatioAndOffset=[...f,-d[0]/100,-d[1]/100]:r.originRatioAndOffset=[0,0,0,0]},h=this.ad(c.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(h.disposableOn(()=>A())),A()}get czmGeoImageModel(){return this._czmGeoImageModel}}const oc=class oc extends Gl{constructor(e,i){super(e,i);L(this,"_resetting");if(!i.viewer){console.warn("viewer is undefined!");return}const r=this.disposeVar(c.createNextAnimateFrameEvent(this.sceneObject.urlChanged,this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged));this._resetting=this.disposeVar(new c.ObjResettingWithEvent(r,()=>this.sceneObject.screenRender?new Nx(this.sceneObject,this.czmViewer):new Hx(this.sceneObject,this.czmViewer,this)))}get resetting(){return this._resetting}flyTo(e,i){const{sceneObject:o,czmViewer:r,resetting:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a&&a.obj&&a.obj.flyTo(e,i),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(oc,"type",oc.register("ESCesiumViewer",c.ESImageLabel.type,oc));let dg=oc;function dO(t){switch(t){case"wms":return"WebMapServiceImageryProvider";case"tms":return"TileMapServiceImageryProvider";case"wmts":return"WebMapTileServiceImageryProvider";case"xyz":return"UrlTemplateImageryProvider";case"ion":return"IonImageryProvider"}}const sc=class sc extends Nn{constructor(e,i){super(e,i);L(this,"_czmImagery");if(this._czmImagery=this.dv(new Zr(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmImagery;{const a=this.ad(c.reactJson(""));{const u=()=>{if(typeof e.url=="string")a.value=c.ESSceneObject.context.getStrFromEnv(e.url);else{const A=e.url;A.url=c.ESSceneObject.context.getStrFromEnv(A.url),a.value=A}};u(),this.ad(e.urlChanged.don(u))}const s=()=>{var p;if(!a.value)return;const u=(((p=e.options)==null?void 0:p.type)??"auto").toLowerCase(),A=e.options??{};let h={type:"UrlTemplateImageryProvider",url:a.value,rectangle:e.rectangle,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,...A},f=a.value,d=typeof f=="string"?f:f.url;if(u==="auto"){const g=d.toLowerCase();if(g.startsWith("ion://")){const y=+g.substring(6);h={...A,assetId:y,type:"IonImageryProvider"}}else if(g.includes("{x}")||g.includes("{y}")||g.includes("{z}"))h.type="UrlTemplateImageryProvider";else if(g.includes("wmts"))h.type="WebMapTileServiceImageryProvider";else if(g.includes("wms"))h.type="WebMapServiceImageryProvider";else{if(d.includes("/tilemapresource.xml")){const v=d.split("/tilemapresource.xml").join("");typeof f=="string"?f=v:f.url=v,h.url=f}h.type="TileMapServiceImageryProvider"}}else{if(u==="tms"&&d.includes("/tilemapresource.xml")){const g=d.split("/tilemapresource.xml").join("");typeof f=="string"?f=g:f.url=g,h.url=f}else if(u==="ion"&&d.startsWith("ion://")){const v=+d.substring(6);h={...A,assetId:v,type:"IonImageryProvider"}}h.type=dO(u)}console.log("imageryProvider",h),r.imageryProvider=h};s();const l=this.dv(c.createNextAnimateFrameEvent(a.changed,e.maximumLevelChanged,e.minimumLevelChanged,e.optionsChanged,e.rectangleChanged));this.d(l.don(s))}this.d(c.track([r,"show"],[e,"show"])),this.d(c.bind([r,"alpha"],[e,"opacity"])),this.d(c.bind([r,"alpha"],[e,"czmAlpha"])),this.d(c.track([r,"splitDirection"],[e,"splitDirection"])),this.d(c.track([r,"brightness"],[e,"czmBrightness"])),this.d(c.track([r,"contrast"],[e,"czmContrast"])),this.d(c.track([r,"hue"],[e,"czmHue"])),this.d(c.track([r,"saturation"],[e,"czmSaturation"])),this.d(c.track([r,"gamma"],[e,"czmGamma"])),this.d(c.track([r,"rectangle"],[e,"rectangle"])),this.d(c.track([r,"zIndex"],[e,"zIndex"])),this.ad(c.track([r,"targetID"],[e,"targetID"]))}get czmImagery(){return this._czmImagery}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmImagery:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmImagery:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(sc,"type",sc.register("ESCesiumViewer",c.ESImageryLayer.type,sc));let mg=sc;class mO extends c.Destroyable{constructor(e,i,o,r){super();L(this,"_show");L(this,"_czmESCustomPrimitive");L(this,"_czmTexture");this._sceneObject=e,this._show=this.disposeVar(c.react(this._sceneObject.show)),this._czmESCustomPrimitive=this.dv(new at(i,this._sceneObject.id)),this._czmTexture=this.dv(new At(i));const a=e,s=this._czmESCustomPrimitive,l=this._czmTexture;this.dispose(c.track([s,"show"],[this,"show"])),this.dispose(c.track([s,"show"],[a,"show"])),this.dispose(c.track([s,"allowPicking"],[a,"allowPicking"])),this.dispose(c.track([s,"rotation"],[a,"rotation"])),this.dispose(c.track([s,"position"],[a,"position"])),this.dispose(c.track([s,"scale"],[a,"scale"])),this.ad(a.allowPickingChanged.don(()=>{s.allowPicking=a.allowPicking,s.pass=a.allowPicking?"TRANSLUCENT":"OVERLAY"}));{const u=()=>{const h=a.size/2,f=r[0].map(S=>S*h),d=r[1].map(S=>S*h),p=r[2].map(S=>S*h),g=r[3].map(S=>S*h),v=[...f,...d,...p,...g];let y=[0,3,2,0,2,1];(o=="north"||o=="west"||o=="bottom")&&(y=y.reverse());const m=[0,0],x=[1,0],_=[1,1],E=[0,1];let B=[];o=="east"||o=="south"?B=[...x,...m,...E,..._]:o=="west"?B=[...x,..._,...E,...m]:o=="top"?B=[...E,..._,...x,...m]:B=[...m,...x,..._,...E],s.indexTypedArray=new Uint16Array(y),s.attributes={position:{typedArray:new Float32Array(v),componentsPerAttribute:3},st:{typedArray:new Float32Array(B),componentsPerAttribute:2}},l.uri=c.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/img/skybox/${a.mode}/${o}.${a.mode!="blueSky"?"png":"jpg"}`);const P=i.getCameraInfo();if(P!=null){const T=c.getDistancesFromPositions([a.position,P.position],"NONE")[0]/(a.size/2*a.autoOpacityFactor);this.changeOpacity(a.autoFollow?1:T)}const I=s.computeLocalAxisedBoundingBoxFromAttribute("position");if(!I)return;const{min:M,max:F}=I;s.setLocalAxisedBoundingBox(M,F)};u();const A=this.disposeVar(c.createNextAnimateFrameEvent(a.sizeChanged,a.modeChanged));this.dispose(A.disposableOn(u))}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}get czmESCustomPrimitive(){return this._czmESCustomPrimitive}get czmTexture(){return this._czmTexture}changeOpacity(e){this._czmESCustomPrimitive.uniformMap={u_image:{type:"texture",id:this._czmTexture.id},u_color:[1,1,1,1-e>=0?1-e:0]}}}class gO extends c.Destroyable{constructor(n,e,i){if(super(),!e.viewer)return;let o=!0,r;this.dispose(e.viewer.scene.preUpdate.addEventListener(()=>{a()}));function a(){var l;if(!((l=e.viewer)!=null&&l.camera))return;const s=e.getCameraInfo();if(s!=null&&(r==null||r.position[0]!=s.position[0]||r.position[1]!=s.position[1]||r.position[2]!=s.position[2]||r.rotation[0]!=s.rotation[0]||r.rotation[1]!=s.rotation[1]||r.rotation[2]!=s.rotation[2])){r=s;const A=c.getDistancesFromPositions([n.position,r.position],"NONE")[0]/(n.size/2*n.autoOpacityFactor);n.autoFollow?(n.position=r.position,o&&(o=!1,i.forEach(h=>{h.changeOpacity(1)}))):i.forEach(h=>{h.changeOpacity(A)})}}a()}}const Pt=class Pt extends He{constructor(e,i){super(e,i);L(this,"_czmSkyBoxComponents",[]);if(!i.viewer){console.warn("viewer is undefined!");return}!Pt._defaultLocalBox&&Pt._firstLoad&&(Pt._firstLoad=!1,Pt._defaultLocalBox=i.xbsjLocalBoxSources),Pt._eSLocalSkyBoxArr.push(e),this.d(()=>{Pt._eSLocalSkyBoxArr.includes(e)&&Pt._eSLocalSkyBoxArr.splice(Pt._eSLocalSkyBoxArr.indexOf(e),1),this.ChangeAutoFollow()});const r={bottom:[[-1,-1,-1],[1,-1,-1],[1,1,-1],[-1,1,-1]],top:[[-1,-1,1],[1,-1,1],[1,1,1],[-1,1,1]],south:[[-1,-1,-1],[1,-1,-1],[1,-1,1],[-1,-1,1]],north:[[-1,1,-1],[1,1,-1],[1,1,1],[-1,1,1]],east:[[1,-1,-1],[1,1,-1],[1,1,1],[1,-1,1]],west:[[-1,1,-1],[-1,1,1],[-1,-1,1],[-1,-1,-1]]};for(const a in r)if(Object.prototype.hasOwnProperty.call(r,a)){const s=r[a];this._czmSkyBoxComponents.push(this.dv(new mO(e,i,a,s)))}{const a=this.disposeVar(c.createNextAnimateFrameEvent(e.autoFollowChanged,e.autoOpacityFactorChanged));this.disposeVar(new c.ObjResettingWithEvent(a,()=>(this.ChangeAutoFollow(),new gO(e,i,this._czmSkyBoxComponents))))}{const a=()=>{this.ChangeAutoFollow()},s=this.disposeVar(c.createNextAnimateFrameEvent(e.sizeChanged,e.modeChanged,e.showChanged));this.dispose(s.disposableOn(a))}}ChangeAutoFollow(){const{czmViewer:e}=this;for(let i=Pt._eSLocalSkyBoxArr.length-1;i>=0;i--){const o=Pt._eSLocalSkyBoxArr[i];if(o.autoFollow&&o.show){e.xbsjLocalBoxSources={positiveX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/east.${o.mode!="blueSky"?"png":"jpg"}`,negativeX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/west.${o.mode!="blueSky"?"png":"jpg"}`,positiveY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/bottom.${o.mode!="blueSky"?"png":"jpg"}`,negativeY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/top.${o.mode!="blueSky"?"png":"jpg"}`,positiveZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/north.${o.mode!="blueSky"?"png":"jpg"}`,negativeZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/south.${o.mode!="blueSky"?"png":"jpg"}`};break}i==0&&(e.xbsjLocalBoxSources=Pt._defaultLocalBox)}Pt._eSLocalSkyBoxArr.length==0&&(e.xbsjLocalBoxSources=Pt._defaultLocalBox)}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const a=o.size??c.ESLocalSkyBox.defaults.size;return o.position?(Gn(r,o,i,o.position,a,e,!0),!0):!1}}};L(Pt,"type",Pt.register("ESCesiumViewer",c.ESLocalSkyBox.type,Pt)),L(Pt,"_defaultLocalBox"),L(Pt,"_firstLoad",!0),L(Pt,"_eSLocalSkyBoxArr",[]);let gg=Pt;const ni=class ni extends He{constructor(e,i){super(e,i);L(this,"_geoCustomDivPoi");L(this,"_textFunc",this.disposeVar(c.react(void 0)));if(this._geoCustomDivPoi=this.disposeVar(new wt(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this.geoCustomDivPoi;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"]));{this.dispose(r.pickedEvent.disposableOn(a=>{(e.allowPicking??c.ESLocationMeasurement.defaults.allowPicking)&&e.pickedEvent.emit(a)})),this.dispose(r.innerHtmlMounted.disposableOn(a=>{const s=a.firstElementChild;s&&(s.style.pointerEvents="auto",s.style.cursor="default",s.onclick=l=>r.pickFromDiv(s,{type:"viewerPicking",pointerEvent:l}))}));{const a=()=>{if(!e.position)return;const l=(this.textFunc??ni.defaultTextFunc_度格式)(e.position);r.innerHTML=xo(l)};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.positionChanged,this.textFuncChanged));this.dispose(s.disposableOn(a))}{const a=()=>{i.lonLatFormat??(i.lonLatFormat="DECIMAL_DEGREE"),this.textFunc=i.lonLatFormat=="DECIMAL_DEGREE"?ni.defaultTextFunc_度格式:i.lonLatFormat=="DEGREES_DECIMAL_MINUTES"?ni.defaultTextFunc_度分格式:ni.defaultTextFunc_度分秒格式};a(),this.d(i.lonLatFormatChanged.don(()=>{a()}))}}}get geoCustomDivPoi(){return this._geoCustomDivPoi}get textFunc(){return this._textFunc.value}set textFunc(e){this._textFunc.value=e}get textFuncChanged(){return this._textFunc.changed}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoCustomDivPoi:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoCustomDivPoi:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(ni,"type",ni.register("ESCesiumViewer",c.ESLocationMeasurement.type,ni)),L(ni,"defaultTextFunc_度格式",e=>{if(!e)return"";const[i=0,o=0,r=0]=e;return`经度: ${i.toFixed(5)}°
3104
+ `,xt=class xt extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_loadFuncReact",this.disposeVar(c.react(void 0)));L(this,"_dataSource",this.disposeVar(c.react(void 0)));L(this,"_data");L(this,"_defaultHeight",{});L(this,"_defaultBoundingSphere",new b.BoundingSphere);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}let r=()=>{this.dataSource&&o.dataSources.remove(this.dataSource,!0),this.dataSource=void 0,this._data=void 0};this.dispose(()=>{r()});{const a=this.dv(c.createProcessingFromAsyncFunc(async u=>{this.dataSource&&r(),this.url&&(typeof this.url=="object"?this._data=this.url:c.isJSON(this.url)?this._data=JSON.parse(this.url):await fetch(c.ESSceneObject.context.getStrFromEnv(this.url)).then(A=>A.json()).then(A=>{this._data=A}).catch(A=>{console.warn("ESGeoJson数据加载失败",A)}),this.dataSource=await b.GeoJsonDataSource.load(this._data),o.dataSources.add(this.dataSource).then(A=>{var f,d;const h=[];for(const p of A.entities.values)if(b.Entity.prototype&&(p.ESSceneObjectID=i),this._isEntityShow(p,e),p.polygon&&h.push(...(f=p.polygon.hierarchy)==null?void 0:f.getValue(b.JulianDate.now()).positions),p.polyline&&h.push(...(d=p.polyline.positions)==null?void 0:d.getValue(b.JulianDate.now())),p.position){const g=p.position.getValue(b.JulianDate.now());g&&h.push(g)}this._defaultBoundingSphere=b.BoundingSphere.fromPoints(h)}))})),s=()=>{a.isRunning&&a.cancel(),a.restart()};s();const l=this.dv(c.createNextAnimateFrameEvent(this.loadFunChanged,this.urlChanged));this.dispose(l.don(s))}{const a=()=>{var l,u;if(this.dataSource)if(this.dataSource.show=this.show,this.loadFun)try{this.loadFun(this.dataSource)}catch(A){console.error(A)}else{const A=this.dataSource.entities.values;for(let h=0;h<A.length;h++){const f=A[h];if(f.polygon){this._defaultHeight[f.id]||(this._defaultHeight[f.id]=(l=f.polygon.height)==null?void 0:l.getValue(b.JulianDate.now())),f.polygon.height=this.fillGround?void 0:new b.ConstantProperty(this._defaultHeight[f.id]),f.polygon.perPositionHeight=new b.ConstantProperty(!this.fillGround),f.polygon.heightReference=new b.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?b.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?b.HeightReference.CLAMP_TO_GROUND:b.HeightReference.RELATIVE_TO_GROUND),f.polygon.show=new b.ConstantProperty(this.filled??xt.defaults.filled),f.polygon.material=new b.ColorMaterialProperty(new b.Color(...this.fillColor??xt.defaults.fillColor)),f.polygon.outline=new b.ConstantProperty(!1),f.polygon.classificationType=b.ClassificationType[this.classificationType.toUpperCase()],f.polyline=new b.PolylineGraphics;const d=JSON.parse(JSON.stringify((u=f.polygon.hierarchy)==null?void 0:u.getValue(b.JulianDate.now()).positions));b.Cartesian3.equals(d[0],d[d.length-1])||d.push(d[0]),f.polyline.positions=d,f.polyline.classificationType=b.ClassificationType[this.classificationType.toUpperCase()]}if(f.polyline&&(f.polyline.classificationType=b.ClassificationType[this.classificationType.toUpperCase()],f.polyline.show=new b.ConstantProperty(this.stroked??xt.defaults.stroked),f.polyline.width=new b.ConstantProperty(this.strokeWidth??xt.defaults.strokeWidth),f.polyline.material=new b.ColorMaterialProperty(new b.Color(...this.strokeColor??xt.defaults.strokeColor)),f.polyline.clampToGround=new b.ConstantProperty(this.strokeGround)),f.billboard){f.billboard.show=new b.ConstantProperty(this.imageShow??xt.defaults.imageShow),f.billboard.width=new b.ConstantProperty(this.imageSize?this.imageSize[0]:xt.defaults.imageSize[0]),f.billboard.height=new b.ConstantProperty(this.imageSize?this.imageSize[1]:xt.defaults.imageSize[1]);const d=this.imageUrl?typeof this.imageUrl=="string"?this.imageUrl:this.imageUrl.url:xt.defaults.imageUrl;f.billboard.image=new b.ConstantProperty(c.ESSceneObject.context.getStrFromEnv(d)),f.billboard.horizontalOrigin=new b.ConstantProperty(b.HorizontalOrigin.LEFT),f.billboard.verticalOrigin=new b.ConstantProperty(b.VerticalOrigin.TOP),f.billboard.heightReference=new b.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?b.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?b.HeightReference.CLAMP_TO_GROUND:b.HeightReference.RELATIVE_TO_GROUND);const p=this.imageAnchor??xt.defaults.imageAnchor,g=this.imageOffset??xt.defaults.imageOffset;if(f.billboard.pixelOffset=new b.ConstantProperty(b.Cartesian2.fromArray([-p[0]*f.billboard.width.getValue(b.JulianDate.now())+g[0],-p[1]*f.billboard.height.getValue(b.JulianDate.now())+g[1]])),f.label=new b.LabelGraphics,!f.label)return;f.label.show=new b.ConstantProperty(this.textShow??xt.defaults.textShow),f.label.heightReference=new b.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?b.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?b.HeightReference.CLAMP_TO_GROUND:b.HeightReference.RELATIVE_TO_GROUND),f.label.text=new b.ConstantProperty(this.textProperty&&this.textProperty!==""&&f.properties&&f.properties[this.textProperty]?f.properties[this.textProperty].getValue():this.textDefaultText??xt.defaults.textDefaultText),f.label.fillColor=new b.ConstantProperty(new b.Color(...this.textColor??xt.defaults.textColor)),f.label.showBackground=new b.ConstantProperty(this.textBackgroundColor!=null);const v=this.textFontSize&&this.textFontSize!=0?this.textFontSize:xt.defaults.textFontSize,y=this.textOffset??xt.defaults.textOffset;f.label.backgroundColor=new b.ConstantProperty(new b.Color(...this.textBackgroundColor??xt.defaults.textBackgroundColor)),f.label.font=new b.ConstantProperty(`${this.textFontStyle} ${this.textFontWeight} ${v}px ${this.textFontFamily??xt.defaults.textFontFamily}`),f.label.horizontalOrigin=new b.ConstantProperty(b.HorizontalOrigin.LEFT),f.label.verticalOrigin=new b.ConstantProperty(b.VerticalOrigin.TOP),f.label.eyeOffset=new b.ConstantProperty(b.Cartesian3.fromArray([0,0,-1]));const m=this.textAnchor??xt.defaults.textAnchor;f.label.pixelOffset=new b.ConstantProperty(b.Cartesian2.fromArray([-m[0]*((this.textBackgroundColor?-14:0)+this._getTextPixelWidth(f.label.text.getValue(b.JulianDate.now()),f.label.font.getValue(b.JulianDate.now())))+y[0],-m[1]*((this.textBackgroundColor?10:0)+v)+y[1]]))}}}};a();const s=this.dv(c.createNextAnimateFrameEvent(this._dataSource.changed,this.showChanged,this.strokedChanged,this.strokeWidthChanged,this.strokeWidthTypeChanged,this.strokeColorChanged,this.strokeMaterialChanged,this.strokeMaterialParamsChanged,this.strokeGroundChanged,this.filledChanged,this.fillColorChanged,this.fillMaterialChanged,this.fillMaterialParamsChanged,this.fillGroundChanged,this.imageShowChanged,this.imageUrlChanged,this.imageSizeChanged,this.imageAnchorChanged,this.imageOffsetChanged,this.textShowChanged,this.textPropertyChanged,this.textDefaultTextChanged,this.textColorChanged,this.textBackgroundColorChanged,this.textFontFamilyChanged,this.textFontSizeChanged,this.textFontStyleChanged,this.textFontWeightChanged,this.textAnchorChanged,this.textOffsetChanged,this.heightReferenceChanged,this.classificationTypeChanged));this.dispose(s.don(a))}{const a=()=>{if(!this.dataSource)return;const l=this.dataSource.entities.values;for(let u=0;u<l.length;u++){const A=l[u];this._isEntityShow(A,e)}};a();const s=this.ad(c.createNextAnimateFrameEvent(this.minFeatureVisibleDistanceChanged,this.maxFeatureVisibleDistanceChanged,e.cameraChanged,this.showChanged));this.ad(s.don(a))}{const a=()=>{if(this.loadFuncStr)try{const s=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=s}catch(s){console.error(s),this.loadFun=void 0}else this.loadFun=void 0};a(),this.dispose(this.loadFuncStrChanged.disposableOn(a))}this.dispose(this.flyToEvent.disposableOn(a=>{e.actived&&this.dataSource&&(a!==void 0?o.flyTo(this.dataSource,{duration:a/1e3}).then(s=>{s||o.camera.flyToBoundingSphere(this._defaultBoundingSphere,{duration:a/1e3})}):o.flyTo(this.dataSource).then(s=>{s||o.camera.flyToBoundingSphere(this._defaultBoundingSphere)}))}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get loadFun(){return this._loadFuncReact.value}set loadFun(e){this._loadFuncReact.value=e}get loadFunChanged(){return this._loadFuncReact.changed}get dataSource(){return this._dataSource.value}set dataSource(e){this._dataSource.value=e}_getTextPixelWidth(e,i="16px sans-serif"){const r=document.createElement("canvas").getContext("2d");return r.font=i,r.measureText(e).width}_isEntityShow(e,i){var o;if(this.minFeatureVisibleDistance==0&&this.maxFeatureVisibleDistance==0){e.show=this.show;return}if((o=i.viewer)!=null&&o.camera&&this.show){let r;if(e.polygon&&e.polygon.hierarchy)r=c.getMinMaxCorner(e.polygon.hierarchy.getValue(b.JulianDate.now()).positions.map(l=>Ue(l))).center;else if(e.polyline&&e.polyline.positions)r=c.getMinMaxCorner(e.polyline.positions.getValue(b.JulianDate.now()).map(l=>Ue(l))).center;else if(e.position){const l=e.position.getValue(b.JulianDate.now());l&&(r=Ue(l))}if(!r||isNaN(r[0]))return;const a=c.getDistancesFromPositions([r,Fn(i.viewer.camera)],"NONE")[0];let s=!1;this.minFeatureVisibleDistance<this.maxFeatureVisibleDistance?s=this.minFeatureVisibleDistance<a&&a<this.maxFeatureVisibleDistance:this.maxFeatureVisibleDistance==0?s=a>this.minFeatureVisibleDistance:this.minFeatureVisibleDistance==0&&(s=a<this.maxFeatureVisibleDistance),e.show=this.show&&s}}};L(xt,"defaults",{show:!0,allowPicking:!0,url:Qx,defaultLoadFuncStr:kx,defaultLoadFuncDocStr:pO,data:AO,dataMd:fO,stroked:!0,strokeWidth:1,strokeWidthType:"world",strokeColor:[.79,.91,.06,1],strokeMaterial:"",strokeMaterialParams:{},strokeGround:!1,filled:!0,fillColor:[.79,.91,.06,.2],fillMaterial:"",fillMaterialParams:{},fillGround:!1,imageShow:!0,imageUrl:"${earthsdk3-assets-script-dir}/assets/misc/location.png",imageSize:[64,64],imageAnchor:[.5,1],imageOffset:[0,0],textShow:!0,textProperty:"",textDefaultText:"默认标注",textColor:[1,1,1,1],textBackgroundColor:[.79,.91,.06,1],textFontFamily:"Arial",textFontSize:16,textFontWeight:"normal",textFontStyle:"normal",textAnchor:[.5,1],textOffset:[0,0],strokeWidthTypes:[["screen","screen"],["world","world"]],minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReferences:[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]]});let Ko=xt;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:void 0,loadFuncStr:void 0,url:void 0,stroked:void 0,strokeWidth:void 0,strokeWidthType:"world",strokeColor:c.reactArrayWithUndefined(void 0),strokeMaterial:void 0,strokeMaterialParams:c.reactJsonWithUndefined(void 0),strokeGround:void 0,filled:void 0,fillColor:c.reactArrayWithUndefined(void 0),fillMaterial:void 0,fillMaterialParams:c.reactJsonWithUndefined(void 0),fillGround:void 0,imageShow:void 0,imageUrl:void 0,imageSize:c.reactArrayWithUndefined(void 0),imageAnchor:c.reactArrayWithUndefined(void 0),imageOffset:c.reactArrayWithUndefined(void 0),textShow:void 0,textProperty:void 0,textDefaultText:void 0,textColor:c.reactArrayWithUndefined(void 0),textBackgroundColor:c.reactArrayWithUndefined(void 0),textFontFamily:void 0,textFontSize:void 0,textFontStyle:void 0,textFontWeight:void 0,textAnchor:c.reactArrayWithUndefined(void 0),textOffset:c.reactArrayWithUndefined(void 0),minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReference:"NONE",classificationType:"TERRAIN"})})(Ko||(Ko={})),c.extendClassProps(Ko.prototype,Ko.createDefaultProps);const Ju=class Ju extends Nn{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}const o=this.ad(new Ko(e,n.id));this.ad(c.track([o,"show"],[n,"show"])),this.ad(c.track([o,"allowPicking"],[n,"allowPicking"])),this.ad(c.track([o,"loadFuncStr"],[n,"loadFuncStr"])),this.ad(c.track([o,"url"],[n,"features"])),this.ad(c.track([o,"stroked"],[n,"stroked"])),this.ad(c.track([o,"strokeWidth"],[n,"strokeWidth"])),this.ad(c.track([o,"strokeWidthType"],[n,"strokeWidthType"])),this.ad(c.track([o,"strokeColor"],[n,"strokeColor"])),this.ad(c.track([o,"strokeMaterial"],[n,"strokeMaterial"])),this.ad(c.track([o,"strokeMaterialParams"],[n,"strokeMaterialParams"])),this.ad(c.track([o,"strokeGround"],[n,"strokeGround"])),this.ad(c.track([o,"filled"],[n,"filled"])),this.ad(c.track([o,"fillColor"],[n,"fillColor"])),this.ad(c.track([o,"fillMaterial"],[n,"fillMaterial"])),this.ad(c.track([o,"fillMaterialParams"],[n,"fillMaterialParams"])),this.ad(c.track([o,"fillGround"],[n,"fillGround"])),this.ad(c.track([o,"imageShow"],[n,"imageShow"])),this.ad(c.track([o,"imageUrl"],[n,"imageUrl"])),this.ad(c.track([o,"imageSize"],[n,"imageSize"])),this.ad(c.track([o,"imageAnchor"],[n,"imageAnchor"])),this.ad(c.track([o,"imageOffset"],[n,"imageOffset"])),this.ad(c.track([o,"textShow"],[n,"textShow"])),this.ad(c.track([o,"textProperty"],[n,"textProperty"])),this.ad(c.track([o,"textDefaultText"],[n,"textDefaultText"])),this.ad(c.track([o,"textColor"],[n,"textColor"])),this.ad(c.track([o,"textBackgroundColor"],[n,"textBackgroundColor"])),this.ad(c.track([o,"textFontFamily"],[n,"textFontFamily"])),this.ad(c.track([o,"textFontSize"],[n,"textFontSize"])),this.ad(c.track([o,"textFontStyle"],[n,"textFontStyle"])),this.ad(c.track([o,"textFontWeight"],[n,"textFontWeight"])),this.ad(c.track([o,"textAnchor"],[n,"textAnchor"])),this.ad(c.track([o,"textOffset"],[n,"textOffset"])),this.ad(c.track([o,"minFeatureVisibleDistance"],[n,"minFeatureVisibleDistance"])),this.ad(c.track([o,"maxFeatureVisibleDistance"],[n,"maxFeatureVisibleDistance"])),this.ad(c.track([o,"heightReference"],[n,"heightReference"])),this.ad(c.track([o,"classificationType"],[n,"classificationType"])),this.ad(n.flyToEvent.disposableOn(r=>{if(e.actived){if(n.flyInParam){const{position:a,rotation:s,flyDuration:l}=n.flyInParam;return Fe(e.viewer,a,void 0,s,l),!0}o.flyTo(r&&r*1e3)}}));{const r=async(a,s,l)=>{if(!e.actived)return;const u=JSON.parse(JSON.stringify(this._getFeatureByIndexOrProperties(a,s)));if(!(!u||!(u!=null&&u.positions)))if(u.type=="Point"||u.type=="MultiPoint")Gn(e,n,this.id,await this._calculateFeatureHeight(u.type=="MultiPoint"?u.positions.flat():u.positions,n.heightReference,e),1e3,l);else{const A=u.type=="Polygon"||u.type=="MultiPolygon"||u.type=="MultiLineString";let h=[];A?h=u.positions.flat(u.type=="MultiPolygon"?2:1).map(g=>this._calculateFeatureHeight(g,n.fillGround?"CLAMP_TO_GROUND":"NONE",e)):h=u.positions.map(g=>this._calculateFeatureHeight(g,n.strokeGround?"CLAMP_TO_GROUND":"NONE",e));const{minPos:f,maxPos:d,center:p}=c.getMinMaxCorner(h);Gn(e,n,this.id,p,c.getDistancesFromPositions([f,d],"NONE")[0],l)}};this.d(n.flyToFeatureEvent.don((a,s,l)=>r(a,s,l))),this.d(n.flyToFeatureIndexEvent.don((a,s)=>r(a,void 0,s)))}}_getFeatureByIndexOrProperties(n,e){var a,s,l,u,A,h,f,d;const{sceneObject:i}=this,o=i.features;if(!o)return;const r=Reflect.get(o,"features")||Reflect.get(o,"geometries");if(r){if(e){let p=r.find(g=>(g==null?void 0:g.properties[n])==e);return{type:p!=null&&p.coordinates?p.type:(a=p==null?void 0:p.geometry)==null?void 0:a.type,positions:(p==null?void 0:p.coordinates)||((s=p==null?void 0:p.geometry)==null?void 0:s.coordinates)}}else if(typeof n=="number")return{type:(l=r[n])!=null&&l.coordinates?r[n].type:(A=(u=r[n])==null?void 0:u.geometry)==null?void 0:A.type,positions:((h=r[n])==null?void 0:h.coordinates)||((d=(f=r[n])==null?void 0:f.geometry)==null?void 0:d.coordinates)}}}async _calculateFeatureHeight(n,e,i){const o=[...n];return e=="NONE"?o[2]=o[2]??0:e=="CLAMP_TO_GROUND"||!o[2]?o[2]=await i.getTerrainHeight(o)??0:o[2]+=await i.getTerrainHeight(o)??0,o}};L(Ju,"type",Ju.register("ESCesiumViewer",c.ESGeoJson.type,Ju));let lg=Ju;const ec=class ec extends on{constructor(e,i){super(e,i);L(this,"_czmGeoESRectangle");L(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new Ye(i,e.id)),this._czmGeoESRectangle=this.disposeVar(new Ci(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoESRectangle,a=this._geoPolyline;a.arcType="RHUMB",this.dispose(c.track([a,"color"],[e,"strokeColor"])),this.dispose(c.track([a,"width"],[e,"strokeWidth"])),this.dispose(c.track([a,"ground"],[e,"strokeGround"])),this.dispose(c.track([r,"ground"],[e,"fillGround"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"]));{const s=()=>{a.show=e.show&&e.stroked,r.show=e.show&&e.filled};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged));this.dispose(l.disposableOn(s))}{const s=()=>{e.filled?r.material={type:"Color",color:e.fillColor}:r.material=void 0};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(s))}{const s=()=>{const l=e.points;if(l&&l.length>=2){const{minPos:u,maxPos:A}=c.getMinMaxCorner(l);r.rectangle=[u[0],u[1],A[0],A[1]],r.height=l[0][2],r.extrudedHeight=l[0][2];const h=l.map(g=>(l&&(g[2]=l[0][2]),g)),f=h[0],d=h[1],p=[f,[f[0],d[1],f[2]],d,[d[0],f[1],d[2]]];a.positions=[...p,f]}else r.rectangle=void 0,a.positions=void 0,r.height=0,r.extrudedHeight=0};s(),this.dispose(e.pointsChanged.disposableOn(()=>s()))}}get czmGeoESRectangle(){return this._czmGeoESRectangle}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmGeoESRectangle:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}};L(ec,"type",ec.register("ESCesiumViewer",c.ESGeoRectangle.type,ec));let ug=ec;class Zl extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_geoPolygon");this._geoPolygon=this.disposeVar(new zr(e,i));const{geoPolygon:o}=this;this.dispose(c.bind([o,"allowPicking"],[this,"allowPicking"])),this.dispose(this.flyToEvent.disposableOn(a=>{o.flyTo(a)})),this.dispose(c.bind([o,"show"],[this,"show"])),this.dispose(c.bind([o,"fill"],[this,"filled"])),this.dispose(c.bind([o,"strokeGround"],[this,"strokeGround"])),this.dispose(c.bind([o,"ground"],[this,"ground"])),this.dispose(c.bind([o,"outline"],[this,"outline"])),this.dispose(c.bind([o,"outlineColor"],[this,"outlineColor"])),this.dispose(c.bind([o,"outlineWidth"],[this,"outlineWidth"])),this.dispose(c.bind([o,"color"],[this,"color"])),this.dispose(c.bind([o,"depth"],[this,"depth"]));const r=()=>{if(this.positions&&this.positions.length>=2){const a=Tp([...this.positions,this.positions[0]]);o.positions=a}else o.positions=void 0};r(),this.dispose(this.positionsChanged.disposableOn(r))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolygon(){return this._geoPolygon}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,strokeGround:!1,ground:!1,outline:!1,filled:!0,outlineColor:c.reactArray([1,1,1,1]),outlineWidth:1,color:c.reactArrayWithUndefined([1,1,1,.5]),positions:c.reactPositions(void 0),depth:0})})(Zl||(Zl={})),c.extendClassProps(Zl.prototype,Zl.createDefaultProps);const tc=class tc extends on{constructor(e,i){super(e,i);L(this,"_geoSmoothPolygon");if(this._geoSmoothPolygon=this.disposeVar(new Zl(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._geoSmoothPolygon;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"outline"],[e,"stroked"])),this.dispose(c.track([r,"outlineColor"],[e,"strokeColor"])),this.dispose(c.track([r,"outlineWidth"],[e,"strokeWidth"])),this.dispose(c.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(c.track([r,"filled"],[e,"filled"])),this.dispose(c.track([r,"color"],[e,"fillColor"])),this.dispose(c.track([r,"ground"],[e,"ground"]));{const a=()=>{r.ground=e.ground||e.fillGround};a();const s=this.dv(c.createNextAnimateFrameEvent(e.groundChanged,e.fillGroundChanged));this.d(s.don(a))}{const a=()=>{r.color=e.filled?e.fillColor:Kl.defaults.fillStyle.color};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(s.disposableOn(a))}this.dispose(c.track([r,"depth"],[e,"depth"]))}get geoSmoothPolygon(){return this._geoSmoothPolygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoSmoothPolygon:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoSmoothPolygon:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(tc,"type",tc.register("ESCesiumViewer",Kl.type,tc));let cg=tc;const nc=class nc extends He{constructor(e,i){super(e,i);L(this,"_czmModel");const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModel=this.dv(new Ht(i,e.id));const r=this._czmModel;this.d(r.readyEvent.don(s=>{var l;r.activeAnimationsJson=(l=r.gltf.animations)==null?void 0:l.map((u,A)=>({index:A,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration * 2"})),e.czmModelReadyEvent.emit(s),e.readyEvent.emit(s)})),this.ad(new Bh(o,this._czmModel)),this.d(c.track([r,"show"],[e,"show"])),this.d(c.track([r,"color"],[e,"czmColor"])),this.d(c.track([r,"nativeMaximumScale"],[e,"czmMaximumScale"])),this.d(c.track([r,"nativeMinimumPixelSize"],[e,"czmMinimumPixelSize"])),this.d(c.bind([r,"position"],[e,"position"])),this.d(c.track([r,"nativeScale"],[e,"czmNativeScale"])),this.d(c.track([r,"scale"],[e,"scale"])),this.ad(c.track([r,"imageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(c.track([r,"environmentMapManager"],[e,"czmEnvironmentMapManager"]));{const s=l=>{e.czmEnvironmentMapManager=e.czmEnvironmentMapManager?{...e.czmEnvironmentMapManager,atmosphereScatteringIntensity:l}:{atmosphereScatteringIntensity:l}};s(e.czmAtmosphereScatteringIntensity),this.ad(e.czmAtmosphereScatteringIntensityChanged.don(l=>s(l)))}{const s=()=>{var l,u;(l=e.czmEnvironmentMapManager)!=null&&l.atmosphereScatteringIntensity&&(e.czmAtmosphereScatteringIntensity=(u=e.czmEnvironmentMapManager)==null?void 0:u.atmosphereScatteringIntensity)};s(),this.ad(e.czmEnvironmentMapManagerChanged.don(s))}{const s=()=>{const l=[...e.rotation??[0,0,0]];l[0]+=e.instances&&e.instances.length!=0?0:90,r.rotation=l};s(),this.d(e.rotationChanged.don(s));{const l=()=>{if(s(),!e.instances){r.instances=e.instances;return}r.instances=e.instances.map(u=>{const A=JSON.parse(JSON.stringify(u));return!A.rotation&&(A.rotation=[0,0,0]),A.rotation[0]+=90,A})};l(),this.ad(e.instancesChanged.don(l))}}this.ad(e.setMaterialEvent.don(s=>{r.setMaterial(s)}));{const s=()=>{const l=[...r.rotation];l[0]-=e.instances&&e.instances.length!=0?0:90,e.rotation=l};s(),this.d(r.rotationChanged.don(s))}{const s=this.dv(c.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),l=()=>{e.allowPicking&&!e.editing?r.allowPicking=!0:r.allowPicking=!1};l(),this.d(s.don(l))}const a=()=>{var s;r.url=c.ESSceneObject.context.getStrFromEnv(Th(typeof e.url=="string"?e.url:((s=e.url)==null?void 0:s.url)??c.ESGltfModel.defaults.url))};a(),this.d(e.urlChanged.don(a)),this.d(e.setNodePositionEvent.don((s,l)=>{r.setNodeTranslation(s,l)})),this.d(e.setNodeRotationEvent.don((s,l)=>{r.setNodeRotation(s,l)})),this.d(e.setNodeScaleEvent.don((s,l)=>{r.setNodeScale(s,l)})),this.d(e.printDebugInfoEvent.don(()=>{r.printDebugInfo()}))}get model(){return this._czmModel}flyTo(e,i){const{sceneObject:o,czmViewer:r,model:a}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):(a&&wn(r,o,i,e,a,!0),!!a):!1}};L(nc,"type",nc.register("ESCesiumViewer",c.ESGltfModel.type,nc));let hg=nc;function Vx(t,n){const e=t[0]-n[0],i=t[1]-n[1],o=t[2]-n[2];return Math.sqrt(e*e+i*i+o*o)}class $l extends c.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new c.Event));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_distance",this.disposeVar(c.react(0)));L(this,"_surfaceDistance",this.disposeVar(c.react(0)));L(this,"_height",this.disposeVar(c.react(0)));L(this,"_middlePosition",this.disposeVar(c.reactArrayWithUndefined(void 0)));L(this,"_heightPosition",this.disposeVar(c.reactArrayWithUndefined(void 0)));const o=()=>{if(this.positions)if(this.positions.length>=2)if(this._middlePosition.value=[this.positions[0][0],this.positions[0][1],this.positions[1][2]],this._heightPosition.value=[this.positions[0][0],this.positions[0][1],.5*(this.positions[1][2]+this.positions[0][2])],this.arcType===void 0||this.arcType==="GEODESIC"){const a=this._surfaceDistance.value=c.geoDistance(this.positions[0],this.positions[1]),s=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(a*a+s*s)}else if(this.arcType==="RHUMB"){const a=this._surfaceDistance.value=c.geoRhumbDistance(this.positions[0],this.positions[1]),s=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(a*a+s*s)}else if(this.arcType==="NONE"){const a=c.lbhToXyz(this.positions[0]),s=c.lbhToXyz(this.positions[1]);this._distance.value=Vx(a,s),this._surfaceDistance.value=Vx(c.lbhToXyz(this._middlePosition.value),s),this._height.value=this.positions[1][2]-this.positions[0][2]}else console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`);else this._heightPosition.value=void 0,this._distance.value=0,this._surfaceDistance.value=0,this._height.value=0};o();const r=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged));this.dispose(r.disposableOn(o));{const a=this.disposeVar(new Ye(e,i));a.ground=!1,a.loop=!1,this.dispose(c.track([a,"allowPicking"],[this,"allowPicking"])),this.dispose(c.bind([a,"arcType"],[this,"arcType"])),this.dispose(c.bind([a,"color"],[this,"color"])),this.dispose(c.bind([a,"dashLength"],[this,"dashLength"])),this.dispose(c.bind([a,"dashPattern"],[this,"dashPattern"])),this.dispose(c.bind([a,"gapColor"],[this,"gapColor"])),this.dispose(c.bind([a,"hasArrow"],[this,"hasArrow"])),this.dispose(c.bind([a,"hasDash"],[this,"hasDash"])),this.dispose(c.bind([a,"show"],[this,"show"])),this.dispose(c.bind([a,"width"],[this,"width"])),this.dispose(c.bind([a,"depthTest"],[this,"depthTest"]));{a.loop=!0;const l=()=>{if(this.positions&&this.positions.length===2){const[u,A]=this.positions;a.positions=[u,A,[u[0],u[1],A[2]]]}else a.positions=void 0};l(),this.dispose(this.positionsChanged.disposableOn(l))}this.dispose(this.flyToEvent.disposableOn(l=>{e.actived&&a.flyTo(l)}));const s=this.disposeVar(new wt(e,i));this.dispose(c.track([s,"shadowDom"],[this,"shadowDom"])),this.dispose(c.track([s,"cssAllInitial"],[this,"cssAllInitial"])),this.dispose(c.track([s,"show"],[this,"show"]));{const l=()=>{s.position=this.heightPosition};l(),this.dispose(this.heightPositionChanged.disposableOn(l))}{const l=()=>{s.innerHTML=xo(`高度: ${Ih(this.height)}`,0)};l(),this.dispose(this.heightChanged.disposableOn(l))}this.ad(s.pickedEvent.don(l=>{Gi(l)===0&&this.pickedEvent.emit(l)}))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}get surfaceDistance(){return this._surfaceDistance.value}get surfaceDistanceChanged(){return this._surfaceDistance.changed}get height(){return this._height.value}get heightChanged(){return this._height.changed}get middlePosition(){return this._middlePosition.value}get middlePositionChanged(){return this._middlePosition.changed}get heightPosition(){return this._heightPosition.value}get heightPositionChanged(){return this._heightPosition.changed}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:c.reactPositions(void 0),width:1,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.reactArrayWithUndefined([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1})})($l||($l={})),c.extendClassProps($l.prototype,$l.createDefaultProps);const ic=class ic extends on{constructor(e,i){super(e,i);L(this,"_geoHeightMeasurement");if(this._geoHeightMeasurement=this.disposeVar(new $l(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmHeightMeasurement:r}=this;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"]));{const a=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.width=e.strokeWidth,r.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):u==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):(r.hasDash=!1,r.hasArrow=!1);const A=e.strokeStyle;if(A.material==="hasDash"&&A.materialParams)try{const h=A.materialParams;Reflect.has(h,"gapColor")&&(r.gapColor=h.gapColor??[0,0,0,0]),Reflect.has(h,"dashLength")&&(r.dashLength=h.dashLength),Reflect.has(h,"dashPattern")&&(r.dashPattern=h.dashPattern)}catch(h){console.error(h)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(s.disposableOn(a))}this.dispose(r.pickedEvent.disposableOn(a=>{Gi(a)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(a)}))}get czmHeightMeasurement(){return this._geoHeightMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmHeightMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmHeightMeasurement:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(ic,"type",ic.register("ESCesiumViewer",c.ESHeightMeasurement.type,ic));let Ag=ic;const fg={czmAnimationsStand:[{index:0,name:"Stand",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],czmAnimationsWalk:[{index:2,name:"Walk",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],czmAnimationsRun:[{index:1,name:"Run",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}]},rc=class rc extends He{constructor(e,i){super(e,i);L(this,"_czmModelPrimitive");const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModelPrimitive=this.disposeVar(new Ht(i,this.sceneObject.id));const r=this._czmModelPrimitive;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(Mt([r,"rotation"],[e,"rotation"])),this.dispose(c.bind([r,"scale"],[e,"scale"])),this.d(r.readyEvent.don(g=>{e.readyEvent.emit(g)}));{const g=this.dv(c.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),v=()=>{e.allowPicking&&!e.editing?r.allowPicking=!0:r.allowPicking=!1};v(),this.d(g.don(v))}const a=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/worker.glb"),s=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/police.glb"),l=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/pedestrian.glb"),u=c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/Stranger.glb"),A=c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsMan.glb"),h=c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsWoman.glb"),f=()=>{switch(e.mode){case"worker":r.url=a;break;case"police":r.url=s;break;case"pedestrian":r.url=l;break;case"stranger":r.url=u;break;case"suitMan":r.url=A;break;case"suitWoman":r.url=h;break;default:r.url=a;break}};this.dispose(e.modeChanged.disposableOn(()=>{f()})),f();const d=()=>{const g=e.animation??c.ESHuman.defaults.animation;if(!e.show){r.activeAnimationsJson=void 0;return}g==="walking"?r.activeAnimationsJson=fg.czmAnimationsWalk:g==="standing"?r.activeAnimationsJson=fg.czmAnimationsStand:g==="running"&&(r.activeAnimationsJson=fg.czmAnimationsRun)};d();const p=this.ad(c.createNextAnimateFrameEvent(e.showChanged,e.animationChanged));this.dispose(p.disposableOn(()=>d())),this.ad(new Bh(o,r))}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmModelPrimitive:a}=this;return!r.actived||!r.viewer?!1:o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):(a&&wn(r,o,i,e,a,!0),!!a)}};L(rc,"type",rc.register("ESCesiumViewer",c.ESHuman.type,rc));let pg=rc;class Nx extends c.Destroyable{constructor(e,i){super();L(this,"_czmGeoCanvasImagePoi");L(this,"flyTo",(e,i)=>{if(this.czmGeoCanvasImagePoi.position){Fe(this.czmViewer.viewer,this.czmGeoCanvasImagePoi.position,1e3,Hn,e);return}this.czmGeoCanvasImagePoi.flyTo(e&&e*1e3)});this.sceneObject=e,this.czmViewer=i,this._czmGeoCanvasImagePoi=this.disposeVar(new yi(i));const o=this._czmGeoCanvasImagePoi;o.pickOnClick=!0,this.d(o.pickedEvent.don(r=>{(e.allowPicking??!1)&&e.pickedEvent.emit(r)}));{const r=A=>{let h=A;return A.includes("inner://")&&(h="${earthsdk3-assets-script-dir}/assets/img/points/"+A.split("inner://")[1]),c.ESSceneObject.context.getStrFromEnv(Th(h))},a=()=>{const A=r(typeof e.url=="string"?e.url:e.url.url);if(o.imageUri=A,e.sizeByContent){const f=new Image;f.src=A,f.onload=()=>{o.size=[f.width,f.height]}}else{const f=e.size;o.size=[...f]}},s=this.disposeVar(c.createNextAnimateFrameEvent(e.urlChanged,e.sizeByContentChanged,e.sizeChanged));this.dispose(s.disposableOn(()=>a())),a(),this.d(c.track([o,"zOrder"],[e,"zOrder"])),this.dispose(c.track([o,"show"],[e,"show"])),this.dispose(c.bind([o,"position"],[e,"position"])),this.ad(c.bind([o,"isHoverZoom"],[e,"isHoverZoom"])),this.ad(c.bind([o,"hoverHighlight"],[e,"hoverHighlight"]));{const A=()=>{o.scale=[e.scale[1],e.scale[2]]};A(),this.dispose(e.scaleChanged.don(A))}const l=()=>{const A=e.anchor,h=e.offset;A?o.originRatioAndOffset=[...A,-h[0],-h[1]]:o.originRatioAndOffset=[0,0,0,0]},u=this.ad(c.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(u.disposableOn(()=>l())),l(),this.dispose(o.clickEvent.disposableOn(A=>{const{offsetX:h,offsetY:f}=A,p={type:A.button===0?"leftClick":A.button===2?"rightClick":void 0,add:{mousePos:[h,f]}};e.widgetEvent.emit(p)})),this.dispose(o.hoveredChanged.disposableOn(A=>{if(A===void 0)return;const h={type:A?"mouseEnter":"mouseLeave"};e.widgetEvent.emit(h)}))}}get czmGeoCanvasImagePoi(){return this._czmGeoCanvasImagePoi}}class Hx extends c.Destroyable{constructor(e,i,o){super();L(this,"_czmGeoImageModel");L(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});L(this,"_isPointEvent",!1);L(this,"flyTo",(e,i)=>{if(this.czmGeoImageModel.position)return Gn(this.czmViewer,this.sceneObject,i,this.sceneObject.position,Math.max(...this.czmGeoImageModel.size),e,!0);this.czmGeoImageModel.flyTo(e&&e*1e3)});this.sceneObject=e,this.czmViewer=i,this._czmGeoImageModel=this.disposeVar(new $i(i,e.id));const r=this._czmGeoImageModel;this.ad(i.clickEvent.don(f=>{const d=f==null?void 0:f.pointerEvent;d&&(this._isPointEvent=!0,this._eventInfo={type:d.button==0?"leftClick":d.button==2?"rightClick":"leftClick",add:{mousePos:[d.offsetX,d.offsetY]}})})),this.d(e.pickedEvent.don(f=>{var d,p,g;f.screenPosition&&this._isPointEvent&&f.attachedInfo!="innerHoverEvent"&&((d=this._eventInfo.add)!=null&&d.mousePos)&&Math.abs(f.screenPosition[0]-((p=this._eventInfo.add)==null?void 0:p.mousePos[0]))<1&&Math.abs(f.screenPosition[1]-((g=this._eventInfo.add)==null?void 0:g.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),c.registerCreatedEventUpdate(this,e,()=>{const f=i.getEngineObject(e);this.ad(f.lastHoverResultChanged.don((d,p)=>{(d==null?void 0:d.sceneObject)==(p==null?void 0:p.sceneObject)||(d==null?void 0:d.sceneObject)!=e&&(p==null?void 0:p.sceneObject)!=e||(d!=null&&d.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:d==null?void 0:d.screenPosition}},d.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&d.sceneObject.id==e.id&&(r.scale=[r.scale[0]*1.5,r.scale[1]*1.5])),p!=null&&p.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:d==null?void 0:d.screenPosition}},p.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&p.sceneObject.id==e.id&&(r.scale=[r.scale[0]/1.5,r.scale[1]/1.5])))}))});const a=e.sizeByContent,l=(f=>{let d=f;return f.includes("inner://")&&(d="${earthsdk3-assets-script-dir}/assets/img/points/"+f.split("inner://")[1]),c.ESSceneObject.context.getStrFromEnv(Th(d))})(typeof o.sceneObject.url=="string"?o.sceneObject.url:o.sceneObject.url.url),u=new Image;u.src=l,u.onload=()=>{if(a)r.size=[u.width/100,u.height/100];else{const f=e.size;r.size=[f[0]/100,f[1]/100]}},r.uri=l,this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),r.pixelSize=void 0,r.useAxis="XZ";{const f=()=>{r.scale=[e.scale[1],e.scale[2]]};f(),this.d(e.scaleChanged.don(f))}{const f=()=>{e.rotationType===0&&(r.rotationMode="WithProp",this.d(Mt([r,"rotation"],[e,"rotation"]))),e.rotationType===1&&(r.rotationMode="WithCamera"),e.rotationType===2&&(r.rotationMode="WithCameraOnlyZ")};f(),this.dispose(e.rotationTypeChanged.disposableOn(f))}const A=()=>{const f=e.anchor,d=e.offset;f?r.originRatioAndOffset=[...f,-d[0]/100,-d[1]/100]:r.originRatioAndOffset=[0,0,0,0]},h=this.ad(c.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(h.disposableOn(()=>A())),A()}get czmGeoImageModel(){return this._czmGeoImageModel}}const oc=class oc extends Gl{constructor(e,i){super(e,i);L(this,"_resetting");if(!i.viewer){console.warn("viewer is undefined!");return}const r=this.disposeVar(c.createNextAnimateFrameEvent(this.sceneObject.urlChanged,this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged));this._resetting=this.disposeVar(new c.ObjResettingWithEvent(r,()=>this.sceneObject.screenRender?new Nx(this.sceneObject,this.czmViewer):new Hx(this.sceneObject,this.czmViewer,this)))}get resetting(){return this._resetting}flyTo(e,i){const{sceneObject:o,czmViewer:r,resetting:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a&&a.obj&&a.obj.flyTo(e,i),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(oc,"type",oc.register("ESCesiumViewer",c.ESImageLabel.type,oc));let dg=oc;function dO(t){switch(t){case"wms":return"WebMapServiceImageryProvider";case"tms":return"TileMapServiceImageryProvider";case"wmts":return"WebMapTileServiceImageryProvider";case"xyz":return"UrlTemplateImageryProvider";case"ion":return"IonImageryProvider"}}const sc=class sc extends Nn{constructor(e,i){super(e,i);L(this,"_czmImagery");if(this._czmImagery=this.dv(new Zr(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmImagery;{const a=this.ad(c.reactJson(""));{const u=()=>{if(typeof e.url=="string")a.value=c.ESSceneObject.context.getStrFromEnv(e.url);else{const A=e.url;A.url=c.ESSceneObject.context.getStrFromEnv(A.url),a.value=A}};u(),this.ad(e.urlChanged.don(u))}const s=()=>{var p;if(!a.value)return;const u=(((p=e.options)==null?void 0:p.type)??"auto").toLowerCase(),A=e.options??{};let h={type:"UrlTemplateImageryProvider",url:a.value,rectangle:e.rectangle,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,...A},f=a.value,d=typeof f=="string"?f:f.url;if(u==="auto"){const g=d.toLowerCase();if(g.startsWith("ion://")){const y=+g.substring(6);h={...A,assetId:y,type:"IonImageryProvider"}}else if(g.includes("{x}")||g.includes("{y}")||g.includes("{z}"))h.type="UrlTemplateImageryProvider";else if(g.includes("wmts"))h.type="WebMapTileServiceImageryProvider";else if(g.includes("wms"))h.type="WebMapServiceImageryProvider";else{if(d.includes("/tilemapresource.xml")){const v=d.split("/tilemapresource.xml").join("");typeof f=="string"?f=v:f.url=v,h.url=f}h.type="TileMapServiceImageryProvider"}}else{if(u==="tms"&&d.includes("/tilemapresource.xml")){const g=d.split("/tilemapresource.xml").join("");typeof f=="string"?f=g:f.url=g,h.url=f}else if(u==="ion"&&d.startsWith("ion://")){const v=+d.substring(6);h={...A,assetId:v,type:"IonImageryProvider"}}h.type=dO(u)}console.log("imageryProvider",h),r.imageryProvider=h};s();const l=this.dv(c.createNextAnimateFrameEvent(a.changed,e.maximumLevelChanged,e.minimumLevelChanged,e.optionsChanged,e.rectangleChanged));this.d(l.don(s))}this.d(c.track([r,"show"],[e,"show"])),this.d(c.bind([r,"alpha"],[e,"opacity"])),this.d(c.bind([r,"alpha"],[e,"czmAlpha"])),this.d(c.track([r,"splitDirection"],[e,"splitDirection"])),this.d(c.track([r,"brightness"],[e,"czmBrightness"])),this.d(c.track([r,"contrast"],[e,"czmContrast"])),this.d(c.track([r,"hue"],[e,"czmHue"])),this.d(c.track([r,"saturation"],[e,"czmSaturation"])),this.d(c.track([r,"gamma"],[e,"czmGamma"])),this.d(c.track([r,"rectangle"],[e,"rectangle"])),this.d(c.track([r,"zIndex"],[e,"zIndex"])),this.ad(c.track([r,"targetID"],[e,"targetID"]))}get czmImagery(){return this._czmImagery}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmImagery:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmImagery:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(sc,"type",sc.register("ESCesiumViewer",c.ESImageryLayer.type,sc));let mg=sc;class mO extends c.Destroyable{constructor(e,i,o,r){super();L(this,"_show");L(this,"_czmESCustomPrimitive");L(this,"_czmTexture");this._sceneObject=e,this._show=this.disposeVar(c.react(this._sceneObject.show)),this._czmESCustomPrimitive=this.dv(new at(i,this._sceneObject.id)),this._czmTexture=this.dv(new At(i));const a=e,s=this._czmESCustomPrimitive,l=this._czmTexture;this.dispose(c.track([s,"show"],[this,"show"])),this.dispose(c.track([s,"show"],[a,"show"])),this.dispose(c.track([s,"allowPicking"],[a,"allowPicking"])),this.dispose(c.track([s,"rotation"],[a,"rotation"])),this.dispose(c.track([s,"position"],[a,"position"])),this.dispose(c.track([s,"scale"],[a,"scale"])),this.ad(a.allowPickingChanged.don(()=>{s.allowPicking=a.allowPicking,s.pass=a.allowPicking?"TRANSLUCENT":"OVERLAY"}));{const u=()=>{const h=a.size/2,f=r[0].map(S=>S*h),d=r[1].map(S=>S*h),p=r[2].map(S=>S*h),g=r[3].map(S=>S*h),v=[...f,...d,...p,...g];let y=[0,3,2,0,2,1];(o=="north"||o=="west"||o=="bottom")&&(y=y.reverse());const m=[0,0],x=[1,0],_=[1,1],E=[0,1];let B=[];o=="east"||o=="south"?B=[...x,...m,...E,..._]:o=="west"?B=[...x,..._,...E,...m]:o=="top"?B=[...E,..._,...x,...m]:B=[...m,...x,..._,...E],s.indexTypedArray=new Uint16Array(y),s.attributes={position:{typedArray:new Float32Array(v),componentsPerAttribute:3},st:{typedArray:new Float32Array(B),componentsPerAttribute:2}},l.uri=c.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/img/skybox/${a.mode}/${o}.${a.mode!="blueSky"?"png":"jpg"}`);const P=i.getCameraInfo();if(P!=null){const T=c.getDistancesFromPositions([a.position,P.position],"NONE")[0]/(a.size/2*a.autoOpacityFactor);this.changeOpacity(a.autoFollow?1:T)}const I=s.computeLocalAxisedBoundingBoxFromAttribute("position");if(!I)return;const{min:M,max:F}=I;s.setLocalAxisedBoundingBox(M,F)};u();const A=this.disposeVar(c.createNextAnimateFrameEvent(a.sizeChanged,a.modeChanged));this.dispose(A.disposableOn(u))}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}get czmESCustomPrimitive(){return this._czmESCustomPrimitive}get czmTexture(){return this._czmTexture}changeOpacity(e){this._czmESCustomPrimitive.uniformMap={u_image:{type:"texture",id:this._czmTexture.id},u_color:[1,1,1,1-e>=0?1-e:0]}}}class gO extends c.Destroyable{constructor(n,e,i){if(super(),!e.viewer)return;let o=!0,r;this.dispose(e.viewer.scene.preUpdate.addEventListener(()=>{a()}));function a(){var l;if(!((l=e.viewer)!=null&&l.camera))return;const s=e.getCameraInfo();if(s!=null&&(r==null||r.position[0]!=s.position[0]||r.position[1]!=s.position[1]||r.position[2]!=s.position[2]||r.rotation[0]!=s.rotation[0]||r.rotation[1]!=s.rotation[1]||r.rotation[2]!=s.rotation[2])){r=s;const A=c.getDistancesFromPositions([n.position,r.position],"NONE")[0]/(n.size/2*n.autoOpacityFactor);n.autoFollow?(n.position=r.position,o&&(o=!1,i.forEach(h=>{h.changeOpacity(1)}))):i.forEach(h=>{h.changeOpacity(A)})}}a()}}const Pt=class Pt extends He{constructor(e,i){super(e,i);L(this,"_czmSkyBoxComponents",[]);if(!i.viewer){console.warn("viewer is undefined!");return}!Pt._defaultLocalBox&&Pt._firstLoad&&(Pt._firstLoad=!1,Pt._defaultLocalBox=i.xbsjLocalBoxSources),Pt._eSLocalSkyBoxArr.push(e),this.d(()=>{Pt._eSLocalSkyBoxArr.includes(e)&&Pt._eSLocalSkyBoxArr.splice(Pt._eSLocalSkyBoxArr.indexOf(e),1),this.ChangeAutoFollow()});const r={bottom:[[-1,-1,-1],[1,-1,-1],[1,1,-1],[-1,1,-1]],top:[[-1,-1,1],[1,-1,1],[1,1,1],[-1,1,1]],south:[[-1,-1,-1],[1,-1,-1],[1,-1,1],[-1,-1,1]],north:[[-1,1,-1],[1,1,-1],[1,1,1],[-1,1,1]],east:[[1,-1,-1],[1,1,-1],[1,1,1],[1,-1,1]],west:[[-1,1,-1],[-1,1,1],[-1,-1,1],[-1,-1,-1]]};for(const a in r)if(Object.prototype.hasOwnProperty.call(r,a)){const s=r[a];this._czmSkyBoxComponents.push(this.dv(new mO(e,i,a,s)))}{const a=this.disposeVar(c.createNextAnimateFrameEvent(e.autoFollowChanged,e.autoOpacityFactorChanged));this.disposeVar(new c.ObjResettingWithEvent(a,()=>(this.ChangeAutoFollow(),new gO(e,i,this._czmSkyBoxComponents))))}{const a=()=>{this.ChangeAutoFollow()},s=this.disposeVar(c.createNextAnimateFrameEvent(e.sizeChanged,e.modeChanged,e.showChanged));this.dispose(s.disposableOn(a))}}ChangeAutoFollow(){const{czmViewer:e}=this;for(let i=Pt._eSLocalSkyBoxArr.length-1;i>=0;i--){const o=Pt._eSLocalSkyBoxArr[i];if(o.autoFollow&&o.show){e.xbsjLocalBoxSources={positiveX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/east.${o.mode!="blueSky"?"png":"jpg"}`,negativeX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/west.${o.mode!="blueSky"?"png":"jpg"}`,positiveY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/bottom.${o.mode!="blueSky"?"png":"jpg"}`,negativeY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/top.${o.mode!="blueSky"?"png":"jpg"}`,positiveZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/north.${o.mode!="blueSky"?"png":"jpg"}`,negativeZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/south.${o.mode!="blueSky"?"png":"jpg"}`};break}i==0&&(e.xbsjLocalBoxSources=Pt._defaultLocalBox)}Pt._eSLocalSkyBoxArr.length==0&&(e.xbsjLocalBoxSources=Pt._defaultLocalBox)}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const a=o.size??c.ESLocalSkyBox.defaults.size;return o.position?(Gn(r,o,i,o.position,a,e,!0),!0):!1}}};L(Pt,"type",Pt.register("ESCesiumViewer",c.ESLocalSkyBox.type,Pt)),L(Pt,"_defaultLocalBox"),L(Pt,"_firstLoad",!0),L(Pt,"_eSLocalSkyBoxArr",[]);let gg=Pt;const ni=class ni extends He{constructor(e,i){super(e,i);L(this,"_geoCustomDivPoi");L(this,"_textFunc",this.disposeVar(c.react(void 0)));if(this._geoCustomDivPoi=this.disposeVar(new wt(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this.geoCustomDivPoi;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"]));{this.dispose(r.pickedEvent.disposableOn(a=>{(e.allowPicking??c.ESLocationMeasurement.defaults.allowPicking)&&e.pickedEvent.emit(a)})),this.dispose(r.innerHtmlMounted.disposableOn(a=>{const s=a.firstElementChild;s&&(s.style.pointerEvents="auto",s.style.cursor="default",s.onclick=l=>r.pickFromDiv(s,{type:"viewerPicking",pointerEvent:l}))}));{const a=()=>{if(!e.position)return;const l=(this.textFunc??ni.defaultTextFunc_度格式)(e.position);r.innerHTML=xo(l)};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.positionChanged,this.textFuncChanged));this.dispose(s.disposableOn(a))}{const a=()=>{i.lonLatFormat??(i.lonLatFormat="DECIMAL_DEGREE"),this.textFunc=i.lonLatFormat=="DECIMAL_DEGREE"?ni.defaultTextFunc_度格式:i.lonLatFormat=="DEGREES_DECIMAL_MINUTES"?ni.defaultTextFunc_度分格式:ni.defaultTextFunc_度分秒格式};a(),this.d(i.lonLatFormatChanged.don(()=>{a()}))}}}get geoCustomDivPoi(){return this._geoCustomDivPoi}get textFunc(){return this._textFunc.value}set textFunc(e){this._textFunc.value=e}get textFuncChanged(){return this._textFunc.changed}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoCustomDivPoi:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoCustomDivPoi:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(ni,"type",ni.register("ESCesiumViewer",c.ESLocationMeasurement.type,ni)),L(ni,"defaultTextFunc_度格式",e=>{if(!e)return"";const[i=0,o=0,r=0]=e;return`经度: ${i.toFixed(5)}°
3105
3105
  纬度: ${o.toFixed(5)}°
3106
3106
  高度: ${r.toFixed(2)}m`}),L(ni,"defaultTextFunc_度分格式",e=>{if(!e)return"";const[i,o,r]=Ep(e,!0);return`经度: ${i}
3107
3107
  纬度: ${o}
@@ -4142,10 +4142,10 @@ async function initCesiumViewer(container, czmViewer) {
4142
4142
  `;function UH(){const t="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
4143
4143
  github地址:https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/Ion.js#L7
4144
4144
  gitee地址:${t}
4145
- `;console.log(e);const i=window.prompt(e,t);i&&window.open(i,"_blank")}const Nt=class Nt extends c.ESViewer{constructor(e){super(e);L(this,"_disabledInputStack",this.disposeVar(c.react(0)));L(this,"_viewer",this.dv(c.react(void 0)));L(this,"_viewerInstance");L(this,"_viewerLegend");L(this,"pickCustomAttachedInfo");L(this,"_fps",this.dv(c.react(0)));L(this,"_notSupportEditingCount",this.disposeVar(c.react(0)));L(this,"_editingSystem",Wf);L(this,"_moveObjectsProcess",this.ad(RS()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new mV(this)),this.ad(new gV(this)),this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new bV(this)})),this._viewerLegend=this.dv(new TH(this)),this._viewerInstance=this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new kv(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=Be([1,1,1,1]))}));const i=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new c.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new vN(this.subContainer,this,o=>this._viewer.value=o,i.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&&Qn(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,i,o){if(!this.extensions)return;const{pickingManager:r}=this.extensions;return await r.pick(e,void 0,i)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:i}=this;if(!i)return;const o=b.Cartographic.fromDegrees(e[0],e[1],e[2],Nt.getHeightsScartchCarto);return i.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Fn(e),rotation:gs(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:i}=this.viewer;if(!i||!e)return;const o=b.Cartesian3.fromDegrees(...e),r=b.Transforms.eastNorthUpToFixedFrame(o),a=b.Matrix4.inverse(r,new b.Matrix4),s=b.Matrix4.multiplyByPoint(a,i.positionWC,new b.Cartesian3),l=b.Cartesian3.magnitude(s);let u=-Math.asin(s.z/l);u=b.Math.toDegrees(u);let A=b.Math.PI_OVER_TWO-Math.atan(s.y/s.x);s.x>0&&(A+=s.y<0?-b.Math.PI:b.Math.PI),A=b.Math.toDegrees(A);const h=gs(i),f=h[0]-A,d=h[1]-u;return{distance:l,heading:A,pitch:u,flyDuration:1,hDelta:f,pDelta:d}}flyIn(e,i,o,r="default"){var l;if(!i)return;const a={position:e,rotation:i,duration:(o??1)*1e3},s=(l=this.viewer)==null?void 0:l.camera;return s&&rl(s,a,r)}flyTo(e,i,o="default"){var d;const{distance:r,heading:a,pitch:s,flyDuration:l,hDelta:u,pDelta:A}=e,h={position:i,viewDistance:r,rotation:[a,s,0],duration:l*1e3,hdelta:u,pdelta:A},f=(d=this.viewer)==null?void 0:d.camera;return f&&rl(f,h,o)}flyToBoundingSphere(e,i,o=1){var h;const r=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],a=c.getGeoBoundingSphereFromPositions(r);if(!a)return;const{center:s,radius:l}=a,u={position:s,viewDistance:i??l,rotation:[0,-90,0],duration:o*1e3},A=(h=this.viewer)==null?void 0:h.camera;return A&&rl(A,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Fn(e),rotation:gs(e)}}transformFlyParam(e,i){if(!(e instanceof c.ESObjectWithLocation)){console.warn("flyInParam转换为flyToParam失败,sceneObject不是ESObjectWithLocation类型!");return}if("position"in i){const o=b.Cartesian3.fromDegrees(...e.position),r=b.Transforms.eastNorthUpToFixedFrame(o),a=b.Matrix4.inverse(r,new b.Matrix4),s=b.Matrix4.multiplyByPoint(a,ut(i.position),new b.Cartesian3),l=b.Cartesian3.magnitude(s);let u=-Math.asin(s.z/l);u=b.Math.toDegrees(u);let A=b.Math.PI_OVER_TWO-Math.atan(s.y/s.x);s.x>0&&(A+=s.y<0?-b.Math.PI:b.Math.PI),A=b.Math.toDegrees(A);const h=i.rotation[0]-A,f=i.rotation[1]-u;return{distance:l,heading:A,pitch:u,flyDuration:i.flyDuration??1,hDelta:h,pDelta:f}}else{if(!e.position)return;const o=ut(e.position);let r={heading:b.Math.toRadians(i.heading),pitch:b.Math.toRadians(i.pitch),roll:0};const a=new b.HeadingPitchRoll;if(i.distance){a.heading=r.heading,a.pitch=r.pitch,a.roll=0,a.heading-=b.Math.PI_OVER_TWO;const l=b.Transforms.headingPitchRollToFixedFrame(o,a,void 0,void 0),u=b.Matrix4.multiplyByPointAsVector(l,b.Cartesian3.UNIT_X,new b.Cartesian3);b.Cartesian3.multiplyByScalar(u,i.distance,u),b.Cartesian3.subtract(o,u,o)}i.hDelta&&(r.heading+=b.Math.toRadians(i.hDelta)),i.pDelta&&(r.pitch+=b.Math.toRadians(i.pDelta));const s=Ue(o);return s?{position:s,rotation:[b.Math.toDegrees(r.heading),b.Math.toDegrees(r.pitch),b.Math.toDegrees(r.roll)],flyDuration:i.flyDuration??1}:void 0}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,i=4.2,o=1.6){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToWalk(e,i,o),this._navigationMode.value="Walk"}changeToMap(){var e,i;(i=(e=this._viewerInstance)==null?void 0:e.obj)==null||i.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,i,o){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToRotateGlobe(e,i,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,i,o,r,a,s){var l,u;(u=(l=this._viewerInstance)==null?void 0:l.obj)==null||u.navigationManager.changeToLine(e,i,o,r,a,s),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToRotatePoint(e,i,o,r,a),this._navigationMode.value="RotatePoint"}changeToFollow(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToFollow(e,i,o,r,a),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=window.g_XE3CopyRights??{};return e.cesium=b.VERSION,e}async getHeightByLonLat(e,i,o){if(!this.viewer)return null;const r=b.Cartographic.fromDegrees(e,i,void 0,Nt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(r)??null}async getHeightsByLonLats(e,i){const o=e.map(a=>this.getHeightByLonLat(...a));return await Promise.all(o)}async capture(e,i){if(this.viewer)return await P0(this.viewer.scene,e,i)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const i=this.viewer.scene.cartesianToCanvasCoordinates(ut(e));if(i)return[i.x,i.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,i,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const r=e.components.main??e;r&&i!=null&&(r.editingID=`${o.callSource}_${c.createGuid()}`,this._editingSystem.create(this,r,i,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const i=[],o=c.createGuid();for(let r=0;r<e.length;r++){const a=e[r],s=a.components.main??a;s.editingID=o,s&&i.push(s)}this._moveObjectsProcess.restart(void 0,this,i,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=Nt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!Nt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=Nt.latestDefaultAccessToken}positionsToLocalPositions(e,i){return vn(e,i)}localPositionsToPositions(e,i){return _r(e,i)}isPointVisible(e){if(!this.viewer)return!1;const i=ut(e),o=new b.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(i))return!1;const r=this.viewer.scene.cartesianToCanvasCoordinates(i);return!(!r||r.x<0||r.y<0)}getESProperties(){const e={...super.getESProperties()},i=Nt.defaults;return{...e,more:[...e.more,new c.GroupProperty([],"通用","通用"),new c.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",RH,DH,!0),new c.FunctionProperty([],()=>Nt.getCesiumIonToken(),[],"获取官方token"),new c.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new c.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new c.BooleanProperty([this,"flashLighting"],"头顶灯",i.flashLighting,!0),new c.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",i.particleGlobalControl,!0),new c.GroupProperty([],"Viewer","Viewer"),new c.NumberProperty([this,"resolutionScale"],"分辨率比率",i.resolutionScale,!0),new c.NumberProperty([this,"msaaSamples"],"msaaSamples",i.msaaSamples,!0),new c.BooleanProperty([this,"shadows"]),new c.GroupProperty([],"比例尺","比例尺(Legend)"),new c.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new c.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new c.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new c.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new c.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new c.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new c.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new c.GroupProperty([],"场景","场景(Scene)"),new c.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",i.sceneSplitPosition,!0),new c.GroupProperty([],"Globe","Globe"),new c.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",i.sceneGlobeShadows,!0),new c.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new c.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new c.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new c.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new c.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new c.BooleanProperty([this,"sceneGlobeShowSkirts"]),new c.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new c.ColorProperty([this,"sceneGlobeBaseColor"]),new c.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new c.JsonProperty([this,"sceneGlobeClippingPlanes"]),new c.StringProperty([this,"sceneGlobeClippingPlanesId"]),new c.JsonProperty([this,"sceneGlobeClippingPolygons"]),new c.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new c.GroupProperty([],"underground","underground"),new c.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",i.sceneGlobeUndergroundColor,!0),new c.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",i.sceneGlobeUndergroundColorAlphaByDistance,!0),new c.GroupProperty([],"Translucency","Translucency"),new c.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",i.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new c.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",i.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new c.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",i.sceneGlobeTranslucencyRectangle,!0),new c.GroupProperty([],"Sun","Sun"),new c.BooleanProperty([this,"sun"],"sun",i.sun,!0),new c.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",i.sceneSunGlowFactor,!0),new c.GroupProperty([],"Moon","Moon"),new c.BooleanProperty([this,"moon"],"moon",i.moon,!0),new c.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",i.sceneMoonTextureUrl,!0),new c.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",i.sceneMoonOnlySunLighting,!0),new c.GroupProperty([],"SkyBox","SkyBox"),new c.BooleanProperty([this,"sceneSkyBoxShow"]),new c.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",i.sceneSkyBoxSources,void 0,!0),new c.GroupProperty([],"Background","Background"),new c.BooleanProperty([this,"xbsjUseBackground"]),new c.StringProperty([this,"xbsjBackgroundImageUri"]),new c.ColorProperty([this,"xbsjBackgroundColor"]),new c.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new c.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",i.xbsjLocalBoxSources,void 0,!0),new c.ColorProperty([this,"sceneBackgroundColor"]),new c.GroupProperty([],"Fog","Fog"),new c.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",i.sceneFogEnabled,!0),new c.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",i.sceneFogDensity,!0),new c.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",i.sceneFogScreenSpaceErrorFactor,!0),new c.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",i.sceneFogMinimumBrightness,!0),new c.GroupProperty([],"Sscc","Sscc"),new c.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",i.sceneSsccEnableInputs,!0),new c.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",i.sceneSsccEnableCollisionDetection,!0),new c.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",i.sceneSsccZoomFactor,!0),new c.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new c.GroupProperty([],"后处理","后处理"),new c.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",i.scenePpsfxaaEnabled,!0),new c.GroupProperty([],"环境遮蔽","环境遮蔽"),new c.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new c.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new c.GroupProperty([],"Bloom","Bloom"),new c.BooleanProperty([this,"scenePpsBloomEnabled"]),new c.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new c.NumberProperty([this,"scenePpsBloomContrast"]),new c.NumberProperty([this,"scenePpsBloomBrightness"]),new c.NumberProperty([this,"scenePpsBloomDelta"]),new c.NumberProperty([this,"scenePpsBloomSigma"]),new c.NumberProperty([this,"scenePpsBloomStepSize"]),new c.GroupProperty([],"调试","调试"),new c.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",i.sceneDebugShowFramesPerSecond,!0),new c.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",i.sceneDebugShowCommands,!0),new c.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",i.sceneDebugShowFrustums,!0),new c.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",i.sceneDebugShowFrustumPlanes,!0),new c.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",i.sceneDebugShowDepthFrustum,!0),new c.GroupProperty([],"Inspector","Inspector"),new c.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",i.showCesiumInspector,!0),new c.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",i.cesiumInspectorWireframe,!0),new c.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",i.showCesium3DTilesInspector,!0)]}}};L(Nt,"type",Nt.register("ESCesiumViewer",Nt)),L(Nt,"getCesiumIonToken",UH),L(Nt,"currentDefaultAccessToken",b.Ion.defaultAccessToken),L(Nt,"latestDefaultAccessToken"),L(Nt,"ObjectsToExcludeWrapper",wV),L(Nt,"defaults",{...c.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:b.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:b.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}),L(Nt,"getHeightsScartchCarto",new b.Cartographic);let ot=Nt;(t=>{t.createDefaultProps=()=>({...c.ESViewer.createDefaultProps(),...MH()})})(ot||(ot={})),c.extendClassProps(ot.prototype,ot.createDefaultProps),re.copyright=void 0;try{const t="earthsdk3-cesium",n="3.5.0",e="2025-10-30T00:53:02.000Z",i="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="cda73626e40b80da99887fe7a1decdbccc6aa5d9",s=((Date.now()-1761785582e3)/36e5).toFixed(1),l=`%c🌏 ${t}%c ${n}.${r.slice(0,8)}.${e} (距今${s}个小时)
4145
+ `;console.log(e);const i=window.prompt(e,t);i&&window.open(i,"_blank")}const Nt=class Nt extends c.ESViewer{constructor(e){super(e);L(this,"_disabledInputStack",this.disposeVar(c.react(0)));L(this,"_viewer",this.dv(c.react(void 0)));L(this,"_viewerInstance");L(this,"_viewerLegend");L(this,"pickCustomAttachedInfo");L(this,"_fps",this.dv(c.react(0)));L(this,"_notSupportEditingCount",this.disposeVar(c.react(0)));L(this,"_editingSystem",Wf);L(this,"_moveObjectsProcess",this.ad(RS()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new mV(this)),this.ad(new gV(this)),this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new bV(this)})),this._viewerLegend=this.dv(new TH(this)),this._viewerInstance=this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new kv(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=Be([1,1,1,1]))}));const i=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new c.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new vN(this.subContainer,this,o=>this._viewer.value=o,i.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&&Qn(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,i,o){if(!this.extensions)return;const{pickingManager:r}=this.extensions;return await r.pick(e,void 0,i)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:i}=this;if(!i)return;const o=b.Cartographic.fromDegrees(e[0],e[1],e[2],Nt.getHeightsScartchCarto);return i.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Fn(e),rotation:gs(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:i}=this.viewer;if(!i||!e)return;const o=b.Cartesian3.fromDegrees(...e),r=b.Transforms.eastNorthUpToFixedFrame(o),a=b.Matrix4.inverse(r,new b.Matrix4),s=b.Matrix4.multiplyByPoint(a,i.positionWC,new b.Cartesian3),l=b.Cartesian3.magnitude(s);let u=-Math.asin(s.z/l);u=b.Math.toDegrees(u);let A=b.Math.PI_OVER_TWO-Math.atan(s.y/s.x);s.x>0&&(A+=s.y<0?-b.Math.PI:b.Math.PI),A=b.Math.toDegrees(A);const h=gs(i),f=h[0]-A,d=h[1]-u;return{distance:l,heading:A,pitch:u,flyDuration:1,hDelta:f,pDelta:d}}flyIn(e,i,o,r="default"){var l;if(!i)return;const a={position:e,rotation:i,duration:(o??1)*1e3},s=(l=this.viewer)==null?void 0:l.camera;return s&&rl(s,a,r)}flyTo(e,i,o="default"){var d;const{distance:r,heading:a,pitch:s,flyDuration:l,hDelta:u,pDelta:A}=e,h={position:i,viewDistance:r,rotation:[a,s,0],duration:l*1e3,hdelta:u,pdelta:A},f=(d=this.viewer)==null?void 0:d.camera;return f&&rl(f,h,o)}flyToBoundingSphere(e,i,o=1){var h;const r=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],a=c.getGeoBoundingSphereFromPositions(r);if(!a)return;const{center:s,radius:l}=a,u={position:s,viewDistance:i??l,rotation:[0,-90,0],duration:o*1e3},A=(h=this.viewer)==null?void 0:h.camera;return A&&rl(A,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Fn(e),rotation:gs(e)}}transformFlyParam(e,i){if(!(e instanceof c.ESObjectWithLocation)){console.warn("flyInParam转换为flyToParam失败,sceneObject不是ESObjectWithLocation类型!");return}if("position"in i){const o=b.Cartesian3.fromDegrees(...e.position),r=b.Transforms.eastNorthUpToFixedFrame(o),a=b.Matrix4.inverse(r,new b.Matrix4),s=b.Matrix4.multiplyByPoint(a,ut(i.position),new b.Cartesian3),l=b.Cartesian3.magnitude(s);let u=-Math.asin(s.z/l);u=b.Math.toDegrees(u);let A=b.Math.PI_OVER_TWO-Math.atan(s.y/s.x);s.x>0&&(A+=s.y<0?-b.Math.PI:b.Math.PI),A=b.Math.toDegrees(A);const h=i.rotation[0]-A,f=i.rotation[1]-u;return{distance:l,heading:A,pitch:u,flyDuration:i.flyDuration??1,hDelta:h,pDelta:f}}else{if(!e.position)return;const o=ut(e.position);let r={heading:b.Math.toRadians(i.heading),pitch:b.Math.toRadians(i.pitch),roll:0};const a=new b.HeadingPitchRoll;if(i.distance){a.heading=r.heading,a.pitch=r.pitch,a.roll=0,a.heading-=b.Math.PI_OVER_TWO;const l=b.Transforms.headingPitchRollToFixedFrame(o,a,void 0,void 0),u=b.Matrix4.multiplyByPointAsVector(l,b.Cartesian3.UNIT_X,new b.Cartesian3);b.Cartesian3.multiplyByScalar(u,i.distance,u),b.Cartesian3.subtract(o,u,o)}i.hDelta&&(r.heading+=b.Math.toRadians(i.hDelta)),i.pDelta&&(r.pitch+=b.Math.toRadians(i.pDelta));const s=Ue(o);return s?{position:s,rotation:[b.Math.toDegrees(r.heading),b.Math.toDegrees(r.pitch),b.Math.toDegrees(r.roll)],flyDuration:i.flyDuration??1}:void 0}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,i=4.2,o=1.6){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToWalk(e,i,o),this._navigationMode.value="Walk"}changeToMap(){var e,i;(i=(e=this._viewerInstance)==null?void 0:e.obj)==null||i.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,i,o){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToRotateGlobe(e,i,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,i,o,r,a,s){var l,u;(u=(l=this._viewerInstance)==null?void 0:l.obj)==null||u.navigationManager.changeToLine(e,i,o,r,a,s),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToRotatePoint(e,i,o,r,a),this._navigationMode.value="RotatePoint"}changeToFollow(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToFollow(e,i,o,r,a),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=window.g_XE3CopyRights??{};return e.cesium=b.VERSION,e}async getHeightByLonLat(e,i,o){if(!this.viewer)return null;const r=b.Cartographic.fromDegrees(e,i,void 0,Nt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(r)??null}async getHeightsByLonLats(e,i){const o=e.map(a=>this.getHeightByLonLat(...a));return await Promise.all(o)}async capture(e,i){if(this.viewer)return await P0(this.viewer.scene,e,i)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const i=this.viewer.scene.cartesianToCanvasCoordinates(ut(e));if(i)return[i.x,i.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,i,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const r=e.components.main??e;r&&i!=null&&(r.editingID=`${o.callSource}_${c.createGuid()}`,this._editingSystem.create(this,r,i,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const i=[],o=c.createGuid();for(let r=0;r<e.length;r++){const a=e[r],s=a.components.main??a;s.editingID=o,s&&i.push(s)}this._moveObjectsProcess.restart(void 0,this,i,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=Nt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!Nt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=Nt.latestDefaultAccessToken}positionsToLocalPositions(e,i){return vn(e,i)}localPositionsToPositions(e,i){return _r(e,i)}isPointVisible(e){if(!this.viewer)return!1;const i=ut(e),o=new b.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(i))return!1;const r=this.viewer.scene.cartesianToCanvasCoordinates(i);return!(!r||r.x<0||r.y<0)}getESProperties(){const e={...super.getESProperties()},i=Nt.defaults;return{...e,more:[...e.more,new c.GroupProperty([],"通用","通用"),new c.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",RH,DH,!0),new c.FunctionProperty([],()=>Nt.getCesiumIonToken(),[],"获取官方token"),new c.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new c.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new c.BooleanProperty([this,"flashLighting"],"头顶灯",i.flashLighting,!0),new c.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",i.particleGlobalControl,!0),new c.GroupProperty([],"Viewer","Viewer"),new c.NumberProperty([this,"resolutionScale"],"分辨率比率",i.resolutionScale,!0),new c.NumberProperty([this,"msaaSamples"],"msaaSamples",i.msaaSamples,!0),new c.BooleanProperty([this,"shadows"]),new c.GroupProperty([],"比例尺","比例尺(Legend)"),new c.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new c.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new c.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new c.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new c.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new c.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new c.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new c.GroupProperty([],"场景","场景(Scene)"),new c.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",i.sceneSplitPosition,!0),new c.GroupProperty([],"Globe","Globe"),new c.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",i.sceneGlobeShadows,!0),new c.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new c.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new c.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new c.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new c.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new c.BooleanProperty([this,"sceneGlobeShowSkirts"]),new c.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new c.ColorProperty([this,"sceneGlobeBaseColor"]),new c.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new c.JsonProperty([this,"sceneGlobeClippingPlanes"]),new c.StringProperty([this,"sceneGlobeClippingPlanesId"]),new c.JsonProperty([this,"sceneGlobeClippingPolygons"]),new c.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new c.GroupProperty([],"underground","underground"),new c.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",i.sceneGlobeUndergroundColor,!0),new c.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",i.sceneGlobeUndergroundColorAlphaByDistance,!0),new c.GroupProperty([],"Translucency","Translucency"),new c.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",i.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new c.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",i.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new c.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",i.sceneGlobeTranslucencyRectangle,!0),new c.GroupProperty([],"Sun","Sun"),new c.BooleanProperty([this,"sun"],"sun",i.sun,!0),new c.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",i.sceneSunGlowFactor,!0),new c.GroupProperty([],"Moon","Moon"),new c.BooleanProperty([this,"moon"],"moon",i.moon,!0),new c.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",i.sceneMoonTextureUrl,!0),new c.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",i.sceneMoonOnlySunLighting,!0),new c.GroupProperty([],"SkyBox","SkyBox"),new c.BooleanProperty([this,"sceneSkyBoxShow"]),new c.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",i.sceneSkyBoxSources,void 0,!0),new c.GroupProperty([],"Background","Background"),new c.BooleanProperty([this,"xbsjUseBackground"]),new c.StringProperty([this,"xbsjBackgroundImageUri"]),new c.ColorProperty([this,"xbsjBackgroundColor"]),new c.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new c.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",i.xbsjLocalBoxSources,void 0,!0),new c.ColorProperty([this,"sceneBackgroundColor"]),new c.GroupProperty([],"Fog","Fog"),new c.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",i.sceneFogEnabled,!0),new c.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",i.sceneFogDensity,!0),new c.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",i.sceneFogScreenSpaceErrorFactor,!0),new c.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",i.sceneFogMinimumBrightness,!0),new c.GroupProperty([],"Sscc","Sscc"),new c.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",i.sceneSsccEnableInputs,!0),new c.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",i.sceneSsccEnableCollisionDetection,!0),new c.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",i.sceneSsccZoomFactor,!0),new c.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new c.GroupProperty([],"后处理","后处理"),new c.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",i.scenePpsfxaaEnabled,!0),new c.GroupProperty([],"环境遮蔽","环境遮蔽"),new c.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new c.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new c.GroupProperty([],"Bloom","Bloom"),new c.BooleanProperty([this,"scenePpsBloomEnabled"]),new c.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new c.NumberProperty([this,"scenePpsBloomContrast"]),new c.NumberProperty([this,"scenePpsBloomBrightness"]),new c.NumberProperty([this,"scenePpsBloomDelta"]),new c.NumberProperty([this,"scenePpsBloomSigma"]),new c.NumberProperty([this,"scenePpsBloomStepSize"]),new c.GroupProperty([],"调试","调试"),new c.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",i.sceneDebugShowFramesPerSecond,!0),new c.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",i.sceneDebugShowCommands,!0),new c.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",i.sceneDebugShowFrustums,!0),new c.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",i.sceneDebugShowFrustumPlanes,!0),new c.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",i.sceneDebugShowDepthFrustum,!0),new c.GroupProperty([],"Inspector","Inspector"),new c.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",i.showCesiumInspector,!0),new c.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",i.cesiumInspectorWireframe,!0),new c.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",i.showCesium3DTilesInspector,!0)]}}};L(Nt,"type",Nt.register("ESCesiumViewer",Nt)),L(Nt,"getCesiumIonToken",UH),L(Nt,"currentDefaultAccessToken",b.Ion.defaultAccessToken),L(Nt,"latestDefaultAccessToken"),L(Nt,"ObjectsToExcludeWrapper",wV),L(Nt,"defaults",{...c.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:b.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:b.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}),L(Nt,"getHeightsScartchCarto",new b.Cartographic);let ot=Nt;(t=>{t.createDefaultProps=()=>({...c.ESViewer.createDefaultProps(),...MH()})})(ot||(ot={})),c.extendClassProps(ot.prototype,ot.createDefaultProps),re.copyright=void 0;try{const t="earthsdk3-cesium",n="3.6.0-beta.1",e="2025-10-30T06:56:39.000Z",i="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="4036c096f6901802a4551685925be1fa8a9fdade",s=((Date.now()-1761807399e3)/36e5).toFixed(1),l=`%c🌏 ${t}%c ${n}.${r.slice(0,8)}.${e} (距今${s}个小时)
4146
4146
  %c${o?o+`
4147
4147
  `:""}当前网站正在使用${t},此软件版权归${i}所有
4148
- `;re.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","cda73626e40b80da99887fe7a1decdbccc6aa5d9")},get info(){return l},get date(){return"2025-10-30T00:53:02.000Z"},get author(){return"suplyang"},get version(){return"3.5.0"},get name(){return"earthsdk3-cesium"},get commitId(){return"cda73626e40b80da99887fe7a1decdbccc6aa5d9"},print(){console.info(this.info,`
4148
+ `;re.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","4036c096f6901802a4551685925be1fa8a9fdade")},get info(){return l},get date(){return"2025-10-30T06:56:39.000Z"},get author(){return"suplyang"},get version(){return"3.6.0-beta.1"},get name(){return"earthsdk3-cesium"},get commitId(){return"4036c096f6901802a4551685925be1fa8a9fdade"},print(){console.info(this.info,`
4149
4149
  font-size: 18px;
4150
4150
  font-weight: 1000;
4151
4151
  line-height: 1;