earthsdk3-cesium 3.6.0-beta.119 → 3.6.0-beta.121

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.
Files changed (28) hide show
  1. package/dist/earthsdk3-cesium.iife.js +27 -27
  2. package/dist/earthsdk3-cesium.js +1280 -1257
  3. package/dist/earthsdk3-cesium.umd.cjs +25 -25
  4. package/dist/types/CzmObjects/general/CzmESMVTLayer/VectorTilesManager/VectorTilesCache.d.ts +1 -0
  5. package/dist/types/CzmObjects/general/CzmESMVTLayer/VectorTilesManager/VectorTilesCache.d.ts.map +1 -1
  6. package/dist/types/CzmObjects/general/CzmESMVTLayer/VectorTilesManager/index.d.ts.map +1 -1
  7. package/dist/types/CzmObjects/general/CzmESMVTLayer/VectorTilesManager/utils.d.ts.map +1 -1
  8. package/dist/types/CzmObjects/general/CzmESMVTLayer/index.d.ts.map +1 -1
  9. package/dist/types/ESCesiumViewer/ViewerExtensions/ScreenManager/ScreenLayer.d.ts.map +1 -1
  10. package/dist/types/ESCesiumViewer/ViewerExtensions/ScreenManager/ScreenObject.d.ts +3 -0
  11. package/dist/types/ESCesiumViewer/ViewerExtensions/ScreenManager/ScreenObject.d.ts.map +1 -1
  12. package/dist/types/ESObjects/ESMVTLayer.d.ts +5 -0
  13. package/dist/types/ESObjects/ESMVTLayer.d.ts.map +1 -1
  14. package/package.json +1 -1
  15. package/dist/types/CzmObjects/base/InnerClass/XbsjGroundPolylinePrimitive/GroundPolylinePrimitive.d.ts +0 -148
  16. package/dist/types/CzmObjects/general/CzmESSignalTransmission/XbsjPolyline/XbsjPolylineGeometry.d.ts +0 -3
  17. package/dist/types/CzmObjects/general/CzmESSignalTransmission/XbsjPolyline/xbsjCreateODLinesPrimitive.d.ts +0 -29
  18. package/dist/types/CzmObjects/general/CzmESVideoFusion/XbsjCameraVideo/XbsjCameraVideo.d.ts +0 -18
  19. package/dist/types/CzmObjects/general/CzmESViewShed/XbsjViewshed/XbsjViewshed.d.ts +0 -16
  20. package/dist/types/ESCesiumViewer/BackGroundImage/BackGroundImage.d.ts +0 -5
  21. package/dist/types/ESCesiumViewer/LocalSkyBox/SkyAtmosphere.d.ts +0 -14
  22. package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/GaussianSplatPipelineStage.d.ts +0 -12
  23. package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/GaussianSplatTexturePipelineStage.d.ts +0 -11
  24. package/dist/types/ESCesiumViewer/initCesiumViewer/fixGoogleEarth/cesiumFixGoogleEarth.d.ts +0 -1
  25. package/dist/types/__declares/cesium.d.ts +0 -427
  26. package/dist/types/utils/czmUtils/todo/generateCartesianArc/czm/generateCartesianArc.d.ts +0 -8
  27. package/dist/types/utils/generalUtils/geoPolylineToBezierSpline/bezierSpline/index.d.ts +0 -37
  28. package/dist/types/utils/generalUtils/geoPolylineToBezierSpline/bezierSpline/lib/spline.d.ts +0 -62
@@ -1,4 +1,4 @@
1
- (function(M,ye){typeof exports=="object"&&typeof module<"u"?ye(exports,require("cesium"),require("earthsdk3"),require("html2canvas"),require("mvt-basic-render"),require("delaunator"),require("earcut"),require("pbf"),require("@mapbox/vector-tile")):typeof define=="function"&&define.amd?define(["exports","cesium","earthsdk3","html2canvas","mvt-basic-render","delaunator","earcut","pbf","@mapbox/vector-tile"],ye):(M=typeof globalThis<"u"?globalThis:M||self,ye(M.EarthSDK3_Cesium={},M.Cesium,M.EarthSDK3,M.html2canvas,M.Mapbox,M.Delaunator,M.earcut,M.Pbf,M.vectorTile))})(this,function(M,ye,a,Jh,d_,p_,f_,g_,m_){"use strict";var q4=Object.defineProperty;var X4=(M,ye,a)=>ye in M?q4(M,ye,{enumerable:!0,configurable:!0,writable:!0,value:a}):M[ye]=a;var m=(M,ye,a)=>X4(M,typeof ye!="symbol"?ye+"":ye,a);var ko=typeof document<"u"?document.currentScript:null;function Lg(t){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(i,e,n.get?n:{enumerable:!0,get:()=>t[e]})}}return i.default=t,Object.freeze(i)}const h=Lg(ye),v_=Lg(d_);window.Cesium=h;function y_(){Object.keys(h).forEach(t=>{h[t].prototype&&Object.defineProperty(h[t].prototype,"ESSceneObjectID",{writable:!0,enumerable:!0,value:a.createGuid()})})}fetch("https://corsproxy.io/?https://gitee.com/mirrors/CesiumJS/raw/main/packages/engine/Source/Core/Ion.js").then(t=>t.text()).then(t=>{const i=t.match(/defaultAccessToken\s*=\s*["'`](.*?)["'`]/);i&&(h.Ion.defaultAccessToken=i[1],console.log("更新默认Cesium.Ion.Token成功"))});const ma=class ma extends a.Destroyable{};m(ma,"defaults",{enabled:!0}),m(ma,"createDefaultProps",()=>({...ma.defaults}));let Gt=ma;a.extendClassProps(Gt.prototype,Gt.createDefaultProps);class jt extends a.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(i.flyToEvent.don((o,s,r)=>this.flyTo(o,s,r))),this.d(i.flyInEvent.don((o,s,r)=>this.flyIn(o,s,r))),this.dispose(i.calcFlyInParamEvent.disposableOn(()=>{if(!e.actived)return;const o=e.getCameraInfo();if(!o)return;const{position:s,rotation:r}=o;i.flyInParam={position:s,rotation:r,flyDuration:1}})),this.dispose(i.calcFlyToParamEvent.disposableOn(()=>{i.useCalcFlyToParamInESObjectWithLocation||console.warn("calcFlyToParam无法调用,该对象缺少position属性!")}))}flyToWithPromise(i,e,n,o,s,r,l,c="default"){const{sceneObject:u,czmViewer:d}=this,p=d.flyTo({distance:n??0,heading:o?o[0]:0,pitch:o?o[1]:0,flyDuration:s??1,hDelta:r??0,pDelta:l??0},e,c);p&&p.then(f=>{})}flyTo(i,e,n="default"){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam&&(o.useCalcFlyToParamInESObjectWithLocation||console.warn("flyToParam无法使用,该对象缺少position属性,若飞行失败,请清空flyToParam后重试!")),o.flyInParam){const{position:r,rotation:l,flyDuration:c}=o.flyInParam,u=i??c;return this.flyToWithPromise(e,r,void 0,l,u,void 0,void 0,n),!0}return!1}flyIn(i,e,n="default"){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyInParam){const{position:r,rotation:l,flyDuration:c}=o.flyInParam,u=i??c;return this.flyToWithPromise(e,r,void 0,l,u,void 0,void 0,n),!0}return!1}get czmViewer(){return this.viewer}}function Ie(t,i){return h.Cartesian3.fromDegrees(...t,void 0,i)}const w_=new h.Cartographic;function se(t,i){const e=h.Cartographic.fromCartesian(t,void 0,w_);if(e)return i=i||[0,0,0],i[0]=h.Math.toDegrees(e.longitude),i[1]=h.Math.toDegrees(e.latitude),i[2]=e.height,i}function Pe(t,i){return i=i||new h.Cartesian2,i.x=t[0],i.y=t[1],i}function Og(t,i){return i=i||[0,0],i[0]=t.x,i[1]=t.y,i}function hi(t,i){return i=i||new h.Cartesian3,i.x=t[0],i.y=t[1],i.z=t[2],i}function vr(t,i){return i=i||[0,0,0],i[0]=t.x,i[1]=t.y,i[2]=t.z,i}function jh(t,i){return i=i||new h.Cartesian4,i.x=t[0],i.y=t[1],i.z=t[2],i.w=t[3],i}function Ng(t,i){return i=i||[0,0,0,0],i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w,i}function ui(t,i){if(t.length===4)return jh(t,i);if(t.length===3)return hi(t,i);if(t.length===2)return Pe(t,i);throw new Error("toCartesian error: should not be here!")}function C_(t,i){if(t instanceof h.Cartesian2)return Og(t,i);if(t instanceof h.Cartesian3)return vr(t,i);if(t instanceof h.Cartesian4)return Ng(t,i);throw new Error("fromCartesian error: should not be here!")}function __(t,i){return i=i||new h.Cartographic,i.longitude=h.Math.toRadians(t[0]),i.latitude=h.Math.toRadians(t[1]),i.height=t[2],i}function Jn(t,i){return i=i||[0,0,0],i[0]=h.Math.toDegrees(t.longitude),i[1]=h.Math.toDegrees(t.latitude),i[2]=t.height,i}function te(t,i){return i=i||new h.Color,i.red=t[0],i.green=t[1],i.blue=t[2],i.alpha=t[3],i}function P_(t,i){return i=i||[0,0,0,0],i[0]=t.red,i[1]=t.green,i[2]=t.blue,i[3]=t.alpha,i}function dn(t,i){return i=i||new h.NearFarScalar,i.near=t[0],i.nearValue=t[1],i.far=t[2],i.farValue=t[3],i}function b_(t,i){return i=i||[0,0,0,0],i[0]=t.near,i[1]=t.nearValue,i[2]=t.far,i[3]=t.farValue,i}function Bg(t,i){return i=i||new h.HeadingPitchRoll,i.heading=h.Math.toRadians(t[0]-90),i.pitch=h.Math.toRadians(t[1]),i.roll=h.Math.toRadians(t[2]),i}function S_(t,i){return i=i||[0,0,0],i[0]=h.Math.toDegrees(t.heading+h.Math.PI_OVER_TWO),i[1]=h.Math.toDegrees(t.pitch),i[2]=h.Math.toDegrees(t.roll),i}function yr(t,i){return i=i||new h.DistanceDisplayCondition,i.near=t[0],i.far=t[1],i}function E_(t,i){return i=i||[0,0],i[0]=t.near,i[1]=t.far,i}function x_(t,i){return i=i||new h.Quaternion,i.x=t[0],i.y=t[1],i.z=t[2],i.w=t[3],i}function A_(t,i){return i=i||[0,0,0,0],i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w,i}const T_=new h.HeadingPitchRoll,M_=new h.Cartesian3;function I_(t,i,e){const n=Bg(i,T_),o=Ie(t,M_);return h.Transforms.headingPitchRollQuaternion(o,n,void 0,void 0,e)}function Ue(t,i){return i=i||new h.Rectangle,i.west=t[0]*Math.PI/180,i.south=t[1]*Math.PI/180,i.east=t[2]*Math.PI/180,i.north=t[3]*Math.PI/180,i}function D_(t,i){return i=i||[0,0,0,0],i[0]=t.west,i[1]=t.south,i[2]=t.east,i[3]=t.north,i}const R_=new h.Cartesian3;function we(t,i){return i=i||new h.Ellipsoid,h.Ellipsoid.fromCartesian3(h.Cartesian3.fromArray(t,void 0,R_),i)}function F_(t,i){return i=i||[0,0,0],i[0]=t.radii.x,i[1]=t.radii.y,i[2]=t.radii.z,i}function wi(t){if(t.type==="GeographicTilingScheme")return new h.GeographicTilingScheme({ellipsoid:t.ellipsoid&&we(t.ellipsoid),rectangle:t.rectangle&&Ue(t.rectangle),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY});if(t.type==="WebMercatorTilingScheme")return new h.WebMercatorTilingScheme({ellipsoid:t.ellipsoid&&we(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Pe(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Pe(t.rectangleNortheastInMeters)});if(t.type==="ToGCJ02WebMercatorTilingScheme")return new ey({ellipsoid:t.ellipsoid&&we(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Pe(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Pe(t.rectangleNortheastInMeters)});if(t.type==="ToWGS84WebMercatorTilingScheme")return new ty({ellipsoid:t.ellipsoid&&we(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Pe(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Pe(t.rectangleNortheastInMeters)});console.warn(`未能识别的类型tilingSchemaJson.type: ${t.type}`)}function wr(t,i){const{planes:e,enabled:n,modelMatrix:o,unionClippingRegions:s,edgeColor:r,edgeWidth:l}=t;let c=o&&h.Matrix4.fromArray(o);return i&&(c=c||h.Matrix4.clone(h.Matrix4.IDENTITY,new h.Matrix4),h.Matrix4.multiply(i,c,c)),new h.ClippingPlaneCollection({planes:e&&e.map(u=>new h.ClippingPlane(hi(u.normal),u.distance)),enabled:n,modelMatrix:c,unionClippingRegions:s,edgeColor:r&&te(r),edgeWidth:l})}function dc(t,i,e){const n=i;if(!n){t.removeAll(),t.enabled=!1;return}if(t.removeAll(),n.planes)for(let s of n.planes)t.add(new h.ClippingPlane(hi(s.normal),s.distance));let o=n.modelMatrix&&h.Matrix4.fromArray(n.modelMatrix)||h.Matrix4.clone(h.Matrix4.IDENTITY,new h.Matrix4);e&&h.Matrix4.multiply(e,o,o),t.enabled=n.enabled??!0,t.modelMatrix=o,t.unionClippingRegions=n.unionClippingRegions??!1,t.edgeColor=te(n.edgeColor??[1,1,1,1]),t.edgeWidth=n.edgeWidth??2}function pc(t){const{polygons:i,enabled:e,inverse:n}=t;return new h.ClippingPolygonCollection({polygons:i&&i.map(o=>new h.ClippingPolygon({positions:o.positions.map(s=>Ie(s))})),enabled:e,inverse:n})}function fc(t,i){return eu(t,h.Cartesian3.UNIT_Y,h.Cartesian3.UNIT_Z,h.Cartesian3.UNIT_X,i)}function Vg(t,i){return eu(t,h.Cartesian3.UNIT_X,h.Cartesian3.UNIT_Z,new h.Cartesian3(0,-1,0),i)}function eu(t,i,e,n,o){const[s,r,l]=t,c=h.Quaternion.fromAxisAngle(e,h.Math.toRadians(-s)),u=h.Quaternion.fromAxisAngle(n,h.Math.toRadians(r)),d=h.Quaternion.fromAxisAngle(i,h.Math.toRadians(l)),p=h.Quaternion.clone(h.Quaternion.IDENTITY,o);return h.Quaternion.multiply(d,p,p),h.Quaternion.multiply(u,p,p),h.Quaternion.multiply(c,p,p),p}function pn(t,i){return Array.isArray(t)?t.length!==i?(console.warn(`array.length !== ${i}`),!1):t.every(e=>Number.isFinite(e))?!0:(console.warn("!array.every(v => Number.isFinite(v))"),!1):(console.warn("!Array.isArray(array)"),!1)}function Ug(t){return t.some(i=>i===0)?(console.warn("array.some(e => e === 0)"),!1):!0}function Fe(t,i){if(!((!t.localScale||pn(t.localScale,3))&&(!t.localRotation||pn(t.localRotation,3))&&(!t.localPosition||pn(t.localPosition,3))&&(!t.localModelMatrix||pn(t.localModelMatrix,16))&&(!t.scale||pn(t.scale,3))&&(!t.rotation||pn(t.rotation,3))&&(!t.position||pn(t.position,3))&&(!t.modelMatrix||pn(t.modelMatrix,16)))||t.localScale&&!Ug(t.localScale)||t.scale&&!Ug(t.scale))return;if(t.sceneScaleFromPixelSize){if(!Number.isFinite(t.sceneScaleFromPixelSize)){console.warn("!Number.isFinite(options.sceneScaleFromPixelSize)");return}if(t.sceneScaleFromPixelSize===0){console.warn("options.sceneScaleFromPixelSize === 0");return}}const n=i??h.Matrix4.clone(h.Matrix4.IDENTITY);if(t.localScale){const[o,s,r]=t.localScale??[1,1,1],l=h.Matrix4.fromScale(h.Cartesian3.fromElements(o,s,r),new h.Matrix4);h.Matrix4.multiply(l,n,n)}if((t.initialRotation??"yForwardzUp")==="xForwardzUp"){const o=h.Quaternion.fromAxisAngle(h.Cartesian3.UNIT_Z,h.Math.toRadians(90)),s=h.Matrix3.fromQuaternion(o);h.Matrix4.multiply(h.Matrix4.fromRotationTranslation(s),n,n)}if(t.localRotation){const o=fc(t.localRotation),s=h.Matrix3.fromQuaternion(o);h.Matrix4.multiply(h.Matrix4.fromRotationTranslation(s),n,n)}if(t.localPosition){const o=h.Matrix4.fromTranslation(h.Cartesian3.fromArray(t.localPosition));h.Matrix4.multiply(o,n,n)}if(t.localModelMatrix){const o=h.Matrix4.fromArray(t.localModelMatrix);h.Matrix4.multiply(o,n,n)}if(t.sceneScaleFromPixelSize!==void 0&&Number.isFinite(t.sceneScaleFromPixelSize)){const o=t.sceneScaleFromPixelSize,s=h.Matrix4.fromScale(h.Cartesian3.fromElements(o,o,o),new h.Matrix4);h.Matrix4.multiply(s,n,n)}if(t.scale){const[o,s,r]=t.scale??[1,1,1],l=h.Matrix4.fromScale(h.Cartesian3.fromElements(o,s,r),new h.Matrix4);h.Matrix4.multiply(l,n,n)}if(t.rotation){const o=fc(t.rotation),s=h.Matrix3.fromQuaternion(o);h.Matrix4.multiply(h.Matrix4.fromRotationTranslation(s),n,n)}if(t.position){const o=h.Cartesian3.fromDegrees(...t.position),s=h.Transforms.eastNorthUpToFixedFrame(o);h.Matrix4.multiply(s,n,n)}if(t.modelMatrix){const o=h.Matrix4.fromArray(t.modelMatrix);h.Matrix4.multiply(o,n,n)}return n}const z_=new h.Cartesian3,Cr=new h.HeadingPitchRoll,L_=new h.Matrix4,O_=new h.Cartesian3,N_=new h.Cartographic;function B_(t,i=[0,0,0],e=0,n){const[o,s,r]=t,l=h.Cartesian3.fromDegrees(o,s,r,void 0,z_),c=[...i];for(let d=0;d<3;++d)c[d]=h.Math.RADIANS_PER_DEGREE*c[d];if(e!==0){Cr.heading=c[0],Cr.pitch=c[1],Cr.roll=c[2],Cr.heading-=h.Math.PI_OVER_TWO;const d=h.Transforms.headingPitchRollToFixedFrame(l,Cr,void 0,void 0,L_),p=h.Matrix4.multiplyByPointAsVector(d,h.Cartesian3.UNIT_X,O_);h.Cartesian3.multiplyByScalar(p,e,p),h.Cartesian3.subtract(l,p,l)}const u=h.Cartographic.fromCartesian(l,void 0,N_);if(u)return n=n||[0,0,0],n[0]=u.longitude*180/Math.PI,n[1]=u.latitude*180/Math.PI,n[2]=u.height,n}function Wg(t,i,e,n){return B_(t,i,e,n)}const fn=h.Math.toDegrees;function Ht(t,i){const{longitude:e,latitude:n,height:o}=t.positionCartographic;return i?(i[0]=fn(e),i[1]=fn(n),i[2]=o,i):[fn(e),fn(n),o]}function Ko(t,i){const{heading:e,pitch:n,roll:o}=t;return i?(i[0]=fn(e),i[1]=fn(n),i[2]=fn(o),i):[e,n,o].map(fn)}class gc extends a.Destroyable{constructor(e){super();m(this,"_originViewMatrix",new h.Matrix4);m(this,"_originProjMatrix",new h.Matrix4);m(this,"_changed",new a.Event);this._scene=e;const n=this._scene.camera;h.Matrix4.clone(n.viewMatrix,this._originViewMatrix),h.Matrix4.clone(n.frustum.projectionMatrix,this._originViewMatrix),this.dispose(this._scene.preUpdate.addEventListener(()=>{this._update()}))}_update(){h.Matrix4.equals(this._scene.camera.viewMatrix,this._originViewMatrix)||(h.Matrix4.clone(this._scene.camera.viewMatrix,this._originViewMatrix),this._changed.emit()),h.Matrix4.equals(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix)||(h.Matrix4.clone(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix),this._changed.emit())}get changed(){return this._changed}}class V_ extends a.Destroyable{constructor(i){super();const e=()=>{};this.dispose(i.viewDistanceChanged.disposableOn(e)),this.dispose(i.visibleAlphaChanged.disposableOn(e))}}class U_ extends a.Destroyable{constructor(e){super();m(this,"_debugObjResetting");this._control=e,this._debugObjResetting=this.disposeVar(new a.ObjResettingWithEvent(this._control.debugChanged,()=>{if(this._control.debug)return new V_(this._control)}))}get debugObjResetting(){return this._debugObjResetting}}class jn extends a.Destroyable{constructor(e,n,o,s){super();m(this,"_visibleAlpha",this.disposeVar(a.react(1)));m(this,"_viewDistance",this.disposeVar(a.react(0)));m(this,"_debug",this.disposeVar(a.react(!1)));m(this,"_viewDistanceDebug",this.disposeVar(new U_(this)));this._czmViewer=e,this._positionReact=o;const{positionReact:r,czmViewer:l}=this,[c,u,d]=a.getReactFuncs(n),[p,f,g]=a.getReactFuncs(r),[v,y,w]=s?a.getReactFuncs(s):[void 0,void 0,void 0],P=()=>{let x=1,A=Number.NEGATIVE_INFINITY;const R=c(),L=p(),B=v?v():0,V=l.getCurrentCameraInfo();if(!R||!L||!V){this._viewDistance.value=A,this._visibleAlpha.value=x;return}A=a.cartesianDistance(V.position,L)-(B??0);const[G,O,N,_]=R;G>O||O>N||N>_?console.error("viewDistanceRange存在问题,需要满足逐级增大的条件,否则不生效!"):A>=O&&A<=N?x=1:A<=G||A>=_?x=0:A>G&&A<O?O-G<=0?x=0:x=(A-G)/(O-G):A>N&&A<_?(_<=N&&(x=0),x=(_-A)/(_-N)):(x=1,console.error("不应该运行至此!")),this._viewDistance.value=A,this._visibleAlpha.value=x};P();const C=[l.cameraChanged,d,g];w&&C.push(w);const S=this.disposeVar(a.createNextAnimateFrameEvent(...C));this.dispose(S.disposableOn(P))}get visibleAlpha(){return this._visibleAlpha.value}get visibleAlphaChanged(){return this._visibleAlpha.changed}get viewDistance(){return this._viewDistance.value}set viewDistance(e){this._viewDistance.value=e}get viewDistanceChanged(){return this._viewDistance.changed}get debug(){return this._debug.value}set debug(e){this._debug.value=e}get debugChanged(){return this._debug.changed}get positionReact(){return this._positionReact}get czmViewer(){return this._czmViewer}get viewDistanceDebug(){return this._viewDistanceDebug}}const W_=new h.BoundingSphere(h.Cartesian3.ZERO,0);function Wi(t,i,e){var n=W_;h.Cartesian3.clone(i,n.center);const o=t.camera.getPixelSize(n,t.drawingBufferWidth,t.drawingBufferHeight);if(o<=0)return;const s=e*o;if(Number.isFinite(s)&&s>0)return s}function pt(t,i=!1){const e=t.length;let n;const o=[];for(let s=0;s<e;++s){const[r,l,c]=t[s],u=i?h.Cartesian3.fromDegrees(r,l):h.Cartesian3.fromDegrees(r,l,c);if(!u)continue;const{x:d,y:p,z:f}=u;[d,p,f].every(Number.isFinite)&&(!n||!h.Cartesian3.equals(n,u))&&(n=u,o.push(n))}return o}function eo(t,i,e,n){const o=a.geoRhumbDistance(t,e),s=a.geoRhumbHeading(t,e),r=Math.cos(s*Math.PI/180)*Math.cos(i*Math.PI/180)+Math.sin(s*Math.PI/180)*Math.sin(i*Math.PI/180);return r>0?a.geoRhumbDestination(t,o,i,n):a.geoRhumbDestination(t,o,i+180,n),[r>0?o:-o,n]}function G_(t,i,e){const n=e*.1,o=[];for(let s=-9;s<10;++s){const r=a.geoRhumbDestination(t,n*s,i);r&&o.push(r)}return o}function H_(t,i){return a.geoNearestPointOnLine(t,i).geometry.coordinates}const Gg=new h.Cartesian3,$_=new h.Ray,q_=new h.Plane(h.Cartesian3.UNIT_X,0);function mc(t,i,e,n){const o=h.Cartesian3.normalize(i,Gg),s=h.Cartesian3.cross(t.camera.right,o,Gg);h.Cartesian3.normalize(s,s);const r=h.Plane.fromPointNormal(i,s,q_),l=t.camera.getPickRay(e,$_);if(l)return h.IntersectionTests.rayPlane(l,r,n)}const tu=new h.Cartesian3,X_=new h.Ray,Y_=new h.Cartographic,Z_=new h.Ellipsoid;function Jo(t,i,e,n){const o=t.camera.getPickRay(i,X_);if(!o)return;const s=h.Cartesian3.fromElements(e,e,e,tu),r=h.Cartesian3.add(s,h.Ellipsoid.WGS84.radii,tu),l=h.Ellipsoid.fromCartesian3(r,Z_),c=h.IntersectionTests.rayEllipsoid(o,l);if(c){const u=c.start>0?c.start:c.stop;if(u){const d=h.Ray.getPoint(o,u,tu),p=h.Cartographic.fromCartesian(d,void 0,Y_);return n=n||new h.Cartographic,n.longitude=p.longitude,n.latitude=p.latitude,n.height=e,n}else return}else return}function jo(t,i){i[0]=t[0],i[1]=t[1],i[2]=t[2]}function Hg(t){const i=h.Ellipsoid.WGS84.minimumRadius;return(t+i)/i}const $g=new h.Cartographic,qg=new h.Cartesian3,Mt=[0,0,0],gn=[0,0,0],iu=new h.Cartesian2,nu=new h.Cartesian3;function ou(t,i,e,n,o,s){o.constraintMode="none",jo([0,0,0],o.startDragPos),s=s||{},ui(a.getDomEventCurrentTargetPos(t),iu);const r=e.position;if(!Ie(r,nu))return;const l=Wi(i,nu,n);if(l===void 0||!mc(i,nu,iu,qg)||!se(qg,Mt))return;const c=Hg(Mt[2])*a.geoDistance(r,Mt);if(!s.z&&c<l&&Math.abs(r[2]-Mt[2])<e.dimensions[0]&&Mt[2]>r[2])return o.constraintMode="z",jo(Mt,o.startDragPos),!0;if(!Jo(i,iu,r[2],$g)||!Jn($g,Mt))return;const u=Hg(r[2])*a.geoDistance(r,Mt),d=e.dimensions[0];if(!(u>1.05*d)){if(!s.zAxis&&u>.95*d&&u<=1.05*d){o.constraintMode="zAxis",jo(Mt,o.startDragPos);return}{const[p,f]=eo(r,e.heading+90,Mt,gn);if(!s.x&&p>0&&f&&(gn[2]=r[2],a.geoDistance(gn,Mt)<l)){o.constraintMode="x",jo(gn,o.startDragPos);return}}{const[p,f]=eo(r,e.heading,Mt,gn);if(!s.y&&p>0&&f&&(gn[2]=r[2],a.geoDistance(gn,Mt)<l)){o.constraintMode="y",jo(gn,o.startDragPos);return}}s.xy||(o.constraintMode="xy",jo(Mt,o.startDragPos))}}async function Xg(t,i,e,n){var l;const o=(l=t.viewer)==null?void 0:l.scene;if(!o)throw new Error("!scene");const s=a.getDomEventCurrentTargetPos(i),r=ui(s);if(e===void 0){const c=t.quickPickPosition(s);return c?await c:void 0}else{const c=Jo(o,r,e);return c?Jn(c):void 0}}let su,ru;function Yg(t,i,e,n,o){o=o||new h.Cartesian3,su=su||new h.Ray,ru=ru||new h.Plane(h.Cartesian3.UNIT_X,0);const s=t.camera.getPickRay(n,su),r=h.Plane.fromPointNormal(i,e,ru);return o=h.IntersectionTests.rayPlane(s,r,o),o}function Zg(t){const i=h.Material.fromType(t.type);return au(i,t),i}function It(t){return t&&a.ESSceneObject.context.getStrFromEnv(t)||h.Material.DefaultImageId}function Q_(t){return{x:t[0],y:t[1]}}function au(t,i){i.type==="Color"?t.uniforms.color=te(i.color??[1,1,1,1]):i.type==="PolylineArrow"?t.uniforms.color=te(i.color??[1,1,1,1]):i.type==="PolylineDash"?(t.uniforms.color=te(i.color??[1,1,1,1]),t.uniforms.gapColor=te(i.gapColor??[0,0,0,0]),t.uniforms.dashLength=i.dashLength??16,t.uniforms.dashPattern=i.dashPattern??255):i.type==="PolylineGlow"?(t.uniforms.color=te(i.color??[1,1,1,1]),t.uniforms.glowPower=i.glowPower??.25,t.uniforms.taperPower=i.taperPower??1):i.type==="PolylineOutline"?(t.uniforms.color=te(i.color??[1,1,1,1]),t.uniforms.outlineColor=te(i.outlineColor??[1,0,0,1]),t.uniforms.outlineWidth=i.outlineWidth??1):i.type==="Image"?(t.uniforms.image=It(i.image),t.uniforms.repeat=Pe(i.repeat??[1,1]),t.uniforms.color=te(i.color??[1,1,1,1])):i.type==="DiffuseMap"?(t.uniforms.image=It(i.image),t.uniforms.repeat=Pe(i.repeat??[1,1]),t.uniforms.channels=i.channels??"rgb"):i.type==="AlphaMap"?(t.uniforms.image=It(i.image),t.uniforms.repeat=Pe(i.repeat??[1,1]),t.uniforms.channel=i.channel??"a"):i.type==="SpecularMap"?(t.uniforms.image=It(i.image),t.uniforms.repeat=Pe(i.repeat??[1,1]),t.uniforms.channel=i.channel??"r"):i.type==="EmissionMap"?(t.uniforms.image=It(i.image),t.uniforms.repeat=Pe(i.repeat??[1,1]),t.uniforms.channels=i.channels??"rgb"):i.type==="BumpMap"?(t.uniforms.image=It(i.image),t.uniforms.repeat=Pe(i.repeat??[1,1]),t.uniforms.channel=i.channel??"r",t.uniforms.strength=i.strength??.8):i.type==="NormalMap"?(t.uniforms.image=It(i.image),t.uniforms.repeat=Pe(i.repeat??[1,1]),t.uniforms.channels=i.channels??"rgb",t.uniforms.strength=i.strength??.8):i.type==="Grid"?(t.uniforms.color=te(i.color??[0,1,0,1]),t.uniforms.cellAlpha=i.cellAlpha??.1,t.uniforms.lineCount=Pe(i.lineCount??[8,8]),t.uniforms.lineThickness=Pe(i.lineThickness??[1,1]),t.uniforms.lineOffset=Pe(i.lineOffset??[0,0])):i.type==="Stripe"?(t.uniforms.evenColor=te(i.evenColor??[1,1,1,.5]),t.uniforms.oddColor=te(i.oddColor??[0,0,1,.5]),t.uniforms.horizontal=i.horizontal??!0,t.uniforms.offset=i.offset??0,t.uniforms.repeat=i.repeat??5):i.type==="Checkerboard"?(t.uniforms.lightColor=te(i.lightColor??[1,1,1,.5]),t.uniforms.darkColor=te(i.darkColor??[0,0,0,.5]),t.uniforms.repeat=Pe(i.repeat??[5,5])):i.type==="Dot"?(t.uniforms.lightColor=te(i.lightColor??[1,1,0,.75]),t.uniforms.darkColor=te(i.darkColor??[0,1,1,.75]),t.uniforms.repeat=Pe(i.repeat??[5,5])):i.type==="Water"?(t.uniforms.baseWaterColor=te(i.baseWaterColor??[.2,.3,.6,1]),t.uniforms.blendColor=te(i.blendColor??[0,1,.699,1]),t.uniforms.specularMap=It(i.specularMap),t.uniforms.normalMap=It(i.normalMap),t.uniforms.frequency=i.frequency??10,t.uniforms.animationSpeed=i.animationSpeed??.01,t.uniforms.amplitude=i.amplitude??1,t.uniforms.specularIntensity=i.specularIntensity??.5,t.uniforms.fadeFactor=i.fadeFactor??1):i.type==="RimLighting"?(t.uniforms.color=te(i.color??[1,0,0,.7]),t.uniforms.rimColor=te(i.rimColor??[1,1,1,.4]),t.uniforms.width=i.width??.3):i.type==="Fade"?(t.uniforms.fadeInColor=te(i.fadeInColor??[1,0,0,1]),t.uniforms.fadeOutColor=te(i.fadeOutColor??[0,0,0,0]),t.uniforms.maximumDistance=i.maximumDistance??.5,t.uniforms.repeat=i.repeat??!0,t.uniforms.fadeDirection=Q_(i.fadeDirection??[!0,!0]),t.uniforms.time=Pe(i.time??[.5,.5])):i.type==="ElevationContour"?(t.uniforms.color=te(i.color??[1,0,0,1]),t.uniforms.spacing=i.spacing??100,t.uniforms.width=i.width??1):i.type==="ElevationRamp"?(t.uniforms.image=It(i.image),t.uniforms.minimumHeight=i.minimumHeight??0,t.uniforms.maximumHeight=i.maximumHeight??1e4):i.type==="AspectRamp"?t.uniforms.image=It(i.image):i.type==="ElevationBand"?(t.uniforms.color=It(i.colors),t.uniforms.heights=It(i.heights)):i.type==="XbsjPolylineArrow"?(t.uniforms.color=te(i.color??[1,1,1,1]),t.uniforms.image=It(i.image),t.uniforms.repeat=i.repeat??60,t.uniforms.speed=i.speed??1,t.uniforms.lineLength=i.lineLength??1):console.warn(`未知材质类型,无法更新 ${i.type}`)}function di(t,i){const e=a.react(void 0);let n="";const[o,s,r]=a.getReactFuncs(t),l=()=>{try{const c=o()??i;c?n!==c.type?(n=c.type,e.value=Zg(c)):e.value&&au(e.value,c):(n="",e.value=void 0)}catch{}};return l(),e.dispose(r.disposableOn(l)),e}function Gi(t,i=!1){const e=pt(t.positions,i),n=t.holes&&t.holes.map(o=>Gi(o));return{positions:e,holes:n}}function lu(t,i){const e=Math.PI/180,n=1/e,o=new h.Cartographic(t[0]*e,t[1]*e,t[2]),s=new h.Cartographic(i[0]*e,i[1]*e,i[2]),r=new h.EllipsoidGeodesic(o,s).interpolateUsingFraction(.5,new h.Cartographic);if(r)return r.height=(o.height+s.height)*.5,[r.longitude*n,r.latitude*n,r.height]}const Qg=new h.Cartesian4,k_=new h.Matrix4;function K_(){return{left:0,top:0,right:0,bottom:0,depth:0}}function kg(t,i){return t.left===i.left&&t.right===i.right&&t.bottom===i.bottom&&t.top===i.top&&t.depth===i.depth}function Kg(t,i,e){if(t.scene.mode!==h.SceneMode.SCENE3D)return;const n=t.canvas.clientHeight,o=t.canvas.clientWidth,s=t.camera.viewMatrix,r=t.camera.frustum.projectionMatrix,l=h.Matrix4.multiply(r,s,k_),c=h.Matrix4.multiplyByVector(l,h.Cartesian4.fromElements(i.x,i.y,i.z,1,Qg),Qg);c.x/=c.w,c.y/=c.w,c.z/=c.w,c.w=1;const u=o*(c.x*.5+.5),d=n*(c.y*.5+.5),p=o-u,f=n-d,g=c.z;if(!(u<0||d<0||p<0||f<0||g<0||g>1))return e?(e.left=u,e.top=f,e.right=p,e.bottom=d,e.depth=g):e={left:u,top:f,right:p,bottom:d,depth:g},e}const to={left:0,top:0,right:0,bottom:0,depth:0};class vc extends a.Destroyable{constructor(e,n=!0,o){super();m(this,"_cartesian",new h.Cartesian3);m(this,"_winPos",{left:0,top:0,right:0,bottom:0,depth:0});m(this,"_winPosValid",!1);m(this,"_changedEvent",new a.Event);m(this,"_enabled",!0);this._viewer=e,o=o||this.disposeVar(new gc(this._viewer.scene)),this.dispose(o.changed.disposableOn(()=>this._updateWinPos())),this.dispose(()=>{this._changedEvent.empty||console.warn("WinPosFromCartesian需要销毁,但是changed事件仍有监听,代码未必有错,但是说明代码不严谨。")}),this.enabled=n}get enabled(){return this._enabled}set enabled(e){this._enabled!==e&&(this._enabled=e,e&&this._updateWinPos())}_updateWinPos(){if(!this._enabled)return;let e=!1;const n=Kg(this._viewer,this._cartesian,to);!!n!==this._winPosValid&&(e=!0,this._winPosValid=!!n),this._winPosValid?kg(this._winPos,to)||(e=!0,this._winPos.left=to.left,this._winPos.top=to.top,this._winPos.right=to.right,this._winPos.bottom=to.bottom,this._winPos.depth=to.depth):(e=!0,this._winPos.left=Number.NaN,this._winPos.top=Number.NaN,this._winPos.right=Number.NaN,this._winPos.bottom=Number.NaN,this._winPos.depth=Number.NaN),e&&this._changedEvent.emit(this._winPosValid,this._winPos)}get cartesian(){return this._cartesian}set cartesian(e){h.Cartesian3.equals(this._cartesian,e)||(h.Cartesian3.clone(e,this._cartesian),this._updateWinPos())}get changed(){return this._changedEvent}get winPosValid(){return this._winPosValid}get winPos(){return this._winPos}}function Jg(t){const i=h.Math.toRadians(t[0]),e=h.Math.toRadians(t[1]),n=h.Math.toRadians(t[2]),o=h.Matrix3.fromHeadingPitchRoll(new h.HeadingPitchRoll(i,e,n)),s=new h.Cartesian3;return h.Matrix3.multiplyByVector(o,h.Cartesian3.UNIT_X,s),[s.x,s.y,s.z]}const J_=h.Check,io=h.defined,jg=h.Math.EPSILON10;function j_(t,i,e,n){if(J_.defined("equalsEpsilon",i),!io(t))return;e=e??!1;const o=io(n),s=t.length;if(s<2)return t;let r,l=t[0],c,u,d=0,p=-1;for(r=1;r<s;++r)c=t[r],i(l,c,jg)?(io(u)||(u=t.slice(0,r),d=r-1,p=0),o&&n.push(r)):(io(u)&&(u.push(c),d=r,o&&(p=n.length)),l=c);return e&&i(t[0],t[s-1],jg)&&(o&&(io(u)?n.splice(p,0,d):n.push(s-1)),io(u)?u.length-=1:u=t.slice(0,-1)),io(u)?u:t}const ge=h.Cartesian3,es=h.Cartographic,no=h.defined,em=h.DeveloperError,tm=h.Ellipsoid,e1=h.EllipsoidGeodesic,im=h.EllipsoidRhumbLine,t1=h.IntersectionTests,cu=h.Math,ts=h.Matrix4,oo=h.Plane,Ke={};Ke.numberOfPoints=function(t,i,e){const n=ge.distance(t,i);return Math.ceil(n/e)},Ke.numberOfPointsRhumbLine=function(t,i,e){const n=Math.pow(t.longitude-i.longitude,2)+Math.pow(t.latitude-i.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(n/(e*e))))};const i1=new es;Ke.extractHeights=function(t,i){const e=t.length,n=new Array(e);for(let o=0;o<e;o++){const s=t[o];n[o]=i.cartesianToCartographic(s,i1).height}return n};const n1=new ts,o1=new ge,nm=new ge,s1=new oo(ge.UNIT_X,0),om=new ge,r1=new oo(ge.UNIT_X,0),a1=new ge,l1=new ge,hu=[];function sm(t,i,e){const n=hu;n.length=t;let o;if(i===e){for(o=0;o<t;o++)n[o]=i;return n}const r=(e-i)/t;for(o=0;o<t;o++){const l=i+o*r;n[o]=l}return n}const yc=new es,wc=new es,mn=new ge,uu=new ge,c1=new ge,du=new e1;let _r=new im;function h1(t,i,e,n,o,s,r,l){const c=n.scaleToGeodeticSurface(t,uu),u=n.scaleToGeodeticSurface(i,c1),d=Ke.numberOfPoints(t,i,e),p=n.cartesianToCartographic(c,yc),f=n.cartesianToCartographic(u,wc),g=sm(d,o,s);du.setEndPoints(p,f);const v=du.surfaceDistance/d;let y=l;p.height=o;let w=n.cartographicToCartesian(p,mn);ge.pack(w,r,y),y+=3;for(let P=1;P<d;P++){const C=du.interpolateUsingSurfaceDistance(P*v,wc);C.height=g[P],w=n.cartographicToCartesian(C,mn),ge.pack(w,r,y),y+=3}return y}function u1(t,i,e,n,o,s,r,l){const c=n.cartesianToCartographic(t,yc),u=n.cartesianToCartographic(i,wc),d=Ke.numberOfPointsRhumbLine(c,u,e);c.height=0,u.height=0;const p=sm(d,o,s);_r.ellipsoid.equals(n)||(_r=new im(void 0,void 0,n)),_r.setEndPoints(c,u);const f=_r.surfaceDistance/d;let g=l;c.height=o;let v=n.cartographicToCartesian(c,mn);ge.pack(v,r,g),g+=3;for(let y=1;y<d;y++){const w=_r.interpolateUsingSurfaceDistance(y*f,wc);w.height=p[y],v=n.cartographicToCartesian(w,mn),ge.pack(v,r,g),g+=3}return g}Ke.wrapLongitude=function(t,i){const e=[],n=[];if(no(t)&&t.length>0){i=i??ts.IDENTITY;const o=ts.inverseTransformation(i,n1),s=ts.multiplyByPoint(o,ge.ZERO,o1),r=ge.normalize(ts.multiplyByPointAsVector(o,ge.UNIT_Y,nm),nm),l=oo.fromPointNormal(s,r,s1),c=ge.normalize(ts.multiplyByPointAsVector(o,ge.UNIT_X,om),om),u=oo.fromPointNormal(s,c,r1);let d=1;e.push(ge.clone(t[0]));let p=e[0];const f=t.length;for(let g=1;g<f;++g){const v=t[g];if(oo.getPointDistance(u,p)<0||oo.getPointDistance(u,v)<0){const y=t1.lineSegmentPlane(p,v,l,a1);if(no(y)){const w=ge.multiplyByScalar(r,5e-9,l1);oo.getPointDistance(l,p)<0&&ge.negate(w,w),e.push(ge.add(y,w,new ge)),n.push(d+1),ge.negate(w,w),e.push(ge.add(y,w,new ge)),d=1}}e.push(ge.clone(t[g])),d++,p=v}n.push(d)}return{positions:e,lengths:n}},Ke.generateArc=function(t){no(t)||(t={});const i=t.positions;if(!no(i))throw new em("options.positions is required.");const e=i.length,n=t.ellipsoid??tm.WGS84;let o=t.height??0;const s=Array.isArray(o);if(e<1)return[];if(e===1){const y=n.scaleToGeodeticSurface(i[0],uu);if(o=s?o[0]:o,o!==0){const w=n.geodeticSurfaceNormal(y,mn);ge.multiplyByScalar(w,o,w),ge.add(y,w,y)}return[y.x,y.y,y.z]}let r=t.minDistance;if(!no(r)){const y=t.granularity??cu.RADIANS_PER_DEGREE;r=cu.chordLength(y,n.maximumRadius)}let l=0,c;for(c=0;c<e-1;c++)l+=Ke.numberOfPoints(i[c],i[c+1],r);const u=(l+1)*3,d=new Array(u);let p=0;for(c=0;c<e-1;c++){const y=i[c],w=i[c+1],P=s?o[c]:o,C=s?o[c+1]:o;p=h1(y,w,r,n,P,C,d,p)}hu.length=0;const f=i[e-1],g=n.cartesianToCartographic(f,yc);g.height=s?o[e-1]:o;const v=n.cartographicToCartesian(g,mn);return ge.pack(v,d,u-3),d};const rm=new es,d1=new es;Ke.generateRhumbArc=function(t){no(t)||(t={});const i=t.positions;if(!no(i))throw new em("options.positions is required.");const e=i.length,n=t.ellipsoid??tm.WGS84;let o=t.height??0;const s=Array.isArray(o);if(e<1)return[];if(e===1){const P=n.scaleToGeodeticSurface(i[0],uu);if(o=s?o[0]:o,o!==0){const C=n.geodeticSurfaceNormal(P,mn);ge.multiplyByScalar(C,o,C),ge.add(P,C,P)}return[P.x,P.y,P.z]}const r=t.granularity??cu.RADIANS_PER_DEGREE;let l=0,c,u=n.cartesianToCartographic(i[0],rm),d;for(c=0;c<e-1;c++)d=n.cartesianToCartographic(i[c+1],d1),l+=Ke.numberOfPointsRhumbLine(u,d,r),u=es.clone(d,rm);const p=(l+1)*3,f=new Array(p);let g=0;for(c=0;c<e-1;c++){const P=i[c],C=i[c+1],S=s?o[c]:o,x=s?o[c+1]:o;g=u1(P,C,r,n,S,x,f,g)}hu.length=0;const v=i[e-1],y=n.cartesianToCartographic(v,yc);y.height=s?o[e-1]:o;const w=n.cartographicToCartesian(y,mn);return ge.pack(w,f,p-3),f},Ke.generateCartesianArc=function(t){const i=Ke.generateArc(t),e=i.length/3,n=new Array(e);for(let o=0;o<e;o++)n[o]=ge.unpack(i,o*3);return n},Ke.generateCartesianRhumbArc=function(t){const i=Ke.generateRhumbArc(t),e=i.length/3,n=new Array(e);for(let o=0;o<e;o++)n[o]=ge.unpack(i,o*3);return n};const Cc=h.ArcType,p1=h.Cartesian3,f1=h.Math;function am(t){const i=t.arcType,e=t.granularity,n=t.ellipsoid,o=[];let s=j_(t.positions,p1.equalsEpsilon,!1,o);if(!(s.length<2)){if(i===Cc.GEODESIC||i===Cc.RHUMB){let l;i===Cc.GEODESIC?(l=f1.chordLength(e,n.maximumRadius),Ke.numberOfPoints):(l=e,Ke.numberOfPointsRhumbLine);const c=Ke.extractHeights(s,n);i===Cc.GEODESIC?s=Ke.generateCartesianArc({positions:s,minDistance:l,ellipsoid:n,height:c}):s=Ke.generateCartesianRhumbArc({positions:s,granularity:l,ellipsoid:n,height:c})}return s}}function pu(t,i="GEODESIC",e){const o=t.map(a.lbhToXyz).map(p=>h.Cartesian3.fromArray(p));let s;if(e>0&&i!=="NONE"){if(s=am({arcType:h.ArcType[i??"GEODESIC"],granularity:e,ellipsoid:h.Ellipsoid.WGS84,positions:o}),!s)return}else s=o;let r=0;const l=[0],c=s.length;for(let p=1;p<c;++p)r+=h.Cartesian3.distance(s[p-1],s[p]),l.push(r);const u=s.map(p=>a.xyzToLbh([p.x,p.y,p.z]));return{timePosRots:l.map((p,f)=>[l[f],u[f],void 0]),distances:l}}function lm(t,i){i=i??new Array(16);for(let e=0;e<16;++e)i[e]=t[e];return i}function fu(t,i){const e=h.Matrix4.clone(h.Matrix4.IDENTITY),{position:n,rotation:o,scale:s,initialRotationMode:r="YForwardZUp"}=t;if(n){const[l,c,u]=n;h.Transforms.eastNorthUpToFixedFrame(h.Cartesian3.fromDegrees(l,c,u),void 0,e)}if(o){const l=new h.Quaternion;r==="YForwardZUp"?fc(o,l):r==="XForwardZUp"&&Vg(o,l);const c=h.Matrix3.fromQuaternion(l);h.Matrix4.multiply(e,h.Matrix4.fromRotationTranslation(c),e)}return s&&h.Matrix4.multiplyByScale(e,ui(s),e),lm(e,i)}const g1=new h.Matrix4;function cm(t,i){const e=h.Matrix4.fromArray(t,0,g1);return h.Matrix4.inverse(e,e),lm(e,i)}const m1=new h.Matrix4,v1=new h.Cartesian3;function hm(t,i,e){const[n,o,s]=i,r=h.Cartesian3.fromDegrees(n,o,s,void 0,v1),l=h.Matrix4.fromArray(t,0,m1),c=h.Matrix4.multiplyByPoint(l,r,r),{x:u,y:d,z:p}=c;return e=e||[0,0,0],e[0]=u,e[1]=d,e[2]=p,e}const y1=new h.Matrix4,w1=new h.Cartesian3,C1=new h.Cartographic;function vn(t,i,e){const[n,o,s]=i,r=h.Cartesian3.fromElements(n,o,s,w1),l=h.Matrix4.fromArray(t,0,y1),c=h.Matrix4.multiplyByPoint(l,r,r),u=h.Cartographic.fromCartesian(c,void 0,C1);return e=e||[0,0,0],e[0]=h.Math.toDegrees(u.longitude),e[1]=h.Math.toDegrees(u.latitude),e[2]=u.height,e}function Dt(t,i){const{originPosition:e,originRotation:n,originScale:o,initialRotationMode:s}=t,r=fu({position:e,rotation:n,scale:o,initialRotationMode:s}),l=cm(r);return[i.map(u=>hm(l,u)),r,l]}function yn(t,i){const{originPosition:e,originRotation:n,originScale:o,initialRotationMode:s}=t,r=fu({position:e,rotation:n,scale:o,initialRotationMode:s});return[i.map(c=>vn(r,c)),r]}function um(t){if(t.length<2)return console.error("getIncludedAngleFromPositions需要传入的点不能少于三个!!!!!"),!1;let i=[];for(let e=0;e<t.length-2;e++){const n=ye.Cartesian3.fromDegrees(...t[e]),o=ye.Cartesian3.fromDegrees(...t[e+1]),s=ye.Cartesian3.fromDegrees(...t[e+2]),r=ye.Cartesian3.angleBetween(ye.Cartesian3.subtract(n,o,new ye.Cartesian3),ye.Cartesian3.subtract(s,o,new ye.Cartesian3));i.push(isNaN(r)?0:ye.Math.toDegrees(r))}return i}function gu(t,i){let e=i||[];return t.positions&&(e[e.length]??(e[e.length]=[]),e[e.length-1].push(...t.positions.map(n=>se(n)))),t.holes&&t.holes.forEach(n=>{e=gu(n,e)}),e}function $t(t){return typeof t=="string"?a.ESSceneObject.context.getStrFromEnv(t):new h.Resource({url:a.ESSceneObject.context.getStrFromEnv(t.url),headers:t.headers,queryParameters:t.queryParameters,templateValues:t.templateValues,proxy:t.proxy,retryCallback:t.retryCallback,retryAttempts:t.retryAttempts,request:t.request,parseUrl:t.parseUrl})}class mu extends a.Destroyable{constructor(i,e,n,o){if(super(),!i.viewer)return;const{scene:s}=i.viewer,[r,l,c]=a.getReactFuncs(e),[u,d,p]=a.getReactFuncs(n),f=new h.Cartesian3,g=()=>{let v=r();v&&(v=[...v],i.editingHeightOffset&&(v[2]-=i.editingHeightOffset),h.Cartesian3.fromDegrees(...v,void 0,f))};g(),this.dispose(c.disposableOn(g)),this.dispose(s.preUpdate.addEventListener(()=>{if(h.Cartesian3.ZERO.equals(f))return;const v=Wi(s,f,o);v!==void 0?d([v,v,v]):console.warn(`CzmGeoCoordinatesEditor warn: scale: ${v??"undefined"}`)}))}}function _1(t){const i=Reflect.has(t.root,"transform")?t.root.transform:h.Matrix4.toArray(h.Matrix4.IDENTITY);let e,n,o,s;if(Reflect.has(t.root.boundingVolume,"region"))return t.root.boundingVolume.region;if(Reflect.has(t.root.boundingVolume,"box"))s=h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(0,3)),e=h.Cartesian3.add(s,h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(3,6)),new h.Cartesian3),n=h.Cartesian3.add(s,h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(6,9)),new h.Cartesian3),o=h.Cartesian3.add(s,h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(9,12)),new h.Cartesian3);else if(Reflect.has(t.root.boundingVolume,"sphere")){const f=t.root.boundingVolume.sphere[3];s=h.Cartesian3.fromArray(t.root.boundingVolume.sphere.slice(0,3)),e=h.Cartesian3.add(s,h.Cartesian3.fromArray([f,0,0]),new h.Cartesian3),n=h.Cartesian3.add(s,h.Cartesian3.fromArray([0,f,0]),new h.Cartesian3),o=h.Cartesian3.add(s,h.Cartesian3.fromArray([0,0,f]),new h.Cartesian3)}if(!e||!n||!o||!s)return"无法生成包围盒,请检查包围盒是否正确";let r,l,c,u,d,p;return h.Matrix4.IDENTITY.equals(h.Matrix4.fromArray(i))?(r=se(e),u=se(h.Cartesian3.add(s,h.Cartesian3.subtract(s,e,new h.Cartesian3),new h.Cartesian3)),l=se(n),d=se(h.Cartesian3.add(s,h.Cartesian3.subtract(s,n,new h.Cartesian3),new h.Cartesian3)),c=se(o),p=se(h.Cartesian3.add(s,h.Cartesian3.subtract(s,o,new h.Cartesian3),new h.Cartesian3))):(r=vn(i,[e.x,e.y,e.z]),u=vn(i,[-e.x,-e.y,-e.z]),l=vn(i,[n.x,n.y,n.z]),d=vn(i,[-n.x,-n.y,-n.z]),c=vn(i,[o.x,o.y,o.z]),p=vn(i,[-o.x,-o.y,-o.z])),!r||!u||!l||!d||!c||!p?"无法生成包围盒,请检查包围盒是否正确":[h.Math.toRadians(Math.min(r[0],u[0],l[0],d[0],c[0],p[0])),h.Math.toRadians(Math.min(r[1],u[1],l[1],d[1],c[1],p[1])),h.Math.toRadians(Math.max(r[0],u[0],l[0],d[0],c[0],p[0])),h.Math.toRadians(Math.max(r[1],u[1],l[1],d[1],c[1],p[1])),Math.min(r[2],u[2],l[2],d[2],c[2],p[2]),Math.max(r[2],u[2],l[2],d[2],c[2],p[2])]}const dm=a.createProcessingFromAsyncFunc(async(t,i)=>{let e={state:"success",tilesUrl:{asset:{version:"1.1"},geometricError:0,refine:"REPLACE",root:{boundingVolume:{region:[]},geometricError:0,refine:"REPLACE",children:[]}}},n={},o=[];if(await a.step(t,async c=>new Promise(async(u,d)=>{for(let p=0;p<i.length;p++){const f=i[p];await fetch(f).then(g=>g.json()).then(g=>{g&&!Reflect.has(g,"success")?n[f]=g:o.push({index:p,url:f,message:g.message}),p==i.length-1&&u()}).catch(g=>{o.push({index:p,url:f,message:g}),p==i.length-1&&u()})}})),o.length>0&&(e.state="error",e.info=o,o.length==i.length))return e.tilesUrl=void 0,e;const s=[],r=[],l=[];for(const c in n){const u=n[c];r.push(u.geometricError??u.root.geometricError??0);const d=_1(u);s.push(d),l.push({content:{uri:c},boundingVolume:{region:d},geometricError:u.geometricError,refine:"REPLACE"})}return e.tilesUrl&&(e.tilesUrl.geometricError=e.tilesUrl.root.geometricError=Math.max(...r),e.tilesUrl.root.boundingVolume.region=[Math.min(...s.map(c=>c[0])),Math.min(...s.map(c=>c[1])),Math.max(...s.map(c=>c[2])),Math.max(...s.map(c=>c[3])),Math.min(...s.map(c=>c[4])),Math.max(...s.map(c=>c[5]))],e.tilesUrl.root.children=l),e});function P1(t){return new Promise((i,e)=>{dm.restart(void 0,t),dm.completeEvent.don(n=>{i(n)})})}class vu extends a.Destroyable{constructor(e){super();m(this,"_center",this.disposeVar(a.reactArrayWithUndefined(void 0)));m(this,"_radius",this.disposeVar(a.react(0)));const[n,o,s]=a.getReactFuncs(e);{const r=()=>{const l=n();if(l){const{center:c,minPos:u,maxPos:d}=a.getMinMaxCorner(l);this._center.value=c,this._radius.value=a.geoDistance(u,d)/2}else this._center.value=void 0};r(),this.dispose(s.disposableOn(r))}}get centerReact(){return this._center}get center(){return this._center.value}get centerChanged(){return this._center.changed}get radiusReact(){return this._radius}get radius(){return this._radius.value}get radiusChanged(){return this._radius.changed}}function pm(t){return new h.Material({fabric:{type:"XbsjWater",uniforms:{baseWaterImage:"",repeatX:1,repeatY:1,flowSpeed:0,baseWaterColor:new h.Color(.2,.3,.6,1),blendColor:new h.Color(0,1,.699,1),specularMap:h.Material.DefaultImageId,normalMap:h.Material.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1,...t},source:`// Thanks for the contribution Jonas
1
+ (function(M,ye){typeof exports=="object"&&typeof module<"u"?ye(exports,require("cesium"),require("earthsdk3"),require("html2canvas"),require("mvt-basic-render"),require("delaunator"),require("earcut"),require("pbf"),require("@mapbox/vector-tile")):typeof define=="function"&&define.amd?define(["exports","cesium","earthsdk3","html2canvas","mvt-basic-render","delaunator","earcut","pbf","@mapbox/vector-tile"],ye):(M=typeof globalThis<"u"?globalThis:M||self,ye(M.EarthSDK3_Cesium={},M.Cesium,M.EarthSDK3,M.html2canvas,M.Mapbox,M.Delaunator,M.earcut,M.Pbf,M.vectorTile))})(this,function(M,ye,a,Jh,d_,p_,f_,g_,m_){"use strict";var X4=Object.defineProperty;var Y4=(M,ye,a)=>ye in M?X4(M,ye,{enumerable:!0,configurable:!0,writable:!0,value:a}):M[ye]=a;var m=(M,ye,a)=>Y4(M,typeof ye!="symbol"?ye+"":ye,a);var ko=typeof document<"u"?document.currentScript:null;function Lg(t){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(i,e,n.get?n:{enumerable:!0,get:()=>t[e]})}}return i.default=t,Object.freeze(i)}const h=Lg(ye),v_=Lg(d_);window.Cesium=h;function y_(){Object.keys(h).forEach(t=>{h[t].prototype&&Object.defineProperty(h[t].prototype,"ESSceneObjectID",{writable:!0,enumerable:!0,value:a.createGuid()})})}fetch("https://corsproxy.io/?https://gitee.com/mirrors/CesiumJS/raw/main/packages/engine/Source/Core/Ion.js").then(t=>t.text()).then(t=>{const i=t.match(/defaultAccessToken\s*=\s*["'`](.*?)["'`]/);i&&(h.Ion.defaultAccessToken=i[1],console.log("更新默认Cesium.Ion.Token成功"))});const ma=class ma extends a.Destroyable{};m(ma,"defaults",{enabled:!0}),m(ma,"createDefaultProps",()=>({...ma.defaults}));let Gt=ma;a.extendClassProps(Gt.prototype,Gt.createDefaultProps);class jt extends a.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(i.flyToEvent.don((o,s,r)=>this.flyTo(o,s,r))),this.d(i.flyInEvent.don((o,s,r)=>this.flyIn(o,s,r))),this.dispose(i.calcFlyInParamEvent.disposableOn(()=>{if(!e.actived)return;const o=e.getCameraInfo();if(!o)return;const{position:s,rotation:r}=o;i.flyInParam={position:s,rotation:r,flyDuration:1}})),this.dispose(i.calcFlyToParamEvent.disposableOn(()=>{i.useCalcFlyToParamInESObjectWithLocation||console.warn("calcFlyToParam无法调用,该对象缺少position属性!")}))}flyToWithPromise(i,e,n,o,s,r,l,c="default"){const{sceneObject:u,czmViewer:d}=this,p=d.flyTo({distance:n??0,heading:o?o[0]:0,pitch:o?o[1]:0,flyDuration:s??1,hDelta:r??0,pDelta:l??0},e,c);p&&p.then(f=>{})}flyTo(i,e,n="default"){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam&&(o.useCalcFlyToParamInESObjectWithLocation||console.warn("flyToParam无法使用,该对象缺少position属性,若飞行失败,请清空flyToParam后重试!")),o.flyInParam){const{position:r,rotation:l,flyDuration:c}=o.flyInParam,u=i??c;return this.flyToWithPromise(e,r,void 0,l,u,void 0,void 0,n),!0}return!1}flyIn(i,e,n="default"){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyInParam){const{position:r,rotation:l,flyDuration:c}=o.flyInParam,u=i??c;return this.flyToWithPromise(e,r,void 0,l,u,void 0,void 0,n),!0}return!1}get czmViewer(){return this.viewer}}function Ie(t,i){return h.Cartesian3.fromDegrees(...t,void 0,i)}const w_=new h.Cartographic;function se(t,i){const e=h.Cartographic.fromCartesian(t,void 0,w_);if(e)return i=i||[0,0,0],i[0]=h.Math.toDegrees(e.longitude),i[1]=h.Math.toDegrees(e.latitude),i[2]=e.height,i}function Pe(t,i){return i=i||new h.Cartesian2,i.x=t[0],i.y=t[1],i}function Og(t,i){return i=i||[0,0],i[0]=t.x,i[1]=t.y,i}function hi(t,i){return i=i||new h.Cartesian3,i.x=t[0],i.y=t[1],i.z=t[2],i}function vr(t,i){return i=i||[0,0,0],i[0]=t.x,i[1]=t.y,i[2]=t.z,i}function jh(t,i){return i=i||new h.Cartesian4,i.x=t[0],i.y=t[1],i.z=t[2],i.w=t[3],i}function Ng(t,i){return i=i||[0,0,0,0],i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w,i}function ui(t,i){if(t.length===4)return jh(t,i);if(t.length===3)return hi(t,i);if(t.length===2)return Pe(t,i);throw new Error("toCartesian error: should not be here!")}function C_(t,i){if(t instanceof h.Cartesian2)return Og(t,i);if(t instanceof h.Cartesian3)return vr(t,i);if(t instanceof h.Cartesian4)return Ng(t,i);throw new Error("fromCartesian error: should not be here!")}function __(t,i){return i=i||new h.Cartographic,i.longitude=h.Math.toRadians(t[0]),i.latitude=h.Math.toRadians(t[1]),i.height=t[2],i}function Jn(t,i){return i=i||[0,0,0],i[0]=h.Math.toDegrees(t.longitude),i[1]=h.Math.toDegrees(t.latitude),i[2]=t.height,i}function te(t,i){return i=i||new h.Color,i.red=t[0],i.green=t[1],i.blue=t[2],i.alpha=t[3],i}function P_(t,i){return i=i||[0,0,0,0],i[0]=t.red,i[1]=t.green,i[2]=t.blue,i[3]=t.alpha,i}function dn(t,i){return i=i||new h.NearFarScalar,i.near=t[0],i.nearValue=t[1],i.far=t[2],i.farValue=t[3],i}function b_(t,i){return i=i||[0,0,0,0],i[0]=t.near,i[1]=t.nearValue,i[2]=t.far,i[3]=t.farValue,i}function Bg(t,i){return i=i||new h.HeadingPitchRoll,i.heading=h.Math.toRadians(t[0]-90),i.pitch=h.Math.toRadians(t[1]),i.roll=h.Math.toRadians(t[2]),i}function S_(t,i){return i=i||[0,0,0],i[0]=h.Math.toDegrees(t.heading+h.Math.PI_OVER_TWO),i[1]=h.Math.toDegrees(t.pitch),i[2]=h.Math.toDegrees(t.roll),i}function yr(t,i){return i=i||new h.DistanceDisplayCondition,i.near=t[0],i.far=t[1],i}function E_(t,i){return i=i||[0,0],i[0]=t.near,i[1]=t.far,i}function x_(t,i){return i=i||new h.Quaternion,i.x=t[0],i.y=t[1],i.z=t[2],i.w=t[3],i}function A_(t,i){return i=i||[0,0,0,0],i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w,i}const T_=new h.HeadingPitchRoll,M_=new h.Cartesian3;function I_(t,i,e){const n=Bg(i,T_),o=Ie(t,M_);return h.Transforms.headingPitchRollQuaternion(o,n,void 0,void 0,e)}function Ue(t,i){return i=i||new h.Rectangle,i.west=t[0]*Math.PI/180,i.south=t[1]*Math.PI/180,i.east=t[2]*Math.PI/180,i.north=t[3]*Math.PI/180,i}function D_(t,i){return i=i||[0,0,0,0],i[0]=t.west,i[1]=t.south,i[2]=t.east,i[3]=t.north,i}const R_=new h.Cartesian3;function we(t,i){return i=i||new h.Ellipsoid,h.Ellipsoid.fromCartesian3(h.Cartesian3.fromArray(t,void 0,R_),i)}function F_(t,i){return i=i||[0,0,0],i[0]=t.radii.x,i[1]=t.radii.y,i[2]=t.radii.z,i}function wi(t){if(t.type==="GeographicTilingScheme")return new h.GeographicTilingScheme({ellipsoid:t.ellipsoid&&we(t.ellipsoid),rectangle:t.rectangle&&Ue(t.rectangle),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY});if(t.type==="WebMercatorTilingScheme")return new h.WebMercatorTilingScheme({ellipsoid:t.ellipsoid&&we(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Pe(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Pe(t.rectangleNortheastInMeters)});if(t.type==="ToGCJ02WebMercatorTilingScheme")return new ey({ellipsoid:t.ellipsoid&&we(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Pe(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Pe(t.rectangleNortheastInMeters)});if(t.type==="ToWGS84WebMercatorTilingScheme")return new ty({ellipsoid:t.ellipsoid&&we(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Pe(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Pe(t.rectangleNortheastInMeters)});console.warn(`未能识别的类型tilingSchemaJson.type: ${t.type}`)}function wr(t,i){const{planes:e,enabled:n,modelMatrix:o,unionClippingRegions:s,edgeColor:r,edgeWidth:l}=t;let c=o&&h.Matrix4.fromArray(o);return i&&(c=c||h.Matrix4.clone(h.Matrix4.IDENTITY,new h.Matrix4),h.Matrix4.multiply(i,c,c)),new h.ClippingPlaneCollection({planes:e&&e.map(u=>new h.ClippingPlane(hi(u.normal),u.distance)),enabled:n,modelMatrix:c,unionClippingRegions:s,edgeColor:r&&te(r),edgeWidth:l})}function dc(t,i,e){const n=i;if(!n){t.removeAll(),t.enabled=!1;return}if(t.removeAll(),n.planes)for(let s of n.planes)t.add(new h.ClippingPlane(hi(s.normal),s.distance));let o=n.modelMatrix&&h.Matrix4.fromArray(n.modelMatrix)||h.Matrix4.clone(h.Matrix4.IDENTITY,new h.Matrix4);e&&h.Matrix4.multiply(e,o,o),t.enabled=n.enabled??!0,t.modelMatrix=o,t.unionClippingRegions=n.unionClippingRegions??!1,t.edgeColor=te(n.edgeColor??[1,1,1,1]),t.edgeWidth=n.edgeWidth??2}function pc(t){const{polygons:i,enabled:e,inverse:n}=t;return new h.ClippingPolygonCollection({polygons:i&&i.map(o=>new h.ClippingPolygon({positions:o.positions.map(s=>Ie(s))})),enabled:e,inverse:n})}function fc(t,i){return eu(t,h.Cartesian3.UNIT_Y,h.Cartesian3.UNIT_Z,h.Cartesian3.UNIT_X,i)}function Vg(t,i){return eu(t,h.Cartesian3.UNIT_X,h.Cartesian3.UNIT_Z,new h.Cartesian3(0,-1,0),i)}function eu(t,i,e,n,o){const[s,r,l]=t,c=h.Quaternion.fromAxisAngle(e,h.Math.toRadians(-s)),u=h.Quaternion.fromAxisAngle(n,h.Math.toRadians(r)),d=h.Quaternion.fromAxisAngle(i,h.Math.toRadians(l)),p=h.Quaternion.clone(h.Quaternion.IDENTITY,o);return h.Quaternion.multiply(d,p,p),h.Quaternion.multiply(u,p,p),h.Quaternion.multiply(c,p,p),p}function pn(t,i){return Array.isArray(t)?t.length!==i?(console.warn(`array.length !== ${i}`),!1):t.every(e=>Number.isFinite(e))?!0:(console.warn("!array.every(v => Number.isFinite(v))"),!1):(console.warn("!Array.isArray(array)"),!1)}function Ug(t){return t.some(i=>i===0)?(console.warn("array.some(e => e === 0)"),!1):!0}function Fe(t,i){if(!((!t.localScale||pn(t.localScale,3))&&(!t.localRotation||pn(t.localRotation,3))&&(!t.localPosition||pn(t.localPosition,3))&&(!t.localModelMatrix||pn(t.localModelMatrix,16))&&(!t.scale||pn(t.scale,3))&&(!t.rotation||pn(t.rotation,3))&&(!t.position||pn(t.position,3))&&(!t.modelMatrix||pn(t.modelMatrix,16)))||t.localScale&&!Ug(t.localScale)||t.scale&&!Ug(t.scale))return;if(t.sceneScaleFromPixelSize){if(!Number.isFinite(t.sceneScaleFromPixelSize)){console.warn("!Number.isFinite(options.sceneScaleFromPixelSize)");return}if(t.sceneScaleFromPixelSize===0){console.warn("options.sceneScaleFromPixelSize === 0");return}}const n=i??h.Matrix4.clone(h.Matrix4.IDENTITY);if(t.localScale){const[o,s,r]=t.localScale??[1,1,1],l=h.Matrix4.fromScale(h.Cartesian3.fromElements(o,s,r),new h.Matrix4);h.Matrix4.multiply(l,n,n)}if((t.initialRotation??"yForwardzUp")==="xForwardzUp"){const o=h.Quaternion.fromAxisAngle(h.Cartesian3.UNIT_Z,h.Math.toRadians(90)),s=h.Matrix3.fromQuaternion(o);h.Matrix4.multiply(h.Matrix4.fromRotationTranslation(s),n,n)}if(t.localRotation){const o=fc(t.localRotation),s=h.Matrix3.fromQuaternion(o);h.Matrix4.multiply(h.Matrix4.fromRotationTranslation(s),n,n)}if(t.localPosition){const o=h.Matrix4.fromTranslation(h.Cartesian3.fromArray(t.localPosition));h.Matrix4.multiply(o,n,n)}if(t.localModelMatrix){const o=h.Matrix4.fromArray(t.localModelMatrix);h.Matrix4.multiply(o,n,n)}if(t.sceneScaleFromPixelSize!==void 0&&Number.isFinite(t.sceneScaleFromPixelSize)){const o=t.sceneScaleFromPixelSize,s=h.Matrix4.fromScale(h.Cartesian3.fromElements(o,o,o),new h.Matrix4);h.Matrix4.multiply(s,n,n)}if(t.scale){const[o,s,r]=t.scale??[1,1,1],l=h.Matrix4.fromScale(h.Cartesian3.fromElements(o,s,r),new h.Matrix4);h.Matrix4.multiply(l,n,n)}if(t.rotation){const o=fc(t.rotation),s=h.Matrix3.fromQuaternion(o);h.Matrix4.multiply(h.Matrix4.fromRotationTranslation(s),n,n)}if(t.position){const o=h.Cartesian3.fromDegrees(...t.position),s=h.Transforms.eastNorthUpToFixedFrame(o);h.Matrix4.multiply(s,n,n)}if(t.modelMatrix){const o=h.Matrix4.fromArray(t.modelMatrix);h.Matrix4.multiply(o,n,n)}return n}const z_=new h.Cartesian3,Cr=new h.HeadingPitchRoll,L_=new h.Matrix4,O_=new h.Cartesian3,N_=new h.Cartographic;function B_(t,i=[0,0,0],e=0,n){const[o,s,r]=t,l=h.Cartesian3.fromDegrees(o,s,r,void 0,z_),c=[...i];for(let d=0;d<3;++d)c[d]=h.Math.RADIANS_PER_DEGREE*c[d];if(e!==0){Cr.heading=c[0],Cr.pitch=c[1],Cr.roll=c[2],Cr.heading-=h.Math.PI_OVER_TWO;const d=h.Transforms.headingPitchRollToFixedFrame(l,Cr,void 0,void 0,L_),p=h.Matrix4.multiplyByPointAsVector(d,h.Cartesian3.UNIT_X,O_);h.Cartesian3.multiplyByScalar(p,e,p),h.Cartesian3.subtract(l,p,l)}const u=h.Cartographic.fromCartesian(l,void 0,N_);if(u)return n=n||[0,0,0],n[0]=u.longitude*180/Math.PI,n[1]=u.latitude*180/Math.PI,n[2]=u.height,n}function Wg(t,i,e,n){return B_(t,i,e,n)}const fn=h.Math.toDegrees;function Ht(t,i){const{longitude:e,latitude:n,height:o}=t.positionCartographic;return i?(i[0]=fn(e),i[1]=fn(n),i[2]=o,i):[fn(e),fn(n),o]}function Ko(t,i){const{heading:e,pitch:n,roll:o}=t;return i?(i[0]=fn(e),i[1]=fn(n),i[2]=fn(o),i):[e,n,o].map(fn)}class gc extends a.Destroyable{constructor(e){super();m(this,"_originViewMatrix",new h.Matrix4);m(this,"_originProjMatrix",new h.Matrix4);m(this,"_changed",new a.Event);this._scene=e;const n=this._scene.camera;h.Matrix4.clone(n.viewMatrix,this._originViewMatrix),h.Matrix4.clone(n.frustum.projectionMatrix,this._originViewMatrix),this.dispose(this._scene.preUpdate.addEventListener(()=>{this._update()}))}_update(){h.Matrix4.equals(this._scene.camera.viewMatrix,this._originViewMatrix)||(h.Matrix4.clone(this._scene.camera.viewMatrix,this._originViewMatrix),this._changed.emit()),h.Matrix4.equals(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix)||(h.Matrix4.clone(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix),this._changed.emit())}get changed(){return this._changed}}class V_ extends a.Destroyable{constructor(i){super();const e=()=>{};this.dispose(i.viewDistanceChanged.disposableOn(e)),this.dispose(i.visibleAlphaChanged.disposableOn(e))}}class U_ extends a.Destroyable{constructor(e){super();m(this,"_debugObjResetting");this._control=e,this._debugObjResetting=this.disposeVar(new a.ObjResettingWithEvent(this._control.debugChanged,()=>{if(this._control.debug)return new V_(this._control)}))}get debugObjResetting(){return this._debugObjResetting}}class jn extends a.Destroyable{constructor(e,n,o,s){super();m(this,"_visibleAlpha",this.disposeVar(a.react(1)));m(this,"_viewDistance",this.disposeVar(a.react(0)));m(this,"_debug",this.disposeVar(a.react(!1)));m(this,"_viewDistanceDebug",this.disposeVar(new U_(this)));this._czmViewer=e,this._positionReact=o;const{positionReact:r,czmViewer:l}=this,[c,u,d]=a.getReactFuncs(n),[p,f,g]=a.getReactFuncs(r),[v,y,w]=s?a.getReactFuncs(s):[void 0,void 0,void 0],P=()=>{let x=1,A=Number.NEGATIVE_INFINITY;const R=c(),L=p(),B=v?v():0,V=l.getCurrentCameraInfo();if(!R||!L||!V){this._viewDistance.value=A,this._visibleAlpha.value=x;return}A=a.cartesianDistance(V.position,L)-(B??0);const[G,O,N,_]=R;G>O||O>N||N>_?console.error("viewDistanceRange存在问题,需要满足逐级增大的条件,否则不生效!"):A>=O&&A<=N?x=1:A<=G||A>=_?x=0:A>G&&A<O?O-G<=0?x=0:x=(A-G)/(O-G):A>N&&A<_?(_<=N&&(x=0),x=(_-A)/(_-N)):(x=1,console.error("不应该运行至此!")),this._viewDistance.value=A,this._visibleAlpha.value=x};P();const C=[l.cameraChanged,d,g];w&&C.push(w);const S=this.disposeVar(a.createNextAnimateFrameEvent(...C));this.dispose(S.disposableOn(P))}get visibleAlpha(){return this._visibleAlpha.value}get visibleAlphaChanged(){return this._visibleAlpha.changed}get viewDistance(){return this._viewDistance.value}set viewDistance(e){this._viewDistance.value=e}get viewDistanceChanged(){return this._viewDistance.changed}get debug(){return this._debug.value}set debug(e){this._debug.value=e}get debugChanged(){return this._debug.changed}get positionReact(){return this._positionReact}get czmViewer(){return this._czmViewer}get viewDistanceDebug(){return this._viewDistanceDebug}}const W_=new h.BoundingSphere(h.Cartesian3.ZERO,0);function Wi(t,i,e){var n=W_;h.Cartesian3.clone(i,n.center);const o=t.camera.getPixelSize(n,t.drawingBufferWidth,t.drawingBufferHeight);if(o<=0)return;const s=e*o;if(Number.isFinite(s)&&s>0)return s}function pt(t,i=!1){const e=t.length;let n;const o=[];for(let s=0;s<e;++s){const[r,l,c]=t[s],u=i?h.Cartesian3.fromDegrees(r,l):h.Cartesian3.fromDegrees(r,l,c);if(!u)continue;const{x:d,y:p,z:f}=u;[d,p,f].every(Number.isFinite)&&(!n||!h.Cartesian3.equals(n,u))&&(n=u,o.push(n))}return o}function eo(t,i,e,n){const o=a.geoRhumbDistance(t,e),s=a.geoRhumbHeading(t,e),r=Math.cos(s*Math.PI/180)*Math.cos(i*Math.PI/180)+Math.sin(s*Math.PI/180)*Math.sin(i*Math.PI/180);return r>0?a.geoRhumbDestination(t,o,i,n):a.geoRhumbDestination(t,o,i+180,n),[r>0?o:-o,n]}function G_(t,i,e){const n=e*.1,o=[];for(let s=-9;s<10;++s){const r=a.geoRhumbDestination(t,n*s,i);r&&o.push(r)}return o}function H_(t,i){return a.geoNearestPointOnLine(t,i).geometry.coordinates}const Gg=new h.Cartesian3,$_=new h.Ray,q_=new h.Plane(h.Cartesian3.UNIT_X,0);function mc(t,i,e,n){const o=h.Cartesian3.normalize(i,Gg),s=h.Cartesian3.cross(t.camera.right,o,Gg);h.Cartesian3.normalize(s,s);const r=h.Plane.fromPointNormal(i,s,q_),l=t.camera.getPickRay(e,$_);if(l)return h.IntersectionTests.rayPlane(l,r,n)}const tu=new h.Cartesian3,X_=new h.Ray,Y_=new h.Cartographic,Z_=new h.Ellipsoid;function Jo(t,i,e,n){const o=t.camera.getPickRay(i,X_);if(!o)return;const s=h.Cartesian3.fromElements(e,e,e,tu),r=h.Cartesian3.add(s,h.Ellipsoid.WGS84.radii,tu),l=h.Ellipsoid.fromCartesian3(r,Z_),c=h.IntersectionTests.rayEllipsoid(o,l);if(c){const u=c.start>0?c.start:c.stop;if(u){const d=h.Ray.getPoint(o,u,tu),p=h.Cartographic.fromCartesian(d,void 0,Y_);return n=n||new h.Cartographic,n.longitude=p.longitude,n.latitude=p.latitude,n.height=e,n}else return}else return}function jo(t,i){i[0]=t[0],i[1]=t[1],i[2]=t[2]}function Hg(t){const i=h.Ellipsoid.WGS84.minimumRadius;return(t+i)/i}const $g=new h.Cartographic,qg=new h.Cartesian3,Mt=[0,0,0],gn=[0,0,0],iu=new h.Cartesian2,nu=new h.Cartesian3;function ou(t,i,e,n,o,s){o.constraintMode="none",jo([0,0,0],o.startDragPos),s=s||{},ui(a.getDomEventCurrentTargetPos(t),iu);const r=e.position;if(!Ie(r,nu))return;const l=Wi(i,nu,n);if(l===void 0||!mc(i,nu,iu,qg)||!se(qg,Mt))return;const c=Hg(Mt[2])*a.geoDistance(r,Mt);if(!s.z&&c<l&&Math.abs(r[2]-Mt[2])<e.dimensions[0]&&Mt[2]>r[2])return o.constraintMode="z",jo(Mt,o.startDragPos),!0;if(!Jo(i,iu,r[2],$g)||!Jn($g,Mt))return;const u=Hg(r[2])*a.geoDistance(r,Mt),d=e.dimensions[0];if(!(u>1.05*d)){if(!s.zAxis&&u>.95*d&&u<=1.05*d){o.constraintMode="zAxis",jo(Mt,o.startDragPos);return}{const[p,f]=eo(r,e.heading+90,Mt,gn);if(!s.x&&p>0&&f&&(gn[2]=r[2],a.geoDistance(gn,Mt)<l)){o.constraintMode="x",jo(gn,o.startDragPos);return}}{const[p,f]=eo(r,e.heading,Mt,gn);if(!s.y&&p>0&&f&&(gn[2]=r[2],a.geoDistance(gn,Mt)<l)){o.constraintMode="y",jo(gn,o.startDragPos);return}}s.xy||(o.constraintMode="xy",jo(Mt,o.startDragPos))}}async function Xg(t,i,e,n){var l;const o=(l=t.viewer)==null?void 0:l.scene;if(!o)throw new Error("!scene");const s=a.getDomEventCurrentTargetPos(i),r=ui(s);if(e===void 0){const c=t.quickPickPosition(s);return c?await c:void 0}else{const c=Jo(o,r,e);return c?Jn(c):void 0}}let su,ru;function Yg(t,i,e,n,o){o=o||new h.Cartesian3,su=su||new h.Ray,ru=ru||new h.Plane(h.Cartesian3.UNIT_X,0);const s=t.camera.getPickRay(n,su),r=h.Plane.fromPointNormal(i,e,ru);return o=h.IntersectionTests.rayPlane(s,r,o),o}function Zg(t){const i=h.Material.fromType(t.type);return au(i,t),i}function It(t){return t&&a.ESSceneObject.context.getStrFromEnv(t)||h.Material.DefaultImageId}function Q_(t){return{x:t[0],y:t[1]}}function au(t,i){i.type==="Color"?t.uniforms.color=te(i.color??[1,1,1,1]):i.type==="PolylineArrow"?t.uniforms.color=te(i.color??[1,1,1,1]):i.type==="PolylineDash"?(t.uniforms.color=te(i.color??[1,1,1,1]),t.uniforms.gapColor=te(i.gapColor??[0,0,0,0]),t.uniforms.dashLength=i.dashLength??16,t.uniforms.dashPattern=i.dashPattern??255):i.type==="PolylineGlow"?(t.uniforms.color=te(i.color??[1,1,1,1]),t.uniforms.glowPower=i.glowPower??.25,t.uniforms.taperPower=i.taperPower??1):i.type==="PolylineOutline"?(t.uniforms.color=te(i.color??[1,1,1,1]),t.uniforms.outlineColor=te(i.outlineColor??[1,0,0,1]),t.uniforms.outlineWidth=i.outlineWidth??1):i.type==="Image"?(t.uniforms.image=It(i.image),t.uniforms.repeat=Pe(i.repeat??[1,1]),t.uniforms.color=te(i.color??[1,1,1,1])):i.type==="DiffuseMap"?(t.uniforms.image=It(i.image),t.uniforms.repeat=Pe(i.repeat??[1,1]),t.uniforms.channels=i.channels??"rgb"):i.type==="AlphaMap"?(t.uniforms.image=It(i.image),t.uniforms.repeat=Pe(i.repeat??[1,1]),t.uniforms.channel=i.channel??"a"):i.type==="SpecularMap"?(t.uniforms.image=It(i.image),t.uniforms.repeat=Pe(i.repeat??[1,1]),t.uniforms.channel=i.channel??"r"):i.type==="EmissionMap"?(t.uniforms.image=It(i.image),t.uniforms.repeat=Pe(i.repeat??[1,1]),t.uniforms.channels=i.channels??"rgb"):i.type==="BumpMap"?(t.uniforms.image=It(i.image),t.uniforms.repeat=Pe(i.repeat??[1,1]),t.uniforms.channel=i.channel??"r",t.uniforms.strength=i.strength??.8):i.type==="NormalMap"?(t.uniforms.image=It(i.image),t.uniforms.repeat=Pe(i.repeat??[1,1]),t.uniforms.channels=i.channels??"rgb",t.uniforms.strength=i.strength??.8):i.type==="Grid"?(t.uniforms.color=te(i.color??[0,1,0,1]),t.uniforms.cellAlpha=i.cellAlpha??.1,t.uniforms.lineCount=Pe(i.lineCount??[8,8]),t.uniforms.lineThickness=Pe(i.lineThickness??[1,1]),t.uniforms.lineOffset=Pe(i.lineOffset??[0,0])):i.type==="Stripe"?(t.uniforms.evenColor=te(i.evenColor??[1,1,1,.5]),t.uniforms.oddColor=te(i.oddColor??[0,0,1,.5]),t.uniforms.horizontal=i.horizontal??!0,t.uniforms.offset=i.offset??0,t.uniforms.repeat=i.repeat??5):i.type==="Checkerboard"?(t.uniforms.lightColor=te(i.lightColor??[1,1,1,.5]),t.uniforms.darkColor=te(i.darkColor??[0,0,0,.5]),t.uniforms.repeat=Pe(i.repeat??[5,5])):i.type==="Dot"?(t.uniforms.lightColor=te(i.lightColor??[1,1,0,.75]),t.uniforms.darkColor=te(i.darkColor??[0,1,1,.75]),t.uniforms.repeat=Pe(i.repeat??[5,5])):i.type==="Water"?(t.uniforms.baseWaterColor=te(i.baseWaterColor??[.2,.3,.6,1]),t.uniforms.blendColor=te(i.blendColor??[0,1,.699,1]),t.uniforms.specularMap=It(i.specularMap),t.uniforms.normalMap=It(i.normalMap),t.uniforms.frequency=i.frequency??10,t.uniforms.animationSpeed=i.animationSpeed??.01,t.uniforms.amplitude=i.amplitude??1,t.uniforms.specularIntensity=i.specularIntensity??.5,t.uniforms.fadeFactor=i.fadeFactor??1):i.type==="RimLighting"?(t.uniforms.color=te(i.color??[1,0,0,.7]),t.uniforms.rimColor=te(i.rimColor??[1,1,1,.4]),t.uniforms.width=i.width??.3):i.type==="Fade"?(t.uniforms.fadeInColor=te(i.fadeInColor??[1,0,0,1]),t.uniforms.fadeOutColor=te(i.fadeOutColor??[0,0,0,0]),t.uniforms.maximumDistance=i.maximumDistance??.5,t.uniforms.repeat=i.repeat??!0,t.uniforms.fadeDirection=Q_(i.fadeDirection??[!0,!0]),t.uniforms.time=Pe(i.time??[.5,.5])):i.type==="ElevationContour"?(t.uniforms.color=te(i.color??[1,0,0,1]),t.uniforms.spacing=i.spacing??100,t.uniforms.width=i.width??1):i.type==="ElevationRamp"?(t.uniforms.image=It(i.image),t.uniforms.minimumHeight=i.minimumHeight??0,t.uniforms.maximumHeight=i.maximumHeight??1e4):i.type==="AspectRamp"?t.uniforms.image=It(i.image):i.type==="ElevationBand"?(t.uniforms.color=It(i.colors),t.uniforms.heights=It(i.heights)):i.type==="XbsjPolylineArrow"?(t.uniforms.color=te(i.color??[1,1,1,1]),t.uniforms.image=It(i.image),t.uniforms.repeat=i.repeat??60,t.uniforms.speed=i.speed??1,t.uniforms.lineLength=i.lineLength??1):console.warn(`未知材质类型,无法更新 ${i.type}`)}function di(t,i){const e=a.react(void 0);let n="";const[o,s,r]=a.getReactFuncs(t),l=()=>{try{const c=o()??i;c?n!==c.type?(n=c.type,e.value=Zg(c)):e.value&&au(e.value,c):(n="",e.value=void 0)}catch{}};return l(),e.dispose(r.disposableOn(l)),e}function Gi(t,i=!1){const e=pt(t.positions,i),n=t.holes&&t.holes.map(o=>Gi(o));return{positions:e,holes:n}}function lu(t,i){const e=Math.PI/180,n=1/e,o=new h.Cartographic(t[0]*e,t[1]*e,t[2]),s=new h.Cartographic(i[0]*e,i[1]*e,i[2]),r=new h.EllipsoidGeodesic(o,s).interpolateUsingFraction(.5,new h.Cartographic);if(r)return r.height=(o.height+s.height)*.5,[r.longitude*n,r.latitude*n,r.height]}const Qg=new h.Cartesian4,k_=new h.Matrix4;function K_(){return{left:0,top:0,right:0,bottom:0,depth:0}}function kg(t,i){return t.left===i.left&&t.right===i.right&&t.bottom===i.bottom&&t.top===i.top&&t.depth===i.depth}function Kg(t,i,e){if(t.scene.mode!==h.SceneMode.SCENE3D)return;const n=t.canvas.clientHeight,o=t.canvas.clientWidth,s=t.camera.viewMatrix,r=t.camera.frustum.projectionMatrix,l=h.Matrix4.multiply(r,s,k_),c=h.Matrix4.multiplyByVector(l,h.Cartesian4.fromElements(i.x,i.y,i.z,1,Qg),Qg);c.x/=c.w,c.y/=c.w,c.z/=c.w,c.w=1;const u=o*(c.x*.5+.5),d=n*(c.y*.5+.5),p=o-u,f=n-d,g=c.z;if(!(u<0||d<0||p<0||f<0||g<0||g>1))return e?(e.left=u,e.top=f,e.right=p,e.bottom=d,e.depth=g):e={left:u,top:f,right:p,bottom:d,depth:g},e}const to={left:0,top:0,right:0,bottom:0,depth:0};class vc extends a.Destroyable{constructor(e,n=!0,o){super();m(this,"_cartesian",new h.Cartesian3);m(this,"_winPos",{left:0,top:0,right:0,bottom:0,depth:0});m(this,"_winPosValid",!1);m(this,"_changedEvent",new a.Event);m(this,"_enabled",!0);this._viewer=e,o=o||this.disposeVar(new gc(this._viewer.scene)),this.dispose(o.changed.disposableOn(()=>this._updateWinPos())),this.dispose(()=>{this._changedEvent.empty||console.warn("WinPosFromCartesian需要销毁,但是changed事件仍有监听,代码未必有错,但是说明代码不严谨。")}),this.enabled=n}get enabled(){return this._enabled}set enabled(e){this._enabled!==e&&(this._enabled=e,e&&this._updateWinPos())}_updateWinPos(){if(!this._enabled)return;let e=!1;const n=Kg(this._viewer,this._cartesian,to);!!n!==this._winPosValid&&(e=!0,this._winPosValid=!!n),this._winPosValid?kg(this._winPos,to)||(e=!0,this._winPos.left=to.left,this._winPos.top=to.top,this._winPos.right=to.right,this._winPos.bottom=to.bottom,this._winPos.depth=to.depth):(e=!0,this._winPos.left=Number.NaN,this._winPos.top=Number.NaN,this._winPos.right=Number.NaN,this._winPos.bottom=Number.NaN,this._winPos.depth=Number.NaN),e&&this._changedEvent.emit(this._winPosValid,this._winPos)}get cartesian(){return this._cartesian}set cartesian(e){h.Cartesian3.equals(this._cartesian,e)||(h.Cartesian3.clone(e,this._cartesian),this._updateWinPos())}get changed(){return this._changedEvent}get winPosValid(){return this._winPosValid}get winPos(){return this._winPos}}function Jg(t){const i=h.Math.toRadians(t[0]),e=h.Math.toRadians(t[1]),n=h.Math.toRadians(t[2]),o=h.Matrix3.fromHeadingPitchRoll(new h.HeadingPitchRoll(i,e,n)),s=new h.Cartesian3;return h.Matrix3.multiplyByVector(o,h.Cartesian3.UNIT_X,s),[s.x,s.y,s.z]}const J_=h.Check,io=h.defined,jg=h.Math.EPSILON10;function j_(t,i,e,n){if(J_.defined("equalsEpsilon",i),!io(t))return;e=e??!1;const o=io(n),s=t.length;if(s<2)return t;let r,l=t[0],c,u,d=0,p=-1;for(r=1;r<s;++r)c=t[r],i(l,c,jg)?(io(u)||(u=t.slice(0,r),d=r-1,p=0),o&&n.push(r)):(io(u)&&(u.push(c),d=r,o&&(p=n.length)),l=c);return e&&i(t[0],t[s-1],jg)&&(o&&(io(u)?n.splice(p,0,d):n.push(s-1)),io(u)?u.length-=1:u=t.slice(0,-1)),io(u)?u:t}const ge=h.Cartesian3,es=h.Cartographic,no=h.defined,em=h.DeveloperError,tm=h.Ellipsoid,e1=h.EllipsoidGeodesic,im=h.EllipsoidRhumbLine,t1=h.IntersectionTests,cu=h.Math,ts=h.Matrix4,oo=h.Plane,Ke={};Ke.numberOfPoints=function(t,i,e){const n=ge.distance(t,i);return Math.ceil(n/e)},Ke.numberOfPointsRhumbLine=function(t,i,e){const n=Math.pow(t.longitude-i.longitude,2)+Math.pow(t.latitude-i.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(n/(e*e))))};const i1=new es;Ke.extractHeights=function(t,i){const e=t.length,n=new Array(e);for(let o=0;o<e;o++){const s=t[o];n[o]=i.cartesianToCartographic(s,i1).height}return n};const n1=new ts,o1=new ge,nm=new ge,s1=new oo(ge.UNIT_X,0),om=new ge,r1=new oo(ge.UNIT_X,0),a1=new ge,l1=new ge,hu=[];function sm(t,i,e){const n=hu;n.length=t;let o;if(i===e){for(o=0;o<t;o++)n[o]=i;return n}const r=(e-i)/t;for(o=0;o<t;o++){const l=i+o*r;n[o]=l}return n}const yc=new es,wc=new es,mn=new ge,uu=new ge,c1=new ge,du=new e1;let _r=new im;function h1(t,i,e,n,o,s,r,l){const c=n.scaleToGeodeticSurface(t,uu),u=n.scaleToGeodeticSurface(i,c1),d=Ke.numberOfPoints(t,i,e),p=n.cartesianToCartographic(c,yc),f=n.cartesianToCartographic(u,wc),g=sm(d,o,s);du.setEndPoints(p,f);const v=du.surfaceDistance/d;let y=l;p.height=o;let w=n.cartographicToCartesian(p,mn);ge.pack(w,r,y),y+=3;for(let P=1;P<d;P++){const C=du.interpolateUsingSurfaceDistance(P*v,wc);C.height=g[P],w=n.cartographicToCartesian(C,mn),ge.pack(w,r,y),y+=3}return y}function u1(t,i,e,n,o,s,r,l){const c=n.cartesianToCartographic(t,yc),u=n.cartesianToCartographic(i,wc),d=Ke.numberOfPointsRhumbLine(c,u,e);c.height=0,u.height=0;const p=sm(d,o,s);_r.ellipsoid.equals(n)||(_r=new im(void 0,void 0,n)),_r.setEndPoints(c,u);const f=_r.surfaceDistance/d;let g=l;c.height=o;let v=n.cartographicToCartesian(c,mn);ge.pack(v,r,g),g+=3;for(let y=1;y<d;y++){const w=_r.interpolateUsingSurfaceDistance(y*f,wc);w.height=p[y],v=n.cartographicToCartesian(w,mn),ge.pack(v,r,g),g+=3}return g}Ke.wrapLongitude=function(t,i){const e=[],n=[];if(no(t)&&t.length>0){i=i??ts.IDENTITY;const o=ts.inverseTransformation(i,n1),s=ts.multiplyByPoint(o,ge.ZERO,o1),r=ge.normalize(ts.multiplyByPointAsVector(o,ge.UNIT_Y,nm),nm),l=oo.fromPointNormal(s,r,s1),c=ge.normalize(ts.multiplyByPointAsVector(o,ge.UNIT_X,om),om),u=oo.fromPointNormal(s,c,r1);let d=1;e.push(ge.clone(t[0]));let p=e[0];const f=t.length;for(let g=1;g<f;++g){const v=t[g];if(oo.getPointDistance(u,p)<0||oo.getPointDistance(u,v)<0){const y=t1.lineSegmentPlane(p,v,l,a1);if(no(y)){const w=ge.multiplyByScalar(r,5e-9,l1);oo.getPointDistance(l,p)<0&&ge.negate(w,w),e.push(ge.add(y,w,new ge)),n.push(d+1),ge.negate(w,w),e.push(ge.add(y,w,new ge)),d=1}}e.push(ge.clone(t[g])),d++,p=v}n.push(d)}return{positions:e,lengths:n}},Ke.generateArc=function(t){no(t)||(t={});const i=t.positions;if(!no(i))throw new em("options.positions is required.");const e=i.length,n=t.ellipsoid??tm.WGS84;let o=t.height??0;const s=Array.isArray(o);if(e<1)return[];if(e===1){const y=n.scaleToGeodeticSurface(i[0],uu);if(o=s?o[0]:o,o!==0){const w=n.geodeticSurfaceNormal(y,mn);ge.multiplyByScalar(w,o,w),ge.add(y,w,y)}return[y.x,y.y,y.z]}let r=t.minDistance;if(!no(r)){const y=t.granularity??cu.RADIANS_PER_DEGREE;r=cu.chordLength(y,n.maximumRadius)}let l=0,c;for(c=0;c<e-1;c++)l+=Ke.numberOfPoints(i[c],i[c+1],r);const u=(l+1)*3,d=new Array(u);let p=0;for(c=0;c<e-1;c++){const y=i[c],w=i[c+1],P=s?o[c]:o,C=s?o[c+1]:o;p=h1(y,w,r,n,P,C,d,p)}hu.length=0;const f=i[e-1],g=n.cartesianToCartographic(f,yc);g.height=s?o[e-1]:o;const v=n.cartographicToCartesian(g,mn);return ge.pack(v,d,u-3),d};const rm=new es,d1=new es;Ke.generateRhumbArc=function(t){no(t)||(t={});const i=t.positions;if(!no(i))throw new em("options.positions is required.");const e=i.length,n=t.ellipsoid??tm.WGS84;let o=t.height??0;const s=Array.isArray(o);if(e<1)return[];if(e===1){const P=n.scaleToGeodeticSurface(i[0],uu);if(o=s?o[0]:o,o!==0){const C=n.geodeticSurfaceNormal(P,mn);ge.multiplyByScalar(C,o,C),ge.add(P,C,P)}return[P.x,P.y,P.z]}const r=t.granularity??cu.RADIANS_PER_DEGREE;let l=0,c,u=n.cartesianToCartographic(i[0],rm),d;for(c=0;c<e-1;c++)d=n.cartesianToCartographic(i[c+1],d1),l+=Ke.numberOfPointsRhumbLine(u,d,r),u=es.clone(d,rm);const p=(l+1)*3,f=new Array(p);let g=0;for(c=0;c<e-1;c++){const P=i[c],C=i[c+1],S=s?o[c]:o,x=s?o[c+1]:o;g=u1(P,C,r,n,S,x,f,g)}hu.length=0;const v=i[e-1],y=n.cartesianToCartographic(v,yc);y.height=s?o[e-1]:o;const w=n.cartographicToCartesian(y,mn);return ge.pack(w,f,p-3),f},Ke.generateCartesianArc=function(t){const i=Ke.generateArc(t),e=i.length/3,n=new Array(e);for(let o=0;o<e;o++)n[o]=ge.unpack(i,o*3);return n},Ke.generateCartesianRhumbArc=function(t){const i=Ke.generateRhumbArc(t),e=i.length/3,n=new Array(e);for(let o=0;o<e;o++)n[o]=ge.unpack(i,o*3);return n};const Cc=h.ArcType,p1=h.Cartesian3,f1=h.Math;function am(t){const i=t.arcType,e=t.granularity,n=t.ellipsoid,o=[];let s=j_(t.positions,p1.equalsEpsilon,!1,o);if(!(s.length<2)){if(i===Cc.GEODESIC||i===Cc.RHUMB){let l;i===Cc.GEODESIC?(l=f1.chordLength(e,n.maximumRadius),Ke.numberOfPoints):(l=e,Ke.numberOfPointsRhumbLine);const c=Ke.extractHeights(s,n);i===Cc.GEODESIC?s=Ke.generateCartesianArc({positions:s,minDistance:l,ellipsoid:n,height:c}):s=Ke.generateCartesianRhumbArc({positions:s,granularity:l,ellipsoid:n,height:c})}return s}}function pu(t,i="GEODESIC",e){const o=t.map(a.lbhToXyz).map(p=>h.Cartesian3.fromArray(p));let s;if(e>0&&i!=="NONE"){if(s=am({arcType:h.ArcType[i??"GEODESIC"],granularity:e,ellipsoid:h.Ellipsoid.WGS84,positions:o}),!s)return}else s=o;let r=0;const l=[0],c=s.length;for(let p=1;p<c;++p)r+=h.Cartesian3.distance(s[p-1],s[p]),l.push(r);const u=s.map(p=>a.xyzToLbh([p.x,p.y,p.z]));return{timePosRots:l.map((p,f)=>[l[f],u[f],void 0]),distances:l}}function lm(t,i){i=i??new Array(16);for(let e=0;e<16;++e)i[e]=t[e];return i}function fu(t,i){const e=h.Matrix4.clone(h.Matrix4.IDENTITY),{position:n,rotation:o,scale:s,initialRotationMode:r="YForwardZUp"}=t;if(n){const[l,c,u]=n;h.Transforms.eastNorthUpToFixedFrame(h.Cartesian3.fromDegrees(l,c,u),void 0,e)}if(o){const l=new h.Quaternion;r==="YForwardZUp"?fc(o,l):r==="XForwardZUp"&&Vg(o,l);const c=h.Matrix3.fromQuaternion(l);h.Matrix4.multiply(e,h.Matrix4.fromRotationTranslation(c),e)}return s&&h.Matrix4.multiplyByScale(e,ui(s),e),lm(e,i)}const g1=new h.Matrix4;function cm(t,i){const e=h.Matrix4.fromArray(t,0,g1);return h.Matrix4.inverse(e,e),lm(e,i)}const m1=new h.Matrix4,v1=new h.Cartesian3;function hm(t,i,e){const[n,o,s]=i,r=h.Cartesian3.fromDegrees(n,o,s,void 0,v1),l=h.Matrix4.fromArray(t,0,m1),c=h.Matrix4.multiplyByPoint(l,r,r),{x:u,y:d,z:p}=c;return e=e||[0,0,0],e[0]=u,e[1]=d,e[2]=p,e}const y1=new h.Matrix4,w1=new h.Cartesian3,C1=new h.Cartographic;function vn(t,i,e){const[n,o,s]=i,r=h.Cartesian3.fromElements(n,o,s,w1),l=h.Matrix4.fromArray(t,0,y1),c=h.Matrix4.multiplyByPoint(l,r,r),u=h.Cartographic.fromCartesian(c,void 0,C1);return e=e||[0,0,0],e[0]=h.Math.toDegrees(u.longitude),e[1]=h.Math.toDegrees(u.latitude),e[2]=u.height,e}function Dt(t,i){const{originPosition:e,originRotation:n,originScale:o,initialRotationMode:s}=t,r=fu({position:e,rotation:n,scale:o,initialRotationMode:s}),l=cm(r);return[i.map(u=>hm(l,u)),r,l]}function yn(t,i){const{originPosition:e,originRotation:n,originScale:o,initialRotationMode:s}=t,r=fu({position:e,rotation:n,scale:o,initialRotationMode:s});return[i.map(c=>vn(r,c)),r]}function um(t){if(t.length<2)return console.error("getIncludedAngleFromPositions需要传入的点不能少于三个!!!!!"),!1;let i=[];for(let e=0;e<t.length-2;e++){const n=ye.Cartesian3.fromDegrees(...t[e]),o=ye.Cartesian3.fromDegrees(...t[e+1]),s=ye.Cartesian3.fromDegrees(...t[e+2]),r=ye.Cartesian3.angleBetween(ye.Cartesian3.subtract(n,o,new ye.Cartesian3),ye.Cartesian3.subtract(s,o,new ye.Cartesian3));i.push(isNaN(r)?0:ye.Math.toDegrees(r))}return i}function gu(t,i){let e=i||[];return t.positions&&(e[e.length]??(e[e.length]=[]),e[e.length-1].push(...t.positions.map(n=>se(n)))),t.holes&&t.holes.forEach(n=>{e=gu(n,e)}),e}function $t(t){return typeof t=="string"?a.ESSceneObject.context.getStrFromEnv(t):new h.Resource({url:a.ESSceneObject.context.getStrFromEnv(t.url),headers:t.headers,queryParameters:t.queryParameters,templateValues:t.templateValues,proxy:t.proxy,retryCallback:t.retryCallback,retryAttempts:t.retryAttempts,request:t.request,parseUrl:t.parseUrl})}class mu extends a.Destroyable{constructor(i,e,n,o){if(super(),!i.viewer)return;const{scene:s}=i.viewer,[r,l,c]=a.getReactFuncs(e),[u,d,p]=a.getReactFuncs(n),f=new h.Cartesian3,g=()=>{let v=r();v&&(v=[...v],i.editingHeightOffset&&(v[2]-=i.editingHeightOffset),h.Cartesian3.fromDegrees(...v,void 0,f))};g(),this.dispose(c.disposableOn(g)),this.dispose(s.preUpdate.addEventListener(()=>{if(h.Cartesian3.ZERO.equals(f))return;const v=Wi(s,f,o);v!==void 0?d([v,v,v]):console.warn(`CzmGeoCoordinatesEditor warn: scale: ${v??"undefined"}`)}))}}function _1(t){const i=Reflect.has(t.root,"transform")?t.root.transform:h.Matrix4.toArray(h.Matrix4.IDENTITY);let e,n,o,s;if(Reflect.has(t.root.boundingVolume,"region"))return t.root.boundingVolume.region;if(Reflect.has(t.root.boundingVolume,"box"))s=h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(0,3)),e=h.Cartesian3.add(s,h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(3,6)),new h.Cartesian3),n=h.Cartesian3.add(s,h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(6,9)),new h.Cartesian3),o=h.Cartesian3.add(s,h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(9,12)),new h.Cartesian3);else if(Reflect.has(t.root.boundingVolume,"sphere")){const f=t.root.boundingVolume.sphere[3];s=h.Cartesian3.fromArray(t.root.boundingVolume.sphere.slice(0,3)),e=h.Cartesian3.add(s,h.Cartesian3.fromArray([f,0,0]),new h.Cartesian3),n=h.Cartesian3.add(s,h.Cartesian3.fromArray([0,f,0]),new h.Cartesian3),o=h.Cartesian3.add(s,h.Cartesian3.fromArray([0,0,f]),new h.Cartesian3)}if(!e||!n||!o||!s)return"无法生成包围盒,请检查包围盒是否正确";let r,l,c,u,d,p;return h.Matrix4.IDENTITY.equals(h.Matrix4.fromArray(i))?(r=se(e),u=se(h.Cartesian3.add(s,h.Cartesian3.subtract(s,e,new h.Cartesian3),new h.Cartesian3)),l=se(n),d=se(h.Cartesian3.add(s,h.Cartesian3.subtract(s,n,new h.Cartesian3),new h.Cartesian3)),c=se(o),p=se(h.Cartesian3.add(s,h.Cartesian3.subtract(s,o,new h.Cartesian3),new h.Cartesian3))):(r=vn(i,[e.x,e.y,e.z]),u=vn(i,[-e.x,-e.y,-e.z]),l=vn(i,[n.x,n.y,n.z]),d=vn(i,[-n.x,-n.y,-n.z]),c=vn(i,[o.x,o.y,o.z]),p=vn(i,[-o.x,-o.y,-o.z])),!r||!u||!l||!d||!c||!p?"无法生成包围盒,请检查包围盒是否正确":[h.Math.toRadians(Math.min(r[0],u[0],l[0],d[0],c[0],p[0])),h.Math.toRadians(Math.min(r[1],u[1],l[1],d[1],c[1],p[1])),h.Math.toRadians(Math.max(r[0],u[0],l[0],d[0],c[0],p[0])),h.Math.toRadians(Math.max(r[1],u[1],l[1],d[1],c[1],p[1])),Math.min(r[2],u[2],l[2],d[2],c[2],p[2]),Math.max(r[2],u[2],l[2],d[2],c[2],p[2])]}const dm=a.createProcessingFromAsyncFunc(async(t,i)=>{let e={state:"success",tilesUrl:{asset:{version:"1.1"},geometricError:0,refine:"REPLACE",root:{boundingVolume:{region:[]},geometricError:0,refine:"REPLACE",children:[]}}},n={},o=[];if(await a.step(t,async c=>new Promise(async(u,d)=>{for(let p=0;p<i.length;p++){const f=i[p];await fetch(f).then(g=>g.json()).then(g=>{g&&!Reflect.has(g,"success")?n[f]=g:o.push({index:p,url:f,message:g.message}),p==i.length-1&&u()}).catch(g=>{o.push({index:p,url:f,message:g}),p==i.length-1&&u()})}})),o.length>0&&(e.state="error",e.info=o,o.length==i.length))return e.tilesUrl=void 0,e;const s=[],r=[],l=[];for(const c in n){const u=n[c];r.push(u.geometricError??u.root.geometricError??0);const d=_1(u);s.push(d),l.push({content:{uri:c},boundingVolume:{region:d},geometricError:u.geometricError,refine:"REPLACE"})}return e.tilesUrl&&(e.tilesUrl.geometricError=e.tilesUrl.root.geometricError=Math.max(...r),e.tilesUrl.root.boundingVolume.region=[Math.min(...s.map(c=>c[0])),Math.min(...s.map(c=>c[1])),Math.max(...s.map(c=>c[2])),Math.max(...s.map(c=>c[3])),Math.min(...s.map(c=>c[4])),Math.max(...s.map(c=>c[5]))],e.tilesUrl.root.children=l),e});function P1(t){return new Promise((i,e)=>{dm.restart(void 0,t),dm.completeEvent.don(n=>{i(n)})})}class vu extends a.Destroyable{constructor(e){super();m(this,"_center",this.disposeVar(a.reactArrayWithUndefined(void 0)));m(this,"_radius",this.disposeVar(a.react(0)));const[n,o,s]=a.getReactFuncs(e);{const r=()=>{const l=n();if(l){const{center:c,minPos:u,maxPos:d}=a.getMinMaxCorner(l);this._center.value=c,this._radius.value=a.geoDistance(u,d)/2}else this._center.value=void 0};r(),this.dispose(s.disposableOn(r))}}get centerReact(){return this._center}get center(){return this._center.value}get centerChanged(){return this._center.changed}get radiusReact(){return this._radius}get radius(){return this._radius.value}get radiusChanged(){return this._radius.changed}}function pm(t){return new h.Material({fabric:{type:"XbsjWater",uniforms:{baseWaterImage:"",repeatX:1,repeatY:1,flowSpeed:0,baseWaterColor:new h.Color(.2,.3,.6,1),blendColor:new h.Color(0,1,.699,1),specularMap:h.Material.DefaultImageId,normalMap:h.Material.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1,...t},source:`// Thanks for the contribution Jonas
2
2
  // http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog
3
3
 
4
4
  uniform sampler2D specularMap;
@@ -740,7 +740,7 @@ ${Cy}
740
740
  // out_FragColor = vec4(texture(u_gradientMap, vec2(a, .5)).rgb, (a + .1)*4.);
741
741
  out_FragColor = vec4(texture(u_gradientMap, vec2(a, .5)).rgb, a);
742
742
  }
743
- `,s.uniformMap={u_gradientMap:{type:"texture",id:"5d45a4a4-4f5d-4424-aea5-181de75bd13b"},u_stripMinMaxValue:[0,1],u_ratio:0};let l=this.disposeVar(a.react(void 0));{const c=this.disposeVar(a.createProcessingFromAsyncFunc(async d=>{l.value=void 0;const p=e.url??a.ESDataMesh.defaults.url;if(!p)return;await d.promise(a.sleep(200));const f=(e.maxTime??23)|0;l.value=await d.promise(gA(a.ESSceneObject.context.getStrFromEnv(typeof p=="string"?p:p.url),f+1))}));c.start();const u=this.disposeVar(a.createNextAnimateFrameEvent(e.urlChanged,e.maxTimeChanged));this.dispose(u.disposableOn(()=>c.restart()))}{class c{constructor(p){this._buffer=p}[Symbol.iterator](){return mA(this._buffer)}}const u=()=>{if(!l.value)return;const{vertexBuffer:d,propBuffers:p,indexBuffer:f}=l.value,{minPos:g,maxPos:v}=a.getMinMaxCorner(new c(d));s.setLocalAxisedBoundingBox(g,v);const y=(e.maxTime??23)|0;let w=(e.currentTime??a.ESDataMesh.defaults.currentTime)/y;w=w<0?0:w>1?1:w;const P=w*y;let C=w*y|0,S=P-C;if(C>=y&&(C=y-1,S=1),!Number.isFinite(S)){console.error("!Number.isFinite(rr)");debugger;return}if(s.indexTypedArray=f,!p[C]||!p[C+1]){console.error("!propBuffers[i] || !propBuffers[i + 1]");debugger}s.attributes={a_position:{typedArray:d,componentsPerAttribute:3},a_prop:{typedArray:p[C],componentsPerAttribute:3},a_prop2:{typedArray:p[C+1],componentsPerAttribute:3}},s.uniformMap={u_gradientMap:{type:"texture",id:`${r.id}`},u_stripMinMaxValue:[e.minPropValue??a.ESDataMesh.defaults.minPropValue,e.maxPropValue??a.ESDataMesh.defaults.maxPropValue],u_ratio:S}};u(),this.dispose(e.maxTimeChanged.disposableOn(u)),this.dispose(e.currentTimeChanged.disposableOn(u)),this.dispose(e.minPropValueChanged.disposableOn(u)),this.dispose(e.maxPropValueChanged.disposableOn(u)),this.dispose(l.changed.disposableOn(u))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}get czmTexture(){return this._czmTexture}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmCustomPrimitive:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(Rt(s,o,n,e,r,!0),!0):!1}};m(Ba,"type",Ba.register("ESCesiumViewer",a.ESDataMesh.type,Ba));let Kd=Ba;const Go=class Go extends a.Destroyable{constructor(e,n){super();m(this,"_pickedEvent",this.disposeVar(new a.Event));m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_heading",this.disposeVar(a.react(0)));m(this,"_textFunc",this.disposeVar(a.react(void 0)));const o=this;{const l=()=>{if(this.positions&&this.positions.length>=2){let u=0;this.arcType===void 0||this.arcType==="GEODESIC"?u=a.geoHeading(this.positions[0],this.positions[1]):this.arcType==="RHUMB"?u=a.geoRhumbHeading(this.positions[0],this.positions[1]):this.arcType==="NONE"?u=a.geoHeading(this.positions[0],this.positions[1]):console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`),this._heading.value=this.angleMode==="-180~180"?a.clampN180_180(u):a.clamp0_360(u)}};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.angleModeChanged));this.dispose(c.disposableOn(l))}const s=this.disposeVar(new Se(e,n));s.loop=!1,this.dispose(a.track([s,"allowPicking"],[o,"allowPicking"])),this.dispose(a.bind([s,"arcType"],[o,"arcType"])),this.dispose(a.bind([s,"color"],[o,"color"])),this.dispose(a.bind([s,"dashLength"],[o,"dashLength"])),this.dispose(a.bind([s,"dashPattern"],[o,"dashPattern"])),this.dispose(a.bind([s,"gapColor"],[o,"gapColor"])),this.dispose(a.bind([s,"hasArrow"],[o,"hasArrow"])),this.dispose(a.bind([s,"hasDash"],[o,"hasDash"])),this.dispose(a.bind([s,"positions"],[o,"positions"])),this.dispose(a.bind([s,"show"],[o,"show"])),this.dispose(a.bind([s,"width"],[o,"width"])),this.dispose(a.bind([s,"depthTest"],[o,"depthTest"])),this.dispose(a.bind([s,"ground"],[o,"strokeGround"])),this.dispose(o.flyToEvent.disposableOn(l=>{e.actived&&s.flyTo(l)}));const r=this.disposeVar(new He(e,n));this.dispose(a.bind([r,"shadowDom"],[o,"shadowDom"])),this.dispose(a.bind([r,"cssAllInitial"],[o,"cssAllInitial"])),this.dispose(a.bind([r,"show"],[o,"show"]));{const l=()=>{o.positions&&o.positions.length>=2?r.position=o.positions[1]:r.position=void 0};l(),this.dispose(o.positionsChanged.disposableOn(l))}{const l=()=>{const{heading:u}=o,d=(o.textFunc??Go.defaultTextFunc_度格式)(u);r.innerHTML=ao(`方向: ${d}`,24)};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(o.headingChanged,o.textFuncChanged));this.dispose(c.disposableOn(l))}this.ad(r.pickedEvent.don(l=>{Hi(l)===0&&this.pickedEvent.emit(l)}))}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get heading(){return this._heading.value}get headingChanged(){return this._heading.changed}get textFunc(){return this._textFunc.value}set textFunc(e){this._textFunc.value=e}get textFuncChanged(){return this._textFunc.changed}};m(Go,"defaultTextFunc_度格式",e=>`${e.toFixed(5)}°`),m(Go,"defaultTextFunc_度分格式",e=>`${br(e,!0)}`),m(Go,"defaultTextFunc_度分秒格式",e=>`${br(e,!1)}`),m(Go,"defaults",{positions:[]});let Ao=Go;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(void 0),width:8,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!0,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1,angleMode:"-180~180",strokeGround:!1})})(Ao||(Ao={})),a.extendClassProps(Ao.prototype,Ao.createDefaultProps);const Va=class Va extends yt{constructor(e,n){super(e,n);m(this,"_czmDirectionMeasurement");if(this._czmDirectionMeasurement=this.disposeVar(new Ao(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmDirectionMeasurement;s.angleMode="0~360",this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.bind([s,"strokeGround"],[e,"strokeGround"]));{const r=()=>{if(e.stroked)s.width=e.strokeWidth;else{s.width=0;return}s.width=e.strokeWidth,s.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(s.hasDash=!0,s.hasArrow=!1):u==="hasArrow"?(s.hasDash=!1,s.hasArrow=!0):u==="normal"?(s.hasDash=!1,s.hasArrow=!1):(s.hasDash=!1,s.hasArrow=!0);const d=e.strokeStyle;if(d.material==="hasDash"&&d.materialParams)try{const p=d.materialParams;Reflect.has(p,"gapColor")&&(s.gapColor=p.gapColor??[0,0,0,0]),Reflect.has(p,"dashLength")&&(s.dashLength=p.dashLength),Reflect.has(p,"dashPattern")&&(s.dashPattern=p.dashPattern)}catch(p){console.error(p)}else s.gapColor=[0,0,0,0],s.dashLength=0,s.dashPattern=0};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(l.disposableOn(r))}this.dispose(s.pickedEvent.disposableOn(r=>{Hi(r)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(r)}))}get czmDirectionMeasurement(){return this._czmDirectionMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmDirectionMeasurement:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmDirectionMeasurement:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(Va,"type",Va.register("ESCesiumViewer",a.ESDirectionMeasurement.type,Va));let Jd=Va;class Ls extends a.Destroyable{constructor(e,n){super();m(this,"_pickedEvent",this.disposeVar(new a.Event));m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_distances",this.disposeVar(a.reactArray([])));const o=async()=>{this.strokeGround&&e.viewer?this._distances.value=await bm(e.viewer,this.positions??[]):this._distances.value=a.getDistancesFromPositions(this.positions??[],this.arcType)};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.strokeGroundChanged));this.dispose(s.disposableOn(o));const r=this.disposeVar(new Se(e,n));r.loop=!1,this.dispose(a.track([r,"allowPicking"],[this,"allowPicking"])),this.dispose(a.bind([r,"arcType"],[this,"arcType"])),this.dispose(a.bind([r,"color"],[this,"color"])),this.dispose(a.bind([r,"dashLength"],[this,"dashLength"])),this.dispose(a.bind([r,"dashPattern"],[this,"dashPattern"])),this.dispose(a.bind([r,"gapColor"],[this,"gapColor"])),this.dispose(a.bind([r,"hasArrow"],[this,"hasArrow"])),this.dispose(a.bind([r,"hasDash"],[this,"hasDash"])),this.dispose(a.bind([r,"positions"],[this,"positions"])),this.dispose(a.bind([r,"show"],[this,"show"])),this.dispose(a.bind([r,"width"],[this,"width"])),this.dispose(a.bind([r,"depthTest"],[this,"depthTest"])),this.dispose(a.bind([r,"ground"],[this,"strokeGround"])),this.dispose(this.flyToEvent.disposableOn(l=>{e.actived&&r.flyTo(l)}));{const l=[],c=()=>{for(let d of l)d.destroy();l.length=0};this.dispose(c);const u=()=>{if(c(),!this.positions)return;if(this.positions.length>0&&this.distances.length>0){const p=Eu("起点",this.positions[0],e,n);p.dispose(a.track([p,"show"],[this,"show"])),p.dispose(a.track([p,"shadowDom"],[this,"shadowDom"])),p.dispose(a.track([p,"cssAllInitial"],[this,"cssAllInitial"])),l.push(p)}const d=this.distances.length;for(let p=0;p<d;++p){const f=this.distances[p],g=this.positions[p+1],v=Eu(`长度: ${bc(f)}`,g,e,n);v.dispose(a.track([v,"show"],[this,"show"])),v.dispose(a.track([v,"shadowDom"],[this,"shadowDom"])),v.dispose(a.track([v,"cssAllInitial"],[this,"cssAllInitial"])),this.ad(v.pickedEvent.don(y=>{Hi(y)===0&&this.pickedEvent.emit(y)})),l.push(v)}};u(),this.dispose(this.distancesChanged.disposableOn(()=>a.inOrderRunning(u)))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get distances(){return this._distances.value}get distancesChanged(){return this._distances.changed}}m(Ls,"defaults",{positions:[]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(void 0),width:1,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1,strokeGround:!1})})(Ls||(Ls={})),a.extendClassProps(Ls.prototype,Ls.createDefaultProps);const Ua=class Ua extends yt{constructor(e,n){super(e,n);m(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new Se(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._geoPolyline;this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"width"],[e,"strokeWidth"])),this.dispose(a.track([s,"color"],[e,"strokeColor"])),this.dispose(a.track([s,"ground"],[e,"strokeGround"]));{const r=()=>{s.show=e.show&&e.stroked};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(l.disposableOn(r))}}get geoPolyline(){return this._geoPolyline}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoPolyline:r}=this;return s.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,geoPolyline:r}=this;return s.actived?o.flyInParam?(super.flyIn(e,n),!0):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(Ua,"type",Ua.register("ESCesiumViewer",a.ESGeoLineString.type,Ua));let Os=Ua;const Wa=class Wa extends Os{constructor(e,n){super(e,n);m(this,"_czmDistanceMeasurement");if(this._czmDistanceMeasurement=this.disposeVar(new Ls(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmDistanceMeasurement:s}=this;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.bind([s,"strokeGround"],[e,"strokeGround"]));{const r=()=>{if(e.stroked)s.width=e.strokeWidth;else{s.width=0;return}s.width=e.strokeWidth,s.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(s.hasDash=!0,s.hasArrow=!1):u==="hasArrow"?(s.hasDash=!1,s.hasArrow=!0):(s.hasDash=!1,s.hasArrow=!1);const d=e.strokeStyle;if(d.material==="hasDash"&&d.materialParams)try{const p=d.materialParams;Reflect.has(p,"gapColor")&&(s.gapColor=p.gapColor??[0,0,0,0]),Reflect.has(p,"dashLength")&&(s.dashLength=p.dashLength),Reflect.has(p,"dashPattern")&&(s.dashPattern=p.dashPattern)}catch(p){console.error(p)}else s.gapColor=[0,0,0,0],s.dashLength=0,s.dashPattern=0};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(l.disposableOn(r))}this.dispose(s.pickedEvent.disposableOn(r=>{Hi(r)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(r)}))}get czmDistanceMeasurement(){return this._czmDistanceMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmDistanceMeasurement:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmDistanceMeasurement:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(Wa,"type",Wa.register("ESCesiumViewer",a.ESDistanceMeasurement.type,Wa));let jd=Wa;class Ns extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_id",this.disposeVar(a.react(a.createGuid())));n&&(this.id=n)}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}(t=>{t.createDefaultProps=()=>({enabled:!0,showHelper:!0,allowPicking:!1,positions:a.reactPositions(void 0),reverse:!1,edgeColor:a.reactArray([1,1,1,1]),edgeWidth:2})})(Ns||(Ns={})),a.extendClassProps(Ns.prototype,Ns.createDefaultProps);class vA extends a.Destroyable{constructor(i,e){super(),this._czmESExcavate=i,this._eS3DTileset=e;for(let n=0;n<this._eS3DTileset.excavateId.length;n++){const o=this._eS3DTileset.excavateId[n];a.ESSceneObject.getSceneObjById(o)||this._eS3DTileset.excavateId.splice(n,1)}this._eS3DTileset.excavateId=[...this._eS3DTileset.excavateId,this._czmESExcavate.czmPolygonClipping.id],this.dispose(()=>{this._eS3DTileset.excavateId=[...this._eS3DTileset.excavateId.filter(n=>n!==this._czmESExcavate.czmPolygonClipping.id)]})}}class yA extends a.Destroyable{constructor(i){if(super(),this._czmESExcavate=i,!!this._czmESExcavate.viewer){for(let e=0;e<this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.length;e++){const n=this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId[e];a.ESSceneObject.getSceneObjById(n)||this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.splice(e,1)}this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId=[...this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId,this._czmESExcavate.czmPolygonClipping.id],this.dispose(()=>{this._czmESExcavate.viewer&&(this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId=[...this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.filter(e=>e!==this._czmESExcavate.czmPolygonClipping.id)])})}}}const Ga=class Ga extends Yt{constructor(e,n){super(e,n);m(this,"_czmPolygonClipping");m(this,"_tilesSceneObjectWithId");this._czmPolygonClipping=this.ad(new Ns(n,e.id)),this._tilesSceneObjectWithId=this.disposeVar(new a.ESSceneObjectWithId);const o=this.ad(a.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const l=a.ESSceneObject.getSceneObject(e.targetID);o.value=l?(l.components.main??l).id:""})),this.dispose(a.track([this._tilesSceneObjectWithId,"id"],o)),this.disposeVar(a.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged)),!n.viewer)return;const r=this._czmPolygonClipping;r.showHelper=!1,this.dispose(a.bind([r,"positions"],[e,"points"])),this.dispose(a.track([r,"allowPicking"],[e,"allowPicking"]));{const l=()=>{r.reverse=e.mode!=="in"};l(),this.dispose(e.modeChanged.disposableOn(l))}a.registerCreatedEventUpdate(this,e,()=>{const l=this.disposeVar(a.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged));this.disposeVar(new a.ObjResettingWithEvent(l,()=>{const{sceneObject:c,id:u}=this.tilesSceneObjectWithId;if(this.sceneObject.show)return u===""?new yA(this):!c||!(c instanceof a.ES3DTileset)?void 0:new vA(this,c)}))})}get czmPolygonClipping(){return this._czmPolygonClipping}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmPolygonClipping:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(Ga,"type",Ga.register("ESCesiumViewer",a.ESExcavate.type,Ga));let ep=Ga;const Ha=class Ha extends me{constructor(e,n){super(e,n);m(this,"_czmFireParticleSystem");if(this._czmFireParticleSystem=this.disposeVar(new bi(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmFireParticleSystem;s.endColor=[1,1,0,.4],s.startColor=[1,0,0,.5],s.particleLife=1,s.emissionRate=30,s.lifetime=1,s.imageSize=[1,1],s.emitter={type:"CircleEmitter",radius:.1},s.sizeInMeters=!0;{const r=()=>{s.startScale=10*(e.scale[0]>0?e.scale[0]:1),s.endScale=5*(e.scale[0]>0?e.scale[0]:1),s.minimumSpeed=10*(e.scale[0]>0?e.scale[0]:1),s.maximumSpeed=15*(e.scale[0]>0?e.scale[0]:1)};r(),this.ad(e.scaleChanged.don(r))}this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.track([s,"translation"],[e,"translation"])),this.dispose(Je([s,"rotation"],[e,"rotation"])),this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"image"],[e,"image"]))}get czmFireParticleSystem(){return this._czmFireParticleSystem}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmFireParticleSystem:r}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{const l=r.position;return ne(s.viewer,l,100,ei,e),o.flyOverEvent.emit(n,"over",s),!0}}};m(Ha,"type",Ha.register("ESCesiumViewer",a.ESFireParticleSystem.type,Ha));let tp=Ha;class Bs extends a.Destroyable{constructor(e,n){super();m(this,"_geoPath");m(this,"_geoPolyline");m(this,"_geoCanvasPointPoi");m(this,"_player");m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_currentDistance",this.disposeVar(a.react(0)));m(this,"_ratio",this.disposeVar(a.PlayerProperty.createPlayingRatio([this,"currentTime"],[this,"duration"])));this._geoPath=this.disposeVar(new a.ESPathImpl),this._geoPolyline=this.disposeVar(new Se(e,n)),this._geoCanvasPointPoi=this.disposeVar(new _n(e,n)),this._player=this.disposeVar(new a.Player),this.dispose(a.bind([this._geoPolyline,"positions"],[this,"positions"])),this.dispose(a.track([this._geoPolyline,"width"],[this,"width"])),this.dispose(a.track([this._geoPolyline,"ground"],[this,"ground"])),this.dispose(a.track([this._geoPolyline,"color"],[this,"color"])),this.dispose(a.track([this._geoPolyline,"hasDash"],[this,"hasDash"])),this.dispose(a.track([this._geoPolyline,"gapColor"],[this,"gapColor"])),this.dispose(a.track([this._geoPolyline,"dashLength"],[this,"dashLength"])),this.dispose(a.track([this._geoPolyline,"dashPattern"],[this,"dashPattern"])),this.dispose(a.track([this._geoPolyline,"hasArrow"],[this,"hasArrow"])),this.dispose(a.track([this._geoPolyline,"depthTest"],[this,"depthTest"])),this.dispose(a.track([this._geoPolyline,"arcType"],[this,"arcType"])),this.dispose(a.track([this._geoPolyline,"show"],[this,"show"])),this.dispose(a.track([this._geoPolyline,"show"],[this,"polylineShow"])),this.dispose(a.track([this._geoPolyline,"allowPicking"],[this,"allowPicking"])),this.dispose(a.track([this._geoPath,"currentTime"],[this,"currentDistance"])),this.dispose(a.track([this._geoPath,"leadTime"],[this,"leadTime"])),this.dispose(a.track([this._geoPath,"trailTime"],[this,"trailTime"])),this.dispose(a.track([this._geoPath,"show"],[this,"show"])),this.dispose(a.track([this._geoPath,"currentPoiShow"],[this,"currentPoiShow"]));{const o=()=>{this._geoCanvasPointPoi.show=(this.show??!0)&&(this.currentPoiShow??!0)};o(),this.dispose(this.showChanged.disposableOn(o)),this.dispose(this.currentPoiShowChanged.disposableOn(o))}this.dispose(a.track([this._geoCanvasPointPoi,"position"],[this,"currentPosition"]));{const o=()=>{if(this.positions){const r=this.granularity*Math.PI/180,l=pu(this.positions,this.arcType??"GEODESIC",r);if(l){this._geoPath.timePosRots=l.timePosRots,this.rotationRadius.some(c=>c>0)?(this._geoPath.addAroundPoints(this.rotationRadius,!0),this._geoPath.computeRotIfUndefinedUsingLerp(!0),this._geoPath.rotLerpMode="Lerp"):(this._geoPath.computeRotIfUndefinedUsingPrevLine(!0),this._geoPath.rotLerpMode=this.rotLerpMode);return}}this._geoPath.timePosRots=[]};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.granularityChanged,this.rotationRadiusChanged,this.rotLerpModeChanged));this.dispose(s.disposableOn(o))}{const o=()=>{if((this._player.duration??3e3)<=0){this.currentDistance=0;return}const s=this.totalDistance*((this._player.currentTime??0)/(this._player.duration??3e3));Math.abs(s-this.currentDistance)>.01&&(this.currentDistance=s)};o(),this.dispose(this._player.currentTimeChanged.disposableOn(o))}{const o=()=>{if(this.totalDistance<=0){this._player.currentTime=0;return}const s=this.currentDistance/this.totalDistance*(this.duration??3e3);Math.abs(s-(this._player.currentTime??0))>.01&&(this._player.currentTime=s)};o(),this.dispose(this.currentDistanceChanged.disposableOn(o))}this.dispose(a.bind([this._player,"loop"],[this,"loop"])),this.dispose(a.bind([this._player,"currentTime"],[this,"currentTime"])),this.dispose(a.bind([this._player,"duration"],[this,"duration"])),this.dispose(a.bind([this._player,"playing"],[this,"playing"])),this.dispose(a.bind([this._player,"speed"],[this,"speed"])),this.dispose(this._flyToEvent.disposableOn(o=>{this._geoPolyline.flyTo(o)}))}get geoPath(){return this._geoPath}get geoPolyline(){return this._geoPolyline}get geoCanvasPointPoi(){return this._geoCanvasPointPoi}get player(){return this._player}get currentInfo(){return this._geoPath.currentInfo}get currentInfoChanged(){return this._geoPath.currentInfoChanged}get currentIndex(){return this._geoPath.currentIndex}get currentIndexChanged(){return this._geoPath.currentIndexChanged}get currentPosition(){return this._geoPath.currentPosition}get currentPositionChanged(){return this._geoPath.currentPositionChanged}get currentRotation(){return this._geoPath.currentRotation}get currentRotationChanged(){return this._geoPath.currentRotationChanged}get accumDistances(){return this._geoPath.accumDistances}get accumDistancesChanged(){return this._geoPath.accumDistancesChanged}get totalDistance(){return this._geoPath.totalDistance}get totalDistanceChanged(){return this._geoPath.totalDistanceChanged}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}subPath(e,n){const o=this._geoPath.subPath(e,n);if(o)return o.map(s=>s[1])}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.changed}get ratio(){return this._ratio.value}set ratio(e){this._ratio.value=e}get ratioChanged(){return this._ratio.changed}get timePosRots(){return this.geoPath.timePosRots}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,currentPoiShow:!0,polylineShow:!0,positions:a.reactPositions(void 0),width:1,ground:!1,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",granularity:1,loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,depthTest:!1,leadTime:0,trailTime:0,rotationRadius:[0],rotLerpMode:"Next"})})(Bs||(Bs={})),a.extendClassProps(Bs.prototype,Bs.createDefaultProps);class qr extends a.Destroyable{constructor(e,n){super();m(this,"_geoPolylinePath");m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_currentDistance",this.disposeVar(a.react(0)));this._geoPolylinePath=this.disposeVar(new Bs(e,n)),this._geoPolylinePath.rotLerpMode="Lerp",this.dispose(a.bind([this._geoPolylinePath,"show"],[this,"show"])),this.dispose(a.bind([this._geoPolylinePath,"currentPoiShow"],[this,"currentPoiShow"])),this.dispose(a.bind([this._geoPolylinePath,"polylineShow"],[this,"polylineShow"])),this.dispose(a.bind([this._geoPolylinePath,"width"],[this,"width"])),this.dispose(a.bind([this._geoPolylinePath,"ground"],[this,"ground"])),this.dispose(a.bind([this._geoPolylinePath,"color"],[this,"color"])),this.dispose(a.bind([this._geoPolylinePath,"hasDash"],[this,"hasDash"])),this.dispose(a.bind([this._geoPolylinePath,"gapColor"],[this,"gapColor"])),this.dispose(a.bind([this._geoPolylinePath,"dashLength"],[this,"dashLength"])),this.dispose(a.bind([this._geoPolylinePath,"dashPattern"],[this,"dashPattern"])),this.dispose(a.bind([this._geoPolylinePath,"hasArrow"],[this,"hasArrow"])),this.dispose(a.bind([this._geoPolylinePath,"arcType"],[this,"arcType"])),this.dispose(a.bind([this._geoPolylinePath,"currentDistance"],[this,"currentDistance"])),this.dispose(a.bind([this._geoPolylinePath,"loop"],[this,"loop"])),this.dispose(a.bind([this._geoPolylinePath,"currentTime"],[this,"currentTime"])),this.dispose(a.bind([this._geoPolylinePath,"duration"],[this,"duration"])),this.dispose(a.bind([this._geoPolylinePath,"playing"],[this,"playing"])),this.dispose(a.bind([this._geoPolylinePath,"speed"],[this,"speed"])),this.dispose(a.bind([this._geoPolylinePath,"depthTest"],[this,"depthTest"])),this.dispose(a.track([this._geoPolylinePath,"leadTime"],[this,"leadTime"])),this.dispose(a.track([this._geoPolylinePath,"trailTime"],[this,"trailTime"])),this.dispose(a.track([this._geoPolylinePath,"allowPicking"],[this,"allowPicking"]));const o=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.resolutionChanged,this.sharpnessChanged)),s=()=>{try{if(this.positions&&this.positions.length>=2){const r=xu(this.positions,this.resolution,this.sharpness);this._geoPolylinePath.positions=r}else this._geoPolylinePath.positions=void 0}catch(r){console.error(r),this._geoPolylinePath.positions=void 0}};s(),this.dispose(o.disposableOn(s)),this.dispose(this._flyToEvent.disposableOn(r=>{this._geoPolylinePath.flyTo(r)}))}get geoPolylinePath(){return this._geoPolylinePath}get geoPath(){return this._geoPolylinePath.geoPath}get ratio(){return this._geoPolylinePath.ratio}set ratio(e){this._geoPolylinePath.ratio=e}get ratioChanged(){return this._geoPolylinePath.ratioChanged}get player(){return this._geoPolylinePath.player}get currentInfo(){return this._geoPolylinePath.currentInfo}get currentInfoChanged(){return this._geoPolylinePath.currentInfoChanged}get currentIndex(){return this._geoPolylinePath.currentIndex}get currentIndexChanged(){return this._geoPolylinePath.currentIndexChanged}get currentPosition(){return this._geoPolylinePath.currentPosition}get currentPositionChanged(){return this._geoPolylinePath.currentPositionChanged}get currentRotation(){return this._geoPolylinePath.currentRotation}get currentRotationChanged(){return this._geoPolylinePath.currentRotationChanged}get accumDistances(){return this._geoPolylinePath.accumDistances}get accumDistancesChanged(){return this._geoPolylinePath.accumDistances}get totalDistance(){return this._geoPolylinePath.totalDistance}get totalDistanceChanged(){return this._geoPolylinePath.totalDistanceChanged}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.changed}get timePosRots(){return this.geoPath.timePosRots}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,currentPoiShow:!0,polylineShow:!0,positions:a.reactPositions(void 0),width:1,ground:!1,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,resolution:1e3,sharpness:.85,depthTest:!1,leadTime:0,trailTime:0})})(qr||(qr={})),a.extendClassProps(qr.prototype,qr.createDefaultProps);const wA=[["256",256],["512",512],["1024",1024]],CA=[["LEFT","LEFT"],["NONE","NONE"],["RIGHT","RIGHT"]],Ut=class Ut extends a.ESVisualObject{constructor(e){super(e);m(this,"_pickFeaturesEvent",this.dv(new a.Event));this.ad(a.bind([this,"czmSplitDirection"],[this,"splitDirection"])),this.ad(a.bind([this,"czmAlpha"],[this,"opacity"]))}get pickFeaturesEvent(){return this._pickFeaturesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new a.StringProperty([this,"accessToken"],"令牌",Ut.defaults.accessToken),new a.Number4Property([this,"rectangle"],"矩形范围",Ut.defaults.rectangle),new a.JsonProperty([this,"url"],"服务地址",Ut.defaults.url),new a.JsonProperty([this,"style"],"样式配置",Ut.defaults.style),new a.NumberProperty([this,"zIndex"],"层级序号",Ut.defaults.zIndex),new a.EnumProperty([this,"tileSize"],wA,"瓦片大小",256),new a.NumberSliderProperty([this,"maximumLevel"],1,[1,24],"最大层级",Ut.defaults.maximumLevel),new a.NumberSliderProperty([this,"minimumLevel"],1,[0,24],"最小层级",Ut.defaults.minimumLevel),new a.EnumProperty([this,"scheme"],[["tms","tms"],["xyz","xyz"]],"影像类型",Ut.defaults.scheme)],more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.EnumProperty([this,"splitDirection"],CA,"splitDirection","NONE"),new a.GroupProperty([],"czm","czm"),new a.NumberProperty([this,"czmAlpha"],"透明度"),new a.NumberProperty([this,"czmBrightness"],"亮度"),new a.NumberProperty([this,"czmContrast"],"对比度"),new a.NumberProperty([this,"czmHue"],"色相"),new a.NumberProperty([this,"czmSaturation"],"饱和度"),new a.NumberProperty([this,"czmGamma"],"伽马值")]}}};m(Ut,"createDefaultProps",()=>({...a.ESVisualObject.createDefaultProps(),rectangle:a.reactJsonWithUndefined([-180,-90,180,90]),url:a.reactJson(""),zIndex:0,accessToken:"",tileSize:256,maximumLevel:18,minimumLevel:0,style:a.reactArrayWithUndefined([]),scheme:a.react("tms"),czmSplitDirection:"NONE",czmAlpha:1,opacity:1,splitDirection:"NONE",czmBrightness:1,czmContrast:1,czmHue:0,czmSaturation:1,czmGamma:1})),m(Ut,"type",Ut.register("ESMVTLayer",Ut,{chsName:"矢量瓦片图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载矢量瓦片图层。"}));let fh=Ut;const _A=t=>{const i=[{maxAlt:25e7,level:0},{maxAlt:25e6,level:1},{maxAlt:9e6,level:2},{maxAlt:7e6,level:3},{maxAlt:44e5,level:4},{maxAlt:2e6,level:5},{maxAlt:1e6,level:6},{maxAlt:493977,level:7},{maxAlt:218047,level:8},{maxAlt:124961,level:9},{maxAlt:56110,level:10},{maxAlt:4e4,level:11},{maxAlt:13222,level:12},{maxAlt:7e3,level:13},{maxAlt:4e3,level:14},{maxAlt:2500,level:15},{maxAlt:1500,level:16},{maxAlt:600,level:17},{maxAlt:250,level:18},{maxAlt:150,level:19},{maxAlt:50,level:20}];for(const{maxAlt:e,level:n}of i)if(t>=e)return n;return 20},PA=async(t,i,e)=>(await fetch(`http://abc.gggis.com:13001/xyzinfo/${e}/${t}/${i}`)).json(),bA=async t=>{var u;const i=(u=t.getCurrentCameraInfo())==null?void 0:u.position;if(!i)return;const e=i[0],n=i[1],o=i[2],s=_A(o);let r=Math.floor((e+180)/360*Math.pow(2,s+1)),l=Math.floor((90-n)/180*Math.pow(2,s));return await PA(r,l,s)};class SA extends a.Destroyable{constructor(i,e,n){super();const o=async()=>{const r=await bA(i);e.datesEvent.emit(r,i)};o();let s;s=setInterval(()=>{o()},3e3),this.d(()=>s&&clearInterval(s));{const r=()=>{const l=e.currentDate?e.currentDate:0;n.url=`http://abc.gggis.com:13001/timetile/tms/${l}/tilemapresource.xml`};r(),this.d(e.currentDateChanged.don(r))}}}const dr=class dr extends a.ESVisualObject{constructor(e){super(e);m(this,"_esImageryLayer",this.dv(new a.ESImageryLayer));m(this,"_datesEvent",this.dv(new a.Event));const n=this._esImageryLayer;this.d(this.components.disposableAdd(n)),n.zIndex=1,n.minimumLevel=1,n.maximumLevel=18,this.d(a.track([n,"show"],[this,"show"])),this.d(a.track([n,"zIndex"],[this,"zIndex"])),this.d(a.track([n,"rectangle"],[this,"rectangle"])),this.d(a.bind([n,"flyInParam"],[this,"flyInParam"])),this.d(a.bind([n,"flyToParam"],[this,"flyToParam"])),this.registerAttachedObjectForContainer(o=>new SA(o,this,n)),this.d(this.flyInEvent.don(o=>{n.flyIn(o)})),this.d(this.flyToEvent.don(o=>{n.flyTo(o)})),this.d(this.calcFlyToParamEvent.don(()=>{n.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{n.calcFlyInParam()}))}get esImageryLayer(){return this._esImageryLayer}get datesEvent(){return this._datesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new a.StringProperty([this,"currentDate"],"时间","0"),new a.NumberProperty([this,"zIndex"],"层级",0),new a.Number4Property([this,"rectangle"],"矩形范围",[-180,-90,180,90])]}}};m(dr,"createDefaultProps",()=>({...a.ESVisualObject.createDefaultProps(),currentDate:"",zIndex:0,rectangle:a.reactArray([-180,-90,180,90])})),m(dr,"type",dr.register("ESGeHistoryImagery",dr,{chsName:"谷歌历史影像",tags:["ESObjects","_ES_Impl_UE"],description:"ESGeHistoryImagery"}));let gh=dr;const Py=`async (dataSource, viewer) => {
743
+ `,s.uniformMap={u_gradientMap:{type:"texture",id:"5d45a4a4-4f5d-4424-aea5-181de75bd13b"},u_stripMinMaxValue:[0,1],u_ratio:0};let l=this.disposeVar(a.react(void 0));{const c=this.disposeVar(a.createProcessingFromAsyncFunc(async d=>{l.value=void 0;const p=e.url??a.ESDataMesh.defaults.url;if(!p)return;await d.promise(a.sleep(200));const f=(e.maxTime??23)|0;l.value=await d.promise(gA(a.ESSceneObject.context.getStrFromEnv(typeof p=="string"?p:p.url),f+1))}));c.start();const u=this.disposeVar(a.createNextAnimateFrameEvent(e.urlChanged,e.maxTimeChanged));this.dispose(u.disposableOn(()=>c.restart()))}{class c{constructor(p){this._buffer=p}[Symbol.iterator](){return mA(this._buffer)}}const u=()=>{if(!l.value)return;const{vertexBuffer:d,propBuffers:p,indexBuffer:f}=l.value,{minPos:g,maxPos:v}=a.getMinMaxCorner(new c(d));s.setLocalAxisedBoundingBox(g,v);const y=(e.maxTime??23)|0;let w=(e.currentTime??a.ESDataMesh.defaults.currentTime)/y;w=w<0?0:w>1?1:w;const P=w*y;let C=w*y|0,S=P-C;if(C>=y&&(C=y-1,S=1),!Number.isFinite(S)){console.error("!Number.isFinite(rr)");debugger;return}if(s.indexTypedArray=f,!p[C]||!p[C+1]){console.error("!propBuffers[i] || !propBuffers[i + 1]");debugger}s.attributes={a_position:{typedArray:d,componentsPerAttribute:3},a_prop:{typedArray:p[C],componentsPerAttribute:3},a_prop2:{typedArray:p[C+1],componentsPerAttribute:3}},s.uniformMap={u_gradientMap:{type:"texture",id:`${r.id}`},u_stripMinMaxValue:[e.minPropValue??a.ESDataMesh.defaults.minPropValue,e.maxPropValue??a.ESDataMesh.defaults.maxPropValue],u_ratio:S}};u(),this.dispose(e.maxTimeChanged.disposableOn(u)),this.dispose(e.currentTimeChanged.disposableOn(u)),this.dispose(e.minPropValueChanged.disposableOn(u)),this.dispose(e.maxPropValueChanged.disposableOn(u)),this.dispose(l.changed.disposableOn(u))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}get czmTexture(){return this._czmTexture}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmCustomPrimitive:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(Rt(s,o,n,e,r,!0),!0):!1}};m(Ba,"type",Ba.register("ESCesiumViewer",a.ESDataMesh.type,Ba));let Kd=Ba;const Go=class Go extends a.Destroyable{constructor(e,n){super();m(this,"_pickedEvent",this.disposeVar(new a.Event));m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_heading",this.disposeVar(a.react(0)));m(this,"_textFunc",this.disposeVar(a.react(void 0)));const o=this;{const l=()=>{if(this.positions&&this.positions.length>=2){let u=0;this.arcType===void 0||this.arcType==="GEODESIC"?u=a.geoHeading(this.positions[0],this.positions[1]):this.arcType==="RHUMB"?u=a.geoRhumbHeading(this.positions[0],this.positions[1]):this.arcType==="NONE"?u=a.geoHeading(this.positions[0],this.positions[1]):console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`),this._heading.value=this.angleMode==="-180~180"?a.clampN180_180(u):a.clamp0_360(u)}};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.angleModeChanged));this.dispose(c.disposableOn(l))}const s=this.disposeVar(new Se(e,n));s.loop=!1,this.dispose(a.track([s,"allowPicking"],[o,"allowPicking"])),this.dispose(a.bind([s,"arcType"],[o,"arcType"])),this.dispose(a.bind([s,"color"],[o,"color"])),this.dispose(a.bind([s,"dashLength"],[o,"dashLength"])),this.dispose(a.bind([s,"dashPattern"],[o,"dashPattern"])),this.dispose(a.bind([s,"gapColor"],[o,"gapColor"])),this.dispose(a.bind([s,"hasArrow"],[o,"hasArrow"])),this.dispose(a.bind([s,"hasDash"],[o,"hasDash"])),this.dispose(a.bind([s,"positions"],[o,"positions"])),this.dispose(a.bind([s,"show"],[o,"show"])),this.dispose(a.bind([s,"width"],[o,"width"])),this.dispose(a.bind([s,"depthTest"],[o,"depthTest"])),this.dispose(a.bind([s,"ground"],[o,"strokeGround"])),this.dispose(o.flyToEvent.disposableOn(l=>{e.actived&&s.flyTo(l)}));const r=this.disposeVar(new He(e,n));this.dispose(a.bind([r,"shadowDom"],[o,"shadowDom"])),this.dispose(a.bind([r,"cssAllInitial"],[o,"cssAllInitial"])),this.dispose(a.bind([r,"show"],[o,"show"]));{const l=()=>{o.positions&&o.positions.length>=2?r.position=o.positions[1]:r.position=void 0};l(),this.dispose(o.positionsChanged.disposableOn(l))}{const l=()=>{const{heading:u}=o,d=(o.textFunc??Go.defaultTextFunc_度格式)(u);r.innerHTML=ao(`方向: ${d}`,24)};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(o.headingChanged,o.textFuncChanged));this.dispose(c.disposableOn(l))}this.ad(r.pickedEvent.don(l=>{Hi(l)===0&&this.pickedEvent.emit(l)}))}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get heading(){return this._heading.value}get headingChanged(){return this._heading.changed}get textFunc(){return this._textFunc.value}set textFunc(e){this._textFunc.value=e}get textFuncChanged(){return this._textFunc.changed}};m(Go,"defaultTextFunc_度格式",e=>`${e.toFixed(5)}°`),m(Go,"defaultTextFunc_度分格式",e=>`${br(e,!0)}`),m(Go,"defaultTextFunc_度分秒格式",e=>`${br(e,!1)}`),m(Go,"defaults",{positions:[]});let Ao=Go;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(void 0),width:8,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!0,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1,angleMode:"-180~180",strokeGround:!1})})(Ao||(Ao={})),a.extendClassProps(Ao.prototype,Ao.createDefaultProps);const Va=class Va extends yt{constructor(e,n){super(e,n);m(this,"_czmDirectionMeasurement");if(this._czmDirectionMeasurement=this.disposeVar(new Ao(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmDirectionMeasurement;s.angleMode="0~360",this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.bind([s,"strokeGround"],[e,"strokeGround"]));{const r=()=>{if(e.stroked)s.width=e.strokeWidth;else{s.width=0;return}s.width=e.strokeWidth,s.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(s.hasDash=!0,s.hasArrow=!1):u==="hasArrow"?(s.hasDash=!1,s.hasArrow=!0):u==="normal"?(s.hasDash=!1,s.hasArrow=!1):(s.hasDash=!1,s.hasArrow=!0);const d=e.strokeStyle;if(d.material==="hasDash"&&d.materialParams)try{const p=d.materialParams;Reflect.has(p,"gapColor")&&(s.gapColor=p.gapColor??[0,0,0,0]),Reflect.has(p,"dashLength")&&(s.dashLength=p.dashLength),Reflect.has(p,"dashPattern")&&(s.dashPattern=p.dashPattern)}catch(p){console.error(p)}else s.gapColor=[0,0,0,0],s.dashLength=0,s.dashPattern=0};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(l.disposableOn(r))}this.dispose(s.pickedEvent.disposableOn(r=>{Hi(r)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(r)}))}get czmDirectionMeasurement(){return this._czmDirectionMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmDirectionMeasurement:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmDirectionMeasurement:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(Va,"type",Va.register("ESCesiumViewer",a.ESDirectionMeasurement.type,Va));let Jd=Va;class Ls extends a.Destroyable{constructor(e,n){super();m(this,"_pickedEvent",this.disposeVar(new a.Event));m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_distances",this.disposeVar(a.reactArray([])));const o=async()=>{this.strokeGround&&e.viewer?this._distances.value=await bm(e.viewer,this.positions??[]):this._distances.value=a.getDistancesFromPositions(this.positions??[],this.arcType)};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.strokeGroundChanged));this.dispose(s.disposableOn(o));const r=this.disposeVar(new Se(e,n));r.loop=!1,this.dispose(a.track([r,"allowPicking"],[this,"allowPicking"])),this.dispose(a.bind([r,"arcType"],[this,"arcType"])),this.dispose(a.bind([r,"color"],[this,"color"])),this.dispose(a.bind([r,"dashLength"],[this,"dashLength"])),this.dispose(a.bind([r,"dashPattern"],[this,"dashPattern"])),this.dispose(a.bind([r,"gapColor"],[this,"gapColor"])),this.dispose(a.bind([r,"hasArrow"],[this,"hasArrow"])),this.dispose(a.bind([r,"hasDash"],[this,"hasDash"])),this.dispose(a.bind([r,"positions"],[this,"positions"])),this.dispose(a.bind([r,"show"],[this,"show"])),this.dispose(a.bind([r,"width"],[this,"width"])),this.dispose(a.bind([r,"depthTest"],[this,"depthTest"])),this.dispose(a.bind([r,"ground"],[this,"strokeGround"])),this.dispose(this.flyToEvent.disposableOn(l=>{e.actived&&r.flyTo(l)}));{const l=[],c=()=>{for(let d of l)d.destroy();l.length=0};this.dispose(c);const u=()=>{if(c(),!this.positions)return;if(this.positions.length>0&&this.distances.length>0){const p=Eu("起点",this.positions[0],e,n);p.dispose(a.track([p,"show"],[this,"show"])),p.dispose(a.track([p,"shadowDom"],[this,"shadowDom"])),p.dispose(a.track([p,"cssAllInitial"],[this,"cssAllInitial"])),l.push(p)}const d=this.distances.length;for(let p=0;p<d;++p){const f=this.distances[p],g=this.positions[p+1],v=Eu(`长度: ${bc(f)}`,g,e,n);v.dispose(a.track([v,"show"],[this,"show"])),v.dispose(a.track([v,"shadowDom"],[this,"shadowDom"])),v.dispose(a.track([v,"cssAllInitial"],[this,"cssAllInitial"])),this.ad(v.pickedEvent.don(y=>{Hi(y)===0&&this.pickedEvent.emit(y)})),l.push(v)}};u(),this.dispose(this.distancesChanged.disposableOn(()=>a.inOrderRunning(u)))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get distances(){return this._distances.value}get distancesChanged(){return this._distances.changed}}m(Ls,"defaults",{positions:[]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(void 0),width:1,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1,strokeGround:!1})})(Ls||(Ls={})),a.extendClassProps(Ls.prototype,Ls.createDefaultProps);const Ua=class Ua extends yt{constructor(e,n){super(e,n);m(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new Se(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._geoPolyline;this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"width"],[e,"strokeWidth"])),this.dispose(a.track([s,"color"],[e,"strokeColor"])),this.dispose(a.track([s,"ground"],[e,"strokeGround"]));{const r=()=>{s.show=e.show&&e.stroked};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(l.disposableOn(r))}}get geoPolyline(){return this._geoPolyline}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoPolyline:r}=this;return s.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,geoPolyline:r}=this;return s.actived?o.flyInParam?(super.flyIn(e,n),!0):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(Ua,"type",Ua.register("ESCesiumViewer",a.ESGeoLineString.type,Ua));let Os=Ua;const Wa=class Wa extends Os{constructor(e,n){super(e,n);m(this,"_czmDistanceMeasurement");if(this._czmDistanceMeasurement=this.disposeVar(new Ls(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmDistanceMeasurement:s}=this;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.bind([s,"strokeGround"],[e,"strokeGround"]));{const r=()=>{if(e.stroked)s.width=e.strokeWidth;else{s.width=0;return}s.width=e.strokeWidth,s.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(s.hasDash=!0,s.hasArrow=!1):u==="hasArrow"?(s.hasDash=!1,s.hasArrow=!0):(s.hasDash=!1,s.hasArrow=!1);const d=e.strokeStyle;if(d.material==="hasDash"&&d.materialParams)try{const p=d.materialParams;Reflect.has(p,"gapColor")&&(s.gapColor=p.gapColor??[0,0,0,0]),Reflect.has(p,"dashLength")&&(s.dashLength=p.dashLength),Reflect.has(p,"dashPattern")&&(s.dashPattern=p.dashPattern)}catch(p){console.error(p)}else s.gapColor=[0,0,0,0],s.dashLength=0,s.dashPattern=0};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(l.disposableOn(r))}this.dispose(s.pickedEvent.disposableOn(r=>{Hi(r)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(r)}))}get czmDistanceMeasurement(){return this._czmDistanceMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmDistanceMeasurement:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmDistanceMeasurement:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(Wa,"type",Wa.register("ESCesiumViewer",a.ESDistanceMeasurement.type,Wa));let jd=Wa;class Ns extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_id",this.disposeVar(a.react(a.createGuid())));n&&(this.id=n)}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}(t=>{t.createDefaultProps=()=>({enabled:!0,showHelper:!0,allowPicking:!1,positions:a.reactPositions(void 0),reverse:!1,edgeColor:a.reactArray([1,1,1,1]),edgeWidth:2})})(Ns||(Ns={})),a.extendClassProps(Ns.prototype,Ns.createDefaultProps);class vA extends a.Destroyable{constructor(i,e){super(),this._czmESExcavate=i,this._eS3DTileset=e;for(let n=0;n<this._eS3DTileset.excavateId.length;n++){const o=this._eS3DTileset.excavateId[n];a.ESSceneObject.getSceneObjById(o)||this._eS3DTileset.excavateId.splice(n,1)}this._eS3DTileset.excavateId=[...this._eS3DTileset.excavateId,this._czmESExcavate.czmPolygonClipping.id],this.dispose(()=>{this._eS3DTileset.excavateId=[...this._eS3DTileset.excavateId.filter(n=>n!==this._czmESExcavate.czmPolygonClipping.id)]})}}class yA extends a.Destroyable{constructor(i){if(super(),this._czmESExcavate=i,!!this._czmESExcavate.viewer){for(let e=0;e<this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.length;e++){const n=this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId[e];a.ESSceneObject.getSceneObjById(n)||this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.splice(e,1)}this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId=[...this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId,this._czmESExcavate.czmPolygonClipping.id],this.dispose(()=>{this._czmESExcavate.viewer&&(this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId=[...this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.filter(e=>e!==this._czmESExcavate.czmPolygonClipping.id)])})}}}const Ga=class Ga extends Yt{constructor(e,n){super(e,n);m(this,"_czmPolygonClipping");m(this,"_tilesSceneObjectWithId");this._czmPolygonClipping=this.ad(new Ns(n,e.id)),this._tilesSceneObjectWithId=this.disposeVar(new a.ESSceneObjectWithId);const o=this.ad(a.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const l=a.ESSceneObject.getSceneObject(e.targetID);o.value=l?(l.components.main??l).id:""})),this.dispose(a.track([this._tilesSceneObjectWithId,"id"],o)),this.disposeVar(a.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged)),!n.viewer)return;const r=this._czmPolygonClipping;r.showHelper=!1,this.dispose(a.bind([r,"positions"],[e,"points"])),this.dispose(a.track([r,"allowPicking"],[e,"allowPicking"]));{const l=()=>{r.reverse=e.mode!=="in"};l(),this.dispose(e.modeChanged.disposableOn(l))}a.registerCreatedEventUpdate(this,e,()=>{const l=this.disposeVar(a.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged));this.disposeVar(new a.ObjResettingWithEvent(l,()=>{const{sceneObject:c,id:u}=this.tilesSceneObjectWithId;if(this.sceneObject.show)return u===""?new yA(this):!c||!(c instanceof a.ES3DTileset)?void 0:new vA(this,c)}))})}get czmPolygonClipping(){return this._czmPolygonClipping}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmPolygonClipping:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(Ga,"type",Ga.register("ESCesiumViewer",a.ESExcavate.type,Ga));let ep=Ga;const Ha=class Ha extends me{constructor(e,n){super(e,n);m(this,"_czmFireParticleSystem");if(this._czmFireParticleSystem=this.disposeVar(new bi(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmFireParticleSystem;s.endColor=[1,1,0,.4],s.startColor=[1,0,0,.5],s.particleLife=1,s.emissionRate=30,s.lifetime=1,s.imageSize=[1,1],s.emitter={type:"CircleEmitter",radius:.1},s.sizeInMeters=!0;{const r=()=>{s.startScale=10*(e.scale[0]>0?e.scale[0]:1),s.endScale=5*(e.scale[0]>0?e.scale[0]:1),s.minimumSpeed=10*(e.scale[0]>0?e.scale[0]:1),s.maximumSpeed=15*(e.scale[0]>0?e.scale[0]:1)};r(),this.ad(e.scaleChanged.don(r))}this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.track([s,"translation"],[e,"translation"])),this.dispose(Je([s,"rotation"],[e,"rotation"])),this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"image"],[e,"image"]))}get czmFireParticleSystem(){return this._czmFireParticleSystem}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmFireParticleSystem:r}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{const l=r.position;return ne(s.viewer,l,100,ei,e),o.flyOverEvent.emit(n,"over",s),!0}}};m(Ha,"type",Ha.register("ESCesiumViewer",a.ESFireParticleSystem.type,Ha));let tp=Ha;class Bs extends a.Destroyable{constructor(e,n){super();m(this,"_geoPath");m(this,"_geoPolyline");m(this,"_geoCanvasPointPoi");m(this,"_player");m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_currentDistance",this.disposeVar(a.react(0)));m(this,"_ratio",this.disposeVar(a.PlayerProperty.createPlayingRatio([this,"currentTime"],[this,"duration"])));this._geoPath=this.disposeVar(new a.ESPathImpl),this._geoPolyline=this.disposeVar(new Se(e,n)),this._geoCanvasPointPoi=this.disposeVar(new _n(e,n)),this._player=this.disposeVar(new a.Player),this.dispose(a.bind([this._geoPolyline,"positions"],[this,"positions"])),this.dispose(a.track([this._geoPolyline,"width"],[this,"width"])),this.dispose(a.track([this._geoPolyline,"ground"],[this,"ground"])),this.dispose(a.track([this._geoPolyline,"color"],[this,"color"])),this.dispose(a.track([this._geoPolyline,"hasDash"],[this,"hasDash"])),this.dispose(a.track([this._geoPolyline,"gapColor"],[this,"gapColor"])),this.dispose(a.track([this._geoPolyline,"dashLength"],[this,"dashLength"])),this.dispose(a.track([this._geoPolyline,"dashPattern"],[this,"dashPattern"])),this.dispose(a.track([this._geoPolyline,"hasArrow"],[this,"hasArrow"])),this.dispose(a.track([this._geoPolyline,"depthTest"],[this,"depthTest"])),this.dispose(a.track([this._geoPolyline,"arcType"],[this,"arcType"])),this.dispose(a.track([this._geoPolyline,"show"],[this,"show"])),this.dispose(a.track([this._geoPolyline,"show"],[this,"polylineShow"])),this.dispose(a.track([this._geoPolyline,"allowPicking"],[this,"allowPicking"])),this.dispose(a.track([this._geoPath,"currentTime"],[this,"currentDistance"])),this.dispose(a.track([this._geoPath,"leadTime"],[this,"leadTime"])),this.dispose(a.track([this._geoPath,"trailTime"],[this,"trailTime"])),this.dispose(a.track([this._geoPath,"show"],[this,"show"])),this.dispose(a.track([this._geoPath,"currentPoiShow"],[this,"currentPoiShow"]));{const o=()=>{this._geoCanvasPointPoi.show=(this.show??!0)&&(this.currentPoiShow??!0)};o(),this.dispose(this.showChanged.disposableOn(o)),this.dispose(this.currentPoiShowChanged.disposableOn(o))}this.dispose(a.track([this._geoCanvasPointPoi,"position"],[this,"currentPosition"]));{const o=()=>{if(this.positions){const r=this.granularity*Math.PI/180,l=pu(this.positions,this.arcType??"GEODESIC",r);if(l){this._geoPath.timePosRots=l.timePosRots,this.rotationRadius.some(c=>c>0)?(this._geoPath.addAroundPoints(this.rotationRadius,!0),this._geoPath.computeRotIfUndefinedUsingLerp(!0),this._geoPath.rotLerpMode="Lerp"):(this._geoPath.computeRotIfUndefinedUsingPrevLine(!0),this._geoPath.rotLerpMode=this.rotLerpMode);return}}this._geoPath.timePosRots=[]};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.granularityChanged,this.rotationRadiusChanged,this.rotLerpModeChanged));this.dispose(s.disposableOn(o))}{const o=()=>{if((this._player.duration??3e3)<=0){this.currentDistance=0;return}const s=this.totalDistance*((this._player.currentTime??0)/(this._player.duration??3e3));Math.abs(s-this.currentDistance)>.01&&(this.currentDistance=s)};o(),this.dispose(this._player.currentTimeChanged.disposableOn(o))}{const o=()=>{if(this.totalDistance<=0){this._player.currentTime=0;return}const s=this.currentDistance/this.totalDistance*(this.duration??3e3);Math.abs(s-(this._player.currentTime??0))>.01&&(this._player.currentTime=s)};o(),this.dispose(this.currentDistanceChanged.disposableOn(o))}this.dispose(a.bind([this._player,"loop"],[this,"loop"])),this.dispose(a.bind([this._player,"currentTime"],[this,"currentTime"])),this.dispose(a.bind([this._player,"duration"],[this,"duration"])),this.dispose(a.bind([this._player,"playing"],[this,"playing"])),this.dispose(a.bind([this._player,"speed"],[this,"speed"])),this.dispose(this._flyToEvent.disposableOn(o=>{this._geoPolyline.flyTo(o)}))}get geoPath(){return this._geoPath}get geoPolyline(){return this._geoPolyline}get geoCanvasPointPoi(){return this._geoCanvasPointPoi}get player(){return this._player}get currentInfo(){return this._geoPath.currentInfo}get currentInfoChanged(){return this._geoPath.currentInfoChanged}get currentIndex(){return this._geoPath.currentIndex}get currentIndexChanged(){return this._geoPath.currentIndexChanged}get currentPosition(){return this._geoPath.currentPosition}get currentPositionChanged(){return this._geoPath.currentPositionChanged}get currentRotation(){return this._geoPath.currentRotation}get currentRotationChanged(){return this._geoPath.currentRotationChanged}get accumDistances(){return this._geoPath.accumDistances}get accumDistancesChanged(){return this._geoPath.accumDistancesChanged}get totalDistance(){return this._geoPath.totalDistance}get totalDistanceChanged(){return this._geoPath.totalDistanceChanged}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}subPath(e,n){const o=this._geoPath.subPath(e,n);if(o)return o.map(s=>s[1])}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.changed}get ratio(){return this._ratio.value}set ratio(e){this._ratio.value=e}get ratioChanged(){return this._ratio.changed}get timePosRots(){return this.geoPath.timePosRots}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,currentPoiShow:!0,polylineShow:!0,positions:a.reactPositions(void 0),width:1,ground:!1,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",granularity:1,loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,depthTest:!1,leadTime:0,trailTime:0,rotationRadius:[0],rotLerpMode:"Next"})})(Bs||(Bs={})),a.extendClassProps(Bs.prototype,Bs.createDefaultProps);class qr extends a.Destroyable{constructor(e,n){super();m(this,"_geoPolylinePath");m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_currentDistance",this.disposeVar(a.react(0)));this._geoPolylinePath=this.disposeVar(new Bs(e,n)),this._geoPolylinePath.rotLerpMode="Lerp",this.dispose(a.bind([this._geoPolylinePath,"show"],[this,"show"])),this.dispose(a.bind([this._geoPolylinePath,"currentPoiShow"],[this,"currentPoiShow"])),this.dispose(a.bind([this._geoPolylinePath,"polylineShow"],[this,"polylineShow"])),this.dispose(a.bind([this._geoPolylinePath,"width"],[this,"width"])),this.dispose(a.bind([this._geoPolylinePath,"ground"],[this,"ground"])),this.dispose(a.bind([this._geoPolylinePath,"color"],[this,"color"])),this.dispose(a.bind([this._geoPolylinePath,"hasDash"],[this,"hasDash"])),this.dispose(a.bind([this._geoPolylinePath,"gapColor"],[this,"gapColor"])),this.dispose(a.bind([this._geoPolylinePath,"dashLength"],[this,"dashLength"])),this.dispose(a.bind([this._geoPolylinePath,"dashPattern"],[this,"dashPattern"])),this.dispose(a.bind([this._geoPolylinePath,"hasArrow"],[this,"hasArrow"])),this.dispose(a.bind([this._geoPolylinePath,"arcType"],[this,"arcType"])),this.dispose(a.bind([this._geoPolylinePath,"currentDistance"],[this,"currentDistance"])),this.dispose(a.bind([this._geoPolylinePath,"loop"],[this,"loop"])),this.dispose(a.bind([this._geoPolylinePath,"currentTime"],[this,"currentTime"])),this.dispose(a.bind([this._geoPolylinePath,"duration"],[this,"duration"])),this.dispose(a.bind([this._geoPolylinePath,"playing"],[this,"playing"])),this.dispose(a.bind([this._geoPolylinePath,"speed"],[this,"speed"])),this.dispose(a.bind([this._geoPolylinePath,"depthTest"],[this,"depthTest"])),this.dispose(a.track([this._geoPolylinePath,"leadTime"],[this,"leadTime"])),this.dispose(a.track([this._geoPolylinePath,"trailTime"],[this,"trailTime"])),this.dispose(a.track([this._geoPolylinePath,"allowPicking"],[this,"allowPicking"]));const o=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.resolutionChanged,this.sharpnessChanged)),s=()=>{try{if(this.positions&&this.positions.length>=2){const r=xu(this.positions,this.resolution,this.sharpness);this._geoPolylinePath.positions=r}else this._geoPolylinePath.positions=void 0}catch(r){console.error(r),this._geoPolylinePath.positions=void 0}};s(),this.dispose(o.disposableOn(s)),this.dispose(this._flyToEvent.disposableOn(r=>{this._geoPolylinePath.flyTo(r)}))}get geoPolylinePath(){return this._geoPolylinePath}get geoPath(){return this._geoPolylinePath.geoPath}get ratio(){return this._geoPolylinePath.ratio}set ratio(e){this._geoPolylinePath.ratio=e}get ratioChanged(){return this._geoPolylinePath.ratioChanged}get player(){return this._geoPolylinePath.player}get currentInfo(){return this._geoPolylinePath.currentInfo}get currentInfoChanged(){return this._geoPolylinePath.currentInfoChanged}get currentIndex(){return this._geoPolylinePath.currentIndex}get currentIndexChanged(){return this._geoPolylinePath.currentIndexChanged}get currentPosition(){return this._geoPolylinePath.currentPosition}get currentPositionChanged(){return this._geoPolylinePath.currentPositionChanged}get currentRotation(){return this._geoPolylinePath.currentRotation}get currentRotationChanged(){return this._geoPolylinePath.currentRotationChanged}get accumDistances(){return this._geoPolylinePath.accumDistances}get accumDistancesChanged(){return this._geoPolylinePath.accumDistances}get totalDistance(){return this._geoPolylinePath.totalDistance}get totalDistanceChanged(){return this._geoPolylinePath.totalDistanceChanged}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.changed}get timePosRots(){return this.geoPath.timePosRots}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,currentPoiShow:!0,polylineShow:!0,positions:a.reactPositions(void 0),width:1,ground:!1,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,resolution:1e3,sharpness:.85,depthTest:!1,leadTime:0,trailTime:0})})(qr||(qr={})),a.extendClassProps(qr.prototype,qr.createDefaultProps);const wA=[["256",256],["512",512],["1024",1024]],CA=[["LEFT","LEFT"],["NONE","NONE"],["RIGHT","RIGHT"]],Ut=class Ut extends a.ESVisualObject{constructor(e){super(e);m(this,"_pickFeaturesEvent",this.dv(new a.Event));this.ad(a.bind([this,"czmSplitDirection"],[this,"splitDirection"])),this.ad(a.bind([this,"czmAlpha"],[this,"opacity"]))}get pickFeaturesEvent(){return this._pickFeaturesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new a.StringProperty([this,"accessToken"],"令牌",Ut.defaults.accessToken),new a.Number4Property([this,"rectangle"],"矩形范围",Ut.defaults.rectangle),new a.JsonProperty([this,"url"],"服务地址",Ut.defaults.url),new a.JsonProperty([this,"style"],"样式配置",Ut.defaults.style),new a.NumberProperty([this,"zIndex"],"层级序号",Ut.defaults.zIndex),new a.EnumProperty([this,"tileSize"],wA,"瓦片大小",256),new a.NumberSliderProperty([this,"maximumLevel"],1,[1,24],"最大层级",Ut.defaults.maximumLevel),new a.NumberSliderProperty([this,"minimumLevel"],1,[0,24],"最小层级",Ut.defaults.minimumLevel),new a.EnumProperty([this,"scheme"],[["tms","tms"],["xyz","xyz"]],"影像类型",Ut.defaults.scheme),new a.EnumProperty([this,"heightReference"],[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]],"高度参考")],more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.EnumProperty([this,"splitDirection"],CA,"splitDirection","NONE"),new a.GroupProperty([],"czm","czm"),new a.NumberProperty([this,"czmAlpha"],"透明度"),new a.NumberProperty([this,"czmBrightness"],"亮度"),new a.NumberProperty([this,"czmContrast"],"对比度"),new a.NumberProperty([this,"czmHue"],"色相"),new a.NumberProperty([this,"czmSaturation"],"饱和度"),new a.NumberProperty([this,"czmGamma"],"伽马值")]}}};m(Ut,"createDefaultProps",()=>({...a.ESVisualObject.createDefaultProps(),rectangle:a.reactJsonWithUndefined([-180,-90,180,90]),url:a.reactJson(""),zIndex:0,accessToken:"",tileSize:256,maximumLevel:18,minimumLevel:0,style:a.reactArrayWithUndefined([]),scheme:a.react("xyz"),czmSplitDirection:"NONE",heightReference:"NONE",czmAlpha:1,opacity:1,splitDirection:"NONE",czmBrightness:1,czmContrast:1,czmHue:0,czmSaturation:1,czmGamma:1})),m(Ut,"type",Ut.register("ESMVTLayer",Ut,{chsName:"矢量瓦片图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载矢量瓦片图层。"}));let fh=Ut;const _A=t=>{const i=[{maxAlt:25e7,level:0},{maxAlt:25e6,level:1},{maxAlt:9e6,level:2},{maxAlt:7e6,level:3},{maxAlt:44e5,level:4},{maxAlt:2e6,level:5},{maxAlt:1e6,level:6},{maxAlt:493977,level:7},{maxAlt:218047,level:8},{maxAlt:124961,level:9},{maxAlt:56110,level:10},{maxAlt:4e4,level:11},{maxAlt:13222,level:12},{maxAlt:7e3,level:13},{maxAlt:4e3,level:14},{maxAlt:2500,level:15},{maxAlt:1500,level:16},{maxAlt:600,level:17},{maxAlt:250,level:18},{maxAlt:150,level:19},{maxAlt:50,level:20}];for(const{maxAlt:e,level:n}of i)if(t>=e)return n;return 20},PA=async(t,i,e)=>(await fetch(`http://abc.gggis.com:13001/xyzinfo/${e}/${t}/${i}`)).json(),bA=async t=>{var u;const i=(u=t.getCurrentCameraInfo())==null?void 0:u.position;if(!i)return;const e=i[0],n=i[1],o=i[2],s=_A(o);let r=Math.floor((e+180)/360*Math.pow(2,s+1)),l=Math.floor((90-n)/180*Math.pow(2,s));return await PA(r,l,s)};class SA extends a.Destroyable{constructor(i,e,n){super();const o=async()=>{const r=await bA(i);e.datesEvent.emit(r,i)};o();let s;s=setInterval(()=>{o()},3e3),this.d(()=>s&&clearInterval(s));{const r=()=>{const l=e.currentDate?e.currentDate:0;n.url=`http://abc.gggis.com:13001/timetile/tms/${l}/tilemapresource.xml`};r(),this.d(e.currentDateChanged.don(r))}}}const dr=class dr extends a.ESVisualObject{constructor(e){super(e);m(this,"_esImageryLayer",this.dv(new a.ESImageryLayer));m(this,"_datesEvent",this.dv(new a.Event));const n=this._esImageryLayer;this.d(this.components.disposableAdd(n)),n.zIndex=1,n.minimumLevel=1,n.maximumLevel=18,this.d(a.track([n,"show"],[this,"show"])),this.d(a.track([n,"zIndex"],[this,"zIndex"])),this.d(a.track([n,"rectangle"],[this,"rectangle"])),this.d(a.bind([n,"flyInParam"],[this,"flyInParam"])),this.d(a.bind([n,"flyToParam"],[this,"flyToParam"])),this.registerAttachedObjectForContainer(o=>new SA(o,this,n)),this.d(this.flyInEvent.don(o=>{n.flyIn(o)})),this.d(this.flyToEvent.don(o=>{n.flyTo(o)})),this.d(this.calcFlyToParamEvent.don(()=>{n.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{n.calcFlyInParam()}))}get esImageryLayer(){return this._esImageryLayer}get datesEvent(){return this._datesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new a.StringProperty([this,"currentDate"],"时间","0"),new a.NumberProperty([this,"zIndex"],"层级",0),new a.Number4Property([this,"rectangle"],"矩形范围",[-180,-90,180,90])]}}};m(dr,"createDefaultProps",()=>({...a.ESVisualObject.createDefaultProps(),currentDate:"",zIndex:0,rectangle:a.reactArray([-180,-90,180,90])})),m(dr,"type",dr.register("ESGeHistoryImagery",dr,{chsName:"谷歌历史影像",tags:["ESObjects","_ES_Impl_UE"],description:"ESGeHistoryImagery"}));let gh=dr;const Py=`async (dataSource, viewer) => {
744
744
  viewer.clock.shouldAnimate = false;
745
745
  const rider = dataSource.entities.getById("tour");
746
746
  await viewer.flyTo(rider)
@@ -1743,7 +1743,7 @@ ${$y}
1743
1743
  vec4 imageColor = texture(u_image, fract(v_st * u_stScale - addst));
1744
1744
  out_FragColor = imageColor * u_color;
1745
1745
  }
1746
- `};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(this.heightChanged,this.positionsChanged));this.dispose(l.disposableOn(r))}this.dispose(this.flyToEvent.disposableOn(r=>{this.czmCustomPrimitive.flyTo(r)}));{const r=()=>{const c=s.value?s.value:1,u=this.height??un.defaults.height,{textureSizeInMeters:d=un.defaults.textureSizeInMeters}=this,{textureUri:p=un.defaults.textureUri}=this;o.uniformMap={u_image:{type:"image",uri:p},u_stScale:[c/d[0],u/d[1]],u_speed:this.textureMoveSpeed??un.defaults.textureMoveSpeed,u_color:this.textureColor??un.defaults.textureColor}};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(this.textureColorChanged,this.textureMoveSpeedChanged,this.textureSizeInMetersChanged,this.heightChanged,this.textureSizeInMetersChanged,this.textureUriChanged,s.changed));this.dispose(l.disposableOn(r))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get czmCustomPrimitive(){return this._czmCustomPrimitive}get geoBoundingSphere(){return this._geoBoundingSphere.value}get geoBoundingSphereChanged(){return this._geoBoundingSphere.changed}};m(un,"defaults",{show:!0,allowPicking:!1,positions:[],height:1e3,textureSizeInMeters:[500,500],textureUri:"${earthsdk3-assets-script-dir}/assets/img/location.png",textureMoveSpeed:[0,.3],textureColor:[1,1,1,1]});let Io=un;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:a.reactPositions(void 0),height:void 0,textureSizeInMeters:a.reactArrayWithUndefined(void 0),textureUri:void 0,textureMoveSpeed:a.reactArrayWithUndefined(void 0),textureColor:a.reactArrayWithUndefined(void 0)})})(Io||(Io={})),a.extendClassProps(Io.prototype,Io.createDefaultProps);const Cl=class Cl extends yt{constructor(e,n){super(e,n);m(this,"_czmPolygonFence");m(this,"_czmPolygon");if(this._czmPolygonFence=this.disposeVar(new Io(n,e.id)),this._czmPolygon=this.dv(new a.ESGeoPolygon),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmPolygonFence,r=this._czmPolygon;n.add(r),this.dispose(()=>n.delete(r)),r.filled=!1,this.d(a.track([r,"points"],[e,"points"])),this.d(a.track([r,"stroked"],[e,"stroked"])),this.d(a.track([r,"strokeColor"],[e,"strokeColor"])),this.d(a.track([r,"strokeWidth"],[e,"strokeWidth"])),this.d(a.track([r,"strokeGround"],[e,"strokeGround"]));{const l={danger:{color:[.99,.98,.57,1],image:"01.png"},checkerboard:{color:[.88,.98,.99,1],image:"02.png"},warning:{color:[1,.93,.58,1],image:"03.png"},cord:{color:[.91,.87,.56,1],image:"04.png"},scanline:{color:[.43,.78,.8,1],image:"05.png"},honeycomb:{color:[.28,.84,.86,1],image:"06.png"},gradientColor:{color:[1,1,1,1],image:"07.png"}},c=(f,g)=>{switch(f){case"danger":return{textureMoveSpeed:[.05,0],textureSizeInMeters:[2,2]};case"checkerboard":return{textureMoveSpeed:[0,0],textureSizeInMeters:[2,2]};case"warning":return{textureMoveSpeed:[-.05,0],textureSizeInMeters:[2,2]};case"cord":return{textureMoveSpeed:[-.05,0],textureSizeInMeters:[2,2]};case"scanline":return{textureMoveSpeed:[0,0],textureSizeInMeters:[g,g]};case"honeycomb":return{textureMoveSpeed:[0,0],textureSizeInMeters:[g,g]};case"gradientColor":return{textureMoveSpeed:[0,0],textureSizeInMeters:[g,g]};default:return{textureMoveSpeed:[0,0],textureSizeInMeters:[g*.5,2]}}},u="${earthsdk3-assets-script-dir}/assets/img/fence/",d=()=>{const f=e.materialMode,g=l[f];if(!g)return;s.textureUri=u+g.image,s.textureColor=f!=="gradientColor"?g.color:e.fillColor;const{textureMoveSpeed:v,textureSizeInMeters:y}=c(f,e.height);s.textureMoveSpeed=v,s.textureSizeInMeters=y};d();const p=this.disposeVar(a.createNextAnimateFrameEvent(e.materialModeChanged,e.heightChanged,e.fillColorChanged));this.dispose(p.disposableOn(d))}{this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"height"],[e,"height"]));{const l=()=>{s.show=e.show&&e.filled};l();const c=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.dispose(c.don(l))}}}get czmPolygonFence(){return this._czmPolygonFence}get czmPolygon(){return this._czmPolygon}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmPolygonFence:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(Rt(s,o,n,e,r.czmCustomPrimitive),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmPolygonFence:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(Rt(s,o,n,e,r.czmCustomPrimitive),!0):!1}};m(Cl,"type",Cl.register("ESCesiumViewer",a.ESPolygonFence.type,Cl));let Np=Cl;const _l=class _l extends yt{constructor(e,n){super(e,n);m(this,"_czmESRectangle");if(this._czmESRectangle=this.disposeVar(new Si(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmESRectangle;this.dispose(a.bind([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"ground"],[e,"fillGround"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([s,"outlineTranslucent"],[e,"outlineTranslucent"])),this.dispose(a.bind([s,"height"],[e,"height"])),this.dispose(a.bind([s,"extrudedHeight"],[e,"extrudedHeight"])),this.dispose(a.bind([s,"rectangle"],[e,"rectangle"])),this.dispose(a.bind([s,"stRotation"],[e,"stRotation"])),this.dispose(a.bind([s,"rotation"],[e,"rotation"])),this.dispose(a.track([s,"outline"],[e,"stroked"])),this.dispose(a.track([s,"outlineColor"],[e,"strokeColor"]));{const r=()=>{const l=e.points;if(l&&l.length>=2){const{minPos:c,maxPos:u}=a.getMinMaxCorner(l);s.rectangle=[c[0],c[1],u[0],u[1]],s.height=l[1][2],s.extrudedHeight=l[0][2]}else s.rectangle=void 0,s.height=0,s.extrudedHeight=0};r(),this.dispose(e.pointsChanged.disposableOn(()=>r()))}{const r=()=>{e.filled?s.material={type:"Color",color:e.fillColor}:s.material={type:"Color",color:[1,1,1,0]}};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(r))}}get czmESRectangle(){return this._czmESRectangle}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmESRectangle:r}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);if(r.rectangle){const l=[[r.rectangle[0],r.rectangle[1],r.height],[r.rectangle[2],r.rectangle[3],r.height],[r.rectangle[0],r.rectangle[1],r.extrudedHeight],[r.rectangle[2],r.rectangle[3],r.extrudedHeight]];return oe(s,o,n,l,e),!0}return!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmESRectangle:r}=this;if(!s.actived)return!1;if(o.flyInParam)return super.flyIn(e,n);if(r.rectangle){const l=[[r.rectangle[0],r.rectangle[1],r.height],[r.rectangle[2],r.rectangle[3],r.height],[r.rectangle[0],r.rectangle[1],r.extrudedHeight],[r.rectangle[2],r.rectangle[3],r.extrudedHeight]];return oe(s,o,n,l,e),!0}return!1}};m(_l,"type",_l.register("ESCesiumViewer",a.ESRectangle.type,_l));let Bp=_l;const Zn=class Zn extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const s=a.ESSceneObject.context.createEnvStrReact([this,"imageUrl"],Zn.defaults.imageUrl),r=this.disposeVar(a.react(void 0)),l=()=>{const C=h.Material.fromType(h.Material.ImageType);C.uniforms.image=s.value,C.uniforms.repeat=Pe(this.repeat??Zn.defaults.repeat),r.value=C};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(s.changed,this.repeatChanged));this.dispose(c.disposableOn(l));const u=(C,S)=>{const x=new h.PolylineMaterialAppearance({material:S,renderState:{depthTest:{enabled:!1}}});x.renderState.depthMask=!1;const A=[];if(C.length<2)return;A.push(new h.GeometryInstance({geometry:new h.GroundPolylineGeometry({positions:C,width:this.width??Zn.defaults.width,vertexFormat:h.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:h.ArcType[this.arcType??Zn.defaults.arcType]}),id:this}));const R=new Ti({geometryInstances:A,appearance:x,asynchronous:!1,allowPicking:this.allowPicking??Zn.defaults.allowPicking,compressVertices:!1});return R.ESSceneObjectID=n,R};let d;const p=new h.BoundingSphere,f=()=>{d&&(o.scene.primitives.remove(d),d=void 0)};this.dispose(f);const g=()=>{if(f(),!this.positions)return;const C=pt(this.positions);if(C.length<2||!r.value){p.radius=-1;return}h.BoundingSphere.fromPoints(C,p),d=u(C,r.value),d&&o.scene.primitives.add(d)},v=()=>{d&&(d.show=this.show??!0)};this.dispose(this.flyToEvent.disposableOn(C=>{if(e.actived&&p.radius>0){const S=se(p.center);S&&ne(o,S,p.radius*4,void 0,C)}})),g(),v();const y=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.widthChanged,r.changed,this.arcTypeChanged,this.allowPickingChanged));this.dispose(y.disposableOn(()=>{g(),v()}));const w=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged));this.dispose(w.disposableOn(()=>{v()}));const{extensions:P}=e;if(!P){console.warn("!extensions");return}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};m(Zn,"defaults",{show:!0,positions:[],width:50,arcType:"GEODESIC",imageUrl:"${earthsdk3-assets-script-dir}/assets/img/roads/4.jpg",repeat:[100,1],allowPicking:!1});let Do=Zn;(t=>{t.createDefaultProps=()=>({show:void 0,positions:a.reactPositions(void 0),width:void 0,arcType:void 0,imageUrl:void 0,repeat:void 0,allowPicking:void 0})})(Do||(Do={})),a.extendClassProps(Do.prototype,Do.createDefaultProps);const Pl=class Pl extends yt{constructor(e,n){super(e,n);m(this,"_czmESRoad");if(this._czmESRoad=this.disposeVar(new Do(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmESRoad;{const r=()=>{s.show=e.show&&e.stroked};r();const l=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(l.don(r))}this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"width"],[e,"width"])),this.dispose(a.track([s,"arcType"],[e,"arcType"])),this.dispose(a.track([s,"imageUrl"],[e,"imageUrl"])),this.dispose(a.track([s,"repeat"],[e,"repeat"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"]))}get czmESRoad(){return this._czmESRoad}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmESRoad:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmESRoad:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(Pl,"type",Pl.register("ESCesiumViewer",Ch.type,Pl));let Vp=Pl;const bl=class bl extends a.EngineObject{constructor(e,n){super(e,n);m(this,"_customDiv");if(this._customDiv=this.disposeVar(new a.ESCustomDiv(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._customDiv;n.add(s),this.dispose(()=>n.delete(s)),s.instanceClass=class extends a.Destroyable{constructor(l,c,u){super(),this._subContainer=l;const d=document.createElement("div");this._subContainer.appendChild(d),this.dispose(()=>this._subContainer.removeChild(d));{const y=()=>{d.style.display=e.show??a.ESScale.defaults.show?"block":"none"};y(),e.dispose(e.showChanged.disposableOn(y))}d.style.position="fixed",d.style.width="125px",d.style.height="30px",d.style.border="1px solid rgba(49,50,56,.8)",d.style.padding="0 5px",d.style.backgroundColor="rgba(37,38,42,.8)",d.style.borderRadius="15px",d.style.pointerEvents="auto",d.style.transition=" right 0.4s linear";{const y=()=>{d.style.bottom=`${e.cssPosition?e.cssPosition[0]:a.ESScale.defaults.cssPosition[0]}px`,e.screenPosition==="left"?(d.style.right="auto",d.style.left=`${e.cssPosition?e.cssPosition[1]:a.ESScale.defaults.cssPosition[1]}px`):(d.style.left="auto",d.style.right=`${e.cssPosition?e.cssPosition[1]:a.ESScale.defaults.cssPosition[1]}px`)},w=this.disposeVar(a.createNextAnimateFrameEvent(e.cssPositionChanged,e.screenPositionChanged));y(),this.dispose(w.disposableOn(()=>y()))}const p=document.createElement("div");d.appendChild(p),this.dispose(()=>d.removeChild(p)),p.style.width="125px",p.style.display="inline-block",p.style.textAlign="center",p.style.fontSize="14px",p.style.fontWeight="lighter",p.style.lineHeight="30px",p.style.color="#fff",p.innerHTML="1000km";const f=document.createElement("div");d.appendChild(f),this.dispose(()=>d.removeChild(f)),f.style.borderRight="1px solid #fff",f.style.borderLeft="1px solid #fff",f.style.borderBottom="1px solid #fff",f.style.position="absolute",f.style.height="10px",f.style.top="15px",f.style.width="75px",f.style.left=`${60/2}px`;const g=()=>{const y=n.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||y&&y>1e6)d.style.display="none";else{d.style.display="block";const w=n.viewerLegend.legend.computedLengthInStr;w&&(p.innerHTML=w);const P=n.viewerLegend.legend.computedLengthInPixels;if(P){f.style.width=`${P}px`;const C=(135-P)/2;f.style.left=`${C}px`}}};g();const v=setInterval(()=>{g()},200);this.dispose(()=>clearInterval(v))}}}get customDiv(){return this._customDiv}};m(bl,"type",bl.register("ESCesiumViewer",a.ESScale.type,bl));let Up=bl;const Sl=class Sl extends me{constructor(e,n){super(e,n);m(this,"_czmCustomPrimitive");if(this._czmCustomPrimitive=this.disposeVar(new ze(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmCustomPrimitive;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(Je([s,"rotation"],[e,"rotation"])),this.dispose(a.track([s,"position"],[e,"position"])),this.dispose(a.track([s,"scale"],[e,"scale"])),this.dispose(a.track([s,"viewDistanceRange"],[e,"viewDistanceRange"])),this.dispose(a.track([s,"viewDistanceDebug"],[e,"viewDistanceDebug"])),this.dispose(a.track([s,"maximumScale"],[e,"maximumScale"])),this.dispose(a.track([s,"minimumScale"],[e,"minimumScale"])),this.dispose(a.track([s,"pixelSize"],[e,"pixelSize"])),this.dispose(a.track([s,"showSceneScale"],[e,"showSceneScale"])),this.dispose(a.track([s,"modelMatrix"],[e,"modelMatrix"])),this.dispose(a.track([s,"cull"],[e,"cull"])),this.dispose(a.track([s,"boundingVolume"],[e,"boundingVolume"])),this.dispose(a.track([s,"pass"],[e,"pass"])),this.dispose(a.track([s,"primitiveType"],[e,"primitiveType"])),this.dispose(a.track([s,"renderState"],[e,"renderState"])),this.dispose(a.track([s,"vertexShaderSource"],[e,"vertexShaderSource"])),this.dispose(a.track([s,"fragmentShaderSource"],[e,"fragmentShaderSource"])),this.dispose(a.track([s,"uniformMap"],[e,"uniformMap"])),this.dispose(a.track([s,"attributes"],[e,"attributes"])),this.dispose(a.track([s,"indexTypedArray"],[e,"indexTypedArray"])),this.dispose(a.track([s,"attributesJson"],[e,"attributesJson"])),this.dispose(a.track([s,"indexTypedArrayJson"],[e,"indexTypedArrayJson"])),this.dispose(a.track([s,"count"],[e,"count"])),this.dispose(a.track([s,"offset"],[e,"offset"])),this.dispose(a.track([s,"instanceCount"],[e,"instanceCount"])),this.dispose(a.track([s,"localPosition"],[e,"localPosition"])),this.dispose(a.track([s,"localScale"],[e,"localScale"])),this.dispose(a.track([s,"localModelMatrix"],[e,"localModelMatrix"])),this.dispose(a.track([s,"debugShowBoundingVolume"],[e,"debugShowBoundingVolume"])),this.dispose(a.track([s,"debugOverlappingFrustums"],[e,"debugOverlappingFrustums"])),this.dispose(a.track([s,"occlude"],[e,"occlude"])),this.dispose(a.track([s,"castShadows"],[e,"castShadows"])),this.dispose(a.track([s,"receiveShadows"],[e,"receiveShadows"])),this.dispose(a.track([s,"executeInClosestFrustum"],[e,"executeInClosestFrustum"])),this.dispose(a.track([s,"pickOnly"],[e,"pickOnly"])),this.dispose(a.track([s,"depthForTranslucentClassification"],[e,"depthForTranslucentClassification"]));{const r=()=>{if(e.localRotation){const l=[...e.localRotation];l[0]-=90,s.localRotation=l}else s.localRotation=[-90,0,0]};r(),this.dispose(e.localRotationChanged.disposableOn(r))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmCustomPrimitive:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(Rt(s,o,n,e,r,!0),!0):!1}};m(Sl,"type",Sl.register("ESCesiumViewer",yh.type,Sl));let Wp=Sl;const El=class El extends dh{constructor(e,n){super(e,n);m(this,"czmGeoPolyline");m(this,"czmWater");if(!n.viewer){console.warn("viewer is undefined!");return}if(!et(n.viewer))return;this.czmGeoPolyline=this.dv(new Se(n,e.id)),this.czmWater=this.dv(new fo(n,e.id));const{czmGeoPolyline:r,czmWater:l}=this;this.d(a.track([l,"allowPicking"],[e,"allowPicking"])),this.d(a.track([l,"ground"],[e,"fillGround"])),this.d(a.track([r,"allowPicking"],[e,"allowPicking"])),this.d(a.track([r,"color"],[e,"strokeColor"])),this.d(a.track([r,"width"],[e,"strokeWidth"])),this.d(a.track([r,"ground"],[e,"strokeGround"]));{const c=this.dv(a.createNextAnimateFrameEvent(e.waterColorChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),u=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??a.ESDynamicWater.defaults.waterColor,frequency:(e.frequency??a.ESDynamicWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??a.ESDynamicWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??a.ESDynamicWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??a.ESDynamicWater.defaults.specularIntensity,flowDirection:e.flowDirection??a.ESDynamicWater.defaults.flowDirection,flowSpeed:e.flowSpeed??a.ESDynamicWater.defaults.flowSpeed});else{const d=Object.assign({},Ec[e.waterType]);d.frequency&&(d.frequency/=10),d.waveVelocity&&(d.waveVelocity/=100),d.amplitude&&(d.amplitude*=100),this.updateWater(d)}};u(),this.d(c.don(u))}{const c=()=>{r.show=e.show&&e.stroked},u=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(c)),c()}{const c=()=>{l.show=!!(e.show&&e.filled)},u=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(c)),c()}{const c=()=>{if(!e.points||e.points&&e.points.length<=2){r.positions=[],l.points=[];return}if(e.scale&&e.scale.some(f=>f===0)){console.warn("缩放属性(scale)不能设置值为0");return}const d=e.points.map(f=>[f[0],f[1],0]),[p]=yn({originPosition:e.position,originRotation:e.rotation,originScale:e.scale,initialRotationMode:"XForwardZUp"},d);r.positions=[...p,p[0]],l.points=[...p]};c();const u=this.dv(a.createNextAnimateFrameEvent(e.pointsChanged,e.positionChanged,e.rotationChanged,e.scaleChanged));this.d(u.don(c))}}visibleDistance(e,n){var o;if((o=n.viewer)!=null&&o.camera&&e.show){const s=a.getDistancesFromPositions([e.position,Ht(n.viewer.camera)],"NONE")[0];let r=!1;e.minVisibleDistance<e.maxVisibleDistance?r=e.minVisibleDistance<s&&s<e.maxVisibleDistance:e.maxVisibleDistance==0&&(r=s>e.minVisibleDistance),this.czmGeoPolyline&&(this.czmGeoPolyline.show=e.show&&e.stroked&&r),this.czmWater&&(this.czmWater.show=e.show&&e.filled&&r)}}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmWater:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r!=null&&r.points?(oe(s,o,n,r.points,e,!0),!0):!1:!1}updateWater(e){const{czmWater:n}=this;n&&(e.waterColor&&n.waterColor!=e.waterColor&&(n.waterColor=e.waterColor),e.specularIntensity!=null&&n.specularIntensity!=e.specularIntensity&&(n.specularIntensity=e.specularIntensity),e.frequency!=null&&n.frequency!=e.frequency&&(n.frequency=e.frequency),e.waveVelocity!=null&&n.animationSpeed!=e.waveVelocity&&(n.animationSpeed=e.waveVelocity),e.amplitude!=null&&n.amplitude!=e.amplitude&&(n.amplitude=e.amplitude),e.flowSpeed!=null&&n.flowSpeed!=e.flowSpeed&&(n.flowSpeed=e.flowSpeed),n.baseWaterImage=e.waterImage,n.stRotation=e.flowDirection)}};m(El,"type",El.register("ESCesiumViewer",a.ESDynamicWater.type,El));let Gp=El;const Me=class Me extends jt{constructor(e,n){super(e,n);m(this,"_dataSource",this.disposeVar(a.react(void 0)));m(this,"_pointFeatures",this.disposeVar(a.reactJsonWithUndefined(void 0)));m(this,"featureArrName","features");const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=et(o);if(!s)return;const{screenManager:r}=s,l={scale:1*Me.scaleFactor,font:"16px sans-serif",verticalOrigin:h.VerticalOrigin.BOTTOM,horizontalOrigin:h.HorizontalOrigin.CENTER,scaleByDistance:Me.scaleByDistance,eyeOffset:new h.Cartesian3(0,0,-10),show:!0},c={scale:1*Me.scaleFactor,verticalOrigin:h.VerticalOrigin.BOTTOM,horizontalOrigin:h.HorizontalOrigin.CENTER,scaleByDistance:Me.scaleByDistance,image:Me.clusterImageUrl};(async()=>{if(Me.clusterImageAttribute===void 0){const u=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterJson.json");await fetch(u).then(d=>d.json()).then(d=>{Me.clusterImageAttribute=d}).catch(d=>{console.error(d)})}{const u=()=>{if(!e.data){this.pointFeatures=void 0;return}this.featureArrName=e.data.type=="FeatureCollection"?"features":"geometries";const d={type:e.data.type,[this.featureArrName]:[]};if(e.data.type==="FeatureCollection")for(let p=0;p<e.data.features.length;p++){const f=e.data.features[p];if(f.geometry.type=="Point")d[this.featureArrName].push(f);else if(f.geometry.type=="MultiPoint")for(let g=0;g<f.geometry.coordinates.length;g++)d[this.featureArrName].push({type:"Feature",geometry:{type:"Point",coordinates:f.geometry.coordinates[g]},properties:f.properties??{}});else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",f.geometry.type)}else if(e.data.type=="GeometryCollection")for(let p=0;p<e.data.geometries.length;p++){const f=e.data.geometries[p];if(f.type=="Point")d[this.featureArrName].push(f);else if(f.type=="MultiPoint")for(let g=0;g<f.coordinates.length;g++)d[this.featureArrName].push({type:"Feature",geometry:{type:"Point",coordinates:f.coordinates[g]},properties:f.properties??{}});else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",f.type)}this.pointFeatures=d};u(),this.ad(e.dataChanged.don(u))}{const u=()=>{this.dataSource&&o.dataSources.remove(this.dataSource),this.dataSource=void 0};this.ad(()=>u());const d=()=>{u(),this.pointFeatures&&h.GeoJsonDataSource.load(this.pointFeatures).then(p=>{o.dataSources.add(p).then(()=>{this.dataSource=p})})};d(),this.ad(this.pointFeaturesChanged.don(d))}this.ad(new a.ObjResettingWithEvent(this.dataSourceChanged,()=>{var v;if(!this.dataSource)return;const u=new a.Destroyable,d=this.dataSource;d.clustering.enabled=d.clustering.clusterBillboards=d.clustering.clusterLabels=d.clustering.clusterPoints=!0;for(let y=0;y<d.entities.values.length;y++){const w=d.entities.values[y];w.billboard&&(w.billboard.color=new h.ConstantProperty(h.Color.TRANSPARENT))}{const y=()=>{const P=d.clustering.pixelRange;d.clustering.pixelRange=0,d.clustering.pixelRange=P};y();let w=(v=this.czmViewer.viewer)==null?void 0:v.camera.moveEnd.addEventListener(()=>{y()});u.d(()=>{var P;w&&((P=this.czmViewer.viewer)==null||P.camera.moveEnd.removeEventListener(w))})}u.d(a.track([d.clustering,"pixelRange"],[e,"pixelRange"])),u.d(a.track([d.clustering,"minimumClusterSize"],[e,"minimumClusterSize"])),d.clustering.clusterEvent.addEventListener((y,w)=>{w.label&&(w.label.show=!1),w.billboard&&(w.billboard.show=!1),w.point&&(w.point.show=!1)});const p=u.ad(a.react(!1));let f=[];const g=o.scene.postUpdate.addEventListener(()=>{if(d.clustering._clusterLabelCollection)if(d.clustering._clusterLabelCollection._labels.length!=f.length||!d.clustering._clusterLabelCollection._labels.every(y=>f.includes(y.id.length))){f=[];for(let y=0;y<d.clustering._clusterLabelCollection._labels.length;y++){const w=d.clustering._clusterLabelCollection._labels[y];f.push(w.id.length)}p.value=!0}else p.value=!1});u.ad(()=>g());{let y={id:"",layer:"",screenObjectIds:[]},w={id:"",layer:"",screenObjectIds:[]};const P=()=>{y&&(r.remove(y.layer,y.id,{label:y.screenObjectIds}),y={id:"",layer:"",screenObjectIds:[]}),w&&(r.remove(w.layer,w.id,{billboard:w.screenObjectIds}),w={id:"",layer:"",screenObjectIds:[]})};u.ad(()=>{P()});const C=()=>{var G,O,N,_,E,D;if(P(),!e.show||!Me.clusterImageAttribute)return;const x=e.style??a.ESEntityCluster.defaults.style,A=Me.clusterImageAttribute[((G=x.nonCluster)==null?void 0:G.mode)??"SquareH01"],R=[-A.anchorPixelOffset[0]+A.textPixelOffset[0],-A.anchorPixelOffset[1]-A.textPixelOffset[1]],L={...l,pixelOffset:new h.Cartesian2(R[0]*Me.scaleFactor,R[1]*Me.scaleFactor),heightReference:h.HeightReference[(e.heightReference??a.ESEntityCluster.defaults.heightReference).toUpperCase()]},B={...c,width:A.imageSize[0],height:A.imageSize[1],heightReference:h.HeightReference[(e.heightReference??a.ESEntityCluster.defaults.heightReference).toUpperCase()],pixelOffset:new h.Cartesian2(-A.anchorPixelOffset[0]*Me.scaleFactor,-A.anchorPixelOffset[1]*Me.scaleFactor),imageSubRegion:new h.BoundingRectangle(...A.imagePixelOffset,...A.imageSize)},V=new Map;if(d.clustering._clusterLabelCollection)for(let z=0;z<d.clustering._clusterLabelCollection._labels.length;z++){const U=d.clustering._clusterLabelCollection._labels[z];if(!Me.clusterImageAttribute)continue;const Y=U.text,q=se(U.position),X={index:U.id.map(Ae=>d.entities.values.length-1-d.clustering._collectionIndicesByEntity[Ae.id].billboardIndex).sort((Ae,Te)=>Ae-Te),name:Y,position:q},Q=this.getClusterStyle(x.cluster??a.ESEntityCluster.defaults.style.cluster,U.id.length).mode,j=Me.clusterImageAttribute[Q],ae=[-j.anchorPixelOffset[0]+j.textPixelOffset[0],-j.anchorPixelOffset[1]-j.textPixelOffset[1]],ue={...l,pixelOffset:new h.Cartesian2(ae[0]*Me.scaleFactor,ae[1]*Me.scaleFactor),heightReference:h.HeightReference[(e.heightReference??a.ESEntityCluster.defaults.heightReference).toUpperCase()]},fe={...c,width:j.imageSize[0],height:j.imageSize[1],heightReference:h.HeightReference[(e.heightReference??a.ESEntityCluster.defaults.heightReference).toUpperCase()],pixelOffset:new h.Cartesian2(-j.anchorPixelOffset[0]*Me.scaleFactor,-j.anchorPixelOffset[1]*Me.scaleFactor),imageSubRegion:new h.BoundingRectangle(...j.imagePixelOffset,...j.imageSize)},_e=r.addImage(e.id,e.typeName,fe,X),Oe=r.addLabel(e.id,e.typeName,ue,X);w.id=_e.id,w.layer=_e.layer,w.screenObjectIds.push(_e.screenObjectId),y.id=Oe.id,y.layer=Oe.layer,y.screenObjectIds.push(Oe.screenObjectId);for(let Ae=0;Ae<U.id.length;Ae++)V.set(U.id[Ae].id,1)}for(let z=0;z<d.entities.values.length;z++){const U=d.entities.values[z];if(V.has(U.id)||!this.pointFeatures||!n.isPointVisible(se((O=U.position)==null?void 0:O.getValue())))continue;const Y=((N=this.pointFeatures[this.featureArrName][z])==null?void 0:N.coordinates)??((_=this.pointFeatures[this.featureArrName][z])==null?void 0:_.geometry.coordinates),q=((E=this.pointFeatures[this.featureArrName][z])==null?void 0:E.name)??((D=this.pointFeatures[this.featureArrName][z].properties)==null?void 0:D.name)??(z+1).toString(),X={index:z,name:q,position:Y},Q=r.addImage(e.id,e.typeName,B,X),j=r.addLabel(e.id,e.typeName,L,X);w.id=Q.id,w.layer=Q.layer,w.screenObjectIds.push(Q.screenObjectId),y.id=j.id,y.layer=j.layer,y.screenObjectIds.push(j.screenObjectId)}};C();const S=u.ad(a.createNextAnimateFrameEvent(e.showChanged,e.styleChanged,e.heightReferenceChanged,p.changed));u.ad(S.don(C))}return u}))})()}get dataSource(){return this._dataSource.value}set dataSource(e){this._dataSource.value=e}get dataSourceChanged(){return this._dataSource.changed}get pointFeatures(){return this._pointFeatures.value}set pointFeatures(e){this._pointFeatures.value=e}get pointFeaturesChanged(){return this._pointFeatures.changed}getClusterStyle(e,n){return e.find(o=>{if(o.value!==void 0)return o.value===n;const s=o.minValue!==void 0?o.minValue<=n:!0,r=o.maxValue!==void 0?o.maxValue>=n:!0;return s&&r})}};m(Me,"type",Me.register("ESCesiumViewer",a.ESEntityCluster.type,Me)),m(Me,"scaleFactor",.6),m(Me,"scaleByDistance",new h.NearFarScalar(100,1,1e3,1)),m(Me,"clusterImages"),m(Me,"clusterImageAttribute"),m(Me,"clusterImageUrl",a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterSpirit.png"));let Hp=Me;const xl=class xl extends jt{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}flyTo(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyToParam||n.flyInParam?super.flyTo(i,e):(n.esImageryLayer.flyTo(i&&i),n.flyOverEvent.emit(e,"over",o),!0):!1}flyIn(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyInParam?super.flyIn(i,e):(n.esImageryLayer.flyTo(i&&i),n.flyOverEvent.emit(e,"over",o),!0):!1}};m(xl,"type",xl.register("ESCesiumViewer",gh.type,xl));let $p=xl;const Al=class Al extends Yt{constructor(e,n){super(e,n);m(this,"geoPolyline");m(this,"czmWater");if(!n.viewer){console.warn("viewer is undefined!");return}if(!et(n.viewer))return;this.geoPolyline=this.dv(new Se(n,e.id)),this.czmWater=this.dv(new fo(n,e.id));const{geoPolyline:r,czmWater:l}=this;this.d(a.track([l,"allowPicking"],[e,"allowPicking"])),this.d(a.track([l,"ground"],[e,"fillGround"])),this.d(a.track([r,"allowPicking"],[e,"allowPicking"])),this.d(a.track([r,"color"],[e,"strokeColor"])),this.d(a.track([r,"width"],[e,"strokeWidth"])),this.d(a.track([r,"ground"],[e,"strokeGround"]));{const c=this.dv(a.createNextAnimateFrameEvent(e.waterColorChanged,e.waterImageChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),u=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??a.ESGeoWater.defaults.waterColor,frequency:(e.frequency??a.ESGeoWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??a.ESGeoWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??a.ESGeoWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??a.ESGeoWater.defaults.specularIntensity,flowDirection:e.flowDirection??a.ESGeoWater.defaults.flowDirection,flowSpeed:e.flowSpeed??a.ESGeoWater.defaults.flowSpeed,waterImage:e.waterImage??a.ESGeoWater.defaults.waterImage});else{const d=Object.assign({},Ec[e.waterType]);d.frequency&&(d.frequency/=10),d.waveVelocity&&(d.waveVelocity/=100),d.amplitude&&(d.amplitude*=100),this.updateWater(d)}};u(),this.d(c.don(u))}{const c=()=>{r.show=!!(e.show&&e.stroked)},u=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(c)),c()}{const c=()=>{l.show=e.show&&e.filled},u=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(c)),c()}{const c=()=>{e.points&&e.points.length>=3?(r.positions=[...e.points,e.points[0]],l.points=[...e.points]):(r.positions=e.points&&e.points.length>=2?[...e.points,e.points[0]]:[],l.points=[])};c();const u=this.dv(a.createNextAnimateFrameEvent(e.pointsChanged));this.d(u.don(c))}this.ad(e.editingChanged.don(c=>{l.updateBoundingSphere(c)}))}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}updateWater(e){const{czmWater:n}=this;e.waterColor&&n.waterColor!=e.waterColor&&(n.waterColor=e.waterColor),e.specularIntensity!=null&&n.specularIntensity!=e.specularIntensity&&(n.specularIntensity=e.specularIntensity),e.frequency!=null&&n.frequency!=e.frequency&&(n.frequency=e.frequency),e.waveVelocity!=null&&n.animationSpeed!=e.waveVelocity&&(n.animationSpeed=e.waveVelocity),e.amplitude!=null&&n.amplitude!=e.amplitude&&(n.amplitude=e.amplitude),e.flowSpeed!=null&&n.flowSpeed!=e.flowSpeed&&(n.flowSpeed=e.flowSpeed),n.baseWaterImage=e.waterImage,n.stRotation=e.flowDirection}};m(Al,"type",Al.register("ESCesiumViewer",a.ESGeoWater.type,Al));let qp=Al;function DT(t){let i,e;if(Reflect.has(t,"type")&&t.type==="symbol"&&Reflect.has(t,"layout")){const n=t.layout;if(Reflect.has(n,"icon-image")){e={},e.image=n["icon-image"];const{horizontalOrigin:o,verticalOrigin:s}=qy(n["icon-anchor"]??"center");if(e.horizontalOrigin=o,e.verticalOrigin=s,Reflect.has(t,"paint")){const r=t.paint;e.color=h.Color.fromCssColorString(r["icon-color"]??"#FF0000").withAlpha(r["icon-opacity"]??1)}e.rotation=h.Math.toRadians(n["icon-rotate"]??0),e.scale=n["icon-size"]??1,e.show=(n.visibility??"visible")==="visible"}if(Reflect.has(n,"text-field")){i={},i.text=n["text-field"];const{horizontalOrigin:o,verticalOrigin:s}=qy(n["text-anchor"]??"center");if(i.horizontalOrigin=o,i.verticalOrigin=s,Reflect.has(t,"paint")){const r=t.paint;i.fillColor=h.Color.fromCssColorString(r["text-color"]??"#FFFFFF").withAlpha(r["text-opacity"]??1)}i.font=`${n["text-size"]??16}px ${n["text-font"]??"sans-serif"}`,i.show=(n.visibility??"visible")==="visible"}}return{labelStyle:i,billboardStyle:e}}function qy(t){let i=h.HorizontalOrigin.CENTER,e=h.VerticalOrigin.CENTER;switch(t){case"center":break;case"left":i=h.HorizontalOrigin.LEFT;break;case"right":i=h.HorizontalOrigin.RIGHT;break;case"top":e=h.VerticalOrigin.TOP;break;case"bottom":e=h.VerticalOrigin.BOTTOM;break;case"top-left":i=h.HorizontalOrigin.LEFT,e=h.VerticalOrigin.TOP;break;case"top-right":i=h.HorizontalOrigin.RIGHT,e=h.VerticalOrigin.TOP;break;case"bottom-left":i=h.HorizontalOrigin.LEFT,e=h.VerticalOrigin.BOTTOM;break;case"bottom-right":i=h.HorizontalOrigin.RIGHT,e=h.VerticalOrigin.BOTTOM;break}return{horizontalOrigin:i,verticalOrigin:e}}class RT extends a.Destroyable{constructor(e,n){super();m(this,"czmViewer");m(this,"czmESMVTLayer");m(this,"screenManager");m(this,"cacheSize",100);m(this,"urlMap",new Map);m(this,"tileScheme","xyz");m(this,"minimumLevel",0);m(this,"maximumLevel",18);m(this,"_cache",new Map);m(this,"lastTiles",new Map);this.czmViewer=e,this.czmESMVTLayer=n;const o=this.czmViewer.viewer;if(!o)return;const s=et(o);if(!s)return;this.screenManager=s.screenManager,this.tileScheme=n.sceneObject.scheme??"xyz",this.maximumLevel=n.sceneObject.maximumLevel,this.minimumLevel=n.sceneObject.minimumLevel,(()=>{do{if(!n.mvtLayerJson)break;if(typeof n.mvtLayerJson.mainJson=="string"){this.urlMap.set("customSource",[n.mvtLayerJson.mainJson]);break}if(typeof n.mvtLayerJson.mainJson=="object"){const l=n.mvtLayerJson.mainJson.sources;for(const c in l){const u=l[c];u.type==="vector"&&Reflect.has(u,"tiles")&&this.urlMap.set(c,u.tiles)}break}}while(!1)})(),this.ad(()=>{var c;const l=Array.from(this.lastTiles.values()).map(u=>u.featureTable).map(u=>Object.values(u)).flat(1/0);l&&((c=this.screenManager)==null||c.remove("default",this.czmESMVTLayer.sceneObject.id,l)),this.cache&&(this.cache.clear(),this.cache=null)})}get cache(){return this._cache}set cache(e){this._cache=e}addTiles(e){var r;if(this.urlMap.size==0)return;if(this.cache&&this.cache.has(e)&&this.lastTiles.has(e)){this.updateTiles([e],"show");return}const[n,o,s]=e.split("-").map(Number);(r=this.cache)==null||r.set(e,new Map),this.requestImage(o,s,n,e)}updateTiles(e,n="hide"){var o,s;for(let r=0;r<e.length;r++){const l=e[r],c=this.lastTiles.get(l);if(c){const u=Object.keys(c.featureTable);for(let d=0;d<u.length;d++){const p=u[d],f=c.featureTable[p];n=="delete"?(o=this.screenManager)==null||o.remove(c.layer,c.id,f):(s=this.screenManager)==null||s.update(c.layer,c.id,f,{all:{show:n=="show"}})}}n=="delete"&&this.lastTiles.delete(l)}}update(e){const n=Array.from(this.lastTiles.keys()),o=n.filter(l=>!e.includes(l)),s=n.filter(l=>e.includes(l)),r=e.filter(l=>!n.includes(l));this.updateTiles(o),this.updateTiles(s,"show");for(let l=0;l<r.length;l++){const c=r[l];this.addTiles(c)}}requestImage(e,n,o,s){const r=this.tileScheme=="tms"?Math.pow(2,o)-n-1:n;this.urlMap.size!=0&&this.urlMap.entries().forEach(([l,c])=>{if(c.length!=0&&c[0].includes("{z}")){const u=c[0].replace(/{z}/g,o.toString()).replace(/{x}/g,e.toString()).replace(/{y}/g,r.toString());fetch(u).then(d=>{var p,f;if(d.ok&&((p=this.cache)!=null&&p.has(s))&&((f=this.cache.get(s))==null?void 0:f.size)==0)return d.arrayBuffer()}).then(d=>{var v;const p=new g_(d),f=new m_.VectorTile(p),g=new Map;for(const y in f.layers){const w=f.layers[y];if(w.length<=0||w.feature(0).type!==1)continue;const P=[];for(let C=0;C<w.length;C++){const S=w.feature(C);P.push(S.toGeoJSON(e,n,o))}g.set(y,P)}(v=this.cache)==null||v.set(s,g),this.addScreenManage(s,g),this.clearCache()})}})}clearCache(){if(!this.cache)return;const e=this.cache.size-this.cacheSize;if(!(e<=0))for(let n=0;n<e;n++){const o=this.cache.keys().next().value;o&&(this.updateTiles([o],"delete"),this.cache.delete(o))}}addScreenManage(e,n){this.lastTiles.set(e,{layer:"default",id:this.czmESMVTLayer.sceneObject.id,featureTable:{}});const o=this.lastTiles.get(e);for(const[s,r]of n.entries()){const l=this.czmESMVTLayer.mvtLayerJson.pointJson.find(c=>c["source-layer"]==s)??{};for(const c of r){const{labelStyle:u,billboardStyle:d}=DT(l);let p,f;u&&(u.show=!this.screenManager.avoidanceManager.enable,p=this.screenManager.addLabel(this.czmESMVTLayer.sceneObject.id,"default",u??{},{position:c.geometry.coordinates,name:c.properties.NAME??c.properties.name,index:c.id})),d&&(d.show=!this.screenManager.avoidanceManager.enable,f=this.screenManager.addImage(this.czmESMVTLayer.sceneObject.id,"default",d??{},{position:c.geometry.coordinates,name:c.properties.NAME??c.properties.name,index:c.id})),o.featureTable[s]||(o.featureTable[s]=[]),p&&o.featureTable[s].push(p.screenObjectId),f&&o.featureTable[s].push(f.screenObjectId)}}}reset(){if(!this.cache)return;const e=Array.from(this.cache.keys());this.update([]),setTimeout(()=>{this.update(e)})}}class FT extends a.Destroyable{constructor(e,n){super();m(this,"vectorTilesCache");m(this,"czmViewer");m(this,"czmESMVTLayer");this.czmViewer=e,this.czmESMVTLayer=n,this.vectorTilesCache=this.ad(new RT(e,n)),this.updateTiles();const o=this.czmViewer.viewer.scene.globe._surface.tileLoadProgressEvent.addEventListener(s=>{s==0&&this.updateTiles()});this.ad(()=>{o()})}updateTiles(){const e=this.czmViewer.viewer;if(!e)return;const n=new Set;for(let o=0;o<e.scene.globe._surface._tilesToRender.length;o++){const s=e.scene.globe._surface._tilesToRender[o];if(s.data)for(let r=0;r<s.data.imagery.length;r++){const l=s.data.imagery[r],c=l.loadingImagery??l.readyImagery;if(c){const u=`${c.level}-${c.x}-${c.y}`;n.add(u)}}}this.vectorTilesCache.update(Array.from(n))}}const Tl=class Tl extends jt{constructor(e,n){super(e,n);m(this,"_czmImagery");m(this,"_mvtLayerJson",this.disposeVar(a.reactJson({mainJson:"",pointJson:[],otherJson:[]})));m(this,"mvtLayerJsonChanged",this.ad(new a.Event));if(this._czmImagery=this.dv(new Ln(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmImagery;this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([s,"zIndex"],[e,"zIndex"])),this.d(a.track([s,"rectangle"],[e,"rectangle"])),this.d(a.track([s,"alpha"],[e,"opacity"])),this.d(a.track([s,"splitDirection"],[e,"splitDirection"])),this.d(a.track([s,"brightness"],[e,"czmBrightness"])),this.d(a.track([s,"contrast"],[e,"czmContrast"])),this.d(a.track([s,"hue"],[e,"czmHue"])),this.d(a.track([s,"saturation"],[e,"czmSaturation"])),this.d(a.track([s,"gamma"],[e,"czmGamma"]));{const l=this.dv(a.createNextAnimateFrameEvent(e.accessTokenChanged,e.maximumLevelChanged,e.minimumLevelChanged,e.tileSizeChanged,e.allowPickingChanged,e.rectangleChanged,e.schemeChanged,this.mvtLayerJsonChanged)),c=()=>{!this.mvtLayerJson||this.mvtLayerJson.otherJson.length==0||(s.imageryProvider={type:"MVTImageryProvider",url:this.mvtLayerJson.mainJson,accessToken:e.accessToken,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,tileSize:e.tileSize,enablePickFeatures:e.allowPicking,rectangle:e.rectangle,style:this.mvtLayerJson.otherJson,scheme:e.scheme})};c(),this.d(l.don(c))}{const l=d=>{const p=structuredClone(d);Reflect.deleteProperty(p,"layers"),this.mvtLayerJson={mainJson:p,pointJson:d.layers.filter(f=>f.type=="symbol"),otherJson:d.layers.filter(f=>f.type!="symbol")}},c=async()=>{var d;if(typeof e.url=="string")if(e.url.includes("{z}"))this.mvtLayerJson.mainJson=e.url;else{const p=await fetch(e.url);if((d=p.headers.get("Content-Type"))!=null&&d.includes("json")){const f=await p.json();l(f)}}else l(e.url);e.style&&e.style.length!=0&&(this.mvtLayerJson.pointJson=e.style.filter(p=>p.type=="symbol"),this.mvtLayerJson.otherJson=e.style.filter(p=>p.type!="symbol")),this.mvtLayerJsonChanged.emit()};c();const u=this.ad(a.createNextAnimateFrameEvent(e.urlChanged,e.styleChanged));this.ad(u.don(c))}const r=this.ad(a.createNextAnimateFrameEvent(e.schemeChanged,e.maximumLevelChanged,e.minimumLevelChanged,this.mvtLayerJsonChanged,e.showChanged));this.ad(new a.ObjResettingWithEvent(r,()=>{if(e.show)return new FT(n,this)}))}get czmImagery(){return this._czmImagery}get mvtLayerJson(){return this._mvtLayerJson.value}set mvtLayerJson(e){this._mvtLayerJson.value=e}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(Tl,"type",Tl.register("ESCesiumViewer",fh.type,Tl));let Xp=Tl;class zT extends a.Destroyable{constructor(i,e){super(),this._czmESPipeFence=i,this._sceneObject=e;const n=this._sceneObject,o=this._czmESPipeFence,s=o.czmCustomPrimitive;if(!n.points||n.points.length<2){this.clear(s);return}const r=n.points.length;let l=[],c=[],u=[],d=[],p=[];for(let P=0;P<r-1;P++){const{outlinePionts:C,customPrimitivePoints:S}=this.divideFourPoints(n.points[P],n.points[P+1]);d.push(...S),p.push(...C),u.push(...this.setIndexs(P))}const[f,g,v]=Dt({originPosition:d[0]},d),y=this.setFaces(f);l.push(...y.flat());const w=this.setTextureCoordinates(n,o);c.push(...w.flat()),o.computeBoundingBox(),this.updateCustomPrimitive(s,g,l,u,c)}divideFourPoints(i,e){const n=a.geoHeading(i,e),o=a.geoDestination(i,this._sceneObject.width/2,90+n),s=a.geoDestination(i,this._sceneObject.width/2,n-90),r=a.geoDestination(e,this._sceneObject.width/2,n-90),l=a.geoDestination(e,this._sceneObject.width/2,90+n),c=[o[0],o[1],o[2]+this._sceneObject.height/2],u=[o[0],o[1],o[2]-this._sceneObject.height/2],d=[s[0],s[1],s[2]+this._sceneObject.height/2],p=[s[0],s[1],s[2]-this._sceneObject.height/2],f=[l[0],l[1],l[2]+this._sceneObject.height/2],g=[l[0],l[1],l[2]-this._sceneObject.height/2],v=[r[0],r[1],r[2]+this._sceneObject.height/2],y=[r[0],r[1],r[2]-this._sceneObject.height/2],w=[[c,d],[c,f],[c,u],[u,g]],P=[[u,p],[d,v],[d,p],[p,y]],C=[[f,g],[f,v],[g,y],[v,y]];return{outlinePionts:[...w,...P,...C],customPrimitivePoints:[u,c,d,p,g,f,v,y]}}setIndexs(i){const e=i*16;return[e+1,e+0,e+3,e+1,e+3,e+2,e+5,e+4,e+7,e+6,e+5,e+7,e+9,e+8,e+11,e+9,e+11,e+10,e+13,e+12,e+15,e+13,e+15,e+14]}setFaces(i){const e=[],n=i.length/8;for(let s=0;s<n;s++){const r=i.slice(8*s,8*(s+1));e.push(r)}return[...e.map(s=>[s[4],s[5],s[1],s[0],s[5],s[6],s[2],s[1],s[6],s[7],s[3],s[2],s[7],s[4],s[0],s[3]]).flat()]}getDistances(i,e){const[n]=Dt({originPosition:i[0]},i),o=n.length,s=n.reduce((c,u,d,p)=>{if(d===0)return c.push(0),c;const f=d-1,g=p[f],v=Math.sqrt((g[0]-u[0])*(g[0]-u[0])+(g[1]-u[1])*(g[1]-u[1]));return c.push(c[f]+v),c},[]),r=s[o-1];return e.distances=r,s.map(c=>c/r)}setTextureCoordinates(i,e){if(!i.points||i.points.length<2)return;const n=this.getDistances(i.points,e),o=[];for(let s=1;s<n.length;s++){let r=[];if(s===n.length-1){const l=[1,0,1,1,n[s-1],1,n[s-1],0];r=[...l,...l,...l,...l]}else{const l=[n[s],0,n[s],1,n[s-1],1,n[s-1],0];r=[...l,...l,...l,...l]}o.push(r)}return o}updateCustomPrimitive(i,e,n,o,s){i.modelMatrix=e,i.indexTypedArray=new Uint16Array(o),i.attributes={position:{typedArray:new Float32Array(n),componentsPerAttribute:3},a_st:{typedArray:new Float32Array(s),componentsPerAttribute:2}}}clear(i){i.indexTypedArray=void 0,i.modelMatrix=void 0,i.attributes=void 0}}const Ml=class Ml extends yt{constructor(e,n){super(e,n);m(this,"_line",this.dv(new Se(this.czmViewer,this.sceneObject.id)));m(this,"_czmTexture",this.ad(new Be(this.czmViewer,this.sceneObject.id)));m(this,"_czmCustomPrimitive",this.dv(new ze(this.czmViewer,this.sceneObject.id)));m(this,"_distances",this.dv(a.react(0)));if(!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmTexture,r=this._line;this.d(a.bind([r,"positions"],[e,"points"])),this.d(a.track([this.line,"allowPicking"],[e,"allowPicking"])),this.d(a.track([this.line,"color"],[e,"strokeColor"])),this.d(a.track([this.line,"width"],[e,"strokeWidth"])),this.d(a.track([this.line,"ground"],[e,"strokeGround"]));{const d=this.dv(a.createNextAnimateFrameEvent(this.sceneObject.pointsChanged,this.sceneObject.strokeWidthChanged,this.sceneObject.strokeColorChanged,this.sceneObject.heightChanged,this.sceneObject.widthChanged,this.sceneObject.fillColorChanged));this.dv(new a.ObjResettingWithEvent(d,()=>new zT(this,this.sceneObject)))}{const d=()=>{r.show=e.show&&e.stroked};d();const p=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(p.don(d))}this.bindCustomPrimitive(e);let l="";const c=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/singleArrow.png"),u=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/multipleArrows.png");{const d=()=>{e.materialMode==="multipleArrows"||e.materialMode==="blue"?l=u:e.materialMode==="color"?l="":l=c,s.uri=l,l==""?(this._czmCustomPrimitive.uniformMap={u_color:e.fillColor},this._czmCustomPrimitive.fragmentShaderSource=` uniform vec4 u_color;
1746
+ `};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(this.heightChanged,this.positionsChanged));this.dispose(l.disposableOn(r))}this.dispose(this.flyToEvent.disposableOn(r=>{this.czmCustomPrimitive.flyTo(r)}));{const r=()=>{const c=s.value?s.value:1,u=this.height??un.defaults.height,{textureSizeInMeters:d=un.defaults.textureSizeInMeters}=this,{textureUri:p=un.defaults.textureUri}=this;o.uniformMap={u_image:{type:"image",uri:p},u_stScale:[c/d[0],u/d[1]],u_speed:this.textureMoveSpeed??un.defaults.textureMoveSpeed,u_color:this.textureColor??un.defaults.textureColor}};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(this.textureColorChanged,this.textureMoveSpeedChanged,this.textureSizeInMetersChanged,this.heightChanged,this.textureSizeInMetersChanged,this.textureUriChanged,s.changed));this.dispose(l.disposableOn(r))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get czmCustomPrimitive(){return this._czmCustomPrimitive}get geoBoundingSphere(){return this._geoBoundingSphere.value}get geoBoundingSphereChanged(){return this._geoBoundingSphere.changed}};m(un,"defaults",{show:!0,allowPicking:!1,positions:[],height:1e3,textureSizeInMeters:[500,500],textureUri:"${earthsdk3-assets-script-dir}/assets/img/location.png",textureMoveSpeed:[0,.3],textureColor:[1,1,1,1]});let Io=un;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:a.reactPositions(void 0),height:void 0,textureSizeInMeters:a.reactArrayWithUndefined(void 0),textureUri:void 0,textureMoveSpeed:a.reactArrayWithUndefined(void 0),textureColor:a.reactArrayWithUndefined(void 0)})})(Io||(Io={})),a.extendClassProps(Io.prototype,Io.createDefaultProps);const Cl=class Cl extends yt{constructor(e,n){super(e,n);m(this,"_czmPolygonFence");m(this,"_czmPolygon");if(this._czmPolygonFence=this.disposeVar(new Io(n,e.id)),this._czmPolygon=this.dv(new a.ESGeoPolygon),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmPolygonFence,r=this._czmPolygon;n.add(r),this.dispose(()=>n.delete(r)),r.filled=!1,this.d(a.track([r,"points"],[e,"points"])),this.d(a.track([r,"stroked"],[e,"stroked"])),this.d(a.track([r,"strokeColor"],[e,"strokeColor"])),this.d(a.track([r,"strokeWidth"],[e,"strokeWidth"])),this.d(a.track([r,"strokeGround"],[e,"strokeGround"]));{const l={danger:{color:[.99,.98,.57,1],image:"01.png"},checkerboard:{color:[.88,.98,.99,1],image:"02.png"},warning:{color:[1,.93,.58,1],image:"03.png"},cord:{color:[.91,.87,.56,1],image:"04.png"},scanline:{color:[.43,.78,.8,1],image:"05.png"},honeycomb:{color:[.28,.84,.86,1],image:"06.png"},gradientColor:{color:[1,1,1,1],image:"07.png"}},c=(f,g)=>{switch(f){case"danger":return{textureMoveSpeed:[.05,0],textureSizeInMeters:[2,2]};case"checkerboard":return{textureMoveSpeed:[0,0],textureSizeInMeters:[2,2]};case"warning":return{textureMoveSpeed:[-.05,0],textureSizeInMeters:[2,2]};case"cord":return{textureMoveSpeed:[-.05,0],textureSizeInMeters:[2,2]};case"scanline":return{textureMoveSpeed:[0,0],textureSizeInMeters:[g,g]};case"honeycomb":return{textureMoveSpeed:[0,0],textureSizeInMeters:[g,g]};case"gradientColor":return{textureMoveSpeed:[0,0],textureSizeInMeters:[g,g]};default:return{textureMoveSpeed:[0,0],textureSizeInMeters:[g*.5,2]}}},u="${earthsdk3-assets-script-dir}/assets/img/fence/",d=()=>{const f=e.materialMode,g=l[f];if(!g)return;s.textureUri=u+g.image,s.textureColor=f!=="gradientColor"?g.color:e.fillColor;const{textureMoveSpeed:v,textureSizeInMeters:y}=c(f,e.height);s.textureMoveSpeed=v,s.textureSizeInMeters=y};d();const p=this.disposeVar(a.createNextAnimateFrameEvent(e.materialModeChanged,e.heightChanged,e.fillColorChanged));this.dispose(p.disposableOn(d))}{this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"height"],[e,"height"]));{const l=()=>{s.show=e.show&&e.filled};l();const c=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.dispose(c.don(l))}}}get czmPolygonFence(){return this._czmPolygonFence}get czmPolygon(){return this._czmPolygon}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmPolygonFence:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(Rt(s,o,n,e,r.czmCustomPrimitive),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmPolygonFence:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(Rt(s,o,n,e,r.czmCustomPrimitive),!0):!1}};m(Cl,"type",Cl.register("ESCesiumViewer",a.ESPolygonFence.type,Cl));let Np=Cl;const _l=class _l extends yt{constructor(e,n){super(e,n);m(this,"_czmESRectangle");if(this._czmESRectangle=this.disposeVar(new Si(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmESRectangle;this.dispose(a.bind([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"ground"],[e,"fillGround"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([s,"outlineTranslucent"],[e,"outlineTranslucent"])),this.dispose(a.bind([s,"height"],[e,"height"])),this.dispose(a.bind([s,"extrudedHeight"],[e,"extrudedHeight"])),this.dispose(a.bind([s,"rectangle"],[e,"rectangle"])),this.dispose(a.bind([s,"stRotation"],[e,"stRotation"])),this.dispose(a.bind([s,"rotation"],[e,"rotation"])),this.dispose(a.track([s,"outline"],[e,"stroked"])),this.dispose(a.track([s,"outlineColor"],[e,"strokeColor"]));{const r=()=>{const l=e.points;if(l&&l.length>=2){const{minPos:c,maxPos:u}=a.getMinMaxCorner(l);s.rectangle=[c[0],c[1],u[0],u[1]],s.height=l[1][2],s.extrudedHeight=l[0][2]}else s.rectangle=void 0,s.height=0,s.extrudedHeight=0};r(),this.dispose(e.pointsChanged.disposableOn(()=>r()))}{const r=()=>{e.filled?s.material={type:"Color",color:e.fillColor}:s.material={type:"Color",color:[1,1,1,0]}};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(r))}}get czmESRectangle(){return this._czmESRectangle}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmESRectangle:r}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);if(r.rectangle){const l=[[r.rectangle[0],r.rectangle[1],r.height],[r.rectangle[2],r.rectangle[3],r.height],[r.rectangle[0],r.rectangle[1],r.extrudedHeight],[r.rectangle[2],r.rectangle[3],r.extrudedHeight]];return oe(s,o,n,l,e),!0}return!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmESRectangle:r}=this;if(!s.actived)return!1;if(o.flyInParam)return super.flyIn(e,n);if(r.rectangle){const l=[[r.rectangle[0],r.rectangle[1],r.height],[r.rectangle[2],r.rectangle[3],r.height],[r.rectangle[0],r.rectangle[1],r.extrudedHeight],[r.rectangle[2],r.rectangle[3],r.extrudedHeight]];return oe(s,o,n,l,e),!0}return!1}};m(_l,"type",_l.register("ESCesiumViewer",a.ESRectangle.type,_l));let Bp=_l;const Zn=class Zn extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const s=a.ESSceneObject.context.createEnvStrReact([this,"imageUrl"],Zn.defaults.imageUrl),r=this.disposeVar(a.react(void 0)),l=()=>{const C=h.Material.fromType(h.Material.ImageType);C.uniforms.image=s.value,C.uniforms.repeat=Pe(this.repeat??Zn.defaults.repeat),r.value=C};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(s.changed,this.repeatChanged));this.dispose(c.disposableOn(l));const u=(C,S)=>{const x=new h.PolylineMaterialAppearance({material:S,renderState:{depthTest:{enabled:!1}}});x.renderState.depthMask=!1;const A=[];if(C.length<2)return;A.push(new h.GeometryInstance({geometry:new h.GroundPolylineGeometry({positions:C,width:this.width??Zn.defaults.width,vertexFormat:h.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:h.ArcType[this.arcType??Zn.defaults.arcType]}),id:this}));const R=new Ti({geometryInstances:A,appearance:x,asynchronous:!1,allowPicking:this.allowPicking??Zn.defaults.allowPicking,compressVertices:!1});return R.ESSceneObjectID=n,R};let d;const p=new h.BoundingSphere,f=()=>{d&&(o.scene.primitives.remove(d),d=void 0)};this.dispose(f);const g=()=>{if(f(),!this.positions)return;const C=pt(this.positions);if(C.length<2||!r.value){p.radius=-1;return}h.BoundingSphere.fromPoints(C,p),d=u(C,r.value),d&&o.scene.primitives.add(d)},v=()=>{d&&(d.show=this.show??!0)};this.dispose(this.flyToEvent.disposableOn(C=>{if(e.actived&&p.radius>0){const S=se(p.center);S&&ne(o,S,p.radius*4,void 0,C)}})),g(),v();const y=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.widthChanged,r.changed,this.arcTypeChanged,this.allowPickingChanged));this.dispose(y.disposableOn(()=>{g(),v()}));const w=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged));this.dispose(w.disposableOn(()=>{v()}));const{extensions:P}=e;if(!P){console.warn("!extensions");return}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};m(Zn,"defaults",{show:!0,positions:[],width:50,arcType:"GEODESIC",imageUrl:"${earthsdk3-assets-script-dir}/assets/img/roads/4.jpg",repeat:[100,1],allowPicking:!1});let Do=Zn;(t=>{t.createDefaultProps=()=>({show:void 0,positions:a.reactPositions(void 0),width:void 0,arcType:void 0,imageUrl:void 0,repeat:void 0,allowPicking:void 0})})(Do||(Do={})),a.extendClassProps(Do.prototype,Do.createDefaultProps);const Pl=class Pl extends yt{constructor(e,n){super(e,n);m(this,"_czmESRoad");if(this._czmESRoad=this.disposeVar(new Do(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmESRoad;{const r=()=>{s.show=e.show&&e.stroked};r();const l=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(l.don(r))}this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"width"],[e,"width"])),this.dispose(a.track([s,"arcType"],[e,"arcType"])),this.dispose(a.track([s,"imageUrl"],[e,"imageUrl"])),this.dispose(a.track([s,"repeat"],[e,"repeat"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"]))}get czmESRoad(){return this._czmESRoad}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmESRoad:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmESRoad:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(Pl,"type",Pl.register("ESCesiumViewer",Ch.type,Pl));let Vp=Pl;const bl=class bl extends a.EngineObject{constructor(e,n){super(e,n);m(this,"_customDiv");if(this._customDiv=this.disposeVar(new a.ESCustomDiv(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._customDiv;n.add(s),this.dispose(()=>n.delete(s)),s.instanceClass=class extends a.Destroyable{constructor(l,c,u){super(),this._subContainer=l;const d=document.createElement("div");this._subContainer.appendChild(d),this.dispose(()=>this._subContainer.removeChild(d));{const y=()=>{d.style.display=e.show??a.ESScale.defaults.show?"block":"none"};y(),e.dispose(e.showChanged.disposableOn(y))}d.style.position="fixed",d.style.width="125px",d.style.height="30px",d.style.border="1px solid rgba(49,50,56,.8)",d.style.padding="0 5px",d.style.backgroundColor="rgba(37,38,42,.8)",d.style.borderRadius="15px",d.style.pointerEvents="auto",d.style.transition=" right 0.4s linear";{const y=()=>{d.style.bottom=`${e.cssPosition?e.cssPosition[0]:a.ESScale.defaults.cssPosition[0]}px`,e.screenPosition==="left"?(d.style.right="auto",d.style.left=`${e.cssPosition?e.cssPosition[1]:a.ESScale.defaults.cssPosition[1]}px`):(d.style.left="auto",d.style.right=`${e.cssPosition?e.cssPosition[1]:a.ESScale.defaults.cssPosition[1]}px`)},w=this.disposeVar(a.createNextAnimateFrameEvent(e.cssPositionChanged,e.screenPositionChanged));y(),this.dispose(w.disposableOn(()=>y()))}const p=document.createElement("div");d.appendChild(p),this.dispose(()=>d.removeChild(p)),p.style.width="125px",p.style.display="inline-block",p.style.textAlign="center",p.style.fontSize="14px",p.style.fontWeight="lighter",p.style.lineHeight="30px",p.style.color="#fff",p.innerHTML="1000km";const f=document.createElement("div");d.appendChild(f),this.dispose(()=>d.removeChild(f)),f.style.borderRight="1px solid #fff",f.style.borderLeft="1px solid #fff",f.style.borderBottom="1px solid #fff",f.style.position="absolute",f.style.height="10px",f.style.top="15px",f.style.width="75px",f.style.left=`${60/2}px`;const g=()=>{const y=n.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||y&&y>1e6)d.style.display="none";else{d.style.display="block";const w=n.viewerLegend.legend.computedLengthInStr;w&&(p.innerHTML=w);const P=n.viewerLegend.legend.computedLengthInPixels;if(P){f.style.width=`${P}px`;const C=(135-P)/2;f.style.left=`${C}px`}}};g();const v=setInterval(()=>{g()},200);this.dispose(()=>clearInterval(v))}}}get customDiv(){return this._customDiv}};m(bl,"type",bl.register("ESCesiumViewer",a.ESScale.type,bl));let Up=bl;const Sl=class Sl extends me{constructor(e,n){super(e,n);m(this,"_czmCustomPrimitive");if(this._czmCustomPrimitive=this.disposeVar(new ze(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmCustomPrimitive;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(Je([s,"rotation"],[e,"rotation"])),this.dispose(a.track([s,"position"],[e,"position"])),this.dispose(a.track([s,"scale"],[e,"scale"])),this.dispose(a.track([s,"viewDistanceRange"],[e,"viewDistanceRange"])),this.dispose(a.track([s,"viewDistanceDebug"],[e,"viewDistanceDebug"])),this.dispose(a.track([s,"maximumScale"],[e,"maximumScale"])),this.dispose(a.track([s,"minimumScale"],[e,"minimumScale"])),this.dispose(a.track([s,"pixelSize"],[e,"pixelSize"])),this.dispose(a.track([s,"showSceneScale"],[e,"showSceneScale"])),this.dispose(a.track([s,"modelMatrix"],[e,"modelMatrix"])),this.dispose(a.track([s,"cull"],[e,"cull"])),this.dispose(a.track([s,"boundingVolume"],[e,"boundingVolume"])),this.dispose(a.track([s,"pass"],[e,"pass"])),this.dispose(a.track([s,"primitiveType"],[e,"primitiveType"])),this.dispose(a.track([s,"renderState"],[e,"renderState"])),this.dispose(a.track([s,"vertexShaderSource"],[e,"vertexShaderSource"])),this.dispose(a.track([s,"fragmentShaderSource"],[e,"fragmentShaderSource"])),this.dispose(a.track([s,"uniformMap"],[e,"uniformMap"])),this.dispose(a.track([s,"attributes"],[e,"attributes"])),this.dispose(a.track([s,"indexTypedArray"],[e,"indexTypedArray"])),this.dispose(a.track([s,"attributesJson"],[e,"attributesJson"])),this.dispose(a.track([s,"indexTypedArrayJson"],[e,"indexTypedArrayJson"])),this.dispose(a.track([s,"count"],[e,"count"])),this.dispose(a.track([s,"offset"],[e,"offset"])),this.dispose(a.track([s,"instanceCount"],[e,"instanceCount"])),this.dispose(a.track([s,"localPosition"],[e,"localPosition"])),this.dispose(a.track([s,"localScale"],[e,"localScale"])),this.dispose(a.track([s,"localModelMatrix"],[e,"localModelMatrix"])),this.dispose(a.track([s,"debugShowBoundingVolume"],[e,"debugShowBoundingVolume"])),this.dispose(a.track([s,"debugOverlappingFrustums"],[e,"debugOverlappingFrustums"])),this.dispose(a.track([s,"occlude"],[e,"occlude"])),this.dispose(a.track([s,"castShadows"],[e,"castShadows"])),this.dispose(a.track([s,"receiveShadows"],[e,"receiveShadows"])),this.dispose(a.track([s,"executeInClosestFrustum"],[e,"executeInClosestFrustum"])),this.dispose(a.track([s,"pickOnly"],[e,"pickOnly"])),this.dispose(a.track([s,"depthForTranslucentClassification"],[e,"depthForTranslucentClassification"]));{const r=()=>{if(e.localRotation){const l=[...e.localRotation];l[0]-=90,s.localRotation=l}else s.localRotation=[-90,0,0]};r(),this.dispose(e.localRotationChanged.disposableOn(r))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmCustomPrimitive:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(Rt(s,o,n,e,r,!0),!0):!1}};m(Sl,"type",Sl.register("ESCesiumViewer",yh.type,Sl));let Wp=Sl;const El=class El extends dh{constructor(e,n){super(e,n);m(this,"czmGeoPolyline");m(this,"czmWater");if(!n.viewer){console.warn("viewer is undefined!");return}if(!et(n.viewer))return;this.czmGeoPolyline=this.dv(new Se(n,e.id)),this.czmWater=this.dv(new fo(n,e.id));const{czmGeoPolyline:r,czmWater:l}=this;this.d(a.track([l,"allowPicking"],[e,"allowPicking"])),this.d(a.track([l,"ground"],[e,"fillGround"])),this.d(a.track([r,"allowPicking"],[e,"allowPicking"])),this.d(a.track([r,"color"],[e,"strokeColor"])),this.d(a.track([r,"width"],[e,"strokeWidth"])),this.d(a.track([r,"ground"],[e,"strokeGround"]));{const c=this.dv(a.createNextAnimateFrameEvent(e.waterColorChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),u=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??a.ESDynamicWater.defaults.waterColor,frequency:(e.frequency??a.ESDynamicWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??a.ESDynamicWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??a.ESDynamicWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??a.ESDynamicWater.defaults.specularIntensity,flowDirection:e.flowDirection??a.ESDynamicWater.defaults.flowDirection,flowSpeed:e.flowSpeed??a.ESDynamicWater.defaults.flowSpeed});else{const d=Object.assign({},Ec[e.waterType]);d.frequency&&(d.frequency/=10),d.waveVelocity&&(d.waveVelocity/=100),d.amplitude&&(d.amplitude*=100),this.updateWater(d)}};u(),this.d(c.don(u))}{const c=()=>{r.show=e.show&&e.stroked},u=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(c)),c()}{const c=()=>{l.show=!!(e.show&&e.filled)},u=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(c)),c()}{const c=()=>{if(!e.points||e.points&&e.points.length<=2){r.positions=[],l.points=[];return}if(e.scale&&e.scale.some(f=>f===0)){console.warn("缩放属性(scale)不能设置值为0");return}const d=e.points.map(f=>[f[0],f[1],0]),[p]=yn({originPosition:e.position,originRotation:e.rotation,originScale:e.scale,initialRotationMode:"XForwardZUp"},d);r.positions=[...p,p[0]],l.points=[...p]};c();const u=this.dv(a.createNextAnimateFrameEvent(e.pointsChanged,e.positionChanged,e.rotationChanged,e.scaleChanged));this.d(u.don(c))}}visibleDistance(e,n){var o;if((o=n.viewer)!=null&&o.camera&&e.show){const s=a.getDistancesFromPositions([e.position,Ht(n.viewer.camera)],"NONE")[0];let r=!1;e.minVisibleDistance<e.maxVisibleDistance?r=e.minVisibleDistance<s&&s<e.maxVisibleDistance:e.maxVisibleDistance==0&&(r=s>e.minVisibleDistance),this.czmGeoPolyline&&(this.czmGeoPolyline.show=e.show&&e.stroked&&r),this.czmWater&&(this.czmWater.show=e.show&&e.filled&&r)}}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmWater:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r!=null&&r.points?(oe(s,o,n,r.points,e,!0),!0):!1:!1}updateWater(e){const{czmWater:n}=this;n&&(e.waterColor&&n.waterColor!=e.waterColor&&(n.waterColor=e.waterColor),e.specularIntensity!=null&&n.specularIntensity!=e.specularIntensity&&(n.specularIntensity=e.specularIntensity),e.frequency!=null&&n.frequency!=e.frequency&&(n.frequency=e.frequency),e.waveVelocity!=null&&n.animationSpeed!=e.waveVelocity&&(n.animationSpeed=e.waveVelocity),e.amplitude!=null&&n.amplitude!=e.amplitude&&(n.amplitude=e.amplitude),e.flowSpeed!=null&&n.flowSpeed!=e.flowSpeed&&(n.flowSpeed=e.flowSpeed),n.baseWaterImage=e.waterImage,n.stRotation=e.flowDirection)}};m(El,"type",El.register("ESCesiumViewer",a.ESDynamicWater.type,El));let Gp=El;const Me=class Me extends jt{constructor(e,n){super(e,n);m(this,"_dataSource",this.disposeVar(a.react(void 0)));m(this,"_pointFeatures",this.disposeVar(a.reactJsonWithUndefined(void 0)));m(this,"featureArrName","features");const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=et(o);if(!s)return;const{screenManager:r}=s,l={scale:1*Me.scaleFactor,font:"16px sans-serif",verticalOrigin:h.VerticalOrigin.BOTTOM,horizontalOrigin:h.HorizontalOrigin.CENTER,scaleByDistance:Me.scaleByDistance,eyeOffset:new h.Cartesian3(0,0,-10),show:!0},c={scale:1*Me.scaleFactor,verticalOrigin:h.VerticalOrigin.BOTTOM,horizontalOrigin:h.HorizontalOrigin.CENTER,scaleByDistance:Me.scaleByDistance,image:Me.clusterImageUrl};(async()=>{if(Me.clusterImageAttribute===void 0){const u=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterJson.json");await fetch(u).then(d=>d.json()).then(d=>{Me.clusterImageAttribute=d}).catch(d=>{console.error(d)})}{const u=()=>{if(!e.data){this.pointFeatures=void 0;return}this.featureArrName=e.data.type=="FeatureCollection"?"features":"geometries";const d={type:e.data.type,[this.featureArrName]:[]};if(e.data.type==="FeatureCollection")for(let p=0;p<e.data.features.length;p++){const f=e.data.features[p];if(f.geometry.type=="Point")d[this.featureArrName].push(f);else if(f.geometry.type=="MultiPoint")for(let g=0;g<f.geometry.coordinates.length;g++)d[this.featureArrName].push({type:"Feature",geometry:{type:"Point",coordinates:f.geometry.coordinates[g]},properties:f.properties??{}});else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",f.geometry.type)}else if(e.data.type=="GeometryCollection")for(let p=0;p<e.data.geometries.length;p++){const f=e.data.geometries[p];if(f.type=="Point")d[this.featureArrName].push(f);else if(f.type=="MultiPoint")for(let g=0;g<f.coordinates.length;g++)d[this.featureArrName].push({type:"Feature",geometry:{type:"Point",coordinates:f.coordinates[g]},properties:f.properties??{}});else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",f.type)}this.pointFeatures=d};u(),this.ad(e.dataChanged.don(u))}{const u=()=>{this.dataSource&&o.dataSources.remove(this.dataSource),this.dataSource=void 0};this.ad(()=>u());const d=()=>{u(),this.pointFeatures&&h.GeoJsonDataSource.load(this.pointFeatures).then(p=>{o.dataSources.add(p).then(()=>{this.dataSource=p})})};d(),this.ad(this.pointFeaturesChanged.don(d))}this.ad(new a.ObjResettingWithEvent(this.dataSourceChanged,()=>{var v;if(!this.dataSource)return;const u=new a.Destroyable,d=this.dataSource;d.clustering.enabled=d.clustering.clusterBillboards=d.clustering.clusterLabels=d.clustering.clusterPoints=!0;for(let y=0;y<d.entities.values.length;y++){const w=d.entities.values[y];w.billboard&&(w.billboard.color=new h.ConstantProperty(h.Color.TRANSPARENT))}{const y=()=>{const P=d.clustering.pixelRange;d.clustering.pixelRange=0,d.clustering.pixelRange=P};y();let w=(v=this.czmViewer.viewer)==null?void 0:v.camera.moveEnd.addEventListener(()=>{y()});u.d(()=>{var P;w&&((P=this.czmViewer.viewer)==null||P.camera.moveEnd.removeEventListener(w))})}u.d(a.track([d.clustering,"pixelRange"],[e,"pixelRange"])),u.d(a.track([d.clustering,"minimumClusterSize"],[e,"minimumClusterSize"])),d.clustering.clusterEvent.addEventListener((y,w)=>{w.label&&(w.label.show=!1),w.billboard&&(w.billboard.show=!1),w.point&&(w.point.show=!1)});const p=u.ad(a.react(!1));let f=[];const g=o.scene.postUpdate.addEventListener(()=>{if(d.clustering._clusterLabelCollection)if(d.clustering._clusterLabelCollection._labels.length!=f.length||!d.clustering._clusterLabelCollection._labels.every(y=>f.includes(y.id.length))){f=[];for(let y=0;y<d.clustering._clusterLabelCollection._labels.length;y++){const w=d.clustering._clusterLabelCollection._labels[y];f.push(w.id.length)}p.value=!0}else p.value=!1});u.ad(()=>g());{let y={id:"",layer:"",screenObjectIds:[]},w={id:"",layer:"",screenObjectIds:[]};const P=()=>{y&&(r.remove(y.layer,y.id,{label:y.screenObjectIds}),y={id:"",layer:"",screenObjectIds:[]}),w&&(r.remove(w.layer,w.id,{billboard:w.screenObjectIds}),w={id:"",layer:"",screenObjectIds:[]})};u.ad(()=>{P()});const C=()=>{var G,O,N,_,E,D;if(P(),!e.show||!Me.clusterImageAttribute)return;const x=e.style??a.ESEntityCluster.defaults.style,A=Me.clusterImageAttribute[((G=x.nonCluster)==null?void 0:G.mode)??"SquareH01"],R=[-A.anchorPixelOffset[0]+A.textPixelOffset[0],-A.anchorPixelOffset[1]-A.textPixelOffset[1]],L={...l,pixelOffset:new h.Cartesian2(R[0]*Me.scaleFactor,R[1]*Me.scaleFactor),heightReference:h.HeightReference[(e.heightReference??a.ESEntityCluster.defaults.heightReference).toUpperCase()]},B={...c,width:A.imageSize[0],height:A.imageSize[1],heightReference:h.HeightReference[(e.heightReference??a.ESEntityCluster.defaults.heightReference).toUpperCase()],pixelOffset:new h.Cartesian2(-A.anchorPixelOffset[0]*Me.scaleFactor,-A.anchorPixelOffset[1]*Me.scaleFactor),imageSubRegion:new h.BoundingRectangle(...A.imagePixelOffset,...A.imageSize)},V=new Map;if(d.clustering._clusterLabelCollection)for(let z=0;z<d.clustering._clusterLabelCollection._labels.length;z++){const U=d.clustering._clusterLabelCollection._labels[z];if(!Me.clusterImageAttribute)continue;const Y=U.text,q=se(U.position),X={index:U.id.map(Ae=>d.entities.values.length-1-d.clustering._collectionIndicesByEntity[Ae.id].billboardIndex).sort((Ae,Te)=>Ae-Te),name:Y,position:q},Q=this.getClusterStyle(x.cluster??a.ESEntityCluster.defaults.style.cluster,U.id.length).mode,j=Me.clusterImageAttribute[Q],ae=[-j.anchorPixelOffset[0]+j.textPixelOffset[0],-j.anchorPixelOffset[1]-j.textPixelOffset[1]],ue={...l,pixelOffset:new h.Cartesian2(ae[0]*Me.scaleFactor,ae[1]*Me.scaleFactor),heightReference:h.HeightReference[(e.heightReference??a.ESEntityCluster.defaults.heightReference).toUpperCase()]},fe={...c,width:j.imageSize[0],height:j.imageSize[1],heightReference:h.HeightReference[(e.heightReference??a.ESEntityCluster.defaults.heightReference).toUpperCase()],pixelOffset:new h.Cartesian2(-j.anchorPixelOffset[0]*Me.scaleFactor,-j.anchorPixelOffset[1]*Me.scaleFactor),imageSubRegion:new h.BoundingRectangle(...j.imagePixelOffset,...j.imageSize)},_e=r.addImage(e.id,e.typeName,fe,X),Oe=r.addLabel(e.id,e.typeName,ue,X);w.id=_e.id,w.layer=_e.layer,w.screenObjectIds.push(_e.screenObjectId),y.id=Oe.id,y.layer=Oe.layer,y.screenObjectIds.push(Oe.screenObjectId);for(let Ae=0;Ae<U.id.length;Ae++)V.set(U.id[Ae].id,1)}for(let z=0;z<d.entities.values.length;z++){const U=d.entities.values[z];if(V.has(U.id)||!this.pointFeatures||!n.isPointVisible(se((O=U.position)==null?void 0:O.getValue())))continue;const Y=((N=this.pointFeatures[this.featureArrName][z])==null?void 0:N.coordinates)??((_=this.pointFeatures[this.featureArrName][z])==null?void 0:_.geometry.coordinates),q=((E=this.pointFeatures[this.featureArrName][z])==null?void 0:E.name)??((D=this.pointFeatures[this.featureArrName][z].properties)==null?void 0:D.name)??(z+1).toString(),X={index:z,name:q,position:Y},Q=r.addImage(e.id,e.typeName,B,X),j=r.addLabel(e.id,e.typeName,L,X);w.id=Q.id,w.layer=Q.layer,w.screenObjectIds.push(Q.screenObjectId),y.id=j.id,y.layer=j.layer,y.screenObjectIds.push(j.screenObjectId)}};C();const S=u.ad(a.createNextAnimateFrameEvent(e.showChanged,e.styleChanged,e.heightReferenceChanged,p.changed));u.ad(S.don(C))}return u}))})()}get dataSource(){return this._dataSource.value}set dataSource(e){this._dataSource.value=e}get dataSourceChanged(){return this._dataSource.changed}get pointFeatures(){return this._pointFeatures.value}set pointFeatures(e){this._pointFeatures.value=e}get pointFeaturesChanged(){return this._pointFeatures.changed}getClusterStyle(e,n){return e.find(o=>{if(o.value!==void 0)return o.value===n;const s=o.minValue!==void 0?o.minValue<=n:!0,r=o.maxValue!==void 0?o.maxValue>=n:!0;return s&&r})}};m(Me,"type",Me.register("ESCesiumViewer",a.ESEntityCluster.type,Me)),m(Me,"scaleFactor",.6),m(Me,"scaleByDistance",new h.NearFarScalar(100,1,1e3,1)),m(Me,"clusterImages"),m(Me,"clusterImageAttribute"),m(Me,"clusterImageUrl",a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterSpirit.png"));let Hp=Me;const xl=class xl extends jt{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}flyTo(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyToParam||n.flyInParam?super.flyTo(i,e):(n.esImageryLayer.flyTo(i&&i),n.flyOverEvent.emit(e,"over",o),!0):!1}flyIn(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyInParam?super.flyIn(i,e):(n.esImageryLayer.flyTo(i&&i),n.flyOverEvent.emit(e,"over",o),!0):!1}};m(xl,"type",xl.register("ESCesiumViewer",gh.type,xl));let $p=xl;const Al=class Al extends Yt{constructor(e,n){super(e,n);m(this,"geoPolyline");m(this,"czmWater");if(!n.viewer){console.warn("viewer is undefined!");return}if(!et(n.viewer))return;this.geoPolyline=this.dv(new Se(n,e.id)),this.czmWater=this.dv(new fo(n,e.id));const{geoPolyline:r,czmWater:l}=this;this.d(a.track([l,"allowPicking"],[e,"allowPicking"])),this.d(a.track([l,"ground"],[e,"fillGround"])),this.d(a.track([r,"allowPicking"],[e,"allowPicking"])),this.d(a.track([r,"color"],[e,"strokeColor"])),this.d(a.track([r,"width"],[e,"strokeWidth"])),this.d(a.track([r,"ground"],[e,"strokeGround"]));{const c=this.dv(a.createNextAnimateFrameEvent(e.waterColorChanged,e.waterImageChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),u=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??a.ESGeoWater.defaults.waterColor,frequency:(e.frequency??a.ESGeoWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??a.ESGeoWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??a.ESGeoWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??a.ESGeoWater.defaults.specularIntensity,flowDirection:e.flowDirection??a.ESGeoWater.defaults.flowDirection,flowSpeed:e.flowSpeed??a.ESGeoWater.defaults.flowSpeed,waterImage:e.waterImage??a.ESGeoWater.defaults.waterImage});else{const d=Object.assign({},Ec[e.waterType]);d.frequency&&(d.frequency/=10),d.waveVelocity&&(d.waveVelocity/=100),d.amplitude&&(d.amplitude*=100),this.updateWater(d)}};u(),this.d(c.don(u))}{const c=()=>{r.show=!!(e.show&&e.stroked)},u=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(c)),c()}{const c=()=>{l.show=e.show&&e.filled},u=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(c)),c()}{const c=()=>{e.points&&e.points.length>=3?(r.positions=[...e.points,e.points[0]],l.points=[...e.points]):(r.positions=e.points&&e.points.length>=2?[...e.points,e.points[0]]:[],l.points=[])};c();const u=this.dv(a.createNextAnimateFrameEvent(e.pointsChanged));this.d(u.don(c))}this.ad(e.editingChanged.don(c=>{l.updateBoundingSphere(c)}))}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}updateWater(e){const{czmWater:n}=this;e.waterColor&&n.waterColor!=e.waterColor&&(n.waterColor=e.waterColor),e.specularIntensity!=null&&n.specularIntensity!=e.specularIntensity&&(n.specularIntensity=e.specularIntensity),e.frequency!=null&&n.frequency!=e.frequency&&(n.frequency=e.frequency),e.waveVelocity!=null&&n.animationSpeed!=e.waveVelocity&&(n.animationSpeed=e.waveVelocity),e.amplitude!=null&&n.amplitude!=e.amplitude&&(n.amplitude=e.amplitude),e.flowSpeed!=null&&n.flowSpeed!=e.flowSpeed&&(n.flowSpeed=e.flowSpeed),n.baseWaterImage=e.waterImage,n.stRotation=e.flowDirection}};m(Al,"type",Al.register("ESCesiumViewer",a.ESGeoWater.type,Al));let qp=Al;function DT(t){let i,e;if(Reflect.has(t,"type")&&t.type==="symbol"&&Reflect.has(t,"layout")){const n=t.layout;e={},e.image=n["icon-image"]??a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/location.png");const{horizontalOrigin:o,verticalOrigin:s}=qy(n["icon-anchor"]??"right");if(e.horizontalOrigin=o,e.verticalOrigin=s,Reflect.has(t,"paint")){const r=t.paint;e.color=h.Color.fromCssColorString(r["icon-color"]??"#FFFFFF").withAlpha(r["icon-opacity"]??1)}if(e.rotation=h.Math.toRadians(n["icon-rotate"]??0),e.scale=n["icon-size"]??.5,e.width=n["icon-width"]??64,e.height=n["icon-height"]??64,e.pixelOffset=new h.Cartesian2(0,-25),e.pixelOffsetScaleByDistance=new h.NearFarScalar(150,1,8e6,0),e.show=(n.visibility??"visible")==="visible",Reflect.has(n,"text-field")){i={},i.text=n["text-field"];const{horizontalOrigin:r,verticalOrigin:l}=qy(n["text-anchor"]??"left");if(i.horizontalOrigin=r,i.verticalOrigin=l,Reflect.has(t,"paint")){const c=t.paint;i.fillColor=h.Color.fromCssColorString(c["text-color"]??"#FFFFFF").withAlpha(c["text-opacity"]??1)}i.font=`${n["text-size"]??16}px ${n["text-font"]??"sans-serif"}`,i.show=(n.visibility??"visible")==="visible",i.pixelOffset=new h.Cartesian2(0,-25),i.pixelOffsetScaleByDistance=new h.NearFarScalar(150,1,8e6,0)}}return{labelStyle:i,billboardStyle:e}}function qy(t){let i=h.HorizontalOrigin.CENTER,e=h.VerticalOrigin.CENTER;switch(t){case"center":break;case"left":i=h.HorizontalOrigin.LEFT;break;case"right":i=h.HorizontalOrigin.RIGHT;break;case"top":e=h.VerticalOrigin.TOP;break;case"bottom":e=h.VerticalOrigin.BOTTOM;break;case"top-left":i=h.HorizontalOrigin.LEFT,e=h.VerticalOrigin.TOP;break;case"top-right":i=h.HorizontalOrigin.RIGHT,e=h.VerticalOrigin.TOP;break;case"bottom-left":i=h.HorizontalOrigin.LEFT,e=h.VerticalOrigin.BOTTOM;break;case"bottom-right":i=h.HorizontalOrigin.RIGHT,e=h.VerticalOrigin.BOTTOM;break}return{horizontalOrigin:i,verticalOrigin:e}}class RT extends a.Destroyable{constructor(e,n){super();m(this,"czmViewer");m(this,"czmESMVTLayer");m(this,"screenManager");m(this,"cacheSize",300);m(this,"urlMap",new Map);m(this,"tileScheme","xyz");m(this,"heightReference","NONE");m(this,"minimumLevel",0);m(this,"maximumLevel",18);m(this,"_cache",new Map);m(this,"lastTiles",new Map);this.czmViewer=e,this.czmESMVTLayer=n;const o=this.czmViewer.viewer;if(!o)return;const s=et(o);if(!s)return;this.screenManager=s.screenManager,this.tileScheme=n.sceneObject.scheme??"xyz",this.heightReference=n.sceneObject.heightReference,this.maximumLevel=n.sceneObject.maximumLevel,this.minimumLevel=n.sceneObject.minimumLevel,(()=>{do{if(!n.mvtLayerJson)break;if(typeof n.mvtLayerJson.mainJson=="string"){this.urlMap.set("customSource",[n.mvtLayerJson.mainJson]);break}if(typeof n.mvtLayerJson.mainJson=="object"){const l=n.mvtLayerJson.mainJson.sources;for(const c in l){const u=l[c];u.type==="vector"&&Reflect.has(u,"tiles")&&this.urlMap.set(c,u.tiles)}break}}while(!1)})(),this.ad(()=>{var c;const l=Array.from(this.lastTiles.values()).map(u=>u.featureTable).map(u=>Object.values(u)).flat(1/0);l&&((c=this.screenManager)==null||c.remove("default",this.czmESMVTLayer.sceneObject.id,l)),this.cache&&(this.cache.clear(),this.cache=null)})}get cache(){return this._cache}set cache(e){this._cache=e}addTiles(e){var r;if(this.urlMap.size==0)return;if(this.cache&&this.cache.has(e)&&this.lastTiles.has(e)){this.updateTiles([e],"show");return}const[n,o,s]=e.split("-").map(Number);(r=this.cache)==null||r.set(e,new Map),this.requestImage(o,s,n,e)}updateTiles(e,n="hide"){var o,s,r,l,c;for(let u=0;u<e.length;u++){const d=e[u],p=this.lastTiles.get(d);if(p){const f=Object.keys(p.featureTable);for(let g=0;g<f.length;g++){const v=f[g],y=p.featureTable[v];if(n=="delete")(o=this.screenManager)==null||o.remove(p.layer,p.id,y);else{const w=(s=this.cache)==null?void 0:s.get(d);w&&((r=this.cache)==null||r.delete(d),(l=this.cache)==null||l.set(d,w)),this.screenManager.avoidanceManager.enable||(c=this.screenManager)==null||c.update(p.layer,p.id,y,{all:{show:n=="show"}})}}}n=="delete"&&this.lastTiles.delete(d)}}update(e){const n=Array.from(this.lastTiles.keys()),o=n.filter(l=>!e.includes(l)),s=n.filter(l=>e.includes(l)),r=e.filter(l=>!n.includes(l));this.updateTiles(o,"delete"),this.updateTiles(s,"show");for(let l=0;l<r.length;l++){const c=r[l];this.addTiles(c)}}requestImage(e,n,o,s){const r=this.tileScheme=="tms"?Math.pow(2,o)-n-1:n;this.urlMap.size!=0&&this.urlMap.entries().forEach(([l,c])=>{if(c.length!=0&&c[0].includes("{z}")){const u=c[0].replace(/{z}/g,o.toString()).replace(/{x}/g,e.toString()).replace(/{y}/g,r.toString());fetch(u).then(d=>{var p,f;if(d.ok&&((p=this.cache)!=null&&p.has(s))&&((f=this.cache.get(s))==null?void 0:f.size)==0)return d.arrayBuffer()}).then(d=>{var v,y,w;const p=new g_(d),f=new m_.VectorTile(p),g=new Map;for(const P in f.layers){const C=f.layers[P];if(C.length<=0||C.feature(0).type!==1)continue;const S=[];for(let x=0;x<C.length;x++){const A=C.feature(x);S.push(A.toGeoJSON(e,n,o))}g.set(P,S)}(v=this.cache)!=null&&v.has(s)&&((y=this.cache.get(s))==null?void 0:y.size)==0&&((w=this.cache)==null||w.set(s,g),this.addScreenManage(s,g),this.clearCache())})}})}clearCache(){if(!this.cache)return;const e=this.cache.size-this.cacheSize;if(!(e<=0))for(let n=0;n<e;n++){const o=this.cache.keys().next().value;o&&(this.updateTiles([o],"delete"),this.cache.delete(o))}}addScreenManage(e,n){var s,r;this.lastTiles.set(e,{layer:"default",id:this.czmESMVTLayer.sceneObject.id,featureTable:{}});const o=this.lastTiles.get(e);for(const[l,c]of n.entries()){const u=this.czmESMVTLayer.mvtLayerJson.pointJson.find(d=>d["source-layer"]==l)??{};for(const d of c){const p=Number.parseInt(e.split("-")[0]);if(Reflect.has(u,"minzoom")&&u.minzoom>p||Reflect.has(u,"maxzoom")&&u.maxzoom<p)continue;const{labelStyle:f,billboardStyle:g}=DT(u);let v,y;const w=this.heightReference=="NONE"?d.geometry.coordinates:FT(this.czmViewer,d.geometry.coordinates);d.properties.name&&(f&&(f.show=!this.screenManager.avoidanceManager.enable,v=this.screenManager.addLabel(this.czmESMVTLayer.sceneObject.id,"default",f??{},{position:w,name:d.properties.NAME??d.properties.name,index:d.id??u["source-layer"]+((s=d==null?void 0:d.properties)==null?void 0:s.osm_id)})),g&&d.properties.name&&(g.show=!this.screenManager.avoidanceManager.enable,y=this.screenManager.addImage(this.czmESMVTLayer.sceneObject.id,"default",g??{},{position:w,name:d.properties.NAME??d.properties.name,index:d.id??u["source-layer"]+((r=d==null?void 0:d.properties)==null?void 0:r.osm_id)})),o.featureTable[l]||(o.featureTable[l]=[]),v&&o.featureTable[l].push(v.screenObjectId),y&&o.featureTable[l].push(y.screenObjectId))}}}reset(){if(!this.cache)return;const e=Array.from(this.cache.keys());this.update([]),setTimeout(()=>{this.update(e)})}}function FT(t,i){var n;const e=(n=t.viewer)==null?void 0:n.scene.globe.getHeight(h.Cartographic.fromDegrees(i[0],i[1],i[2]??0));return[i[0],i[1],e??0]}class zT extends a.Destroyable{constructor(e,n){var s;super();m(this,"vectorTilesCache");m(this,"czmViewer");m(this,"czmESMVTLayer");this.czmViewer=e,this.czmESMVTLayer=n,this.vectorTilesCache=this.ad(new RT(e,n)),this.updateTiles();const o=(s=this.czmViewer.viewer)==null?void 0:s.camera.moveEnd.addEventListener(()=>{this.updateTiles()});this.ad(()=>{o&&o()})}updateTiles(){const e=this.czmViewer.viewer;if(!e)return;const n=new Set;for(let o=0;o<e.scene.globe._surface._tilesToRender.length;o++){const s=e.scene.globe._surface._tilesToRender[o];if(s.data)for(let r=0;r<s.data.imagery.length;r++){const l=s.data.imagery[r],c=l.loadingImagery??l.readyImagery;if(c){const u=`${c.level}-${c.x}-${c.y}`;n.add(u)}}}this.vectorTilesCache.update(Array.from(n))}}const Tl=class Tl extends jt{constructor(e,n){super(e,n);m(this,"_czmImagery");m(this,"_mvtLayerJson",this.disposeVar(a.reactJson({mainJson:"",pointJson:[],otherJson:[]})));m(this,"mvtLayerJsonChanged",this.ad(new a.Event));if(this._czmImagery=this.dv(new Ln(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmImagery;this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([s,"zIndex"],[e,"zIndex"])),this.d(a.track([s,"rectangle"],[e,"rectangle"])),this.d(a.track([s,"alpha"],[e,"opacity"])),this.d(a.track([s,"splitDirection"],[e,"splitDirection"])),this.d(a.track([s,"brightness"],[e,"czmBrightness"])),this.d(a.track([s,"contrast"],[e,"czmContrast"])),this.d(a.track([s,"hue"],[e,"czmHue"])),this.d(a.track([s,"saturation"],[e,"czmSaturation"])),this.d(a.track([s,"gamma"],[e,"czmGamma"]));{const l=this.dv(a.createNextAnimateFrameEvent(e.accessTokenChanged,e.maximumLevelChanged,e.minimumLevelChanged,e.tileSizeChanged,e.allowPickingChanged,e.rectangleChanged,e.schemeChanged,this.mvtLayerJsonChanged)),c=()=>{!this.mvtLayerJson||this.mvtLayerJson.otherJson.length==0||(s.imageryProvider={type:"MVTImageryProvider",url:this.mvtLayerJson.mainJson,accessToken:e.accessToken,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,tileSize:e.tileSize,enablePickFeatures:e.allowPicking,rectangle:e.rectangle,style:this.mvtLayerJson.otherJson,scheme:e.scheme})};c(),this.d(l.don(c))}{const l=d=>{const p=structuredClone(d);Reflect.deleteProperty(p,"layers"),this.mvtLayerJson={mainJson:p,pointJson:d.layers.filter(f=>f.type=="symbol"),otherJson:d.layers.filter(f=>f.type!="symbol")}},c=async()=>{var d;if(typeof e.url=="string")if(e.url.includes("{z}"))this.mvtLayerJson.mainJson=e.url;else{const p=await fetch(e.url);if((d=p.headers.get("Content-Type"))!=null&&d.includes("json")){const f=await p.json();l(f)}}else l(e.url);e.style&&e.style.length!=0&&(this.mvtLayerJson.pointJson=e.style.filter(p=>p.type=="symbol"),this.mvtLayerJson.otherJson=e.style.filter(p=>p.type!="symbol")),this.mvtLayerJsonChanged.emit()};c();const u=this.ad(a.createNextAnimateFrameEvent(e.urlChanged,e.styleChanged));this.ad(u.don(c))}const r=this.ad(a.createNextAnimateFrameEvent(e.schemeChanged,e.maximumLevelChanged,e.minimumLevelChanged,this.mvtLayerJsonChanged,e.showChanged,e.heightReferenceChanged));this.ad(new a.ObjResettingWithEvent(r,()=>{if(e.show)return new zT(n,this)}))}get czmImagery(){return this._czmImagery}get mvtLayerJson(){return this._mvtLayerJson.value}set mvtLayerJson(e){this._mvtLayerJson.value=e}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(Tl,"type",Tl.register("ESCesiumViewer",fh.type,Tl));let Xp=Tl;class LT extends a.Destroyable{constructor(i,e){super(),this._czmESPipeFence=i,this._sceneObject=e;const n=this._sceneObject,o=this._czmESPipeFence,s=o.czmCustomPrimitive;if(!n.points||n.points.length<2){this.clear(s);return}const r=n.points.length;let l=[],c=[],u=[],d=[],p=[];for(let P=0;P<r-1;P++){const{outlinePionts:C,customPrimitivePoints:S}=this.divideFourPoints(n.points[P],n.points[P+1]);d.push(...S),p.push(...C),u.push(...this.setIndexs(P))}const[f,g,v]=Dt({originPosition:d[0]},d),y=this.setFaces(f);l.push(...y.flat());const w=this.setTextureCoordinates(n,o);c.push(...w.flat()),o.computeBoundingBox(),this.updateCustomPrimitive(s,g,l,u,c)}divideFourPoints(i,e){const n=a.geoHeading(i,e),o=a.geoDestination(i,this._sceneObject.width/2,90+n),s=a.geoDestination(i,this._sceneObject.width/2,n-90),r=a.geoDestination(e,this._sceneObject.width/2,n-90),l=a.geoDestination(e,this._sceneObject.width/2,90+n),c=[o[0],o[1],o[2]+this._sceneObject.height/2],u=[o[0],o[1],o[2]-this._sceneObject.height/2],d=[s[0],s[1],s[2]+this._sceneObject.height/2],p=[s[0],s[1],s[2]-this._sceneObject.height/2],f=[l[0],l[1],l[2]+this._sceneObject.height/2],g=[l[0],l[1],l[2]-this._sceneObject.height/2],v=[r[0],r[1],r[2]+this._sceneObject.height/2],y=[r[0],r[1],r[2]-this._sceneObject.height/2],w=[[c,d],[c,f],[c,u],[u,g]],P=[[u,p],[d,v],[d,p],[p,y]],C=[[f,g],[f,v],[g,y],[v,y]];return{outlinePionts:[...w,...P,...C],customPrimitivePoints:[u,c,d,p,g,f,v,y]}}setIndexs(i){const e=i*16;return[e+1,e+0,e+3,e+1,e+3,e+2,e+5,e+4,e+7,e+6,e+5,e+7,e+9,e+8,e+11,e+9,e+11,e+10,e+13,e+12,e+15,e+13,e+15,e+14]}setFaces(i){const e=[],n=i.length/8;for(let s=0;s<n;s++){const r=i.slice(8*s,8*(s+1));e.push(r)}return[...e.map(s=>[s[4],s[5],s[1],s[0],s[5],s[6],s[2],s[1],s[6],s[7],s[3],s[2],s[7],s[4],s[0],s[3]]).flat()]}getDistances(i,e){const[n]=Dt({originPosition:i[0]},i),o=n.length,s=n.reduce((c,u,d,p)=>{if(d===0)return c.push(0),c;const f=d-1,g=p[f],v=Math.sqrt((g[0]-u[0])*(g[0]-u[0])+(g[1]-u[1])*(g[1]-u[1]));return c.push(c[f]+v),c},[]),r=s[o-1];return e.distances=r,s.map(c=>c/r)}setTextureCoordinates(i,e){if(!i.points||i.points.length<2)return;const n=this.getDistances(i.points,e),o=[];for(let s=1;s<n.length;s++){let r=[];if(s===n.length-1){const l=[1,0,1,1,n[s-1],1,n[s-1],0];r=[...l,...l,...l,...l]}else{const l=[n[s],0,n[s],1,n[s-1],1,n[s-1],0];r=[...l,...l,...l,...l]}o.push(r)}return o}updateCustomPrimitive(i,e,n,o,s){i.modelMatrix=e,i.indexTypedArray=new Uint16Array(o),i.attributes={position:{typedArray:new Float32Array(n),componentsPerAttribute:3},a_st:{typedArray:new Float32Array(s),componentsPerAttribute:2}}}clear(i){i.indexTypedArray=void 0,i.modelMatrix=void 0,i.attributes=void 0}}const Ml=class Ml extends yt{constructor(e,n){super(e,n);m(this,"_line",this.dv(new Se(this.czmViewer,this.sceneObject.id)));m(this,"_czmTexture",this.ad(new Be(this.czmViewer,this.sceneObject.id)));m(this,"_czmCustomPrimitive",this.dv(new ze(this.czmViewer,this.sceneObject.id)));m(this,"_distances",this.dv(a.react(0)));if(!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmTexture,r=this._line;this.d(a.bind([r,"positions"],[e,"points"])),this.d(a.track([this.line,"allowPicking"],[e,"allowPicking"])),this.d(a.track([this.line,"color"],[e,"strokeColor"])),this.d(a.track([this.line,"width"],[e,"strokeWidth"])),this.d(a.track([this.line,"ground"],[e,"strokeGround"]));{const d=this.dv(a.createNextAnimateFrameEvent(this.sceneObject.pointsChanged,this.sceneObject.strokeWidthChanged,this.sceneObject.strokeColorChanged,this.sceneObject.heightChanged,this.sceneObject.widthChanged,this.sceneObject.fillColorChanged));this.dv(new a.ObjResettingWithEvent(d,()=>new LT(this,this.sceneObject)))}{const d=()=>{r.show=e.show&&e.stroked};d();const p=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(p.don(d))}this.bindCustomPrimitive(e);let l="";const c=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/singleArrow.png"),u=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/multipleArrows.png");{const d=()=>{e.materialMode==="multipleArrows"||e.materialMode==="blue"?l=u:e.materialMode==="color"?l="":l=c,s.uri=l,l==""?(this._czmCustomPrimitive.uniformMap={u_color:e.fillColor},this._czmCustomPrimitive.fragmentShaderSource=` uniform vec4 u_color;
1747
1747
  in vec2 v_st;
1748
1748
  void main()
1749
1749
  {
@@ -1782,7 +1782,7 @@ ${$y}
1782
1782
  {
1783
1783
  v_st = a_st;
1784
1784
  gl_Position = czm_modelViewProjection * vec4(position, 1.0);
1785
- }`,n.castShadows=!0,n.receiveShadows=!0,this.computeBoundingBox();{const o=()=>{n.show=e.show&&e.filled};o();const s=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(s.don(o))}return n}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):this.line.positions?(oe(s,o,n,this.line.positions,e),!0):!1:!1}};m(Ml,"type",Ml.register("ESCesiumViewer",a.ESPipeFence.type,Ml));let Yp=Ml;const Il=class Il extends Os{constructor(e,n){super(e,n);m(this,"czmCustomPrimitive");m(this,"czmTexture");if(!n.viewer){console.warn("viewer is undefined!");return}const s=this.dv(new ze(n,e.id)),r=this.ad(new Be(n,e.id));this.czmCustomPrimitive=s,this.czmTexture=r,this.d(a.track([s,"allowPicking"],[e,"allowPicking"]));const l=this.dv(a.createNextAnimateFrameEvent(e.pointsChanged,e.radiusChanged,e.sidesChanged));this.dv(new a.ObjResettingWithEvent(l,()=>{if(e.radius>0&&e.sides>=3&&e.points&&e.points.length>=2)return new LT(e,this);s.attributes=void 0}))}};m(Il,"type",Il.register("ESCesiumViewer",a.ESPipeline.type,Il));let Zp=Il;class LT extends a.Destroyable{constructor(i,e){super(),this._sceneObject=i,this._czmESPipeline=e;const n=this._sceneObject,o=this._czmESPipeline,s=o.czmCustomPrimitive,r=o.czmTexture;if(!s||!r)return;{const u=()=>{s.show=n.show&&n.filled};u();const d=this.dv(a.createNextAnimateFrameEvent(n.showChanged,n.filledChanged));this.d(d.don(u))}const l=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/singleArrow.png"),c=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/multipleArrows.png");{const u=()=>{n.materialImage.url!=""?r.uri=typeof n.materialImage.url=="string"?n.materialImage.url:n.materialImage.url.url:n.materialMode==="multipleArrows"||n.materialMode==="blue"?r.uri=c:r.uri=l;const p=a.getDistancesFromPositions(n.points,"GEODESIC"),g=p[p.length-1]/n.materialImage.uDis;s.uniformMap={u_image:{type:"texture",id:r.id},u_stScale:[g,2*Math.PI*n.radius/n.materialImage.vDis],u_speed:[n.speed/n.materialImage.uDis,0],u_color:n.fillColor}};u();const d=this.dv(a.createNextAnimateFrameEvent(n.speedChanged,n.materialImageChanged,n.materialModeChanged,n.fillColorChanged));this.d(d.don(u))}(()=>{if(!n.points||n.points.length>=2&&a.equalsN3(n.points[n.points.length-2],n.points[n.points.length-1]))return;const{position:d,modelMatrix:p,indexes:f,uvCoordinates:g}=this.coordinateTransformation(n.points,n.sides);s.modelMatrix=p,s.attributes={position:{typedArray:new Float32Array(d),componentsPerAttribute:3},st:{typedArray:new Float32Array([...g,...g.reverse()]),componentsPerAttribute:2}},s.indexTypedArray=new Uint16Array([...f,...f.reverse()]),s.fragmentShaderSource=`
1785
+ }`,n.castShadows=!0,n.receiveShadows=!0,this.computeBoundingBox();{const o=()=>{n.show=e.show&&e.filled};o();const s=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(s.don(o))}return n}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):this.line.positions?(oe(s,o,n,this.line.positions,e),!0):!1:!1}};m(Ml,"type",Ml.register("ESCesiumViewer",a.ESPipeFence.type,Ml));let Yp=Ml;const Il=class Il extends Os{constructor(e,n){super(e,n);m(this,"czmCustomPrimitive");m(this,"czmTexture");if(!n.viewer){console.warn("viewer is undefined!");return}const s=this.dv(new ze(n,e.id)),r=this.ad(new Be(n,e.id));this.czmCustomPrimitive=s,this.czmTexture=r,this.d(a.track([s,"allowPicking"],[e,"allowPicking"]));const l=this.dv(a.createNextAnimateFrameEvent(e.pointsChanged,e.radiusChanged,e.sidesChanged));this.dv(new a.ObjResettingWithEvent(l,()=>{if(e.radius>0&&e.sides>=3&&e.points&&e.points.length>=2)return new OT(e,this);s.attributes=void 0}))}};m(Il,"type",Il.register("ESCesiumViewer",a.ESPipeline.type,Il));let Zp=Il;class OT extends a.Destroyable{constructor(i,e){super(),this._sceneObject=i,this._czmESPipeline=e;const n=this._sceneObject,o=this._czmESPipeline,s=o.czmCustomPrimitive,r=o.czmTexture;if(!s||!r)return;{const u=()=>{s.show=n.show&&n.filled};u();const d=this.dv(a.createNextAnimateFrameEvent(n.showChanged,n.filledChanged));this.d(d.don(u))}const l=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/singleArrow.png"),c=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/multipleArrows.png");{const u=()=>{n.materialImage.url!=""?r.uri=typeof n.materialImage.url=="string"?n.materialImage.url:n.materialImage.url.url:n.materialMode==="multipleArrows"||n.materialMode==="blue"?r.uri=c:r.uri=l;const p=a.getDistancesFromPositions(n.points,"GEODESIC"),g=p[p.length-1]/n.materialImage.uDis;s.uniformMap={u_image:{type:"texture",id:r.id},u_stScale:[g,2*Math.PI*n.radius/n.materialImage.vDis],u_speed:[n.speed/n.materialImage.uDis,0],u_color:n.fillColor}};u();const d=this.dv(a.createNextAnimateFrameEvent(n.speedChanged,n.materialImageChanged,n.materialModeChanged,n.fillColorChanged));this.d(d.don(u))}(()=>{if(!n.points||n.points.length>=2&&a.equalsN3(n.points[n.points.length-2],n.points[n.points.length-1]))return;const{position:d,modelMatrix:p,indexes:f,uvCoordinates:g}=this.coordinateTransformation(n.points,n.sides);s.modelMatrix=p,s.attributes={position:{typedArray:new Float32Array(d),componentsPerAttribute:3},st:{typedArray:new Float32Array([...g,...g.reverse()]),componentsPerAttribute:2}},s.indexTypedArray=new Uint16Array([...f,...f.reverse()]),s.fragmentShaderSource=`
1786
1786
  in vec2 v_st;
1787
1787
  uniform sampler2D u_image;
1788
1788
  uniform vec4 u_color;
@@ -1815,7 +1815,7 @@ ${$y}
1815
1815
  vec4 imageColor = texture(u_image, st);
1816
1816
  out_FragColor = imageColor * u_color;
1817
1817
  }
1818
- `;const O=f.computeLocalAxisedBoundingBoxFromAttribute("position");if(!O)return;const{min:N,max:_}=O;f.setLocalAxisedBoundingBox(N,_)},d=async()=>{if(e.points&&e.points.length>2){const{minPos:f,center:g}=a.getMinMaxCorner(e.points),v=f[2]-e.depth;if(!a.equalsN3(e.points[e.points.length-1],e.points[e.points.length-2])){const x=Dt({originPosition:g},e.points.map((A,R)=>{let L=[...A];return L[2]=v,L}));u(l,g,x[0],"bottom",!0)}const y=this._interpolationAlongPolygon(e.points.map((x,A)=>h.Cartesian3.fromArray(a.lbhToXyz(x))),e.interpolation),w=await n.getHeightsByLonLats(y.map(x=>[x[0],x[1]]));let P=[];for(let x=0;x<y.length;x++){const A=y[x];P.push([A[0],A[1],w[x]??A[2]],[A[0],A[1],v])}const C=Dt({originPosition:g},P);let S=this._isClockwise(e.points,n);u(s,g,C[0],"side",S)}else s.attributes=void 0,l.attributes=void 0};d();const p=this.dv(a.createNextAnimateFrameEvent(e.depthChanged,e.interpolationChanged,e.pointsChanged,e.bottomImageChanged,e.sideImageChanged));this.ad(p.don(d))}{const u=()=>{r.uri=e.sideImage.url,c.uri=e.bottomImage.url,s.uniformMap={u_image:{type:"texture",id:r.id},u_color:[1,1,1,e.opacity]},l.uniformMap={u_image:{type:"texture",id:c.id},u_color:[1,1,1,e.opacity]}};u();const d=this.ad(a.createNextAnimateFrameEvent(e.opacityChanged,e.bottomImageChanged,e.sideImageChanged));this.d(d.don(u))}}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}_interpolationAlongPolygon(e,n){var o=[];for(let c=0;c<e.length;++c){var s=e[c],r=e[(c+1)%e.length],l=this._interpolationAlongLine(s,r,n);o.push(...l)}return o.push(o[0]),o}_interpolationAlongLine(e,n,o){var s=[],r=h.Cartesian3.distance(e,n),l=h.Cartesian3.subtract(n,e,new h.Cartesian3);l.equals(h.Cartesian3.ZERO)||h.Cartesian3.normalize(l,l);for(var c=0;c<r;){var u=new h.Cartesian3(l.x*c,l.y*c,l.z*c),d=h.Cartesian3.add(e,u,new h.Cartesian3);const p=se(d);p&&s.push(p),c+=o}return s}_isClockwise(e,n){if(n.viewer)for(let o=0;o<e.length;o++){let s=h.Cartesian3.fromDegrees(...e[o]),r=h.Cartesian3.fromDegrees(...e[(o+1)%e.length]),l=h.Cartesian3.fromDegrees(...e[(o+2)%e.length]),c=h.Cartesian3.subtract(r,s,new h.Cartesian3),u=h.Cartesian3.subtract(l,r,new h.Cartesian3);if(c.equals(h.Cartesian3.ZERO)||u.equals(h.Cartesian3.ZERO))return!0;if(h.Cartesian3.normalize(c,c),h.Cartesian3.normalize(u,u),Math.abs(h.Cartesian3.dot(c,u))==1){if(o==e.length-1)return!0;continue}let d=h.Cartesian3.cross(c,u,new h.Cartesian3);return h.Cartesian3.dot(d,n.viewer.camera.directionWC)>0}}_triangleIndices(e){let n=new Uint32Array(e*3);for(let o=0;o<e;++o)n[o*3+0]=o,n[o*3+1]=o%2?(o+2)%e:(o+1)%e,n[o*3+2]=o%2?(o+1)%e:(o+2)%e;return n}_getDistance(e,n){return Math.sqrt(Math.pow(e[0]-n[0],2)+Math.pow(e[1]-n[1],2))}};m(Rl,"type",Rl.register("ESCesiumViewer",a.ESPit.type,Rl));let Kp=Rl;const Fl=class Fl extends Yt{constructor(e,n){super(e,n);m(this,"_czmPolygonPrimitive");m(this,"_geoPolylines");if(this._czmPolygonPrimitive=this.disposeVar(new bn(n,e.id)),console.log(this.czmPolygonPrimitive),this._geoPolylines=this.disposeVar(new pi(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}{const l=()=>{this.geoPolygon&&(this.geoPolygon.show=!1)};l(),this.ad(this.sceneObject.showChanged.don(l))}const s=this._geoPolylines;s.arcType="RHUMB";const r=this._czmPolygonPrimitive;this.dispose(a.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"color"],[e,"strokeColor"])),this.dispose(a.track([s,"width"],[e,"strokeWidth"]));{r.perPositionHeight=!0;const l=()=>{s.show=e.show&&e.stroked,r.show=e.show&&e.filled,r.material={type:"Color",color:e.fillColor}};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged,e.fillColorChanged));this.dispose(c.don(l))}{const l=()=>{const u={positions:[],holes:[]};if(e.points&&e.points.length>=3){if(s.positions=[[...e.points,e.points[0]]],u.positions=e.points,e.innerRings&&e.innerRings.length>0)for(let d=0;d<e.innerRings.length;d++){const p=e.innerRings[d];u.holes.push({positions:p}),s.positions.push([...p,p[0]])}r.polygonHierarchy=u}else r.polygonHierarchy=u};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(e.pointsChanged,e.innerRingsChanged));this.dispose(c.disposableOn(()=>l()))}}get czmPolygonPrimitive(){return this._czmPolygonPrimitive}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmPolygonPrimitive:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmPolygonPrimitive:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(Fl,"type",Fl.register("ESCesiumViewer",a.ESPolygonWithHole.type,Fl));let Jp=Fl;var wt=63710088e-1,jp={centimeters:wt*100,centimetres:wt*100,degrees:wt/111325,feet:wt*3.28084,inches:wt*39.37,kilometers:wt/1e3,kilometres:wt/1e3,meters:wt,metres:wt,miles:wt/1609.344,millimeters:wt*1e3,millimetres:wt*1e3,nauticalmiles:wt/1852,radians:1,yards:wt*1.0936},OT={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/wt,yards:1.0936133},ef={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function Zt(t,i,e){e===void 0&&(e={});var n={type:"Feature"};return(e.id===0||e.id)&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.properties=i||{},n.geometry=t,n}function NT(t,i,e){switch(t){case"Point":return dt(i).geometry;case"LineString":return oi(i).geometry;case"Polygon":return ot(i).geometry;case"MultiPoint":return Xy(i).geometry;case"MultiLineString":return tf(i).geometry;case"MultiPolygon":return nf(i).geometry;default:throw new Error(t+" is invalid")}}function dt(t,i,e){if(e===void 0&&(e={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!bh(t[0])||!bh(t[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:t};return Zt(n,i,e)}function BT(t,i,e){return e===void 0&&(e={}),Nt(t.map(function(n){return dt(n,i)}),e)}function ot(t,i,e){e===void 0&&(e={});for(var n=0,o=t;n<o.length;n++){var s=o[n];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var r=0;r<s[s.length-1].length;r++)if(s[s.length-1][r]!==s[0][r])throw new Error("First and last Position are not equivalent.")}var l={type:"Polygon",coordinates:t};return Zt(l,i,e)}function VT(t,i,e){return e===void 0&&(e={}),Nt(t.map(function(n){return ot(n,i)}),e)}function oi(t,i,e){if(e===void 0&&(e={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:t};return Zt(n,i,e)}function UT(t,i,e){return e===void 0&&(e={}),Nt(t.map(function(n){return oi(n,i)}),e)}function Nt(t,i){i===void 0&&(i={});var e={type:"FeatureCollection"};return i.id&&(e.id=i.id),i.bbox&&(e.bbox=i.bbox),e.features=t,e}function tf(t,i,e){e===void 0&&(e={});var n={type:"MultiLineString",coordinates:t};return Zt(n,i,e)}function Xy(t,i,e){e===void 0&&(e={});var n={type:"MultiPoint",coordinates:t};return Zt(n,i,e)}function nf(t,i,e){e===void 0&&(e={});var n={type:"MultiPolygon",coordinates:t};return Zt(n,i,e)}function WT(t,i,e){e===void 0&&(e={});var n={type:"GeometryCollection",geometries:t};return Zt(n,i,e)}function GT(t,i){if(i===void 0&&(i=0),i&&!(i>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,i||0);return Math.round(t*e)/e}function of(t,i){i===void 0&&(i="kilometers");var e=jp[i];if(!e)throw new Error(i+" units is invalid");return t*e}function sf(t,i){i===void 0&&(i="kilometers");var e=jp[i];if(!e)throw new Error(i+" units is invalid");return t/e}function HT(t,i){return Yy(sf(t,i))}function $T(t){var i=t%360;return i<0&&(i+=360),i}function Yy(t){var i=t%(2*Math.PI);return i*180/Math.PI}function Kr(t){var i=t%360;return i*Math.PI/180}function qT(t,i,e){if(i===void 0&&(i="kilometers"),e===void 0&&(e="kilometers"),!(t>=0))throw new Error("length must be a positive number");return of(sf(t,i),e)}function XT(t,i,e){if(i===void 0&&(i="meters"),e===void 0&&(e="kilometers"),!(t>=0))throw new Error("area must be a positive number");var n=ef[i];if(!n)throw new Error("invalid original units");var o=ef[e];if(!o)throw new Error("invalid final units");return t/n*o}function bh(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function rf(t){return!!t&&t.constructor===Object}function YT(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(t.length!==4&&t.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach(function(i){if(!bh(i))throw new Error("bbox must only contain numbers")})}function ZT(t){if(!t)throw new Error("id is required");if(["string","number"].indexOf(typeof t)===-1)throw new Error("id must be a number or a string")}const QT=Object.freeze(Object.defineProperty({__proto__:null,areaFactors:ef,bearingToAzimuth:$T,convertArea:XT,convertLength:qT,degreesToRadians:Kr,earthRadius:wt,factors:jp,feature:Zt,featureCollection:Nt,geometry:NT,geometryCollection:WT,isNumber:bh,isObject:rf,lengthToDegrees:HT,lengthToRadians:sf,lineString:oi,lineStrings:UT,multiLineString:tf,multiPoint:Xy,multiPolygon:nf,point:dt,points:BT,polygon:ot,polygons:VT,radiansToDegrees:Yy,radiansToLength:of,round:GT,unitsFactors:OT,validateBBox:YT,validateId:ZT},Symbol.toStringTag,{value:"Module"}));function Sh(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if(t.type==="Feature"&&t.geometry!==null&&t.geometry.type==="Point")return t.geometry.coordinates;if(t.type==="Point")return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Ii(t){if(Array.isArray(t))return t;if(t.type==="Feature"){if(t.geometry!==null)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function kT(t,i,e){if(!t)throw new Error("No featureCollection passed");if(!t||t.type!=="FeatureCollection")throw new Error("Invalid input to "+e+", FeatureCollection required");for(var n=0,o=t.features;n<o.length;n++){var s=o[n];if(!s||s.type!=="Feature"||!s.geometry)throw new Error("Invalid input to "+e+", Feature with geometry required");if(!s.geometry||s.geometry.type!==i)throw new Error("Invalid input to "+e+": must be a "+i+", given "+s.geometry.type)}}function Di(t){return t.type==="Feature"?t.geometry:t}function KT(t,i){return t.type==="FeatureCollection"?"FeatureCollection":t.type==="GeometryCollection"?"GeometryCollection":t.type==="Feature"&&t.geometry!==null?t.geometry.type:t.type}function Ri(t,i,e){e===void 0&&(e={});var n=Sh(t),o=Sh(i),s=Kr(o[1]-n[1]),r=Kr(o[0]-n[0]),l=Kr(n[1]),c=Kr(o[1]),u=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(r/2),2)*Math.cos(l)*Math.cos(c);return of(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),e.units)}function Ro(t,i,e){if(t!==null)for(var n,o,s,r,l,c,u,d=0,p=0,f,g=t.type,v=g==="FeatureCollection",y=g==="Feature",w=v?t.features.length:1,P=0;P<w;P++){u=v?t.features[P].geometry:y?t.geometry:t,f=u?u.type==="GeometryCollection":!1,l=f?u.geometries.length:1;for(var C=0;C<l;C++){var S=0,x=0;if(r=f?u.geometries[C]:u,r!==null){c=r.coordinates;var A=r.type;switch(d=e&&(A==="Polygon"||A==="MultiPolygon")?1:0,A){case null:break;case"Point":if(i(c,p,P,S,x)===!1)return!1;p++,S++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(i(c[n],p,P,S,x)===!1)return!1;p++,A==="MultiPoint"&&S++}A==="LineString"&&S++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(o=0;o<c[n].length-d;o++){if(i(c[n][o],p,P,S,x)===!1)return!1;p++}A==="MultiLineString"&&S++,A==="Polygon"&&x++}A==="Polygon"&&S++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(x=0,o=0;o<c[n].length;o++){for(s=0;s<c[n][o].length-d;s++){if(i(c[n][o][s],p,P,S,x)===!1)return!1;p++}x++}S++}break;case"GeometryCollection":for(n=0;n<r.geometries.length;n++)if(Ro(r.geometries[n],i,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function JT(t,i,e,n){var o=e;return Ro(t,function(s,r,l,c,u){r===0&&e===void 0?o=s:o=i(o,s,r,l,c,u)},n),o}function Zy(t,i){var e;switch(t.type){case"FeatureCollection":for(e=0;e<t.features.length&&i(t.features[e].properties,e)!==!1;e++);break;case"Feature":i(t.properties,0);break}}function jT(t,i,e){var n=e;return Zy(t,function(o,s){s===0&&e===void 0?n=o:n=i(n,o,s)}),n}function Us(t,i){if(t.type==="Feature")i(t,0);else if(t.type==="FeatureCollection")for(var e=0;e<t.features.length&&i(t.features[e],e)!==!1;e++);}function eM(t,i,e){var n=e;return Us(t,function(o,s){s===0&&e===void 0?n=o:n=i(n,o,s)}),n}function tM(t){var i=[];return Ro(t,function(e){i.push(e)}),i}function af(t,i){var e,n,o,s,r,l,c,u,d,p,f=0,g=t.type==="FeatureCollection",v=t.type==="Feature",y=g?t.features.length:1;for(e=0;e<y;e++){for(l=g?t.features[e].geometry:v?t.geometry:t,u=g?t.features[e].properties:v?t.properties:{},d=g?t.features[e].bbox:v?t.bbox:void 0,p=g?t.features[e].id:v?t.id:void 0,c=l?l.type==="GeometryCollection":!1,r=c?l.geometries.length:1,o=0;o<r;o++){if(s=c?l.geometries[o]:l,s===null){if(i(null,f,u,d,p)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(i(s,f,u,d,p)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<s.geometries.length;n++)if(i(s.geometries[n],f,u,d,p)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function iM(t,i,e){var n=e;return af(t,function(o,s,r,l,c){s===0&&e===void 0?n=o:n=i(n,o,s,r,l,c)}),n}function ji(t,i){af(t,function(e,n,o,s,r){var l=e===null?null:e.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return i(Zt(e,o,{bbox:s,id:r}),n,0)===!1?!1:void 0}var c;switch(l){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var d=e.coordinates[u],p={type:c,coordinates:d};if(i(Zt(p,o),n,u)===!1)return!1}})}function nM(t,i,e){var n=e;return ji(t,function(o,s,r){s===0&&r===0&&e===void 0?n=o:n=i(n,o,s,r)}),n}function Qy(t,i){ji(t,function(e,n,o){var s=0;if(e.geometry){var r=e.geometry.type;if(!(r==="Point"||r==="MultiPoint")){var l,c=0,u=0,d=0;if(Ro(e,function(p,f,g,v,y){if(l===void 0||n>c||v>u||y>d){l=p,c=n,u=v,d=y,s=0;return}var w=oi([l,p],e.properties);if(i(w,n,o,y,s)===!1)return!1;s++,l=p})===!1)return!1}}})}function ky(t,i,e){var n=e,o=!1;return Qy(t,function(s,r,l,c,u){o===!1&&e===void 0?n=s:n=i(n,s,r,l,c,u),o=!0}),n}function Ky(t,i){if(!t)throw new Error("geojson is required");ji(t,function(e,n,o){if(e.geometry!==null){var s=e.geometry.type,r=e.geometry.coordinates;switch(s){case"LineString":if(i(e,n,o,0,0)===!1)return!1;break;case"Polygon":for(var l=0;l<r.length;l++)if(i(oi(r[l],e.properties),n,o,l)===!1)return!1;break}}})}function oM(t,i,e){var n=e;return Ky(t,function(o,s,r,l){s===0&&e===void 0?n=o:n=i(n,o,s,r,l)}),n}function sM(t,i){if(i=i||{},!rf(i))throw new Error("options is invalid");var e=i.featureIndex||0,n=i.multiFeatureIndex||0,o=i.geometryIndex||0,s=i.segmentIndex||0,r=i.properties,l;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),r=r||t.features[e].properties,l=t.features[e].geometry;break;case"Feature":r=r||t.properties,l=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=t;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=c.length+s-1),oi([c[s],c[s+1]],r,i);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s-1),oi([c[o][s],c[o][s+1]],r,i);case"MultiLineString":return n<0&&(n=c.length+n),s<0&&(s=c[n].length+s-1),oi([c[n][s],c[n][s+1]],r,i);case"MultiPolygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),s<0&&(s=c[n][o].length-s-1),oi([c[n][o][s],c[n][o][s+1]],r,i)}throw new Error("geojson is invalid")}function rM(t,i){if(i=i||{},!rf(i))throw new Error("options is invalid");var e=i.featureIndex||0,n=i.multiFeatureIndex||0,o=i.geometryIndex||0,s=i.coordIndex||0,r=i.properties,l;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),r=r||t.features[e].properties,l=t.features[e].geometry;break;case"Feature":r=r||t.properties,l=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=t;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":return dt(c,r,i);case"MultiPoint":return n<0&&(n=c.length+n),dt(c[n],r,i);case"LineString":return s<0&&(s=c.length+s),dt(c[s],r,i);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s),dt(c[o][s],r,i);case"MultiLineString":return n<0&&(n=c.length+n),s<0&&(s=c[n].length+s),dt(c[n][s],r,i);case"MultiPolygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),s<0&&(s=c[n][o].length-s),dt(c[n][o][s],r,i)}throw new Error("geojson is invalid")}const aM=Object.freeze(Object.defineProperty({__proto__:null,coordAll:tM,coordEach:Ro,coordReduce:JT,featureEach:Us,featureReduce:eM,findPoint:rM,findSegment:sM,flattenEach:ji,flattenReduce:nM,geomEach:af,geomReduce:iM,lineEach:Ky,lineReduce:oM,propEach:Zy,propReduce:jT,segmentEach:Qy,segmentReduce:ky},Symbol.toStringTag,{value:"Module"}));function lM(t,i){return i===void 0&&(i={}),ky(t,function(e,n){var o=n.geometry.coordinates;return e+Ri(o[0],o[1],i)},0)}function cM(t){var i=oi(t),e=lM(i,{units:"meters"});return e}function*hM(t){t.type==="FeatureCollection"?yield*t.features.map(i=>[i.geometry,i]):t.type==="Feature"&&(yield[t.geometry,t])}function*uM(t){for(const[i,e]of hM(t))if(i.type==="LineString")yield[i.coordinates,e];else if(i.type==="MultiLineString")for(let n of i.coordinates)yield[n,e]}function dM(t,i,e){return[...uM(t)].map(([n,o])=>{if(n.length<2)return;const s=n.map(c=>[c[0],c[1],c[2]??0]),l=cM(s)/e;return{positions:s,repeat:l,width:i,extra:{geojson:{feature:o}}}}).filter(n=>!!n)}const Jr=h.ArcType,pM=h.arrayRemoveDuplicates,fM=h.BoundingSphere,ke=h.Cartesian3,Bt=h.Color,Ws=h.ComponentDatatype,gM=h.Frozen,Qt=h.defined,Gs=h.DeveloperError,Fi=h.Ellipsoid,mM=h.Geometry,Hs=h.GeometryAttribute,vM=h.GeometryAttributes,yM=h.GeometryType,wM=h.IndexDatatype,Jy=h.Math,jr=h.PolylinePipeline,CM=h.PrimitiveType,en=h.VertexFormat;var jy=[];function _M(t,i,e,n,o){var s=jy;s.length=o;var r,l=e.red,c=e.green,u=e.blue,d=e.alpha,p=n.red,f=n.green,g=n.blue,v=n.alpha;if(Bt.equals(e,n)){for(r=0;r<o;r++)s[r]=Bt.clone(e);return s}var y=(p-l)/o,w=(f-c)/o,P=(g-u)/o,C=(v-d)/o;for(r=0;r<o;r++)s[r]=new Bt(l+r*y,c+r*w,u+r*P,d+r*C);return s}function $s(t){t=t??gM.EMPTY_OBJECT;var i=t.positions,e=t.colors,n=t.width??1,o=t.colorsPerVertex??!1;if(!Qt(i)||i.length<2)throw new Gs("At least two positions are required.");if(typeof n!="number")throw new Gs("width must be a number");if(Qt(e)&&(o&&e.length<i.length||!o&&e.length<i.length-1))throw new Gs("colors has an invalid length.");this._positions=i,this._colors=e,this._width=n,this._colorsPerVertex=o,this._vertexFormat=en.clone(t.vertexFormat??en.DEFAULT),this._arcType=t.arcType??Jr.GEODESIC,this._granularity=t.granularity??Jy.RADIANS_PER_DEGREE,this._ellipsoid=Fi.clone(t.ellipsoid??Fi.WGS84),this._workerName="createPolylineGeometry";var s=1+i.length*ke.packedLength;s+=Qt(e)?1+e.length*Bt.packedLength:1,this.packedLength=s+Fi.packedLength+en.packedLength+4}$s.pack=function(t,i,e){if(!Qt(t))throw new Gs("value is required");if(!Qt(i))throw new Gs("array is required");e=e??0;var n,o=t._positions,s=o.length;for(i[e++]=s,n=0;n<s;++n,e+=ke.packedLength)ke.pack(o[n],i,e);var r=t._colors;for(s=Qt(r)?r.length:0,i[e++]=s,n=0;n<s;++n,e+=Bt.packedLength)Bt.pack(r[n],i,e);return Fi.pack(t._ellipsoid,i,e),e+=Fi.packedLength,en.pack(t._vertexFormat,i,e),e+=en.packedLength,i[e++]=t._width,i[e++]=t._colorsPerVertex?1:0,i[e++]=t._arcType,i[e]=t._granularity,i};var e0=Fi.clone(Fi.UNIT_SPHERE),t0=new en,Fo={positions:void 0,colors:void 0,ellipsoid:e0,vertexFormat:t0,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};$s.unpack=function(t,i,e){if(!Qt(t))throw new Gs("array is required");i=i??0;var n,o=t[i++],s=new Array(o);for(n=0;n<o;++n,i+=ke.packedLength)s[n]=ke.unpack(t,i);o=t[i++];var r=o>0?new Array(o):void 0;for(n=0;n<o;++n,i+=Bt.packedLength)r[n]=Bt.unpack(t,i);var l=Fi.unpack(t,i,e0);i+=Fi.packedLength;var c=en.unpack(t,i,t0);i+=en.packedLength;var u=t[i++],d=t[i++]===1,p=t[i++],f=t[i];return Qt(e)?(e._positions=s,e._colors=r,e._ellipsoid=Fi.clone(l,e._ellipsoid),e._vertexFormat=en.clone(c,e._vertexFormat),e._width=u,e._colorsPerVertex=d,e._arcType=p,e._granularity=f,e):(Fo.positions=s,Fo.colors=r,Fo.width=u,Fo.colorsPerVertex=d,Fo.arcType=p,Fo.granularity=f,new $s(Fo))};var i0=new ke,n0=new ke,o0=new ke,s0=new ke;$s.createGeometry=function(t){var i=t._width,e=t._vertexFormat,n=t._colors,o=t._colorsPerVertex,s=t._arcType,r=t._granularity,l=t._ellipsoid,c,u,d,p=pM(t._positions,ke.equalsEpsilon),f=p.length;if(f<2||i<=0)return;if(s===Jr.GEODESIC||s===Jr.RHUMB){var g,v;s===Jr.GEODESIC?(g=Jy.chordLength(r,l.maximumRadius),v=jr.numberOfPoints):(g=r,v=jr.numberOfPointsRhumbLine);var y=jr.extractHeights(p,l);if(Qt(n)){var w=1;for(c=0;c<f-1;++c)w+=v(p[c],p[c+1],g);var P=new Array(w),C=0;for(c=0;c<f-1;++c){var S=p[c],x=p[c+1],A=n[c],R=v(S,x,g);if(o&&c<w){var L=n[c+1],B=_M(S,x,A,L,R),V=B.length;for(u=0;u<V;++u)P[C++]=B[u]}else for(u=0;u<R;++u)P[C++]=Bt.clone(A)}P[C]=Bt.clone(n[n.length-1]),n=P,jy.length=0}s===Jr.GEODESIC?p=jr.generateCartesianArc({positions:p,minDistance:g,ellipsoid:l,height:y}):p=jr.generateCartesianRhumbArc({positions:p,granularity:g,ellipsoid:l,height:y})}f=p.length;var G=f*4-4,O=new Float64Array(G*3),N=new Float64Array(G*3),_=new Float64Array(G*3),E=new Float32Array(G*2),D=e.st?new Float32Array(G*2):void 0,z=Qt(n)?new Uint8Array(G*4):void 0,U=0,Y=0,q=0,X=0,Q;let j=[0];{for(c=0;c<f-1;c++){const Wt=h.Cartesian3.distance(p[c],p[c+1]);j.push(j[j.length-1]+Wt)}j=j.map(Wt=>Wt/j[j.length-1])}for(u=0;u<f;++u){u===0?(Q=i0,ke.subtract(p[0],p[1],Q),ke.add(p[0],Q,Q)):Q=p[u-1],ke.clone(Q,o0),ke.clone(p[u],n0),u===f-1?(Q=i0,ke.subtract(p[f-1],p[f-2],Q),ke.add(p[f-1],Q,Q)):Q=p[u+1],ke.clone(Q,s0);var ae,ue;Qt(z)&&(u!==0&&!o?ae=n[u-1]:ae=n[u],u!==f-1&&(ue=n[u]));var fe=u===0?2:0,_e=u===f-1?2:4;for(d=fe;d<_e;++d){ke.pack(n0,O,U),ke.pack(o0,N,U),ke.pack(s0,_,U),U+=3;var Oe=d-2<0?-1:1;if(E[Y++]=2*(d%2)-1,E[Y++]=Oe*i,e.st&&(D[q++]=j[u],D[q++]=Math.max(E[Y-2],0)),Qt(z)){var Ae=d<2?ae:ue;z[X++]=Bt.floatToByte(Ae.red),z[X++]=Bt.floatToByte(Ae.green),z[X++]=Bt.floatToByte(Ae.blue),z[X++]=Bt.floatToByte(Ae.alpha)}}}var Te=new vM;Te.position=new Hs({componentDatatype:Ws.DOUBLE,componentsPerAttribute:3,values:O}),Te.prevPosition=new Hs({componentDatatype:Ws.DOUBLE,componentsPerAttribute:3,values:N}),Te.nextPosition=new Hs({componentDatatype:Ws.DOUBLE,componentsPerAttribute:3,values:_}),Te.expandAndWidth=new Hs({componentDatatype:Ws.FLOAT,componentsPerAttribute:2,values:E}),e.st&&(Te.st=new Hs({componentDatatype:Ws.FLOAT,componentsPerAttribute:2,values:D})),Qt(z)&&(Te.color=new Hs({componentDatatype:Ws.UNSIGNED_BYTE,componentsPerAttribute:4,values:z,normalize:!0}));var de=wM.createTypedArray(G,f*6-6),Ne=0,Qe=0,Tt=f-1;for(u=0;u<Tt;++u)de[Qe++]=Ne,de[Qe++]=Ne+2,de[Qe++]=Ne+1,de[Qe++]=Ne+1,de[Qe++]=Ne+2,de[Qe++]=Ne+3,Ne+=4;return new mM({attributes:Te,indices:de,primitiveType:CM.TRIANGLES,boundingSphere:fM.fromPoints(p),geometryType:yM.POLYLINES})};var lf;function PM(){return typeof lf>"u"&&(lf=new h.EllipsoidGeodesic),lf}function bM(t,i){var e=i/3e7;return e=Math.min(1,e),e=1-Math.pow(1-e,2),Math.sin(Math.PI*t)*1e6*e}function SM(t,i,e,n=1){var o=PM(),s=h.Cartesian3.fromDegreesArray([t[0],t[1],i[0],i[1]]),r=[0,0];t.length>=3&&i.length>=3&&(r=[t[2],i[2]]);var l=h.Cartographic.fromDegrees(t[0],t[1]),c=h.Cartographic.fromDegrees(i[0],i[1]);o.setEndPoints(l,c);var u=o.surfaceDistance,d=h.PolylinePipeline.generateCartesianArc({positions:s,height:r,minDistance:u/36}),p=d.length;return d.forEach(function(f,g){var v=g/(p-1),y=bM(v,u*n),w=h.Cartographic.fromCartesian(f);w.height+=y,h.Cartesian3.fromRadians(w.longitude,w.latitude,w.height,h.Ellipsoid.WGS84,d[g])}),d}function EM(t=[.8,.8,0,1],i=!0,e=!0,n){var o;const s=n?{type:"Image",uniforms:{color:new h.Color(...t)}}:{type:"Color",uniforms:{color:new h.Color(...t)}};i?(o=new h.PolylineMaterialAppearance({material:new h.Material({fabric:s,translucent:!1}),translucent:!1}),o.renderState.blending=h.BlendingState.ADDITIVE_BLEND,o.renderState.depthMask=!1,o.renderState.depthTest={enabled:!0},o.getRenderState=function(){const d=h.Appearance.prototype.getRenderState.call(this);return d.depthTest={enabled:e},d.depthMask=!1,d},o.material.type==="Image"&&(o.material._uniforms.image_1=n)):(o=new h.PolylineMaterialAppearance({material:new h.Material({fabric:s,translucent:!0})}),o.getRenderState=function(){const d=h.Appearance.prototype.getRenderState.call(this);return d.depthTest={enabled:e},d.depthMask=!1,d},o.material.type==="Image"&&(o.material._uniforms.image_1=n));var r=h.ShaderSource.replaceMain(o._vertexShaderSource,"czm_twp_main"),l=`out vec4 v_twp;
1818
+ `;const O=f.computeLocalAxisedBoundingBoxFromAttribute("position");if(!O)return;const{min:N,max:_}=O;f.setLocalAxisedBoundingBox(N,_)},d=async()=>{if(e.points&&e.points.length>2){const{minPos:f,center:g}=a.getMinMaxCorner(e.points),v=f[2]-e.depth;if(!a.equalsN3(e.points[e.points.length-1],e.points[e.points.length-2])){const x=Dt({originPosition:g},e.points.map((A,R)=>{let L=[...A];return L[2]=v,L}));u(l,g,x[0],"bottom",!0)}const y=this._interpolationAlongPolygon(e.points.map((x,A)=>h.Cartesian3.fromArray(a.lbhToXyz(x))),e.interpolation),w=await n.getHeightsByLonLats(y.map(x=>[x[0],x[1]]));let P=[];for(let x=0;x<y.length;x++){const A=y[x];P.push([A[0],A[1],w[x]??A[2]],[A[0],A[1],v])}const C=Dt({originPosition:g},P);let S=this._isClockwise(e.points,n);u(s,g,C[0],"side",S)}else s.attributes=void 0,l.attributes=void 0};d();const p=this.dv(a.createNextAnimateFrameEvent(e.depthChanged,e.interpolationChanged,e.pointsChanged,e.bottomImageChanged,e.sideImageChanged));this.ad(p.don(d))}{const u=()=>{r.uri=e.sideImage.url,c.uri=e.bottomImage.url,s.uniformMap={u_image:{type:"texture",id:r.id},u_color:[1,1,1,e.opacity]},l.uniformMap={u_image:{type:"texture",id:c.id},u_color:[1,1,1,e.opacity]}};u();const d=this.ad(a.createNextAnimateFrameEvent(e.opacityChanged,e.bottomImageChanged,e.sideImageChanged));this.d(d.don(u))}}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}_interpolationAlongPolygon(e,n){var o=[];for(let c=0;c<e.length;++c){var s=e[c],r=e[(c+1)%e.length],l=this._interpolationAlongLine(s,r,n);o.push(...l)}return o.push(o[0]),o}_interpolationAlongLine(e,n,o){var s=[],r=h.Cartesian3.distance(e,n),l=h.Cartesian3.subtract(n,e,new h.Cartesian3);l.equals(h.Cartesian3.ZERO)||h.Cartesian3.normalize(l,l);for(var c=0;c<r;){var u=new h.Cartesian3(l.x*c,l.y*c,l.z*c),d=h.Cartesian3.add(e,u,new h.Cartesian3);const p=se(d);p&&s.push(p),c+=o}return s}_isClockwise(e,n){if(n.viewer)for(let o=0;o<e.length;o++){let s=h.Cartesian3.fromDegrees(...e[o]),r=h.Cartesian3.fromDegrees(...e[(o+1)%e.length]),l=h.Cartesian3.fromDegrees(...e[(o+2)%e.length]),c=h.Cartesian3.subtract(r,s,new h.Cartesian3),u=h.Cartesian3.subtract(l,r,new h.Cartesian3);if(c.equals(h.Cartesian3.ZERO)||u.equals(h.Cartesian3.ZERO))return!0;if(h.Cartesian3.normalize(c,c),h.Cartesian3.normalize(u,u),Math.abs(h.Cartesian3.dot(c,u))==1){if(o==e.length-1)return!0;continue}let d=h.Cartesian3.cross(c,u,new h.Cartesian3);return h.Cartesian3.dot(d,n.viewer.camera.directionWC)>0}}_triangleIndices(e){let n=new Uint32Array(e*3);for(let o=0;o<e;++o)n[o*3+0]=o,n[o*3+1]=o%2?(o+2)%e:(o+1)%e,n[o*3+2]=o%2?(o+1)%e:(o+2)%e;return n}_getDistance(e,n){return Math.sqrt(Math.pow(e[0]-n[0],2)+Math.pow(e[1]-n[1],2))}};m(Rl,"type",Rl.register("ESCesiumViewer",a.ESPit.type,Rl));let Kp=Rl;const Fl=class Fl extends Yt{constructor(e,n){super(e,n);m(this,"_czmPolygonPrimitive");m(this,"_geoPolylines");if(this._czmPolygonPrimitive=this.disposeVar(new bn(n,e.id)),console.log(this.czmPolygonPrimitive),this._geoPolylines=this.disposeVar(new pi(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}{const l=()=>{this.geoPolygon&&(this.geoPolygon.show=!1)};l(),this.ad(this.sceneObject.showChanged.don(l))}const s=this._geoPolylines;s.arcType="RHUMB";const r=this._czmPolygonPrimitive;this.dispose(a.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"color"],[e,"strokeColor"])),this.dispose(a.track([s,"width"],[e,"strokeWidth"]));{r.perPositionHeight=!0;const l=()=>{s.show=e.show&&e.stroked,r.show=e.show&&e.filled,r.material={type:"Color",color:e.fillColor}};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged,e.fillColorChanged));this.dispose(c.don(l))}{const l=()=>{const u={positions:[],holes:[]};if(e.points&&e.points.length>=3){if(s.positions=[[...e.points,e.points[0]]],u.positions=e.points,e.innerRings&&e.innerRings.length>0)for(let d=0;d<e.innerRings.length;d++){const p=e.innerRings[d];u.holes.push({positions:p}),s.positions.push([...p,p[0]])}r.polygonHierarchy=u}else r.polygonHierarchy=u};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(e.pointsChanged,e.innerRingsChanged));this.dispose(c.disposableOn(()=>l()))}}get czmPolygonPrimitive(){return this._czmPolygonPrimitive}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmPolygonPrimitive:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmPolygonPrimitive:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(Fl,"type",Fl.register("ESCesiumViewer",a.ESPolygonWithHole.type,Fl));let Jp=Fl;var wt=63710088e-1,jp={centimeters:wt*100,centimetres:wt*100,degrees:wt/111325,feet:wt*3.28084,inches:wt*39.37,kilometers:wt/1e3,kilometres:wt/1e3,meters:wt,metres:wt,miles:wt/1609.344,millimeters:wt*1e3,millimetres:wt*1e3,nauticalmiles:wt/1852,radians:1,yards:wt*1.0936},NT={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/wt,yards:1.0936133},ef={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function Zt(t,i,e){e===void 0&&(e={});var n={type:"Feature"};return(e.id===0||e.id)&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.properties=i||{},n.geometry=t,n}function BT(t,i,e){switch(t){case"Point":return dt(i).geometry;case"LineString":return oi(i).geometry;case"Polygon":return ot(i).geometry;case"MultiPoint":return Xy(i).geometry;case"MultiLineString":return tf(i).geometry;case"MultiPolygon":return nf(i).geometry;default:throw new Error(t+" is invalid")}}function dt(t,i,e){if(e===void 0&&(e={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!bh(t[0])||!bh(t[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:t};return Zt(n,i,e)}function VT(t,i,e){return e===void 0&&(e={}),Nt(t.map(function(n){return dt(n,i)}),e)}function ot(t,i,e){e===void 0&&(e={});for(var n=0,o=t;n<o.length;n++){var s=o[n];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var r=0;r<s[s.length-1].length;r++)if(s[s.length-1][r]!==s[0][r])throw new Error("First and last Position are not equivalent.")}var l={type:"Polygon",coordinates:t};return Zt(l,i,e)}function UT(t,i,e){return e===void 0&&(e={}),Nt(t.map(function(n){return ot(n,i)}),e)}function oi(t,i,e){if(e===void 0&&(e={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:t};return Zt(n,i,e)}function WT(t,i,e){return e===void 0&&(e={}),Nt(t.map(function(n){return oi(n,i)}),e)}function Nt(t,i){i===void 0&&(i={});var e={type:"FeatureCollection"};return i.id&&(e.id=i.id),i.bbox&&(e.bbox=i.bbox),e.features=t,e}function tf(t,i,e){e===void 0&&(e={});var n={type:"MultiLineString",coordinates:t};return Zt(n,i,e)}function Xy(t,i,e){e===void 0&&(e={});var n={type:"MultiPoint",coordinates:t};return Zt(n,i,e)}function nf(t,i,e){e===void 0&&(e={});var n={type:"MultiPolygon",coordinates:t};return Zt(n,i,e)}function GT(t,i,e){e===void 0&&(e={});var n={type:"GeometryCollection",geometries:t};return Zt(n,i,e)}function HT(t,i){if(i===void 0&&(i=0),i&&!(i>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,i||0);return Math.round(t*e)/e}function of(t,i){i===void 0&&(i="kilometers");var e=jp[i];if(!e)throw new Error(i+" units is invalid");return t*e}function sf(t,i){i===void 0&&(i="kilometers");var e=jp[i];if(!e)throw new Error(i+" units is invalid");return t/e}function $T(t,i){return Yy(sf(t,i))}function qT(t){var i=t%360;return i<0&&(i+=360),i}function Yy(t){var i=t%(2*Math.PI);return i*180/Math.PI}function Kr(t){var i=t%360;return i*Math.PI/180}function XT(t,i,e){if(i===void 0&&(i="kilometers"),e===void 0&&(e="kilometers"),!(t>=0))throw new Error("length must be a positive number");return of(sf(t,i),e)}function YT(t,i,e){if(i===void 0&&(i="meters"),e===void 0&&(e="kilometers"),!(t>=0))throw new Error("area must be a positive number");var n=ef[i];if(!n)throw new Error("invalid original units");var o=ef[e];if(!o)throw new Error("invalid final units");return t/n*o}function bh(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function rf(t){return!!t&&t.constructor===Object}function ZT(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(t.length!==4&&t.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach(function(i){if(!bh(i))throw new Error("bbox must only contain numbers")})}function QT(t){if(!t)throw new Error("id is required");if(["string","number"].indexOf(typeof t)===-1)throw new Error("id must be a number or a string")}const kT=Object.freeze(Object.defineProperty({__proto__:null,areaFactors:ef,bearingToAzimuth:qT,convertArea:YT,convertLength:XT,degreesToRadians:Kr,earthRadius:wt,factors:jp,feature:Zt,featureCollection:Nt,geometry:BT,geometryCollection:GT,isNumber:bh,isObject:rf,lengthToDegrees:$T,lengthToRadians:sf,lineString:oi,lineStrings:WT,multiLineString:tf,multiPoint:Xy,multiPolygon:nf,point:dt,points:VT,polygon:ot,polygons:UT,radiansToDegrees:Yy,radiansToLength:of,round:HT,unitsFactors:NT,validateBBox:ZT,validateId:QT},Symbol.toStringTag,{value:"Module"}));function Sh(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if(t.type==="Feature"&&t.geometry!==null&&t.geometry.type==="Point")return t.geometry.coordinates;if(t.type==="Point")return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Ii(t){if(Array.isArray(t))return t;if(t.type==="Feature"){if(t.geometry!==null)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function KT(t,i,e){if(!t)throw new Error("No featureCollection passed");if(!t||t.type!=="FeatureCollection")throw new Error("Invalid input to "+e+", FeatureCollection required");for(var n=0,o=t.features;n<o.length;n++){var s=o[n];if(!s||s.type!=="Feature"||!s.geometry)throw new Error("Invalid input to "+e+", Feature with geometry required");if(!s.geometry||s.geometry.type!==i)throw new Error("Invalid input to "+e+": must be a "+i+", given "+s.geometry.type)}}function Di(t){return t.type==="Feature"?t.geometry:t}function JT(t,i){return t.type==="FeatureCollection"?"FeatureCollection":t.type==="GeometryCollection"?"GeometryCollection":t.type==="Feature"&&t.geometry!==null?t.geometry.type:t.type}function Ri(t,i,e){e===void 0&&(e={});var n=Sh(t),o=Sh(i),s=Kr(o[1]-n[1]),r=Kr(o[0]-n[0]),l=Kr(n[1]),c=Kr(o[1]),u=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(r/2),2)*Math.cos(l)*Math.cos(c);return of(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),e.units)}function Ro(t,i,e){if(t!==null)for(var n,o,s,r,l,c,u,d=0,p=0,f,g=t.type,v=g==="FeatureCollection",y=g==="Feature",w=v?t.features.length:1,P=0;P<w;P++){u=v?t.features[P].geometry:y?t.geometry:t,f=u?u.type==="GeometryCollection":!1,l=f?u.geometries.length:1;for(var C=0;C<l;C++){var S=0,x=0;if(r=f?u.geometries[C]:u,r!==null){c=r.coordinates;var A=r.type;switch(d=e&&(A==="Polygon"||A==="MultiPolygon")?1:0,A){case null:break;case"Point":if(i(c,p,P,S,x)===!1)return!1;p++,S++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(i(c[n],p,P,S,x)===!1)return!1;p++,A==="MultiPoint"&&S++}A==="LineString"&&S++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(o=0;o<c[n].length-d;o++){if(i(c[n][o],p,P,S,x)===!1)return!1;p++}A==="MultiLineString"&&S++,A==="Polygon"&&x++}A==="Polygon"&&S++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(x=0,o=0;o<c[n].length;o++){for(s=0;s<c[n][o].length-d;s++){if(i(c[n][o][s],p,P,S,x)===!1)return!1;p++}x++}S++}break;case"GeometryCollection":for(n=0;n<r.geometries.length;n++)if(Ro(r.geometries[n],i,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function jT(t,i,e,n){var o=e;return Ro(t,function(s,r,l,c,u){r===0&&e===void 0?o=s:o=i(o,s,r,l,c,u)},n),o}function Zy(t,i){var e;switch(t.type){case"FeatureCollection":for(e=0;e<t.features.length&&i(t.features[e].properties,e)!==!1;e++);break;case"Feature":i(t.properties,0);break}}function eM(t,i,e){var n=e;return Zy(t,function(o,s){s===0&&e===void 0?n=o:n=i(n,o,s)}),n}function Us(t,i){if(t.type==="Feature")i(t,0);else if(t.type==="FeatureCollection")for(var e=0;e<t.features.length&&i(t.features[e],e)!==!1;e++);}function tM(t,i,e){var n=e;return Us(t,function(o,s){s===0&&e===void 0?n=o:n=i(n,o,s)}),n}function iM(t){var i=[];return Ro(t,function(e){i.push(e)}),i}function af(t,i){var e,n,o,s,r,l,c,u,d,p,f=0,g=t.type==="FeatureCollection",v=t.type==="Feature",y=g?t.features.length:1;for(e=0;e<y;e++){for(l=g?t.features[e].geometry:v?t.geometry:t,u=g?t.features[e].properties:v?t.properties:{},d=g?t.features[e].bbox:v?t.bbox:void 0,p=g?t.features[e].id:v?t.id:void 0,c=l?l.type==="GeometryCollection":!1,r=c?l.geometries.length:1,o=0;o<r;o++){if(s=c?l.geometries[o]:l,s===null){if(i(null,f,u,d,p)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(i(s,f,u,d,p)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<s.geometries.length;n++)if(i(s.geometries[n],f,u,d,p)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function nM(t,i,e){var n=e;return af(t,function(o,s,r,l,c){s===0&&e===void 0?n=o:n=i(n,o,s,r,l,c)}),n}function ji(t,i){af(t,function(e,n,o,s,r){var l=e===null?null:e.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return i(Zt(e,o,{bbox:s,id:r}),n,0)===!1?!1:void 0}var c;switch(l){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var d=e.coordinates[u],p={type:c,coordinates:d};if(i(Zt(p,o),n,u)===!1)return!1}})}function oM(t,i,e){var n=e;return ji(t,function(o,s,r){s===0&&r===0&&e===void 0?n=o:n=i(n,o,s,r)}),n}function Qy(t,i){ji(t,function(e,n,o){var s=0;if(e.geometry){var r=e.geometry.type;if(!(r==="Point"||r==="MultiPoint")){var l,c=0,u=0,d=0;if(Ro(e,function(p,f,g,v,y){if(l===void 0||n>c||v>u||y>d){l=p,c=n,u=v,d=y,s=0;return}var w=oi([l,p],e.properties);if(i(w,n,o,y,s)===!1)return!1;s++,l=p})===!1)return!1}}})}function ky(t,i,e){var n=e,o=!1;return Qy(t,function(s,r,l,c,u){o===!1&&e===void 0?n=s:n=i(n,s,r,l,c,u),o=!0}),n}function Ky(t,i){if(!t)throw new Error("geojson is required");ji(t,function(e,n,o){if(e.geometry!==null){var s=e.geometry.type,r=e.geometry.coordinates;switch(s){case"LineString":if(i(e,n,o,0,0)===!1)return!1;break;case"Polygon":for(var l=0;l<r.length;l++)if(i(oi(r[l],e.properties),n,o,l)===!1)return!1;break}}})}function sM(t,i,e){var n=e;return Ky(t,function(o,s,r,l){s===0&&e===void 0?n=o:n=i(n,o,s,r,l)}),n}function rM(t,i){if(i=i||{},!rf(i))throw new Error("options is invalid");var e=i.featureIndex||0,n=i.multiFeatureIndex||0,o=i.geometryIndex||0,s=i.segmentIndex||0,r=i.properties,l;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),r=r||t.features[e].properties,l=t.features[e].geometry;break;case"Feature":r=r||t.properties,l=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=t;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=c.length+s-1),oi([c[s],c[s+1]],r,i);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s-1),oi([c[o][s],c[o][s+1]],r,i);case"MultiLineString":return n<0&&(n=c.length+n),s<0&&(s=c[n].length+s-1),oi([c[n][s],c[n][s+1]],r,i);case"MultiPolygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),s<0&&(s=c[n][o].length-s-1),oi([c[n][o][s],c[n][o][s+1]],r,i)}throw new Error("geojson is invalid")}function aM(t,i){if(i=i||{},!rf(i))throw new Error("options is invalid");var e=i.featureIndex||0,n=i.multiFeatureIndex||0,o=i.geometryIndex||0,s=i.coordIndex||0,r=i.properties,l;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),r=r||t.features[e].properties,l=t.features[e].geometry;break;case"Feature":r=r||t.properties,l=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=t;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":return dt(c,r,i);case"MultiPoint":return n<0&&(n=c.length+n),dt(c[n],r,i);case"LineString":return s<0&&(s=c.length+s),dt(c[s],r,i);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s),dt(c[o][s],r,i);case"MultiLineString":return n<0&&(n=c.length+n),s<0&&(s=c[n].length+s),dt(c[n][s],r,i);case"MultiPolygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),s<0&&(s=c[n][o].length-s),dt(c[n][o][s],r,i)}throw new Error("geojson is invalid")}const lM=Object.freeze(Object.defineProperty({__proto__:null,coordAll:iM,coordEach:Ro,coordReduce:jT,featureEach:Us,featureReduce:tM,findPoint:aM,findSegment:rM,flattenEach:ji,flattenReduce:oM,geomEach:af,geomReduce:nM,lineEach:Ky,lineReduce:sM,propEach:Zy,propReduce:eM,segmentEach:Qy,segmentReduce:ky},Symbol.toStringTag,{value:"Module"}));function cM(t,i){return i===void 0&&(i={}),ky(t,function(e,n){var o=n.geometry.coordinates;return e+Ri(o[0],o[1],i)},0)}function hM(t){var i=oi(t),e=cM(i,{units:"meters"});return e}function*uM(t){t.type==="FeatureCollection"?yield*t.features.map(i=>[i.geometry,i]):t.type==="Feature"&&(yield[t.geometry,t])}function*dM(t){for(const[i,e]of uM(t))if(i.type==="LineString")yield[i.coordinates,e];else if(i.type==="MultiLineString")for(let n of i.coordinates)yield[n,e]}function pM(t,i,e){return[...dM(t)].map(([n,o])=>{if(n.length<2)return;const s=n.map(c=>[c[0],c[1],c[2]??0]),l=hM(s)/e;return{positions:s,repeat:l,width:i,extra:{geojson:{feature:o}}}}).filter(n=>!!n)}const Jr=h.ArcType,fM=h.arrayRemoveDuplicates,gM=h.BoundingSphere,ke=h.Cartesian3,Bt=h.Color,Ws=h.ComponentDatatype,mM=h.Frozen,Qt=h.defined,Gs=h.DeveloperError,Fi=h.Ellipsoid,vM=h.Geometry,Hs=h.GeometryAttribute,yM=h.GeometryAttributes,wM=h.GeometryType,CM=h.IndexDatatype,Jy=h.Math,jr=h.PolylinePipeline,_M=h.PrimitiveType,en=h.VertexFormat;var jy=[];function PM(t,i,e,n,o){var s=jy;s.length=o;var r,l=e.red,c=e.green,u=e.blue,d=e.alpha,p=n.red,f=n.green,g=n.blue,v=n.alpha;if(Bt.equals(e,n)){for(r=0;r<o;r++)s[r]=Bt.clone(e);return s}var y=(p-l)/o,w=(f-c)/o,P=(g-u)/o,C=(v-d)/o;for(r=0;r<o;r++)s[r]=new Bt(l+r*y,c+r*w,u+r*P,d+r*C);return s}function $s(t){t=t??mM.EMPTY_OBJECT;var i=t.positions,e=t.colors,n=t.width??1,o=t.colorsPerVertex??!1;if(!Qt(i)||i.length<2)throw new Gs("At least two positions are required.");if(typeof n!="number")throw new Gs("width must be a number");if(Qt(e)&&(o&&e.length<i.length||!o&&e.length<i.length-1))throw new Gs("colors has an invalid length.");this._positions=i,this._colors=e,this._width=n,this._colorsPerVertex=o,this._vertexFormat=en.clone(t.vertexFormat??en.DEFAULT),this._arcType=t.arcType??Jr.GEODESIC,this._granularity=t.granularity??Jy.RADIANS_PER_DEGREE,this._ellipsoid=Fi.clone(t.ellipsoid??Fi.WGS84),this._workerName="createPolylineGeometry";var s=1+i.length*ke.packedLength;s+=Qt(e)?1+e.length*Bt.packedLength:1,this.packedLength=s+Fi.packedLength+en.packedLength+4}$s.pack=function(t,i,e){if(!Qt(t))throw new Gs("value is required");if(!Qt(i))throw new Gs("array is required");e=e??0;var n,o=t._positions,s=o.length;for(i[e++]=s,n=0;n<s;++n,e+=ke.packedLength)ke.pack(o[n],i,e);var r=t._colors;for(s=Qt(r)?r.length:0,i[e++]=s,n=0;n<s;++n,e+=Bt.packedLength)Bt.pack(r[n],i,e);return Fi.pack(t._ellipsoid,i,e),e+=Fi.packedLength,en.pack(t._vertexFormat,i,e),e+=en.packedLength,i[e++]=t._width,i[e++]=t._colorsPerVertex?1:0,i[e++]=t._arcType,i[e]=t._granularity,i};var e0=Fi.clone(Fi.UNIT_SPHERE),t0=new en,Fo={positions:void 0,colors:void 0,ellipsoid:e0,vertexFormat:t0,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};$s.unpack=function(t,i,e){if(!Qt(t))throw new Gs("array is required");i=i??0;var n,o=t[i++],s=new Array(o);for(n=0;n<o;++n,i+=ke.packedLength)s[n]=ke.unpack(t,i);o=t[i++];var r=o>0?new Array(o):void 0;for(n=0;n<o;++n,i+=Bt.packedLength)r[n]=Bt.unpack(t,i);var l=Fi.unpack(t,i,e0);i+=Fi.packedLength;var c=en.unpack(t,i,t0);i+=en.packedLength;var u=t[i++],d=t[i++]===1,p=t[i++],f=t[i];return Qt(e)?(e._positions=s,e._colors=r,e._ellipsoid=Fi.clone(l,e._ellipsoid),e._vertexFormat=en.clone(c,e._vertexFormat),e._width=u,e._colorsPerVertex=d,e._arcType=p,e._granularity=f,e):(Fo.positions=s,Fo.colors=r,Fo.width=u,Fo.colorsPerVertex=d,Fo.arcType=p,Fo.granularity=f,new $s(Fo))};var i0=new ke,n0=new ke,o0=new ke,s0=new ke;$s.createGeometry=function(t){var i=t._width,e=t._vertexFormat,n=t._colors,o=t._colorsPerVertex,s=t._arcType,r=t._granularity,l=t._ellipsoid,c,u,d,p=fM(t._positions,ke.equalsEpsilon),f=p.length;if(f<2||i<=0)return;if(s===Jr.GEODESIC||s===Jr.RHUMB){var g,v;s===Jr.GEODESIC?(g=Jy.chordLength(r,l.maximumRadius),v=jr.numberOfPoints):(g=r,v=jr.numberOfPointsRhumbLine);var y=jr.extractHeights(p,l);if(Qt(n)){var w=1;for(c=0;c<f-1;++c)w+=v(p[c],p[c+1],g);var P=new Array(w),C=0;for(c=0;c<f-1;++c){var S=p[c],x=p[c+1],A=n[c],R=v(S,x,g);if(o&&c<w){var L=n[c+1],B=PM(S,x,A,L,R),V=B.length;for(u=0;u<V;++u)P[C++]=B[u]}else for(u=0;u<R;++u)P[C++]=Bt.clone(A)}P[C]=Bt.clone(n[n.length-1]),n=P,jy.length=0}s===Jr.GEODESIC?p=jr.generateCartesianArc({positions:p,minDistance:g,ellipsoid:l,height:y}):p=jr.generateCartesianRhumbArc({positions:p,granularity:g,ellipsoid:l,height:y})}f=p.length;var G=f*4-4,O=new Float64Array(G*3),N=new Float64Array(G*3),_=new Float64Array(G*3),E=new Float32Array(G*2),D=e.st?new Float32Array(G*2):void 0,z=Qt(n)?new Uint8Array(G*4):void 0,U=0,Y=0,q=0,X=0,Q;let j=[0];{for(c=0;c<f-1;c++){const Wt=h.Cartesian3.distance(p[c],p[c+1]);j.push(j[j.length-1]+Wt)}j=j.map(Wt=>Wt/j[j.length-1])}for(u=0;u<f;++u){u===0?(Q=i0,ke.subtract(p[0],p[1],Q),ke.add(p[0],Q,Q)):Q=p[u-1],ke.clone(Q,o0),ke.clone(p[u],n0),u===f-1?(Q=i0,ke.subtract(p[f-1],p[f-2],Q),ke.add(p[f-1],Q,Q)):Q=p[u+1],ke.clone(Q,s0);var ae,ue;Qt(z)&&(u!==0&&!o?ae=n[u-1]:ae=n[u],u!==f-1&&(ue=n[u]));var fe=u===0?2:0,_e=u===f-1?2:4;for(d=fe;d<_e;++d){ke.pack(n0,O,U),ke.pack(o0,N,U),ke.pack(s0,_,U),U+=3;var Oe=d-2<0?-1:1;if(E[Y++]=2*(d%2)-1,E[Y++]=Oe*i,e.st&&(D[q++]=j[u],D[q++]=Math.max(E[Y-2],0)),Qt(z)){var Ae=d<2?ae:ue;z[X++]=Bt.floatToByte(Ae.red),z[X++]=Bt.floatToByte(Ae.green),z[X++]=Bt.floatToByte(Ae.blue),z[X++]=Bt.floatToByte(Ae.alpha)}}}var Te=new yM;Te.position=new Hs({componentDatatype:Ws.DOUBLE,componentsPerAttribute:3,values:O}),Te.prevPosition=new Hs({componentDatatype:Ws.DOUBLE,componentsPerAttribute:3,values:N}),Te.nextPosition=new Hs({componentDatatype:Ws.DOUBLE,componentsPerAttribute:3,values:_}),Te.expandAndWidth=new Hs({componentDatatype:Ws.FLOAT,componentsPerAttribute:2,values:E}),e.st&&(Te.st=new Hs({componentDatatype:Ws.FLOAT,componentsPerAttribute:2,values:D})),Qt(z)&&(Te.color=new Hs({componentDatatype:Ws.UNSIGNED_BYTE,componentsPerAttribute:4,values:z,normalize:!0}));var de=CM.createTypedArray(G,f*6-6),Ne=0,Qe=0,Tt=f-1;for(u=0;u<Tt;++u)de[Qe++]=Ne,de[Qe++]=Ne+2,de[Qe++]=Ne+1,de[Qe++]=Ne+1,de[Qe++]=Ne+2,de[Qe++]=Ne+3,Ne+=4;return new vM({attributes:Te,indices:de,primitiveType:_M.TRIANGLES,boundingSphere:gM.fromPoints(p),geometryType:wM.POLYLINES})};var lf;function bM(){return typeof lf>"u"&&(lf=new h.EllipsoidGeodesic),lf}function SM(t,i){var e=i/3e7;return e=Math.min(1,e),e=1-Math.pow(1-e,2),Math.sin(Math.PI*t)*1e6*e}function EM(t,i,e,n=1){var o=bM(),s=h.Cartesian3.fromDegreesArray([t[0],t[1],i[0],i[1]]),r=[0,0];t.length>=3&&i.length>=3&&(r=[t[2],i[2]]);var l=h.Cartographic.fromDegrees(t[0],t[1]),c=h.Cartographic.fromDegrees(i[0],i[1]);o.setEndPoints(l,c);var u=o.surfaceDistance,d=h.PolylinePipeline.generateCartesianArc({positions:s,height:r,minDistance:u/36}),p=d.length;return d.forEach(function(f,g){var v=g/(p-1),y=SM(v,u*n),w=h.Cartographic.fromCartesian(f);w.height+=y,h.Cartesian3.fromRadians(w.longitude,w.latitude,w.height,h.Ellipsoid.WGS84,d[g])}),d}function xM(t=[.8,.8,0,1],i=!0,e=!0,n){var o;const s=n?{type:"Image",uniforms:{color:new h.Color(...t)}}:{type:"Color",uniforms:{color:new h.Color(...t)}};i?(o=new h.PolylineMaterialAppearance({material:new h.Material({fabric:s,translucent:!1}),translucent:!1}),o.renderState.blending=h.BlendingState.ADDITIVE_BLEND,o.renderState.depthMask=!1,o.renderState.depthTest={enabled:!0},o.getRenderState=function(){const d=h.Appearance.prototype.getRenderState.call(this);return d.depthTest={enabled:e},d.depthMask=!1,d},o.material.type==="Image"&&(o.material._uniforms.image_1=n)):(o=new h.PolylineMaterialAppearance({material:new h.Material({fabric:s,translucent:!0})}),o.getRenderState=function(){const d=h.Appearance.prototype.getRenderState.call(this);return d.depthTest={enabled:e},d.depthMask=!1,d},o.material.type==="Image"&&(o.material._uniforms.image_1=n));var r=h.ShaderSource.replaceMain(o._vertexShaderSource,"czm_twp_main"),l=`out vec4 v_twp;
1819
1819
  out vec4 v_color;
1820
1820
  out vec4 v_bgColor;
1821
1821
  out float v_expand;
@@ -1841,7 +1841,7 @@ void main()
1841
1841
  {
1842
1842
  czm_twp2_main();
1843
1843
  float t = v_twp.x; float bidirectional = v_twp.z; t *= 1.03; float alpha0 = smoothstep(t - 0.03, t, v_st.s) * step(v_st.s, t); float mt = 1. - t; float alpha1 = smoothstep(mt + 0.03, mt, v_st.s) * step(mt, v_st.s); float a0 = step(abs(bidirectional - 0.0) - 0.001, 0.); float a1 = step(abs(bidirectional - 1.0) - 0.001, 0.); float db = step(abs(bidirectional - 2.0) - 0.001, 0.); float alpha = alpha0 * (a0 + db) + alpha1 * (a1 + db); alpha = clamp(alpha, 0., 1.); out_FragColor.rgb *= (v_color.rgb * alpha + v_bgColor.rgb * (1. - alpha)); out_FragColor.a *= (v_color.a * alpha + v_bgColor.a * (1. - alpha));}`;return o._fragmentShaderSource=c+`
1844
- `+u,o}function xM(t,i,e,n,o,s,r){const l=$s.createGeometry(new $s({positions:i,width:e,vertexFormat:h.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:n}));if(l){s||(s=h.Color.clone(o||h.Color.WHITE),s.alpha=.2);var c=new h.GeometryInstance({geometry:l,id:t,attributes:{color:h.ColorGeometryInstanceAttribute.fromColor(o||h.Color.WHITE),bgColor:h.ColorGeometryInstanceAttribute.fromColor(s),twp:new h.GeometryInstanceAttribute({componentDatatype:h.ComponentDatatype.FLOAT,componentsPerAttribute:4,normalize:!1,value:r})}});return c}}const Eh=new h.Cartesian4(0,0,0,0),zi=new h.Cartesian4(0,0,0,0),ea={timeRatio:0,repeat:1,color:[1,1,1,1],bgColor:[1,1,1,1],bidirectional:0};function AM(t,i,e,n,o=!0,s=!0,r,l){var c=[];try{t.forEach(function(d,p){var f=d.positions&&d.positions.map(L=>h.Cartesian3.fromDegrees(...L))||SM(d.startPos,d.endPos,void 0,typeof d.heightRatio>"u"?1:d.heightRatio);const g=n(p,void 0,ea),{timeRatio:v,repeat:y,color:w,bidirectional:P,bgColor:C}=g,S=new h.Color(...w),x=new h.Color(...C),A=[v,y,P,0];var R=xM(p,f,d.width,e,S,x,A);if(!R)throw new Error("cannot get geoemetry instance!");c.push(R)})}catch{return}var u=new h.Primitive({geometryInstances:c,appearance:EM(i,o,s,r),asynchronous:!1});return h.Primitive.prototype&&(u.ESSceneObjectID=l),u.update=function(d){const p=this;if(typeof p._batchTable<"u")for(var f=p._batchTableAttributeIndices.twp,g=p._batchTableAttributeIndices.color,v=p._batchTableAttributeIndices.bgColor,y=p._batchTable._numberOfInstances,w=0;w<y;++w){var P=w;ea.timeRatio=0,ea.repeat=1,ea.color.splice(0,4,1,1,1);const C=n(P,d,ea),{timeRatio:S,repeat:x,color:A,bidirectional:R,bgColor:L}=C;Eh.x=S,Eh.y=x,Eh.z=typeof R!="number"?0:R,p._batchTable.setBatchedAttribute(P,f,Eh),zi.x=255*A[0],zi.y=255*A[1],zi.z=255*A[2],zi.w=255*A[3],p._batchTable.setBatchedAttribute(P,g,zi),zi.x=255*L[0],zi.y=255*L[1],zi.z=255*L[2],zi.w=255*L[3],p._batchTable.setBatchedAttribute(P,v,zi)}h.Primitive.prototype.update.call(p,d)},u}class TM extends a.Destroyable{constructor(e,n,o){super();m(this,"_nativePrimitive");this._viewer=e;const s=this._viewer,r=n.routePaths;if(!r)throw new Error("!routePath");const l=n.arcType!==void 0?h.ArcType[n.arcType]:h.ArcType.GEODESIC,c=AM(r,n.color,l,(u,d,p)=>{const f=r[u];if(!n)return p;p.repeat=(f.repeat??1)*n.repeat;const g=f.startTime??n.startTime,v=f.transmissionTime??n.transmissionTime??n.duration??tn.defaults.duration,y=n.currentTime??tn.defaults.currentTime,w=a.clamp((y-g)/v,0,1);p.timeRatio=w/p.repeat;const P=f.color??n.color,C=f.bgColor??n.bgColor;return p.color.splice(0,4,...P),p.bgColor.splice(0,4,...C),p.bidirectional=f.bidirectional??n.bidirectional,(n.routePathCallback&&n.routePathCallback(p,u,d))??p},n.brightening,n.depthTest,o,n.id);c&&(s.scene.primitives.add(c),this.dispose(()=>{s.scene.primitives.remove(c)}),c.show=n.show??!0,this.dispose(n.showChanged.disposableOn(()=>{c&&(c.show=n.show??!0)})),this._nativePrimitive=c)}get nativePrimitive(){return this._nativePrimitive}}const MM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAABCAYAAABubagXAAAATUlEQVQYlaXLOQqEUBQF0SMmojgvpfe/JiccEvlNwwuM24IK7oXKUkof7ylQoUGHHsPDMf4WNcpociTcuHBgx4oFczg9/O0tPKP7D3wBky8UMt76XnoAAAAASUVORK5CYII=",IM=`默认示例代码
1844
+ `+u,o}function AM(t,i,e,n,o,s,r){const l=$s.createGeometry(new $s({positions:i,width:e,vertexFormat:h.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:n}));if(l){s||(s=h.Color.clone(o||h.Color.WHITE),s.alpha=.2);var c=new h.GeometryInstance({geometry:l,id:t,attributes:{color:h.ColorGeometryInstanceAttribute.fromColor(o||h.Color.WHITE),bgColor:h.ColorGeometryInstanceAttribute.fromColor(s),twp:new h.GeometryInstanceAttribute({componentDatatype:h.ComponentDatatype.FLOAT,componentsPerAttribute:4,normalize:!1,value:r})}});return c}}const Eh=new h.Cartesian4(0,0,0,0),zi=new h.Cartesian4(0,0,0,0),ea={timeRatio:0,repeat:1,color:[1,1,1,1],bgColor:[1,1,1,1],bidirectional:0};function TM(t,i,e,n,o=!0,s=!0,r,l){var c=[];try{t.forEach(function(d,p){var f=d.positions&&d.positions.map(L=>h.Cartesian3.fromDegrees(...L))||EM(d.startPos,d.endPos,void 0,typeof d.heightRatio>"u"?1:d.heightRatio);const g=n(p,void 0,ea),{timeRatio:v,repeat:y,color:w,bidirectional:P,bgColor:C}=g,S=new h.Color(...w),x=new h.Color(...C),A=[v,y,P,0];var R=AM(p,f,d.width,e,S,x,A);if(!R)throw new Error("cannot get geoemetry instance!");c.push(R)})}catch{return}var u=new h.Primitive({geometryInstances:c,appearance:xM(i,o,s,r),asynchronous:!1});return h.Primitive.prototype&&(u.ESSceneObjectID=l),u.update=function(d){const p=this;if(typeof p._batchTable<"u")for(var f=p._batchTableAttributeIndices.twp,g=p._batchTableAttributeIndices.color,v=p._batchTableAttributeIndices.bgColor,y=p._batchTable._numberOfInstances,w=0;w<y;++w){var P=w;ea.timeRatio=0,ea.repeat=1,ea.color.splice(0,4,1,1,1);const C=n(P,d,ea),{timeRatio:S,repeat:x,color:A,bidirectional:R,bgColor:L}=C;Eh.x=S,Eh.y=x,Eh.z=typeof R!="number"?0:R,p._batchTable.setBatchedAttribute(P,f,Eh),zi.x=255*A[0],zi.y=255*A[1],zi.z=255*A[2],zi.w=255*A[3],p._batchTable.setBatchedAttribute(P,g,zi),zi.x=255*L[0],zi.y=255*L[1],zi.z=255*L[2],zi.w=255*L[3],p._batchTable.setBatchedAttribute(P,v,zi)}h.Primitive.prototype.update.call(p,d)},u}class MM extends a.Destroyable{constructor(e,n,o){super();m(this,"_nativePrimitive");this._viewer=e;const s=this._viewer,r=n.routePaths;if(!r)throw new Error("!routePath");const l=n.arcType!==void 0?h.ArcType[n.arcType]:h.ArcType.GEODESIC,c=TM(r,n.color,l,(u,d,p)=>{const f=r[u];if(!n)return p;p.repeat=(f.repeat??1)*n.repeat;const g=f.startTime??n.startTime,v=f.transmissionTime??n.transmissionTime??n.duration??tn.defaults.duration,y=n.currentTime??tn.defaults.currentTime,w=a.clamp((y-g)/v,0,1);p.timeRatio=w/p.repeat;const P=f.color??n.color,C=f.bgColor??n.bgColor;return p.color.splice(0,4,...P),p.bgColor.splice(0,4,...C),p.bidirectional=f.bidirectional??n.bidirectional,(n.routePathCallback&&n.routePathCallback(p,u,d))??p},n.brightening,n.depthTest,o,n.id);c&&(s.scene.primitives.add(c),this.dispose(()=>{s.scene.primitives.remove(c)}),c.show=n.show??!0,this.dispose(n.showChanged.disposableOn(()=>{c&&(c.show=n.show??!0)})),this._nativePrimitive=c)}get nativePrimitive(){return this._nativePrimitive}}const IM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAABCAYAAABubagXAAAATUlEQVQYlaXLOQqEUBQF0SMmojgvpfe/JiccEvlNwwuM24IK7oXKUkof7ylQoUGHHsPDMf4WNcpociTcuHBgx4oFczg9/O0tPKP7D3wBky8UMt76XnoAAAAASUVORK5CYII=",DM=`默认示例代码
1845
1845
  \`\`\`
1846
1846
  // result 最后的结果
1847
1847
  // this 是当前的信号传输器集合
@@ -1855,7 +1855,7 @@ function (result, this, instanceIndex, frameState) {
1855
1855
  result.bgColor = [c*.5+.5, (1.0 - c)*.5+.5, 0.5, 0.3];
1856
1856
  return result;
1857
1857
  }\`\`\`
1858
- `,Qn=class Qn extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_player");m(this,"_finalImageUrlReact",this.disposeVar(a.ESSceneObject.context.createEnvStrReact([this,"imageUrl"])));m(this,"_routePaths",this.disposeVar(a.react(void 0)));m(this,"routePathCallback");m(this,"_id",this.disposeVar(a.react(a.createGuid())));n&&(this._id.value=n),this._player=this.disposeVar(new a.Player);{const g=Qn.defaults;this.dispose(a.bind([this._player,"loop"],[this,"loop"],v=>v??g.loop,v=>v??g.loop)),this.dispose(a.bind([this._player,"currentTime"],[this,"currentTime"],v=>v??g.currentTime,v=>v??g.currentTime)),this.dispose(a.bind([this._player,"duration"],[this,"duration"],v=>v??g.duration,v=>v??g.duration)),this.dispose(a.bind([this._player,"playing"],[this,"playing"],v=>v??g.playing,v=>v??g.playing)),this.dispose(a.bind([this._player,"speed"],[this,"speed"],v=>v??g.speed,v=>v??g.speed))}const o=this.disposeVar(a.ESSceneObject.context.createEnvStrReact([this,"geoJsonUrl"])),s=this.disposeVar(a.createProcessingFromAsyncFunc(async g=>{this.routePaths=void 0;const v=o.value;if(v)try{const w=await(await fetch(v)).json();this.routePaths=dM(w,this.width,this.repeatLength);return}catch(y){console.error(`geojson加载解析出错!${y}`),console.error(y)}if(this.data){this.routePaths=[...this.data];return}if(this.positionsSet){const y=this.positionsSet;if(y){this.routePaths=y.map(w=>({positions:w,width:this.width}));return}}}));{const g=()=>{s.restart()};g();const v=this.disposeVar(a.createNextAnimateFrameEvent(o.changed,this.positionsSetChanged,this.dataChanged,this.finalImageUrlReact.changed,this.widthChanged,this.repeatLengthChanged,this.arcTypeChanged,this.brighteningChanged,this.depthTestChanged));this.dispose(v.disposableOn(g))}{const g=()=>{const v=Pu(this.routePathCallbackStr,["result","this","instanceIndex","frameState"]);v&&(this.routePathCallback=v)};g(),this.dispose(this.routePathCallbackStrChanged.disposableOn(g))}const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}const l=this.finalImageUrlReact,c=this.disposeVar(new is),u=this.disposeVar(a.createProcessingFromAsyncFunc(async g=>{if(!l.value)return;const v=Im(r.scene.context).getTextureHandler(l.value);if(v instanceof is)c.reset(v);else{const y=await g.promise(v);c.reset(y)}})),d=()=>c.valid?c.raw:r.scene.context.defaultTexture,p=()=>u.restart();p(),this.dispose(l.changed.disposableOn(p));const f=this.ad(a.createNextAnimateFrameEvent(this.routePathsChanged,this.colorChanged,this.bgColorChanged));this.disposeVar(new a.ObjResettingWithEvent(f,()=>this.routePaths?new TM(r,this,l.value&&d||void 0):void 0)),this.dispose(this.flyToEvent.disposableOn(g=>{if(!(!this.routePaths||this.routePaths.length===0)&&this.routePaths.length===1)if(!Object.prototype.hasOwnProperty.call(this.routePaths[0],"positions"))ne(r,this.routePaths[0].startPos,r.camera.positionCartographic.height,void 0,g);else{const v=computeBoundingSphere(this.routePaths[0].positions);if(!v)return;const[y,w]=v;ne(r,y,w*3,void 0,g)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get player(){return this._player}get ratio(){return this._player.ratio}set ratio(e){this._player.ratio=e}get ratioChanged(){return this._player.ratioChanged}get finalImageUrlReact(){return this._finalImageUrlReact}get routePaths(){return this._routePaths.value}set routePaths(e){this._routePaths.value=e}get routePathsChanged(){return this._routePaths.changed}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}};m(Qn,"whiteGradientImageBase64",MM),m(Qn,"defaultRoutePathCallback",function(e,n,o){const s=n/50,r=s-Math.floor(s);return e.color=[r*.5+.5,(1-r)*.5+.5,.5,1],e.bgColor=[r*.5+.5,(1-r)*.5+.5,.5,.3],e}),m(Qn,"routePathCallbackStrMd",IM),m(Qn,"defaults",{loop:!0,startTime:0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),m(Qn,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png");let tn=Qn;(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:a.reactArray([0,1,0,1]),bgColor:a.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positionsSet:a.reactPositionsSet(void 0),data:a.reactJson(void 0),geoJsonUrl:"",allowPicking:!1,routePathCallbackStr:"",loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(tn||(tn={})),a.extendClassProps(tn.prototype,tn.createDefaultProps);class Bn extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_collection");this._collection=this.disposeVar(new tn(e,n)),this.dispose(a.track([this._collection,"show"],[this,"show"])),this.dispose(a.track([this._collection,"startTime"],[this,"startTime"])),this.dispose(a.track([this._collection,"transmissionTime"],[this,"transmissionTime"])),this.dispose(a.track([this._collection,"color"],[this,"color"])),this.dispose(a.track([this._collection,"bgColor"],[this,"bgColor"])),this.dispose(a.track([this._collection,"width"],[this,"width"])),this.dispose(a.track([this._collection,"arcType"],[this,"arcType"])),this.dispose(a.track([this._collection,"brightening"],[this,"brightening"])),this.dispose(a.track([this._collection,"depthTest"],[this,"depthTest"])),this.dispose(a.track([this._collection,"imageUrl"],[this,"imageUrl"])),this.dispose(a.track([this._collection,"repeat"],[this,"repeat"])),this.dispose(a.track([this._collection,"repeatLength"],[this,"repeatLength"])),this.dispose(a.track([this._collection,"bidirectional"],[this,"bidirectional"])),this.dispose(a.track([this._collection,"allowPicking"],[this,"allowPicking"])),this.dispose(a.bind([this._collection,"playing"],[this,"playing"])),this.dispose(a.track([this._collection,"loop"],[this,"loop"])),this.dispose(a.bind([this._collection,"currentTime"],[this,"currentTime"])),this.dispose(a.bind([this._collection,"duration"],[this,"duration"])),this.dispose(a.bind([this._collection,"speed"],[this,"speed"]));{const o=()=>{this.color=[this.bgColor[0],this.bgColor[1],this.bgColor[2],1]};o(),this.ad(this.bgColorChanged.don(o))}this.dispose(this.flyToEvent.disposableOn(o=>{this._collection.flyTo(o)}));{const o=()=>{if(!this.positions){this._collection.data=void 0;return}if(this.heightRatio===0){this._collection.data=[{positions:this.positions,width:this.width}];return}if(this.positions.length>=2){this._collection.data=this.positions.map((r,l)=>{var c;if(!(!this.positions||l==((c=this.positions)==null?void 0:c.length)-1))return{startPos:r,endPos:this.positions[l+1],width:this.width,heightRatio:this.heightRatio}}).filter(r=>r!==void 0);return}this._collection.data=void 0};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.heightRatioChanged,this.widthChanged));this.dispose(s.disposableOn(o))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get collection(){return this._collection}get player(){return this.collection.player}get ratio(){return this.player.ratio}set ratio(e){this.player.ratio=e}get ratioChanged(){return this.player.ratioChanged}}m(Bn,"defaults",{loop:!0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),m(Bn,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png"),(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:a.reactArray([0,1,0,1]),bgColor:a.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positions:a.reactPositions(void 0),heightRatio:0,allowPicking:!1,loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(Bn||(Bn={})),a.extendClassProps(Bn.prototype,Bn.createDefaultProps);const zl=class zl extends yt{constructor(e,n){super(e,n);m(this,"_czmSignalTransmission");if(this._czmSignalTransmission=this.disposeVar(new Bn(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmSignalTransmission;{const r=()=>{s.show=e.show&&e.stroked};r(),this.ad(e.showChanged.don(r)),this.ad(e.strokedChanged.don(r))}this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"width"],[e,"strokeWidth"])),this.dispose(a.track([s,"bgColor"],[e,"strokeColor"])),this.dispose(a.track([s,"startTime"],[e,"startTime"])),this.dispose(a.track([s,"transmissionTime"],[e,"transmissionTime"])),this.dispose(a.track([s,"heightRatio"],[e,"heightRatio"])),this.dispose(a.track([s,"arcType"],[e,"arcType"])),this.dispose(a.track([s,"brightening"],[e,"brightening"])),this.dispose(a.track([s,"depthTest"],[e,"depthTest"])),this.dispose(a.track([s,"imageUrl"],[e,"imageUrl"])),this.dispose(a.track([s,"repeat"],[e,"repeat"])),this.dispose(a.track([s,"bidirectional"],[e,"bidirectional"])),this.dispose(a.track([s,"loop"],[e,"loop"])),this.dispose(a.track([s,"currentTime"],[e,"currentTime"])),this.dispose(a.track([s,"duration"],[e,"duration"])),this.dispose(a.track([s,"playing"],[e,"playing"])),this.dispose(a.track([s,"speed"],[e,"speed"]))}get czmSignalTransmission(){return this._czmSignalTransmission}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmSignalTransmission:r}=this;return s.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmSignalTransmission:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(zl,"type",zl.register("ESCesiumViewer",wh.type,zl));let cf=zl;function zo(t){var i=[1/0,1/0,-1/0,-1/0];return Ro(t,function(e){i[0]>e[0]&&(i[0]=e[0]),i[1]>e[1]&&(i[1]=e[1]),i[2]<e[0]&&(i[2]=e[0]),i[3]<e[1]&&(i[3]=e[1])}),i}zo.default=zo;var r0={exports:{}};(function(t,i){(function(e,n){t.exports=n()})(mo,function(){function e(C,S,x,A,R){(function L(B,V,G,O,N){for(;O>G;){if(O-G>600){var _=O-G+1,E=V-G+1,D=Math.log(_),z=.5*Math.exp(2*D/3),U=.5*Math.sqrt(D*z*(_-z)/_)*(E-_/2<0?-1:1),Y=Math.max(G,Math.floor(V-E*z/_+U)),q=Math.min(O,Math.floor(V+(_-E)*z/_+U));L(B,V,Y,q,N)}var X=B[V],Q=G,j=O;for(n(B,G,V),N(B[O],X)>0&&n(B,G,O);Q<j;){for(n(B,Q,j),Q++,j--;N(B[Q],X)<0;)Q++;for(;N(B[j],X)>0;)j--}N(B[G],X)===0?n(B,G,j):n(B,++j,O),j<=V&&(G=j+1),V<=j&&(O=j-1)}})(C,S,x||0,A||C.length-1,R||o)}function n(C,S,x){var A=C[S];C[S]=C[x],C[x]=A}function o(C,S){return C<S?-1:C>S?1:0}var s=function(C){C===void 0&&(C=9),this._maxEntries=Math.max(4,C),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function r(C,S,x){if(!x)return S.indexOf(C);for(var A=0;A<S.length;A++)if(x(C,S[A]))return A;return-1}function l(C,S){c(C,0,C.children.length,S,C)}function c(C,S,x,A,R){R||(R=w(null)),R.minX=1/0,R.minY=1/0,R.maxX=-1/0,R.maxY=-1/0;for(var L=S;L<x;L++){var B=C.children[L];u(R,C.leaf?A(B):B)}return R}function u(C,S){return C.minX=Math.min(C.minX,S.minX),C.minY=Math.min(C.minY,S.minY),C.maxX=Math.max(C.maxX,S.maxX),C.maxY=Math.max(C.maxY,S.maxY),C}function d(C,S){return C.minX-S.minX}function p(C,S){return C.minY-S.minY}function f(C){return(C.maxX-C.minX)*(C.maxY-C.minY)}function g(C){return C.maxX-C.minX+(C.maxY-C.minY)}function v(C,S){return C.minX<=S.minX&&C.minY<=S.minY&&S.maxX<=C.maxX&&S.maxY<=C.maxY}function y(C,S){return S.minX<=C.maxX&&S.minY<=C.maxY&&S.maxX>=C.minX&&S.maxY>=C.minY}function w(C){return{children:C,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function P(C,S,x,A,R){for(var L=[S,x];L.length;)if(!((x=L.pop())-(S=L.pop())<=A)){var B=S+Math.ceil((x-S)/A/2)*A;e(C,B,S,x,R),L.push(S,B,B,x)}}return s.prototype.all=function(){return this._all(this.data,[])},s.prototype.search=function(C){var S=this.data,x=[];if(!y(C,S))return x;for(var A=this.toBBox,R=[];S;){for(var L=0;L<S.children.length;L++){var B=S.children[L],V=S.leaf?A(B):B;y(C,V)&&(S.leaf?x.push(B):v(C,V)?this._all(B,x):R.push(B))}S=R.pop()}return x},s.prototype.collides=function(C){var S=this.data;if(!y(C,S))return!1;for(var x=[];S;){for(var A=0;A<S.children.length;A++){var R=S.children[A],L=S.leaf?this.toBBox(R):R;if(y(C,L)){if(S.leaf||v(C,L))return!0;x.push(R)}}S=x.pop()}return!1},s.prototype.load=function(C){if(!C||!C.length)return this;if(C.length<this._minEntries){for(var S=0;S<C.length;S++)this.insert(C[S]);return this}var x=this._build(C.slice(),0,C.length-1,0);if(this.data.children.length)if(this.data.height===x.height)this._splitRoot(this.data,x);else{if(this.data.height<x.height){var A=this.data;this.data=x,x=A}this._insert(x,this.data.height-x.height-1,!0)}else this.data=x;return this},s.prototype.insert=function(C){return C&&this._insert(C,this.data.height-1),this},s.prototype.clear=function(){return this.data=w([]),this},s.prototype.remove=function(C,S){if(!C)return this;for(var x,A,R,L=this.data,B=this.toBBox(C),V=[],G=[];L||V.length;){if(L||(L=V.pop(),A=V[V.length-1],x=G.pop(),R=!0),L.leaf){var O=r(C,L.children,S);if(O!==-1)return L.children.splice(O,1),V.push(L),this._condense(V),this}R||L.leaf||!v(L,B)?A?(x++,L=A.children[x],R=!1):L=null:(V.push(L),G.push(x),x=0,A=L,L=L.children[0])}return this},s.prototype.toBBox=function(C){return C},s.prototype.compareMinX=function(C,S){return C.minX-S.minX},s.prototype.compareMinY=function(C,S){return C.minY-S.minY},s.prototype.toJSON=function(){return this.data},s.prototype.fromJSON=function(C){return this.data=C,this},s.prototype._all=function(C,S){for(var x=[];C;)C.leaf?S.push.apply(S,C.children):x.push.apply(x,C.children),C=x.pop();return S},s.prototype._build=function(C,S,x,A){var R,L=x-S+1,B=this._maxEntries;if(L<=B)return l(R=w(C.slice(S,x+1)),this.toBBox),R;A||(A=Math.ceil(Math.log(L)/Math.log(B)),B=Math.ceil(L/Math.pow(B,A-1))),(R=w([])).leaf=!1,R.height=A;var V=Math.ceil(L/B),G=V*Math.ceil(Math.sqrt(B));P(C,S,x,G,this.compareMinX);for(var O=S;O<=x;O+=G){var N=Math.min(O+G-1,x);P(C,O,N,V,this.compareMinY);for(var _=O;_<=N;_+=V){var E=Math.min(_+V-1,N);R.children.push(this._build(C,_,E,A-1))}}return l(R,this.toBBox),R},s.prototype._chooseSubtree=function(C,S,x,A){for(;A.push(S),!S.leaf&&A.length-1!==x;){for(var R=1/0,L=1/0,B=void 0,V=0;V<S.children.length;V++){var G=S.children[V],O=f(G),N=(_=C,E=G,(Math.max(E.maxX,_.maxX)-Math.min(E.minX,_.minX))*(Math.max(E.maxY,_.maxY)-Math.min(E.minY,_.minY))-O);N<L?(L=N,R=O<R?O:R,B=G):N===L&&O<R&&(R=O,B=G)}S=B||S.children[0]}var _,E;return S},s.prototype._insert=function(C,S,x){var A=x?C:this.toBBox(C),R=[],L=this._chooseSubtree(A,this.data,S,R);for(L.children.push(C),u(L,A);S>=0&&R[S].children.length>this._maxEntries;)this._split(R,S),S--;this._adjustParentBBoxes(A,R,S)},s.prototype._split=function(C,S){var x=C[S],A=x.children.length,R=this._minEntries;this._chooseSplitAxis(x,R,A);var L=this._chooseSplitIndex(x,R,A),B=w(x.children.splice(L,x.children.length-L));B.height=x.height,B.leaf=x.leaf,l(x,this.toBBox),l(B,this.toBBox),S?C[S-1].children.push(B):this._splitRoot(x,B)},s.prototype._splitRoot=function(C,S){this.data=w([C,S]),this.data.height=C.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},s.prototype._chooseSplitIndex=function(C,S,x){for(var A,R,L,B,V,G,O,N=1/0,_=1/0,E=S;E<=x-S;E++){var D=c(C,0,E,this.toBBox),z=c(C,E,x,this.toBBox),U=(R=D,L=z,B=void 0,V=void 0,G=void 0,O=void 0,B=Math.max(R.minX,L.minX),V=Math.max(R.minY,L.minY),G=Math.min(R.maxX,L.maxX),O=Math.min(R.maxY,L.maxY),Math.max(0,G-B)*Math.max(0,O-V)),Y=f(D)+f(z);U<N?(N=U,A=E,_=Y<_?Y:_):U===N&&Y<_&&(_=Y,A=E)}return A||x-S},s.prototype._chooseSplitAxis=function(C,S,x){var A=C.leaf?this.compareMinX:d,R=C.leaf?this.compareMinY:p;this._allDistMargin(C,S,x,A)<this._allDistMargin(C,S,x,R)&&C.children.sort(A)},s.prototype._allDistMargin=function(C,S,x,A){C.children.sort(A);for(var R=this.toBBox,L=c(C,0,S,R),B=c(C,x-S,x,R),V=g(L)+g(B),G=S;G<x-S;G++){var O=C.children[G];u(L,C.leaf?R(O):O),V+=g(L)}for(var N=x-S-1;N>=S;N--){var _=C.children[N];u(B,C.leaf?R(_):_),V+=g(B)}return V},s.prototype._adjustParentBBoxes=function(C,S,x){for(var A=x;A>=0;A--)u(S[A],C)},s.prototype._condense=function(C){for(var S=C.length-1,x=void 0;S>=0;S--)C[S].children.length===0?S>0?(x=C[S-1].children).splice(x.indexOf(C[S]),1):this.clear():l(C[S],this.toBBox)},s})})(r0);var DM=r0.exports;function bt(t,i,e){if(e===void 0&&(e={}),!t)throw new Error("point is required");if(!i)throw new Error("polygon is required");var n=Sh(t),o=Di(i),s=o.type,r=i.bbox,l=o.coordinates;if(r&&RM(n,r)===!1)return!1;s==="Polygon"&&(l=[l]);for(var c=!1,u=0;u<l.length&&!c;u++)if(a0(n,l[u][0],e.ignoreBoundary)){for(var d=!1,p=1;p<l[u].length&&!d;)a0(n,l[u][p],!e.ignoreBoundary)&&(d=!0),p++;d||(c=!0)}return c}function a0(t,i,e){var n=!1;i[0][0]===i[i.length-1][0]&&i[0][1]===i[i.length-1][1]&&(i=i.slice(0,i.length-1));for(var o=0,s=i.length-1;o<i.length;s=o++){var r=i[o][0],l=i[o][1],c=i[s][0],u=i[s][1],d=t[1]*(r-c)+l*(c-t[0])+u*(t[0]-r)===0&&(r-t[0])*(c-t[0])<=0&&(l-t[1])*(u-t[1])<=0;if(d)return!e;var p=l>t[1]!=u>t[1]&&t[0]<(c-r)*(t[1]-l)/(u-l)+r;p&&(n=!n)}return n}function RM(t,i){return i[0]<=t[0]&&i[1]<=t[1]&&i[2]>=t[0]&&i[3]>=t[1]}function FM(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return l0(t);case"FeatureCollection":return zM(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return hf(t);default:throw new Error("unknown GeoJSON type")}}function l0(t){var i={type:"Feature"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"properties":case"geometry":return;default:i[e]=t[e]}}),i.properties=c0(t.properties),i.geometry=hf(t.geometry),i}function c0(t){var i={};return t&&Object.keys(t).forEach(function(e){var n=t[e];typeof n=="object"?n===null?i[e]=null:Array.isArray(n)?i[e]=n.map(function(o){return o}):i[e]=c0(n):i[e]=n}),i}function zM(t){var i={type:"FeatureCollection"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"features":return;default:i[e]=t[e]}}),i.features=t.features.map(function(e){return l0(e)}),i}function hf(t){var i={type:t.type};return t.bbox&&(i.bbox=t.bbox),t.type==="GeometryCollection"?(i.geometries=t.geometries.map(function(e){return hf(e)}),i):(i.coordinates=h0(t.coordinates),i)}function h0(t){var i=t;return typeof i[0]!="object"?i.slice():i.map(function(e){return h0(e)})}function u0(t,i){i===void 0&&(i={});var e=typeof i=="object"?i.mutate:i;if(!t)throw new Error("geojson is required");var n=KT(t),o=[];switch(n){case"LineString":o=uf(t);break;case"MultiLineString":case"Polygon":Ii(t).forEach(function(r){o.push(uf(r))});break;case"MultiPolygon":Ii(t).forEach(function(r){var l=[];r.forEach(function(c){l.push(uf(c))}),o.push(l)});break;case"Point":return t;case"MultiPoint":var s={};Ii(t).forEach(function(r){var l=r.join("-");Object.prototype.hasOwnProperty.call(s,l)||(o.push(r),s[l]=!0)});break;default:throw new Error(n+" geometry not supported")}return t.coordinates?e===!0?(t.coordinates=o,t):{type:n,coordinates:o}:e===!0?(t.geometry.coordinates=o,t):Zt({type:n,coordinates:o},t.properties,{bbox:t.bbox,id:t.id})}function uf(t){var i=Ii(t);if(i.length===2&&!d0(i[0],i[1]))return i;var e=[],n=i.length-1,o=e.length;e.push(i[0]);for(var s=1;s<n;s++){var r=e[e.length-1];i[s][0]===r[0]&&i[s][1]===r[1]||(e.push(i[s]),o=e.length,o>2&&p0(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1))}if(e.push(i[i.length-1]),o=e.length,d0(i[0],i[i.length-1])&&o<4)throw new Error("invalid polygon");return p0(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1),e}function d0(t,i){return t[0]===i[0]&&t[1]===i[1]}function p0(t,i,e){var n=e[0],o=e[1],s=t[0],r=t[1],l=i[0],c=i[1],u=n-s,d=o-r,p=l-s,f=c-r,g=u*f-d*p;return g!==0?!1:Math.abs(p)>=Math.abs(f)?p>0?s<=n&&n<=l:l<=n&&n<=s:f>0?r<=o&&o<=c:c<=o&&o<=r}function LM(t,i){i===void 0&&(i={});var e=0,n=0,o=0;return Ro(t,function(s){e+=s[0],n+=s[1],o++},!0),dt([e/o,n/o],i.properties)}function f0(t){if(!t)throw new Error("geojson is required");var i=[];return ji(t,function(e){OM(e,i)}),Nt(i)}function OM(t,i){var e=[],n=t.geometry;if(n!==null){switch(n.type){case"Polygon":e=Ii(n);break;case"LineString":e=[Ii(n)]}e.forEach(function(o){var s=NM(o,t.properties);s.forEach(function(r){r.id=i.length,i.push(r)})})}}function NM(t,i){var e=[];return t.reduce(function(n,o){var s=oi([n,o],i);return s.bbox=BM(n,o),e.push(s),o}),e}function BM(t,i){var e=t[0],n=t[1],o=i[0],s=i[1],r=e<o?e:o,l=n<s?n:s,c=e>o?e:o,u=n>s?n:s;return[r,l,c,u]}var df={exports:{}},g0={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.earthRadius=63710088e-1,t.factors={centimeters:t.earthRadius*100,centimetres:t.earthRadius*100,degrees:t.earthRadius/111325,feet:t.earthRadius*3.28084,inches:t.earthRadius*39.37,kilometers:t.earthRadius/1e3,kilometres:t.earthRadius/1e3,meters:t.earthRadius,metres:t.earthRadius,miles:t.earthRadius/1609.344,millimeters:t.earthRadius*1e3,millimetres:t.earthRadius*1e3,nauticalmiles:t.earthRadius/1852,radians:1,yards:t.earthRadius*1.0936},t.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/t.earthRadius,yards:1.0936133},t.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function i(O,N,_){_===void 0&&(_={});var E={type:"Feature"};return(_.id===0||_.id)&&(E.id=_.id),_.bbox&&(E.bbox=_.bbox),E.properties=N||{},E.geometry=O,E}t.feature=i;function e(O,N,_){switch(O){case"Point":return n(N).geometry;case"LineString":return l(N).geometry;case"Polygon":return s(N).geometry;case"MultiPoint":return p(N).geometry;case"MultiLineString":return d(N).geometry;case"MultiPolygon":return f(N).geometry;default:throw new Error(O+" is invalid")}}t.geometry=e;function n(O,N,_){if(_===void 0&&(_={}),!O)throw new Error("coordinates is required");if(!Array.isArray(O))throw new Error("coordinates must be an Array");if(O.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!L(O[0])||!L(O[1]))throw new Error("coordinates must contain numbers");var E={type:"Point",coordinates:O};return i(E,N,_)}t.point=n;function o(O,N,_){return _===void 0&&(_={}),u(O.map(function(E){return n(E,N)}),_)}t.points=o;function s(O,N,_){_===void 0&&(_={});for(var E=0,D=O;E<D.length;E++){var z=D[E];if(z.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var U=0;U<z[z.length-1].length;U++)if(z[z.length-1][U]!==z[0][U])throw new Error("First and last Position are not equivalent.")}var Y={type:"Polygon",coordinates:O};return i(Y,N,_)}t.polygon=s;function r(O,N,_){return _===void 0&&(_={}),u(O.map(function(E){return s(E,N)}),_)}t.polygons=r;function l(O,N,_){if(_===void 0&&(_={}),O.length<2)throw new Error("coordinates must be an array of two or more positions");var E={type:"LineString",coordinates:O};return i(E,N,_)}t.lineString=l;function c(O,N,_){return _===void 0&&(_={}),u(O.map(function(E){return l(E,N)}),_)}t.lineStrings=c;function u(O,N){N===void 0&&(N={});var _={type:"FeatureCollection"};return N.id&&(_.id=N.id),N.bbox&&(_.bbox=N.bbox),_.features=O,_}t.featureCollection=u;function d(O,N,_){_===void 0&&(_={});var E={type:"MultiLineString",coordinates:O};return i(E,N,_)}t.multiLineString=d;function p(O,N,_){_===void 0&&(_={});var E={type:"MultiPoint",coordinates:O};return i(E,N,_)}t.multiPoint=p;function f(O,N,_){_===void 0&&(_={});var E={type:"MultiPolygon",coordinates:O};return i(E,N,_)}t.multiPolygon=f;function g(O,N,_){_===void 0&&(_={});var E={type:"GeometryCollection",geometries:O};return i(E,N,_)}t.geometryCollection=g;function v(O,N){if(N===void 0&&(N=0),N&&!(N>=0))throw new Error("precision must be a positive number");var _=Math.pow(10,N||0);return Math.round(O*_)/_}t.round=v;function y(O,N){N===void 0&&(N="kilometers");var _=t.factors[N];if(!_)throw new Error(N+" units is invalid");return O*_}t.radiansToLength=y;function w(O,N){N===void 0&&(N="kilometers");var _=t.factors[N];if(!_)throw new Error(N+" units is invalid");return O/_}t.lengthToRadians=w;function P(O,N){return S(w(O,N))}t.lengthToDegrees=P;function C(O){var N=O%360;return N<0&&(N+=360),N}t.bearingToAzimuth=C;function S(O){var N=O%(2*Math.PI);return N*180/Math.PI}t.radiansToDegrees=S;function x(O){var N=O%360;return N*Math.PI/180}t.degreesToRadians=x;function A(O,N,_){if(N===void 0&&(N="kilometers"),_===void 0&&(_="kilometers"),!(O>=0))throw new Error("length must be a positive number");return y(w(O,N),_)}t.convertLength=A;function R(O,N,_){if(N===void 0&&(N="meters"),_===void 0&&(_="kilometers"),!(O>=0))throw new Error("area must be a positive number");var E=t.areaFactors[N];if(!E)throw new Error("invalid original units");var D=t.areaFactors[_];if(!D)throw new Error("invalid final units");return O/E*D}t.convertArea=R;function L(O){return!isNaN(O)&&O!==null&&!Array.isArray(O)}t.isNumber=L;function B(O){return!!O&&O.constructor===Object}t.isObject=B;function V(O){if(!O)throw new Error("bbox is required");if(!Array.isArray(O))throw new Error("bbox must be an Array");if(O.length!==4&&O.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");O.forEach(function(N){if(!L(N))throw new Error("bbox must only contain numbers")})}t.validateBBox=V;function G(O){if(!O)throw new Error("id is required");if(["string","number"].indexOf(typeof O)===-1)throw new Error("id must be a number or a string")}t.validateId=G})(g0);var je={};const VM=Wm(QT);Object.defineProperty(je,"__esModule",{value:!0});var Ct=VM;function ta(t,i,e){if(t!==null)for(var n,o,s,r,l,c,u,d=0,p=0,f,g=t.type,v=g==="FeatureCollection",y=g==="Feature",w=v?t.features.length:1,P=0;P<w;P++){u=v?t.features[P].geometry:y?t.geometry:t,f=u?u.type==="GeometryCollection":!1,l=f?u.geometries.length:1;for(var C=0;C<l;C++){var S=0,x=0;if(r=f?u.geometries[C]:u,r!==null){c=r.coordinates;var A=r.type;switch(d=e&&(A==="Polygon"||A==="MultiPolygon")?1:0,A){case null:break;case"Point":if(i(c,p,P,S,x)===!1)return!1;p++,S++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(i(c[n],p,P,S,x)===!1)return!1;p++,A==="MultiPoint"&&S++}A==="LineString"&&S++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(o=0;o<c[n].length-d;o++){if(i(c[n][o],p,P,S,x)===!1)return!1;p++}A==="MultiLineString"&&S++,A==="Polygon"&&x++}A==="Polygon"&&S++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(x=0,o=0;o<c[n].length;o++){for(s=0;s<c[n][o].length-d;s++){if(i(c[n][o][s],p,P,S,x)===!1)return!1;p++}x++}S++}break;case"GeometryCollection":for(n=0;n<r.geometries.length;n++)if(ta(r.geometries[n],i,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function UM(t,i,e,n){var o=e;return ta(t,function(s,r,l,c,u){r===0&&e===void 0?o=s:o=i(o,s,r,l,c,u)},n),o}function m0(t,i){var e;switch(t.type){case"FeatureCollection":for(e=0;e<t.features.length&&i(t.features[e].properties,e)!==!1;e++);break;case"Feature":i(t.properties,0);break}}function WM(t,i,e){var n=e;return m0(t,function(o,s){s===0&&e===void 0?n=o:n=i(n,o,s)}),n}function v0(t,i){if(t.type==="Feature")i(t,0);else if(t.type==="FeatureCollection")for(var e=0;e<t.features.length&&i(t.features[e],e)!==!1;e++);}function GM(t,i,e){var n=e;return v0(t,function(o,s){s===0&&e===void 0?n=o:n=i(n,o,s)}),n}function HM(t){var i=[];return ta(t,function(e){i.push(e)}),i}function pf(t,i){var e,n,o,s,r,l,c,u,d,p,f=0,g=t.type==="FeatureCollection",v=t.type==="Feature",y=g?t.features.length:1;for(e=0;e<y;e++){for(l=g?t.features[e].geometry:v?t.geometry:t,u=g?t.features[e].properties:v?t.properties:{},d=g?t.features[e].bbox:v?t.bbox:void 0,p=g?t.features[e].id:v?t.id:void 0,c=l?l.type==="GeometryCollection":!1,r=c?l.geometries.length:1,o=0;o<r;o++){if(s=c?l.geometries[o]:l,s===null){if(i(null,f,u,d,p)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(i(s,f,u,d,p)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<s.geometries.length;n++)if(i(s.geometries[n],f,u,d,p)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function $M(t,i,e){var n=e;return pf(t,function(o,s,r,l,c){s===0&&e===void 0?n=o:n=i(n,o,s,r,l,c)}),n}function xh(t,i){pf(t,function(e,n,o,s,r){var l=e===null?null:e.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return i(Ct.feature(e,o,{bbox:s,id:r}),n,0)===!1?!1:void 0}var c;switch(l){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var d=e.coordinates[u],p={type:c,coordinates:d};if(i(Ct.feature(p,o),n,u)===!1)return!1}})}function qM(t,i,e){var n=e;return xh(t,function(o,s,r){s===0&&r===0&&e===void 0?n=o:n=i(n,o,s,r)}),n}function y0(t,i){xh(t,function(e,n,o){var s=0;if(e.geometry){var r=e.geometry.type;if(!(r==="Point"||r==="MultiPoint")){var l,c=0,u=0,d=0;if(ta(e,function(p,f,g,v,y){if(l===void 0||n>c||v>u||y>d){l=p,c=n,u=v,d=y,s=0;return}var w=Ct.lineString([l,p],e.properties);if(i(w,n,o,y,s)===!1)return!1;s++,l=p})===!1)return!1}}})}function XM(t,i,e){var n=e,o=!1;return y0(t,function(s,r,l,c,u){o===!1&&e===void 0?n=s:n=i(n,s,r,l,c,u),o=!0}),n}function w0(t,i){if(!t)throw new Error("geojson is required");xh(t,function(e,n,o){if(e.geometry!==null){var s=e.geometry.type,r=e.geometry.coordinates;switch(s){case"LineString":if(i(e,n,o,0,0)===!1)return!1;break;case"Polygon":for(var l=0;l<r.length;l++)if(i(Ct.lineString(r[l],e.properties),n,o,l)===!1)return!1;break}}})}function YM(t,i,e){var n=e;return w0(t,function(o,s,r,l){s===0&&e===void 0?n=o:n=i(n,o,s,r,l)}),n}function ZM(t,i){if(i=i||{},!Ct.isObject(i))throw new Error("options is invalid");var e=i.featureIndex||0,n=i.multiFeatureIndex||0,o=i.geometryIndex||0,s=i.segmentIndex||0,r=i.properties,l;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),r=r||t.features[e].properties,l=t.features[e].geometry;break;case"Feature":r=r||t.properties,l=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=t;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=c.length+s-1),Ct.lineString([c[s],c[s+1]],r,i);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s-1),Ct.lineString([c[o][s],c[o][s+1]],r,i);case"MultiLineString":return n<0&&(n=c.length+n),s<0&&(s=c[n].length+s-1),Ct.lineString([c[n][s],c[n][s+1]],r,i);case"MultiPolygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),s<0&&(s=c[n][o].length-s-1),Ct.lineString([c[n][o][s],c[n][o][s+1]],r,i)}throw new Error("geojson is invalid")}function QM(t,i){if(i=i||{},!Ct.isObject(i))throw new Error("options is invalid");var e=i.featureIndex||0,n=i.multiFeatureIndex||0,o=i.geometryIndex||0,s=i.coordIndex||0,r=i.properties,l;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),r=r||t.features[e].properties,l=t.features[e].geometry;break;case"Feature":r=r||t.properties,l=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=t;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":return Ct.point(c,r,i);case"MultiPoint":return n<0&&(n=c.length+n),Ct.point(c[n],r,i);case"LineString":return s<0&&(s=c.length+s),Ct.point(c[s],r,i);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s),Ct.point(c[o][s],r,i);case"MultiLineString":return n<0&&(n=c.length+n),s<0&&(s=c[n].length+s),Ct.point(c[n][s],r,i);case"MultiPolygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),s<0&&(s=c[n][o].length-s),Ct.point(c[n][o][s],r,i)}throw new Error("geojson is invalid")}je.coordAll=HM,je.coordEach=ta,je.coordReduce=UM,je.featureEach=v0,je.featureReduce=GM,je.findPoint=QM,je.findSegment=ZM,je.flattenEach=xh,je.flattenReduce=qM,je.geomEach=pf,je.geomReduce=$M,je.lineEach=w0,je.lineReduce=YM,je.propEach=m0,je.propReduce=WM,je.segmentEach=y0,je.segmentReduce=XM;var ff={};const kM=Wm(aM);Object.defineProperty(ff,"__esModule",{value:!0});var KM=kM;function gf(t){var i=[1/0,1/0,-1/0,-1/0];return KM.coordEach(t,function(e){i[0]>e[0]&&(i[0]=e[0]),i[1]>e[1]&&(i[1]=e[1]),i[2]<e[0]&&(i[2]=e[0]),i[3]<e[1]&&(i[3]=e[1])}),i}gf.default=gf,ff.default=gf;var Li=DM,C0=g0,_0=je,qs=ff.default,JM=_0.featureEach;_0.coordEach,C0.polygon;var P0=C0.featureCollection;function b0(t){var i=new Li(t);return i.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:qs(e),Li.prototype.insert.call(this,e)},i.load=function(e){var n=[];return Array.isArray(e)?e.forEach(function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:qs(o),n.push(o)}):JM(e,function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:qs(o),n.push(o)}),Li.prototype.load.call(this,n)},i.remove=function(e,n){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:qs(e),Li.prototype.remove.call(this,e,n)},i.clear=function(){return Li.prototype.clear.call(this)},i.search=function(e){var n=Li.prototype.search.call(this,this.toBBox(e));return P0(n)},i.collides=function(e){return Li.prototype.collides.call(this,this.toBBox(e))},i.all=function(){var e=Li.prototype.all.call(this);return P0(e)},i.toJSON=function(){return Li.prototype.toJSON.call(this)},i.fromJSON=function(e){return Li.prototype.fromJSON.call(this,e)},i.toBBox=function(e){var n;if(e.bbox)n=e.bbox;else if(Array.isArray(e)&&e.length===4)n=e;else if(Array.isArray(e)&&e.length===6)n=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")n=qs(e);else if(e.type==="FeatureCollection")n=qs(e);else throw new Error("invalid geojson");return{minX:n[0],minY:n[1],maxX:n[2],maxY:n[3]}},i}df.exports=b0,df.exports.default=b0;var jM=df.exports;const eI=Ic(jM);function mf(t,i){var e={},n=[];if(t.type==="LineString"&&(t=Zt(t)),i.type==="LineString"&&(i=Zt(i)),t.type==="Feature"&&i.type==="Feature"&&t.geometry!==null&&i.geometry!==null&&t.geometry.type==="LineString"&&i.geometry.type==="LineString"&&t.geometry.coordinates.length===2&&i.geometry.coordinates.length===2){var o=S0(t,i);return o&&n.push(o),Nt(n)}var s=eI();return s.load(f0(i)),Us(f0(t),function(r){Us(s.search(r),function(l){var c=S0(r,l);if(c){var u=Ii(c).join(",");e[u]||(e[u]=!0,n.push(c))}})}),Nt(n)}function S0(t,i){var e=Ii(t),n=Ii(i);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(n.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=e[0][0],s=e[0][1],r=e[1][0],l=e[1][1],c=n[0][0],u=n[0][1],d=n[1][0],p=n[1][1],f=(p-u)*(r-o)-(d-c)*(l-s),g=(d-c)*(s-u)-(p-u)*(o-c),v=(r-o)*(s-u)-(l-s)*(o-c);if(f===0)return null;var y=g/f,w=v/f;if(y>=0&&y<=1&&w>=0&&w<=1){var P=o+y*(r-o),C=s+y*(l-s);return dt([P,C])}return null}function Ah(t,i,e){e===void 0&&(e={});for(var n=Sh(t),o=Ii(i),s=0;s<o.length-1;s++){var r=!1;if(e.ignoreEndVertices&&(s===0&&(r="start"),s===o.length-2&&(r="end"),s===0&&s+1===o.length-1&&(r="both")),tI(o[s],o[s+1],n,r,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function tI(t,i,e,n,o){var s=e[0],r=e[1],l=t[0],c=t[1],u=i[0],d=i[1],p=e[0]-l,f=e[1]-c,g=u-l,v=d-c,y=p*v-f*g;if(o!==null){if(Math.abs(y)>o)return!1}else if(y!==0)return!1;if(n){if(n==="start")return Math.abs(g)>=Math.abs(v)?g>0?l<s&&s<=u:u<=s&&s<l:v>0?c<r&&r<=d:d<=r&&r<c;if(n==="end")return Math.abs(g)>=Math.abs(v)?g>0?l<=s&&s<u:u<s&&s<=l:v>0?c<=r&&r<d:d<r&&r<=c;if(n==="both")return Math.abs(g)>=Math.abs(v)?g>0?l<s&&s<u:u<s&&s<l:v>0?c<r&&r<d:d<r&&r<c}else return Math.abs(g)>=Math.abs(v)?g>0?l<=s&&s<=u:u<=s&&s<=l:v>0?c<=r&&r<=d:d<=r&&r<=c;return!1}function iI(t,i){var e=Di(t),n=Di(i),o=e.type,s=n.type;switch(o){case"Point":switch(s){case"MultiPoint":return nI(e,n);case"LineString":return Ah(e,n,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return bt(e,n,{ignoreBoundary:!0});default:throw new Error("feature2 "+s+" geometry not supported")}case"MultiPoint":switch(s){case"MultiPoint":return oI(e,n);case"LineString":return sI(e,n);case"Polygon":case"MultiPolygon":return rI(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"LineString":return aI(e,n);case"Polygon":case"MultiPolygon":return lI(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Polygon":case"MultiPolygon":return cI(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+o+" geometry not supported")}}function nI(t,i){var e,n=!1;for(e=0;e<i.coordinates.length;e++)if(x0(i.coordinates[e],t.coordinates)){n=!0;break}return n}function oI(t,i){for(var e=0;e<t.coordinates.length;e++){for(var n=!1,o=0;o<i.coordinates.length;o++)x0(t.coordinates[e],i.coordinates[o])&&(n=!0);if(!n)return!1}return!0}function sI(t,i){for(var e=!1,n=0;n<t.coordinates.length;n++){if(!Ah(t.coordinates[n],i))return!1;e||(e=Ah(t.coordinates[n],i,{ignoreEndVertices:!0}))}return e}function rI(t,i){for(var e=!0,n=!1,o=0;o<t.coordinates.length;o++){if(n=bt(t.coordinates[1],i),!n){e=!1;break}n=bt(t.coordinates[1],i,{ignoreBoundary:!0})}return e&&n}function aI(t,i){for(var e=0;e<t.coordinates.length;e++)if(!Ah(t.coordinates[e],i))return!1;return!0}function lI(t,i){var e=zo(i),n=zo(t);if(!E0(e,n))return!1;for(var o=!1,s=0;s<t.coordinates.length-1;s++){if(!bt(t.coordinates[s],i))return!1;if(o||(o=bt(t.coordinates[s],i,{ignoreBoundary:!0})),!o){var r=hI(t.coordinates[s],t.coordinates[s+1]);o=bt(r,i,{ignoreBoundary:!0})}}return o}function cI(t,i){var e=zo(t),n=zo(i);if(!E0(n,e))return!1;for(var o=0;o<t.coordinates[0].length;o++)if(!bt(t.coordinates[0][o],i))return!1;return!0}function E0(t,i){return!(t[0]>i[0]||t[2]<i[2]||t[1]>i[1]||t[3]<i[3])}function x0(t,i){return t[0]===i[0]&&t[1]===i[1]}function hI(t,i){return[(t[0]+i[0])/2,(t[1]+i[1])/2]}function A0(t,i,e){e===void 0&&(e={}),e.mask&&!e.units&&(e.units="kilometers");for(var n=[],o=t[0],s=t[1],r=t[2],l=t[3],c=i/Ri([o,s],[r,s],e),u=c*(r-o),d=i/Ri([o,s],[o,l],e),p=d*(l-s),f=r-o,g=l-s,v=Math.floor(f/u),y=Math.floor(g/p),w=(f-v*u)/2,P=(g-y*p)/2,C=o+w;C<=r;){for(var S=s+P;S<=l;){var x=dt([C,S],e.properties);e.mask?iI(x,e.mask)&&n.push(x):n.push(x),S+=p}C+=u}return Nt(n)}function vf(t,i){i===void 0&&(i={});var e=Di(t);switch(!i.properties&&t.type==="Feature"&&(i.properties=t.properties),e.type){case"Polygon":return uI(e,i);case"MultiPolygon":return dI(e,i);default:throw new Error("invalid poly")}}function uI(t,i){i===void 0&&(i={});var e=Di(t),n=e.coordinates,o=i.properties?i.properties:t.type==="Feature"?t.properties:{};return T0(n,o)}function dI(t,i){i===void 0&&(i={});var e=Di(t),n=e.coordinates,o=i.properties?i.properties:t.type==="Feature"?t.properties:{},s=[];return n.forEach(function(r){s.push(T0(r,o))}),Nt(s)}function T0(t,i){return t.length>1?tf(t,i):oi(t[0],i)}var M0=Object.prototype.toString,I0=function(i){var e=M0.call(i),n=e==="[object Arguments]";return n||(n=e!=="[object Array]"&&i!==null&&typeof i=="object"&&typeof i.length=="number"&&i.length>=0&&M0.call(i.callee)==="[object Function]"),n},yf,D0;function pI(){if(D0)return yf;D0=1;var t;if(!Object.keys){var i=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=I0,o=Object.prototype.propertyIsEnumerable,s=!o.call({toString:null},"toString"),r=o.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(f){var g=f.constructor;return g&&g.prototype===f},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},d=function(){if(typeof window>"u")return!1;for(var f in window)try{if(!u["$"+f]&&i.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{c(window[f])}catch{return!0}}catch{return!0}return!1}(),p=function(f){if(typeof window>"u"||!d)return c(f);try{return c(f)}catch{return!1}};t=function(g){var v=g!==null&&typeof g=="object",y=e.call(g)==="[object Function]",w=n(g),P=v&&e.call(g)==="[object String]",C=[];if(!v&&!y&&!w)throw new TypeError("Object.keys called on a non-object");var S=r&&y;if(P&&g.length>0&&!i.call(g,0))for(var x=0;x<g.length;++x)C.push(String(x));if(w&&g.length>0)for(var A=0;A<g.length;++A)C.push(String(A));else for(var R in g)!(S&&R==="prototype")&&i.call(g,R)&&C.push(String(R));if(s)for(var L=p(g),B=0;B<l.length;++B)!(L&&l[B]==="constructor")&&i.call(g,l[B])&&C.push(l[B]);return C}}return yf=t,yf}var fI=Array.prototype.slice,gI=I0,R0=Object.keys,Th=R0?function(i){return R0(i)}:pI(),F0=Object.keys;Th.shim=function(){if(Object.keys){var i=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);i||(Object.keys=function(n){return gI(n)?F0(fI.call(n)):F0(n)})}else Object.keys=Th;return Object.keys||Th};var z0=Th,L0=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var i={},e=Symbol("test"),n=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;i[e]=o;for(var s in i)return!1;if(typeof Object.keys=="function"&&Object.keys(i).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(i).length!==0)return!1;var r=Object.getOwnPropertySymbols(i);if(r.length!==1||r[0]!==e||!Object.prototype.propertyIsEnumerable.call(i,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(i,e);if(l.value!==o||l.enumerable!==!0)return!1}return!0},mI=L0,wf=function(){return mI()&&!!Symbol.toStringTag},O0=Object,N0=Error,vI=EvalError,yI=RangeError,wI=ReferenceError,B0=SyntaxError,Xs=TypeError,CI=URIError,_I=Math.abs,PI=Math.floor,bI=Math.max,SI=Math.min,EI=Math.pow,xI=Math.round,AI=Number.isNaN||function(i){return i!==i},TI=AI,MI=function(i){return TI(i)||i===0?i:i<0?-1:1},II=Object.getOwnPropertyDescriptor,Mh=II;if(Mh)try{Mh([],"length")}catch{Mh=null}var Ys=Mh,Ih=Object.defineProperty||!1;if(Ih)try{Ih({},"a",{value:1})}catch{Ih=!1}var Dh=Ih,Cf,V0;function DI(){if(V0)return Cf;V0=1;var t=typeof Symbol<"u"&&Symbol,i=L0;return Cf=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:i()},Cf}var U0=typeof Reflect<"u"&&Reflect.getPrototypeOf||null,RI=O0,W0=RI.getPrototypeOf||null,FI="Function.prototype.bind called on incompatible ",zI=Object.prototype.toString,LI=Math.max,OI="[object Function]",G0=function(i,e){for(var n=[],o=0;o<i.length;o+=1)n[o]=i[o];for(var s=0;s<e.length;s+=1)n[s+i.length]=e[s];return n},NI=function(i,e){for(var n=[],o=e,s=0;o<i.length;o+=1,s+=1)n[s]=i[o];return n},BI=function(t,i){for(var e="",n=0;n<t.length;n+=1)e+=t[n],n+1<t.length&&(e+=i);return e},VI=function(i){var e=this;if(typeof e!="function"||zI.apply(e)!==OI)throw new TypeError(FI+e);for(var n=NI(arguments,1),o,s=function(){if(this instanceof o){var d=e.apply(this,G0(n,arguments));return Object(d)===d?d:this}return e.apply(i,G0(n,arguments))},r=LI(0,e.length-n.length),l=[],c=0;c<r;c++)l[c]="$"+c;if(o=Function("binder","return function ("+BI(l,",")+"){ return binder.apply(this,arguments); }")(s),e.prototype){var u=function(){};u.prototype=e.prototype,o.prototype=new u,u.prototype=null}return o},UI=VI,ia=Function.prototype.bind||UI,_f=Function.prototype.call,Pf=Function.prototype.apply,WI=typeof Reflect<"u"&&Reflect&&Reflect.apply,GI=ia,HI=Pf,$I=_f,qI=WI,H0=qI||GI.call($I,HI),XI=ia,YI=Xs,ZI=_f,QI=H0,bf=function(i){if(i.length<1||typeof i[0]!="function")throw new YI("a function is required");return QI(XI,ZI,i)},kI=bf,$0=Ys,q0;try{q0=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var Sf=!!q0&&$0&&$0(Object.prototype,"__proto__"),X0=Object,Y0=X0.getPrototypeOf,KI=Sf&&typeof Sf.get=="function"?kI([Sf.get]):typeof Y0=="function"?function(i){return Y0(i==null?i:X0(i))}:!1,Z0=U0,Q0=W0,k0=KI,K0=Z0?function(i){return Z0(i)}:Q0?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return Q0(i)}:k0?function(i){return k0(i)}:null,JI=Function.prototype.call,jI=Object.prototype.hasOwnProperty,eD=ia,J0=eD.call(JI,jI),ve,tD=O0,iD=N0,nD=vI,oD=yI,sD=wI,Zs=B0,Qs=Xs,rD=CI,aD=_I,lD=PI,cD=bI,hD=SI,uD=EI,dD=xI,pD=MI,j0=Function,Ef=function(t){try{return j0('"use strict"; return ('+t+").constructor;")()}catch{}},na=Ys,fD=Dh,xf=function(){throw new Qs},gD=na?function(){try{return arguments.callee,xf}catch{try{return na(arguments,"callee").get}catch{return xf}}}():xf,ks=DI()(),st=K0,mD=W0,vD=U0,ew=Pf,oa=_f,Ks={},yD=typeof Uint8Array>"u"||!st?ve:st(Uint8Array),Lo={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?ve:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ve:ArrayBuffer,"%ArrayIteratorPrototype%":ks&&st?st([][Symbol.iterator]()):ve,"%AsyncFromSyncIteratorPrototype%":ve,"%AsyncFunction%":Ks,"%AsyncGenerator%":Ks,"%AsyncGeneratorFunction%":Ks,"%AsyncIteratorPrototype%":Ks,"%Atomics%":typeof Atomics>"u"?ve:Atomics,"%BigInt%":typeof BigInt>"u"?ve:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ve:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ve:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ve:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":iD,"%eval%":eval,"%EvalError%":nD,"%Float16Array%":typeof Float16Array>"u"?ve:Float16Array,"%Float32Array%":typeof Float32Array>"u"?ve:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ve:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ve:FinalizationRegistry,"%Function%":j0,"%GeneratorFunction%":Ks,"%Int8Array%":typeof Int8Array>"u"?ve:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ve:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ve:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":ks&&st?st(st([][Symbol.iterator]())):ve,"%JSON%":typeof JSON=="object"?JSON:ve,"%Map%":typeof Map>"u"?ve:Map,"%MapIteratorPrototype%":typeof Map>"u"||!ks||!st?ve:st(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":tD,"%Object.getOwnPropertyDescriptor%":na,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ve:Promise,"%Proxy%":typeof Proxy>"u"?ve:Proxy,"%RangeError%":oD,"%ReferenceError%":sD,"%Reflect%":typeof Reflect>"u"?ve:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ve:Set,"%SetIteratorPrototype%":typeof Set>"u"||!ks||!st?ve:st(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ve:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":ks&&st?st(""[Symbol.iterator]()):ve,"%Symbol%":ks?Symbol:ve,"%SyntaxError%":Zs,"%ThrowTypeError%":gD,"%TypedArray%":yD,"%TypeError%":Qs,"%Uint8Array%":typeof Uint8Array>"u"?ve:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ve:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ve:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ve:Uint32Array,"%URIError%":rD,"%WeakMap%":typeof WeakMap>"u"?ve:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ve:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ve:WeakSet,"%Function.prototype.call%":oa,"%Function.prototype.apply%":ew,"%Object.defineProperty%":fD,"%Object.getPrototypeOf%":mD,"%Math.abs%":aD,"%Math.floor%":lD,"%Math.max%":cD,"%Math.min%":hD,"%Math.pow%":uD,"%Math.round%":dD,"%Math.sign%":pD,"%Reflect.getPrototypeOf%":vD};if(st)try{null.error}catch(t){var wD=st(st(t));Lo["%Error.prototype%"]=wD}var CD=function t(i){var e;if(i==="%AsyncFunction%")e=Ef("async function () {}");else if(i==="%GeneratorFunction%")e=Ef("function* () {}");else if(i==="%AsyncGeneratorFunction%")e=Ef("async function* () {}");else if(i==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(e=n.prototype)}else if(i==="%AsyncIteratorPrototype%"){var o=t("%AsyncGenerator%");o&&st&&(e=st(o.prototype))}return Lo[i]=e,e},tw={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},sa=ia,Rh=J0,_D=sa.call(oa,Array.prototype.concat),PD=sa.call(ew,Array.prototype.splice),iw=sa.call(oa,String.prototype.replace),Fh=sa.call(oa,String.prototype.slice),bD=sa.call(oa,RegExp.prototype.exec),SD=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ED=/\\(\\)?/g,xD=function(i){var e=Fh(i,0,1),n=Fh(i,-1);if(e==="%"&&n!=="%")throw new Zs("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&e!=="%")throw new Zs("invalid intrinsic syntax, expected opening `%`");var o=[];return iw(i,SD,function(s,r,l,c){o[o.length]=l?iw(c,ED,"$1"):r||s}),o},AD=function(i,e){var n=i,o;if(Rh(tw,n)&&(o=tw[n],n="%"+o[0]+"%"),Rh(Lo,n)){var s=Lo[n];if(s===Ks&&(s=CD(n)),typeof s>"u"&&!e)throw new Qs("intrinsic "+i+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:s}}throw new Zs("intrinsic "+i+" does not exist!")},nw=function(i,e){if(typeof i!="string"||i.length===0)throw new Qs("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Qs('"allowMissing" argument must be a boolean');if(bD(/^%?[^%]*%?$/,i)===null)throw new Zs("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=xD(i),o=n.length>0?n[0]:"",s=AD("%"+o+"%",e),r=s.name,l=s.value,c=!1,u=s.alias;u&&(o=u[0],PD(n,_D([0,1],u)));for(var d=1,p=!0;d<n.length;d+=1){var f=n[d],g=Fh(f,0,1),v=Fh(f,-1);if((g==='"'||g==="'"||g==="`"||v==='"'||v==="'"||v==="`")&&g!==v)throw new Zs("property names with quotes must have matching quotes");if((f==="constructor"||!p)&&(c=!0),o+="."+f,r="%"+o+"%",Rh(Lo,r))l=Lo[r];else if(l!=null){if(!(f in l)){if(!e)throw new Qs("base intrinsic for "+i+" exists, but the property is not available.");return}if(na&&d+1>=n.length){var y=na(l,f);p=!!y,p&&"get"in y&&!("originalValue"in y.get)?l=y.get:l=l[f]}else p=Rh(l,f),l=l[f];p&&!c&&(Lo[r]=l)}}return l},ow=nw,sw=bf,TD=sw([ow("%String.prototype.indexOf%")]),Af=function(i,e){var n=ow(i,!!e);return typeof n=="function"&&TD(i,".prototype.")>-1?sw([n]):n},MD=wf(),ID=Af,Tf=ID("Object.prototype.toString"),zh=function(i){return MD&&i&&typeof i=="object"&&Symbol.toStringTag in i?!1:Tf(i)==="[object Arguments]"},rw=function(i){return zh(i)?!0:i!==null&&typeof i=="object"&&"length"in i&&typeof i.length=="number"&&i.length>=0&&Tf(i)!=="[object Array]"&&"callee"in i&&Tf(i.callee)==="[object Function]"},DD=function(){return zh(arguments)}();zh.isLegacyArguments=rw;var RD=DD?zh:rw,aw=Dh,FD=B0,Js=Xs,lw=Ys,Mf=function(i,e,n){if(!i||typeof i!="object"&&typeof i!="function")throw new Js("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new Js("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Js("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Js("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Js("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Js("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,r=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,c=!!lw&&lw(i,e);if(aw)aw(i,e,{configurable:r===null&&c?c.configurable:!r,enumerable:o===null&&c?c.enumerable:!o,value:n,writable:s===null&&c?c.writable:!s});else if(l||!o&&!s&&!r)i[e]=n;else throw new FD("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},If=Dh,cw=function(){return!!If};cw.hasArrayLengthDefineBug=function(){if(!If)return null;try{return If([],"length",{value:1}).length!==1}catch{return!0}};var Df=cw,zD=z0,LD=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",OD=Object.prototype.toString,ND=Array.prototype.concat,hw=Mf,BD=function(t){return typeof t=="function"&&OD.call(t)==="[object Function]"},uw=Df(),VD=function(t,i,e,n){if(i in t){if(n===!0){if(t[i]===e)return}else if(!BD(n)||!n())return}uw?hw(t,i,e,!0):hw(t,i,e)},dw=function(t,i){var e=arguments.length>2?arguments[2]:{},n=zD(i);LD&&(n=ND.call(n,Object.getOwnPropertySymbols(i)));for(var o=0;o<n.length;o+=1)VD(t,n[o],i[n[o]],e[n[o]])};dw.supportsDescriptors=!!uw;var ra=dw,pw={exports:{}},UD=nw,fw=Mf,WD=Df(),gw=Ys,mw=Xs,GD=UD("%Math.floor%"),HD=function(i,e){if(typeof i!="function")throw new mw("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||GD(e)!==e)throw new mw("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],o=!0,s=!0;if("length"in i&&gw){var r=gw(i,"length");r&&!r.configurable&&(o=!1),r&&!r.writable&&(s=!1)}return(o||s||!n)&&(WD?fw(i,"length",e,!0,!0):fw(i,"length",e)),i},$D=ia,qD=Pf,XD=H0,YD=function(){return XD($D,qD,arguments)};(function(t){var i=HD,e=Dh,n=bf,o=YD;t.exports=function(r){var l=n(arguments),c=r.length-(arguments.length-1);return i(l,1+(c>0?c:0),!0)},e?e(t.exports,"apply",{value:o}):t.exports.apply=o})(pw);var vw=pw.exports,yw=function(t){return t!==t},ww=function(i,e){return i===0&&e===0?1/i===1/e:!!(i===e||yw(i)&&yw(e))},ZD=ww,Cw=function(){return typeof Object.is=="function"?Object.is:ZD},QD=Cw,kD=ra,KD=function(){var i=QD();return kD(Object,{is:i},{is:function(){return Object.is!==i}}),i},JD=ra,jD=vw,eR=ww,_w=Cw,tR=KD,Pw=jD(_w(),Object);JD(Pw,{getPolyfill:_w,implementation:eR,shim:tR});var iR=Pw,bw=Af,nR=wf(),oR=J0,sR=Ys,Rf;if(nR){var rR=bw("RegExp.prototype.exec"),Sw={},Ff=function(){throw Sw},Ew={toString:Ff,valueOf:Ff};typeof Symbol.toPrimitive=="symbol"&&(Ew[Symbol.toPrimitive]=Ff),Rf=function(i){if(!i||typeof i!="object")return!1;var e=sR(i,"lastIndex"),n=e&&oR(e,"value");if(!n)return!1;try{rR(i,Ew)}catch(o){return o===Sw}}}else{var aR=bw("Object.prototype.toString"),lR="[object RegExp]";Rf=function(i){return!i||typeof i!="object"&&typeof i!="function"?!1:aR(i)===lR}}var cR=Rf,aa=function(){return typeof(function(){}).name=="string"},la=Object.getOwnPropertyDescriptor;if(la)try{la([],"length")}catch{la=null}aa.functionsHaveConfigurableNames=function(){if(!aa()||!la)return!1;var i=la(function(){},"name");return!!i&&!!i.configurable};var hR=Function.prototype.bind;aa.boundFunctionsHaveNames=function(){return aa()&&typeof hR=="function"&&(function(){}).bind().name!==""};var uR=aa,xw=Mf,dR=Df(),pR=uR.functionsHaveConfigurableNames(),fR=Xs,gR=function(i,e){if(typeof i!="function")throw new fR("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return(!n||pR)&&(dR?xw(i,"name",e,!0,!0):xw(i,"name",e)),i},mR=gR,vR=Xs,yR=Object,Aw=mR(function(){if(this==null||this!==yR(this))throw new vR("RegExp.prototype.flags getter called on non-object");var i="";return this.hasIndices&&(i+="d"),this.global&&(i+="g"),this.ignoreCase&&(i+="i"),this.multiline&&(i+="m"),this.dotAll&&(i+="s"),this.unicode&&(i+="u"),this.unicodeSets&&(i+="v"),this.sticky&&(i+="y"),i},"get flags",!0),wR=Aw,CR=ra.supportsDescriptors,_R=Object.getOwnPropertyDescriptor,Tw=function(){if(CR&&/a/mig.flags==="gim"){var i=_R(RegExp.prototype,"flags");if(i&&typeof i.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",n={};if(Object.defineProperty(n,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(n,"sticky",{get:function(){e+="y"}}),i.get.call(n),e==="dy")return i.get}}return wR},PR=ra.supportsDescriptors,bR=Tw,SR=Ys,ER=Object.defineProperty,xR=N0,Mw=K0,AR=/a/,TR=function(){if(!PR||!Mw)throw new xR("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var i=bR(),e=Mw(AR),n=SR(e,"flags");return(!n||n.get!==i)&&ER(e,"flags",{configurable:!0,enumerable:!1,get:i}),i},MR=ra,IR=vw,DR=Aw,Iw=Tw,RR=TR,Dw=IR(Iw());MR(Dw,{getPolyfill:Iw,implementation:DR,shim:RR});var FR=Dw,Rw=Af,zR=Rw("Date.prototype.getDay"),LR=function(i){try{return zR(i),!0}catch{return!1}},OR=Rw("Object.prototype.toString"),NR="[object Date]",BR=wf(),VR=function(i){return typeof i!="object"||i===null?!1:BR?LR(i):OR(i)===NR},Fw=z0,zw=RD,Lw=iR,Ow=cR,Nw=FR,Bw=VR,Vw=Date.prototype.getTime;function Uw(t,i,e){var n=e||{};return(n.strict?Lw(t,i):t===i)?!0:!t||!i||typeof t!="object"&&typeof i!="object"?n.strict?Lw(t,i):t==i:UR(t,i,n)}function Ww(t){return t==null}function Gw(t){return!(!t||typeof t!="object"||typeof t.length!="number"||typeof t.copy!="function"||typeof t.slice!="function"||t.length>0&&typeof t[0]!="number")}function UR(t,i,e){var n,o;if(typeof t!=typeof i||Ww(t)||Ww(i)||t.prototype!==i.prototype||zw(t)!==zw(i))return!1;var s=Ow(t),r=Ow(i);if(s!==r)return!1;if(s||r)return t.source===i.source&&Nw(t)===Nw(i);if(Bw(t)&&Bw(i))return Vw.call(t)===Vw.call(i);var l=Gw(t),c=Gw(i);if(l!==c)return!1;if(l||c){if(t.length!==i.length)return!1;for(n=0;n<t.length;n++)if(t[n]!==i[n])return!1;return!0}if(typeof t!=typeof i)return!1;try{var u=Fw(t),d=Fw(i)}catch{return!1}if(u.length!==d.length)return!1;for(u.sort(),d.sort(),n=u.length-1;n>=0;n--)if(u[n]!=d[n])return!1;for(n=u.length-1;n>=0;n--)if(o=u[n],!Uw(t[o],i[o],e))return!1;return!0}var WR=Uw;function GR(t,i){var e=!0;return ji(t,function(n){ji(i,function(o){if(e===!1)return!1;e=HR(n.geometry,o.geometry)})}),e}function HR(t,i){switch(t.type){case"Point":switch(i.type){case"Point":return!YR(t.coordinates,i.coordinates);case"LineString":return!Hw(i,t);case"Polygon":return!bt(t,i)}break;case"LineString":switch(i.type){case"Point":return!Hw(t,i);case"LineString":return!$R(t,i);case"Polygon":return!$w(i,t)}break;case"Polygon":switch(i.type){case"Point":return!bt(i,t);case"LineString":return!$w(t,i);case"Polygon":return!qR(i,t)}}return!1}function Hw(t,i){for(var e=0;e<t.coordinates.length-1;e++)if(XR(t.coordinates[e],t.coordinates[e+1],i.coordinates))return!0;return!1}function $R(t,i){var e=mf(t,i);return e.features.length>0}function $w(t,i){for(var e=0,n=i.coordinates;e<n.length;e++){var o=n[e];if(bt(o,t))return!0}var s=mf(i,vf(t));return s.features.length>0}function qR(t,i){for(var e=0,n=t.coordinates[0];e<n.length;e++){var o=n[e];if(bt(o,i))return!0}for(var s=0,r=i.coordinates[0];s<r.length;s++){var l=r[s];if(bt(l,t))return!0}var c=mf(vf(t),vf(i));return c.features.length>0}function XR(t,i,e){var n=e[0]-t[0],o=e[1]-t[1],s=i[0]-t[0],r=i[1]-t[1],l=n*r-o*s;return l!==0?!1:Math.abs(s)>=Math.abs(r)?s>0?t[0]<=e[0]&&e[0]<=i[0]:i[0]<=e[0]&&e[0]<=t[0]:r>0?t[1]<=e[1]&&e[1]<=i[1]:i[1]<=e[1]&&e[1]<=t[1]}function YR(t,i){return t[0]===i[0]&&t[1]===i[1]}var ZR=WR,Oi=function(t){this.precision=t&&t.precision?t.precision:17,this.direction=t&&t.direction?t.direction:!1,this.pseudoNode=t&&t.pseudoNode?t.pseudoNode:!1,this.objectComparator=t&&t.objectComparator?t.objectComparator:QR};Oi.prototype.compare=function(t,i){if(t.type!==i.type||!Xw(t,i))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,i.coordinates);case"LineString":return this.compareLine(t.coordinates,i.coordinates,0,!1);case"Polygon":return this.comparePolygon(t,i);case"Feature":return this.compareFeature(t,i);default:if(t.type.indexOf("Multi")===0){var e=this,n=qw(t),o=qw(i);return n.every(function(s){return this.some(function(r){return e.compare(s,r)})},o)}}return!1};function qw(t){return t.coordinates.map(function(i){return{type:t.type.replace("Multi",""),coordinates:i}})}function Xw(t,i){return t.hasOwnProperty("coordinates")?t.coordinates.length===i.coordinates.length:t.length===i.length}Oi.prototype.compareCoord=function(t,i){if(t.length!==i.length)return!1;for(var e=0;e<t.length;e++)if(t[e].toFixed(this.precision)!==i[e].toFixed(this.precision))return!1;return!0},Oi.prototype.compareLine=function(t,i,e,n){if(!Xw(t,i))return!1;var o=this.pseudoNode?t:this.removePseudo(t),s=this.pseudoNode?i:this.removePseudo(i);if(!(n&&!this.compareCoord(o[0],s[0])&&(s=this.fixStartIndex(s,o),!s))){var r=this.compareCoord(o[e],s[e]);return this.direction||r?this.comparePath(o,s):this.compareCoord(o[e],s[s.length-(1+e)])?this.comparePath(o.slice().reverse(),s):!1}},Oi.prototype.fixStartIndex=function(t,i){for(var e,n=-1,o=0;o<t.length;o++)if(this.compareCoord(t[o],i[0])){n=o;break}return n>=0&&(e=[].concat(t.slice(n,t.length),t.slice(1,n+1))),e},Oi.prototype.comparePath=function(t,i){var e=this;return t.every(function(n,o){return e.compareCoord(n,this[o])},i)},Oi.prototype.comparePolygon=function(t,i){if(this.compareLine(t.coordinates[0],i.coordinates[0],1,!0)){var e=t.coordinates.slice(1,t.coordinates.length),n=i.coordinates.slice(1,i.coordinates.length),o=this;return e.every(function(s){return this.some(function(r){return o.compareLine(s,r,1,!0)})},n)}else return!1},Oi.prototype.compareFeature=function(t,i){return t.id!==i.id||!this.objectComparator(t.properties,i.properties)||!this.compareBBox(t,i)?!1:this.compare(t.geometry,i.geometry)},Oi.prototype.compareBBox=function(t,i){return!!(!t.bbox&&!i.bbox||t.bbox&&i.bbox&&this.compareCoord(t.bbox,i.bbox))},Oi.prototype.removePseudo=function(t){return t};function QR(t,i){return ZR(t,i,{strict:!0})}var kR=Oi;const KR=Ic(kR);function JR(t,i){var e=Di(t).type,n=Di(i).type;if(e!==n)return!1;var o=new KR({precision:6});return o.compare(u0(t),u0(i))}function jR(t,i){var e=!1;return ji(t,function(n){ji(i,function(o){if(e===!0)return!0;e=!GR(n.geometry,o.geometry)})}),e}/**
1858
+ `,Qn=class Qn extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_player");m(this,"_finalImageUrlReact",this.disposeVar(a.ESSceneObject.context.createEnvStrReact([this,"imageUrl"])));m(this,"_routePaths",this.disposeVar(a.react(void 0)));m(this,"routePathCallback");m(this,"_id",this.disposeVar(a.react(a.createGuid())));n&&(this._id.value=n),this._player=this.disposeVar(new a.Player);{const g=Qn.defaults;this.dispose(a.bind([this._player,"loop"],[this,"loop"],v=>v??g.loop,v=>v??g.loop)),this.dispose(a.bind([this._player,"currentTime"],[this,"currentTime"],v=>v??g.currentTime,v=>v??g.currentTime)),this.dispose(a.bind([this._player,"duration"],[this,"duration"],v=>v??g.duration,v=>v??g.duration)),this.dispose(a.bind([this._player,"playing"],[this,"playing"],v=>v??g.playing,v=>v??g.playing)),this.dispose(a.bind([this._player,"speed"],[this,"speed"],v=>v??g.speed,v=>v??g.speed))}const o=this.disposeVar(a.ESSceneObject.context.createEnvStrReact([this,"geoJsonUrl"])),s=this.disposeVar(a.createProcessingFromAsyncFunc(async g=>{this.routePaths=void 0;const v=o.value;if(v)try{const w=await(await fetch(v)).json();this.routePaths=pM(w,this.width,this.repeatLength);return}catch(y){console.error(`geojson加载解析出错!${y}`),console.error(y)}if(this.data){this.routePaths=[...this.data];return}if(this.positionsSet){const y=this.positionsSet;if(y){this.routePaths=y.map(w=>({positions:w,width:this.width}));return}}}));{const g=()=>{s.restart()};g();const v=this.disposeVar(a.createNextAnimateFrameEvent(o.changed,this.positionsSetChanged,this.dataChanged,this.finalImageUrlReact.changed,this.widthChanged,this.repeatLengthChanged,this.arcTypeChanged,this.brighteningChanged,this.depthTestChanged));this.dispose(v.disposableOn(g))}{const g=()=>{const v=Pu(this.routePathCallbackStr,["result","this","instanceIndex","frameState"]);v&&(this.routePathCallback=v)};g(),this.dispose(this.routePathCallbackStrChanged.disposableOn(g))}const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}const l=this.finalImageUrlReact,c=this.disposeVar(new is),u=this.disposeVar(a.createProcessingFromAsyncFunc(async g=>{if(!l.value)return;const v=Im(r.scene.context).getTextureHandler(l.value);if(v instanceof is)c.reset(v);else{const y=await g.promise(v);c.reset(y)}})),d=()=>c.valid?c.raw:r.scene.context.defaultTexture,p=()=>u.restart();p(),this.dispose(l.changed.disposableOn(p));const f=this.ad(a.createNextAnimateFrameEvent(this.routePathsChanged,this.colorChanged,this.bgColorChanged));this.disposeVar(new a.ObjResettingWithEvent(f,()=>this.routePaths?new MM(r,this,l.value&&d||void 0):void 0)),this.dispose(this.flyToEvent.disposableOn(g=>{if(!(!this.routePaths||this.routePaths.length===0)&&this.routePaths.length===1)if(!Object.prototype.hasOwnProperty.call(this.routePaths[0],"positions"))ne(r,this.routePaths[0].startPos,r.camera.positionCartographic.height,void 0,g);else{const v=computeBoundingSphere(this.routePaths[0].positions);if(!v)return;const[y,w]=v;ne(r,y,w*3,void 0,g)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get player(){return this._player}get ratio(){return this._player.ratio}set ratio(e){this._player.ratio=e}get ratioChanged(){return this._player.ratioChanged}get finalImageUrlReact(){return this._finalImageUrlReact}get routePaths(){return this._routePaths.value}set routePaths(e){this._routePaths.value=e}get routePathsChanged(){return this._routePaths.changed}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}};m(Qn,"whiteGradientImageBase64",IM),m(Qn,"defaultRoutePathCallback",function(e,n,o){const s=n/50,r=s-Math.floor(s);return e.color=[r*.5+.5,(1-r)*.5+.5,.5,1],e.bgColor=[r*.5+.5,(1-r)*.5+.5,.5,.3],e}),m(Qn,"routePathCallbackStrMd",DM),m(Qn,"defaults",{loop:!0,startTime:0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),m(Qn,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png");let tn=Qn;(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:a.reactArray([0,1,0,1]),bgColor:a.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positionsSet:a.reactPositionsSet(void 0),data:a.reactJson(void 0),geoJsonUrl:"",allowPicking:!1,routePathCallbackStr:"",loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(tn||(tn={})),a.extendClassProps(tn.prototype,tn.createDefaultProps);class Bn extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_collection");this._collection=this.disposeVar(new tn(e,n)),this.dispose(a.track([this._collection,"show"],[this,"show"])),this.dispose(a.track([this._collection,"startTime"],[this,"startTime"])),this.dispose(a.track([this._collection,"transmissionTime"],[this,"transmissionTime"])),this.dispose(a.track([this._collection,"color"],[this,"color"])),this.dispose(a.track([this._collection,"bgColor"],[this,"bgColor"])),this.dispose(a.track([this._collection,"width"],[this,"width"])),this.dispose(a.track([this._collection,"arcType"],[this,"arcType"])),this.dispose(a.track([this._collection,"brightening"],[this,"brightening"])),this.dispose(a.track([this._collection,"depthTest"],[this,"depthTest"])),this.dispose(a.track([this._collection,"imageUrl"],[this,"imageUrl"])),this.dispose(a.track([this._collection,"repeat"],[this,"repeat"])),this.dispose(a.track([this._collection,"repeatLength"],[this,"repeatLength"])),this.dispose(a.track([this._collection,"bidirectional"],[this,"bidirectional"])),this.dispose(a.track([this._collection,"allowPicking"],[this,"allowPicking"])),this.dispose(a.bind([this._collection,"playing"],[this,"playing"])),this.dispose(a.track([this._collection,"loop"],[this,"loop"])),this.dispose(a.bind([this._collection,"currentTime"],[this,"currentTime"])),this.dispose(a.bind([this._collection,"duration"],[this,"duration"])),this.dispose(a.bind([this._collection,"speed"],[this,"speed"]));{const o=()=>{this.color=[this.bgColor[0],this.bgColor[1],this.bgColor[2],1]};o(),this.ad(this.bgColorChanged.don(o))}this.dispose(this.flyToEvent.disposableOn(o=>{this._collection.flyTo(o)}));{const o=()=>{if(!this.positions){this._collection.data=void 0;return}if(this.heightRatio===0){this._collection.data=[{positions:this.positions,width:this.width}];return}if(this.positions.length>=2){this._collection.data=this.positions.map((r,l)=>{var c;if(!(!this.positions||l==((c=this.positions)==null?void 0:c.length)-1))return{startPos:r,endPos:this.positions[l+1],width:this.width,heightRatio:this.heightRatio}}).filter(r=>r!==void 0);return}this._collection.data=void 0};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.heightRatioChanged,this.widthChanged));this.dispose(s.disposableOn(o))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get collection(){return this._collection}get player(){return this.collection.player}get ratio(){return this.player.ratio}set ratio(e){this.player.ratio=e}get ratioChanged(){return this.player.ratioChanged}}m(Bn,"defaults",{loop:!0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),m(Bn,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png"),(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:a.reactArray([0,1,0,1]),bgColor:a.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positions:a.reactPositions(void 0),heightRatio:0,allowPicking:!1,loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(Bn||(Bn={})),a.extendClassProps(Bn.prototype,Bn.createDefaultProps);const zl=class zl extends yt{constructor(e,n){super(e,n);m(this,"_czmSignalTransmission");if(this._czmSignalTransmission=this.disposeVar(new Bn(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmSignalTransmission;{const r=()=>{s.show=e.show&&e.stroked};r(),this.ad(e.showChanged.don(r)),this.ad(e.strokedChanged.don(r))}this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"width"],[e,"strokeWidth"])),this.dispose(a.track([s,"bgColor"],[e,"strokeColor"])),this.dispose(a.track([s,"startTime"],[e,"startTime"])),this.dispose(a.track([s,"transmissionTime"],[e,"transmissionTime"])),this.dispose(a.track([s,"heightRatio"],[e,"heightRatio"])),this.dispose(a.track([s,"arcType"],[e,"arcType"])),this.dispose(a.track([s,"brightening"],[e,"brightening"])),this.dispose(a.track([s,"depthTest"],[e,"depthTest"])),this.dispose(a.track([s,"imageUrl"],[e,"imageUrl"])),this.dispose(a.track([s,"repeat"],[e,"repeat"])),this.dispose(a.track([s,"bidirectional"],[e,"bidirectional"])),this.dispose(a.track([s,"loop"],[e,"loop"])),this.dispose(a.track([s,"currentTime"],[e,"currentTime"])),this.dispose(a.track([s,"duration"],[e,"duration"])),this.dispose(a.track([s,"playing"],[e,"playing"])),this.dispose(a.track([s,"speed"],[e,"speed"]))}get czmSignalTransmission(){return this._czmSignalTransmission}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmSignalTransmission:r}=this;return s.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmSignalTransmission:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(zl,"type",zl.register("ESCesiumViewer",wh.type,zl));let cf=zl;function zo(t){var i=[1/0,1/0,-1/0,-1/0];return Ro(t,function(e){i[0]>e[0]&&(i[0]=e[0]),i[1]>e[1]&&(i[1]=e[1]),i[2]<e[0]&&(i[2]=e[0]),i[3]<e[1]&&(i[3]=e[1])}),i}zo.default=zo;var r0={exports:{}};(function(t,i){(function(e,n){t.exports=n()})(mo,function(){function e(C,S,x,A,R){(function L(B,V,G,O,N){for(;O>G;){if(O-G>600){var _=O-G+1,E=V-G+1,D=Math.log(_),z=.5*Math.exp(2*D/3),U=.5*Math.sqrt(D*z*(_-z)/_)*(E-_/2<0?-1:1),Y=Math.max(G,Math.floor(V-E*z/_+U)),q=Math.min(O,Math.floor(V+(_-E)*z/_+U));L(B,V,Y,q,N)}var X=B[V],Q=G,j=O;for(n(B,G,V),N(B[O],X)>0&&n(B,G,O);Q<j;){for(n(B,Q,j),Q++,j--;N(B[Q],X)<0;)Q++;for(;N(B[j],X)>0;)j--}N(B[G],X)===0?n(B,G,j):n(B,++j,O),j<=V&&(G=j+1),V<=j&&(O=j-1)}})(C,S,x||0,A||C.length-1,R||o)}function n(C,S,x){var A=C[S];C[S]=C[x],C[x]=A}function o(C,S){return C<S?-1:C>S?1:0}var s=function(C){C===void 0&&(C=9),this._maxEntries=Math.max(4,C),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function r(C,S,x){if(!x)return S.indexOf(C);for(var A=0;A<S.length;A++)if(x(C,S[A]))return A;return-1}function l(C,S){c(C,0,C.children.length,S,C)}function c(C,S,x,A,R){R||(R=w(null)),R.minX=1/0,R.minY=1/0,R.maxX=-1/0,R.maxY=-1/0;for(var L=S;L<x;L++){var B=C.children[L];u(R,C.leaf?A(B):B)}return R}function u(C,S){return C.minX=Math.min(C.minX,S.minX),C.minY=Math.min(C.minY,S.minY),C.maxX=Math.max(C.maxX,S.maxX),C.maxY=Math.max(C.maxY,S.maxY),C}function d(C,S){return C.minX-S.minX}function p(C,S){return C.minY-S.minY}function f(C){return(C.maxX-C.minX)*(C.maxY-C.minY)}function g(C){return C.maxX-C.minX+(C.maxY-C.minY)}function v(C,S){return C.minX<=S.minX&&C.minY<=S.minY&&S.maxX<=C.maxX&&S.maxY<=C.maxY}function y(C,S){return S.minX<=C.maxX&&S.minY<=C.maxY&&S.maxX>=C.minX&&S.maxY>=C.minY}function w(C){return{children:C,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function P(C,S,x,A,R){for(var L=[S,x];L.length;)if(!((x=L.pop())-(S=L.pop())<=A)){var B=S+Math.ceil((x-S)/A/2)*A;e(C,B,S,x,R),L.push(S,B,B,x)}}return s.prototype.all=function(){return this._all(this.data,[])},s.prototype.search=function(C){var S=this.data,x=[];if(!y(C,S))return x;for(var A=this.toBBox,R=[];S;){for(var L=0;L<S.children.length;L++){var B=S.children[L],V=S.leaf?A(B):B;y(C,V)&&(S.leaf?x.push(B):v(C,V)?this._all(B,x):R.push(B))}S=R.pop()}return x},s.prototype.collides=function(C){var S=this.data;if(!y(C,S))return!1;for(var x=[];S;){for(var A=0;A<S.children.length;A++){var R=S.children[A],L=S.leaf?this.toBBox(R):R;if(y(C,L)){if(S.leaf||v(C,L))return!0;x.push(R)}}S=x.pop()}return!1},s.prototype.load=function(C){if(!C||!C.length)return this;if(C.length<this._minEntries){for(var S=0;S<C.length;S++)this.insert(C[S]);return this}var x=this._build(C.slice(),0,C.length-1,0);if(this.data.children.length)if(this.data.height===x.height)this._splitRoot(this.data,x);else{if(this.data.height<x.height){var A=this.data;this.data=x,x=A}this._insert(x,this.data.height-x.height-1,!0)}else this.data=x;return this},s.prototype.insert=function(C){return C&&this._insert(C,this.data.height-1),this},s.prototype.clear=function(){return this.data=w([]),this},s.prototype.remove=function(C,S){if(!C)return this;for(var x,A,R,L=this.data,B=this.toBBox(C),V=[],G=[];L||V.length;){if(L||(L=V.pop(),A=V[V.length-1],x=G.pop(),R=!0),L.leaf){var O=r(C,L.children,S);if(O!==-1)return L.children.splice(O,1),V.push(L),this._condense(V),this}R||L.leaf||!v(L,B)?A?(x++,L=A.children[x],R=!1):L=null:(V.push(L),G.push(x),x=0,A=L,L=L.children[0])}return this},s.prototype.toBBox=function(C){return C},s.prototype.compareMinX=function(C,S){return C.minX-S.minX},s.prototype.compareMinY=function(C,S){return C.minY-S.minY},s.prototype.toJSON=function(){return this.data},s.prototype.fromJSON=function(C){return this.data=C,this},s.prototype._all=function(C,S){for(var x=[];C;)C.leaf?S.push.apply(S,C.children):x.push.apply(x,C.children),C=x.pop();return S},s.prototype._build=function(C,S,x,A){var R,L=x-S+1,B=this._maxEntries;if(L<=B)return l(R=w(C.slice(S,x+1)),this.toBBox),R;A||(A=Math.ceil(Math.log(L)/Math.log(B)),B=Math.ceil(L/Math.pow(B,A-1))),(R=w([])).leaf=!1,R.height=A;var V=Math.ceil(L/B),G=V*Math.ceil(Math.sqrt(B));P(C,S,x,G,this.compareMinX);for(var O=S;O<=x;O+=G){var N=Math.min(O+G-1,x);P(C,O,N,V,this.compareMinY);for(var _=O;_<=N;_+=V){var E=Math.min(_+V-1,N);R.children.push(this._build(C,_,E,A-1))}}return l(R,this.toBBox),R},s.prototype._chooseSubtree=function(C,S,x,A){for(;A.push(S),!S.leaf&&A.length-1!==x;){for(var R=1/0,L=1/0,B=void 0,V=0;V<S.children.length;V++){var G=S.children[V],O=f(G),N=(_=C,E=G,(Math.max(E.maxX,_.maxX)-Math.min(E.minX,_.minX))*(Math.max(E.maxY,_.maxY)-Math.min(E.minY,_.minY))-O);N<L?(L=N,R=O<R?O:R,B=G):N===L&&O<R&&(R=O,B=G)}S=B||S.children[0]}var _,E;return S},s.prototype._insert=function(C,S,x){var A=x?C:this.toBBox(C),R=[],L=this._chooseSubtree(A,this.data,S,R);for(L.children.push(C),u(L,A);S>=0&&R[S].children.length>this._maxEntries;)this._split(R,S),S--;this._adjustParentBBoxes(A,R,S)},s.prototype._split=function(C,S){var x=C[S],A=x.children.length,R=this._minEntries;this._chooseSplitAxis(x,R,A);var L=this._chooseSplitIndex(x,R,A),B=w(x.children.splice(L,x.children.length-L));B.height=x.height,B.leaf=x.leaf,l(x,this.toBBox),l(B,this.toBBox),S?C[S-1].children.push(B):this._splitRoot(x,B)},s.prototype._splitRoot=function(C,S){this.data=w([C,S]),this.data.height=C.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},s.prototype._chooseSplitIndex=function(C,S,x){for(var A,R,L,B,V,G,O,N=1/0,_=1/0,E=S;E<=x-S;E++){var D=c(C,0,E,this.toBBox),z=c(C,E,x,this.toBBox),U=(R=D,L=z,B=void 0,V=void 0,G=void 0,O=void 0,B=Math.max(R.minX,L.minX),V=Math.max(R.minY,L.minY),G=Math.min(R.maxX,L.maxX),O=Math.min(R.maxY,L.maxY),Math.max(0,G-B)*Math.max(0,O-V)),Y=f(D)+f(z);U<N?(N=U,A=E,_=Y<_?Y:_):U===N&&Y<_&&(_=Y,A=E)}return A||x-S},s.prototype._chooseSplitAxis=function(C,S,x){var A=C.leaf?this.compareMinX:d,R=C.leaf?this.compareMinY:p;this._allDistMargin(C,S,x,A)<this._allDistMargin(C,S,x,R)&&C.children.sort(A)},s.prototype._allDistMargin=function(C,S,x,A){C.children.sort(A);for(var R=this.toBBox,L=c(C,0,S,R),B=c(C,x-S,x,R),V=g(L)+g(B),G=S;G<x-S;G++){var O=C.children[G];u(L,C.leaf?R(O):O),V+=g(L)}for(var N=x-S-1;N>=S;N--){var _=C.children[N];u(B,C.leaf?R(_):_),V+=g(B)}return V},s.prototype._adjustParentBBoxes=function(C,S,x){for(var A=x;A>=0;A--)u(S[A],C)},s.prototype._condense=function(C){for(var S=C.length-1,x=void 0;S>=0;S--)C[S].children.length===0?S>0?(x=C[S-1].children).splice(x.indexOf(C[S]),1):this.clear():l(C[S],this.toBBox)},s})})(r0);var RM=r0.exports;function bt(t,i,e){if(e===void 0&&(e={}),!t)throw new Error("point is required");if(!i)throw new Error("polygon is required");var n=Sh(t),o=Di(i),s=o.type,r=i.bbox,l=o.coordinates;if(r&&FM(n,r)===!1)return!1;s==="Polygon"&&(l=[l]);for(var c=!1,u=0;u<l.length&&!c;u++)if(a0(n,l[u][0],e.ignoreBoundary)){for(var d=!1,p=1;p<l[u].length&&!d;)a0(n,l[u][p],!e.ignoreBoundary)&&(d=!0),p++;d||(c=!0)}return c}function a0(t,i,e){var n=!1;i[0][0]===i[i.length-1][0]&&i[0][1]===i[i.length-1][1]&&(i=i.slice(0,i.length-1));for(var o=0,s=i.length-1;o<i.length;s=o++){var r=i[o][0],l=i[o][1],c=i[s][0],u=i[s][1],d=t[1]*(r-c)+l*(c-t[0])+u*(t[0]-r)===0&&(r-t[0])*(c-t[0])<=0&&(l-t[1])*(u-t[1])<=0;if(d)return!e;var p=l>t[1]!=u>t[1]&&t[0]<(c-r)*(t[1]-l)/(u-l)+r;p&&(n=!n)}return n}function FM(t,i){return i[0]<=t[0]&&i[1]<=t[1]&&i[2]>=t[0]&&i[3]>=t[1]}function zM(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return l0(t);case"FeatureCollection":return LM(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return hf(t);default:throw new Error("unknown GeoJSON type")}}function l0(t){var i={type:"Feature"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"properties":case"geometry":return;default:i[e]=t[e]}}),i.properties=c0(t.properties),i.geometry=hf(t.geometry),i}function c0(t){var i={};return t&&Object.keys(t).forEach(function(e){var n=t[e];typeof n=="object"?n===null?i[e]=null:Array.isArray(n)?i[e]=n.map(function(o){return o}):i[e]=c0(n):i[e]=n}),i}function LM(t){var i={type:"FeatureCollection"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"features":return;default:i[e]=t[e]}}),i.features=t.features.map(function(e){return l0(e)}),i}function hf(t){var i={type:t.type};return t.bbox&&(i.bbox=t.bbox),t.type==="GeometryCollection"?(i.geometries=t.geometries.map(function(e){return hf(e)}),i):(i.coordinates=h0(t.coordinates),i)}function h0(t){var i=t;return typeof i[0]!="object"?i.slice():i.map(function(e){return h0(e)})}function u0(t,i){i===void 0&&(i={});var e=typeof i=="object"?i.mutate:i;if(!t)throw new Error("geojson is required");var n=JT(t),o=[];switch(n){case"LineString":o=uf(t);break;case"MultiLineString":case"Polygon":Ii(t).forEach(function(r){o.push(uf(r))});break;case"MultiPolygon":Ii(t).forEach(function(r){var l=[];r.forEach(function(c){l.push(uf(c))}),o.push(l)});break;case"Point":return t;case"MultiPoint":var s={};Ii(t).forEach(function(r){var l=r.join("-");Object.prototype.hasOwnProperty.call(s,l)||(o.push(r),s[l]=!0)});break;default:throw new Error(n+" geometry not supported")}return t.coordinates?e===!0?(t.coordinates=o,t):{type:n,coordinates:o}:e===!0?(t.geometry.coordinates=o,t):Zt({type:n,coordinates:o},t.properties,{bbox:t.bbox,id:t.id})}function uf(t){var i=Ii(t);if(i.length===2&&!d0(i[0],i[1]))return i;var e=[],n=i.length-1,o=e.length;e.push(i[0]);for(var s=1;s<n;s++){var r=e[e.length-1];i[s][0]===r[0]&&i[s][1]===r[1]||(e.push(i[s]),o=e.length,o>2&&p0(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1))}if(e.push(i[i.length-1]),o=e.length,d0(i[0],i[i.length-1])&&o<4)throw new Error("invalid polygon");return p0(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1),e}function d0(t,i){return t[0]===i[0]&&t[1]===i[1]}function p0(t,i,e){var n=e[0],o=e[1],s=t[0],r=t[1],l=i[0],c=i[1],u=n-s,d=o-r,p=l-s,f=c-r,g=u*f-d*p;return g!==0?!1:Math.abs(p)>=Math.abs(f)?p>0?s<=n&&n<=l:l<=n&&n<=s:f>0?r<=o&&o<=c:c<=o&&o<=r}function OM(t,i){i===void 0&&(i={});var e=0,n=0,o=0;return Ro(t,function(s){e+=s[0],n+=s[1],o++},!0),dt([e/o,n/o],i.properties)}function f0(t){if(!t)throw new Error("geojson is required");var i=[];return ji(t,function(e){NM(e,i)}),Nt(i)}function NM(t,i){var e=[],n=t.geometry;if(n!==null){switch(n.type){case"Polygon":e=Ii(n);break;case"LineString":e=[Ii(n)]}e.forEach(function(o){var s=BM(o,t.properties);s.forEach(function(r){r.id=i.length,i.push(r)})})}}function BM(t,i){var e=[];return t.reduce(function(n,o){var s=oi([n,o],i);return s.bbox=VM(n,o),e.push(s),o}),e}function VM(t,i){var e=t[0],n=t[1],o=i[0],s=i[1],r=e<o?e:o,l=n<s?n:s,c=e>o?e:o,u=n>s?n:s;return[r,l,c,u]}var df={exports:{}},g0={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.earthRadius=63710088e-1,t.factors={centimeters:t.earthRadius*100,centimetres:t.earthRadius*100,degrees:t.earthRadius/111325,feet:t.earthRadius*3.28084,inches:t.earthRadius*39.37,kilometers:t.earthRadius/1e3,kilometres:t.earthRadius/1e3,meters:t.earthRadius,metres:t.earthRadius,miles:t.earthRadius/1609.344,millimeters:t.earthRadius*1e3,millimetres:t.earthRadius*1e3,nauticalmiles:t.earthRadius/1852,radians:1,yards:t.earthRadius*1.0936},t.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/t.earthRadius,yards:1.0936133},t.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function i(O,N,_){_===void 0&&(_={});var E={type:"Feature"};return(_.id===0||_.id)&&(E.id=_.id),_.bbox&&(E.bbox=_.bbox),E.properties=N||{},E.geometry=O,E}t.feature=i;function e(O,N,_){switch(O){case"Point":return n(N).geometry;case"LineString":return l(N).geometry;case"Polygon":return s(N).geometry;case"MultiPoint":return p(N).geometry;case"MultiLineString":return d(N).geometry;case"MultiPolygon":return f(N).geometry;default:throw new Error(O+" is invalid")}}t.geometry=e;function n(O,N,_){if(_===void 0&&(_={}),!O)throw new Error("coordinates is required");if(!Array.isArray(O))throw new Error("coordinates must be an Array");if(O.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!L(O[0])||!L(O[1]))throw new Error("coordinates must contain numbers");var E={type:"Point",coordinates:O};return i(E,N,_)}t.point=n;function o(O,N,_){return _===void 0&&(_={}),u(O.map(function(E){return n(E,N)}),_)}t.points=o;function s(O,N,_){_===void 0&&(_={});for(var E=0,D=O;E<D.length;E++){var z=D[E];if(z.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var U=0;U<z[z.length-1].length;U++)if(z[z.length-1][U]!==z[0][U])throw new Error("First and last Position are not equivalent.")}var Y={type:"Polygon",coordinates:O};return i(Y,N,_)}t.polygon=s;function r(O,N,_){return _===void 0&&(_={}),u(O.map(function(E){return s(E,N)}),_)}t.polygons=r;function l(O,N,_){if(_===void 0&&(_={}),O.length<2)throw new Error("coordinates must be an array of two or more positions");var E={type:"LineString",coordinates:O};return i(E,N,_)}t.lineString=l;function c(O,N,_){return _===void 0&&(_={}),u(O.map(function(E){return l(E,N)}),_)}t.lineStrings=c;function u(O,N){N===void 0&&(N={});var _={type:"FeatureCollection"};return N.id&&(_.id=N.id),N.bbox&&(_.bbox=N.bbox),_.features=O,_}t.featureCollection=u;function d(O,N,_){_===void 0&&(_={});var E={type:"MultiLineString",coordinates:O};return i(E,N,_)}t.multiLineString=d;function p(O,N,_){_===void 0&&(_={});var E={type:"MultiPoint",coordinates:O};return i(E,N,_)}t.multiPoint=p;function f(O,N,_){_===void 0&&(_={});var E={type:"MultiPolygon",coordinates:O};return i(E,N,_)}t.multiPolygon=f;function g(O,N,_){_===void 0&&(_={});var E={type:"GeometryCollection",geometries:O};return i(E,N,_)}t.geometryCollection=g;function v(O,N){if(N===void 0&&(N=0),N&&!(N>=0))throw new Error("precision must be a positive number");var _=Math.pow(10,N||0);return Math.round(O*_)/_}t.round=v;function y(O,N){N===void 0&&(N="kilometers");var _=t.factors[N];if(!_)throw new Error(N+" units is invalid");return O*_}t.radiansToLength=y;function w(O,N){N===void 0&&(N="kilometers");var _=t.factors[N];if(!_)throw new Error(N+" units is invalid");return O/_}t.lengthToRadians=w;function P(O,N){return S(w(O,N))}t.lengthToDegrees=P;function C(O){var N=O%360;return N<0&&(N+=360),N}t.bearingToAzimuth=C;function S(O){var N=O%(2*Math.PI);return N*180/Math.PI}t.radiansToDegrees=S;function x(O){var N=O%360;return N*Math.PI/180}t.degreesToRadians=x;function A(O,N,_){if(N===void 0&&(N="kilometers"),_===void 0&&(_="kilometers"),!(O>=0))throw new Error("length must be a positive number");return y(w(O,N),_)}t.convertLength=A;function R(O,N,_){if(N===void 0&&(N="meters"),_===void 0&&(_="kilometers"),!(O>=0))throw new Error("area must be a positive number");var E=t.areaFactors[N];if(!E)throw new Error("invalid original units");var D=t.areaFactors[_];if(!D)throw new Error("invalid final units");return O/E*D}t.convertArea=R;function L(O){return!isNaN(O)&&O!==null&&!Array.isArray(O)}t.isNumber=L;function B(O){return!!O&&O.constructor===Object}t.isObject=B;function V(O){if(!O)throw new Error("bbox is required");if(!Array.isArray(O))throw new Error("bbox must be an Array");if(O.length!==4&&O.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");O.forEach(function(N){if(!L(N))throw new Error("bbox must only contain numbers")})}t.validateBBox=V;function G(O){if(!O)throw new Error("id is required");if(["string","number"].indexOf(typeof O)===-1)throw new Error("id must be a number or a string")}t.validateId=G})(g0);var je={};const UM=Wm(kT);Object.defineProperty(je,"__esModule",{value:!0});var Ct=UM;function ta(t,i,e){if(t!==null)for(var n,o,s,r,l,c,u,d=0,p=0,f,g=t.type,v=g==="FeatureCollection",y=g==="Feature",w=v?t.features.length:1,P=0;P<w;P++){u=v?t.features[P].geometry:y?t.geometry:t,f=u?u.type==="GeometryCollection":!1,l=f?u.geometries.length:1;for(var C=0;C<l;C++){var S=0,x=0;if(r=f?u.geometries[C]:u,r!==null){c=r.coordinates;var A=r.type;switch(d=e&&(A==="Polygon"||A==="MultiPolygon")?1:0,A){case null:break;case"Point":if(i(c,p,P,S,x)===!1)return!1;p++,S++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(i(c[n],p,P,S,x)===!1)return!1;p++,A==="MultiPoint"&&S++}A==="LineString"&&S++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(o=0;o<c[n].length-d;o++){if(i(c[n][o],p,P,S,x)===!1)return!1;p++}A==="MultiLineString"&&S++,A==="Polygon"&&x++}A==="Polygon"&&S++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(x=0,o=0;o<c[n].length;o++){for(s=0;s<c[n][o].length-d;s++){if(i(c[n][o][s],p,P,S,x)===!1)return!1;p++}x++}S++}break;case"GeometryCollection":for(n=0;n<r.geometries.length;n++)if(ta(r.geometries[n],i,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function WM(t,i,e,n){var o=e;return ta(t,function(s,r,l,c,u){r===0&&e===void 0?o=s:o=i(o,s,r,l,c,u)},n),o}function m0(t,i){var e;switch(t.type){case"FeatureCollection":for(e=0;e<t.features.length&&i(t.features[e].properties,e)!==!1;e++);break;case"Feature":i(t.properties,0);break}}function GM(t,i,e){var n=e;return m0(t,function(o,s){s===0&&e===void 0?n=o:n=i(n,o,s)}),n}function v0(t,i){if(t.type==="Feature")i(t,0);else if(t.type==="FeatureCollection")for(var e=0;e<t.features.length&&i(t.features[e],e)!==!1;e++);}function HM(t,i,e){var n=e;return v0(t,function(o,s){s===0&&e===void 0?n=o:n=i(n,o,s)}),n}function $M(t){var i=[];return ta(t,function(e){i.push(e)}),i}function pf(t,i){var e,n,o,s,r,l,c,u,d,p,f=0,g=t.type==="FeatureCollection",v=t.type==="Feature",y=g?t.features.length:1;for(e=0;e<y;e++){for(l=g?t.features[e].geometry:v?t.geometry:t,u=g?t.features[e].properties:v?t.properties:{},d=g?t.features[e].bbox:v?t.bbox:void 0,p=g?t.features[e].id:v?t.id:void 0,c=l?l.type==="GeometryCollection":!1,r=c?l.geometries.length:1,o=0;o<r;o++){if(s=c?l.geometries[o]:l,s===null){if(i(null,f,u,d,p)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(i(s,f,u,d,p)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<s.geometries.length;n++)if(i(s.geometries[n],f,u,d,p)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function qM(t,i,e){var n=e;return pf(t,function(o,s,r,l,c){s===0&&e===void 0?n=o:n=i(n,o,s,r,l,c)}),n}function xh(t,i){pf(t,function(e,n,o,s,r){var l=e===null?null:e.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return i(Ct.feature(e,o,{bbox:s,id:r}),n,0)===!1?!1:void 0}var c;switch(l){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var d=e.coordinates[u],p={type:c,coordinates:d};if(i(Ct.feature(p,o),n,u)===!1)return!1}})}function XM(t,i,e){var n=e;return xh(t,function(o,s,r){s===0&&r===0&&e===void 0?n=o:n=i(n,o,s,r)}),n}function y0(t,i){xh(t,function(e,n,o){var s=0;if(e.geometry){var r=e.geometry.type;if(!(r==="Point"||r==="MultiPoint")){var l,c=0,u=0,d=0;if(ta(e,function(p,f,g,v,y){if(l===void 0||n>c||v>u||y>d){l=p,c=n,u=v,d=y,s=0;return}var w=Ct.lineString([l,p],e.properties);if(i(w,n,o,y,s)===!1)return!1;s++,l=p})===!1)return!1}}})}function YM(t,i,e){var n=e,o=!1;return y0(t,function(s,r,l,c,u){o===!1&&e===void 0?n=s:n=i(n,s,r,l,c,u),o=!0}),n}function w0(t,i){if(!t)throw new Error("geojson is required");xh(t,function(e,n,o){if(e.geometry!==null){var s=e.geometry.type,r=e.geometry.coordinates;switch(s){case"LineString":if(i(e,n,o,0,0)===!1)return!1;break;case"Polygon":for(var l=0;l<r.length;l++)if(i(Ct.lineString(r[l],e.properties),n,o,l)===!1)return!1;break}}})}function ZM(t,i,e){var n=e;return w0(t,function(o,s,r,l){s===0&&e===void 0?n=o:n=i(n,o,s,r,l)}),n}function QM(t,i){if(i=i||{},!Ct.isObject(i))throw new Error("options is invalid");var e=i.featureIndex||0,n=i.multiFeatureIndex||0,o=i.geometryIndex||0,s=i.segmentIndex||0,r=i.properties,l;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),r=r||t.features[e].properties,l=t.features[e].geometry;break;case"Feature":r=r||t.properties,l=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=t;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=c.length+s-1),Ct.lineString([c[s],c[s+1]],r,i);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s-1),Ct.lineString([c[o][s],c[o][s+1]],r,i);case"MultiLineString":return n<0&&(n=c.length+n),s<0&&(s=c[n].length+s-1),Ct.lineString([c[n][s],c[n][s+1]],r,i);case"MultiPolygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),s<0&&(s=c[n][o].length-s-1),Ct.lineString([c[n][o][s],c[n][o][s+1]],r,i)}throw new Error("geojson is invalid")}function kM(t,i){if(i=i||{},!Ct.isObject(i))throw new Error("options is invalid");var e=i.featureIndex||0,n=i.multiFeatureIndex||0,o=i.geometryIndex||0,s=i.coordIndex||0,r=i.properties,l;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),r=r||t.features[e].properties,l=t.features[e].geometry;break;case"Feature":r=r||t.properties,l=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=t;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":return Ct.point(c,r,i);case"MultiPoint":return n<0&&(n=c.length+n),Ct.point(c[n],r,i);case"LineString":return s<0&&(s=c.length+s),Ct.point(c[s],r,i);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s),Ct.point(c[o][s],r,i);case"MultiLineString":return n<0&&(n=c.length+n),s<0&&(s=c[n].length+s),Ct.point(c[n][s],r,i);case"MultiPolygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),s<0&&(s=c[n][o].length-s),Ct.point(c[n][o][s],r,i)}throw new Error("geojson is invalid")}je.coordAll=$M,je.coordEach=ta,je.coordReduce=WM,je.featureEach=v0,je.featureReduce=HM,je.findPoint=kM,je.findSegment=QM,je.flattenEach=xh,je.flattenReduce=XM,je.geomEach=pf,je.geomReduce=qM,je.lineEach=w0,je.lineReduce=ZM,je.propEach=m0,je.propReduce=GM,je.segmentEach=y0,je.segmentReduce=YM;var ff={};const KM=Wm(lM);Object.defineProperty(ff,"__esModule",{value:!0});var JM=KM;function gf(t){var i=[1/0,1/0,-1/0,-1/0];return JM.coordEach(t,function(e){i[0]>e[0]&&(i[0]=e[0]),i[1]>e[1]&&(i[1]=e[1]),i[2]<e[0]&&(i[2]=e[0]),i[3]<e[1]&&(i[3]=e[1])}),i}gf.default=gf,ff.default=gf;var Li=RM,C0=g0,_0=je,qs=ff.default,jM=_0.featureEach;_0.coordEach,C0.polygon;var P0=C0.featureCollection;function b0(t){var i=new Li(t);return i.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:qs(e),Li.prototype.insert.call(this,e)},i.load=function(e){var n=[];return Array.isArray(e)?e.forEach(function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:qs(o),n.push(o)}):jM(e,function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:qs(o),n.push(o)}),Li.prototype.load.call(this,n)},i.remove=function(e,n){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:qs(e),Li.prototype.remove.call(this,e,n)},i.clear=function(){return Li.prototype.clear.call(this)},i.search=function(e){var n=Li.prototype.search.call(this,this.toBBox(e));return P0(n)},i.collides=function(e){return Li.prototype.collides.call(this,this.toBBox(e))},i.all=function(){var e=Li.prototype.all.call(this);return P0(e)},i.toJSON=function(){return Li.prototype.toJSON.call(this)},i.fromJSON=function(e){return Li.prototype.fromJSON.call(this,e)},i.toBBox=function(e){var n;if(e.bbox)n=e.bbox;else if(Array.isArray(e)&&e.length===4)n=e;else if(Array.isArray(e)&&e.length===6)n=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")n=qs(e);else if(e.type==="FeatureCollection")n=qs(e);else throw new Error("invalid geojson");return{minX:n[0],minY:n[1],maxX:n[2],maxY:n[3]}},i}df.exports=b0,df.exports.default=b0;var eI=df.exports;const tI=Ic(eI);function mf(t,i){var e={},n=[];if(t.type==="LineString"&&(t=Zt(t)),i.type==="LineString"&&(i=Zt(i)),t.type==="Feature"&&i.type==="Feature"&&t.geometry!==null&&i.geometry!==null&&t.geometry.type==="LineString"&&i.geometry.type==="LineString"&&t.geometry.coordinates.length===2&&i.geometry.coordinates.length===2){var o=S0(t,i);return o&&n.push(o),Nt(n)}var s=tI();return s.load(f0(i)),Us(f0(t),function(r){Us(s.search(r),function(l){var c=S0(r,l);if(c){var u=Ii(c).join(",");e[u]||(e[u]=!0,n.push(c))}})}),Nt(n)}function S0(t,i){var e=Ii(t),n=Ii(i);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(n.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=e[0][0],s=e[0][1],r=e[1][0],l=e[1][1],c=n[0][0],u=n[0][1],d=n[1][0],p=n[1][1],f=(p-u)*(r-o)-(d-c)*(l-s),g=(d-c)*(s-u)-(p-u)*(o-c),v=(r-o)*(s-u)-(l-s)*(o-c);if(f===0)return null;var y=g/f,w=v/f;if(y>=0&&y<=1&&w>=0&&w<=1){var P=o+y*(r-o),C=s+y*(l-s);return dt([P,C])}return null}function Ah(t,i,e){e===void 0&&(e={});for(var n=Sh(t),o=Ii(i),s=0;s<o.length-1;s++){var r=!1;if(e.ignoreEndVertices&&(s===0&&(r="start"),s===o.length-2&&(r="end"),s===0&&s+1===o.length-1&&(r="both")),iI(o[s],o[s+1],n,r,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function iI(t,i,e,n,o){var s=e[0],r=e[1],l=t[0],c=t[1],u=i[0],d=i[1],p=e[0]-l,f=e[1]-c,g=u-l,v=d-c,y=p*v-f*g;if(o!==null){if(Math.abs(y)>o)return!1}else if(y!==0)return!1;if(n){if(n==="start")return Math.abs(g)>=Math.abs(v)?g>0?l<s&&s<=u:u<=s&&s<l:v>0?c<r&&r<=d:d<=r&&r<c;if(n==="end")return Math.abs(g)>=Math.abs(v)?g>0?l<=s&&s<u:u<s&&s<=l:v>0?c<=r&&r<d:d<r&&r<=c;if(n==="both")return Math.abs(g)>=Math.abs(v)?g>0?l<s&&s<u:u<s&&s<l:v>0?c<r&&r<d:d<r&&r<c}else return Math.abs(g)>=Math.abs(v)?g>0?l<=s&&s<=u:u<=s&&s<=l:v>0?c<=r&&r<=d:d<=r&&r<=c;return!1}function nI(t,i){var e=Di(t),n=Di(i),o=e.type,s=n.type;switch(o){case"Point":switch(s){case"MultiPoint":return oI(e,n);case"LineString":return Ah(e,n,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return bt(e,n,{ignoreBoundary:!0});default:throw new Error("feature2 "+s+" geometry not supported")}case"MultiPoint":switch(s){case"MultiPoint":return sI(e,n);case"LineString":return rI(e,n);case"Polygon":case"MultiPolygon":return aI(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"LineString":return lI(e,n);case"Polygon":case"MultiPolygon":return cI(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Polygon":case"MultiPolygon":return hI(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+o+" geometry not supported")}}function oI(t,i){var e,n=!1;for(e=0;e<i.coordinates.length;e++)if(x0(i.coordinates[e],t.coordinates)){n=!0;break}return n}function sI(t,i){for(var e=0;e<t.coordinates.length;e++){for(var n=!1,o=0;o<i.coordinates.length;o++)x0(t.coordinates[e],i.coordinates[o])&&(n=!0);if(!n)return!1}return!0}function rI(t,i){for(var e=!1,n=0;n<t.coordinates.length;n++){if(!Ah(t.coordinates[n],i))return!1;e||(e=Ah(t.coordinates[n],i,{ignoreEndVertices:!0}))}return e}function aI(t,i){for(var e=!0,n=!1,o=0;o<t.coordinates.length;o++){if(n=bt(t.coordinates[1],i),!n){e=!1;break}n=bt(t.coordinates[1],i,{ignoreBoundary:!0})}return e&&n}function lI(t,i){for(var e=0;e<t.coordinates.length;e++)if(!Ah(t.coordinates[e],i))return!1;return!0}function cI(t,i){var e=zo(i),n=zo(t);if(!E0(e,n))return!1;for(var o=!1,s=0;s<t.coordinates.length-1;s++){if(!bt(t.coordinates[s],i))return!1;if(o||(o=bt(t.coordinates[s],i,{ignoreBoundary:!0})),!o){var r=uI(t.coordinates[s],t.coordinates[s+1]);o=bt(r,i,{ignoreBoundary:!0})}}return o}function hI(t,i){var e=zo(t),n=zo(i);if(!E0(n,e))return!1;for(var o=0;o<t.coordinates[0].length;o++)if(!bt(t.coordinates[0][o],i))return!1;return!0}function E0(t,i){return!(t[0]>i[0]||t[2]<i[2]||t[1]>i[1]||t[3]<i[3])}function x0(t,i){return t[0]===i[0]&&t[1]===i[1]}function uI(t,i){return[(t[0]+i[0])/2,(t[1]+i[1])/2]}function A0(t,i,e){e===void 0&&(e={}),e.mask&&!e.units&&(e.units="kilometers");for(var n=[],o=t[0],s=t[1],r=t[2],l=t[3],c=i/Ri([o,s],[r,s],e),u=c*(r-o),d=i/Ri([o,s],[o,l],e),p=d*(l-s),f=r-o,g=l-s,v=Math.floor(f/u),y=Math.floor(g/p),w=(f-v*u)/2,P=(g-y*p)/2,C=o+w;C<=r;){for(var S=s+P;S<=l;){var x=dt([C,S],e.properties);e.mask?nI(x,e.mask)&&n.push(x):n.push(x),S+=p}C+=u}return Nt(n)}function vf(t,i){i===void 0&&(i={});var e=Di(t);switch(!i.properties&&t.type==="Feature"&&(i.properties=t.properties),e.type){case"Polygon":return dI(e,i);case"MultiPolygon":return pI(e,i);default:throw new Error("invalid poly")}}function dI(t,i){i===void 0&&(i={});var e=Di(t),n=e.coordinates,o=i.properties?i.properties:t.type==="Feature"?t.properties:{};return T0(n,o)}function pI(t,i){i===void 0&&(i={});var e=Di(t),n=e.coordinates,o=i.properties?i.properties:t.type==="Feature"?t.properties:{},s=[];return n.forEach(function(r){s.push(T0(r,o))}),Nt(s)}function T0(t,i){return t.length>1?tf(t,i):oi(t[0],i)}var M0=Object.prototype.toString,I0=function(i){var e=M0.call(i),n=e==="[object Arguments]";return n||(n=e!=="[object Array]"&&i!==null&&typeof i=="object"&&typeof i.length=="number"&&i.length>=0&&M0.call(i.callee)==="[object Function]"),n},yf,D0;function fI(){if(D0)return yf;D0=1;var t;if(!Object.keys){var i=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=I0,o=Object.prototype.propertyIsEnumerable,s=!o.call({toString:null},"toString"),r=o.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(f){var g=f.constructor;return g&&g.prototype===f},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},d=function(){if(typeof window>"u")return!1;for(var f in window)try{if(!u["$"+f]&&i.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{c(window[f])}catch{return!0}}catch{return!0}return!1}(),p=function(f){if(typeof window>"u"||!d)return c(f);try{return c(f)}catch{return!1}};t=function(g){var v=g!==null&&typeof g=="object",y=e.call(g)==="[object Function]",w=n(g),P=v&&e.call(g)==="[object String]",C=[];if(!v&&!y&&!w)throw new TypeError("Object.keys called on a non-object");var S=r&&y;if(P&&g.length>0&&!i.call(g,0))for(var x=0;x<g.length;++x)C.push(String(x));if(w&&g.length>0)for(var A=0;A<g.length;++A)C.push(String(A));else for(var R in g)!(S&&R==="prototype")&&i.call(g,R)&&C.push(String(R));if(s)for(var L=p(g),B=0;B<l.length;++B)!(L&&l[B]==="constructor")&&i.call(g,l[B])&&C.push(l[B]);return C}}return yf=t,yf}var gI=Array.prototype.slice,mI=I0,R0=Object.keys,Th=R0?function(i){return R0(i)}:fI(),F0=Object.keys;Th.shim=function(){if(Object.keys){var i=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);i||(Object.keys=function(n){return mI(n)?F0(gI.call(n)):F0(n)})}else Object.keys=Th;return Object.keys||Th};var z0=Th,L0=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var i={},e=Symbol("test"),n=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;i[e]=o;for(var s in i)return!1;if(typeof Object.keys=="function"&&Object.keys(i).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(i).length!==0)return!1;var r=Object.getOwnPropertySymbols(i);if(r.length!==1||r[0]!==e||!Object.prototype.propertyIsEnumerable.call(i,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(i,e);if(l.value!==o||l.enumerable!==!0)return!1}return!0},vI=L0,wf=function(){return vI()&&!!Symbol.toStringTag},O0=Object,N0=Error,yI=EvalError,wI=RangeError,CI=ReferenceError,B0=SyntaxError,Xs=TypeError,_I=URIError,PI=Math.abs,bI=Math.floor,SI=Math.max,EI=Math.min,xI=Math.pow,AI=Math.round,TI=Number.isNaN||function(i){return i!==i},MI=TI,II=function(i){return MI(i)||i===0?i:i<0?-1:1},DI=Object.getOwnPropertyDescriptor,Mh=DI;if(Mh)try{Mh([],"length")}catch{Mh=null}var Ys=Mh,Ih=Object.defineProperty||!1;if(Ih)try{Ih({},"a",{value:1})}catch{Ih=!1}var Dh=Ih,Cf,V0;function RI(){if(V0)return Cf;V0=1;var t=typeof Symbol<"u"&&Symbol,i=L0;return Cf=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:i()},Cf}var U0=typeof Reflect<"u"&&Reflect.getPrototypeOf||null,FI=O0,W0=FI.getPrototypeOf||null,zI="Function.prototype.bind called on incompatible ",LI=Object.prototype.toString,OI=Math.max,NI="[object Function]",G0=function(i,e){for(var n=[],o=0;o<i.length;o+=1)n[o]=i[o];for(var s=0;s<e.length;s+=1)n[s+i.length]=e[s];return n},BI=function(i,e){for(var n=[],o=e,s=0;o<i.length;o+=1,s+=1)n[s]=i[o];return n},VI=function(t,i){for(var e="",n=0;n<t.length;n+=1)e+=t[n],n+1<t.length&&(e+=i);return e},UI=function(i){var e=this;if(typeof e!="function"||LI.apply(e)!==NI)throw new TypeError(zI+e);for(var n=BI(arguments,1),o,s=function(){if(this instanceof o){var d=e.apply(this,G0(n,arguments));return Object(d)===d?d:this}return e.apply(i,G0(n,arguments))},r=OI(0,e.length-n.length),l=[],c=0;c<r;c++)l[c]="$"+c;if(o=Function("binder","return function ("+VI(l,",")+"){ return binder.apply(this,arguments); }")(s),e.prototype){var u=function(){};u.prototype=e.prototype,o.prototype=new u,u.prototype=null}return o},WI=UI,ia=Function.prototype.bind||WI,_f=Function.prototype.call,Pf=Function.prototype.apply,GI=typeof Reflect<"u"&&Reflect&&Reflect.apply,HI=ia,$I=Pf,qI=_f,XI=GI,H0=XI||HI.call(qI,$I),YI=ia,ZI=Xs,QI=_f,kI=H0,bf=function(i){if(i.length<1||typeof i[0]!="function")throw new ZI("a function is required");return kI(YI,QI,i)},KI=bf,$0=Ys,q0;try{q0=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var Sf=!!q0&&$0&&$0(Object.prototype,"__proto__"),X0=Object,Y0=X0.getPrototypeOf,JI=Sf&&typeof Sf.get=="function"?KI([Sf.get]):typeof Y0=="function"?function(i){return Y0(i==null?i:X0(i))}:!1,Z0=U0,Q0=W0,k0=JI,K0=Z0?function(i){return Z0(i)}:Q0?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return Q0(i)}:k0?function(i){return k0(i)}:null,jI=Function.prototype.call,eD=Object.prototype.hasOwnProperty,tD=ia,J0=tD.call(jI,eD),ve,iD=O0,nD=N0,oD=yI,sD=wI,rD=CI,Zs=B0,Qs=Xs,aD=_I,lD=PI,cD=bI,hD=SI,uD=EI,dD=xI,pD=AI,fD=II,j0=Function,Ef=function(t){try{return j0('"use strict"; return ('+t+").constructor;")()}catch{}},na=Ys,gD=Dh,xf=function(){throw new Qs},mD=na?function(){try{return arguments.callee,xf}catch{try{return na(arguments,"callee").get}catch{return xf}}}():xf,ks=RI()(),st=K0,vD=W0,yD=U0,ew=Pf,oa=_f,Ks={},wD=typeof Uint8Array>"u"||!st?ve:st(Uint8Array),Lo={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?ve:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ve:ArrayBuffer,"%ArrayIteratorPrototype%":ks&&st?st([][Symbol.iterator]()):ve,"%AsyncFromSyncIteratorPrototype%":ve,"%AsyncFunction%":Ks,"%AsyncGenerator%":Ks,"%AsyncGeneratorFunction%":Ks,"%AsyncIteratorPrototype%":Ks,"%Atomics%":typeof Atomics>"u"?ve:Atomics,"%BigInt%":typeof BigInt>"u"?ve:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ve:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ve:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ve:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":nD,"%eval%":eval,"%EvalError%":oD,"%Float16Array%":typeof Float16Array>"u"?ve:Float16Array,"%Float32Array%":typeof Float32Array>"u"?ve:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ve:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ve:FinalizationRegistry,"%Function%":j0,"%GeneratorFunction%":Ks,"%Int8Array%":typeof Int8Array>"u"?ve:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ve:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ve:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":ks&&st?st(st([][Symbol.iterator]())):ve,"%JSON%":typeof JSON=="object"?JSON:ve,"%Map%":typeof Map>"u"?ve:Map,"%MapIteratorPrototype%":typeof Map>"u"||!ks||!st?ve:st(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":iD,"%Object.getOwnPropertyDescriptor%":na,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ve:Promise,"%Proxy%":typeof Proxy>"u"?ve:Proxy,"%RangeError%":sD,"%ReferenceError%":rD,"%Reflect%":typeof Reflect>"u"?ve:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ve:Set,"%SetIteratorPrototype%":typeof Set>"u"||!ks||!st?ve:st(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ve:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":ks&&st?st(""[Symbol.iterator]()):ve,"%Symbol%":ks?Symbol:ve,"%SyntaxError%":Zs,"%ThrowTypeError%":mD,"%TypedArray%":wD,"%TypeError%":Qs,"%Uint8Array%":typeof Uint8Array>"u"?ve:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ve:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ve:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ve:Uint32Array,"%URIError%":aD,"%WeakMap%":typeof WeakMap>"u"?ve:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ve:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ve:WeakSet,"%Function.prototype.call%":oa,"%Function.prototype.apply%":ew,"%Object.defineProperty%":gD,"%Object.getPrototypeOf%":vD,"%Math.abs%":lD,"%Math.floor%":cD,"%Math.max%":hD,"%Math.min%":uD,"%Math.pow%":dD,"%Math.round%":pD,"%Math.sign%":fD,"%Reflect.getPrototypeOf%":yD};if(st)try{null.error}catch(t){var CD=st(st(t));Lo["%Error.prototype%"]=CD}var _D=function t(i){var e;if(i==="%AsyncFunction%")e=Ef("async function () {}");else if(i==="%GeneratorFunction%")e=Ef("function* () {}");else if(i==="%AsyncGeneratorFunction%")e=Ef("async function* () {}");else if(i==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(e=n.prototype)}else if(i==="%AsyncIteratorPrototype%"){var o=t("%AsyncGenerator%");o&&st&&(e=st(o.prototype))}return Lo[i]=e,e},tw={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},sa=ia,Rh=J0,PD=sa.call(oa,Array.prototype.concat),bD=sa.call(ew,Array.prototype.splice),iw=sa.call(oa,String.prototype.replace),Fh=sa.call(oa,String.prototype.slice),SD=sa.call(oa,RegExp.prototype.exec),ED=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,xD=/\\(\\)?/g,AD=function(i){var e=Fh(i,0,1),n=Fh(i,-1);if(e==="%"&&n!=="%")throw new Zs("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&e!=="%")throw new Zs("invalid intrinsic syntax, expected opening `%`");var o=[];return iw(i,ED,function(s,r,l,c){o[o.length]=l?iw(c,xD,"$1"):r||s}),o},TD=function(i,e){var n=i,o;if(Rh(tw,n)&&(o=tw[n],n="%"+o[0]+"%"),Rh(Lo,n)){var s=Lo[n];if(s===Ks&&(s=_D(n)),typeof s>"u"&&!e)throw new Qs("intrinsic "+i+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:s}}throw new Zs("intrinsic "+i+" does not exist!")},nw=function(i,e){if(typeof i!="string"||i.length===0)throw new Qs("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Qs('"allowMissing" argument must be a boolean');if(SD(/^%?[^%]*%?$/,i)===null)throw new Zs("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=AD(i),o=n.length>0?n[0]:"",s=TD("%"+o+"%",e),r=s.name,l=s.value,c=!1,u=s.alias;u&&(o=u[0],bD(n,PD([0,1],u)));for(var d=1,p=!0;d<n.length;d+=1){var f=n[d],g=Fh(f,0,1),v=Fh(f,-1);if((g==='"'||g==="'"||g==="`"||v==='"'||v==="'"||v==="`")&&g!==v)throw new Zs("property names with quotes must have matching quotes");if((f==="constructor"||!p)&&(c=!0),o+="."+f,r="%"+o+"%",Rh(Lo,r))l=Lo[r];else if(l!=null){if(!(f in l)){if(!e)throw new Qs("base intrinsic for "+i+" exists, but the property is not available.");return}if(na&&d+1>=n.length){var y=na(l,f);p=!!y,p&&"get"in y&&!("originalValue"in y.get)?l=y.get:l=l[f]}else p=Rh(l,f),l=l[f];p&&!c&&(Lo[r]=l)}}return l},ow=nw,sw=bf,MD=sw([ow("%String.prototype.indexOf%")]),Af=function(i,e){var n=ow(i,!!e);return typeof n=="function"&&MD(i,".prototype.")>-1?sw([n]):n},ID=wf(),DD=Af,Tf=DD("Object.prototype.toString"),zh=function(i){return ID&&i&&typeof i=="object"&&Symbol.toStringTag in i?!1:Tf(i)==="[object Arguments]"},rw=function(i){return zh(i)?!0:i!==null&&typeof i=="object"&&"length"in i&&typeof i.length=="number"&&i.length>=0&&Tf(i)!=="[object Array]"&&"callee"in i&&Tf(i.callee)==="[object Function]"},RD=function(){return zh(arguments)}();zh.isLegacyArguments=rw;var FD=RD?zh:rw,aw=Dh,zD=B0,Js=Xs,lw=Ys,Mf=function(i,e,n){if(!i||typeof i!="object"&&typeof i!="function")throw new Js("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new Js("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Js("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Js("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Js("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Js("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,r=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,c=!!lw&&lw(i,e);if(aw)aw(i,e,{configurable:r===null&&c?c.configurable:!r,enumerable:o===null&&c?c.enumerable:!o,value:n,writable:s===null&&c?c.writable:!s});else if(l||!o&&!s&&!r)i[e]=n;else throw new zD("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},If=Dh,cw=function(){return!!If};cw.hasArrayLengthDefineBug=function(){if(!If)return null;try{return If([],"length",{value:1}).length!==1}catch{return!0}};var Df=cw,LD=z0,OD=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",ND=Object.prototype.toString,BD=Array.prototype.concat,hw=Mf,VD=function(t){return typeof t=="function"&&ND.call(t)==="[object Function]"},uw=Df(),UD=function(t,i,e,n){if(i in t){if(n===!0){if(t[i]===e)return}else if(!VD(n)||!n())return}uw?hw(t,i,e,!0):hw(t,i,e)},dw=function(t,i){var e=arguments.length>2?arguments[2]:{},n=LD(i);OD&&(n=BD.call(n,Object.getOwnPropertySymbols(i)));for(var o=0;o<n.length;o+=1)UD(t,n[o],i[n[o]],e[n[o]])};dw.supportsDescriptors=!!uw;var ra=dw,pw={exports:{}},WD=nw,fw=Mf,GD=Df(),gw=Ys,mw=Xs,HD=WD("%Math.floor%"),$D=function(i,e){if(typeof i!="function")throw new mw("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||HD(e)!==e)throw new mw("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],o=!0,s=!0;if("length"in i&&gw){var r=gw(i,"length");r&&!r.configurable&&(o=!1),r&&!r.writable&&(s=!1)}return(o||s||!n)&&(GD?fw(i,"length",e,!0,!0):fw(i,"length",e)),i},qD=ia,XD=Pf,YD=H0,ZD=function(){return YD(qD,XD,arguments)};(function(t){var i=$D,e=Dh,n=bf,o=ZD;t.exports=function(r){var l=n(arguments),c=r.length-(arguments.length-1);return i(l,1+(c>0?c:0),!0)},e?e(t.exports,"apply",{value:o}):t.exports.apply=o})(pw);var vw=pw.exports,yw=function(t){return t!==t},ww=function(i,e){return i===0&&e===0?1/i===1/e:!!(i===e||yw(i)&&yw(e))},QD=ww,Cw=function(){return typeof Object.is=="function"?Object.is:QD},kD=Cw,KD=ra,JD=function(){var i=kD();return KD(Object,{is:i},{is:function(){return Object.is!==i}}),i},jD=ra,eR=vw,tR=ww,_w=Cw,iR=JD,Pw=eR(_w(),Object);jD(Pw,{getPolyfill:_w,implementation:tR,shim:iR});var nR=Pw,bw=Af,oR=wf(),sR=J0,rR=Ys,Rf;if(oR){var aR=bw("RegExp.prototype.exec"),Sw={},Ff=function(){throw Sw},Ew={toString:Ff,valueOf:Ff};typeof Symbol.toPrimitive=="symbol"&&(Ew[Symbol.toPrimitive]=Ff),Rf=function(i){if(!i||typeof i!="object")return!1;var e=rR(i,"lastIndex"),n=e&&sR(e,"value");if(!n)return!1;try{aR(i,Ew)}catch(o){return o===Sw}}}else{var lR=bw("Object.prototype.toString"),cR="[object RegExp]";Rf=function(i){return!i||typeof i!="object"&&typeof i!="function"?!1:lR(i)===cR}}var hR=Rf,aa=function(){return typeof(function(){}).name=="string"},la=Object.getOwnPropertyDescriptor;if(la)try{la([],"length")}catch{la=null}aa.functionsHaveConfigurableNames=function(){if(!aa()||!la)return!1;var i=la(function(){},"name");return!!i&&!!i.configurable};var uR=Function.prototype.bind;aa.boundFunctionsHaveNames=function(){return aa()&&typeof uR=="function"&&(function(){}).bind().name!==""};var dR=aa,xw=Mf,pR=Df(),fR=dR.functionsHaveConfigurableNames(),gR=Xs,mR=function(i,e){if(typeof i!="function")throw new gR("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return(!n||fR)&&(pR?xw(i,"name",e,!0,!0):xw(i,"name",e)),i},vR=mR,yR=Xs,wR=Object,Aw=vR(function(){if(this==null||this!==wR(this))throw new yR("RegExp.prototype.flags getter called on non-object");var i="";return this.hasIndices&&(i+="d"),this.global&&(i+="g"),this.ignoreCase&&(i+="i"),this.multiline&&(i+="m"),this.dotAll&&(i+="s"),this.unicode&&(i+="u"),this.unicodeSets&&(i+="v"),this.sticky&&(i+="y"),i},"get flags",!0),CR=Aw,_R=ra.supportsDescriptors,PR=Object.getOwnPropertyDescriptor,Tw=function(){if(_R&&/a/mig.flags==="gim"){var i=PR(RegExp.prototype,"flags");if(i&&typeof i.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",n={};if(Object.defineProperty(n,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(n,"sticky",{get:function(){e+="y"}}),i.get.call(n),e==="dy")return i.get}}return CR},bR=ra.supportsDescriptors,SR=Tw,ER=Ys,xR=Object.defineProperty,AR=N0,Mw=K0,TR=/a/,MR=function(){if(!bR||!Mw)throw new AR("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var i=SR(),e=Mw(TR),n=ER(e,"flags");return(!n||n.get!==i)&&xR(e,"flags",{configurable:!0,enumerable:!1,get:i}),i},IR=ra,DR=vw,RR=Aw,Iw=Tw,FR=MR,Dw=DR(Iw());IR(Dw,{getPolyfill:Iw,implementation:RR,shim:FR});var zR=Dw,Rw=Af,LR=Rw("Date.prototype.getDay"),OR=function(i){try{return LR(i),!0}catch{return!1}},NR=Rw("Object.prototype.toString"),BR="[object Date]",VR=wf(),UR=function(i){return typeof i!="object"||i===null?!1:VR?OR(i):NR(i)===BR},Fw=z0,zw=FD,Lw=nR,Ow=hR,Nw=zR,Bw=UR,Vw=Date.prototype.getTime;function Uw(t,i,e){var n=e||{};return(n.strict?Lw(t,i):t===i)?!0:!t||!i||typeof t!="object"&&typeof i!="object"?n.strict?Lw(t,i):t==i:WR(t,i,n)}function Ww(t){return t==null}function Gw(t){return!(!t||typeof t!="object"||typeof t.length!="number"||typeof t.copy!="function"||typeof t.slice!="function"||t.length>0&&typeof t[0]!="number")}function WR(t,i,e){var n,o;if(typeof t!=typeof i||Ww(t)||Ww(i)||t.prototype!==i.prototype||zw(t)!==zw(i))return!1;var s=Ow(t),r=Ow(i);if(s!==r)return!1;if(s||r)return t.source===i.source&&Nw(t)===Nw(i);if(Bw(t)&&Bw(i))return Vw.call(t)===Vw.call(i);var l=Gw(t),c=Gw(i);if(l!==c)return!1;if(l||c){if(t.length!==i.length)return!1;for(n=0;n<t.length;n++)if(t[n]!==i[n])return!1;return!0}if(typeof t!=typeof i)return!1;try{var u=Fw(t),d=Fw(i)}catch{return!1}if(u.length!==d.length)return!1;for(u.sort(),d.sort(),n=u.length-1;n>=0;n--)if(u[n]!=d[n])return!1;for(n=u.length-1;n>=0;n--)if(o=u[n],!Uw(t[o],i[o],e))return!1;return!0}var GR=Uw;function HR(t,i){var e=!0;return ji(t,function(n){ji(i,function(o){if(e===!1)return!1;e=$R(n.geometry,o.geometry)})}),e}function $R(t,i){switch(t.type){case"Point":switch(i.type){case"Point":return!ZR(t.coordinates,i.coordinates);case"LineString":return!Hw(i,t);case"Polygon":return!bt(t,i)}break;case"LineString":switch(i.type){case"Point":return!Hw(t,i);case"LineString":return!qR(t,i);case"Polygon":return!$w(i,t)}break;case"Polygon":switch(i.type){case"Point":return!bt(i,t);case"LineString":return!$w(t,i);case"Polygon":return!XR(i,t)}}return!1}function Hw(t,i){for(var e=0;e<t.coordinates.length-1;e++)if(YR(t.coordinates[e],t.coordinates[e+1],i.coordinates))return!0;return!1}function qR(t,i){var e=mf(t,i);return e.features.length>0}function $w(t,i){for(var e=0,n=i.coordinates;e<n.length;e++){var o=n[e];if(bt(o,t))return!0}var s=mf(i,vf(t));return s.features.length>0}function XR(t,i){for(var e=0,n=t.coordinates[0];e<n.length;e++){var o=n[e];if(bt(o,i))return!0}for(var s=0,r=i.coordinates[0];s<r.length;s++){var l=r[s];if(bt(l,t))return!0}var c=mf(vf(t),vf(i));return c.features.length>0}function YR(t,i,e){var n=e[0]-t[0],o=e[1]-t[1],s=i[0]-t[0],r=i[1]-t[1],l=n*r-o*s;return l!==0?!1:Math.abs(s)>=Math.abs(r)?s>0?t[0]<=e[0]&&e[0]<=i[0]:i[0]<=e[0]&&e[0]<=t[0]:r>0?t[1]<=e[1]&&e[1]<=i[1]:i[1]<=e[1]&&e[1]<=t[1]}function ZR(t,i){return t[0]===i[0]&&t[1]===i[1]}var QR=GR,Oi=function(t){this.precision=t&&t.precision?t.precision:17,this.direction=t&&t.direction?t.direction:!1,this.pseudoNode=t&&t.pseudoNode?t.pseudoNode:!1,this.objectComparator=t&&t.objectComparator?t.objectComparator:kR};Oi.prototype.compare=function(t,i){if(t.type!==i.type||!Xw(t,i))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,i.coordinates);case"LineString":return this.compareLine(t.coordinates,i.coordinates,0,!1);case"Polygon":return this.comparePolygon(t,i);case"Feature":return this.compareFeature(t,i);default:if(t.type.indexOf("Multi")===0){var e=this,n=qw(t),o=qw(i);return n.every(function(s){return this.some(function(r){return e.compare(s,r)})},o)}}return!1};function qw(t){return t.coordinates.map(function(i){return{type:t.type.replace("Multi",""),coordinates:i}})}function Xw(t,i){return t.hasOwnProperty("coordinates")?t.coordinates.length===i.coordinates.length:t.length===i.length}Oi.prototype.compareCoord=function(t,i){if(t.length!==i.length)return!1;for(var e=0;e<t.length;e++)if(t[e].toFixed(this.precision)!==i[e].toFixed(this.precision))return!1;return!0},Oi.prototype.compareLine=function(t,i,e,n){if(!Xw(t,i))return!1;var o=this.pseudoNode?t:this.removePseudo(t),s=this.pseudoNode?i:this.removePseudo(i);if(!(n&&!this.compareCoord(o[0],s[0])&&(s=this.fixStartIndex(s,o),!s))){var r=this.compareCoord(o[e],s[e]);return this.direction||r?this.comparePath(o,s):this.compareCoord(o[e],s[s.length-(1+e)])?this.comparePath(o.slice().reverse(),s):!1}},Oi.prototype.fixStartIndex=function(t,i){for(var e,n=-1,o=0;o<t.length;o++)if(this.compareCoord(t[o],i[0])){n=o;break}return n>=0&&(e=[].concat(t.slice(n,t.length),t.slice(1,n+1))),e},Oi.prototype.comparePath=function(t,i){var e=this;return t.every(function(n,o){return e.compareCoord(n,this[o])},i)},Oi.prototype.comparePolygon=function(t,i){if(this.compareLine(t.coordinates[0],i.coordinates[0],1,!0)){var e=t.coordinates.slice(1,t.coordinates.length),n=i.coordinates.slice(1,i.coordinates.length),o=this;return e.every(function(s){return this.some(function(r){return o.compareLine(s,r,1,!0)})},n)}else return!1},Oi.prototype.compareFeature=function(t,i){return t.id!==i.id||!this.objectComparator(t.properties,i.properties)||!this.compareBBox(t,i)?!1:this.compare(t.geometry,i.geometry)},Oi.prototype.compareBBox=function(t,i){return!!(!t.bbox&&!i.bbox||t.bbox&&i.bbox&&this.compareCoord(t.bbox,i.bbox))},Oi.prototype.removePseudo=function(t){return t};function kR(t,i){return QR(t,i,{strict:!0})}var KR=Oi;const JR=Ic(KR);function jR(t,i){var e=Di(t).type,n=Di(i).type;if(e!==n)return!1;var o=new JR({precision:6});return o.compare(u0(t),u0(i))}function e2(t,i){var e=!1;return ji(t,function(n){ji(i,function(o){if(e===!0)return!0;e=!HR(n.geometry,o.geometry)})}),e}/**
1859
1859
  * splaytree v3.1.2
1860
1860
  * Fast Splay tree for Node and browser
1861
1861
  *
@@ -1875,8 +1875,8 @@ function (result, this, instanceIndex, frameState) {
1875
1875
 
1876
1876
  See the Apache Version 2.0 License for specific language governing permissions
1877
1877
  and limitations under the License.
1878
- ***************************************************************************** */function e2(t,i){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,o,s,r;return r={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(r[Symbol.iterator]=function(){return this}),r;function l(u){return function(d){return c([u,d])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,o&&(s=u[0]&2?o.return:u[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,u[1])).done)return s;switch(o=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,o=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(s=e.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){e.label=u[1];break}if(u[0]===6&&e.label<s[1]){e.label=s[1],s=u;break}if(s&&e.label<s[2]){e.label=s[2],e.ops.push(u);break}s[2]&&e.ops.pop(),e.trys.pop();continue}u=i.call(t,e)}catch(d){u=[6,d],o=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var Vn=function(){function t(i,e){this.next=null,this.key=i,this.data=e,this.left=null,this.right=null}return t}();function t2(t,i){return t>i?1:t<i?-1:0}function Un(t,i,e){for(var n=new Vn(null,null),o=n,s=n;;){var r=e(t,i.key);if(r<0){if(i.left===null)break;if(e(t,i.left.key)<0){var l=i.left;if(i.left=l.right,l.right=i,i=l,i.left===null)break}s.left=i,s=i,i=i.left}else if(r>0){if(i.right===null)break;if(e(t,i.right.key)>0){var l=i.right;if(i.right=l.left,l.left=i,i=l,i.right===null)break}o.right=i,o=i,i=i.right}else break}return o.right=i.left,s.left=i.right,i.left=n.right,i.right=n.left,i}function zf(t,i,e,n){var o=new Vn(t,i);if(e===null)return o.left=o.right=null,o;e=Un(t,e,n);var s=n(t,e.key);return s<0?(o.left=e.left,o.right=e,e.left=null):s>=0&&(o.right=e.right,o.left=e,e.right=null),o}function Yw(t,i,e){var n=null,o=null;if(i){i=Un(t,i,e);var s=e(i.key,t);s===0?(n=i.left,o=i.right):s<0?(o=i.right,i.right=null,n=i):(n=i.left,i.left=null,o=i)}return{left:n,right:o}}function i2(t,i,e){return i===null?t:(t===null||(i=Un(t.key,i,e),i.left=t),i)}function Lf(t,i,e,n,o){if(t){n(""+i+(e?"└── ":"├── ")+o(t)+`
1879
- `);var s=i+(e?" ":"│ ");t.left&&Lf(t.left,s,!1,n,o),t.right&&Lf(t.right,s,!0,n,o)}}var Of=function(){function t(i){i===void 0&&(i=t2),this._root=null,this._size=0,this._comparator=i}return t.prototype.insert=function(i,e){return this._size++,this._root=zf(i,e,this._root,this._comparator)},t.prototype.add=function(i,e){var n=new Vn(i,e);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var o=this._comparator,s=Un(i,this._root,o),r=o(i,s.key);return r===0?this._root=s:(r<0?(n.left=s.left,n.right=s,s.left=null):r>0&&(n.right=s.right,n.left=s,s.right=null),this._size++,this._root=n),this._root},t.prototype.remove=function(i){this._root=this._remove(i,this._root,this._comparator)},t.prototype._remove=function(i,e,n){var o;if(e===null)return null;e=Un(i,e,n);var s=n(i,e.key);return s===0?(e.left===null?o=e.right:(o=Un(i,e.left,n),o.right=e.right),this._size--,o):e},t.prototype.pop=function(){var i=this._root;if(i){for(;i.left;)i=i.left;return this._root=Un(i.key,this._root,this._comparator),this._root=this._remove(i.key,this._root,this._comparator),{key:i.key,data:i.data}}return null},t.prototype.findStatic=function(i){for(var e=this._root,n=this._comparator;e;){var o=n(i,e.key);if(o===0)return e;o<0?e=e.left:e=e.right}return null},t.prototype.find=function(i){return this._root&&(this._root=Un(i,this._root,this._comparator),this._comparator(i,this._root.key)!==0)?null:this._root},t.prototype.contains=function(i){for(var e=this._root,n=this._comparator;e;){var o=n(i,e.key);if(o===0)return!0;o<0?e=e.left:e=e.right}return!1},t.prototype.forEach=function(i,e){for(var n=this._root,o=[],s=!1;!s;)n!==null?(o.push(n),n=n.left):o.length!==0?(n=o.pop(),i.call(e,n),n=n.right):s=!0;return this},t.prototype.range=function(i,e,n,o){for(var s=[],r=this._comparator,l=this._root,c;s.length!==0||l;)if(l)s.push(l),l=l.left;else{if(l=s.pop(),c=r(l.key,e),c>0)break;if(r(l.key,i)>=0&&n.call(o,l))return this;l=l.right}return this},t.prototype.keys=function(){var i=[];return this.forEach(function(e){var n=e.key;return i.push(n)}),i},t.prototype.values=function(){var i=[];return this.forEach(function(e){var n=e.data;return i.push(n)}),i},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(i){if(i===void 0&&(i=this._root),i)for(;i.left;)i=i.left;return i},t.prototype.maxNode=function(i){if(i===void 0&&(i=this._root),i)for(;i.right;)i=i.right;return i},t.prototype.at=function(i){for(var e=this._root,n=!1,o=0,s=[];!n;)if(e)s.push(e),e=e.left;else if(s.length>0){if(e=s.pop(),o===i)return e;o++,e=e.right}else n=!0;return null},t.prototype.next=function(i){var e=this._root,n=null;if(i.right){for(n=i.right;n.left;)n=n.left;return n}for(var o=this._comparator;e;){var s=o(i.key,e.key);if(s===0)break;s<0?(n=e,e=e.left):e=e.right}return n},t.prototype.prev=function(i){var e=this._root,n=null;if(i.left!==null){for(n=i.left;n.right;)n=n.right;return n}for(var o=this._comparator;e;){var s=o(i.key,e.key);if(s===0)break;s<0?e=e.left:(n=e,e=e.right)}return n},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return o2(this._root)},t.prototype.load=function(i,e,n){e===void 0&&(e=[]),n===void 0&&(n=!1);var o=i.length,s=this._comparator;if(n&&Vf(i,e,0,o-1,s),this._root===null)this._root=Nf(i,e,0,o),this._size=o;else{var r=s2(this.toList(),n2(i,e),s);o=this._size+o,this._root=Bf({head:r},0,o)}return this},t.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(i){i===void 0&&(i=function(n){return String(n.key)});var e=[];return Lf(this._root,"",!0,function(n){return e.push(n)},i),e.join("")},t.prototype.update=function(i,e,n){var o=this._comparator,s=Yw(i,this._root,o),r=s.left,l=s.right;o(i,e)<0?l=zf(e,n,l,o):r=zf(e,n,r,o),this._root=i2(r,l,o)},t.prototype.split=function(i){return Yw(i,this._root,this._comparator)},t.prototype[Symbol.iterator]=function(){var i,e,n;return e2(this,function(o){switch(o.label){case 0:i=this._root,e=[],n=!1,o.label=1;case 1:return n?[3,6]:i===null?[3,2]:(e.push(i),i=i.left,[3,5]);case 2:return e.length===0?[3,4]:(i=e.pop(),[4,i]);case 3:return o.sent(),i=i.right,[3,5];case 4:n=!0,o.label=5;case 5:return[3,1];case 6:return[2]}})},t}();function Nf(t,i,e,n){var o=n-e;if(o>0){var s=e+Math.floor(o/2),r=t[s],l=i[s],c=new Vn(r,l);return c.left=Nf(t,i,e,s),c.right=Nf(t,i,s+1,n),c}return null}function n2(t,i){for(var e=new Vn(null,null),n=e,o=0;o<t.length;o++)n=n.next=new Vn(t[o],i[o]);return n.next=null,e.next}function o2(t){for(var i=t,e=[],n=!1,o=new Vn(null,null),s=o;!n;)i?(e.push(i),i=i.left):e.length>0?(i=s=s.next=e.pop(),i=i.right):n=!0;return s.next=null,o.next}function Bf(t,i,e){var n=e-i;if(n>0){var o=i+Math.floor(n/2),s=Bf(t,i,o),r=t.head;return r.left=s,t.head=t.head.next,r.right=Bf(t,o+1,e),r}return null}function s2(t,i,e){for(var n=new Vn(null,null),o=n,s=t,r=i;s!==null&&r!==null;)e(s.key,r.key)<0?(o.next=s,s=s.next):(o.next=r,r=r.next),o=o.next;return s!==null?o.next=s:r!==null&&(o.next=r),n.next}function Vf(t,i,e,n,o){if(!(e>=n)){for(var s=t[e+n>>1],r=e-1,l=n+1;;){do r++;while(o(t[r],s)<0);do l--;while(o(t[l],s)>0);if(r>=l)break;var c=t[r];t[r]=t[l],t[l]=c,c=i[r],i[r]=i[l],i[l]=c}Vf(t,i,e,l,o),Vf(t,i,l+1,n,o)}}const nn=11102230246251565e-32,_t=134217729,r2=(3+8*nn)*nn;function Uf(t,i,e,n,o){let s,r,l,c,u=i[0],d=n[0],p=0,f=0;d>u==d>-u?(s=u,u=i[++p]):(s=d,d=n[++f]);let g=0;if(p<t&&f<e)for(d>u==d>-u?(r=u+s,l=s-(r-u),u=i[++p]):(r=d+s,l=s-(r-d),d=n[++f]),s=r,l!==0&&(o[g++]=l);p<t&&f<e;)d>u==d>-u?(r=s+u,c=r-s,l=s-(r-c)+(u-c),u=i[++p]):(r=s+d,c=r-s,l=s-(r-c)+(d-c),d=n[++f]),s=r,l!==0&&(o[g++]=l);for(;p<t;)r=s+u,c=r-s,l=s-(r-c)+(u-c),u=i[++p],s=r,l!==0&&(o[g++]=l);for(;f<e;)r=s+d,c=r-s,l=s-(r-c)+(d-c),d=n[++f],s=r,l!==0&&(o[g++]=l);return(s!==0||g===0)&&(o[g++]=s),g}function a2(t,i){let e=i[0];for(let n=1;n<t;n++)e+=i[n];return e}function ca(t){return new Float64Array(t)}const l2=(3+16*nn)*nn,c2=(2+12*nn)*nn,h2=(9+64*nn)*nn*nn,js=ca(4),Zw=ca(8),Qw=ca(12),kw=ca(16),St=ca(4);function u2(t,i,e,n,o,s,r){let l,c,u,d,p,f,g,v,y,w,P,C,S,x,A,R,L,B;const V=t-o,G=e-o,O=i-s,N=n-s;x=V*N,f=_t*V,g=f-(f-V),v=V-g,f=_t*N,y=f-(f-N),w=N-y,A=v*w-(x-g*y-v*y-g*w),R=O*G,f=_t*O,g=f-(f-O),v=O-g,f=_t*G,y=f-(f-G),w=G-y,L=v*w-(R-g*y-v*y-g*w),P=A-L,p=A-P,js[0]=A-(P+p)+(p-L),C=x+P,p=C-x,S=x-(C-p)+(P-p),P=S-R,p=S-P,js[1]=S-(P+p)+(p-R),B=C+P,p=B-C,js[2]=C-(B-p)+(P-p),js[3]=B;let _=a2(4,js),E=c2*r;if(_>=E||-_>=E||(p=t-V,l=t-(V+p)+(p-o),p=e-G,u=e-(G+p)+(p-o),p=i-O,c=i-(O+p)+(p-s),p=n-N,d=n-(N+p)+(p-s),l===0&&c===0&&u===0&&d===0)||(E=h2*r+r2*Math.abs(_),_+=V*d+N*l-(O*u+G*c),_>=E||-_>=E))return _;x=l*N,f=_t*l,g=f-(f-l),v=l-g,f=_t*N,y=f-(f-N),w=N-y,A=v*w-(x-g*y-v*y-g*w),R=c*G,f=_t*c,g=f-(f-c),v=c-g,f=_t*G,y=f-(f-G),w=G-y,L=v*w-(R-g*y-v*y-g*w),P=A-L,p=A-P,St[0]=A-(P+p)+(p-L),C=x+P,p=C-x,S=x-(C-p)+(P-p),P=S-R,p=S-P,St[1]=S-(P+p)+(p-R),B=C+P,p=B-C,St[2]=C-(B-p)+(P-p),St[3]=B;const D=Uf(4,js,4,St,Zw);x=V*d,f=_t*V,g=f-(f-V),v=V-g,f=_t*d,y=f-(f-d),w=d-y,A=v*w-(x-g*y-v*y-g*w),R=O*u,f=_t*O,g=f-(f-O),v=O-g,f=_t*u,y=f-(f-u),w=u-y,L=v*w-(R-g*y-v*y-g*w),P=A-L,p=A-P,St[0]=A-(P+p)+(p-L),C=x+P,p=C-x,S=x-(C-p)+(P-p),P=S-R,p=S-P,St[1]=S-(P+p)+(p-R),B=C+P,p=B-C,St[2]=C-(B-p)+(P-p),St[3]=B;const z=Uf(D,Zw,4,St,Qw);x=l*d,f=_t*l,g=f-(f-l),v=l-g,f=_t*d,y=f-(f-d),w=d-y,A=v*w-(x-g*y-v*y-g*w),R=c*u,f=_t*c,g=f-(f-c),v=c-g,f=_t*u,y=f-(f-u),w=u-y,L=v*w-(R-g*y-v*y-g*w),P=A-L,p=A-P,St[0]=A-(P+p)+(p-L),C=x+P,p=C-x,S=x-(C-p)+(P-p),P=S-R,p=S-P,St[1]=S-(P+p)+(p-R),B=C+P,p=B-C,St[2]=C-(B-p)+(P-p),St[3]=B;const U=Uf(z,Qw,4,St,kw);return kw[U-1]}function d2(t,i,e,n,o,s){const r=(i-s)*(e-o),l=(t-o)*(n-s),c=r-l,u=Math.abs(r+l);return Math.abs(c)>=l2*u?c:-u2(t,i,e,n,o,s,u)}const ha=(t,i)=>t.ll.x<=i.x&&i.x<=t.ur.x&&t.ll.y<=i.y&&i.y<=t.ur.y,Wf=(t,i)=>{if(i.ur.x<t.ll.x||t.ur.x<i.ll.x||i.ur.y<t.ll.y||t.ur.y<i.ll.y)return null;const e=t.ll.x<i.ll.x?i.ll.x:t.ll.x,n=t.ur.x<i.ur.x?t.ur.x:i.ur.x,o=t.ll.y<i.ll.y?i.ll.y:t.ll.y,s=t.ur.y<i.ur.y?t.ur.y:i.ur.y;return{ll:{x:e,y:o},ur:{x:n,y:s}}};let Wn=Number.EPSILON;Wn===void 0&&(Wn=Math.pow(2,-52));const p2=Wn*Wn,Kw=(t,i)=>{if(-Wn<t&&t<Wn&&-Wn<i&&i<Wn)return 0;const e=t-i;return e*e<p2*t*i?0:t<i?-1:1};class f2{constructor(){this.reset()}reset(){this.xRounder=new Jw,this.yRounder=new Jw}round(i,e){return{x:this.xRounder.round(i),y:this.yRounder.round(e)}}}class Jw{constructor(){this.tree=new Of,this.round(0)}round(i){const e=this.tree.add(i),n=this.tree.prev(e);if(n!==null&&Kw(e.key,n.key)===0)return this.tree.remove(i),n.key;const o=this.tree.next(e);return o!==null&&Kw(e.key,o.key)===0?(this.tree.remove(i),o.key):i}}const ua=new f2,Lh=(t,i)=>t.x*i.y-t.y*i.x,jw=(t,i)=>t.x*i.x+t.y*i.y,eC=(t,i,e)=>{const n=d2(t.x,t.y,i.x,i.y,e.x,e.y);return n>0?-1:n<0?1:0},Oh=t=>Math.sqrt(jw(t,t)),g2=(t,i,e)=>{const n={x:i.x-t.x,y:i.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return Lh(o,n)/Oh(o)/Oh(n)},m2=(t,i,e)=>{const n={x:i.x-t.x,y:i.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return jw(o,n)/Oh(o)/Oh(n)},tC=(t,i,e)=>i.y===0?null:{x:t.x+i.x/i.y*(e-t.y),y:e},iC=(t,i,e)=>i.x===0?null:{x:e,y:t.y+i.y/i.x*(e-t.x)},v2=(t,i,e,n)=>{if(i.x===0)return iC(e,n,t.x);if(n.x===0)return iC(t,i,e.x);if(i.y===0)return tC(e,n,t.y);if(n.y===0)return tC(t,i,e.y);const o=Lh(i,n);if(o==0)return null;const s={x:e.x-t.x,y:e.y-t.y},r=Lh(s,i)/o,l=Lh(s,n)/o,c=t.x+l*i.x,u=e.x+r*n.x,d=t.y+l*i.y,p=e.y+r*n.y,f=(c+u)/2,g=(d+p)/2;return{x:f,y:g}};class si{static compare(i,e){const n=si.comparePoints(i.point,e.point);return n!==0?n:(i.point!==e.point&&i.link(e),i.isLeft!==e.isLeft?i.isLeft?1:-1:Gn.compare(i.segment,e.segment))}static comparePoints(i,e){return i.x<e.x?-1:i.x>e.x?1:i.y<e.y?-1:i.y>e.y?1:0}constructor(i,e){i.events===void 0?i.events=[this]:i.events.push(this),this.point=i,this.isLeft=e}link(i){if(i.point===this.point)throw new Error("Tried to link already linked events");const e=i.point.events;for(let n=0,o=e.length;n<o;n++){const s=e[n];this.point.events.push(s),s.point=this.point}this.checkForConsuming()}checkForConsuming(){const i=this.point.events.length;for(let e=0;e<i;e++){const n=this.point.events[e];if(n.segment.consumedBy===void 0)for(let o=e+1;o<i;o++){const s=this.point.events[o];s.consumedBy===void 0&&n.otherSE.point.events===s.otherSE.point.events&&n.segment.consume(s.segment)}}}getAvailableLinkedEvents(){const i=[];for(let e=0,n=this.point.events.length;e<n;e++){const o=this.point.events[e];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&i.push(o)}return i}getLeftmostComparator(i){const e=new Map,n=o=>{const s=o.otherSE;e.set(o,{sine:g2(this.point,i.point,s.point),cosine:m2(this.point,i.point,s.point)})};return(o,s)=>{e.has(o)||n(o),e.has(s)||n(s);const{sine:r,cosine:l}=e.get(o),{sine:c,cosine:u}=e.get(s);return r>=0&&c>=0?l<u?1:l>u?-1:0:r<0&&c<0?l<u?-1:l>u?1:0:c<r?-1:c>r?1:0}}}let y2=0;class Gn{static compare(i,e){const n=i.leftSE.point.x,o=e.leftSE.point.x,s=i.rightSE.point.x,r=e.rightSE.point.x;if(r<n)return 1;if(s<o)return-1;const l=i.leftSE.point.y,c=e.leftSE.point.y,u=i.rightSE.point.y,d=e.rightSE.point.y;if(n<o){if(c<l&&c<u)return 1;if(c>l&&c>u)return-1;const p=i.comparePoint(e.leftSE.point);if(p<0)return 1;if(p>0)return-1;const f=e.comparePoint(i.rightSE.point);return f!==0?f:-1}if(n>o){if(l<c&&l<d)return-1;if(l>c&&l>d)return 1;const p=e.comparePoint(i.leftSE.point);if(p!==0)return p;const f=i.comparePoint(e.rightSE.point);return f<0?1:f>0?-1:1}if(l<c)return-1;if(l>c)return 1;if(s<r){const p=e.comparePoint(i.rightSE.point);if(p!==0)return p}if(s>r){const p=i.comparePoint(e.rightSE.point);if(p<0)return 1;if(p>0)return-1}if(s!==r){const p=u-l,f=s-n,g=d-c,v=r-o;if(p>f&&g<v)return 1;if(p<f&&g>v)return-1}return s>r?1:s<r||u<d?-1:u>d?1:i.id<e.id?-1:i.id>e.id?1:0}constructor(i,e,n,o){this.id=++y2,this.leftSE=i,i.segment=this,i.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=i,this.rings=n,this.windings=o}static fromRing(i,e,n){let o,s,r;const l=si.comparePoints(i,e);if(l<0)o=i,s=e,r=1;else if(l>0)o=e,s=i,r=-1;else throw new Error(`Tried to create degenerate segment at [${i.x}, ${i.y}]`);const c=new si(o,!0),u=new si(s,!1);return new Gn(c,u,[n],[r])}replaceRightSE(i){this.rightSE=i,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const i=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:i<e?i:e},ur:{x:this.rightSE.point.x,y:i>e?i:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(i){return i.x===this.leftSE.point.x&&i.y===this.leftSE.point.y||i.x===this.rightSE.point.x&&i.y===this.rightSE.point.y}comparePoint(i){if(this.isAnEndpoint(i))return 0;const e=this.leftSE.point,n=this.rightSE.point,o=this.vector();if(e.x===n.x)return i.x===e.x?0:i.x<e.x?1:-1;const s=(i.y-e.y)/o.y,r=e.x+s*o.x;if(i.x===r)return 0;const l=(i.x-e.x)/o.x,c=e.y+l*o.y;return i.y===c?0:i.y<c?-1:1}getIntersection(i){const e=this.bbox(),n=i.bbox(),o=Wf(e,n);if(o===null)return null;const s=this.leftSE.point,r=this.rightSE.point,l=i.leftSE.point,c=i.rightSE.point,u=ha(e,l)&&this.comparePoint(l)===0,d=ha(n,s)&&i.comparePoint(s)===0,p=ha(e,c)&&this.comparePoint(c)===0,f=ha(n,r)&&i.comparePoint(r)===0;if(d&&u)return f&&!p?r:!f&&p?c:null;if(d)return p&&s.x===c.x&&s.y===c.y?null:s;if(u)return f&&r.x===l.x&&r.y===l.y?null:l;if(f&&p)return null;if(f)return r;if(p)return c;const g=v2(s,this.vector(),l,i.vector());return g===null||!ha(o,g)?null:ua.round(g.x,g.y)}split(i){const e=[],n=i.events!==void 0,o=new si(i,!0),s=new si(i,!1),r=this.rightSE;this.replaceRightSE(s),e.push(s),e.push(o);const l=new Gn(o,r,this.rings.slice(),this.windings.slice());return si.comparePoints(l.leftSE.point,l.rightSE.point)>0&&l.swapEvents(),si.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(o.checkForConsuming(),s.checkForConsuming()),e}swapEvents(){const i=this.rightSE;this.rightSE=this.leftSE,this.leftSE=i,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,n=this.windings.length;e<n;e++)this.windings[e]*=-1}consume(i){let e=this,n=i;for(;e.consumedBy;)e=e.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const o=Gn.compare(e,n);if(o!==0){if(o>0){const s=e;e=n,n=s}if(e.prev===n){const s=e;e=n,n=s}for(let s=0,r=n.rings.length;s<r;s++){const l=n.rings[s],c=n.windings[s],u=e.rings.indexOf(l);u===-1?(e.rings.push(l),e.windings.push(c)):e.windings[u]+=c}n.rings=null,n.windings=null,n.consumedBy=e,n.leftSE.consumedBy=e.leftSE,n.rightSE.consumedBy=e.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const i=this.prev.consumedBy||this.prev;this._beforeState=i.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const i=this.beforeState();this._afterState={rings:i.rings.slice(0),windings:i.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,n=this._afterState.windings,o=this._afterState.multiPolys;for(let l=0,c=this.rings.length;l<c;l++){const u=this.rings[l],d=this.windings[l],p=e.indexOf(u);p===-1?(e.push(u),n.push(d)):n[p]+=d}const s=[],r=[];for(let l=0,c=e.length;l<c;l++){if(n[l]===0)continue;const u=e[l],d=u.poly;if(r.indexOf(d)===-1)if(u.isExterior)s.push(d);else{r.indexOf(d)===-1&&r.push(d);const p=s.indexOf(u.poly);p!==-1&&s.splice(p,1)}}for(let l=0,c=s.length;l<c;l++){const u=s[l].multiPoly;o.indexOf(u)===-1&&o.push(u)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const i=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(vi.type){case"union":{const n=i.length===0,o=e.length===0;this._isInResult=n!==o;break}case"intersection":{let n,o;i.length<e.length?(n=i.length,o=e.length):(n=e.length,o=i.length),this._isInResult=o===vi.numMultiPolys&&n<o;break}case"xor":{const n=Math.abs(i.length-e.length);this._isInResult=n%2===1;break}case"difference":{const n=o=>o.length===1&&o[0].isSubject;this._isInResult=n(i)!==n(e);break}default:throw new Error(`Unrecognized operation type found ${vi.type}`)}return this._isInResult}}class nC{constructor(i,e,n){if(!Array.isArray(i)||i.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=n,this.segments=[],typeof i[0][0]!="number"||typeof i[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const o=ua.round(i[0][0],i[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};let s=o;for(let r=1,l=i.length;r<l;r++){if(typeof i[r][0]!="number"||typeof i[r][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let c=ua.round(i[r][0],i[r][1]);c.x===s.x&&c.y===s.y||(this.segments.push(Gn.fromRing(s,c,this)),c.x<this.bbox.ll.x&&(this.bbox.ll.x=c.x),c.y<this.bbox.ll.y&&(this.bbox.ll.y=c.y),c.x>this.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),s=c)}(o.x!==s.x||o.y!==s.y)&&this.segments.push(Gn.fromRing(s,o,this))}getSweepEvents(){const i=[];for(let e=0,n=this.segments.length;e<n;e++){const o=this.segments[e];i.push(o.leftSE),i.push(o.rightSE)}return i}}class w2{constructor(i,e){if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new nC(i[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let n=1,o=i.length;n<o;n++){const s=new nC(i[n],this,!1);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.interiorRings.push(s)}this.multiPoly=e}getSweepEvents(){const i=this.exteriorRing.getSweepEvents();for(let e=0,n=this.interiorRings.length;e<n;e++){const o=this.interiorRings[e].getSweepEvents();for(let s=0,r=o.length;s<r;s++)i.push(o[s])}return i}}class oC{constructor(i,e){if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof i[0][0][0]=="number"&&(i=[i])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let n=0,o=i.length;n<o;n++){const s=new w2(i[n],this);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.polys.push(s)}this.isSubject=e}getSweepEvents(){const i=[];for(let e=0,n=this.polys.length;e<n;e++){const o=this.polys[e].getSweepEvents();for(let s=0,r=o.length;s<r;s++)i.push(o[s])}return i}}class Nh{static factory(i){const e=[];for(let n=0,o=i.length;n<o;n++){const s=i[n];if(!s.isInResult()||s.ringOut)continue;let r=null,l=s.leftSE,c=s.rightSE;const u=[l],d=l.point,p=[];for(;r=l,l=c,u.push(l),l.point!==d;)for(;;){const f=l.getAvailableLinkedEvents();if(f.length===0){const y=u[0].point,w=u[u.length-1].point;throw new Error(`Unable to complete output ring starting at [${y.x}, ${y.y}]. Last matching segment found ends at [${w.x}, ${w.y}].`)}if(f.length===1){c=f[0].otherSE;break}let g=null;for(let y=0,w=p.length;y<w;y++)if(p[y].point===l.point){g=y;break}if(g!==null){const y=p.splice(g)[0],w=u.splice(y.index);w.unshift(w[0].otherSE),e.push(new Nh(w.reverse()));continue}p.push({index:u.length,point:l.point});const v=l.getLeftmostComparator(r);c=f.sort(v)[0].otherSE;break}e.push(new Nh(u))}return e}constructor(i){this.events=i;for(let e=0,n=i.length;e<n;e++)i[e].segment.ringOut=this;this.poly=null}getGeom(){let i=this.events[0].point;const e=[i];for(let u=1,d=this.events.length-1;u<d;u++){const p=this.events[u].point,f=this.events[u+1].point;eC(p,i,f)!==0&&(e.push(p),i=p)}if(e.length===1)return null;const n=e[0],o=e[1];eC(n,i,o)===0&&e.shift(),e.push(e[0]);const s=this.isExteriorRing()?1:-1,r=this.isExteriorRing()?0:e.length-1,l=this.isExteriorRing()?e.length:-1,c=[];for(let u=r;u!=l;u+=s)c.push([e[u].x,e[u].y]);return c}isExteriorRing(){if(this._isExteriorRing===void 0){const i=this.enclosingRing();this._isExteriorRing=i?!i.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let i=this.events[0];for(let o=1,s=this.events.length;o<s;o++){const r=this.events[o];si.compare(i,r)>0&&(i=r)}let e=i.segment.prevInResult(),n=e?e.prevInResult():null;for(;;){if(!e)return null;if(!n)return e.ringOut;if(n.ringOut!==e.ringOut)return n.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=n.prevInResult(),n=e?e.prevInResult():null}}}class sC{constructor(i){this.exteriorRing=i,i.poly=this,this.interiorRings=[]}addInterior(i){this.interiorRings.push(i),i.poly=this}getGeom(){const i=[this.exteriorRing.getGeom()];if(i[0]===null)return null;for(let e=0,n=this.interiorRings.length;e<n;e++){const o=this.interiorRings[e].getGeom();o!==null&&i.push(o)}return i}}class C2{constructor(i){this.rings=i,this.polys=this._composePolys(i)}getGeom(){const i=[];for(let e=0,n=this.polys.length;e<n;e++){const o=this.polys[e].getGeom();o!==null&&i.push(o)}return i}_composePolys(i){const e=[];for(let n=0,o=i.length;n<o;n++){const s=i[n];if(!s.poly)if(s.isExteriorRing())e.push(new sC(s));else{const r=s.enclosingRing();r.poly||e.push(new sC(r)),r.poly.addInterior(s)}}return e}}class _2{constructor(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Gn.compare;this.queue=i,this.tree=new Of(e),this.segments=[]}process(i){const e=i.segment,n=[];if(i.consumedBy)return i.isLeft?this.queue.remove(i.otherSE):this.tree.remove(e),n;const o=i.isLeft?this.tree.add(e):this.tree.find(e);if(!o)throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);let s=o,r=o,l,c;for(;l===void 0;)s=this.tree.prev(s),s===null?l=null:s.key.consumedBy===void 0&&(l=s.key);for(;c===void 0;)r=this.tree.next(r),r===null?c=null:r.key.consumedBy===void 0&&(c=r.key);if(i.isLeft){let u=null;if(l){const p=l.getIntersection(e);if(p!==null&&(e.isAnEndpoint(p)||(u=p),!l.isAnEndpoint(p))){const f=this._splitSafely(l,p);for(let g=0,v=f.length;g<v;g++)n.push(f[g])}}let d=null;if(c){const p=c.getIntersection(e);if(p!==null&&(e.isAnEndpoint(p)||(d=p),!c.isAnEndpoint(p))){const f=this._splitSafely(c,p);for(let g=0,v=f.length;g<v;g++)n.push(f[g])}}if(u!==null||d!==null){let p=null;u===null?p=d:d===null?p=u:p=si.comparePoints(u,d)<=0?u:d,this.queue.remove(e.rightSE),n.push(e.rightSE);const f=e.split(p);for(let g=0,v=f.length;g<v;g++)n.push(f[g])}n.length>0?(this.tree.remove(e),n.push(i)):(this.segments.push(e),e.prev=l)}else{if(l&&c){const u=l.getIntersection(c);if(u!==null){if(!l.isAnEndpoint(u)){const d=this._splitSafely(l,u);for(let p=0,f=d.length;p<f;p++)n.push(d[p])}if(!c.isAnEndpoint(u)){const d=this._splitSafely(c,u);for(let p=0,f=d.length;p<f;p++)n.push(d[p])}}}this.tree.remove(e)}return n}_splitSafely(i,e){this.tree.remove(i);const n=i.rightSE;this.queue.remove(n);const o=i.split(e);return o.push(n),i.consumedBy===void 0&&this.tree.add(i),o}}const rC=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,P2=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class b2{run(i,e,n){vi.type=i,ua.reset();const o=[new oC(e,!0)];for(let p=0,f=n.length;p<f;p++)o.push(new oC(n[p],!1));if(vi.numMultiPolys=o.length,vi.type==="difference"){const p=o[0];let f=1;for(;f<o.length;)Wf(o[f].bbox,p.bbox)!==null?f++:o.splice(f,1)}if(vi.type==="intersection")for(let p=0,f=o.length;p<f;p++){const g=o[p];for(let v=p+1,y=o.length;v<y;v++)if(Wf(g.bbox,o[v].bbox)===null)return[]}const s=new Of(si.compare);for(let p=0,f=o.length;p<f;p++){const g=o[p].getSweepEvents();for(let v=0,y=g.length;v<y;v++)if(s.insert(g[v]),s.size>rC)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const r=new _2(s);let l=s.size,c=s.pop();for(;c;){const p=c.key;if(s.size===l){const g=p.segment;throw new Error(`Unable to pop() ${p.isLeft?"left":"right"} SweepEvent [${p.point.x}, ${p.point.y}] from segment #${g.id} [${g.leftSE.point.x}, ${g.leftSE.point.y}] -> [${g.rightSE.point.x}, ${g.rightSE.point.y}] from queue.`)}if(s.size>rC)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(r.segments.length>P2)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=r.process(p);for(let g=0,v=f.length;g<v;g++){const y=f[g];y.consumedBy===void 0&&s.insert(y)}l=s.size,c=s.pop()}ua.reset();const u=Nh.factory(r.segments);return new C2(u).getGeom()}}const vi=new b2;var S2={union:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return vi.run("union",t,e)},intersection:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return vi.run("intersection",t,e)},xor:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return vi.run("xor",t,e)},difference:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return vi.run("difference",t,e)}};function Bh(t,i,e){e===void 0&&(e={});var n=Di(t),o=Di(i),s=S2.intersection(n.coordinates,o.coordinates);return s.length===0?null:s.length===1?ot(s[0],e.properties):nf(s,e.properties)}function E2(t,i,e){e===void 0&&(e={});var n=JSON.stringify(e.properties||{}),o=t[0],s=t[1],r=t[2],l=t[3],c=(s+l)/2,u=(o+r)/2,d=i*2/Ri([o,c],[r,c],e),p=d*(r-o),f=i*2/Ri([u,s],[u,l],e),g=f*(l-s),v=p/2,y=v*2,w=Math.sqrt(3)/2*g,P=r-o,C=l-s,S=3/4*y,x=w,A=(P-y)/(y-v/2),R=Math.floor(A),L=(R*S-v/2-P)/2-v/2+S/2,B=Math.floor((C-w)/w),V=(C-B*w)/2,G=B*w-C>w/2;G&&(V-=w/4);for(var O=[],N=[],_=0;_<6;_++){var E=2*Math.PI/6*_;O.push(Math.cos(E)),N.push(Math.sin(E))}for(var D=[],z=0;z<=R;z++)for(var U=0;U<=B;U++){var Y=z%2===1;if(!(U===0&&Y)&&!(U===0&&G)){var q=z*S+o-L,X=U*x+s+V;if(Y&&(X-=w/2),e.triangles===!0)A2([q,X],p/2,g/2,JSON.parse(n),O,N).forEach(function(j){e.mask?Bh(e.mask,j)&&D.push(j):D.push(j)});else{var Q=x2([q,X],p/2,g/2,JSON.parse(n),O,N);e.mask?Bh(e.mask,Q)&&D.push(Q):D.push(Q)}}}return Nt(D)}function x2(t,i,e,n,o,s){for(var r=[],l=0;l<6;l++){var c=t[0]+i*o[l],u=t[1]+e*s[l];r.push([c,u])}return r.push(r[0].slice()),ot([r],n)}function A2(t,i,e,n,o,s){for(var r=[],l=0;l<6;l++){var c=[];c.push(t),c.push([t[0]+i*o[l],t[1]+e*s[l]]),c.push([t[0]+i*o[(l+1)%6],t[1]+e*s[(l+1)%6]]),c.push(t),r.push(ot([c],n))}return r}function T2(t,i,e,n){n===void 0&&(n={});for(var o=[],s=t[0],r=t[1],l=t[2],c=t[3],u=i/Ri([s,r],[l,r],n),d=u*(l-s),p=e/Ri([s,r],[s,c],n),f=p*(c-r),g=l-s,v=c-r,y=Math.floor(g/d),w=Math.floor(v/f),P=(g-y*d)/2,C=(v-w*f)/2,S=s+P,x=0;x<y;x++){for(var A=r+C,R=0;R<w;R++){var L=ot([[[S,A],[S,A+f],[S+d,A+f],[S+d,A],[S,A]]],n.properties);n.mask?jR(n.mask,L)&&o.push(L):o.push(L),A+=f}S+=d}return Nt(o)}function M2(t,i,e){return e===void 0&&(e={}),T2(t,i,i,e)}function I2(t,i,e){e===void 0&&(e={});for(var n=[],o=i/Ri([t[0],t[1]],[t[2],t[1]],e),s=o*(t[2]-t[0]),r=i/Ri([t[0],t[1]],[t[0],t[3]],e),l=r*(t[3]-t[1]),c=0,u=t[0];u<=t[2];){for(var d=0,p=t[1];p<=t[3];){var f=null,g=null;c%2===0&&d%2===0?(f=ot([[[u,p],[u,p+l],[u+s,p],[u,p]]],e.properties),g=ot([[[u,p+l],[u+s,p+l],[u+s,p],[u,p+l]]],e.properties)):c%2===0&&d%2===1?(f=ot([[[u,p],[u+s,p+l],[u+s,p],[u,p]]],e.properties),g=ot([[[u,p],[u,p+l],[u+s,p+l],[u,p]]],e.properties)):d%2===0&&c%2===1?(f=ot([[[u,p],[u,p+l],[u+s,p+l],[u,p]]],e.properties),g=ot([[[u,p],[u+s,p+l],[u+s,p],[u,p]]],e.properties)):d%2===1&&c%2===1&&(f=ot([[[u,p],[u,p+l],[u+s,p],[u,p]]],e.properties),g=ot([[[u,p+l],[u+s,p+l],[u+s,p],[u,p+l]]],e.properties)),e.mask?(Bh(e.mask,f)&&n.push(f),Bh(e.mask,g)&&n.push(g)):(n.push(f),n.push(g)),p+=l,d++}c++,u+=s}return Nt(n)}function D2(t,i,e){if(e=e||{},typeof e!="object")throw new Error("options is invalid");var n=e.gridType,o=e.property,s=e.weight;if(!t)throw new Error("points is required");if(kT(t,"Point","input must contain Points"),!i)throw new Error("cellSize is required");if(s!==void 0&&typeof s!="number")throw new Error("weight must be a number");o=o||"elevation",n=n||"square",s=s||1;var r=zo(t),l;switch(n){case"point":case"points":l=A0(r,i,e);break;case"square":case"squares":l=M2(r,i,e);break;case"hex":case"hexes":l=E2(r,i,e);break;case"triangle":case"triangles":l=I2(r,i,e);break;default:throw new Error("invalid gridType")}var c=[];return Us(l,function(u){var d=0,p=0;Us(t,function(g){var v=n==="point"?u:LM(u),y=Ri(v,g,e),w;if(o!==void 0&&(w=g.properties[o]),w===void 0&&(w=g.geometry.coordinates[2]),w===void 0)throw new Error("zValue is missing");y===0&&(d=w);var P=1/Math.pow(y,s);p+=P,d+=P*w});var f=FM(u);f.properties[o]=d/p,c.push(f)}),Nt(c)}function R2(t,i,e){const n=h.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=h.Cartesian3.fromDegrees(i[0],i[1],i[2]),s=h.Cartesian3.subtract(o,n,new h.Cartesian3);h.Cartesian3.normalize(s,s);const r=new h.Ray(n,s),l=e.pickFromRay(r);return!!(e.globe.pick(r,e)||l)}const aC=(t=0)=>new Promise(i=>setTimeout(i,t));function F2(t,i){const e=Nt(t.map(c=>dt(c))),n=ot([t]);return D2(e,i,{gridType:"point",units:"meters"}).features.map(c=>c.geometry.coordinates).filter(c=>bt(dt(c),n))}function z2(t){const i=h.JulianDate.fromDate(t),e=h.Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(i);return vr(e)}function L2(t,i,e){const n=t[0]+(i[0]-t[0])*e,o=t[1]+(i[1]-t[1])*e,s=t[2]+(i[2]-t[2])*e,r=t[3]+(i[3]-t[3])*e;return[n,o,s,r]}const Ll=class Ll extends Yt{constructor(e,n){super(e,n);m(this,"czmPointPrimitiveCollection");m(this,"_stopRun",!1);const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.dv(new go(n,e.id));this.czmPointPrimitiveCollection=s,this.d(a.track([s,"show"],[e,"show"]));{const r=async()=>{if(!(e.points&&e.points.length>=3)||e.endTime<e.startTime){s.pointPrimitiveOptions=void 0;return}const u=[...e.points,e.points[0]],d=e.sampleDistance,p=F2(u,d).map(S=>[...S,e.height]),f=Math.floor(e.extrudedHeight/d);if(f>0){const S=[...p];for(let x=1;x<=f;x++)p.push(...S.map(A=>[A[0],A[1],e.height+x*d]))}const{startTime:g,endTime:v,spanTime:y}=e,w=y*36e5,P=Math.floor((v-g)/w),C=Array(p.length).fill(0);e:for(let S=0;S<P;S++){if(await aC(),this._stopRun)break e;const x=new Date(g+S*w),A=z2(x);t:for(let R=0;R<p.length;R++){if(await aC(),this._stopRun)break t;R2(p[R],A,o.scene)||(C[R]=(C[R]*P+1)/P)}!this._stopRun&&(e.progress=Number(((S+1)/P*100).toFixed(2))),console.log("colorScalelist",C),c(p,C)}},l=this.dv(a.createProcessingFromAsyncFunc(async u=>{await u.promise(r())}));this.d(e.startEvent.don(()=>{this._stopRun=!1,s.pointPrimitiveOptions=void 0,e.progress=0,l.restart()})),this.d(e.stopEvent.don(()=>{this._stopRun=!0,s.pointPrimitiveOptions=void 0,e.progress=0,l.isRunning&&l.cancel()}));const c=(u,d)=>{const p=u.map((f,g)=>({position:[...f],color:L2(e.startColor,e.endColor,d[g]),pixelSize:10}));s.pointPrimitiveOptions=p}}}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoPolygon:r}=this;if(!r||!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);if(r.positions){const l=[...r.positions];return r.positions.forEach(c=>{l.push([c[0],c[1],o.extrudedHeight],[c[0],c[1],o.height])}),oe(s,o,n,l,e),!0}return!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,geoPolygon:r}=this;if(!r||!s.actived)return!1;if(o.flyInParam)return super.flyIn(e,n);if(r.positions){const l=[...r.positions];return r.positions.forEach(c=>{l.push([c[0],c[1],o.extrudedHeight],[c[0],c[1],o.height])}),oe(s,o,n,l,e),!0}return!1}};m(Ll,"type",Ll.register("ESCesiumViewer",a.ESSunshineAnalysis.type,Ll));let Gf=Ll;const lC=(t=0)=>new Promise(i=>setTimeout(i,t)),qo=class qo extends a.Destroyable{constructor(e,n){super();m(this,"_pickedEvent",this.disposeVar(new a.Event));m(this,"_startEvent",this.disposeVar(new a.Event));m(this,"_stopEvent",this.dv(new a.Event));m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_geoPolyline");m(this,"_customPrimitive");m(this,"_geoDivPoi");m(this,"_starting",!1);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this._geoPolyline=this.disposeVar(new Se(e,n)),this._customPrimitive=this.disposeVar(new ze(e,n)),this._geoDivPoi=this.disposeVar(new He(e,n)),this.ad(this._geoDivPoi.pickedEvent.don(s=>{Hi(s)===0&&this.pickedEvent.emit(s)})),this._geoPolyline.loop=!0,this.d(this.flyToEvent.don(s=>{this._geoPolyline&&this._geoPolyline.flyTo(s)})),this._customPrimitive.primitiveType="LINES",this._customPrimitive.renderState={depthTest:{enabled:!1},cull:{enabled:!1,face:1029},depthMask:!1,blending:{enabled:!1,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},this._customPrimitive.fragmentShaderSource=`
1878
+ ***************************************************************************** */function t2(t,i){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,o,s,r;return r={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(r[Symbol.iterator]=function(){return this}),r;function l(u){return function(d){return c([u,d])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,o&&(s=u[0]&2?o.return:u[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,u[1])).done)return s;switch(o=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,o=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(s=e.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){e.label=u[1];break}if(u[0]===6&&e.label<s[1]){e.label=s[1],s=u;break}if(s&&e.label<s[2]){e.label=s[2],e.ops.push(u);break}s[2]&&e.ops.pop(),e.trys.pop();continue}u=i.call(t,e)}catch(d){u=[6,d],o=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var Vn=function(){function t(i,e){this.next=null,this.key=i,this.data=e,this.left=null,this.right=null}return t}();function i2(t,i){return t>i?1:t<i?-1:0}function Un(t,i,e){for(var n=new Vn(null,null),o=n,s=n;;){var r=e(t,i.key);if(r<0){if(i.left===null)break;if(e(t,i.left.key)<0){var l=i.left;if(i.left=l.right,l.right=i,i=l,i.left===null)break}s.left=i,s=i,i=i.left}else if(r>0){if(i.right===null)break;if(e(t,i.right.key)>0){var l=i.right;if(i.right=l.left,l.left=i,i=l,i.right===null)break}o.right=i,o=i,i=i.right}else break}return o.right=i.left,s.left=i.right,i.left=n.right,i.right=n.left,i}function zf(t,i,e,n){var o=new Vn(t,i);if(e===null)return o.left=o.right=null,o;e=Un(t,e,n);var s=n(t,e.key);return s<0?(o.left=e.left,o.right=e,e.left=null):s>=0&&(o.right=e.right,o.left=e,e.right=null),o}function Yw(t,i,e){var n=null,o=null;if(i){i=Un(t,i,e);var s=e(i.key,t);s===0?(n=i.left,o=i.right):s<0?(o=i.right,i.right=null,n=i):(n=i.left,i.left=null,o=i)}return{left:n,right:o}}function n2(t,i,e){return i===null?t:(t===null||(i=Un(t.key,i,e),i.left=t),i)}function Lf(t,i,e,n,o){if(t){n(""+i+(e?"└── ":"├── ")+o(t)+`
1879
+ `);var s=i+(e?" ":"│ ");t.left&&Lf(t.left,s,!1,n,o),t.right&&Lf(t.right,s,!0,n,o)}}var Of=function(){function t(i){i===void 0&&(i=i2),this._root=null,this._size=0,this._comparator=i}return t.prototype.insert=function(i,e){return this._size++,this._root=zf(i,e,this._root,this._comparator)},t.prototype.add=function(i,e){var n=new Vn(i,e);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var o=this._comparator,s=Un(i,this._root,o),r=o(i,s.key);return r===0?this._root=s:(r<0?(n.left=s.left,n.right=s,s.left=null):r>0&&(n.right=s.right,n.left=s,s.right=null),this._size++,this._root=n),this._root},t.prototype.remove=function(i){this._root=this._remove(i,this._root,this._comparator)},t.prototype._remove=function(i,e,n){var o;if(e===null)return null;e=Un(i,e,n);var s=n(i,e.key);return s===0?(e.left===null?o=e.right:(o=Un(i,e.left,n),o.right=e.right),this._size--,o):e},t.prototype.pop=function(){var i=this._root;if(i){for(;i.left;)i=i.left;return this._root=Un(i.key,this._root,this._comparator),this._root=this._remove(i.key,this._root,this._comparator),{key:i.key,data:i.data}}return null},t.prototype.findStatic=function(i){for(var e=this._root,n=this._comparator;e;){var o=n(i,e.key);if(o===0)return e;o<0?e=e.left:e=e.right}return null},t.prototype.find=function(i){return this._root&&(this._root=Un(i,this._root,this._comparator),this._comparator(i,this._root.key)!==0)?null:this._root},t.prototype.contains=function(i){for(var e=this._root,n=this._comparator;e;){var o=n(i,e.key);if(o===0)return!0;o<0?e=e.left:e=e.right}return!1},t.prototype.forEach=function(i,e){for(var n=this._root,o=[],s=!1;!s;)n!==null?(o.push(n),n=n.left):o.length!==0?(n=o.pop(),i.call(e,n),n=n.right):s=!0;return this},t.prototype.range=function(i,e,n,o){for(var s=[],r=this._comparator,l=this._root,c;s.length!==0||l;)if(l)s.push(l),l=l.left;else{if(l=s.pop(),c=r(l.key,e),c>0)break;if(r(l.key,i)>=0&&n.call(o,l))return this;l=l.right}return this},t.prototype.keys=function(){var i=[];return this.forEach(function(e){var n=e.key;return i.push(n)}),i},t.prototype.values=function(){var i=[];return this.forEach(function(e){var n=e.data;return i.push(n)}),i},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(i){if(i===void 0&&(i=this._root),i)for(;i.left;)i=i.left;return i},t.prototype.maxNode=function(i){if(i===void 0&&(i=this._root),i)for(;i.right;)i=i.right;return i},t.prototype.at=function(i){for(var e=this._root,n=!1,o=0,s=[];!n;)if(e)s.push(e),e=e.left;else if(s.length>0){if(e=s.pop(),o===i)return e;o++,e=e.right}else n=!0;return null},t.prototype.next=function(i){var e=this._root,n=null;if(i.right){for(n=i.right;n.left;)n=n.left;return n}for(var o=this._comparator;e;){var s=o(i.key,e.key);if(s===0)break;s<0?(n=e,e=e.left):e=e.right}return n},t.prototype.prev=function(i){var e=this._root,n=null;if(i.left!==null){for(n=i.left;n.right;)n=n.right;return n}for(var o=this._comparator;e;){var s=o(i.key,e.key);if(s===0)break;s<0?e=e.left:(n=e,e=e.right)}return n},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return s2(this._root)},t.prototype.load=function(i,e,n){e===void 0&&(e=[]),n===void 0&&(n=!1);var o=i.length,s=this._comparator;if(n&&Vf(i,e,0,o-1,s),this._root===null)this._root=Nf(i,e,0,o),this._size=o;else{var r=r2(this.toList(),o2(i,e),s);o=this._size+o,this._root=Bf({head:r},0,o)}return this},t.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(i){i===void 0&&(i=function(n){return String(n.key)});var e=[];return Lf(this._root,"",!0,function(n){return e.push(n)},i),e.join("")},t.prototype.update=function(i,e,n){var o=this._comparator,s=Yw(i,this._root,o),r=s.left,l=s.right;o(i,e)<0?l=zf(e,n,l,o):r=zf(e,n,r,o),this._root=n2(r,l,o)},t.prototype.split=function(i){return Yw(i,this._root,this._comparator)},t.prototype[Symbol.iterator]=function(){var i,e,n;return t2(this,function(o){switch(o.label){case 0:i=this._root,e=[],n=!1,o.label=1;case 1:return n?[3,6]:i===null?[3,2]:(e.push(i),i=i.left,[3,5]);case 2:return e.length===0?[3,4]:(i=e.pop(),[4,i]);case 3:return o.sent(),i=i.right,[3,5];case 4:n=!0,o.label=5;case 5:return[3,1];case 6:return[2]}})},t}();function Nf(t,i,e,n){var o=n-e;if(o>0){var s=e+Math.floor(o/2),r=t[s],l=i[s],c=new Vn(r,l);return c.left=Nf(t,i,e,s),c.right=Nf(t,i,s+1,n),c}return null}function o2(t,i){for(var e=new Vn(null,null),n=e,o=0;o<t.length;o++)n=n.next=new Vn(t[o],i[o]);return n.next=null,e.next}function s2(t){for(var i=t,e=[],n=!1,o=new Vn(null,null),s=o;!n;)i?(e.push(i),i=i.left):e.length>0?(i=s=s.next=e.pop(),i=i.right):n=!0;return s.next=null,o.next}function Bf(t,i,e){var n=e-i;if(n>0){var o=i+Math.floor(n/2),s=Bf(t,i,o),r=t.head;return r.left=s,t.head=t.head.next,r.right=Bf(t,o+1,e),r}return null}function r2(t,i,e){for(var n=new Vn(null,null),o=n,s=t,r=i;s!==null&&r!==null;)e(s.key,r.key)<0?(o.next=s,s=s.next):(o.next=r,r=r.next),o=o.next;return s!==null?o.next=s:r!==null&&(o.next=r),n.next}function Vf(t,i,e,n,o){if(!(e>=n)){for(var s=t[e+n>>1],r=e-1,l=n+1;;){do r++;while(o(t[r],s)<0);do l--;while(o(t[l],s)>0);if(r>=l)break;var c=t[r];t[r]=t[l],t[l]=c,c=i[r],i[r]=i[l],i[l]=c}Vf(t,i,e,l,o),Vf(t,i,l+1,n,o)}}const nn=11102230246251565e-32,_t=134217729,a2=(3+8*nn)*nn;function Uf(t,i,e,n,o){let s,r,l,c,u=i[0],d=n[0],p=0,f=0;d>u==d>-u?(s=u,u=i[++p]):(s=d,d=n[++f]);let g=0;if(p<t&&f<e)for(d>u==d>-u?(r=u+s,l=s-(r-u),u=i[++p]):(r=d+s,l=s-(r-d),d=n[++f]),s=r,l!==0&&(o[g++]=l);p<t&&f<e;)d>u==d>-u?(r=s+u,c=r-s,l=s-(r-c)+(u-c),u=i[++p]):(r=s+d,c=r-s,l=s-(r-c)+(d-c),d=n[++f]),s=r,l!==0&&(o[g++]=l);for(;p<t;)r=s+u,c=r-s,l=s-(r-c)+(u-c),u=i[++p],s=r,l!==0&&(o[g++]=l);for(;f<e;)r=s+d,c=r-s,l=s-(r-c)+(d-c),d=n[++f],s=r,l!==0&&(o[g++]=l);return(s!==0||g===0)&&(o[g++]=s),g}function l2(t,i){let e=i[0];for(let n=1;n<t;n++)e+=i[n];return e}function ca(t){return new Float64Array(t)}const c2=(3+16*nn)*nn,h2=(2+12*nn)*nn,u2=(9+64*nn)*nn*nn,js=ca(4),Zw=ca(8),Qw=ca(12),kw=ca(16),St=ca(4);function d2(t,i,e,n,o,s,r){let l,c,u,d,p,f,g,v,y,w,P,C,S,x,A,R,L,B;const V=t-o,G=e-o,O=i-s,N=n-s;x=V*N,f=_t*V,g=f-(f-V),v=V-g,f=_t*N,y=f-(f-N),w=N-y,A=v*w-(x-g*y-v*y-g*w),R=O*G,f=_t*O,g=f-(f-O),v=O-g,f=_t*G,y=f-(f-G),w=G-y,L=v*w-(R-g*y-v*y-g*w),P=A-L,p=A-P,js[0]=A-(P+p)+(p-L),C=x+P,p=C-x,S=x-(C-p)+(P-p),P=S-R,p=S-P,js[1]=S-(P+p)+(p-R),B=C+P,p=B-C,js[2]=C-(B-p)+(P-p),js[3]=B;let _=l2(4,js),E=h2*r;if(_>=E||-_>=E||(p=t-V,l=t-(V+p)+(p-o),p=e-G,u=e-(G+p)+(p-o),p=i-O,c=i-(O+p)+(p-s),p=n-N,d=n-(N+p)+(p-s),l===0&&c===0&&u===0&&d===0)||(E=u2*r+a2*Math.abs(_),_+=V*d+N*l-(O*u+G*c),_>=E||-_>=E))return _;x=l*N,f=_t*l,g=f-(f-l),v=l-g,f=_t*N,y=f-(f-N),w=N-y,A=v*w-(x-g*y-v*y-g*w),R=c*G,f=_t*c,g=f-(f-c),v=c-g,f=_t*G,y=f-(f-G),w=G-y,L=v*w-(R-g*y-v*y-g*w),P=A-L,p=A-P,St[0]=A-(P+p)+(p-L),C=x+P,p=C-x,S=x-(C-p)+(P-p),P=S-R,p=S-P,St[1]=S-(P+p)+(p-R),B=C+P,p=B-C,St[2]=C-(B-p)+(P-p),St[3]=B;const D=Uf(4,js,4,St,Zw);x=V*d,f=_t*V,g=f-(f-V),v=V-g,f=_t*d,y=f-(f-d),w=d-y,A=v*w-(x-g*y-v*y-g*w),R=O*u,f=_t*O,g=f-(f-O),v=O-g,f=_t*u,y=f-(f-u),w=u-y,L=v*w-(R-g*y-v*y-g*w),P=A-L,p=A-P,St[0]=A-(P+p)+(p-L),C=x+P,p=C-x,S=x-(C-p)+(P-p),P=S-R,p=S-P,St[1]=S-(P+p)+(p-R),B=C+P,p=B-C,St[2]=C-(B-p)+(P-p),St[3]=B;const z=Uf(D,Zw,4,St,Qw);x=l*d,f=_t*l,g=f-(f-l),v=l-g,f=_t*d,y=f-(f-d),w=d-y,A=v*w-(x-g*y-v*y-g*w),R=c*u,f=_t*c,g=f-(f-c),v=c-g,f=_t*u,y=f-(f-u),w=u-y,L=v*w-(R-g*y-v*y-g*w),P=A-L,p=A-P,St[0]=A-(P+p)+(p-L),C=x+P,p=C-x,S=x-(C-p)+(P-p),P=S-R,p=S-P,St[1]=S-(P+p)+(p-R),B=C+P,p=B-C,St[2]=C-(B-p)+(P-p),St[3]=B;const U=Uf(z,Qw,4,St,kw);return kw[U-1]}function p2(t,i,e,n,o,s){const r=(i-s)*(e-o),l=(t-o)*(n-s),c=r-l,u=Math.abs(r+l);return Math.abs(c)>=c2*u?c:-d2(t,i,e,n,o,s,u)}const ha=(t,i)=>t.ll.x<=i.x&&i.x<=t.ur.x&&t.ll.y<=i.y&&i.y<=t.ur.y,Wf=(t,i)=>{if(i.ur.x<t.ll.x||t.ur.x<i.ll.x||i.ur.y<t.ll.y||t.ur.y<i.ll.y)return null;const e=t.ll.x<i.ll.x?i.ll.x:t.ll.x,n=t.ur.x<i.ur.x?t.ur.x:i.ur.x,o=t.ll.y<i.ll.y?i.ll.y:t.ll.y,s=t.ur.y<i.ur.y?t.ur.y:i.ur.y;return{ll:{x:e,y:o},ur:{x:n,y:s}}};let Wn=Number.EPSILON;Wn===void 0&&(Wn=Math.pow(2,-52));const f2=Wn*Wn,Kw=(t,i)=>{if(-Wn<t&&t<Wn&&-Wn<i&&i<Wn)return 0;const e=t-i;return e*e<f2*t*i?0:t<i?-1:1};class g2{constructor(){this.reset()}reset(){this.xRounder=new Jw,this.yRounder=new Jw}round(i,e){return{x:this.xRounder.round(i),y:this.yRounder.round(e)}}}class Jw{constructor(){this.tree=new Of,this.round(0)}round(i){const e=this.tree.add(i),n=this.tree.prev(e);if(n!==null&&Kw(e.key,n.key)===0)return this.tree.remove(i),n.key;const o=this.tree.next(e);return o!==null&&Kw(e.key,o.key)===0?(this.tree.remove(i),o.key):i}}const ua=new g2,Lh=(t,i)=>t.x*i.y-t.y*i.x,jw=(t,i)=>t.x*i.x+t.y*i.y,eC=(t,i,e)=>{const n=p2(t.x,t.y,i.x,i.y,e.x,e.y);return n>0?-1:n<0?1:0},Oh=t=>Math.sqrt(jw(t,t)),m2=(t,i,e)=>{const n={x:i.x-t.x,y:i.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return Lh(o,n)/Oh(o)/Oh(n)},v2=(t,i,e)=>{const n={x:i.x-t.x,y:i.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return jw(o,n)/Oh(o)/Oh(n)},tC=(t,i,e)=>i.y===0?null:{x:t.x+i.x/i.y*(e-t.y),y:e},iC=(t,i,e)=>i.x===0?null:{x:e,y:t.y+i.y/i.x*(e-t.x)},y2=(t,i,e,n)=>{if(i.x===0)return iC(e,n,t.x);if(n.x===0)return iC(t,i,e.x);if(i.y===0)return tC(e,n,t.y);if(n.y===0)return tC(t,i,e.y);const o=Lh(i,n);if(o==0)return null;const s={x:e.x-t.x,y:e.y-t.y},r=Lh(s,i)/o,l=Lh(s,n)/o,c=t.x+l*i.x,u=e.x+r*n.x,d=t.y+l*i.y,p=e.y+r*n.y,f=(c+u)/2,g=(d+p)/2;return{x:f,y:g}};class si{static compare(i,e){const n=si.comparePoints(i.point,e.point);return n!==0?n:(i.point!==e.point&&i.link(e),i.isLeft!==e.isLeft?i.isLeft?1:-1:Gn.compare(i.segment,e.segment))}static comparePoints(i,e){return i.x<e.x?-1:i.x>e.x?1:i.y<e.y?-1:i.y>e.y?1:0}constructor(i,e){i.events===void 0?i.events=[this]:i.events.push(this),this.point=i,this.isLeft=e}link(i){if(i.point===this.point)throw new Error("Tried to link already linked events");const e=i.point.events;for(let n=0,o=e.length;n<o;n++){const s=e[n];this.point.events.push(s),s.point=this.point}this.checkForConsuming()}checkForConsuming(){const i=this.point.events.length;for(let e=0;e<i;e++){const n=this.point.events[e];if(n.segment.consumedBy===void 0)for(let o=e+1;o<i;o++){const s=this.point.events[o];s.consumedBy===void 0&&n.otherSE.point.events===s.otherSE.point.events&&n.segment.consume(s.segment)}}}getAvailableLinkedEvents(){const i=[];for(let e=0,n=this.point.events.length;e<n;e++){const o=this.point.events[e];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&i.push(o)}return i}getLeftmostComparator(i){const e=new Map,n=o=>{const s=o.otherSE;e.set(o,{sine:m2(this.point,i.point,s.point),cosine:v2(this.point,i.point,s.point)})};return(o,s)=>{e.has(o)||n(o),e.has(s)||n(s);const{sine:r,cosine:l}=e.get(o),{sine:c,cosine:u}=e.get(s);return r>=0&&c>=0?l<u?1:l>u?-1:0:r<0&&c<0?l<u?-1:l>u?1:0:c<r?-1:c>r?1:0}}}let w2=0;class Gn{static compare(i,e){const n=i.leftSE.point.x,o=e.leftSE.point.x,s=i.rightSE.point.x,r=e.rightSE.point.x;if(r<n)return 1;if(s<o)return-1;const l=i.leftSE.point.y,c=e.leftSE.point.y,u=i.rightSE.point.y,d=e.rightSE.point.y;if(n<o){if(c<l&&c<u)return 1;if(c>l&&c>u)return-1;const p=i.comparePoint(e.leftSE.point);if(p<0)return 1;if(p>0)return-1;const f=e.comparePoint(i.rightSE.point);return f!==0?f:-1}if(n>o){if(l<c&&l<d)return-1;if(l>c&&l>d)return 1;const p=e.comparePoint(i.leftSE.point);if(p!==0)return p;const f=i.comparePoint(e.rightSE.point);return f<0?1:f>0?-1:1}if(l<c)return-1;if(l>c)return 1;if(s<r){const p=e.comparePoint(i.rightSE.point);if(p!==0)return p}if(s>r){const p=i.comparePoint(e.rightSE.point);if(p<0)return 1;if(p>0)return-1}if(s!==r){const p=u-l,f=s-n,g=d-c,v=r-o;if(p>f&&g<v)return 1;if(p<f&&g>v)return-1}return s>r?1:s<r||u<d?-1:u>d?1:i.id<e.id?-1:i.id>e.id?1:0}constructor(i,e,n,o){this.id=++w2,this.leftSE=i,i.segment=this,i.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=i,this.rings=n,this.windings=o}static fromRing(i,e,n){let o,s,r;const l=si.comparePoints(i,e);if(l<0)o=i,s=e,r=1;else if(l>0)o=e,s=i,r=-1;else throw new Error(`Tried to create degenerate segment at [${i.x}, ${i.y}]`);const c=new si(o,!0),u=new si(s,!1);return new Gn(c,u,[n],[r])}replaceRightSE(i){this.rightSE=i,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const i=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:i<e?i:e},ur:{x:this.rightSE.point.x,y:i>e?i:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(i){return i.x===this.leftSE.point.x&&i.y===this.leftSE.point.y||i.x===this.rightSE.point.x&&i.y===this.rightSE.point.y}comparePoint(i){if(this.isAnEndpoint(i))return 0;const e=this.leftSE.point,n=this.rightSE.point,o=this.vector();if(e.x===n.x)return i.x===e.x?0:i.x<e.x?1:-1;const s=(i.y-e.y)/o.y,r=e.x+s*o.x;if(i.x===r)return 0;const l=(i.x-e.x)/o.x,c=e.y+l*o.y;return i.y===c?0:i.y<c?-1:1}getIntersection(i){const e=this.bbox(),n=i.bbox(),o=Wf(e,n);if(o===null)return null;const s=this.leftSE.point,r=this.rightSE.point,l=i.leftSE.point,c=i.rightSE.point,u=ha(e,l)&&this.comparePoint(l)===0,d=ha(n,s)&&i.comparePoint(s)===0,p=ha(e,c)&&this.comparePoint(c)===0,f=ha(n,r)&&i.comparePoint(r)===0;if(d&&u)return f&&!p?r:!f&&p?c:null;if(d)return p&&s.x===c.x&&s.y===c.y?null:s;if(u)return f&&r.x===l.x&&r.y===l.y?null:l;if(f&&p)return null;if(f)return r;if(p)return c;const g=y2(s,this.vector(),l,i.vector());return g===null||!ha(o,g)?null:ua.round(g.x,g.y)}split(i){const e=[],n=i.events!==void 0,o=new si(i,!0),s=new si(i,!1),r=this.rightSE;this.replaceRightSE(s),e.push(s),e.push(o);const l=new Gn(o,r,this.rings.slice(),this.windings.slice());return si.comparePoints(l.leftSE.point,l.rightSE.point)>0&&l.swapEvents(),si.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(o.checkForConsuming(),s.checkForConsuming()),e}swapEvents(){const i=this.rightSE;this.rightSE=this.leftSE,this.leftSE=i,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,n=this.windings.length;e<n;e++)this.windings[e]*=-1}consume(i){let e=this,n=i;for(;e.consumedBy;)e=e.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const o=Gn.compare(e,n);if(o!==0){if(o>0){const s=e;e=n,n=s}if(e.prev===n){const s=e;e=n,n=s}for(let s=0,r=n.rings.length;s<r;s++){const l=n.rings[s],c=n.windings[s],u=e.rings.indexOf(l);u===-1?(e.rings.push(l),e.windings.push(c)):e.windings[u]+=c}n.rings=null,n.windings=null,n.consumedBy=e,n.leftSE.consumedBy=e.leftSE,n.rightSE.consumedBy=e.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const i=this.prev.consumedBy||this.prev;this._beforeState=i.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const i=this.beforeState();this._afterState={rings:i.rings.slice(0),windings:i.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,n=this._afterState.windings,o=this._afterState.multiPolys;for(let l=0,c=this.rings.length;l<c;l++){const u=this.rings[l],d=this.windings[l],p=e.indexOf(u);p===-1?(e.push(u),n.push(d)):n[p]+=d}const s=[],r=[];for(let l=0,c=e.length;l<c;l++){if(n[l]===0)continue;const u=e[l],d=u.poly;if(r.indexOf(d)===-1)if(u.isExterior)s.push(d);else{r.indexOf(d)===-1&&r.push(d);const p=s.indexOf(u.poly);p!==-1&&s.splice(p,1)}}for(let l=0,c=s.length;l<c;l++){const u=s[l].multiPoly;o.indexOf(u)===-1&&o.push(u)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const i=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(vi.type){case"union":{const n=i.length===0,o=e.length===0;this._isInResult=n!==o;break}case"intersection":{let n,o;i.length<e.length?(n=i.length,o=e.length):(n=e.length,o=i.length),this._isInResult=o===vi.numMultiPolys&&n<o;break}case"xor":{const n=Math.abs(i.length-e.length);this._isInResult=n%2===1;break}case"difference":{const n=o=>o.length===1&&o[0].isSubject;this._isInResult=n(i)!==n(e);break}default:throw new Error(`Unrecognized operation type found ${vi.type}`)}return this._isInResult}}class nC{constructor(i,e,n){if(!Array.isArray(i)||i.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=n,this.segments=[],typeof i[0][0]!="number"||typeof i[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const o=ua.round(i[0][0],i[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};let s=o;for(let r=1,l=i.length;r<l;r++){if(typeof i[r][0]!="number"||typeof i[r][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let c=ua.round(i[r][0],i[r][1]);c.x===s.x&&c.y===s.y||(this.segments.push(Gn.fromRing(s,c,this)),c.x<this.bbox.ll.x&&(this.bbox.ll.x=c.x),c.y<this.bbox.ll.y&&(this.bbox.ll.y=c.y),c.x>this.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),s=c)}(o.x!==s.x||o.y!==s.y)&&this.segments.push(Gn.fromRing(s,o,this))}getSweepEvents(){const i=[];for(let e=0,n=this.segments.length;e<n;e++){const o=this.segments[e];i.push(o.leftSE),i.push(o.rightSE)}return i}}class C2{constructor(i,e){if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new nC(i[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let n=1,o=i.length;n<o;n++){const s=new nC(i[n],this,!1);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.interiorRings.push(s)}this.multiPoly=e}getSweepEvents(){const i=this.exteriorRing.getSweepEvents();for(let e=0,n=this.interiorRings.length;e<n;e++){const o=this.interiorRings[e].getSweepEvents();for(let s=0,r=o.length;s<r;s++)i.push(o[s])}return i}}class oC{constructor(i,e){if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof i[0][0][0]=="number"&&(i=[i])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let n=0,o=i.length;n<o;n++){const s=new C2(i[n],this);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.polys.push(s)}this.isSubject=e}getSweepEvents(){const i=[];for(let e=0,n=this.polys.length;e<n;e++){const o=this.polys[e].getSweepEvents();for(let s=0,r=o.length;s<r;s++)i.push(o[s])}return i}}class Nh{static factory(i){const e=[];for(let n=0,o=i.length;n<o;n++){const s=i[n];if(!s.isInResult()||s.ringOut)continue;let r=null,l=s.leftSE,c=s.rightSE;const u=[l],d=l.point,p=[];for(;r=l,l=c,u.push(l),l.point!==d;)for(;;){const f=l.getAvailableLinkedEvents();if(f.length===0){const y=u[0].point,w=u[u.length-1].point;throw new Error(`Unable to complete output ring starting at [${y.x}, ${y.y}]. Last matching segment found ends at [${w.x}, ${w.y}].`)}if(f.length===1){c=f[0].otherSE;break}let g=null;for(let y=0,w=p.length;y<w;y++)if(p[y].point===l.point){g=y;break}if(g!==null){const y=p.splice(g)[0],w=u.splice(y.index);w.unshift(w[0].otherSE),e.push(new Nh(w.reverse()));continue}p.push({index:u.length,point:l.point});const v=l.getLeftmostComparator(r);c=f.sort(v)[0].otherSE;break}e.push(new Nh(u))}return e}constructor(i){this.events=i;for(let e=0,n=i.length;e<n;e++)i[e].segment.ringOut=this;this.poly=null}getGeom(){let i=this.events[0].point;const e=[i];for(let u=1,d=this.events.length-1;u<d;u++){const p=this.events[u].point,f=this.events[u+1].point;eC(p,i,f)!==0&&(e.push(p),i=p)}if(e.length===1)return null;const n=e[0],o=e[1];eC(n,i,o)===0&&e.shift(),e.push(e[0]);const s=this.isExteriorRing()?1:-1,r=this.isExteriorRing()?0:e.length-1,l=this.isExteriorRing()?e.length:-1,c=[];for(let u=r;u!=l;u+=s)c.push([e[u].x,e[u].y]);return c}isExteriorRing(){if(this._isExteriorRing===void 0){const i=this.enclosingRing();this._isExteriorRing=i?!i.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let i=this.events[0];for(let o=1,s=this.events.length;o<s;o++){const r=this.events[o];si.compare(i,r)>0&&(i=r)}let e=i.segment.prevInResult(),n=e?e.prevInResult():null;for(;;){if(!e)return null;if(!n)return e.ringOut;if(n.ringOut!==e.ringOut)return n.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=n.prevInResult(),n=e?e.prevInResult():null}}}class sC{constructor(i){this.exteriorRing=i,i.poly=this,this.interiorRings=[]}addInterior(i){this.interiorRings.push(i),i.poly=this}getGeom(){const i=[this.exteriorRing.getGeom()];if(i[0]===null)return null;for(let e=0,n=this.interiorRings.length;e<n;e++){const o=this.interiorRings[e].getGeom();o!==null&&i.push(o)}return i}}class _2{constructor(i){this.rings=i,this.polys=this._composePolys(i)}getGeom(){const i=[];for(let e=0,n=this.polys.length;e<n;e++){const o=this.polys[e].getGeom();o!==null&&i.push(o)}return i}_composePolys(i){const e=[];for(let n=0,o=i.length;n<o;n++){const s=i[n];if(!s.poly)if(s.isExteriorRing())e.push(new sC(s));else{const r=s.enclosingRing();r.poly||e.push(new sC(r)),r.poly.addInterior(s)}}return e}}class P2{constructor(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Gn.compare;this.queue=i,this.tree=new Of(e),this.segments=[]}process(i){const e=i.segment,n=[];if(i.consumedBy)return i.isLeft?this.queue.remove(i.otherSE):this.tree.remove(e),n;const o=i.isLeft?this.tree.add(e):this.tree.find(e);if(!o)throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);let s=o,r=o,l,c;for(;l===void 0;)s=this.tree.prev(s),s===null?l=null:s.key.consumedBy===void 0&&(l=s.key);for(;c===void 0;)r=this.tree.next(r),r===null?c=null:r.key.consumedBy===void 0&&(c=r.key);if(i.isLeft){let u=null;if(l){const p=l.getIntersection(e);if(p!==null&&(e.isAnEndpoint(p)||(u=p),!l.isAnEndpoint(p))){const f=this._splitSafely(l,p);for(let g=0,v=f.length;g<v;g++)n.push(f[g])}}let d=null;if(c){const p=c.getIntersection(e);if(p!==null&&(e.isAnEndpoint(p)||(d=p),!c.isAnEndpoint(p))){const f=this._splitSafely(c,p);for(let g=0,v=f.length;g<v;g++)n.push(f[g])}}if(u!==null||d!==null){let p=null;u===null?p=d:d===null?p=u:p=si.comparePoints(u,d)<=0?u:d,this.queue.remove(e.rightSE),n.push(e.rightSE);const f=e.split(p);for(let g=0,v=f.length;g<v;g++)n.push(f[g])}n.length>0?(this.tree.remove(e),n.push(i)):(this.segments.push(e),e.prev=l)}else{if(l&&c){const u=l.getIntersection(c);if(u!==null){if(!l.isAnEndpoint(u)){const d=this._splitSafely(l,u);for(let p=0,f=d.length;p<f;p++)n.push(d[p])}if(!c.isAnEndpoint(u)){const d=this._splitSafely(c,u);for(let p=0,f=d.length;p<f;p++)n.push(d[p])}}}this.tree.remove(e)}return n}_splitSafely(i,e){this.tree.remove(i);const n=i.rightSE;this.queue.remove(n);const o=i.split(e);return o.push(n),i.consumedBy===void 0&&this.tree.add(i),o}}const rC=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,b2=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class S2{run(i,e,n){vi.type=i,ua.reset();const o=[new oC(e,!0)];for(let p=0,f=n.length;p<f;p++)o.push(new oC(n[p],!1));if(vi.numMultiPolys=o.length,vi.type==="difference"){const p=o[0];let f=1;for(;f<o.length;)Wf(o[f].bbox,p.bbox)!==null?f++:o.splice(f,1)}if(vi.type==="intersection")for(let p=0,f=o.length;p<f;p++){const g=o[p];for(let v=p+1,y=o.length;v<y;v++)if(Wf(g.bbox,o[v].bbox)===null)return[]}const s=new Of(si.compare);for(let p=0,f=o.length;p<f;p++){const g=o[p].getSweepEvents();for(let v=0,y=g.length;v<y;v++)if(s.insert(g[v]),s.size>rC)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const r=new P2(s);let l=s.size,c=s.pop();for(;c;){const p=c.key;if(s.size===l){const g=p.segment;throw new Error(`Unable to pop() ${p.isLeft?"left":"right"} SweepEvent [${p.point.x}, ${p.point.y}] from segment #${g.id} [${g.leftSE.point.x}, ${g.leftSE.point.y}] -> [${g.rightSE.point.x}, ${g.rightSE.point.y}] from queue.`)}if(s.size>rC)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(r.segments.length>b2)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=r.process(p);for(let g=0,v=f.length;g<v;g++){const y=f[g];y.consumedBy===void 0&&s.insert(y)}l=s.size,c=s.pop()}ua.reset();const u=Nh.factory(r.segments);return new _2(u).getGeom()}}const vi=new S2;var E2={union:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return vi.run("union",t,e)},intersection:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return vi.run("intersection",t,e)},xor:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return vi.run("xor",t,e)},difference:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return vi.run("difference",t,e)}};function Bh(t,i,e){e===void 0&&(e={});var n=Di(t),o=Di(i),s=E2.intersection(n.coordinates,o.coordinates);return s.length===0?null:s.length===1?ot(s[0],e.properties):nf(s,e.properties)}function x2(t,i,e){e===void 0&&(e={});var n=JSON.stringify(e.properties||{}),o=t[0],s=t[1],r=t[2],l=t[3],c=(s+l)/2,u=(o+r)/2,d=i*2/Ri([o,c],[r,c],e),p=d*(r-o),f=i*2/Ri([u,s],[u,l],e),g=f*(l-s),v=p/2,y=v*2,w=Math.sqrt(3)/2*g,P=r-o,C=l-s,S=3/4*y,x=w,A=(P-y)/(y-v/2),R=Math.floor(A),L=(R*S-v/2-P)/2-v/2+S/2,B=Math.floor((C-w)/w),V=(C-B*w)/2,G=B*w-C>w/2;G&&(V-=w/4);for(var O=[],N=[],_=0;_<6;_++){var E=2*Math.PI/6*_;O.push(Math.cos(E)),N.push(Math.sin(E))}for(var D=[],z=0;z<=R;z++)for(var U=0;U<=B;U++){var Y=z%2===1;if(!(U===0&&Y)&&!(U===0&&G)){var q=z*S+o-L,X=U*x+s+V;if(Y&&(X-=w/2),e.triangles===!0)T2([q,X],p/2,g/2,JSON.parse(n),O,N).forEach(function(j){e.mask?Bh(e.mask,j)&&D.push(j):D.push(j)});else{var Q=A2([q,X],p/2,g/2,JSON.parse(n),O,N);e.mask?Bh(e.mask,Q)&&D.push(Q):D.push(Q)}}}return Nt(D)}function A2(t,i,e,n,o,s){for(var r=[],l=0;l<6;l++){var c=t[0]+i*o[l],u=t[1]+e*s[l];r.push([c,u])}return r.push(r[0].slice()),ot([r],n)}function T2(t,i,e,n,o,s){for(var r=[],l=0;l<6;l++){var c=[];c.push(t),c.push([t[0]+i*o[l],t[1]+e*s[l]]),c.push([t[0]+i*o[(l+1)%6],t[1]+e*s[(l+1)%6]]),c.push(t),r.push(ot([c],n))}return r}function M2(t,i,e,n){n===void 0&&(n={});for(var o=[],s=t[0],r=t[1],l=t[2],c=t[3],u=i/Ri([s,r],[l,r],n),d=u*(l-s),p=e/Ri([s,r],[s,c],n),f=p*(c-r),g=l-s,v=c-r,y=Math.floor(g/d),w=Math.floor(v/f),P=(g-y*d)/2,C=(v-w*f)/2,S=s+P,x=0;x<y;x++){for(var A=r+C,R=0;R<w;R++){var L=ot([[[S,A],[S,A+f],[S+d,A+f],[S+d,A],[S,A]]],n.properties);n.mask?e2(n.mask,L)&&o.push(L):o.push(L),A+=f}S+=d}return Nt(o)}function I2(t,i,e){return e===void 0&&(e={}),M2(t,i,i,e)}function D2(t,i,e){e===void 0&&(e={});for(var n=[],o=i/Ri([t[0],t[1]],[t[2],t[1]],e),s=o*(t[2]-t[0]),r=i/Ri([t[0],t[1]],[t[0],t[3]],e),l=r*(t[3]-t[1]),c=0,u=t[0];u<=t[2];){for(var d=0,p=t[1];p<=t[3];){var f=null,g=null;c%2===0&&d%2===0?(f=ot([[[u,p],[u,p+l],[u+s,p],[u,p]]],e.properties),g=ot([[[u,p+l],[u+s,p+l],[u+s,p],[u,p+l]]],e.properties)):c%2===0&&d%2===1?(f=ot([[[u,p],[u+s,p+l],[u+s,p],[u,p]]],e.properties),g=ot([[[u,p],[u,p+l],[u+s,p+l],[u,p]]],e.properties)):d%2===0&&c%2===1?(f=ot([[[u,p],[u,p+l],[u+s,p+l],[u,p]]],e.properties),g=ot([[[u,p],[u+s,p+l],[u+s,p],[u,p]]],e.properties)):d%2===1&&c%2===1&&(f=ot([[[u,p],[u,p+l],[u+s,p],[u,p]]],e.properties),g=ot([[[u,p+l],[u+s,p+l],[u+s,p],[u,p+l]]],e.properties)),e.mask?(Bh(e.mask,f)&&n.push(f),Bh(e.mask,g)&&n.push(g)):(n.push(f),n.push(g)),p+=l,d++}c++,u+=s}return Nt(n)}function R2(t,i,e){if(e=e||{},typeof e!="object")throw new Error("options is invalid");var n=e.gridType,o=e.property,s=e.weight;if(!t)throw new Error("points is required");if(KT(t,"Point","input must contain Points"),!i)throw new Error("cellSize is required");if(s!==void 0&&typeof s!="number")throw new Error("weight must be a number");o=o||"elevation",n=n||"square",s=s||1;var r=zo(t),l;switch(n){case"point":case"points":l=A0(r,i,e);break;case"square":case"squares":l=I2(r,i,e);break;case"hex":case"hexes":l=x2(r,i,e);break;case"triangle":case"triangles":l=D2(r,i,e);break;default:throw new Error("invalid gridType")}var c=[];return Us(l,function(u){var d=0,p=0;Us(t,function(g){var v=n==="point"?u:OM(u),y=Ri(v,g,e),w;if(o!==void 0&&(w=g.properties[o]),w===void 0&&(w=g.geometry.coordinates[2]),w===void 0)throw new Error("zValue is missing");y===0&&(d=w);var P=1/Math.pow(y,s);p+=P,d+=P*w});var f=zM(u);f.properties[o]=d/p,c.push(f)}),Nt(c)}function F2(t,i,e){const n=h.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=h.Cartesian3.fromDegrees(i[0],i[1],i[2]),s=h.Cartesian3.subtract(o,n,new h.Cartesian3);h.Cartesian3.normalize(s,s);const r=new h.Ray(n,s),l=e.pickFromRay(r);return!!(e.globe.pick(r,e)||l)}const aC=(t=0)=>new Promise(i=>setTimeout(i,t));function z2(t,i){const e=Nt(t.map(c=>dt(c))),n=ot([t]);return R2(e,i,{gridType:"point",units:"meters"}).features.map(c=>c.geometry.coordinates).filter(c=>bt(dt(c),n))}function L2(t){const i=h.JulianDate.fromDate(t),e=h.Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(i);return vr(e)}function O2(t,i,e){const n=t[0]+(i[0]-t[0])*e,o=t[1]+(i[1]-t[1])*e,s=t[2]+(i[2]-t[2])*e,r=t[3]+(i[3]-t[3])*e;return[n,o,s,r]}const Ll=class Ll extends Yt{constructor(e,n){super(e,n);m(this,"czmPointPrimitiveCollection");m(this,"_stopRun",!1);const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.dv(new go(n,e.id));this.czmPointPrimitiveCollection=s,this.d(a.track([s,"show"],[e,"show"]));{const r=async()=>{if(!(e.points&&e.points.length>=3)||e.endTime<e.startTime){s.pointPrimitiveOptions=void 0;return}const u=[...e.points,e.points[0]],d=e.sampleDistance,p=z2(u,d).map(S=>[...S,e.height]),f=Math.floor(e.extrudedHeight/d);if(f>0){const S=[...p];for(let x=1;x<=f;x++)p.push(...S.map(A=>[A[0],A[1],e.height+x*d]))}const{startTime:g,endTime:v,spanTime:y}=e,w=y*36e5,P=Math.floor((v-g)/w),C=Array(p.length).fill(0);e:for(let S=0;S<P;S++){if(await aC(),this._stopRun)break e;const x=new Date(g+S*w),A=L2(x);t:for(let R=0;R<p.length;R++){if(await aC(),this._stopRun)break t;F2(p[R],A,o.scene)||(C[R]=(C[R]*P+1)/P)}!this._stopRun&&(e.progress=Number(((S+1)/P*100).toFixed(2))),console.log("colorScalelist",C),c(p,C)}},l=this.dv(a.createProcessingFromAsyncFunc(async u=>{await u.promise(r())}));this.d(e.startEvent.don(()=>{this._stopRun=!1,s.pointPrimitiveOptions=void 0,e.progress=0,l.restart()})),this.d(e.stopEvent.don(()=>{this._stopRun=!0,s.pointPrimitiveOptions=void 0,e.progress=0,l.isRunning&&l.cancel()}));const c=(u,d)=>{const p=u.map((f,g)=>({position:[...f],color:O2(e.startColor,e.endColor,d[g]),pixelSize:10}));s.pointPrimitiveOptions=p}}}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoPolygon:r}=this;if(!r||!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);if(r.positions){const l=[...r.positions];return r.positions.forEach(c=>{l.push([c[0],c[1],o.extrudedHeight],[c[0],c[1],o.height])}),oe(s,o,n,l,e),!0}return!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,geoPolygon:r}=this;if(!r||!s.actived)return!1;if(o.flyInParam)return super.flyIn(e,n);if(r.positions){const l=[...r.positions];return r.positions.forEach(c=>{l.push([c[0],c[1],o.extrudedHeight],[c[0],c[1],o.height])}),oe(s,o,n,l,e),!0}return!1}};m(Ll,"type",Ll.register("ESCesiumViewer",a.ESSunshineAnalysis.type,Ll));let Gf=Ll;const lC=(t=0)=>new Promise(i=>setTimeout(i,t)),qo=class qo extends a.Destroyable{constructor(e,n){super();m(this,"_pickedEvent",this.disposeVar(new a.Event));m(this,"_startEvent",this.disposeVar(new a.Event));m(this,"_stopEvent",this.dv(new a.Event));m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_geoPolyline");m(this,"_customPrimitive");m(this,"_geoDivPoi");m(this,"_starting",!1);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this._geoPolyline=this.disposeVar(new Se(e,n)),this._customPrimitive=this.disposeVar(new ze(e,n)),this._geoDivPoi=this.disposeVar(new He(e,n)),this.ad(this._geoDivPoi.pickedEvent.don(s=>{Hi(s)===0&&this.pickedEvent.emit(s)})),this._geoPolyline.loop=!0,this.d(this.flyToEvent.don(s=>{this._geoPolyline&&this._geoPolyline.flyTo(s)})),this._customPrimitive.primitiveType="LINES",this._customPrimitive.renderState={depthTest:{enabled:!1},cull:{enabled:!1,face:1029},depthMask:!1,blending:{enabled:!1,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},this._customPrimitive.fragmentShaderSource=`
1880
1880
  uniform vec4 u_color;
1881
1881
  void main()
1882
1882
  {
@@ -1888,7 +1888,7 @@ void main()
1888
1888
  gl_Position = czm_modelViewProjection * vec4(position, 1.0);
1889
1889
  }
1890
1890
  `,this._customPrimitive.uniformMap={u_color:[1,1,0,1]},this.d(a.track([this._customPrimitive,"show"],[this,"show"])),this.d(a.track([this._geoPolyline,"show"],[this,"show"])),this.d(a.bind([this._geoPolyline,"positions"],[this,"positions"])),this.d(a.bind([this._geoPolyline,"width"],[this,"outlineWidth"])),this.d(a.bind([this._geoPolyline,"color"],[this,"outlineColor"]));{let s=function(u,d){const p=[];for(const f of d)switch(f){case"SquareMeter_SquareKilometer":u>=1e6?p.push(`面积:${(u/1e6).toFixed(2)} km²`):p.push(`面积:${u.toFixed(2)} m²`);break;case"MU_Hectare":const g=u*(1/666.7);if(g>=15){const v=g/15;p.push(`面积:${v.toFixed(2)} 公顷`)}else p.push(`面积:${g.toFixed(2)} 亩`);break}return p};const r=()=>{let u=[];this.totalArea?this._starting?u=["分析计算中..."]:u=[...s(this.totalArea,this.units)]:this._starting?u=["分析计算中..."]:u=["暂无分析结果"],this._geoDivPoi&&(this._geoDivPoi.innerHTML=ao([...u].join(`
1891
- `),24))};r(),this.d(this.totalAreaChanged.don(r)),this.d(this.unitsChanged.don(r)),this.d(a.track([this._geoDivPoi,"show"],[this,"show"])),this.d(this.positionsChanged.don(()=>{this._geoDivPoi&&(this.positions&&this.positions.length>=3?this._geoDivPoi.position=wy(this.positions):this._geoDivPoi.position=void 0)}));const l=async()=>{if((!this.positions||this.positions.length<3)&&this.customPrimitive){this.totalArea=0,this.customPrimitive.position=void 0,this.customPrimitive.attributes=void 0,this.customPrimitive.indexTypedArray=void 0,this.customPrimitive.show=!1;return}const u=this.interpolationDistance??qo.defaults.interpolationDistance,d=this.interpolation??qo.defaults.interpolation,p=this.offsetHeight??qo.defaults.offsetHeight,f=this.drillDepth??qo.defaults.drillDepth,g=[];if(this.positions)for(let q=0;q<this.positions.length;++q){const X=h.Cartesian3.fromDegrees(this.positions[q][0],this.positions[q][1],this.positions[q][2]);g.push(X)}var v=N2(g);if(isNaN(v.x)||isNaN(v.y)||isNaN(v.z)){console.warn("法向量计算错误!");return}var y=B2(g),w=h.Cartesian3.normalize(y,new h.Cartesian3),P=h.Cartesian3.dot(w,v);P<0&&(v=cC(v),g.reverse());let C=h.Transforms.eastNorthUpToFixedFrame(y),S=h.Matrix4.inverseTransformation(C,new h.Matrix4);if(Math.abs(P)<.999){const q=V2(v,w);var x=cC(y),A=h.Matrix4.fromTranslation(x,new h.Matrix4);S=h.Matrix4.multiply(q,A,A),C=h.Matrix4.inverse(S,new h.Matrix4)}var R=er(g,S),L=[],B=[],V=W2(R);if(d&&u>0){var G=U2(R);const q=Math.max(G.maxy-G.miny,G.maxx-G.minx);var O=q2(V,G,u);const X=await Hf(O,C,S,v,o.scene,p,f,q);var N=X2(R,u);const Q=await Hf(N,C,S,v,o.scene,p,f,q);B.push(...X.world_cartesian),L.push(...X.local),B.push(...Q.world_cartesian),L.push(...Q.local);for(let j=0;j<R.length;++j){const ae=R[j];var _=await Hf([ae],C,S,v,o.scene,p,f,q);if(_.local.length>0)L.push(..._.local),B.push(..._.world_cartesian);else{const ue=[ae.x,ae.y,ae.z+p];L.push(ue);var E=er([h.Cartesian3.fromArray(ue)],C);for(let fe=0;fe<E.length;++fe)B.push(E[fe])}}}else{const q=R.map(X=>h.Cartesian3.fromArray([X.x,X.y,X.z+q]));L=q,B=er(q,C)}var D=G2(L,V);const z=H2(B,D);this.totalArea=z;const U=[];L.forEach(q=>{const X=[q.x,q.y,q.z];X&&U.push(...X)});const Y={position:{typedArray:new Float32Array(U),componentsPerAttribute:3}};if(this.customPrimitive){this.customPrimitive.modelMatrix=h.Matrix4.toArray(C),this.customPrimitive.attributes=Y;const q=await O2([...D]);this.customPrimitive.indexTypedArray=new Uint32Array(q),this.customPrimitive.show=!0;const X=this.customPrimitive.computeLocalAxisedBoundingBoxFromAttribute("position");if(!X)return;const{min:Q,max:j}=X;this.customPrimitive.setLocalAxisedBoundingBox(Q,j)}},c=this.dv(a.createProcessingFromAsyncFunc(async u=>{await u.promise(l()),this._starting=!1,r()}));this.d(this.startEvent.don(()=>{if(this._starting){console.log("正在计算中...");return}this._starting=!0,r(),c.restart()})),this.d(this.stopEvent.don(()=>{c.cancel(),this._starting=!1,this.totalArea=0,this.customPrimitive.position=void 0,this.customPrimitive.attributes=void 0,this.customPrimitive.indexTypedArray=void 0,this.customPrimitive.show=!1,r()}))}}get pickedEvent(){return this._pickedEvent}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get stopEvent(){return this._stopEvent}stop(){this._stopEvent.emit()}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolyline(){return this._geoPolyline}get customPrimitive(){return this._customPrimitive}get geoDivPoi(){return this._geoDivPoi}};m(qo,"defaults",{positions:[],totalArea:0,interpolation:!0,interpolationDistance:.5,offsetHeight:0,drillDepth:3,outlineWidth:2,outlineColor:[1,1,1,1]});let Oo=qo;(t=>{t.createDefaultProps=()=>({positions:a.reactArrayWithUndefined(void 0),show:void 0,totalArea:void 0,interpolationDistance:void 0,interpolation:void 0,offsetHeight:void 0,drillDepth:void 0,outlineWidth:void 0,outlineColor:a.reactArray([1,1,1,1]),units:a.reactArray(["SquareMeter_SquareKilometer","MU_Hectare"])})})(Oo||(Oo={})),a.extendClassProps(Oo.prototype,Oo.createDefaultProps);async function O2(t){t.length%3!==0&&console.warn("当前传入的索引不是3的倍数,可能不是三角片的索引!");const i=t.length/3|0,e=new Array(i*6);for(let n=0;n<i;++n)await lC(),e[n*6+0]=t[n*3+0],e[n*6+1]=t[n*3+1],e[n*6+2]=t[n*3+2],e[n*6+3]=t[n*3+1],e[n*6+4]=t[n*3+2],e[n*6+5]=t[n*3+0];return e}function N2(t){var i=new h.Cartesian3(0,0,0),e=new h.Cartesian3(0,0,0),n=new h.Cartesian3(0,0,0),o=new h.Cartesian3(0,0,0);t[0].equals(t[t.length-1])&&t.pop();var s=t.length;for(let u=0;u<s;++u){var r=t[u],l;u==0?l=t[t.length-1]:l=t[u-1];var c;u==t.length-1?c=t[0]:c=t[u+1],i=h.Cartesian3.subtract(r,l,i),e=h.Cartesian3.subtract(r,c,e),n=h.Cartesian3.cross(i,e,n),!n.equalsEpsilon(h.Cartesian3.ZERO,h.Math.EPSILON6)&&(n=h.Cartesian3.normalize(n,n),o=h.Cartesian3.add(o,n,o))}return n.x=o.x/s,n.y=o.y/s,n.z=o.z/s,n}function B2(t){var i=new h.Cartesian3(0,0,0),e=t.length;for(let o=0;o<e;++o){var n=t[o];i=h.Cartesian3.add(i,n,i)}return i.x=i.x/e,i.y=i.y/e,i.z=i.z/e,i}function cC(t){return new h.Cartesian3(-1*t.x,-1*t.y,-1*t.z)}function V2(t,i){var e=h.Cartesian3.cross(t,i,new h.Cartesian3);e=h.Cartesian3.normalize(e,e);var n=h.Cartesian3.cross(t,e,new h.Cartesian3);n=h.Cartesian3.normalize(n,n);var o=t,s=new h.Matrix4(e.x,e.y,e.z,0,n.x,n.y,n.z,0,o.x,o.y,o.z,0,0,0,0,1);return s}function er(t,i){var e=[];for(let s=0;s<t.length;++s){var n=t[s],o=h.Matrix4.multiplyByPoint(i,n,new h.Cartesian3);e.push(o)}return e}function U2(t){var i=t[0].x,e=t[0].y,n=t[0].x,o=t[0].y;return t.forEach(s=>{i=Math.min(i,s.x),e=Math.min(e,s.y),n=Math.max(n,s.x),o=Math.max(o,s.y)}),{minx:i,miny:e,maxx:n,maxy:o}}function W2(t){var i=[];return t.forEach(e=>{i.push([e.x,e.y])}),i.push(i[0]),i}function G2(t,i){var e=[];t.forEach(r=>{const l=[r.x,r.y];e.push(l)});var n=p_.from(e).triangles;const o=[],s=ot([i]);for(let r=0;r<n.length;r+=3){const l=n[r],c=n[r+1],u=n[r+2],d=(t[l].x+t[c].x+t[u].x)/3,p=(t[l].y+t[c].y+t[u].y)/3;bt([d,p],s)&&o.push(l,c,u)}return new Uint32Array(o.reverse())}function H2(t,i){for(var e=0,n=0;n<i.length;n+=3){const o=[t[i[n]],t[i[n+1]],t[i[n+2]]];e+=$2(o)}return e}function $2(t){var i=h.Cartesian3.distance(t[0],t[1]),e=h.Cartesian3.distance(t[1],t[2]),n=h.Cartesian3.distance(t[2],t[0]),o=(i+e+n)/2,s=Math.sqrt(o*(o-i)*(o-e)*(o-n));return s||0}function q2(t,i,e){for(var n=[],o=i.minx;o<i.maxx;o+=e)for(var s=i.miny;s<i.maxy;s+=e)Z2([o,s],t)&&n.push(new h.Cartesian3(o,s,0));return n}function X2(t,i){var e=[];for(let r=0;r<t.length;++r){var n=t[r],o;r==t.length-1?o=t[0]:o=t[r+1];var s=Y2(n,o,i);e.push(...s)}return e}function Y2(t,i,e){var n=[],o=h.Cartesian3.distance(t,i),s=h.Cartesian3.subtract(i,t,new h.Cartesian3);if(s.equalsEpsilon(h.Cartesian3.ZERO,h.Math.EPSILON6))return[];s=h.Cartesian3.normalize(s,s);for(var r=e;r<o;){var l=new h.Cartesian3(s.x*r,s.y*r,s.z*r),c=h.Cartesian3.add(t,l,new h.Cartesian3);n.push(c),r+=e}return n}function Z2(t,i){var e=dt(t);if(!JR(dt(i[0]),dt(i[i.length-1])))return!1;var n=[];n.push(i);var o=ot(n);return bt(e,o)}async function Hf(t,i,e,n,o,s,r,l){var c=[];t.forEach(S=>{var x=S.clone();x.z=l,c.push(x)});var u=er(c,i),d=new h.Cartesian3(-1*n.x,-1*n.y,-1*n.z),p=[],f=[],g=[];for(let S=0;S<u.length;++S){await lC();var v=u[S],y=new h.Ray(v,d),w=void 0;try{w=o.pickFromRay(y)}catch{}if(!w){y=new h.Ray(v,n);try{w=o.pickFromRay(y)}catch{}}if(w){var P=w.position;if(!(!P||!P.x||isNaN(P.x))){var C=er([P],e);C.forEach(x=>{x.z+=s}),P=er(C,i)[0],g.push(P),P=h.Cartographic.fromCartesian(P),p.push([P.longitude,P.latitude,P.height]),f.push(C[0])}}}return{local:f,world:p,world_cartesian:g}}const Ol=class Ol extends Yt{constructor(e,n){super(e,n);m(this,"_czmAreaMeasurement");if(this._czmAreaMeasurement=this.disposeVar(new Oo(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmAreaMeasurement;this.ad(a.track([e,"surfaceArea"],[s,"totalArea"])),this.ad(a.track([s,"units"],[e,"units"])),this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([s,"positions"],[e,"points"])),this.d(a.track([s,"interpolationDistance"],[e,"interpolation"])),this.d(a.track([s,"offsetHeight"],[e,"offsetHeight"]));{const r=()=>{if(this.geoPolygon&&(this.geoPolygon.outline=!1),e.stroked)s.outlineWidth=e.strokeWidth;else{s.outlineWidth=0;return}s.outlineWidth=e.strokeWidth,s.outlineColor=e.strokeColor};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.d(l.disposableOn(r))}this.d(e.startEvent.don(()=>{this._czmAreaMeasurement.start()})),this.d(e.stopEvent.don(()=>{this._czmAreaMeasurement.stop()}))}get czmAreaMeasurement(){return this._czmAreaMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmAreaMeasurement:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.positions&&oe(s,o,n,r.positions,e),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmAreaMeasurement:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.positions&&oe(s,o,n,r.positions,e),!0):!1}};m(Ol,"type",Ol.register("ESCesiumViewer",a.ESSurfaceAreaMeasurement.type,Ol));let $f=Ol;async function Q2(t){navigator.clipboard.writeText(t).then(function(){console.log("复制成功")},function(i){console.log("复制失败")})}const Nl=class Nl extends a.EngineObject{constructor(e,n){super(e,n);m(this,"_customDiv");if(this._customDiv=this.disposeVar(new a.ESCustomDiv(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._customDiv;n.add(s),this.dispose(()=>n.delete(s)),s.instanceClass=class extends a.Destroyable{constructor(l,c,u){if(super(),this._subContainer=l,!u||!(u instanceof Re))return;u.extensions.cursorPositionInfo.enabled=!0;const d=document.createElement("div");this._subContainer.appendChild(d),this.dispose(()=>this._subContainer.removeChild(d)),d.style.width="100%",d.style.position="absolute",d.style.height=`${a.ESViewerStatusBar.defaults.height}px`,d.style.left="0",d.style.bottom="0",d.style.color="#fff",d.style.padding="0 20px 0 0",d.style.boxSizing="border-box",d.style.lineHeight=`${a.ESViewerStatusBar.defaults.height}px`,d.style.zIndex="100",d.style.alignContent="center",d.style.justifyContent="space-between";const p=document.createElement("span");d.appendChild(p),this.dispose(()=>d.removeChild(p));const f=document.createElement("span");p.appendChild(f),this.dispose(()=>p.removeChild(f));const g=document.createElement("span");p.appendChild(g),g.addEventListener("dblclick",function(){let y=g.innerHTML;y.startsWith("鼠标位置")&&(y=y.slice(5)),Q2(y)}),g.style.cursor="pointer",this.dispose(()=>p.removeChild(g));const v=document.createElement("span");d.appendChild(v),this.dispose(()=>d.removeChild(v));{const y=()=>{d.style.height=(e.height??a.ESViewerStatusBar.defaults.height)+"px",d.style.lineHeight=(e.height??a.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(y)),y()}{const y=()=>{d.style.fontSize=(e.fontSize??a.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(y)),y()}{const y=()=>{e.bgColor?d.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:d.style.background=`rgba(${a.ESViewerStatusBar.defaults.bgColor[0]},${a.ESViewerStatusBar.defaults.bgColor[1]},${a.ESViewerStatusBar.defaults.bgColor[2]},${a.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(y)),y()}{v.innerText=`Cesium 版本 : ${h.VERSION} `;let y;const w=()=>{e.show?(d.style.display="flex",y=this.disposeVar(a.createAnimateFrameWithStartValues(()=>{var A;let P="",C="";const S=u.getCameraInfo();if(S){const R=(B,V)=>S.position[B].toFixed(V),L=(B,V)=>S.rotation[B].toFixed(V);P=`帧率:${u.getFPS()}FPS 经度: ${R(0,5)}° 纬度: ${R(1,5)}° 高度: ${R(2,2)}米 偏航角: ${L(0,2)}° 俯仰角: ${L(1,2)}° 翻滚角:${L(2,2)}° `}f.innerText=P;const x=(A=u.extensions)==null?void 0:A.cursorPositionInfo.cursorPosition;if(x){const R=(L,B)=>x[L].toFixed(B);C=`鼠标位置:${R(0,5)}° ${R(1,5)}° ${R(2,2)}m`}else C="暂时无法获取鼠标位置...";g.innerText=C})),y.start()):(d.style.display="none",y.destroy())};this.dispose(e.showChanged.disposableOn(w)),w()}}}}get customDiv(){return this._customDiv}};m(Nl,"type",Nl.register("ESCesiumViewer",a.ESViewerStatusBar.type,Nl));let qf=Nl;const Bl=class Bl extends a.EngineObject{constructor(e,n){super(e,n);m(this,"_customDiv");if(this._customDiv=this.disposeVar(new a.ESCustomDiv(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._customDiv;n.add(s),this.dispose(()=>n.delete(s)),this.dispose(a.track([s,"show"],[e,"show"])),s.instanceClass=class extends a.Destroyable{constructor(l,c,u){if(super(),this._subContainer=l,!u||!(u instanceof Re))return;u.extensions.cursorPositionInfo.enabled=!0;const d=document.createElement("div");this._subContainer.appendChild(d),this.dispose(()=>this._subContainer.removeChild(d));const p=document.createElement("div");d.appendChild(p),p.style.width="100%",p.className="ESViewerStatusBarScale",p.style.position="absolute",p.style.display="flex",p.style.height=`${a.ESViewerStatusBarScale.defaults.height}px`,p.style.left="0",p.style.bottom="0",p.style.color="#fff",p.style.padding="0 20px 0 0",p.style.boxSizing="border-box",p.style.lineHeight=`${a.ESViewerStatusBarScale.defaults.height}px`,p.style.zIndex="100",p.style.alignContent="center",p.style.justifyContent="space-between";const f=document.createElement("div");p.appendChild(f);const g=document.createElement("div");f.appendChild(g);const v=document.createElement("div");f.appendChild(v);const y=document.createElement("div");p.appendChild(y);const w=document.createElement("div");y.appendChild(w);const P=document.createElement("div");w.appendChild(P);const C=document.createElement("div");w.appendChild(C);const S=document.createElement("span");y.appendChild(S);{const B=()=>{p.style.height=(e.height??a.ESViewerStatusBarScale.defaults.height)+"px",p.style.lineHeight=(e.height??a.ESViewerStatusBarScale.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(B)),B()}{const B=()=>{p.style.fontSize=(e.fontSize??a.ESViewerStatusBarScale.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(B)),B()}{const B=()=>{e.bgColor?p.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:p.style.background=`rgba(${a.ESViewerStatusBarScale.defaults.bgColor[0]},${a.ESViewerStatusBarScale.defaults.bgColor[1]},${a.ESViewerStatusBarScale.defaults.bgColor[2]},${a.ESViewerStatusBarScale.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(B)),B()}f.style.display="flex",g.style.fontWeight="bold",g.style.padding="0 0 0 25px";let x="EarthSDK";g.innerText=x,v.style.fontWeight="";let A="——免费开源地球可视化开发包";v.innerText=A,y.style.width="550px",w.style.position="fixed",w.style.width="125px",w.style.height="30px",w.style.padding="0 5px",w.style.display="flex",w.style.justifyContent="flex-end",w.style.pointerEvents="auto",w.style.zIndex="101",P.style.width="125px",P.style.display="inline-block",P.style.textAlign="center",P.style.fontSize="14px",P.style.fontWeight="lighter",P.style.lineHeight="30px",P.style.color="#fff",P.innerHTML="1000km",C.style.borderRight="1px solid #fff",C.style.borderLeft="1px solid #fff",C.style.borderBottom="1px solid #fff",C.style.position="absolute",C.style.height="10px",C.style.top="15px",C.style.width="75px",C.style.right=`${60/2}px`,S.style.display="flex",S.style.zIndex="101",S.style.justifyContent="flex-end",S.style.right="0";const R=()=>{const B=n.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||B&&B>1e6)w.style.display="none";else{w.style.display="block";const V=n.viewerLegend.legend.computedLengthInStr;V&&(P.innerHTML=V);const G=n.viewerLegend.legend.computedLengthInPixels;if(G){C.style.width=`${G}px`;const O=(135-G)/2;C.style.left=`${O}px`}}};R();const L=setInterval(()=>{R()},200);this.dispose(()=>clearInterval(L));{let B;const V=()=>{e.show?(d.style.display="block",B=this.disposeVar(a.createAnimateFrameWithStartValues(()=>{var _;let G="";const O=u.getCameraInfo();if(O){const E=(D,z)=>O.position[D].toFixed(z);G+=`帧率:${u.getFPS()}FPS 相机: ${E(2,2)}米 `}const N=(_=u.extensions)==null?void 0:_.cursorPositionInfo.cursorPosition;if(N){const E=(D,z)=>N[D].toFixed(z);G+=`位置:${E(0,5)}° ${E(1,5)}° ${E(2,2)}米`}else G+="暂时无法获取鼠标位置...";S.innerText=G})),B.start()):(d.style.display="none",B.destroy())};this.dispose(e.showChanged.disposableOn(V)),V()}}}}get customDiv(){return this._customDiv}};m(Bl,"type",Bl.register("ESCesiumViewer",a.ESViewerStatusBarScale.type,Bl));let Xf=Bl;const hC=h.Math.toDegrees,k2=new h.Cartographic;function uC(t,i,e){const n=h.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=h.Cartesian3.fromDegrees(i[0],i[1],i[2]),s=h.Cartesian3.subtract(o,n,new h.Cartesian3);h.Cartesian3.normalize(s,s);const r=new h.Ray(n,s),l=e.pickFromRay(r),c=e.globe.pick(r,e);var u;if(l&&l.position&&c){const v=h.Cartesian3.distance(n,l.position),y=h.Cartesian3.distance(n,c);u=v<y?l.position:c}else l&&l.position?u=l.position:c&&(u=c);if(!u)return;const d=h.Cartesian3.distance(n,o),f=h.Cartesian3.distance(n,u)>d?o:u,g=h.Cartographic.fromCartesian(f,void 0,k2);return[hC(g.longitude),hC(g.latitude),g.height]}const Vl=class Vl extends yt{constructor(e,n){super(e,n);m(this,"_hideGeoPolylines",this.disposeVar(new Xt(this.czmViewer,this.sceneObject.id)));m(this,"_visibleGeoPolylines",this.disposeVar(new Xt(this.czmViewer,this.sceneObject.id)));const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this._hideGeoPolylines,r=this._visibleGeoPolylines;this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([r,"show"],[e,"show"])),this.d(a.track([r,"color"],[e,"visibleColor"])),this.d(a.track([s,"color"],[e,"invisibleColor"]));{const l=()=>{const u=e.points,d=e.heightOffset;if(!u||u.length<2||u[0].toString()===u[1].toString()){s.positions=void 0,r.positions=void 0;return}const p=[],f=[],[g,v,y]=u[0],w=[g,v,y+d];try{u.forEach((P,C)=>{if(C===0)return;const S=uC(w,P,o.scene);S?(p.push([P,S]),f.push([w,S])):f.push([w,P])}),s.positions=p,r.positions=f}catch(P){console.warn(P)}};l();const c=this.dv(a.createNextAnimateFrameEvent(e.pointsChanged,e.heightOffsetChanged));this.d(c.don(l))}}get hideGeoPolylines(){return this._hideGeoPolylines}get visibleGeoPolylines(){return this._visibleGeoPolylines}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{let r=[];return this.visibleGeoPolylines.positions&&(r=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(r=[...r,...this.hideGeoPolylines.positions.flat()]),oe(s,o,n,r,e),!0}}flyIn(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyInParam)return super.flyIn(e,n);{let r=[];return this.visibleGeoPolylines.positions&&(r=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(r=[...r,...this.hideGeoPolylines.positions.flat()]),oe(s,o,n,r,e),!0}}};m(Vl,"type",Vl.register("ESCesiumViewer",a.ESVisibilityAnalysis.type,Vl));let Yf=Vl;class da extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.dv(new a.Event));m(this,"_enableEvent",this.dv(new a.Event));m(this,"_clearEvent",this.dv(new a.Event));m(this,"_gridPoints",this.dv(a.reactJson([])));m(this,"excavationPolylines");m(this,"fillPolylines");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.dv(new Xt(e,n)),r=this.dv(new Xt(e,n));this.excavationPolylines=s,this.fillPolylines=r;const l=s;l.color=[1,1,0,1],this.d(a.track([l,"show"],[this,"show"])),l.show=!1,l.depthTest=!0;const c=r;c.color=[0,0,1,1],this.d(a.track([c,"show"],[this,"show"])),c.show=!1;{const g=this.ad(new Mi(e,n));this.d(a.track([g,"show"],[this,"show"])),this.d(a.bind([g,"allowPicking"],[this,"allowPicking"])),this.d(a.bind([g,"positions"],[this,"positions"])),this.d(a.bind([g,"depthTest"],[this,"depthTest"])),this.d(a.bind([g,"outlineWidth"],[this,"outlineWidth"])),this.d(a.bind([g,"outlineColor"],[this,"outlineColor"])),this.d(a.bind([g,"outline"],[this,"outline"])),this.d(a.bind([g,"color"],[this,"fillColor"])),this.d(a.bind([g,"fill"],[this,"filled"])),this.d(a.bind([g,"strokeGround"],[this,"strokeGround"])),this.d(a.bind([g,"ground"],[this,"fillGround"])),this.d(this.flyToEvent.don(w=>{g.flyTo(w)}));const v=()=>{g.positions=this.positions};v();const y=this.dv(a.createNextAnimateFrameEvent(this.positionsChanged));this.d(y.don(v))}const u=()=>{if(!this.positions||!this.positions.length)return;const{minPos:g,maxPos:v}=a.getMinMaxCorner(this.positions),y=g[0],w=g[1],P=v[0],C=v[1],x={type:"Polygon",coordinates:[[...this.positions.map(N=>[N[0],N[1]])]]},A=[y,w,P,C],R=this.gridWidth,V=A0(A,R,{units:"meters",mask:x}).features.map(N=>N.geometry.coordinates),G=h.Math.toRadians;return V.map(N=>new h.Cartographic(G(N[0]),G(N[1])))},d=()=>{l.positions=[],c.positions=[],this.area=0,this.cutVolume=0,this.fillVolume=0,this.cutAndFillVolume=0,l.depthTest=!0},p=this.dv(a.createProcessingFromAsyncFunc(async g=>{const v=u();let y=0,w=300;const P=Math.ceil(v.length/w),C=[];do{let S=[];y===P-1?S=v.slice(y*w):S=v.slice(y*w,(y+1)*w);const x=o.scene.sampleHeightMostDetailed(S),A=await g.promise(x);if(y===P-1?this.progress=Math.round(this.progress+100/P):this.progress+=100/P,A&&A.length){const R=h.Math.toDegrees,L=A.filter(B=>B!=null).map(B=>[R(B.longitude),R(B.latitude),B.height]);C.push(...L)}y++}while(y<P);!C||!C.length||(this.gridPoints=C)}));let f=null;{const g=()=>{if(!this.positions||!this.positions.length||!this.gridPoints)return;let v=0;const y=[];let w=0;const P=[];this.gridPoints.forEach(C=>{const S=this.positions;C[2]>S[0][2]?(v+=this.gridWidth*this.gridWidth*(C[2]-S[0][2]),y.push([C,[C[0],C[1],S[0][2]]])):(w+=this.gridWidth*this.gridWidth*(S[0][2]-C[2]),P.push([C,[C[0],C[1],S[0][2]]]))}),l.positions=y,c.positions=P,l.show=!0,c.show=!0,this.area=yy(this.positions),this.cutVolume=v,this.fillVolume=w,this.cutAndFillVolume=w-v,f&&clearTimeout(f),f=setTimeout(()=>{l.depthTest=!1},200)};g(),this.d(this.gridPointsChanged.don(g)),this.d(()=>clearTimeout(f))}{const g=()=>{if(!this.positions||!this.positions.length){this.planeHeight=void 0;return}this.planeHeight=this.positions[0][2]};g(),this.d(this.positionsChanged.don(g))}{const g=()=>{if(!this.planeHeight||!this.positions||!this.positions.length)return;const v=JSON.parse(JSON.stringify(this.positions.slice(1)));v.unshift([this.positions[0][0],this.positions[0][1],this.planeHeight]),this.positions=v};g(),this.d(this.planeHeightChanged.don(g))}this.d(this.enableEvent.don(()=>{d(),this.gridPoints=[],this.progress=0,p.restart()})),this.d(this.clearEvent.don(()=>{d()}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get enableEvent(){return this._enableEvent}enableEmit(){this._enableEvent.emit()}get clearEvent(){return this._clearEvent}clearEmit(){this._clearEvent.emit()}get gridPoints(){return this._gridPoints.value}set gridPoints(e){this._gridPoints.value=e}get gridPointsChanged(){return this._gridPoints.changed}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(void 0),planeHeight:a.react(void 0),gridWidth:1,area:0,cutVolume:0,fillVolume:0,cutAndFillVolume:0,progress:0,depthTest:!1,outlineWidth:2,outlineColor:[1,1,1,1],outline:!0,filled:!1,fillColor:[1,1,1,1],fillGround:!1,strokeGround:!1})})(da||(da={})),a.extendClassProps(da.prototype,da.createDefaultProps);const Ul=class Ul extends Yt{constructor(e,n){super(e,n);m(this,"_geoVolumeMeasurement");if(this._geoVolumeMeasurement=this.dv(new da(this.czmViewer,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._geoVolumeMeasurement;this.d(a.track([s,"show"],[e,"show"])),this.d(a.bind([s,"positions"],[e,"points"])),this.d(a.track([s,"allowPicking"],[e,"allowPicking"])),this.d(a.bind([s,"planeHeight"],[e,"planeHeight"])),this.d(a.track([s,"gridWidth"],[e,"gridWidth"])),this.d(a.track([e,"cutVolume"],[s,"cutVolume"])),this.d(a.track([e,"fillVolume"],[s,"fillVolume"])),this.d(a.track([e,"cutAndFillVolume"],[s,"cutAndFillVolume"])),this.d(a.bind([e,"progress"],[s,"progress"])),this.d(a.track([s,"depthTest"],[e,"depthTest"])),this.d(a.track([s,"outline"],[e,"stroked"])),this.d(a.track([s,"outlineWidth"],[e,"strokeWidth"])),this.d(a.track([s,"outlineColor"],[e,"strokeColor"])),this.d(a.track([s,"filled"],[e,"filled"])),this.d(a.track([s,"fillColor"],[e,"fillColor"])),this.d(a.track([s,"fillGround"],[e,"fillGround"])),this.d(a.track([s,"strokeGround"],[e,"strokeGround"])),this.ad(a.track([e,"volume"],[e,"cutAndFillVolume"])),this.d(e.startEvent.don(()=>{s.enableEmit()})),this.d(e.clearEvent.don(()=>{s.clearEmit()}))}get geoVolumeMeasurement(){return this._geoVolumeMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoVolumeMeasurement:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(Ul,"type",Ul.register("ESCesiumViewer",a.ESVolumeMeasurement.type,Ul));let Zf=Ul;const Wl=class Wl extends Yt{constructor(e,n){super(e,n);m(this,"czmEntity");m(this,"czmPolyline",this.ad(new a.ESGeoLineString));const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.czmPolyline;n.add(s),this.ad(()=>n.delete(s)),this.ad(a.bind([s,"show"],[e,"show"])),this.ad(a.bind([s,"allowPicking"],[e,"allowPicking"])),this.ad(a.bind([s,"stroked"],[e,"stroked"])),this.ad(a.bind([s,"strokeColor"],[e,"strokeColor"])),this.ad(a.bind([s,"strokeWidth"],[e,"strokeWidth"])),this.ad(a.bind([s,"strokeGround"],[e,"strokeGround"]));{const u=()=>{if(!e.points||e.points.length<2)s.points=e.points;else{const p=structuredClone(e.points);p.push(p[0]),e.perPositionHeight?s.points=p:s.points=p.map(f=>(f[2]=e.height??a.ESGeoExtrudedPolygon.defaults.height,f))}};u();const d=this.ad(a.createNextAnimateFrameEvent(e.pointsChanged,e.heightChanged,e.perPositionHeightChanged));this.ad(d.don(u))}const r=this.czmEntity=o.entities.add({polygon:{}});h.Entity.prototype&&(r.ESSceneObjectID=e.id),this.dispose(()=>o.entities.remove(r));let l=new h.PolygonHierarchy;r.polygon&&(r.polygon.hierarchy=new h.CallbackProperty(()=>l,!1));const c=()=>{const u=pt(e.points??[]);if(u.length<2){l=new h.PolygonHierarchy;return}l=new h.PolygonHierarchy(u)};c(),this.dispose(e.pointsChanged.disposableOn(c));{const u=()=>{r.show=e.show&&e.filled,this.geoPolygon&&(this.geoPolygon.show=e.show&&!r.show&&e.filled)};u();const d=this.ad(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.ad(d.don(u))}{const u=()=>{r.polygon&&(r.polygon.perPositionHeight=new h.ConstantProperty(e.perPositionHeight),c())};u(),this.ad(e.perPositionHeightChanged.don(u))}{const u=()=>{r.polygon&&(r.polygon.height=new h.ConstantProperty(e.height??a.ESGeoExtrudedPolygon.defaults.height))};u(),this.dispose(e.heightChanged.disposableOn(u))}{const u=()=>{r.polygon&&(r.polygon.extrudedHeight=new h.ConstantProperty(e.extrudedHeight??a.ESGeoExtrudedPolygon.defaults.extrudedHeight))};u(),this.dispose(e.extrudedHeightChanged.disposableOn(u))}{const u=()=>{const d=h.Color.fromCartesian4(h.Cartesian4.fromArray(e.fillColor));r.polygon&&(r.polygon.material=d)};u(),this.dispose(e.fillColorChanged.disposableOn(u))}this.disposeVar(new a.ObjResettingWithEvent(e.allowPickingChanged,()=>{if(!e.allowPicking)return new Re.ObjectsToExcludeWrapper(n,r)}))}getMinAndMaxheight(){const{sceneObject:e}=this;if(e.points){const{minPos:n,maxPos:o}=a.getMinMaxCorner(e.points);return[n[2],o[2]]}return[0,0]}};m(Wl,"type",Wl.register("ESCesiumViewer",a.ESGeoExtrudedPolygon.type,Wl));let Qf=Wl;const Gl=class Gl extends a.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}const{human:o,poi:s}=i;this.dispose(a.bind([o,"position"],[i,"position"])),this.dispose(a.bind([o,"rotation"],[i,"rotation"])),this.ad(a.bind([o,"scale"],[i,"scale"])),this.ad(a.track([s,"scale"],[i,"scale"])),this.dispose(a.track([s,"rotation"],[i,"rotation"]));const r=()=>{const c=i.position;s.position=[c[0],c[1],c[2]+i.poiOffsetHeight]};r();const l=this.dv(a.createNextAnimateFrameEvent(i.positionChanged,i.poiOffsetHeightChanged));this.d(l.don(r)),this.ad(s.pickedEvent.don(c=>{c.assign({sceneObject:i}),i.pickedEvent.emit(c)}))}};m(Gl,"type",Gl.register("ESCesiumViewer",a.ESHumanPoi.type,Gl));let kf=Gl;const Hl=class Hl extends a.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(i.highlightInner3DtilesetEvent.don(o=>{o.strokeFeature([]);const s=o.d(o.tilesetReady.donce(c=>{c.allTilesLoaded.addEventListener(()=>{var d,p,f,g;const u=(g=(f=(p=(d=c==null?void 0:c._root)==null?void 0:d._content)==null?void 0:p._model)==null?void 0:f._featureTables[0])==null?void 0:g._features[0];u?o.strokeFeature([u],h.Color.LIME.toBytes().map(v=>v/255)):console.warn("tileset?._root?._content?._model?._featureTables[0]?._features[0] is undefined !",c),s()})})),r=o.url,l=Date.now();r.includes("?reload=")?o.url=r.replace(/\?reload=\d+/,`?reload=${l}`):o.url=r+`?reload=${l}`})),this.d(i.removeHighlightInner3DtilesetEvent.don(o=>{o.strokeFeature([])})),this.d(i.es3DTileset.tilesetReady.don(o=>{const s=()=>{const l=i.layerConfig;if(!l){o.style=void 0;return}const c=i.colorBlendMode,u=(f,g)=>{try{if(f.getPropertyIds().includes("materialName"))return h.Color.clone(h.Color.WHITE,g);const v=f.getProperty("layer"),y=f.getProperty("dataset"),w=v.toString(),P=y.toString(),C=l.find(x=>x.dataset.toString()===P&&x.layer.toString()===w);if(C&&C.value.color){const x=C.value.color;return h.Color.fromCssColorString(x,g)}const S=l.filter(x=>x.dataset.toString()===P);if(S.length==1&&S[0].value.color){const x=S[0].value.color;return h.Color.fromCssColorString(x,g)}else return h.Color.clone(h.Color.WHITE,g)}catch(v){return console.warn(v),h.Color.clone(h.Color.WHITE,g)}},d=f=>{try{if(f.getPropertyIds().includes("id")){const S=Object.entries(i.visJson);for(let x=0;x<S.length;x++){const A=S[x];if(f.getProperty("id").toString()===A[0])return A[1]}}if(f.getPropertyIds().includes("materialName"))return!0;const g=f.getProperty("layer"),v=f.getProperty("dataset"),y=g.toString(),w=v.toString(),P=l.find(S=>S.dataset.toString()===w&&S.layer.toString()===y);if(P&&P.value.visible===!1)return!1;if(P&&P.value.visible===!0)return!0;const C=l.filter(S=>S.dataset.toString()===w);return!(C.length==1&&C[0].value.visible===!1)}catch(g){return console.warn(g),!0}};let p;c!=="HIGHLIGHT"?p=new h.Cesium3DTileStyle({color:{evaluateColor:function(f,g){return u(f,g)}},show:{evaluate:function(f){return d(f)}}}):p=new h.Cesium3DTileStyle({show:{evaluate:function(f){return d(f)}}}),console.log("style",p),o.style=p};s();const r=this.dv(a.createNextAnimateFrameEvent(i.layerConfigChanged,i.colorBlendModeChanged,i.visJsonChanged));this.d(r.don(()=>{s()}))}))}};m(Hl,"type",Hl.register("ESCesiumViewer",a.ESRtsTileset.type,Hl));let Kf=Hl;const $l=class $l extends Ds{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}};m($l,"type",$l.register("ESCesiumViewer",a.ESRtsFeatureEditing.type,$l));let Jf=$l;const ql=class ql extends Ds{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}};m(ql,"type",ql.register("ESCesiumViewer",a.ESMsTileset.type,ql));let jf=ql;const Xl=class Xl extends me{constructor(e,n){super(e,n);m(this,"_czmGeoPoint");if(this._czmGeoPoint=this.disposeVar(new ti(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoPoint;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"]))}get czmGeoPoint(){return this._czmGeoPoint}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmGeoPoint:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(Xl,"type",Xl.register("ESCesiumViewer",a.ESStaticMesh.type,Xl));let eg=Xl;const Yl=class Yl extends yt{constructor(i,e){super(i,e);const n=e.viewer;if(!n){console.warn("viewer is undefined!");return}const o=this.ad(new mm(n));this.ad(i.startEvent.don(async()=>{const s=await o.getDepthsFromScreen(),r=Number.isFinite(i.radius)?i.radius:a.ESSkylineAnalysis.defaults.radius,{depths:l,windowPositions:c,positions:u}=o.getSkylineDepthsAndPositions(s,n.scene.canvas.width,n.scene.canvas.height,r),d=se(n.camera.position);u.push(d),i.depths=l,i.windowPositions=c,i.points=u}))}flyTo(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyToParam||n.flyInParam?super.flyTo(i,e):n.points?(oe(o,n,e,n.points,i),!0):!1:!1}flyIn(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyInParam?super.flyIn(i,e):n.points?(oe(o,n,e,n.points,i),!0):!1:!1}};m(Yl,"type",Yl.register("ESCesiumViewer",a.ESSkylineAnalysis.type,Yl));let tg=Yl;class K2 extends a.Destroyable{constructor(e,n){super();m(this,"_rectangle");m(this,"_updateHeatMapEvent",this.disposeVar(new a.Event));const o=e.sceneObject;this._rectangle=this.ad(new Si(n,o.id)),this._rectangle.ground=!0,this._rectangle.outline=!1,this.ad(a.bind([this.rectangle,"show"],[o,"show"])),this.ad(a.bind([this.rectangle,"allowPicking"],[o,"allowPicking"])),this.ad(this.updateHeatMapEvent.don(s=>{this.rectangle.rectangle=e.rectangle,this.rectangle.material={type:"Image",image:s}}))}get rectangle(){return this._rectangle}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}}class J2 extends a.Destroyable{constructor(e,n){super();m(this,"_primitive");m(this,"_updateHeatMapEvent",this.disposeVar(new a.Event));m(this,"czmViewer");m(this,"czmESHeatMap");const o=this.czmViewer=n,s=this.czmESHeatMap=e,r=s.sceneObject,l=o.viewer;if(!l)return;let c,u;const d=this.ad(new a.Event),p=()=>{f(),!(!c||!u)&&(this._primitive=l.scene.primitives.add(new h.Primitive({geometryInstances:c,appearance:u,asynchronous:!1,allowPicking:r.allowPicking})))},f=()=>{this.primitive&&l.scene.primitives.remove(this.primitive)};this.ad(f);{const g=()=>{this.primitive&&(this.primitive.show=r.show)};g(),this.ad(r.showChanged.don(g))}{const g=this.ad(a.createNextAnimateFrameEvent(r.allowPickingChanged,d));this.ad(g.don(p))}{const g=()=>{s.rectangle&&(c=new h.GeometryInstance({geometry:this.createHeatmapGeometry(Number.parseFloat(s.div.style.width),Number.parseFloat(s.div.style.height))}),this.primitive&&(this._primitive._state=3,this._primitive._appearance=void 0,this._primitive.geometryInstances=c,this._primitive._recomputeBoundingSpheres=!0))};this.ad(this.updateHeatMapEvent.don(v=>{if(!s.rectangle)return;const y=s.rectangle[1]+(s.rectangle[3]-s.rectangle[1])*.5,w=a.getDistancesFromPositions([[s.rectangle[0],y,0],[s.rectangle[2],y,0]],"GEODESIC")[0]/5;u=new h.MaterialAppearance({material:new h.Material({fabric:{type:"Image",uniforms:{image:v}},translucent:!0}),vertexShaderSource:this.getVertexShaderSource(w),flat:!0}),this.primitive&&s.rectangle&&(this.primitive.appearance.material.uniforms.image=v,this.primitive.appearance._vertexShaderSource=this.getVertexShaderSource(w)),g(),this.primitive||d.emit()}))}}get primitive(){return this._primitive}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}getVertexShaderSource(e){return`
1891
+ `),24))};r(),this.d(this.totalAreaChanged.don(r)),this.d(this.unitsChanged.don(r)),this.d(a.track([this._geoDivPoi,"show"],[this,"show"])),this.d(this.positionsChanged.don(()=>{this._geoDivPoi&&(this.positions&&this.positions.length>=3?this._geoDivPoi.position=wy(this.positions):this._geoDivPoi.position=void 0)}));const l=async()=>{if((!this.positions||this.positions.length<3)&&this.customPrimitive){this.totalArea=0,this.customPrimitive.position=void 0,this.customPrimitive.attributes=void 0,this.customPrimitive.indexTypedArray=void 0,this.customPrimitive.show=!1;return}const u=this.interpolationDistance??qo.defaults.interpolationDistance,d=this.interpolation??qo.defaults.interpolation,p=this.offsetHeight??qo.defaults.offsetHeight,f=this.drillDepth??qo.defaults.drillDepth,g=[];if(this.positions)for(let q=0;q<this.positions.length;++q){const X=h.Cartesian3.fromDegrees(this.positions[q][0],this.positions[q][1],this.positions[q][2]);g.push(X)}var v=B2(g);if(isNaN(v.x)||isNaN(v.y)||isNaN(v.z)){console.warn("法向量计算错误!");return}var y=V2(g),w=h.Cartesian3.normalize(y,new h.Cartesian3),P=h.Cartesian3.dot(w,v);P<0&&(v=cC(v),g.reverse());let C=h.Transforms.eastNorthUpToFixedFrame(y),S=h.Matrix4.inverseTransformation(C,new h.Matrix4);if(Math.abs(P)<.999){const q=U2(v,w);var x=cC(y),A=h.Matrix4.fromTranslation(x,new h.Matrix4);S=h.Matrix4.multiply(q,A,A),C=h.Matrix4.inverse(S,new h.Matrix4)}var R=er(g,S),L=[],B=[],V=G2(R);if(d&&u>0){var G=W2(R);const q=Math.max(G.maxy-G.miny,G.maxx-G.minx);var O=X2(V,G,u);const X=await Hf(O,C,S,v,o.scene,p,f,q);var N=Y2(R,u);const Q=await Hf(N,C,S,v,o.scene,p,f,q);B.push(...X.world_cartesian),L.push(...X.local),B.push(...Q.world_cartesian),L.push(...Q.local);for(let j=0;j<R.length;++j){const ae=R[j];var _=await Hf([ae],C,S,v,o.scene,p,f,q);if(_.local.length>0)L.push(..._.local),B.push(..._.world_cartesian);else{const ue=[ae.x,ae.y,ae.z+p];L.push(ue);var E=er([h.Cartesian3.fromArray(ue)],C);for(let fe=0;fe<E.length;++fe)B.push(E[fe])}}}else{const q=R.map(X=>h.Cartesian3.fromArray([X.x,X.y,X.z+q]));L=q,B=er(q,C)}var D=H2(L,V);const z=$2(B,D);this.totalArea=z;const U=[];L.forEach(q=>{const X=[q.x,q.y,q.z];X&&U.push(...X)});const Y={position:{typedArray:new Float32Array(U),componentsPerAttribute:3}};if(this.customPrimitive){this.customPrimitive.modelMatrix=h.Matrix4.toArray(C),this.customPrimitive.attributes=Y;const q=await N2([...D]);this.customPrimitive.indexTypedArray=new Uint32Array(q),this.customPrimitive.show=!0;const X=this.customPrimitive.computeLocalAxisedBoundingBoxFromAttribute("position");if(!X)return;const{min:Q,max:j}=X;this.customPrimitive.setLocalAxisedBoundingBox(Q,j)}},c=this.dv(a.createProcessingFromAsyncFunc(async u=>{await u.promise(l()),this._starting=!1,r()}));this.d(this.startEvent.don(()=>{if(this._starting){console.log("正在计算中...");return}this._starting=!0,r(),c.restart()})),this.d(this.stopEvent.don(()=>{c.cancel(),this._starting=!1,this.totalArea=0,this.customPrimitive.position=void 0,this.customPrimitive.attributes=void 0,this.customPrimitive.indexTypedArray=void 0,this.customPrimitive.show=!1,r()}))}}get pickedEvent(){return this._pickedEvent}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get stopEvent(){return this._stopEvent}stop(){this._stopEvent.emit()}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolyline(){return this._geoPolyline}get customPrimitive(){return this._customPrimitive}get geoDivPoi(){return this._geoDivPoi}};m(qo,"defaults",{positions:[],totalArea:0,interpolation:!0,interpolationDistance:.5,offsetHeight:0,drillDepth:3,outlineWidth:2,outlineColor:[1,1,1,1]});let Oo=qo;(t=>{t.createDefaultProps=()=>({positions:a.reactArrayWithUndefined(void 0),show:void 0,totalArea:void 0,interpolationDistance:void 0,interpolation:void 0,offsetHeight:void 0,drillDepth:void 0,outlineWidth:void 0,outlineColor:a.reactArray([1,1,1,1]),units:a.reactArray(["SquareMeter_SquareKilometer","MU_Hectare"])})})(Oo||(Oo={})),a.extendClassProps(Oo.prototype,Oo.createDefaultProps);async function N2(t){t.length%3!==0&&console.warn("当前传入的索引不是3的倍数,可能不是三角片的索引!");const i=t.length/3|0,e=new Array(i*6);for(let n=0;n<i;++n)await lC(),e[n*6+0]=t[n*3+0],e[n*6+1]=t[n*3+1],e[n*6+2]=t[n*3+2],e[n*6+3]=t[n*3+1],e[n*6+4]=t[n*3+2],e[n*6+5]=t[n*3+0];return e}function B2(t){var i=new h.Cartesian3(0,0,0),e=new h.Cartesian3(0,0,0),n=new h.Cartesian3(0,0,0),o=new h.Cartesian3(0,0,0);t[0].equals(t[t.length-1])&&t.pop();var s=t.length;for(let u=0;u<s;++u){var r=t[u],l;u==0?l=t[t.length-1]:l=t[u-1];var c;u==t.length-1?c=t[0]:c=t[u+1],i=h.Cartesian3.subtract(r,l,i),e=h.Cartesian3.subtract(r,c,e),n=h.Cartesian3.cross(i,e,n),!n.equalsEpsilon(h.Cartesian3.ZERO,h.Math.EPSILON6)&&(n=h.Cartesian3.normalize(n,n),o=h.Cartesian3.add(o,n,o))}return n.x=o.x/s,n.y=o.y/s,n.z=o.z/s,n}function V2(t){var i=new h.Cartesian3(0,0,0),e=t.length;for(let o=0;o<e;++o){var n=t[o];i=h.Cartesian3.add(i,n,i)}return i.x=i.x/e,i.y=i.y/e,i.z=i.z/e,i}function cC(t){return new h.Cartesian3(-1*t.x,-1*t.y,-1*t.z)}function U2(t,i){var e=h.Cartesian3.cross(t,i,new h.Cartesian3);e=h.Cartesian3.normalize(e,e);var n=h.Cartesian3.cross(t,e,new h.Cartesian3);n=h.Cartesian3.normalize(n,n);var o=t,s=new h.Matrix4(e.x,e.y,e.z,0,n.x,n.y,n.z,0,o.x,o.y,o.z,0,0,0,0,1);return s}function er(t,i){var e=[];for(let s=0;s<t.length;++s){var n=t[s],o=h.Matrix4.multiplyByPoint(i,n,new h.Cartesian3);e.push(o)}return e}function W2(t){var i=t[0].x,e=t[0].y,n=t[0].x,o=t[0].y;return t.forEach(s=>{i=Math.min(i,s.x),e=Math.min(e,s.y),n=Math.max(n,s.x),o=Math.max(o,s.y)}),{minx:i,miny:e,maxx:n,maxy:o}}function G2(t){var i=[];return t.forEach(e=>{i.push([e.x,e.y])}),i.push(i[0]),i}function H2(t,i){var e=[];t.forEach(r=>{const l=[r.x,r.y];e.push(l)});var n=p_.from(e).triangles;const o=[],s=ot([i]);for(let r=0;r<n.length;r+=3){const l=n[r],c=n[r+1],u=n[r+2],d=(t[l].x+t[c].x+t[u].x)/3,p=(t[l].y+t[c].y+t[u].y)/3;bt([d,p],s)&&o.push(l,c,u)}return new Uint32Array(o.reverse())}function $2(t,i){for(var e=0,n=0;n<i.length;n+=3){const o=[t[i[n]],t[i[n+1]],t[i[n+2]]];e+=q2(o)}return e}function q2(t){var i=h.Cartesian3.distance(t[0],t[1]),e=h.Cartesian3.distance(t[1],t[2]),n=h.Cartesian3.distance(t[2],t[0]),o=(i+e+n)/2,s=Math.sqrt(o*(o-i)*(o-e)*(o-n));return s||0}function X2(t,i,e){for(var n=[],o=i.minx;o<i.maxx;o+=e)for(var s=i.miny;s<i.maxy;s+=e)Q2([o,s],t)&&n.push(new h.Cartesian3(o,s,0));return n}function Y2(t,i){var e=[];for(let r=0;r<t.length;++r){var n=t[r],o;r==t.length-1?o=t[0]:o=t[r+1];var s=Z2(n,o,i);e.push(...s)}return e}function Z2(t,i,e){var n=[],o=h.Cartesian3.distance(t,i),s=h.Cartesian3.subtract(i,t,new h.Cartesian3);if(s.equalsEpsilon(h.Cartesian3.ZERO,h.Math.EPSILON6))return[];s=h.Cartesian3.normalize(s,s);for(var r=e;r<o;){var l=new h.Cartesian3(s.x*r,s.y*r,s.z*r),c=h.Cartesian3.add(t,l,new h.Cartesian3);n.push(c),r+=e}return n}function Q2(t,i){var e=dt(t);if(!jR(dt(i[0]),dt(i[i.length-1])))return!1;var n=[];n.push(i);var o=ot(n);return bt(e,o)}async function Hf(t,i,e,n,o,s,r,l){var c=[];t.forEach(S=>{var x=S.clone();x.z=l,c.push(x)});var u=er(c,i),d=new h.Cartesian3(-1*n.x,-1*n.y,-1*n.z),p=[],f=[],g=[];for(let S=0;S<u.length;++S){await lC();var v=u[S],y=new h.Ray(v,d),w=void 0;try{w=o.pickFromRay(y)}catch{}if(!w){y=new h.Ray(v,n);try{w=o.pickFromRay(y)}catch{}}if(w){var P=w.position;if(!(!P||!P.x||isNaN(P.x))){var C=er([P],e);C.forEach(x=>{x.z+=s}),P=er(C,i)[0],g.push(P),P=h.Cartographic.fromCartesian(P),p.push([P.longitude,P.latitude,P.height]),f.push(C[0])}}}return{local:f,world:p,world_cartesian:g}}const Ol=class Ol extends Yt{constructor(e,n){super(e,n);m(this,"_czmAreaMeasurement");if(this._czmAreaMeasurement=this.disposeVar(new Oo(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmAreaMeasurement;this.ad(a.track([e,"surfaceArea"],[s,"totalArea"])),this.ad(a.track([s,"units"],[e,"units"])),this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([s,"positions"],[e,"points"])),this.d(a.track([s,"interpolationDistance"],[e,"interpolation"])),this.d(a.track([s,"offsetHeight"],[e,"offsetHeight"]));{const r=()=>{if(this.geoPolygon&&(this.geoPolygon.outline=!1),e.stroked)s.outlineWidth=e.strokeWidth;else{s.outlineWidth=0;return}s.outlineWidth=e.strokeWidth,s.outlineColor=e.strokeColor};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.d(l.disposableOn(r))}this.d(e.startEvent.don(()=>{this._czmAreaMeasurement.start()})),this.d(e.stopEvent.don(()=>{this._czmAreaMeasurement.stop()}))}get czmAreaMeasurement(){return this._czmAreaMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmAreaMeasurement:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.positions&&oe(s,o,n,r.positions,e),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmAreaMeasurement:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.positions&&oe(s,o,n,r.positions,e),!0):!1}};m(Ol,"type",Ol.register("ESCesiumViewer",a.ESSurfaceAreaMeasurement.type,Ol));let $f=Ol;async function k2(t){navigator.clipboard.writeText(t).then(function(){console.log("复制成功")},function(i){console.log("复制失败")})}const Nl=class Nl extends a.EngineObject{constructor(e,n){super(e,n);m(this,"_customDiv");if(this._customDiv=this.disposeVar(new a.ESCustomDiv(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._customDiv;n.add(s),this.dispose(()=>n.delete(s)),s.instanceClass=class extends a.Destroyable{constructor(l,c,u){if(super(),this._subContainer=l,!u||!(u instanceof Re))return;u.extensions.cursorPositionInfo.enabled=!0;const d=document.createElement("div");this._subContainer.appendChild(d),this.dispose(()=>this._subContainer.removeChild(d)),d.style.width="100%",d.style.position="absolute",d.style.height=`${a.ESViewerStatusBar.defaults.height}px`,d.style.left="0",d.style.bottom="0",d.style.color="#fff",d.style.padding="0 20px 0 0",d.style.boxSizing="border-box",d.style.lineHeight=`${a.ESViewerStatusBar.defaults.height}px`,d.style.zIndex="100",d.style.alignContent="center",d.style.justifyContent="space-between";const p=document.createElement("span");d.appendChild(p),this.dispose(()=>d.removeChild(p));const f=document.createElement("span");p.appendChild(f),this.dispose(()=>p.removeChild(f));const g=document.createElement("span");p.appendChild(g),g.addEventListener("dblclick",function(){let y=g.innerHTML;y.startsWith("鼠标位置")&&(y=y.slice(5)),k2(y)}),g.style.cursor="pointer",this.dispose(()=>p.removeChild(g));const v=document.createElement("span");d.appendChild(v),this.dispose(()=>d.removeChild(v));{const y=()=>{d.style.height=(e.height??a.ESViewerStatusBar.defaults.height)+"px",d.style.lineHeight=(e.height??a.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(y)),y()}{const y=()=>{d.style.fontSize=(e.fontSize??a.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(y)),y()}{const y=()=>{e.bgColor?d.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:d.style.background=`rgba(${a.ESViewerStatusBar.defaults.bgColor[0]},${a.ESViewerStatusBar.defaults.bgColor[1]},${a.ESViewerStatusBar.defaults.bgColor[2]},${a.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(y)),y()}{v.innerText=`Cesium 版本 : ${h.VERSION} `;let y;const w=()=>{e.show?(d.style.display="flex",y=this.disposeVar(a.createAnimateFrameWithStartValues(()=>{var A;let P="",C="";const S=u.getCameraInfo();if(S){const R=(B,V)=>S.position[B].toFixed(V),L=(B,V)=>S.rotation[B].toFixed(V);P=`帧率:${u.getFPS()}FPS 经度: ${R(0,5)}° 纬度: ${R(1,5)}° 高度: ${R(2,2)}米 偏航角: ${L(0,2)}° 俯仰角: ${L(1,2)}° 翻滚角:${L(2,2)}° `}f.innerText=P;const x=(A=u.extensions)==null?void 0:A.cursorPositionInfo.cursorPosition;if(x){const R=(L,B)=>x[L].toFixed(B);C=`鼠标位置:${R(0,5)}° ${R(1,5)}° ${R(2,2)}m`}else C="暂时无法获取鼠标位置...";g.innerText=C})),y.start()):(d.style.display="none",y.destroy())};this.dispose(e.showChanged.disposableOn(w)),w()}}}}get customDiv(){return this._customDiv}};m(Nl,"type",Nl.register("ESCesiumViewer",a.ESViewerStatusBar.type,Nl));let qf=Nl;const Bl=class Bl extends a.EngineObject{constructor(e,n){super(e,n);m(this,"_customDiv");if(this._customDiv=this.disposeVar(new a.ESCustomDiv(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._customDiv;n.add(s),this.dispose(()=>n.delete(s)),this.dispose(a.track([s,"show"],[e,"show"])),s.instanceClass=class extends a.Destroyable{constructor(l,c,u){if(super(),this._subContainer=l,!u||!(u instanceof Re))return;u.extensions.cursorPositionInfo.enabled=!0;const d=document.createElement("div");this._subContainer.appendChild(d),this.dispose(()=>this._subContainer.removeChild(d));const p=document.createElement("div");d.appendChild(p),p.style.width="100%",p.className="ESViewerStatusBarScale",p.style.position="absolute",p.style.display="flex",p.style.height=`${a.ESViewerStatusBarScale.defaults.height}px`,p.style.left="0",p.style.bottom="0",p.style.color="#fff",p.style.padding="0 20px 0 0",p.style.boxSizing="border-box",p.style.lineHeight=`${a.ESViewerStatusBarScale.defaults.height}px`,p.style.zIndex="100",p.style.alignContent="center",p.style.justifyContent="space-between";const f=document.createElement("div");p.appendChild(f);const g=document.createElement("div");f.appendChild(g);const v=document.createElement("div");f.appendChild(v);const y=document.createElement("div");p.appendChild(y);const w=document.createElement("div");y.appendChild(w);const P=document.createElement("div");w.appendChild(P);const C=document.createElement("div");w.appendChild(C);const S=document.createElement("span");y.appendChild(S);{const B=()=>{p.style.height=(e.height??a.ESViewerStatusBarScale.defaults.height)+"px",p.style.lineHeight=(e.height??a.ESViewerStatusBarScale.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(B)),B()}{const B=()=>{p.style.fontSize=(e.fontSize??a.ESViewerStatusBarScale.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(B)),B()}{const B=()=>{e.bgColor?p.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:p.style.background=`rgba(${a.ESViewerStatusBarScale.defaults.bgColor[0]},${a.ESViewerStatusBarScale.defaults.bgColor[1]},${a.ESViewerStatusBarScale.defaults.bgColor[2]},${a.ESViewerStatusBarScale.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(B)),B()}f.style.display="flex",g.style.fontWeight="bold",g.style.padding="0 0 0 25px";let x="EarthSDK";g.innerText=x,v.style.fontWeight="";let A="——免费开源地球可视化开发包";v.innerText=A,y.style.width="550px",w.style.position="fixed",w.style.width="125px",w.style.height="30px",w.style.padding="0 5px",w.style.display="flex",w.style.justifyContent="flex-end",w.style.pointerEvents="auto",w.style.zIndex="101",P.style.width="125px",P.style.display="inline-block",P.style.textAlign="center",P.style.fontSize="14px",P.style.fontWeight="lighter",P.style.lineHeight="30px",P.style.color="#fff",P.innerHTML="1000km",C.style.borderRight="1px solid #fff",C.style.borderLeft="1px solid #fff",C.style.borderBottom="1px solid #fff",C.style.position="absolute",C.style.height="10px",C.style.top="15px",C.style.width="75px",C.style.right=`${60/2}px`,S.style.display="flex",S.style.zIndex="101",S.style.justifyContent="flex-end",S.style.right="0";const R=()=>{const B=n.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||B&&B>1e6)w.style.display="none";else{w.style.display="block";const V=n.viewerLegend.legend.computedLengthInStr;V&&(P.innerHTML=V);const G=n.viewerLegend.legend.computedLengthInPixels;if(G){C.style.width=`${G}px`;const O=(135-G)/2;C.style.left=`${O}px`}}};R();const L=setInterval(()=>{R()},200);this.dispose(()=>clearInterval(L));{let B;const V=()=>{e.show?(d.style.display="block",B=this.disposeVar(a.createAnimateFrameWithStartValues(()=>{var _;let G="";const O=u.getCameraInfo();if(O){const E=(D,z)=>O.position[D].toFixed(z);G+=`帧率:${u.getFPS()}FPS 相机: ${E(2,2)}米 `}const N=(_=u.extensions)==null?void 0:_.cursorPositionInfo.cursorPosition;if(N){const E=(D,z)=>N[D].toFixed(z);G+=`位置:${E(0,5)}° ${E(1,5)}° ${E(2,2)}米`}else G+="暂时无法获取鼠标位置...";S.innerText=G})),B.start()):(d.style.display="none",B.destroy())};this.dispose(e.showChanged.disposableOn(V)),V()}}}}get customDiv(){return this._customDiv}};m(Bl,"type",Bl.register("ESCesiumViewer",a.ESViewerStatusBarScale.type,Bl));let Xf=Bl;const hC=h.Math.toDegrees,K2=new h.Cartographic;function uC(t,i,e){const n=h.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=h.Cartesian3.fromDegrees(i[0],i[1],i[2]),s=h.Cartesian3.subtract(o,n,new h.Cartesian3);h.Cartesian3.normalize(s,s);const r=new h.Ray(n,s),l=e.pickFromRay(r),c=e.globe.pick(r,e);var u;if(l&&l.position&&c){const v=h.Cartesian3.distance(n,l.position),y=h.Cartesian3.distance(n,c);u=v<y?l.position:c}else l&&l.position?u=l.position:c&&(u=c);if(!u)return;const d=h.Cartesian3.distance(n,o),f=h.Cartesian3.distance(n,u)>d?o:u,g=h.Cartographic.fromCartesian(f,void 0,K2);return[hC(g.longitude),hC(g.latitude),g.height]}const Vl=class Vl extends yt{constructor(e,n){super(e,n);m(this,"_hideGeoPolylines",this.disposeVar(new Xt(this.czmViewer,this.sceneObject.id)));m(this,"_visibleGeoPolylines",this.disposeVar(new Xt(this.czmViewer,this.sceneObject.id)));const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this._hideGeoPolylines,r=this._visibleGeoPolylines;this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([r,"show"],[e,"show"])),this.d(a.track([r,"color"],[e,"visibleColor"])),this.d(a.track([s,"color"],[e,"invisibleColor"]));{const l=()=>{const u=e.points,d=e.heightOffset;if(!u||u.length<2||u[0].toString()===u[1].toString()){s.positions=void 0,r.positions=void 0;return}const p=[],f=[],[g,v,y]=u[0],w=[g,v,y+d];try{u.forEach((P,C)=>{if(C===0)return;const S=uC(w,P,o.scene);S?(p.push([P,S]),f.push([w,S])):f.push([w,P])}),s.positions=p,r.positions=f}catch(P){console.warn(P)}};l();const c=this.dv(a.createNextAnimateFrameEvent(e.pointsChanged,e.heightOffsetChanged));this.d(c.don(l))}}get hideGeoPolylines(){return this._hideGeoPolylines}get visibleGeoPolylines(){return this._visibleGeoPolylines}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{let r=[];return this.visibleGeoPolylines.positions&&(r=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(r=[...r,...this.hideGeoPolylines.positions.flat()]),oe(s,o,n,r,e),!0}}flyIn(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyInParam)return super.flyIn(e,n);{let r=[];return this.visibleGeoPolylines.positions&&(r=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(r=[...r,...this.hideGeoPolylines.positions.flat()]),oe(s,o,n,r,e),!0}}};m(Vl,"type",Vl.register("ESCesiumViewer",a.ESVisibilityAnalysis.type,Vl));let Yf=Vl;class da extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.dv(new a.Event));m(this,"_enableEvent",this.dv(new a.Event));m(this,"_clearEvent",this.dv(new a.Event));m(this,"_gridPoints",this.dv(a.reactJson([])));m(this,"excavationPolylines");m(this,"fillPolylines");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.dv(new Xt(e,n)),r=this.dv(new Xt(e,n));this.excavationPolylines=s,this.fillPolylines=r;const l=s;l.color=[1,1,0,1],this.d(a.track([l,"show"],[this,"show"])),l.show=!1,l.depthTest=!0;const c=r;c.color=[0,0,1,1],this.d(a.track([c,"show"],[this,"show"])),c.show=!1;{const g=this.ad(new Mi(e,n));this.d(a.track([g,"show"],[this,"show"])),this.d(a.bind([g,"allowPicking"],[this,"allowPicking"])),this.d(a.bind([g,"positions"],[this,"positions"])),this.d(a.bind([g,"depthTest"],[this,"depthTest"])),this.d(a.bind([g,"outlineWidth"],[this,"outlineWidth"])),this.d(a.bind([g,"outlineColor"],[this,"outlineColor"])),this.d(a.bind([g,"outline"],[this,"outline"])),this.d(a.bind([g,"color"],[this,"fillColor"])),this.d(a.bind([g,"fill"],[this,"filled"])),this.d(a.bind([g,"strokeGround"],[this,"strokeGround"])),this.d(a.bind([g,"ground"],[this,"fillGround"])),this.d(this.flyToEvent.don(w=>{g.flyTo(w)}));const v=()=>{g.positions=this.positions};v();const y=this.dv(a.createNextAnimateFrameEvent(this.positionsChanged));this.d(y.don(v))}const u=()=>{if(!this.positions||!this.positions.length)return;const{minPos:g,maxPos:v}=a.getMinMaxCorner(this.positions),y=g[0],w=g[1],P=v[0],C=v[1],x={type:"Polygon",coordinates:[[...this.positions.map(N=>[N[0],N[1]])]]},A=[y,w,P,C],R=this.gridWidth,V=A0(A,R,{units:"meters",mask:x}).features.map(N=>N.geometry.coordinates),G=h.Math.toRadians;return V.map(N=>new h.Cartographic(G(N[0]),G(N[1])))},d=()=>{l.positions=[],c.positions=[],this.area=0,this.cutVolume=0,this.fillVolume=0,this.cutAndFillVolume=0,l.depthTest=!0},p=this.dv(a.createProcessingFromAsyncFunc(async g=>{const v=u();let y=0,w=300;const P=Math.ceil(v.length/w),C=[];do{let S=[];y===P-1?S=v.slice(y*w):S=v.slice(y*w,(y+1)*w);const x=o.scene.sampleHeightMostDetailed(S),A=await g.promise(x);if(y===P-1?this.progress=Math.round(this.progress+100/P):this.progress+=100/P,A&&A.length){const R=h.Math.toDegrees,L=A.filter(B=>B!=null).map(B=>[R(B.longitude),R(B.latitude),B.height]);C.push(...L)}y++}while(y<P);!C||!C.length||(this.gridPoints=C)}));let f=null;{const g=()=>{if(!this.positions||!this.positions.length||!this.gridPoints)return;let v=0;const y=[];let w=0;const P=[];this.gridPoints.forEach(C=>{const S=this.positions;C[2]>S[0][2]?(v+=this.gridWidth*this.gridWidth*(C[2]-S[0][2]),y.push([C,[C[0],C[1],S[0][2]]])):(w+=this.gridWidth*this.gridWidth*(S[0][2]-C[2]),P.push([C,[C[0],C[1],S[0][2]]]))}),l.positions=y,c.positions=P,l.show=!0,c.show=!0,this.area=yy(this.positions),this.cutVolume=v,this.fillVolume=w,this.cutAndFillVolume=w-v,f&&clearTimeout(f),f=setTimeout(()=>{l.depthTest=!1},200)};g(),this.d(this.gridPointsChanged.don(g)),this.d(()=>clearTimeout(f))}{const g=()=>{if(!this.positions||!this.positions.length){this.planeHeight=void 0;return}this.planeHeight=this.positions[0][2]};g(),this.d(this.positionsChanged.don(g))}{const g=()=>{if(!this.planeHeight||!this.positions||!this.positions.length)return;const v=JSON.parse(JSON.stringify(this.positions.slice(1)));v.unshift([this.positions[0][0],this.positions[0][1],this.planeHeight]),this.positions=v};g(),this.d(this.planeHeightChanged.don(g))}this.d(this.enableEvent.don(()=>{d(),this.gridPoints=[],this.progress=0,p.restart()})),this.d(this.clearEvent.don(()=>{d()}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get enableEvent(){return this._enableEvent}enableEmit(){this._enableEvent.emit()}get clearEvent(){return this._clearEvent}clearEmit(){this._clearEvent.emit()}get gridPoints(){return this._gridPoints.value}set gridPoints(e){this._gridPoints.value=e}get gridPointsChanged(){return this._gridPoints.changed}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(void 0),planeHeight:a.react(void 0),gridWidth:1,area:0,cutVolume:0,fillVolume:0,cutAndFillVolume:0,progress:0,depthTest:!1,outlineWidth:2,outlineColor:[1,1,1,1],outline:!0,filled:!1,fillColor:[1,1,1,1],fillGround:!1,strokeGround:!1})})(da||(da={})),a.extendClassProps(da.prototype,da.createDefaultProps);const Ul=class Ul extends Yt{constructor(e,n){super(e,n);m(this,"_geoVolumeMeasurement");if(this._geoVolumeMeasurement=this.dv(new da(this.czmViewer,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._geoVolumeMeasurement;this.d(a.track([s,"show"],[e,"show"])),this.d(a.bind([s,"positions"],[e,"points"])),this.d(a.track([s,"allowPicking"],[e,"allowPicking"])),this.d(a.bind([s,"planeHeight"],[e,"planeHeight"])),this.d(a.track([s,"gridWidth"],[e,"gridWidth"])),this.d(a.track([e,"cutVolume"],[s,"cutVolume"])),this.d(a.track([e,"fillVolume"],[s,"fillVolume"])),this.d(a.track([e,"cutAndFillVolume"],[s,"cutAndFillVolume"])),this.d(a.bind([e,"progress"],[s,"progress"])),this.d(a.track([s,"depthTest"],[e,"depthTest"])),this.d(a.track([s,"outline"],[e,"stroked"])),this.d(a.track([s,"outlineWidth"],[e,"strokeWidth"])),this.d(a.track([s,"outlineColor"],[e,"strokeColor"])),this.d(a.track([s,"filled"],[e,"filled"])),this.d(a.track([s,"fillColor"],[e,"fillColor"])),this.d(a.track([s,"fillGround"],[e,"fillGround"])),this.d(a.track([s,"strokeGround"],[e,"strokeGround"])),this.ad(a.track([e,"volume"],[e,"cutAndFillVolume"])),this.d(e.startEvent.don(()=>{s.enableEmit()})),this.d(e.clearEvent.don(()=>{s.clearEmit()}))}get geoVolumeMeasurement(){return this._geoVolumeMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoVolumeMeasurement:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(Ul,"type",Ul.register("ESCesiumViewer",a.ESVolumeMeasurement.type,Ul));let Zf=Ul;const Wl=class Wl extends Yt{constructor(e,n){super(e,n);m(this,"czmEntity");m(this,"czmPolyline",this.ad(new a.ESGeoLineString));const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.czmPolyline;n.add(s),this.ad(()=>n.delete(s)),this.ad(a.bind([s,"show"],[e,"show"])),this.ad(a.bind([s,"allowPicking"],[e,"allowPicking"])),this.ad(a.bind([s,"stroked"],[e,"stroked"])),this.ad(a.bind([s,"strokeColor"],[e,"strokeColor"])),this.ad(a.bind([s,"strokeWidth"],[e,"strokeWidth"])),this.ad(a.bind([s,"strokeGround"],[e,"strokeGround"]));{const u=()=>{if(!e.points||e.points.length<2)s.points=e.points;else{const p=structuredClone(e.points);p.push(p[0]),e.perPositionHeight?s.points=p:s.points=p.map(f=>(f[2]=e.height??a.ESGeoExtrudedPolygon.defaults.height,f))}};u();const d=this.ad(a.createNextAnimateFrameEvent(e.pointsChanged,e.heightChanged,e.perPositionHeightChanged));this.ad(d.don(u))}const r=this.czmEntity=o.entities.add({polygon:{}});h.Entity.prototype&&(r.ESSceneObjectID=e.id),this.dispose(()=>o.entities.remove(r));let l=new h.PolygonHierarchy;r.polygon&&(r.polygon.hierarchy=new h.CallbackProperty(()=>l,!1));const c=()=>{const u=pt(e.points??[]);if(u.length<2){l=new h.PolygonHierarchy;return}l=new h.PolygonHierarchy(u)};c(),this.dispose(e.pointsChanged.disposableOn(c));{const u=()=>{r.show=e.show&&e.filled,this.geoPolygon&&(this.geoPolygon.show=e.show&&!r.show&&e.filled)};u();const d=this.ad(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.ad(d.don(u))}{const u=()=>{r.polygon&&(r.polygon.perPositionHeight=new h.ConstantProperty(e.perPositionHeight),c())};u(),this.ad(e.perPositionHeightChanged.don(u))}{const u=()=>{r.polygon&&(r.polygon.height=new h.ConstantProperty(e.height??a.ESGeoExtrudedPolygon.defaults.height))};u(),this.dispose(e.heightChanged.disposableOn(u))}{const u=()=>{r.polygon&&(r.polygon.extrudedHeight=new h.ConstantProperty(e.extrudedHeight??a.ESGeoExtrudedPolygon.defaults.extrudedHeight))};u(),this.dispose(e.extrudedHeightChanged.disposableOn(u))}{const u=()=>{const d=h.Color.fromCartesian4(h.Cartesian4.fromArray(e.fillColor));r.polygon&&(r.polygon.material=d)};u(),this.dispose(e.fillColorChanged.disposableOn(u))}this.disposeVar(new a.ObjResettingWithEvent(e.allowPickingChanged,()=>{if(!e.allowPicking)return new Re.ObjectsToExcludeWrapper(n,r)}))}getMinAndMaxheight(){const{sceneObject:e}=this;if(e.points){const{minPos:n,maxPos:o}=a.getMinMaxCorner(e.points);return[n[2],o[2]]}return[0,0]}};m(Wl,"type",Wl.register("ESCesiumViewer",a.ESGeoExtrudedPolygon.type,Wl));let Qf=Wl;const Gl=class Gl extends a.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}const{human:o,poi:s}=i;this.dispose(a.bind([o,"position"],[i,"position"])),this.dispose(a.bind([o,"rotation"],[i,"rotation"])),this.ad(a.bind([o,"scale"],[i,"scale"])),this.ad(a.track([s,"scale"],[i,"scale"])),this.dispose(a.track([s,"rotation"],[i,"rotation"]));const r=()=>{const c=i.position;s.position=[c[0],c[1],c[2]+i.poiOffsetHeight]};r();const l=this.dv(a.createNextAnimateFrameEvent(i.positionChanged,i.poiOffsetHeightChanged));this.d(l.don(r)),this.ad(s.pickedEvent.don(c=>{c.assign({sceneObject:i}),i.pickedEvent.emit(c)}))}};m(Gl,"type",Gl.register("ESCesiumViewer",a.ESHumanPoi.type,Gl));let kf=Gl;const Hl=class Hl extends a.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(i.highlightInner3DtilesetEvent.don(o=>{o.strokeFeature([]);const s=o.d(o.tilesetReady.donce(c=>{c.allTilesLoaded.addEventListener(()=>{var d,p,f,g;const u=(g=(f=(p=(d=c==null?void 0:c._root)==null?void 0:d._content)==null?void 0:p._model)==null?void 0:f._featureTables[0])==null?void 0:g._features[0];u?o.strokeFeature([u],h.Color.LIME.toBytes().map(v=>v/255)):console.warn("tileset?._root?._content?._model?._featureTables[0]?._features[0] is undefined !",c),s()})})),r=o.url,l=Date.now();r.includes("?reload=")?o.url=r.replace(/\?reload=\d+/,`?reload=${l}`):o.url=r+`?reload=${l}`})),this.d(i.removeHighlightInner3DtilesetEvent.don(o=>{o.strokeFeature([])})),this.d(i.es3DTileset.tilesetReady.don(o=>{const s=()=>{const l=i.layerConfig;if(!l){o.style=void 0;return}const c=i.colorBlendMode,u=(f,g)=>{try{if(f.getPropertyIds().includes("materialName"))return h.Color.clone(h.Color.WHITE,g);const v=f.getProperty("layer"),y=f.getProperty("dataset"),w=v.toString(),P=y.toString(),C=l.find(x=>x.dataset.toString()===P&&x.layer.toString()===w);if(C&&C.value.color){const x=C.value.color;return h.Color.fromCssColorString(x,g)}const S=l.filter(x=>x.dataset.toString()===P);if(S.length==1&&S[0].value.color){const x=S[0].value.color;return h.Color.fromCssColorString(x,g)}else return h.Color.clone(h.Color.WHITE,g)}catch(v){return console.warn(v),h.Color.clone(h.Color.WHITE,g)}},d=f=>{try{if(f.getPropertyIds().includes("id")){const S=Object.entries(i.visJson);for(let x=0;x<S.length;x++){const A=S[x];if(f.getProperty("id").toString()===A[0])return A[1]}}if(f.getPropertyIds().includes("materialName"))return!0;const g=f.getProperty("layer"),v=f.getProperty("dataset"),y=g.toString(),w=v.toString(),P=l.find(S=>S.dataset.toString()===w&&S.layer.toString()===y);if(P&&P.value.visible===!1)return!1;if(P&&P.value.visible===!0)return!0;const C=l.filter(S=>S.dataset.toString()===w);return!(C.length==1&&C[0].value.visible===!1)}catch(g){return console.warn(g),!0}};let p;c!=="HIGHLIGHT"?p=new h.Cesium3DTileStyle({color:{evaluateColor:function(f,g){return u(f,g)}},show:{evaluate:function(f){return d(f)}}}):p=new h.Cesium3DTileStyle({show:{evaluate:function(f){return d(f)}}}),console.log("style",p),o.style=p};s();const r=this.dv(a.createNextAnimateFrameEvent(i.layerConfigChanged,i.colorBlendModeChanged,i.visJsonChanged));this.d(r.don(()=>{s()}))}))}};m(Hl,"type",Hl.register("ESCesiumViewer",a.ESRtsTileset.type,Hl));let Kf=Hl;const $l=class $l extends Ds{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}};m($l,"type",$l.register("ESCesiumViewer",a.ESRtsFeatureEditing.type,$l));let Jf=$l;const ql=class ql extends Ds{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}};m(ql,"type",ql.register("ESCesiumViewer",a.ESMsTileset.type,ql));let jf=ql;const Xl=class Xl extends me{constructor(e,n){super(e,n);m(this,"_czmGeoPoint");if(this._czmGeoPoint=this.disposeVar(new ti(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoPoint;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"]))}get czmGeoPoint(){return this._czmGeoPoint}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmGeoPoint:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(Xl,"type",Xl.register("ESCesiumViewer",a.ESStaticMesh.type,Xl));let eg=Xl;const Yl=class Yl extends yt{constructor(i,e){super(i,e);const n=e.viewer;if(!n){console.warn("viewer is undefined!");return}const o=this.ad(new mm(n));this.ad(i.startEvent.don(async()=>{const s=await o.getDepthsFromScreen(),r=Number.isFinite(i.radius)?i.radius:a.ESSkylineAnalysis.defaults.radius,{depths:l,windowPositions:c,positions:u}=o.getSkylineDepthsAndPositions(s,n.scene.canvas.width,n.scene.canvas.height,r),d=se(n.camera.position);u.push(d),i.depths=l,i.windowPositions=c,i.points=u}))}flyTo(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyToParam||n.flyInParam?super.flyTo(i,e):n.points?(oe(o,n,e,n.points,i),!0):!1:!1}flyIn(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyInParam?super.flyIn(i,e):n.points?(oe(o,n,e,n.points,i),!0):!1:!1}};m(Yl,"type",Yl.register("ESCesiumViewer",a.ESSkylineAnalysis.type,Yl));let tg=Yl;class J2 extends a.Destroyable{constructor(e,n){super();m(this,"_rectangle");m(this,"_updateHeatMapEvent",this.disposeVar(new a.Event));const o=e.sceneObject;this._rectangle=this.ad(new Si(n,o.id)),this._rectangle.ground=!0,this._rectangle.outline=!1,this.ad(a.bind([this.rectangle,"show"],[o,"show"])),this.ad(a.bind([this.rectangle,"allowPicking"],[o,"allowPicking"])),this.ad(this.updateHeatMapEvent.don(s=>{this.rectangle.rectangle=e.rectangle,this.rectangle.material={type:"Image",image:s}}))}get rectangle(){return this._rectangle}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}}class j2 extends a.Destroyable{constructor(e,n){super();m(this,"_primitive");m(this,"_updateHeatMapEvent",this.disposeVar(new a.Event));m(this,"czmViewer");m(this,"czmESHeatMap");const o=this.czmViewer=n,s=this.czmESHeatMap=e,r=s.sceneObject,l=o.viewer;if(!l)return;let c,u;const d=this.ad(new a.Event),p=()=>{f(),!(!c||!u)&&(this._primitive=l.scene.primitives.add(new h.Primitive({geometryInstances:c,appearance:u,asynchronous:!1,allowPicking:r.allowPicking})))},f=()=>{this.primitive&&l.scene.primitives.remove(this.primitive)};this.ad(f);{const g=()=>{this.primitive&&(this.primitive.show=r.show)};g(),this.ad(r.showChanged.don(g))}{const g=this.ad(a.createNextAnimateFrameEvent(r.allowPickingChanged,d));this.ad(g.don(p))}{const g=()=>{s.rectangle&&(c=new h.GeometryInstance({geometry:this.createHeatmapGeometry(Number.parseFloat(s.div.style.width),Number.parseFloat(s.div.style.height))}),this.primitive&&(this._primitive._state=3,this._primitive._appearance=void 0,this._primitive.geometryInstances=c,this._primitive._recomputeBoundingSpheres=!0))};this.ad(this.updateHeatMapEvent.don(v=>{if(!s.rectangle)return;const y=s.rectangle[1]+(s.rectangle[3]-s.rectangle[1])*.5,w=a.getDistancesFromPositions([[s.rectangle[0],y,0],[s.rectangle[2],y,0]],"GEODESIC")[0]/5;u=new h.MaterialAppearance({material:new h.Material({fabric:{type:"Image",uniforms:{image:v}},translucent:!0}),vertexShaderSource:this.getVertexShaderSource(w),flat:!0}),this.primitive&&s.rectangle&&(this.primitive.appearance.material.uniforms.image=v,this.primitive.appearance._vertexShaderSource=this.getVertexShaderSource(w)),g(),this.primitive||d.emit()}))}}get primitive(){return this._primitive}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}getVertexShaderSource(e){return`
1892
1892
  in vec3 position3DHigh;
1893
1893
  in vec3 position3DLow;
1894
1894
  in vec3 normal;
@@ -1911,7 +1911,7 @@ void main()
1911
1911
  p += vec4(color.a * upDir * ${e??1e3}, 0.0);
1912
1912
 
1913
1913
  gl_Position = czm_modelViewProjectionRelativeToEye * p;
1914
- }`}createHeatmapGeometry(e,n){const o=this.czmESHeatMap,s=e||256,r=Math.ceil(n||256),[l,c,u,d]=o.rectangle,p=(u-l)/(s-1),f=(d-c)/(r-1),g=[],v=[],y=[],w=[];for(let P=0;P<s;P++){const C=l+p*P;for(let S=0;S<r;S++){const x=c+f*S;o.heatmap.getValueAt({x:P,y:S});const A=h.Cartesian3.fromDegrees(C,x,o.heatmap._renderer._min);g.push(A.x,A.y,A.z),v.push(P/(s-1),S/(r-1)),S!==r-1&&P!==s-1&&(y.push((P+1)*r+S+1,P*r+S+1,P*r+S),y.push(P*r+S,(P+1)*r+S,(P+1)*r+S+1))}}return this.createGeometry(g,v,y,w)}createGeometry(e,n,o,s){return new h.Geometry({attributes:new h.GeometryAttributes({position:new h.GeometryAttribute({componentDatatype:h.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new h.GeometryAttribute({componentDatatype:h.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(n)})}),indices:new Uint32Array(o),boundingSphere:h.BoundingSphere.fromVertices(e,new h.Cartesian3,3),primitiveType:h.PrimitiveType.TRIANGLES})}}const Vt={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}};class j2{constructor(i){m(this,"_coordinator");m(this,"_data");m(this,"_radi");m(this,"_min");m(this,"_max");m(this,"_xField");m(this,"_yField");m(this,"_valueField");m(this,"_cfgRadius");this._coordinator=new dC,this._data={},this._radi={},this._min=0,this._max=1,this._xField=i.xField||i.defaultXField||Vt.defaultXField,this._yField=i.yField||i.defaultYField||Vt.defaultYField,this._valueField=i.valueField||i.defaultValueField||Vt.defaultValueField,i.radius&&(this._cfgRadius=i.radius)}_organiseData(i,e){const n=i[this._xField],o=i[this._yField],s=i[this._valueField]||1,r=i.radius||this._cfgRadius||Vt.defaultRadius;return this._data[n]||(this._data[n]={},this._radi[n]={}),this._data[n][o]?this._data[n][o]+=s:(this._data[n][o]=s,this._radi[n][o]=r),this._data[n][o]>this._max?(e?this.setDataMax(this._data[n][o]):this._max=this._data[n][o],!1):{x:n,y:o,value:s,radius:r,min:this._min,max:this._max}}_unOrganizeData(){const i=[];for(const e in this._data)for(const n in this._data[e])i.push({x:Number(e),y:Number(n),radius:this._radi[e][n],value:this._data[e][n]});return{min:this._min,max:this._max,data:i}}_onExtremaChange(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})}_getInternalData(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}}addData(i){if(Array.isArray(i))i.forEach(e=>this.addData(e));else{const e=this._organiseData(i,!0);e&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[e]})}return this}setData(i){this._data={},this._radi={};for(const e of i.data)this._organiseData(e,!1);return this._max=i.max,this._min=i.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setDataMax(i){return this._max=i,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setDataMin(i){return this._min=i,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setCoordinator(i){this._coordinator=i}getData(){return this._unOrganizeData()}}class eF{constructor(i){m(this,"shadowCanvas");m(this,"canvas");m(this,"_renderBoundaries");m(this,"_width");m(this,"_height");m(this,"shadowCtx");m(this,"ctx");m(this,"_palette");m(this,"_templates");m(this,"_blur",Vt.defaultBlur);m(this,"_opacity",0);m(this,"_maxOpacity",Vt.defaultMaxOpacity*255);m(this,"_minOpacity",Vt.defaultMinOpacity*255);m(this,"_useGradientOpacity",!1);m(this,"_min",0);m(this,"_max",1);const e=i.container;this.shadowCanvas=document.createElement("canvas"),this.canvas=i.canvas||document.createElement("canvas"),this._renderBoundaries=[1e4,1e4,0,0];const n=getComputedStyle(e);this.canvas.className="heatmap-canvas",this._width=this.canvas.width=this.shadowCanvas.width=+n.width.replace(/px/,""),this._height=this.canvas.height=this.shadowCanvas.height=+n.height.replace(/px/,""),this.shadowCtx=this.shadowCanvas.getContext("2d"),this.ctx=this.canvas.getContext("2d"),this.canvas.style.cssText=this.shadowCanvas.style.cssText="position:absolute;left:0;top:0;",e.style.position="relative",e.appendChild(this.canvas),this._palette=this._getColorPalette(i),this._templates={},this._setStyles(i)}_getColorPalette(i){const e=i.gradient||i.defaultGradient||Vt.defaultGradient,n=document.createElement("canvas"),o=n.getContext("2d");n.width=256,n.height=1;const s=o.createLinearGradient(0,0,256,1);for(const r in e)s.addColorStop(Number(r),e[r]);return o.fillStyle=s,o.fillRect(0,0,256,1),o.getImageData(0,0,256,1).data}_getPointTemplate(i,e){const n=document.createElement("canvas"),o=n.getContext("2d"),s=i,r=i;if(n.width=n.height=i*2,e===1)o.beginPath(),o.arc(s,r,i,0,2*Math.PI,!1),o.fillStyle="rgba(0,0,0,1)",o.fill();else{const l=o.createRadialGradient(s,r,i*e,s,r,i);l.addColorStop(0,"rgba(0,0,0,1)"),l.addColorStop(1,"rgba(0,0,0,0)"),o.fillStyle=l,o.fillRect(0,0,2*i,2*i)}return n}renderPartial(i){this._drawAlpha(i),this._colorize()}renderAll(i){this._clear(),this._drawAlpha(this._prepareData(i)),this._colorize()}_prepareData(i){const e=[],n=Object.keys(i.data);for(const o of n){const s=Object.keys(i.data[o]);for(const r of s)e.push({x:Number(o),y:Number(r),value:i.data[o][r],radius:i.radi[o][r]})}return{min:i.min,max:i.max,data:e}}updateConfig(i){i.gradient&&(this._palette=this._getColorPalette(i)),this._setStyles(i)}setDimensions(i,e){this._width=i,this._height=e,this.canvas.width=this.shadowCanvas.width=i,this.canvas.height=this.shadowCanvas.height=e}_clear(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)}_setStyles(i){this._blur=i.blur===0?0:i.blur||i.defaultBlur||Vt.defaultBlur,i.backgroundColor&&(this.canvas.style.backgroundColor=i.backgroundColor),this._opacity=(i.opacity||0)*255,this._maxOpacity=(i.maxOpacity||i.defaultMaxOpacity||Vt.defaultMaxOpacity)*255,this._minOpacity=(i.minOpacity||i.defaultMinOpacity||Vt.defaultMinOpacity)*255,this._useGradientOpacity=!!i.useGradientOpacity}_drawAlpha(i){this._min=i.min,this._max=i.max;const e=1-this._blur;for(const n of i.data){const o=n.radius,s=n.x-o,r=n.y-o,l=Math.min(n.value,this._max);this._templates[o]=this._getPointTemplate(o,e),this.shadowCtx.globalAlpha=(l-this._min)/(this._max-this._min),this.shadowCtx.drawImage(this._templates[o],s,r),this._renderBoundaries[0]=Math.min(this._renderBoundaries[0],s),this._renderBoundaries[1]=Math.min(this._renderBoundaries[1],r),this._renderBoundaries[2]=Math.max(this._renderBoundaries[2],s+2*o),this._renderBoundaries[3]=Math.max(this._renderBoundaries[3],r+2*o)}}_colorize(){let[i,e,n,o]=this._renderBoundaries;i=Math.max(0,i),e=Math.max(0,e),n=Math.min(this._width-i,n-i),o=Math.min(this._height-e,o-e);const s=this.shadowCtx.getImageData(i,e,n,o),r=s.data;for(let l=3;l<r.length;l+=4){const c=r[l],u=c*4;if(!u)continue;let d;this._opacity>0?d=this._opacity:d=c<this._maxOpacity?c<this._minOpacity?this._minOpacity:c:this._maxOpacity,r[l-3]=this._palette[u],r[l-2]=this._palette[u+1],r[l-1]=this._palette[u+2],r[l]=this._useGradientOpacity?this._palette[u+3]:d}this.ctx.putImageData(s,i,e),this._renderBoundaries=[1e3,1e3,0,0]}getValueAt(i){const n=this.shadowCtx.getImageData(i.x,i.y,1,1).data[3];return Math.abs(this._max-this._min)*(n/255)>>0}getDataURL(){return this.canvas.toDataURL()}}class dC{constructor(){m(this,"cStore");this.cStore={}}on(i,e,n){this.cStore[i]||(this.cStore[i]=[]),this.cStore[i].push(o=>e.call(n,o))}emit(i,e){this.cStore[i]&&this.cStore[i].forEach(n=>n(e))}}class tF{constructor(i={}){m(this,"_config");m(this,"_coordinator");m(this,"_renderer");m(this,"_store");if(this._config={...Vt,...i},this._coordinator=new dC,this._config.plugin){const e=Vt.plugins[this._config.plugin];if(!e)throw new Error(`Plugin '${this._config.plugin}' not found. Maybe it was not registered.`);this._renderer=new e.renderer(this._config),this._store=new e.store(this._config)}else this._renderer=new eF(this._config),this._store=new j2(this._config);this._connect()}_connect(){this._coordinator.on("renderpartial",i=>this._renderer.renderPartial(i),this._renderer),this._coordinator.on("renderall",i=>this._renderer.renderAll(i),this._renderer),this._coordinator.on("extremachange",i=>{var e,n;(n=(e=this._config).onExtremaChange)==null||n.call(e,{min:i.min,max:i.max,gradient:this._config.gradient||this._config.defaultGradient||Vt.defaultGradient})}),this._store.setCoordinator(this._coordinator)}addData(i){return this._store.addData(i),this}setData(i){return this._store.setData(i),this}setDataMax(i){return this._store.setDataMax(i),this}setDataMin(i){return this._store.setDataMin(i),this}configure(i){return this._config={...this._config,...i},this._renderer.updateConfig(this._config),this._coordinator.emit("renderall",this._store._getInternalData()),this}repaint(){return this._coordinator.emit("renderall",this._store._getInternalData()),this}getData(){return this._store.getData()}getDataURL(){return this._renderer.getDataURL()}getValueAt(i){return this._store.getValueAt?this._store.getValueAt(i):this._renderer.getValueAt?this._renderer.getValueAt(i):null}}const iF=t=>new tF(t),Zl=class Zl extends jt{constructor(e,n){super(e,n);m(this,"_heatmap");m(this,"_div");m(this,"_primitiveObj");m(this,"_rectangle",this.disposeVar(a.react(void 0)));m(this,"onePixelRadius",1e-4);const o=n.viewer,s=256;if(this._primitiveObj=this.ad(new a.ObjResettingWithEvent(e.is3DChanged,()=>e.is3D?new J2(this,n):new K2(this,n))),!o){console.warn("viewer is undefined!");return}this._div=document.createElement("div"),this.div.style.display="none",this.div.style.width=`${s}px`,this.div.style.height=`${s}px`,document.body.appendChild(this.div),this.ad(()=>{document.body.removeChild(this.div)}),this._heatmap=iF({container:this.div}),this.heatmap._renderer.setDimensions(s,s);const r=this.ad(new a.Event);let l=[],c={max:100,min:0};{const u=()=>{const p={radius:e.radius??a.ESHeatMap.defaults.radius,gradient:e.gradient??a.ESHeatMap.defaults.gradient,blur:e.blur??a.ESHeatMap.defaults.blur,maxOpacity:1,minOpacity:0};this.heatmap.configure(p),this.heatmap._store._cfgRadius=p.radius,r.emit()};u();const d=this.ad(a.createNextAnimateFrameEvent(e.radiusChanged,e.gradientChanged,e.blurChanged));this.ad(d.don(u))}{const u=()=>{if(e.data&&e.data.length>2){const{maxPos:p,minPos:f}=a.getMinMaxCorner(e.data),g=p[0]-f[0],v=p[1]-f[1];if(c={max:p[2]??100,min:f[2]??0},!Number.isFinite(g)||!Number.isFinite(v)||g<=0||v<=0)return;const y=1/Math.cos((f[1]+v*.5)*Math.PI/180);if(y==1/0)return;const w=s*v/g*y;this.div.style.width=`${s}px`,this.div.style.height=`${w}px`,this.heatmap._renderer.setDimensions(s,w);const P=g/s*(e.radius??a.ESHeatMap.defaults.radius)*2,C=v/w*(e.radius??a.ESHeatMap.defaults.radius)*2;this.onePixelRadius=Math.min(P,C),this.rectangle=[f[0]-P,f[1]-C,p[0]+P,p[1]+C],l=nF(e.data,this.rectangle,s,w),r.emit()}};u();const d=this.ad(a.createNextAnimateFrameEvent(e.dataChanged,e.radiusChanged));this.ad(d.don(u))}{const u=()=>{const d={max:c.max,min:c.min,data:l};this.heatmap.setData(d),this.heatmap.repaint(),this.primitiveObj&&this.primitiveObj.updateHeatMap(this.heatmap.getDataURL())};u(),this.ad(r.don(u))}this.ad(this._primitiveObj.objChanged.don(()=>{r.emit()}))}get heatmap(){return this._heatmap}get div(){return this._div}get primitiveObj(){var e;return(e=this._primitiveObj)==null?void 0:e.obj}get rectangle(){return this._rectangle.value}set rectangle(e){this._rectangle.value=e}get rectangleChanged(){return this._rectangle.changed}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):this.rectangle?(oe(s,o,n,[[this.rectangle[0],this.rectangle[1],0],[this.rectangle[2],this.rectangle[3],0]],e),!0):!1:!1}};m(Zl,"type",Zl.register("ESCesiumViewer",a.ESHeatMap.type,Zl));let ig=Zl;function nF(t,i,e,n,o){return t.map(s=>({x:(s[0]-i[0])*e/(i[2]-i[0])|0,y:(1-(s[1]-i[1])/(i[3]-i[1]))*n|0,value:s[2]}))}const Ql=class Ql extends yt{constructor(e,n){super(e,n);m(this,"czmPoints");if(!n.viewer){console.error("viewer is null");return}this.czmPoints=this.ad(new go(n,e.id)),this._updateShow();const s=this.ad(a.createNextAnimateFrameEvent(e.showChanged,e.pointedChanged));this.ad(s.don(()=>this._updateShow())),this._updatePoints();const r=this.ad(a.createNextAnimateFrameEvent(e.pointsChanged,e.pointStyleChanged));this.ad(r.don(()=>this._updatePoints()))}_updateShow(){this.czmPoints&&(this.czmPoints.show=this.sceneObject.show&&this.sceneObject.pointed)}_updatePoints(){var e;this.czmPoints&&(this.czmPoints.pointPrimitiveOptions=(e=this.sceneObject.points)==null?void 0:e.map(n=>{var o,s,r,l;return{position:n,pixelSize:((o=this.sceneObject.pointStyle)==null?void 0:o.size)??a.ESGeoPoints.defaults.pointStyle.size,color:((s=this.sceneObject.pointStyle)==null?void 0:s.color)??a.ESGeoPoints.defaults.pointStyle.color,outlineColor:((r=this.sceneObject.pointStyle)==null?void 0:r.outlineColor)??a.ESGeoPoints.defaults.pointStyle.outlineColor,outlineWidth:((l=this.sceneObject.pointStyle)==null?void 0:l.outlineWidth)??a.ESGeoPoints.defaults.pointStyle.outlineWidth}}))}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyInParam?(super.flyIn(e,n),!0):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}};m(Ql,"type",Ql.register("ESCesiumViewer",a.ESGeoPoints.type,Ql));let ng=Ql;const Xo=class Xo extends Gt{constructor(e){super();m(this,"_config",this.disposeVar(a.react(Xo.defaultConfig)));m(this,"_overEvent",this.disposeVar(new a.Event));m(this,"_pointerEventFilterFunc",this.disposeVar(a.react(Xo.defaultPointerEventFilterFunc)));m(this,"point");m(this,"czmViewer");this.czmViewer=e,e.viewer&&(this._updateConfig(),this.dispose(this.configChanged.disposableOn(()=>this._updateConfig())),this._createPoint(),this._updatePointPosition(),this.dispose(this.positionChanged.disposableOn(()=>this._updatePointPosition())),this.ad(new a.ObjResettingWithEvent(this.enabledChanged,()=>this.enabled?new oF(e,this):void 0)))}get config(){return this._config.value}set config(e){this._config.value=e}get configChanged(){return this._config.changed}get overEvent(){return this._overEvent}over(){this._overEvent.emit()}get pointerEventFilterFunc(){return this._pointerEventFilterFunc.value}set pointerEventFilterFunc(e){this._pointerEventFilterFunc.value=e}get pointerEventFilterFuncChanged(){return this._pointerEventFilterFunc.changed}_updateConfig(){const{config:e}=this;e.clickEnabled!==void 0&&(this.clickEnabled=e.clickEnabled),e.dblClickEnabled!==void 0&&(this.dblClickEnabled=e.dblClickEnabled)}_createPoint(){this.point=this.ad(new ti(this.czmViewer)),this.point.pixelSize=4,this.point.outlineColor=[0,0,.8,1],this.point.outlineWidth=2,this.point.allowPicking=!1}_updatePointPosition(){if(!this.position)return;const e=[...this.position];this.czmViewer.editingHeightOffset&&(e[2]-=this.czmViewer.editingHeightOffset),this.point.position=e,this.point.show=!!this.position}};m(Xo,"defaultConfig",{clickEnabled:!0,dblClickEnabled:!0}),m(Xo,"defaultPointerEventFilterFunc",e=>e.button===0),m(Xo,"defaults",{...Gt.defaults,position:[116.39,39.9,0]});let Ni=Xo;(t=>{t.createDefaultProps=()=>({...Gt.createDefaultProps(),position:a.reactArrayWithUndefined(void 0),virtualHeight:void 0,clickEnabled:!0,dblClickEnabled:!1})})(Ni||(Ni={})),a.extendClassProps(Ni.prototype,Ni.createDefaultProps);class oF extends a.Destroyable{constructor(e,n){super();m(this,"_doings",[]);m(this,"initDoings",this.ad(()=>{this._doings.forEach(e=>e.destroy()),this._doings.length=0}));this._czmViewer=e,this._placeEditing=n;const o=(s,r)=>{r=="click"&&(!n.clickEnabled||!n.pointerEventFilterFunc(s))||r=="dblclick"&&(!n.dblClickEnabled||!n.pointerEventFilterFunc(s))||(n.over(),n.enabled=!1)};this.ad(e.clickEvent.don(s=>{s.pointerEvent&&o(s.pointerEvent,"click")})),this.ad(e.dblclickEvent.don(s=>{s.pointerEvent&&o(s.pointerEvent,"dblclick")})),this.ad(e.pointerMoveEvent.don(s=>{if(!s.pointerEvent)return;const r=new sF(this,s.pointerEvent,l=>{if(!l||l[2]<-1e5){n.position=void 0;return}const c=[...l];e.editingHeightOffset&&(c[2]+=e.editingHeightOffset),n.position=c,this._doings.splice(0,this._doings.indexOf(r)+1).forEach(d=>d.destroy())});this._doings.push(r)}))}get czmViewer(){return this._czmViewer}get placeEditing(){return this._placeEditing}}class sF extends a.Destroyable{constructor(i,e,n){super(),this._owner=i;const{czmViewer:o}=this._owner,s=Xg(o,e,this._owner.placeEditing.virtualHeight),[r]=a.getEventFromPromise(s);this.dispose(r.disposableOn(n))}}class kt extends Gt{constructor(){super()}}m(kt,"defaults",{...Gt.defaults,position:[116.39,39.9,0]}),(t=>{t.createDefaultProps=()=>({...Gt.createDefaultProps(),position:a.reactArrayWithUndefined(void 0)})})(kt||(kt={})),a.extendClassProps(kt.prototype,kt.createDefaultProps);function og(t,i){const e=new Se(t);return e.hasArrow=!0,e.arcType="RHUMB",e.width=10,e.color=i,e}const ci=class ci extends a.Destroyable{constructor(i){if(super(),!i.viewer)return;const e=this.disposeVar(og(i,ci.defaults.xAxisColor)),n=this.disposeVar(og(i,ci.defaults.yAxisColor)),o=this.disposeVar(og(i,ci.defaults.zAxisColor));{const s=()=>{e.show=this.xAxisShow&&this.show,n.show=this.yAxisShow&&this.show,o.show=this.zAxisShow&&this.show};s();const r=this.ad(a.createNextAnimateFrameEvent(this.showChanged,this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.dispose(r.disposableOn(s))}{const s=()=>{const{position:l=ci.defaults.position,heading:c=ci.defaults.heading}=this,[u,d,p]=l,{dimensions:f=ci.defaults.dimensions}=this;o.positions=[l,[u,d,p+f[2]]];const g=a.geoRhumbDestination(l,f[0],90+c);g&&(e.positions=[l,g]);const v=a.geoRhumbDestination(l,f[1],0+c);v&&(n.positions=[l,v])};s();const r=this.disposeVar(a.createNextAnimateFrameEvent(this.positionChanged,this.dimensionsChanged,this.headingChanged));this.dispose(r.disposableOn(s))}{const s=()=>{e.color=this.xAxisColor??ci.defaults.xAxisColor,n.color=this.yAxisColor??ci.defaults.yAxisColor,o.color=this.zAxisColor??ci.defaults.zAxisColor};s();const r=this.disposeVar(a.createNextAnimateFrameEvent(this.xAxisColorChanged,this.yAxisColorChanged,this.zAxisColorChanged));this.dispose(r.disposableOn(s))}}};m(ci,"defaults",{position:[116.39,39.9,0],heading:0,dimensions:[1e3,1e3,1e3],xAxisColor:[1,0,0,1],yAxisColor:[0,1,0,1],zAxisColor:[0,0,1,1]});let Hn=ci;(t=>{t.createDefaultProps=()=>({show:!0,position:a.reactArrayWithUndefined(void 0),heading:0,dimensions:a.reactArray([1e3,1e3,1e3]),xAxisColor:a.reactArray([1,0,0,1]),yAxisColor:a.reactArray([0,1,0,1]),zAxisColor:a.reactArray([0,0,1,1]),xAxisShow:!0,yAxisShow:!0,zAxisShow:!0})})(Hn||(Hn={})),a.extendClassProps(Hn.prototype,Hn.createDefaultProps);const kn=class kn extends kt{constructor(e){super();m(this,"_opInfo",{step:this.ad(a.react(!1)),moved:this.ad(a.react(!1)),constraintMode:this.ad(a.react("none")),originPosition:this.disposeVar(a.reactArray(kt.defaults.position)),originHeading:this.disposeVar(a.react(0)),originDimensions:this.disposeVar(a.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(a.reactArray([0,0,0])),movingPosition:this.disposeVar(a.reactArray([0,0,0])),targetPosition:this.disposeVar(a.reactArray([0,0,0])),targetHeading:this.disposeVar(a.react(0))});m(this,"_createCoordinates",e=>{const n=this.ad(new Hn(e));this.dispose(this._opInfo.step.changed.disposableOn(()=>{pC(n,this._opInfo.constraintMode.value,this._opInfo.step.value)}));{const o=()=>{const r=[...this.position??kn.defaults.position];e.editingHeightOffset&&(r[2]-=e.editingHeightOffset),n.position=r};o(),this.dispose(this.positionChanged.disposableOn(o))}{const o=()=>{n.heading=this.heading??0};o(),this.dispose(this.headingChanged.disposableOn(o))}{const o=()=>{n.dimensions=this._opInfo.originDimensions.value};o(),this.dispose(this._opInfo.originDimensions.changed.disposableOn(o))}return n});m(this,"_createOriginCoordinates",e=>{const n=this.ad(new Hn(e));n.xAxisColor=[1,0,0,.5],n.yAxisColor=[0,1,0,.5],n.zAxisColor=[0,0,1,.5];const{originPosition:o,originHeading:s,originDimensions:r}=this._opInfo;{const l=()=>{n.position=o.value};l(),this.dispose(o.changed.disposableOn(l))}{const l=()=>{n.heading=s.value??0};l(),this.dispose(s.changed.disposableOn(l))}{const l=()=>{n.dimensions=r.value};l(),this.dispose(r.changed.disposableOn(l))}return n});m(this,"_createGrid",e=>{const n=this.ad(new pi(e));{const o=()=>{const r=this._opInfo.originPosition.value,l=this._opInfo.originHeading.value,c=this._opInfo.originDimensions.value[0],u=[];for(let d=-4;d<5;++d){const p=a.geoRhumbDestination(r,c*.2*d,l+90);if(p){const f=a.geoRhumbDestination(p,c,l+180),g=a.geoRhumbDestination(p,c,l);f&&g&&u.push([f,p,g])}}for(let d=-4;d<5;++d){const p=a.geoRhumbDestination(r,c*.2*d,l);if(p){const f=a.geoRhumbDestination(p,c,l-90),g=a.geoRhumbDestination(p,c,l+90);f&&g&&u.push([f,p,g])}}n.positions=u};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.originHeading.changed,this._opInfo.originDimensions.changed));this.dispose(s.disposableOn(o))}return n});m(this,"_createHelpLine",e=>{const n=this.ad(new Se(e));n.hasDash=!0,n.arcType="RHUMB",n.color=[1,1,0,.99];{const o=()=>{n.positions=[this._opInfo.originPosition.value,this._opInfo.targetPosition.value]},s=this.ad(a.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.targetPosition.changed));this.ad(s.don(o))}return n});m(this,"_createCircle",e=>{const n=this.ad(new pi(e));n.arcType="RHUMB",n.width=2,n.hasDash=!0;const o=this.disposeVar(a.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.originDimensions.changed)),s=()=>{const r=this._opInfo.originPosition.value,l=this._opInfo.originDimensions.value[0],c=[],u=32;for(let d=0;d<=u;++d){const p=a.geoRhumbDestination(r,l,d*360/u);p&&c.push(p)}n.positions=[c]};return s(),this.dispose(o.disposableOn(s)),n});m(this,"_pickingXYProcessing",e=>this.ad(new a.Processing((n,o,s)=>{const r=[0,0,0],l=new h.Cartographic;return e.pointerMoveEvent.don(c=>{if(!c.pointerEvent||!e.viewer)return;const u=ui(a.getDomEventCurrentTargetPos(c.pointerEvent));if(!Jo(e.viewer.scene,u,this._opInfo.originPosition.value[2],l))return;Jn(l,r),this._opInfo.constraintMode.value==="x"?eo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,r,r):this._opInfo.constraintMode.value==="y"?eo(this._opInfo.originPosition.value,this._opInfo.originHeading.value,r,r):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=r;const d=[0,0,0];a.geoRhumbDestination(r,s,o,d),this._opInfo.targetPosition.value=d})})));m(this,"_pickingZProcessing",e=>this.ad(new a.Processing(()=>{const n=new h.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.don(s=>{if(!s.pointerEvent||!e.viewer)return;const r=ui(a.getDomEventCurrentTargetPos(s.pointerEvent));if(!mc(e.viewer.scene,Ie(this._opInfo.originPosition.value),r,n))return;const l=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(se(n,o)){this._opInfo.movingPosition.value=o;const c=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[c[0],c[1],o[2]+l]}})})));m(this,"_pickingZAxisProcessing",e=>this.ad(new a.Processing(()=>{const n=[0,0,0],o=new h.Cartographic;return e.pointerMoveEvent.don(s=>{if(!s.pointerEvent||!e.viewer)return;const r=ui(a.getDomEventCurrentTargetPos(s.pointerEvent));if(!Jo(e.viewer.scene,r,this._opInfo.originPosition.value[2],o))return;Jn(o,n);const l=a.geoRhumbHeading(this._opInfo.originPosition.value,this._opInfo.draggingStartPosition.value),u=a.geoRhumbHeading(this._opInfo.originPosition.value,n)-l;let d=this._opInfo.originHeading.value+u;d=h.Math.toDegrees(h.Math.negativePiToPi(h.Math.toRadians(d))),this._opInfo.movingPosition.value=n,this.heading=this._opInfo.targetHeading.value=d})})));if(!e.viewer)return;const n=this.ad(a.reactArray([1,1,1]));this.ad(e.dblclickEvent.don(()=>this.enabled=!1)),this.ad(new mu(e,this.positionReact,n,this.axisPixelSize));{this.ad(this._opInfo.targetPosition.changed.don(s=>{if(this._opInfo.moved){const r=[...s];e.editingHeightOffset&&(r[2]+=e.editingHeightOffset),this.position=r}})),this.ad(this._opInfo.targetHeading.changed.don(s=>this._opInfo.moved&&(this.heading=s)));const o=()=>{if(this._opInfo.constraintMode.value==="none"){this._opInfo.moved.value=!1;return}if(this._opInfo.originHeading.value!==this._opInfo.targetHeading.value){this._opInfo.moved.value=!0;return}if(!this._opInfo.originPosition.value.every((s,r)=>s===this._opInfo.targetPosition.value[r])){this._opInfo.moved.value=!0;return}};o(),this.dispose(this._opInfo.originHeading.changed.disposableOn(o)),this.dispose(this._opInfo.originPosition.changed.disposableOn(o)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(o)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(o))}{const o=this._createCoordinates(e),s=this._createOriginCoordinates(e),r=this._createGrid(e),l=this._createHelpLine(e),c=this._createCircle(e);{const u=()=>{c.show=r.show=this.enabled&&this.showCircle,l.show=this.enabled&&this.showCircle&&this._opInfo.moved.value,o.show=this.enabled&&this.showCoordinates,s.show=this.enabled&&this.showCoordinates&&this._opInfo.moved.value};u();const d=this.ad(a.createNextAnimateFrameEvent(this.enabledChanged,this.showCircleChanged,this.showCoordinatesChanged,this._opInfo.moved.changed));this.ad(d.don(u))}{const u=()=>{o.xAxisShow=s.xAxisShow=this.xAxisShow,o.yAxisShow=s.yAxisShow=this.yAxisShow,o.zAxisShow=s.zAxisShow=this.zAxisShow};u();const d=this.ad(a.createNextAnimateFrameEvent(this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.ad(d.don(u))}{const u=()=>{r.color=this._opInfo.constraintMode.value!=="none"?[1,1,0,.6]:[1,1,0,.3],c.color=this._opInfo.constraintMode.value==="zAxis"?[1,1,0,.99]:[1,1,0,.5],pC(o,this._opInfo.constraintMode.value,this._opInfo.step.value)};u(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(u))}{const u=this._pickingXYProcessing(e),d=this._pickingZProcessing(e),p=this._pickingZAxisProcessing(e),f=()=>{const S=[...this.position??kn.defaults.position];e.editingHeightOffset&&(S[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=S},g=()=>this._opInfo.targetHeading.value=this._opInfo.originHeading.value=this.heading,v=()=>this._opInfo.originDimensions.value=n.value,y={constraintMode:"none",startDragPos:[0,0,0]},w=S=>{const x={position:o.position??kn.defaults.position,heading:o.heading??kn.defaults.heading,dimensions:o.dimensions??kn.defaults.dimensions};e.viewer&&ou(S,e.viewer.scene,x,this.axisSnapPixelSize,y,{x:this.disableX,y:this.disableY,z:this.disableZ,xy:this.disableXY,zAxis:this.disableZAxis}),this._opInfo.constraintMode.value=y.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=y.startDragPos},P=this.ad(a.createProcessingFromAsyncFunc(async S=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",S.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await a.step(S,async x=>{x.disposer.dispose((f(),this.positionChanged.don(f))),x.disposer.dispose((g(),this.headingChanged.don(g))),x.disposer.dispose((v(),n.changed.don(v))),x.disposer.dispose(e.pointerMoveEvent.don(A=>{A.pointerEvent&&w(A.pointerEvent)})),await a.step(x,A=>new Promise((R,L)=>{A.disposer.dispose(L),A.disposer.dispose(e.pointerDownEvent.don(B=>{B.pointerEvent&&w(B.pointerEvent),B.pointerEvent&&B.pointerEvent.button===0&&y.constraintMode!=="none"&&R()}))}))}),this._opInfo.step.value=!1,await a.step(S,async x=>{if(e.incrementDisabledInputStack(),x.disposer.dispose(()=>{e.decrementDisabledInputStack()}),["xy","x","y"].includes(this._opInfo.constraintMode.value)){const A=a.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),R=a.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);u.restart(void 0,A,R),x.disposer.dispose(()=>u.cancel())}else this._opInfo.constraintMode.value==="z"?(d.restart(),x.disposer.dispose(()=>d.cancel())):this._opInfo.constraintMode.value==="zAxis"?(p.restart(),x.disposer.dispose(()=>p.cancel())):console.warn(`pickingInfo.constraintMode error! ${this._opInfo.constraintMode.value}`);await a.step(x,A=>new Promise((R,L)=>{A.disposer.dispose(L),A.disposer.dispose(e.pointerUpEvent.don(()=>{R()})),A.disposer.dispose(e.pointerOutEvent.don(()=>R()))}))}),P.restart()})),C=()=>{this.enabled?P.restart():P.isRunning&&P.cancel()};C(),this.ad(this.enabledChanged.don(C))}}}};m(kn,"defaults",{...kt.defaults,heading:0,dimensions:[1e3,1e3,1e3],xAxisColor:[1,0,0,1],yAxisColor:[0,1,0,1],zAxisColor:[0,0,1,1]});let on=kn;(t=>{t.createDefaultProps=()=>({...kt.createDefaultProps(),heading:0,axisPixelSize:100,axisSnapPixelSize:5,showCoordinates:!0,showCircle:!0,disableX:!1,disableY:!1,disableZ:!1,disableXY:!1,disableZAxis:!1,xAxisShow:!0,yAxisShow:!0,zAxisShow:!0})})(on||(on={})),a.extendClassProps(on.prototype,on.createDefaultProps);function pC(t,i,e){t.xAxisColor=[1,0,0,.99],t.yAxisColor=[0,1,0,.99],t.zAxisColor=[0,0,1,.99],i==="x"?t.xAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:i==="y"?t.yAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:i==="z"?t.zAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:i==="xy"&&(t.xAxisColor=e?[1,1,0,.8]:[1,1,0,.99],t.yAxisColor=e?[1,1,0,.8]:[1,1,0,.99])}class sg extends a.HasOwner{constructor(e){super(e);m(this,"_valid",!1);m(this,"_normal",new h.Cartesian3(0,0,0));m(this,"_origin",new h.Cartesian3(0,0,0))}get viewer(){return this.owner.czmViewer.viewer}get scene(){return this.viewer.scene}get sceneObject(){return this.owner}get valid(){return this._valid}get normal(){return this._normal}get origin(){return this._valid&&this._origin}pick(e){if(!this.normal||!this.owner.cartesian)return;const n=this.owner.cartesian,o=ui(e);return Yg(this.scene,n,this.normal,o)}}class rF extends sg{constructor(i){super(i);{const e=()=>{const o=Fe({position:this.sceneObject.position,rotation:this.sceneObject.rotation});this._valid=!!o,o&&(this._origin.x=o[4],this._origin.y=o[5],this._origin.z=o[6],this._normal.x=o[8],this._normal.y=o[9],this._normal.z=o[10])};e();const n=this.ad(a.createNextAnimateFrameEvent(this.sceneObject.positionChanged,this.sceneObject.rotationChanged));this.ad(n.don(e))}}}class aF extends sg{constructor(i){super(i);const e=()=>{const n=Fe({rotation:[this.sceneObject.selfRotation[0],0,0]});if(!n)throw new Error("PitchPlane: rm is undefined");const o=Fe({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:h.Matrix4.toArray(n)});if(this._valid=!!o,!!o){{const s=this._normal;s.x=-o[0],s.y=-o[1],s.z=-o[2]}{const s=this._origin;s.x=o[4],s.y=o[5],s.z=o[6]}}};e(),this.dispose(this.sceneObject.positionChanged.disposableOn(e)),this.dispose(this.sceneObject.rotationChanged.disposableOn(e)),this.dispose(this.sceneObject.selfRotationChanged.disposableOn(e))}}class lF extends sg{constructor(i){super(i);const e=()=>{const n=Fe({rotation:[this.sceneObject.selfRotation[0],this.sceneObject.selfRotation[1],0]});if(!n)throw new Error("PitchPlane: rm is undefined");const o=Fe({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:h.Matrix4.toArray(n)});if(this._valid=!!o,!!o){{const s=this._normal;s.x=-o[4],s.y=-o[5],s.z=-o[6]}{const s=this._origin;s.x=o[8],s.y=o[9],s.z=o[10]}}};e(),this.dispose(this.sceneObject.positionChanged.disposableOn(e)),this.dispose(this.sceneObject.rotationChanged.disposableOn(e)),this.dispose(this.sceneObject.selfRotationChanged.disposableOn(e))}}class tr extends a.Destroyable{constructor(e){super();m(this,"_czmTexture");m(this,"_customPrimitiveForCircle");m(this,"_circleCanvas");m(this,"_debugAxis");e.viewer&&(this._czmTexture=this.disposeVar(new Be(e)),this._czmTexture.uri="",this._createCircleCanvas(e),this._createCustomPrimitiveForCircle(e),this._createDebugAxis(e))}get czmTexture(){return this._czmTexture}get customPrimitiveForCircle(){return this._customPrimitiveForCircle}get circleCanvas(){return this._circleCanvas}get debugAxis(){return this._debugAxis}_createCircleCanvas(e){let n=this.disposeVar(a.react(!1));const o=document.createElement("canvas");o.width=o.height=256,this._circleCanvas=o.getContext("2d");{const r=()=>{const c={rotation:this.circleRotation*Math.PI/180,startRotation:this.circleStartRotation*Math.PI/180,endRotation:this.circleEndRotation*Math.PI/180},u=this._circleCanvas,d=this.color,p=`rgba(${d[0]*255|0}, ${d[1]*255|0}, ${d[2]*255|0}, ${d[3]})`;u.clearRect(0,0,256,256),u.lineWidth=6,u.beginPath(),u.arc(128,128,64,0,Math.PI*2,!1),u.strokeStyle=`rgba(0,0,0,${d[3]})`,u.stroke(),u.lineWidth=4,u.beginPath(),u.arc(128,128,64,0,Math.PI*2,!1),u.strokeStyle=p,u.stroke();{u.lineWidth=1,u.beginPath();let v=h.Math.zeroToTwoPi(c.startRotation),y=h.Math.zeroToTwoPi(c.endRotation);y<v&&(y+=h.Math.TWO_PI),(v!==y||v!==0)&&(u.moveTo(128,128),u.arc(128,128,64,v,y,y-v>Math.PI),u.lineTo(128,128),u.strokeStyle="rgba(255, 255, 0, 1.0)",u.stroke())}let f=h.Math.negativePiToPi(c.rotation);u.lineWidth=3,u.beginPath(),u.moveTo(128,128),u.arc(128,128,64,0,f,h.Math.negativePiToPi(f-0)<0),u.lineTo(128,128),u.fillStyle=`rgba(${d[0]*255|0}, ${d[1]*255|0}, ${d[2]*255|0}, 0.5)`,u.fill();{u.save(),u.font="16px console",u.textBaseline="middle";const w=`${(h.Math.negativePiToPi(f-0)*180/Math.PI*10|0)/10}°`;var g=u.measureText(w).width;u.translate(128,128),u.rotate(Math.PI*.5),f=h.Math.negativePiToPi(f-0)+0,u.rotate((f+0)*.5),u.scale(n.value?-1:1,1),u.translate(-128,-128),u.fillStyle="white",u.fillText(w,128-g*.5,54),u.lineWidth=1,u.restore()}this.czmTexture&&this.czmTexture.copyFromCanvas(o)};r();const l=this.ad(a.createNextAnimateFrameEvent(this.colorChanged,this.circleRotationChanged,this.circleStartRotationChanged,this.circleEndRotationChanged,n.changed));this.ad(l.don(r)),this.czmTexture&&this.ad(this.czmTexture.readyEvent.don(r))}{const s=()=>{const l=Fe({rotation:this.selfRotation});if(!l)return;const c=Fe({position:this.position,rotation:this.rotation,localModelMatrix:h.Matrix4.toArray(l)});if(!c)return;const{viewer:u}=e;if(!u)return;const d=h.Cartesian3.dot(u.scene.camera.directionWC,new h.Cartesian3(c[8],c[9],c[10]));n.value=d>0};s();const r=this.ad(a.createNextAnimateFrameEvent(e.cameraChanged,this.positionChanged,this.rotationChanged,this.selfRotationChanged));this.ad(r.don(s))}}_createCustomPrimitiveForCircle(e){this._customPrimitiveForCircle=this.disposeVar(cF(e)),this.dispose(a.track([this._customPrimitiveForCircle,"show"],[this,"show"])),this.dispose(a.track([this._customPrimitiveForCircle,"position"],[this,"position"])),this.dispose(a.track([this._customPrimitiveForCircle,"rotation"],[this,"rotation"])),this.dispose(a.track([this._customPrimitiveForCircle,"pixelSize"],[this,"pixelSize"]));{const n=()=>{const o=Fe({rotation:this.selfRotation});this._customPrimitiveForCircle&&(this._customPrimitiveForCircle.localModelMatrix=o&&h.Matrix4.toArray(o)||void 0)};n(),this.dispose(this.selfRotationChanged.disposableOn(n))}{const n=()=>{this.customPrimitiveForCircle&&this.czmTexture&&(this.customPrimitiveForCircle.uniformMap={u_image:{type:"texture",id:this.czmTexture.id},u_color:this.color})};n(),this.dispose(this.colorChanged.disposableOn(n))}}_createDebugAxis(e){this._debugAxis=this.ad(hF(e)),this.dispose(a.track([this._debugAxis,"pixelSize"],[this,"pixelSize"])),this.dispose(a.track([this._debugAxis,"position"],[this,"position"])),this.dispose(a.track([this._debugAxis,"rotation"],[this,"rotation"])),this.dispose(a.track([this._debugAxis,"show"],[this,"debug"]));{const n=()=>{const o=Fe({rotation:this.selfRotation});this._debugAxis&&(this._debugAxis.localModelMatrix=o&&h.Matrix4.toArray(o)||void 0)};n(),this.dispose(this.selfRotationChanged.disposableOn(n))}{const n=()=>{this._debugAxis&&(this._debugAxis.uniformMap={u_color:this.color})};n(),this.dispose(this.colorChanged.disposableOn(n))}}}m(tr,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,editing:!1,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),selfRotation:a.reactArray([0,0,0]),pixelSize:300,color:a.reactArray([1,1,1,1]),circleRotation:0,circleStartRotation:0,circleEndRotation:0,debug:!1})})(tr||(tr={})),a.extendClassProps(tr.prototype,tr.createDefaultProps);function cF(t){return _u({type:"CzmCustomPrimitive",allowPicking:!0,pixelSize:100,boundingVolume:{type:"LocalAxisedBoundingBox",data:{min:[0,-1,0],max:[1,0,0]}},renderState:{depthTest:{enabled:!1},cull:{enabled:!1,face:1029},depthMask:!1,blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},localPosition:[-.5,-.5,0],localRotation:[-90,0,0]},ze,t)}function hF(t){return _u({type:"CzmCustomPrimitive",allowPicking:!0,position:[114.86128105686282,40.86825802653499,0],primitiveType:"LINES",vertexShaderSource:`in vec3 position;
1914
+ }`}createHeatmapGeometry(e,n){const o=this.czmESHeatMap,s=e||256,r=Math.ceil(n||256),[l,c,u,d]=o.rectangle,p=(u-l)/(s-1),f=(d-c)/(r-1),g=[],v=[],y=[],w=[];for(let P=0;P<s;P++){const C=l+p*P;for(let S=0;S<r;S++){const x=c+f*S;o.heatmap.getValueAt({x:P,y:S});const A=h.Cartesian3.fromDegrees(C,x,o.heatmap._renderer._min);g.push(A.x,A.y,A.z),v.push(P/(s-1),S/(r-1)),S!==r-1&&P!==s-1&&(y.push((P+1)*r+S+1,P*r+S+1,P*r+S),y.push(P*r+S,(P+1)*r+S,(P+1)*r+S+1))}}return this.createGeometry(g,v,y,w)}createGeometry(e,n,o,s){return new h.Geometry({attributes:new h.GeometryAttributes({position:new h.GeometryAttribute({componentDatatype:h.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new h.GeometryAttribute({componentDatatype:h.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(n)})}),indices:new Uint32Array(o),boundingSphere:h.BoundingSphere.fromVertices(e,new h.Cartesian3,3),primitiveType:h.PrimitiveType.TRIANGLES})}}const Vt={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}};class eF{constructor(i){m(this,"_coordinator");m(this,"_data");m(this,"_radi");m(this,"_min");m(this,"_max");m(this,"_xField");m(this,"_yField");m(this,"_valueField");m(this,"_cfgRadius");this._coordinator=new dC,this._data={},this._radi={},this._min=0,this._max=1,this._xField=i.xField||i.defaultXField||Vt.defaultXField,this._yField=i.yField||i.defaultYField||Vt.defaultYField,this._valueField=i.valueField||i.defaultValueField||Vt.defaultValueField,i.radius&&(this._cfgRadius=i.radius)}_organiseData(i,e){const n=i[this._xField],o=i[this._yField],s=i[this._valueField]||1,r=i.radius||this._cfgRadius||Vt.defaultRadius;return this._data[n]||(this._data[n]={},this._radi[n]={}),this._data[n][o]?this._data[n][o]+=s:(this._data[n][o]=s,this._radi[n][o]=r),this._data[n][o]>this._max?(e?this.setDataMax(this._data[n][o]):this._max=this._data[n][o],!1):{x:n,y:o,value:s,radius:r,min:this._min,max:this._max}}_unOrganizeData(){const i=[];for(const e in this._data)for(const n in this._data[e])i.push({x:Number(e),y:Number(n),radius:this._radi[e][n],value:this._data[e][n]});return{min:this._min,max:this._max,data:i}}_onExtremaChange(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})}_getInternalData(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}}addData(i){if(Array.isArray(i))i.forEach(e=>this.addData(e));else{const e=this._organiseData(i,!0);e&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[e]})}return this}setData(i){this._data={},this._radi={};for(const e of i.data)this._organiseData(e,!1);return this._max=i.max,this._min=i.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setDataMax(i){return this._max=i,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setDataMin(i){return this._min=i,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setCoordinator(i){this._coordinator=i}getData(){return this._unOrganizeData()}}class tF{constructor(i){m(this,"shadowCanvas");m(this,"canvas");m(this,"_renderBoundaries");m(this,"_width");m(this,"_height");m(this,"shadowCtx");m(this,"ctx");m(this,"_palette");m(this,"_templates");m(this,"_blur",Vt.defaultBlur);m(this,"_opacity",0);m(this,"_maxOpacity",Vt.defaultMaxOpacity*255);m(this,"_minOpacity",Vt.defaultMinOpacity*255);m(this,"_useGradientOpacity",!1);m(this,"_min",0);m(this,"_max",1);const e=i.container;this.shadowCanvas=document.createElement("canvas"),this.canvas=i.canvas||document.createElement("canvas"),this._renderBoundaries=[1e4,1e4,0,0];const n=getComputedStyle(e);this.canvas.className="heatmap-canvas",this._width=this.canvas.width=this.shadowCanvas.width=+n.width.replace(/px/,""),this._height=this.canvas.height=this.shadowCanvas.height=+n.height.replace(/px/,""),this.shadowCtx=this.shadowCanvas.getContext("2d"),this.ctx=this.canvas.getContext("2d"),this.canvas.style.cssText=this.shadowCanvas.style.cssText="position:absolute;left:0;top:0;",e.style.position="relative",e.appendChild(this.canvas),this._palette=this._getColorPalette(i),this._templates={},this._setStyles(i)}_getColorPalette(i){const e=i.gradient||i.defaultGradient||Vt.defaultGradient,n=document.createElement("canvas"),o=n.getContext("2d");n.width=256,n.height=1;const s=o.createLinearGradient(0,0,256,1);for(const r in e)s.addColorStop(Number(r),e[r]);return o.fillStyle=s,o.fillRect(0,0,256,1),o.getImageData(0,0,256,1).data}_getPointTemplate(i,e){const n=document.createElement("canvas"),o=n.getContext("2d"),s=i,r=i;if(n.width=n.height=i*2,e===1)o.beginPath(),o.arc(s,r,i,0,2*Math.PI,!1),o.fillStyle="rgba(0,0,0,1)",o.fill();else{const l=o.createRadialGradient(s,r,i*e,s,r,i);l.addColorStop(0,"rgba(0,0,0,1)"),l.addColorStop(1,"rgba(0,0,0,0)"),o.fillStyle=l,o.fillRect(0,0,2*i,2*i)}return n}renderPartial(i){this._drawAlpha(i),this._colorize()}renderAll(i){this._clear(),this._drawAlpha(this._prepareData(i)),this._colorize()}_prepareData(i){const e=[],n=Object.keys(i.data);for(const o of n){const s=Object.keys(i.data[o]);for(const r of s)e.push({x:Number(o),y:Number(r),value:i.data[o][r],radius:i.radi[o][r]})}return{min:i.min,max:i.max,data:e}}updateConfig(i){i.gradient&&(this._palette=this._getColorPalette(i)),this._setStyles(i)}setDimensions(i,e){this._width=i,this._height=e,this.canvas.width=this.shadowCanvas.width=i,this.canvas.height=this.shadowCanvas.height=e}_clear(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)}_setStyles(i){this._blur=i.blur===0?0:i.blur||i.defaultBlur||Vt.defaultBlur,i.backgroundColor&&(this.canvas.style.backgroundColor=i.backgroundColor),this._opacity=(i.opacity||0)*255,this._maxOpacity=(i.maxOpacity||i.defaultMaxOpacity||Vt.defaultMaxOpacity)*255,this._minOpacity=(i.minOpacity||i.defaultMinOpacity||Vt.defaultMinOpacity)*255,this._useGradientOpacity=!!i.useGradientOpacity}_drawAlpha(i){this._min=i.min,this._max=i.max;const e=1-this._blur;for(const n of i.data){const o=n.radius,s=n.x-o,r=n.y-o,l=Math.min(n.value,this._max);this._templates[o]=this._getPointTemplate(o,e),this.shadowCtx.globalAlpha=(l-this._min)/(this._max-this._min),this.shadowCtx.drawImage(this._templates[o],s,r),this._renderBoundaries[0]=Math.min(this._renderBoundaries[0],s),this._renderBoundaries[1]=Math.min(this._renderBoundaries[1],r),this._renderBoundaries[2]=Math.max(this._renderBoundaries[2],s+2*o),this._renderBoundaries[3]=Math.max(this._renderBoundaries[3],r+2*o)}}_colorize(){let[i,e,n,o]=this._renderBoundaries;i=Math.max(0,i),e=Math.max(0,e),n=Math.min(this._width-i,n-i),o=Math.min(this._height-e,o-e);const s=this.shadowCtx.getImageData(i,e,n,o),r=s.data;for(let l=3;l<r.length;l+=4){const c=r[l],u=c*4;if(!u)continue;let d;this._opacity>0?d=this._opacity:d=c<this._maxOpacity?c<this._minOpacity?this._minOpacity:c:this._maxOpacity,r[l-3]=this._palette[u],r[l-2]=this._palette[u+1],r[l-1]=this._palette[u+2],r[l]=this._useGradientOpacity?this._palette[u+3]:d}this.ctx.putImageData(s,i,e),this._renderBoundaries=[1e3,1e3,0,0]}getValueAt(i){const n=this.shadowCtx.getImageData(i.x,i.y,1,1).data[3];return Math.abs(this._max-this._min)*(n/255)>>0}getDataURL(){return this.canvas.toDataURL()}}class dC{constructor(){m(this,"cStore");this.cStore={}}on(i,e,n){this.cStore[i]||(this.cStore[i]=[]),this.cStore[i].push(o=>e.call(n,o))}emit(i,e){this.cStore[i]&&this.cStore[i].forEach(n=>n(e))}}class iF{constructor(i={}){m(this,"_config");m(this,"_coordinator");m(this,"_renderer");m(this,"_store");if(this._config={...Vt,...i},this._coordinator=new dC,this._config.plugin){const e=Vt.plugins[this._config.plugin];if(!e)throw new Error(`Plugin '${this._config.plugin}' not found. Maybe it was not registered.`);this._renderer=new e.renderer(this._config),this._store=new e.store(this._config)}else this._renderer=new tF(this._config),this._store=new eF(this._config);this._connect()}_connect(){this._coordinator.on("renderpartial",i=>this._renderer.renderPartial(i),this._renderer),this._coordinator.on("renderall",i=>this._renderer.renderAll(i),this._renderer),this._coordinator.on("extremachange",i=>{var e,n;(n=(e=this._config).onExtremaChange)==null||n.call(e,{min:i.min,max:i.max,gradient:this._config.gradient||this._config.defaultGradient||Vt.defaultGradient})}),this._store.setCoordinator(this._coordinator)}addData(i){return this._store.addData(i),this}setData(i){return this._store.setData(i),this}setDataMax(i){return this._store.setDataMax(i),this}setDataMin(i){return this._store.setDataMin(i),this}configure(i){return this._config={...this._config,...i},this._renderer.updateConfig(this._config),this._coordinator.emit("renderall",this._store._getInternalData()),this}repaint(){return this._coordinator.emit("renderall",this._store._getInternalData()),this}getData(){return this._store.getData()}getDataURL(){return this._renderer.getDataURL()}getValueAt(i){return this._store.getValueAt?this._store.getValueAt(i):this._renderer.getValueAt?this._renderer.getValueAt(i):null}}const nF=t=>new iF(t),Zl=class Zl extends jt{constructor(e,n){super(e,n);m(this,"_heatmap");m(this,"_div");m(this,"_primitiveObj");m(this,"_rectangle",this.disposeVar(a.react(void 0)));m(this,"onePixelRadius",1e-4);const o=n.viewer,s=256;if(this._primitiveObj=this.ad(new a.ObjResettingWithEvent(e.is3DChanged,()=>e.is3D?new j2(this,n):new J2(this,n))),!o){console.warn("viewer is undefined!");return}this._div=document.createElement("div"),this.div.style.display="none",this.div.style.width=`${s}px`,this.div.style.height=`${s}px`,document.body.appendChild(this.div),this.ad(()=>{document.body.removeChild(this.div)}),this._heatmap=nF({container:this.div}),this.heatmap._renderer.setDimensions(s,s);const r=this.ad(new a.Event);let l=[],c={max:100,min:0};{const u=()=>{const p={radius:e.radius??a.ESHeatMap.defaults.radius,gradient:e.gradient??a.ESHeatMap.defaults.gradient,blur:e.blur??a.ESHeatMap.defaults.blur,maxOpacity:1,minOpacity:0};this.heatmap.configure(p),this.heatmap._store._cfgRadius=p.radius,r.emit()};u();const d=this.ad(a.createNextAnimateFrameEvent(e.radiusChanged,e.gradientChanged,e.blurChanged));this.ad(d.don(u))}{const u=()=>{if(e.data&&e.data.length>2){const{maxPos:p,minPos:f}=a.getMinMaxCorner(e.data),g=p[0]-f[0],v=p[1]-f[1];if(c={max:p[2]??100,min:f[2]??0},!Number.isFinite(g)||!Number.isFinite(v)||g<=0||v<=0)return;const y=1/Math.cos((f[1]+v*.5)*Math.PI/180);if(y==1/0)return;const w=s*v/g*y;this.div.style.width=`${s}px`,this.div.style.height=`${w}px`,this.heatmap._renderer.setDimensions(s,w);const P=g/s*(e.radius??a.ESHeatMap.defaults.radius)*2,C=v/w*(e.radius??a.ESHeatMap.defaults.radius)*2;this.onePixelRadius=Math.min(P,C),this.rectangle=[f[0]-P,f[1]-C,p[0]+P,p[1]+C],l=oF(e.data,this.rectangle,s,w),r.emit()}};u();const d=this.ad(a.createNextAnimateFrameEvent(e.dataChanged,e.radiusChanged));this.ad(d.don(u))}{const u=()=>{const d={max:c.max,min:c.min,data:l};this.heatmap.setData(d),this.heatmap.repaint(),this.primitiveObj&&this.primitiveObj.updateHeatMap(this.heatmap.getDataURL())};u(),this.ad(r.don(u))}this.ad(this._primitiveObj.objChanged.don(()=>{r.emit()}))}get heatmap(){return this._heatmap}get div(){return this._div}get primitiveObj(){var e;return(e=this._primitiveObj)==null?void 0:e.obj}get rectangle(){return this._rectangle.value}set rectangle(e){this._rectangle.value=e}get rectangleChanged(){return this._rectangle.changed}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):this.rectangle?(oe(s,o,n,[[this.rectangle[0],this.rectangle[1],0],[this.rectangle[2],this.rectangle[3],0]],e),!0):!1:!1}};m(Zl,"type",Zl.register("ESCesiumViewer",a.ESHeatMap.type,Zl));let ig=Zl;function oF(t,i,e,n,o){return t.map(s=>({x:(s[0]-i[0])*e/(i[2]-i[0])|0,y:(1-(s[1]-i[1])/(i[3]-i[1]))*n|0,value:s[2]}))}const Ql=class Ql extends yt{constructor(e,n){super(e,n);m(this,"czmPoints");if(!n.viewer){console.error("viewer is null");return}this.czmPoints=this.ad(new go(n,e.id)),this._updateShow();const s=this.ad(a.createNextAnimateFrameEvent(e.showChanged,e.pointedChanged));this.ad(s.don(()=>this._updateShow())),this._updatePoints();const r=this.ad(a.createNextAnimateFrameEvent(e.pointsChanged,e.pointStyleChanged));this.ad(r.don(()=>this._updatePoints()))}_updateShow(){this.czmPoints&&(this.czmPoints.show=this.sceneObject.show&&this.sceneObject.pointed)}_updatePoints(){var e;this.czmPoints&&(this.czmPoints.pointPrimitiveOptions=(e=this.sceneObject.points)==null?void 0:e.map(n=>{var o,s,r,l;return{position:n,pixelSize:((o=this.sceneObject.pointStyle)==null?void 0:o.size)??a.ESGeoPoints.defaults.pointStyle.size,color:((s=this.sceneObject.pointStyle)==null?void 0:s.color)??a.ESGeoPoints.defaults.pointStyle.color,outlineColor:((r=this.sceneObject.pointStyle)==null?void 0:r.outlineColor)??a.ESGeoPoints.defaults.pointStyle.outlineColor,outlineWidth:((l=this.sceneObject.pointStyle)==null?void 0:l.outlineWidth)??a.ESGeoPoints.defaults.pointStyle.outlineWidth}}))}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyInParam?(super.flyIn(e,n),!0):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}};m(Ql,"type",Ql.register("ESCesiumViewer",a.ESGeoPoints.type,Ql));let ng=Ql;const Xo=class Xo extends Gt{constructor(e){super();m(this,"_config",this.disposeVar(a.react(Xo.defaultConfig)));m(this,"_overEvent",this.disposeVar(new a.Event));m(this,"_pointerEventFilterFunc",this.disposeVar(a.react(Xo.defaultPointerEventFilterFunc)));m(this,"point");m(this,"czmViewer");this.czmViewer=e,e.viewer&&(this._updateConfig(),this.dispose(this.configChanged.disposableOn(()=>this._updateConfig())),this._createPoint(),this._updatePointPosition(),this.dispose(this.positionChanged.disposableOn(()=>this._updatePointPosition())),this.ad(new a.ObjResettingWithEvent(this.enabledChanged,()=>this.enabled?new sF(e,this):void 0)))}get config(){return this._config.value}set config(e){this._config.value=e}get configChanged(){return this._config.changed}get overEvent(){return this._overEvent}over(){this._overEvent.emit()}get pointerEventFilterFunc(){return this._pointerEventFilterFunc.value}set pointerEventFilterFunc(e){this._pointerEventFilterFunc.value=e}get pointerEventFilterFuncChanged(){return this._pointerEventFilterFunc.changed}_updateConfig(){const{config:e}=this;e.clickEnabled!==void 0&&(this.clickEnabled=e.clickEnabled),e.dblClickEnabled!==void 0&&(this.dblClickEnabled=e.dblClickEnabled)}_createPoint(){this.point=this.ad(new ti(this.czmViewer)),this.point.pixelSize=4,this.point.outlineColor=[0,0,.8,1],this.point.outlineWidth=2,this.point.allowPicking=!1}_updatePointPosition(){if(!this.position)return;const e=[...this.position];this.czmViewer.editingHeightOffset&&(e[2]-=this.czmViewer.editingHeightOffset),this.point.position=e,this.point.show=!!this.position}};m(Xo,"defaultConfig",{clickEnabled:!0,dblClickEnabled:!0}),m(Xo,"defaultPointerEventFilterFunc",e=>e.button===0),m(Xo,"defaults",{...Gt.defaults,position:[116.39,39.9,0]});let Ni=Xo;(t=>{t.createDefaultProps=()=>({...Gt.createDefaultProps(),position:a.reactArrayWithUndefined(void 0),virtualHeight:void 0,clickEnabled:!0,dblClickEnabled:!1})})(Ni||(Ni={})),a.extendClassProps(Ni.prototype,Ni.createDefaultProps);class sF extends a.Destroyable{constructor(e,n){super();m(this,"_doings",[]);m(this,"initDoings",this.ad(()=>{this._doings.forEach(e=>e.destroy()),this._doings.length=0}));this._czmViewer=e,this._placeEditing=n;const o=(s,r)=>{r=="click"&&(!n.clickEnabled||!n.pointerEventFilterFunc(s))||r=="dblclick"&&(!n.dblClickEnabled||!n.pointerEventFilterFunc(s))||(n.over(),n.enabled=!1)};this.ad(e.clickEvent.don(s=>{s.pointerEvent&&o(s.pointerEvent,"click")})),this.ad(e.dblclickEvent.don(s=>{s.pointerEvent&&o(s.pointerEvent,"dblclick")})),this.ad(e.pointerMoveEvent.don(s=>{if(!s.pointerEvent)return;const r=new rF(this,s.pointerEvent,l=>{if(!l||l[2]<-1e5){n.position=void 0;return}const c=[...l];e.editingHeightOffset&&(c[2]+=e.editingHeightOffset),n.position=c,this._doings.splice(0,this._doings.indexOf(r)+1).forEach(d=>d.destroy())});this._doings.push(r)}))}get czmViewer(){return this._czmViewer}get placeEditing(){return this._placeEditing}}class rF extends a.Destroyable{constructor(i,e,n){super(),this._owner=i;const{czmViewer:o}=this._owner,s=Xg(o,e,this._owner.placeEditing.virtualHeight),[r]=a.getEventFromPromise(s);this.dispose(r.disposableOn(n))}}class kt extends Gt{constructor(){super()}}m(kt,"defaults",{...Gt.defaults,position:[116.39,39.9,0]}),(t=>{t.createDefaultProps=()=>({...Gt.createDefaultProps(),position:a.reactArrayWithUndefined(void 0)})})(kt||(kt={})),a.extendClassProps(kt.prototype,kt.createDefaultProps);function og(t,i){const e=new Se(t);return e.hasArrow=!0,e.arcType="RHUMB",e.width=10,e.color=i,e}const ci=class ci extends a.Destroyable{constructor(i){if(super(),!i.viewer)return;const e=this.disposeVar(og(i,ci.defaults.xAxisColor)),n=this.disposeVar(og(i,ci.defaults.yAxisColor)),o=this.disposeVar(og(i,ci.defaults.zAxisColor));{const s=()=>{e.show=this.xAxisShow&&this.show,n.show=this.yAxisShow&&this.show,o.show=this.zAxisShow&&this.show};s();const r=this.ad(a.createNextAnimateFrameEvent(this.showChanged,this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.dispose(r.disposableOn(s))}{const s=()=>{const{position:l=ci.defaults.position,heading:c=ci.defaults.heading}=this,[u,d,p]=l,{dimensions:f=ci.defaults.dimensions}=this;o.positions=[l,[u,d,p+f[2]]];const g=a.geoRhumbDestination(l,f[0],90+c);g&&(e.positions=[l,g]);const v=a.geoRhumbDestination(l,f[1],0+c);v&&(n.positions=[l,v])};s();const r=this.disposeVar(a.createNextAnimateFrameEvent(this.positionChanged,this.dimensionsChanged,this.headingChanged));this.dispose(r.disposableOn(s))}{const s=()=>{e.color=this.xAxisColor??ci.defaults.xAxisColor,n.color=this.yAxisColor??ci.defaults.yAxisColor,o.color=this.zAxisColor??ci.defaults.zAxisColor};s();const r=this.disposeVar(a.createNextAnimateFrameEvent(this.xAxisColorChanged,this.yAxisColorChanged,this.zAxisColorChanged));this.dispose(r.disposableOn(s))}}};m(ci,"defaults",{position:[116.39,39.9,0],heading:0,dimensions:[1e3,1e3,1e3],xAxisColor:[1,0,0,1],yAxisColor:[0,1,0,1],zAxisColor:[0,0,1,1]});let Hn=ci;(t=>{t.createDefaultProps=()=>({show:!0,position:a.reactArrayWithUndefined(void 0),heading:0,dimensions:a.reactArray([1e3,1e3,1e3]),xAxisColor:a.reactArray([1,0,0,1]),yAxisColor:a.reactArray([0,1,0,1]),zAxisColor:a.reactArray([0,0,1,1]),xAxisShow:!0,yAxisShow:!0,zAxisShow:!0})})(Hn||(Hn={})),a.extendClassProps(Hn.prototype,Hn.createDefaultProps);const kn=class kn extends kt{constructor(e){super();m(this,"_opInfo",{step:this.ad(a.react(!1)),moved:this.ad(a.react(!1)),constraintMode:this.ad(a.react("none")),originPosition:this.disposeVar(a.reactArray(kt.defaults.position)),originHeading:this.disposeVar(a.react(0)),originDimensions:this.disposeVar(a.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(a.reactArray([0,0,0])),movingPosition:this.disposeVar(a.reactArray([0,0,0])),targetPosition:this.disposeVar(a.reactArray([0,0,0])),targetHeading:this.disposeVar(a.react(0))});m(this,"_createCoordinates",e=>{const n=this.ad(new Hn(e));this.dispose(this._opInfo.step.changed.disposableOn(()=>{pC(n,this._opInfo.constraintMode.value,this._opInfo.step.value)}));{const o=()=>{const r=[...this.position??kn.defaults.position];e.editingHeightOffset&&(r[2]-=e.editingHeightOffset),n.position=r};o(),this.dispose(this.positionChanged.disposableOn(o))}{const o=()=>{n.heading=this.heading??0};o(),this.dispose(this.headingChanged.disposableOn(o))}{const o=()=>{n.dimensions=this._opInfo.originDimensions.value};o(),this.dispose(this._opInfo.originDimensions.changed.disposableOn(o))}return n});m(this,"_createOriginCoordinates",e=>{const n=this.ad(new Hn(e));n.xAxisColor=[1,0,0,.5],n.yAxisColor=[0,1,0,.5],n.zAxisColor=[0,0,1,.5];const{originPosition:o,originHeading:s,originDimensions:r}=this._opInfo;{const l=()=>{n.position=o.value};l(),this.dispose(o.changed.disposableOn(l))}{const l=()=>{n.heading=s.value??0};l(),this.dispose(s.changed.disposableOn(l))}{const l=()=>{n.dimensions=r.value};l(),this.dispose(r.changed.disposableOn(l))}return n});m(this,"_createGrid",e=>{const n=this.ad(new pi(e));{const o=()=>{const r=this._opInfo.originPosition.value,l=this._opInfo.originHeading.value,c=this._opInfo.originDimensions.value[0],u=[];for(let d=-4;d<5;++d){const p=a.geoRhumbDestination(r,c*.2*d,l+90);if(p){const f=a.geoRhumbDestination(p,c,l+180),g=a.geoRhumbDestination(p,c,l);f&&g&&u.push([f,p,g])}}for(let d=-4;d<5;++d){const p=a.geoRhumbDestination(r,c*.2*d,l);if(p){const f=a.geoRhumbDestination(p,c,l-90),g=a.geoRhumbDestination(p,c,l+90);f&&g&&u.push([f,p,g])}}n.positions=u};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.originHeading.changed,this._opInfo.originDimensions.changed));this.dispose(s.disposableOn(o))}return n});m(this,"_createHelpLine",e=>{const n=this.ad(new Se(e));n.hasDash=!0,n.arcType="RHUMB",n.color=[1,1,0,.99];{const o=()=>{n.positions=[this._opInfo.originPosition.value,this._opInfo.targetPosition.value]},s=this.ad(a.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.targetPosition.changed));this.ad(s.don(o))}return n});m(this,"_createCircle",e=>{const n=this.ad(new pi(e));n.arcType="RHUMB",n.width=2,n.hasDash=!0;const o=this.disposeVar(a.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.originDimensions.changed)),s=()=>{const r=this._opInfo.originPosition.value,l=this._opInfo.originDimensions.value[0],c=[],u=32;for(let d=0;d<=u;++d){const p=a.geoRhumbDestination(r,l,d*360/u);p&&c.push(p)}n.positions=[c]};return s(),this.dispose(o.disposableOn(s)),n});m(this,"_pickingXYProcessing",e=>this.ad(new a.Processing((n,o,s)=>{const r=[0,0,0],l=new h.Cartographic;return e.pointerMoveEvent.don(c=>{if(!c.pointerEvent||!e.viewer)return;const u=ui(a.getDomEventCurrentTargetPos(c.pointerEvent));if(!Jo(e.viewer.scene,u,this._opInfo.originPosition.value[2],l))return;Jn(l,r),this._opInfo.constraintMode.value==="x"?eo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,r,r):this._opInfo.constraintMode.value==="y"?eo(this._opInfo.originPosition.value,this._opInfo.originHeading.value,r,r):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=r;const d=[0,0,0];a.geoRhumbDestination(r,s,o,d),this._opInfo.targetPosition.value=d})})));m(this,"_pickingZProcessing",e=>this.ad(new a.Processing(()=>{const n=new h.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.don(s=>{if(!s.pointerEvent||!e.viewer)return;const r=ui(a.getDomEventCurrentTargetPos(s.pointerEvent));if(!mc(e.viewer.scene,Ie(this._opInfo.originPosition.value),r,n))return;const l=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(se(n,o)){this._opInfo.movingPosition.value=o;const c=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[c[0],c[1],o[2]+l]}})})));m(this,"_pickingZAxisProcessing",e=>this.ad(new a.Processing(()=>{const n=[0,0,0],o=new h.Cartographic;return e.pointerMoveEvent.don(s=>{if(!s.pointerEvent||!e.viewer)return;const r=ui(a.getDomEventCurrentTargetPos(s.pointerEvent));if(!Jo(e.viewer.scene,r,this._opInfo.originPosition.value[2],o))return;Jn(o,n);const l=a.geoRhumbHeading(this._opInfo.originPosition.value,this._opInfo.draggingStartPosition.value),u=a.geoRhumbHeading(this._opInfo.originPosition.value,n)-l;let d=this._opInfo.originHeading.value+u;d=h.Math.toDegrees(h.Math.negativePiToPi(h.Math.toRadians(d))),this._opInfo.movingPosition.value=n,this.heading=this._opInfo.targetHeading.value=d})})));if(!e.viewer)return;const n=this.ad(a.reactArray([1,1,1]));this.ad(e.dblclickEvent.don(()=>this.enabled=!1)),this.ad(new mu(e,this.positionReact,n,this.axisPixelSize));{this.ad(this._opInfo.targetPosition.changed.don(s=>{if(this._opInfo.moved){const r=[...s];e.editingHeightOffset&&(r[2]+=e.editingHeightOffset),this.position=r}})),this.ad(this._opInfo.targetHeading.changed.don(s=>this._opInfo.moved&&(this.heading=s)));const o=()=>{if(this._opInfo.constraintMode.value==="none"){this._opInfo.moved.value=!1;return}if(this._opInfo.originHeading.value!==this._opInfo.targetHeading.value){this._opInfo.moved.value=!0;return}if(!this._opInfo.originPosition.value.every((s,r)=>s===this._opInfo.targetPosition.value[r])){this._opInfo.moved.value=!0;return}};o(),this.dispose(this._opInfo.originHeading.changed.disposableOn(o)),this.dispose(this._opInfo.originPosition.changed.disposableOn(o)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(o)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(o))}{const o=this._createCoordinates(e),s=this._createOriginCoordinates(e),r=this._createGrid(e),l=this._createHelpLine(e),c=this._createCircle(e);{const u=()=>{c.show=r.show=this.enabled&&this.showCircle,l.show=this.enabled&&this.showCircle&&this._opInfo.moved.value,o.show=this.enabled&&this.showCoordinates,s.show=this.enabled&&this.showCoordinates&&this._opInfo.moved.value};u();const d=this.ad(a.createNextAnimateFrameEvent(this.enabledChanged,this.showCircleChanged,this.showCoordinatesChanged,this._opInfo.moved.changed));this.ad(d.don(u))}{const u=()=>{o.xAxisShow=s.xAxisShow=this.xAxisShow,o.yAxisShow=s.yAxisShow=this.yAxisShow,o.zAxisShow=s.zAxisShow=this.zAxisShow};u();const d=this.ad(a.createNextAnimateFrameEvent(this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.ad(d.don(u))}{const u=()=>{r.color=this._opInfo.constraintMode.value!=="none"?[1,1,0,.6]:[1,1,0,.3],c.color=this._opInfo.constraintMode.value==="zAxis"?[1,1,0,.99]:[1,1,0,.5],pC(o,this._opInfo.constraintMode.value,this._opInfo.step.value)};u(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(u))}{const u=this._pickingXYProcessing(e),d=this._pickingZProcessing(e),p=this._pickingZAxisProcessing(e),f=()=>{const S=[...this.position??kn.defaults.position];e.editingHeightOffset&&(S[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=S},g=()=>this._opInfo.targetHeading.value=this._opInfo.originHeading.value=this.heading,v=()=>this._opInfo.originDimensions.value=n.value,y={constraintMode:"none",startDragPos:[0,0,0]},w=S=>{const x={position:o.position??kn.defaults.position,heading:o.heading??kn.defaults.heading,dimensions:o.dimensions??kn.defaults.dimensions};e.viewer&&ou(S,e.viewer.scene,x,this.axisSnapPixelSize,y,{x:this.disableX,y:this.disableY,z:this.disableZ,xy:this.disableXY,zAxis:this.disableZAxis}),this._opInfo.constraintMode.value=y.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=y.startDragPos},P=this.ad(a.createProcessingFromAsyncFunc(async S=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",S.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await a.step(S,async x=>{x.disposer.dispose((f(),this.positionChanged.don(f))),x.disposer.dispose((g(),this.headingChanged.don(g))),x.disposer.dispose((v(),n.changed.don(v))),x.disposer.dispose(e.pointerMoveEvent.don(A=>{A.pointerEvent&&w(A.pointerEvent)})),await a.step(x,A=>new Promise((R,L)=>{A.disposer.dispose(L),A.disposer.dispose(e.pointerDownEvent.don(B=>{B.pointerEvent&&w(B.pointerEvent),B.pointerEvent&&B.pointerEvent.button===0&&y.constraintMode!=="none"&&R()}))}))}),this._opInfo.step.value=!1,await a.step(S,async x=>{if(e.incrementDisabledInputStack(),x.disposer.dispose(()=>{e.decrementDisabledInputStack()}),["xy","x","y"].includes(this._opInfo.constraintMode.value)){const A=a.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),R=a.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);u.restart(void 0,A,R),x.disposer.dispose(()=>u.cancel())}else this._opInfo.constraintMode.value==="z"?(d.restart(),x.disposer.dispose(()=>d.cancel())):this._opInfo.constraintMode.value==="zAxis"?(p.restart(),x.disposer.dispose(()=>p.cancel())):console.warn(`pickingInfo.constraintMode error! ${this._opInfo.constraintMode.value}`);await a.step(x,A=>new Promise((R,L)=>{A.disposer.dispose(L),A.disposer.dispose(e.pointerUpEvent.don(()=>{R()})),A.disposer.dispose(e.pointerOutEvent.don(()=>R()))}))}),P.restart()})),C=()=>{this.enabled?P.restart():P.isRunning&&P.cancel()};C(),this.ad(this.enabledChanged.don(C))}}}};m(kn,"defaults",{...kt.defaults,heading:0,dimensions:[1e3,1e3,1e3],xAxisColor:[1,0,0,1],yAxisColor:[0,1,0,1],zAxisColor:[0,0,1,1]});let on=kn;(t=>{t.createDefaultProps=()=>({...kt.createDefaultProps(),heading:0,axisPixelSize:100,axisSnapPixelSize:5,showCoordinates:!0,showCircle:!0,disableX:!1,disableY:!1,disableZ:!1,disableXY:!1,disableZAxis:!1,xAxisShow:!0,yAxisShow:!0,zAxisShow:!0})})(on||(on={})),a.extendClassProps(on.prototype,on.createDefaultProps);function pC(t,i,e){t.xAxisColor=[1,0,0,.99],t.yAxisColor=[0,1,0,.99],t.zAxisColor=[0,0,1,.99],i==="x"?t.xAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:i==="y"?t.yAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:i==="z"?t.zAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:i==="xy"&&(t.xAxisColor=e?[1,1,0,.8]:[1,1,0,.99],t.yAxisColor=e?[1,1,0,.8]:[1,1,0,.99])}class sg extends a.HasOwner{constructor(e){super(e);m(this,"_valid",!1);m(this,"_normal",new h.Cartesian3(0,0,0));m(this,"_origin",new h.Cartesian3(0,0,0))}get viewer(){return this.owner.czmViewer.viewer}get scene(){return this.viewer.scene}get sceneObject(){return this.owner}get valid(){return this._valid}get normal(){return this._normal}get origin(){return this._valid&&this._origin}pick(e){if(!this.normal||!this.owner.cartesian)return;const n=this.owner.cartesian,o=ui(e);return Yg(this.scene,n,this.normal,o)}}class aF extends sg{constructor(i){super(i);{const e=()=>{const o=Fe({position:this.sceneObject.position,rotation:this.sceneObject.rotation});this._valid=!!o,o&&(this._origin.x=o[4],this._origin.y=o[5],this._origin.z=o[6],this._normal.x=o[8],this._normal.y=o[9],this._normal.z=o[10])};e();const n=this.ad(a.createNextAnimateFrameEvent(this.sceneObject.positionChanged,this.sceneObject.rotationChanged));this.ad(n.don(e))}}}class lF extends sg{constructor(i){super(i);const e=()=>{const n=Fe({rotation:[this.sceneObject.selfRotation[0],0,0]});if(!n)throw new Error("PitchPlane: rm is undefined");const o=Fe({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:h.Matrix4.toArray(n)});if(this._valid=!!o,!!o){{const s=this._normal;s.x=-o[0],s.y=-o[1],s.z=-o[2]}{const s=this._origin;s.x=o[4],s.y=o[5],s.z=o[6]}}};e(),this.dispose(this.sceneObject.positionChanged.disposableOn(e)),this.dispose(this.sceneObject.rotationChanged.disposableOn(e)),this.dispose(this.sceneObject.selfRotationChanged.disposableOn(e))}}class cF extends sg{constructor(i){super(i);const e=()=>{const n=Fe({rotation:[this.sceneObject.selfRotation[0],this.sceneObject.selfRotation[1],0]});if(!n)throw new Error("PitchPlane: rm is undefined");const o=Fe({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:h.Matrix4.toArray(n)});if(this._valid=!!o,!!o){{const s=this._normal;s.x=-o[4],s.y=-o[5],s.z=-o[6]}{const s=this._origin;s.x=o[8],s.y=o[9],s.z=o[10]}}};e(),this.dispose(this.sceneObject.positionChanged.disposableOn(e)),this.dispose(this.sceneObject.rotationChanged.disposableOn(e)),this.dispose(this.sceneObject.selfRotationChanged.disposableOn(e))}}class tr extends a.Destroyable{constructor(e){super();m(this,"_czmTexture");m(this,"_customPrimitiveForCircle");m(this,"_circleCanvas");m(this,"_debugAxis");e.viewer&&(this._czmTexture=this.disposeVar(new Be(e)),this._czmTexture.uri="",this._createCircleCanvas(e),this._createCustomPrimitiveForCircle(e),this._createDebugAxis(e))}get czmTexture(){return this._czmTexture}get customPrimitiveForCircle(){return this._customPrimitiveForCircle}get circleCanvas(){return this._circleCanvas}get debugAxis(){return this._debugAxis}_createCircleCanvas(e){let n=this.disposeVar(a.react(!1));const o=document.createElement("canvas");o.width=o.height=256,this._circleCanvas=o.getContext("2d");{const r=()=>{const c={rotation:this.circleRotation*Math.PI/180,startRotation:this.circleStartRotation*Math.PI/180,endRotation:this.circleEndRotation*Math.PI/180},u=this._circleCanvas,d=this.color,p=`rgba(${d[0]*255|0}, ${d[1]*255|0}, ${d[2]*255|0}, ${d[3]})`;u.clearRect(0,0,256,256),u.lineWidth=6,u.beginPath(),u.arc(128,128,64,0,Math.PI*2,!1),u.strokeStyle=`rgba(0,0,0,${d[3]})`,u.stroke(),u.lineWidth=4,u.beginPath(),u.arc(128,128,64,0,Math.PI*2,!1),u.strokeStyle=p,u.stroke();{u.lineWidth=1,u.beginPath();let v=h.Math.zeroToTwoPi(c.startRotation),y=h.Math.zeroToTwoPi(c.endRotation);y<v&&(y+=h.Math.TWO_PI),(v!==y||v!==0)&&(u.moveTo(128,128),u.arc(128,128,64,v,y,y-v>Math.PI),u.lineTo(128,128),u.strokeStyle="rgba(255, 255, 0, 1.0)",u.stroke())}let f=h.Math.negativePiToPi(c.rotation);u.lineWidth=3,u.beginPath(),u.moveTo(128,128),u.arc(128,128,64,0,f,h.Math.negativePiToPi(f-0)<0),u.lineTo(128,128),u.fillStyle=`rgba(${d[0]*255|0}, ${d[1]*255|0}, ${d[2]*255|0}, 0.5)`,u.fill();{u.save(),u.font="16px console",u.textBaseline="middle";const w=`${(h.Math.negativePiToPi(f-0)*180/Math.PI*10|0)/10}°`;var g=u.measureText(w).width;u.translate(128,128),u.rotate(Math.PI*.5),f=h.Math.negativePiToPi(f-0)+0,u.rotate((f+0)*.5),u.scale(n.value?-1:1,1),u.translate(-128,-128),u.fillStyle="white",u.fillText(w,128-g*.5,54),u.lineWidth=1,u.restore()}this.czmTexture&&this.czmTexture.copyFromCanvas(o)};r();const l=this.ad(a.createNextAnimateFrameEvent(this.colorChanged,this.circleRotationChanged,this.circleStartRotationChanged,this.circleEndRotationChanged,n.changed));this.ad(l.don(r)),this.czmTexture&&this.ad(this.czmTexture.readyEvent.don(r))}{const s=()=>{const l=Fe({rotation:this.selfRotation});if(!l)return;const c=Fe({position:this.position,rotation:this.rotation,localModelMatrix:h.Matrix4.toArray(l)});if(!c)return;const{viewer:u}=e;if(!u)return;const d=h.Cartesian3.dot(u.scene.camera.directionWC,new h.Cartesian3(c[8],c[9],c[10]));n.value=d>0};s();const r=this.ad(a.createNextAnimateFrameEvent(e.cameraChanged,this.positionChanged,this.rotationChanged,this.selfRotationChanged));this.ad(r.don(s))}}_createCustomPrimitiveForCircle(e){this._customPrimitiveForCircle=this.disposeVar(hF(e)),this.dispose(a.track([this._customPrimitiveForCircle,"show"],[this,"show"])),this.dispose(a.track([this._customPrimitiveForCircle,"position"],[this,"position"])),this.dispose(a.track([this._customPrimitiveForCircle,"rotation"],[this,"rotation"])),this.dispose(a.track([this._customPrimitiveForCircle,"pixelSize"],[this,"pixelSize"]));{const n=()=>{const o=Fe({rotation:this.selfRotation});this._customPrimitiveForCircle&&(this._customPrimitiveForCircle.localModelMatrix=o&&h.Matrix4.toArray(o)||void 0)};n(),this.dispose(this.selfRotationChanged.disposableOn(n))}{const n=()=>{this.customPrimitiveForCircle&&this.czmTexture&&(this.customPrimitiveForCircle.uniformMap={u_image:{type:"texture",id:this.czmTexture.id},u_color:this.color})};n(),this.dispose(this.colorChanged.disposableOn(n))}}_createDebugAxis(e){this._debugAxis=this.ad(uF(e)),this.dispose(a.track([this._debugAxis,"pixelSize"],[this,"pixelSize"])),this.dispose(a.track([this._debugAxis,"position"],[this,"position"])),this.dispose(a.track([this._debugAxis,"rotation"],[this,"rotation"])),this.dispose(a.track([this._debugAxis,"show"],[this,"debug"]));{const n=()=>{const o=Fe({rotation:this.selfRotation});this._debugAxis&&(this._debugAxis.localModelMatrix=o&&h.Matrix4.toArray(o)||void 0)};n(),this.dispose(this.selfRotationChanged.disposableOn(n))}{const n=()=>{this._debugAxis&&(this._debugAxis.uniformMap={u_color:this.color})};n(),this.dispose(this.colorChanged.disposableOn(n))}}}m(tr,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,editing:!1,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),selfRotation:a.reactArray([0,0,0]),pixelSize:300,color:a.reactArray([1,1,1,1]),circleRotation:0,circleStartRotation:0,circleEndRotation:0,debug:!1})})(tr||(tr={})),a.extendClassProps(tr.prototype,tr.createDefaultProps);function hF(t){return _u({type:"CzmCustomPrimitive",allowPicking:!0,pixelSize:100,boundingVolume:{type:"LocalAxisedBoundingBox",data:{min:[0,-1,0],max:[1,0,0]}},renderState:{depthTest:{enabled:!1},cull:{enabled:!1,face:1029},depthMask:!1,blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},localPosition:[-.5,-.5,0],localRotation:[-90,0,0]},ze,t)}function uF(t){return _u({type:"CzmCustomPrimitive",allowPicking:!0,position:[114.86128105686282,40.86825802653499,0],primitiveType:"LINES",vertexShaderSource:`in vec3 position;
1915
1915
  void main()
1916
1916
  {
1917
1917
  // 如果这一句注释,要相应地注释掉attribute中的normal,也就是说顶点属性要和shader中的一一匹配!
@@ -1922,7 +1922,7 @@ void main()
1922
1922
  {
1923
1923
  out_FragColor = u_color;
1924
1924
  }
1925
- `,uniformMap:{u_color:[1,1,0,1]},name:"CzmCustomPrimitive_47fd",attributes:{position:{typedArray:{type:"Float32Array",array:[0,0,0,0,0,1]},componentsPerAttribute:3}}},ze,t)}class uF extends a.HasOwner{constructor(i){super(i);const{czmViewer:e}=this.owner;let n;this.dispose(()=>this.owner.hoveredPlaneType="none");const o=this._createRotatorMoveProcessing();this.dispose(e.pointerMoveEvent.disposableOn(s=>{const r=n=this._getStartInfo(s.pointerEvent);r&&(this.owner.hoveredPlaneType=r.currentPlaneType)})),this.dispose(e.pointerDownEvent.disposableOn(s=>{n&&n.currentPlaneType!=="none"&&(o.restart(void 0,e,n),n=void 0)})),this.dispose(e.dblclickEvent.disposableOn(s=>{const r=this._getStartInfo(s.pointerEvent);if(r&&r.currentPlaneType!=="none"){const{currentPlaneType:l}=r,c=[...this.owner.selfRotation];c[yi.rotationNum[l]]=0,this.owner.selfRotation=c;return}this.owner.enabled=!1}))}_createRotatorMoveProcessing(){return this.ad(a.createProcessingFromAsyncFunc(async(i,e,n)=>{const o=this.owner.circles[n.currentPlaneType];e.incrementDisabledInputStack(),i.disposer.dispose(()=>e.decrementDisabledInputStack()),i.disposer.dispose(e.pointerMoveEvent.don(s=>{if(n&&s.pointerEvent){const{offsetX:r,offsetY:l}=s.pointerEvent,c=[r,l],{currentPlaneType:u}=n;if(u==="none")return;const d=this.owner.getPlane(u);if(!n.currentV)return;const p=d.pick(c);if(!p||!this.owner.cartesian)return;const f=h.Cartesian3.subtract(n.currentV,this.owner.cartesian,new h.Cartesian3);h.Cartesian3.normalize(f,f);const g=h.Cartesian3.subtract(p,this.owner.cartesian,new h.Cartesian3);if(h.Cartesian3.normalize(g,g),!d.normal||!d.origin)return;const v=rg(f,g,d.normal),y=rg(d.origin,f,d.normal),w=rg(d.origin,g,d.normal);{const P=[...this.owner.selfRotation];P[yi.rotationNum[u]]=n.startRotation+v,this.owner.selfRotation=P,o.circleStartRotation=y,o.circleEndRotation=w}}})),this.owner.movingPlaneType=n.currentPlaneType,i.disposer.dispose(()=>{this.owner.movingPlaneType="none"}),i.disposer.dispose(()=>{o.circleStartRotation=0,o.circleEndRotation=0}),await a.step(i,s=>new Promise((r,l)=>{s.disposer.dispose(l),s.disposer.dispose(e.pointerUpEvent.don(()=>{r()})),s.disposer.dispose(e.pointerOutEvent.don(()=>{r()}))}))}))}_pickPlane(i,e,n,o,s){const r=this.owner.cartesian;if(!r)return;const{selfRotation:l}=this.owner,c=this.owner.getPlane(n).pick(o);if(!c)return;const u=h.Cartesian3.distance(r,c),d=s/4,p=d*3/128;if(!(u>=d-p&&u<=d+p))return;const g=h.Cartesian3.distance(e.camera.positionWC,c);i.currentD2c<=g||(i.currentPlaneType=n,i.currentD2c=g,i.currentV=c,i.startRotation=l[yi.rotationNum[n]])}_getStartInfo(i){var d;const{czmViewer:e}=this.owner,n=(d=e.viewer)==null?void 0:d.scene;if(!this.owner.position||!this.owner.cartesian)return;const o=Wi(n,this.owner.cartesian,this.owner.pixelSize);if(!o)return;const{offsetX:s,offsetY:r}=i,l=[s,r],c=i.pointerId,u={currentPlaneType:"none",currentD2c:Number.POSITIVE_INFINITY,currentV:void 0,startRotation:0,pointerId:c};return this._pickPlane(u,n,"heading",l,o),this._pickPlane(u,n,"pitch",l,o),this._pickPlane(u,n,"roll",l,o),u}}function rg(t,i,e){const n=h.Cartesian3.cross(i,t,new h.Cartesian3);if(n.equals(h.Cartesian3.ZERO))return 0;h.Cartesian3.normalize(n,n);const o=h.Cartesian3.dot(n,e);let s=Math.acos(h.Cartesian3.dot(t,i))*180/Math.PI;return s=o>0?s:-s,s}const Yo=class Yo extends kt{constructor(e){super();m(this,"_hoveredPlaneType",this.disposeVar(a.react("none")));m(this,"_movingPlaneType",this.disposeVar(a.react("none")));m(this,"_circles");m(this,"_czmCameraModel");m(this,"_cartesian");m(this,"_planes",{heading:this.disposeVar(new rF(this)),pitch:this.disposeVar(new aF(this)),roll:this.disposeVar(new lF(this))});m(this,"_rotatorRunningResetting");this._czmViewer=e;const n=this._czmViewer;if(this._rotatorRunningResetting=this.disposeVar(new a.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new uF(this)})),this._circles={heading:this._createRotatorCircle(n,"heading"),pitch:this._createRotatorCircle(n,"pitch"),roll:this._createRotatorCircle(n,"roll")},!!n.viewer){{const s=()=>{this._cartesian=this.position&&Ie(this.position)||void 0};s(),this.dispose(this.positionChanged.disposableOn(s))}this._createCameraModel(n)}}get hoveredPlaneType(){return this._hoveredPlaneType.value}set hoveredPlaneType(e){this._hoveredPlaneType.value=e}get hoveredPlaneTypeChanged(){return this._hoveredPlaneType.changed}get movingPlaneType(){return this._movingPlaneType.value}set movingPlaneType(e){this._movingPlaneType.value=e}get movingPlaneTypeChanged(){return this._movingPlaneType.changed}get circles(){return this._circles}get czmCameraModel(){return this._czmCameraModel}get cartesian(){return this._cartesian}get czmViewer(){return this._czmViewer}getPlane(e){return this._planes[e]}get rotatorRunningResetting(){return this._rotatorRunningResetting}_createCameraModel(e){this._czmCameraModel=new lt(e),this._czmCameraModel.url="${earthsdk3-assets-script-dir}/assets/glb/camera1/camera1.gltf",this._czmCameraModel.localRotation=[90,0,0],this._czmCameraModel.allowPicking=!1,this._czmCameraModel.opaquePass="OVERLAY",this.dispose(a.track([this._czmCameraModel,"pixelSize"],[this,"pixelSize"],n=>n*.1)),this.dispose(a.track([this._czmCameraModel,"position"],[this,"position"])),this.dispose(a.track([this._czmCameraModel,"rotation"],[this,"rotation"]));{const n=()=>{const o=Fe({rotation:this.selfRotation});if(!o)throw new Error("!rm");this._czmCameraModel&&(this._czmCameraModel.localModelMatrix=h.Matrix4.toArray(o))};n(),this.dispose(this.selfRotationChanged.disposableOn(n))}{const n=()=>{this.circles.heading.show=this.enabled,this.circles.pitch.show=this.enabled,this.circles.roll.show=this.enabled,this._czmCameraModel&&(this._czmCameraModel.show=this.enabled&&this.showHelper)};n(),this.dispose(this.enabledChanged.disposableOn(n)),this.dispose(this.showHelperChanged.disposableOn(n))}}_createRotatorCircle(e,n){const o=this.ad(new tr(e));this.dispose(a.track([o,"position"],[this,"position"])),this.dispose(a.track([o,"pixelSize"],[this,"pixelSize"])),this.dispose(a.track([o,"debug"],[this,"debug"])),this.dispose(a.track([o,"rotation"],[this,"rotation"]));{const s=()=>{o.selfRotation=Yo.rotationFuncs[n](this.selfRotation),o.circleRotation=this.selfRotation[Yo.rotationNum[n]]};s(),this.dispose(this.selfRotationChanged.disposableOn(s))}{const s=()=>{const r=this.movingPlaneType===n,l=this.hoveredPlaneType===n,u=[0,0,0,r||l?1:.8];u[Yo.rotationNum[n]]=1,o.color=u};s(),this.dispose(this.movingPlaneTypeChanged.disposableOn(s)),this.dispose(this.hoveredPlaneTypeChanged.disposableOn(s))}return o}};m(Yo,"rotationNum",{heading:0,pitch:1,roll:2}),m(Yo,"rotationFuncs",{heading:([e,n,o])=>[0,0,0],pitch:([e,n,o])=>[e,0,-90],roll:([e,n,o])=>[e,n+90,0]});let yi=Yo;(t=>{t.createDefaultProps=()=>({...kt.createDefaultProps(),rotation:a.reactArray([0,0,0]),selfRotation:a.reactArray([0,0,0]),pixelSize:300,showHelper:!1,debug:!1})})(yi||(yi={})),a.extendClassProps(yi.prototype,yi.createDefaultProps);const Zo=class Zo extends a.Destroyable{get startPosition(){return this.positions&&this.positions[0]}set startPosition(i){this.positions=[i??Zo.defaults.positions[0],this.stopPosition??Zo.defaults.positions[1]]}get startPositionChanged(){return this.positionsChanged}get stopPosition(){return this.positions&&this.positions[1]}set stopPosition(i){this.positions=[this.startPosition??Zo.defaults.positions[0],i??Zo.defaults.positions[1]]}get stopPositionChanged(){return this.positionsChanged}constructor(i,e){if(super(),!i.viewer)return;const o=this.ad(new Se(i,e));o.arcType="RHUMB";const s=this.ad(new ti(i,e));this.ad(a.track([o,"allowPicking"],[this,"allowPicking"])),this.ad(a.track([s,"allowPicking"],[this,"allowPicking"]));{const r=()=>{o.show=s.show=this.show};r(),this.ad(this.showChanged.don(r))}{const r=()=>{o.width=this.width/2,s.pixelSize=this.width};r(),this.ad(this.widthChanged.don(r))}{const r=()=>{o.color=s.color=this.color};r(),this.ad(this.colorChanged.don(r))}{const r=()=>{o.positions=this.positions,s.position=this.stopPosition};r(),this.dispose(this.startPositionChanged.disposableOn(r)),this.dispose(this.stopPositionChanged.disposableOn(r))}}};m(Zo,"defaults",{positions:[[0,0,0],[0,0,1e6]]});let No=Zo;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(t.defaults.positions),width:10,color:a.reactArray([1,0,0,1])})})(No||(No={})),a.extendClassProps(No.prototype,No.createDefaultProps);class sn extends kt{constructor(e){super();m(this,"_lastPosition");m(this,"_opInfo",{step:this.ad(a.react(!1)),moved:this.ad(a.react(!1)),constraintMode:this.disposeVar(a.react("none")),originPosition:this.disposeVar(a.reactArray([0,0,0])),originHeading:this.disposeVar(a.react(0)),originDimensions:this.disposeVar(a.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(a.reactArray([0,0,0])),movingPosition:this.disposeVar(a.reactArray([0,0,0])),targetPosition:this.disposeVar(a.reactArray([0,0,0])),targetHeading:this.disposeVar(a.react(0))});m(this,"_scaleAxis");m(this,"_pickingXYProcessing",e=>this.disposeVar(new a.Processing((n,o,s)=>{const r=[0,0,0],l=new h.Cartographic;return e.pointerMoveEvent.disposableOn(c=>{if(!c.pointerEvent||!e.viewer)return;const u=ui(a.getDomEventCurrentTargetPos(c.pointerEvent));if(!Jo(e.viewer.scene,u,this._opInfo.originPosition.value[2],l))return;Jn(l,r),this._opInfo.constraintMode.value==="x"?eo(this._opInfo.originPosition.value,this._opInfo.originHeading.value,r,r):this._opInfo.constraintMode.value==="y"?eo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,r,r):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=r,this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const d=[0,0,0];a.geoRhumbDestination(r,s,o,d),this._opInfo.targetPosition.value=d;let p=this.scale[0],f=this.scale[1];const g=a.geoDistance(d,this._opInfo.originPosition.value)-a.geoDistance(this._lastPosition,this._opInfo.originPosition.value);this._lastPosition=[...d];const v=this._opInfo.originDimensions.value[0]/100;g!=0&&this._opInfo.constraintMode.value==="y"&&(g>0?p+=v:p-=v),g!=0&&this._opInfo.constraintMode.value==="x"&&(g>0?f+=v:f-=v),p<=0&&(p+=v),f<=0&&(f+=v),this.scale=[p??1,f??1,this.scale[2]??1]})})));m(this,"_pickingZProcessing",e=>this.disposeVar(new a.Processing(()=>{const n=new h.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.disposableOn(s=>{if(!s.pointerEvent||!e.viewer)return;const r=ui(a.getDomEventCurrentTargetPos(s.pointerEvent));if(!mc(e.viewer.scene,Ie(this._opInfo.originPosition.value),r,n))return;this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const l=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(se(n,o)){this._opInfo.movingPosition.value=o;const c=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[c[0],c[1],o[2]+l];let u=this.scale[2];const d=o[2]-this._lastPosition[2];this._lastPosition=[...o];const p=this._opInfo.originDimensions.value[0]/100;d!=0&&(d>0?u+=p:u-=p),u<=0&&(u+=p),this.scale=[this.scale[0]??1,this.scale[1]??1,u??1]}})})));const n=e.viewer;if(!n)return;const{scene:o}=n;this.ad(new mu(e,this.positionReact,this._opInfo.originDimensions,this.axisPixelSize)),this.ad(e.dblclickEvent.don(()=>{this.enabled=!1})),this._scaleAxis={zAxis:this._createScaleAxis(e,"zAxis"),yAxis:this._createScaleAxis(e,"yAxis"),xAxis:this._createScaleAxis(e,"xAxis")};{const s=()=>{if(!this._scaleAxis)return;const{zAxis:r,yAxis:l,xAxis:c}=this._scaleAxis,u=this._opInfo.constraintMode.value,d=this._opInfo.step;r.color=[0,0,1,.99],l.color=[0,1,0,.99],c.color=[1,0,0,.99],u==="x"?c.color=d?[1,1,0,.8]:[1,1,0,.99]:u==="y"?l.color=d?[1,1,0,.8]:[1,1,0,.99]:u==="z"&&(r.color=d?[1,1,0,.8]:[1,1,0,.99])};s(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(s)),this.dispose(this._opInfo.step.changed.disposableOn(s))}{const s=()=>{if(!this._scaleAxis)return;const{position:l=sn.defaults.position}=this,{zAxis:c,yAxis:u,xAxis:d}=this._scaleAxis;c.startPosition=u.startPosition=d.startPosition=l;const[p,f,g]=l;c.stopPosition=[p,f,g+this._opInfo.originDimensions.value[2]];const v=a.geoRhumbDestination(l,this._opInfo.originDimensions.value[0],90);v&&(d.stopPosition=v);const y=a.geoRhumbDestination(l,this._opInfo.originDimensions.value[1],0);y&&(u.stopPosition=y)};s();const r=this.ad(a.createNextAnimateFrameEvent(this.positionChanged,this._opInfo.originDimensions.changed));this.ad(r.don(s))}{const s=()=>{if(this._opInfo.constraintMode.value==="none"){this._opInfo.moved.value=!1;return}if(this._opInfo.originHeading.value!==this._opInfo.targetHeading.value){this._opInfo.moved.value=!0;return}if(!this._opInfo.originPosition.value.every((r,l)=>r===this._opInfo.targetPosition.value[l])){this._opInfo.moved.value=!0;return}};s(),this.dispose(this._opInfo.originHeading.changed.disposableOn(s)),this.dispose(this._opInfo.originPosition.changed.disposableOn(s)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(s)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(s))}{const s=this._pickingXYProcessing(e),r=this._pickingZProcessing(e),l=()=>{const f=[...this.position??sn.defaults.position];e.editingHeightOffset&&(f[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=f},c={constraintMode:"none",startDragPos:[0,0,0]},u=f=>{if(!this.position)return;const g={position:this.position,dimensions:this._opInfo.originDimensions.value,heading:0};ou(f,o,g,this.axisSnapPixelSize,c),this._opInfo.constraintMode.value=c.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=c.startDragPos},d=this.disposeVar(a.createProcessingFromAsyncFunc(async f=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",f.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await a.step(f,async g=>{g.disposer.dispose((l(),this.positionChanged.disposableOn(l))),g.disposer.dispose(e.pointerMoveEvent.disposableOn(v=>{v.pointerEvent&&u(v.pointerEvent)})),await a.step(g,v=>new Promise((y,w)=>{v.disposer.dispose(w),v.disposer.dispose(e.pointerDownEvent.don(P=>{P.pointerEvent&&u(P.pointerEvent),P.pointerEvent&&P.pointerEvent.button===0&&c.constraintMode!=="none"&&y()}))}))}),this._opInfo.step.value=!1,await a.step(f,async g=>{if(e.incrementDisabledInputStack(),g.disposer.dispose(()=>e.decrementDisabledInputStack()),["x","y"].includes(this._opInfo.constraintMode.value)){const v=a.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),y=a.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);s.restart(void 0,v,y),g.disposer.dispose(()=>s.cancel())}else this._opInfo.constraintMode.value==="z"&&(r.restart(),g.disposer.dispose(()=>r.cancel()));await a.step(g,v=>new Promise((y,w)=>{v.disposer.dispose(w),v.disposer.dispose(e.pointerUpEvent.don(()=>{y()})),v.disposer.dispose(e.pointerOutEvent.don(()=>{y()}))})),this._lastPosition=void 0}),d.restart()})),p=()=>{this.enabled?d.restart():d.isRunning&&d.cancel()};p(),this.dispose(this.enabledChanged.disposableOn(p))}}get scaleAxis(){return this._scaleAxis}_createScaleAxis(e,n){const o=this.ad(new No(e));return o.width=10,this.ad(a.track([o,"show"],[this,"enabled"])),o}}(t=>{t.createDefaultProps=()=>({...kt.createDefaultProps(),scale:a.reactArray([1,1,1]),axisPixelSize:100,axisSnapPixelSize:5})})(sn||(sn={})),a.extendClassProps(sn.prototype,sn.createDefaultProps);const Kn=class Kn extends Gt{constructor(e){super();m(this,"_editingPoints",this.disposeVar(new a.ObservableArray));m(this,"_cancelEvent",this.disposeVar(new a.Event));m(this,"_currentProcess");m(this,"_menuPoiEnabled",this.disposeVar(a.react(!1)));m(this,"_status",this.disposeVar(a.react("None")));m(this,"_positionsChanged",this.ad(new a.Event));m(this,"_cursorInfo");this._czmViewer=e,this.enabled=!1,this.createPolyline(e),this._createCursorInfo(e),this.dispose(()=>this.resetPositions()),this.dispose(()=>this.editingPoints.length=0),this.dispose(this.editingPoints.changedEvent.disposableOn(()=>this.positionsChanged.emit())),this.dispose(this.editingPoints.toChangeEvent.disposableOn(n=>{for(let{start:o,deleteCount:s,items:r}of n){for(const l of r)l.menuPoi.enabled=this.menuPoiEnabled??!1;for(let l=o;l<o+s;++l)this.editingPoints.get(l).destroy()}})),this.dispose(this.menuPoiEnabledChanged.disposableOn(()=>{for(let n of this.editingPoints)n.menuPoi.enabled=this.menuPoiEnabled??!1})),this.dispose(e.dblclickEvent.don(n=>{this.ad(()=>{var o;((o=n.pointerEvent)==null?void 0:o.button)===0&&this.enabled&&this.currentProcess&&this.currentProcess.cancel()})})),this.dispose(this.enabledChanged.disposableOn(n=>{this._currentProcess&&(n?this._currentProcess.restart():this._currentProcess.isRunning&&this._currentProcess.cancel())}));{const n=()=>{this.polylineShow=this.czmViewer.editingLineShow};n(),this.ad(this.czmViewer.editingLineShowChanged.don(n))}}get editingPoints(){return this._editingPoints}get cancelEvent(){return this._cancelEvent}cancel(){this._cancelEvent.emit()}get currentProcess(){return this._currentProcess}set currentProcess(e){this._currentProcess=e}get menuPoiEnabled(){return this._menuPoiEnabled.value}set menuPoiEnabled(e){this._menuPoiEnabled.value=e}get menuPoiEnabledChanged(){return this._menuPoiEnabled.changed}get status(){return this._status.value}get statusChanged(){return this._status.changed}set status(e){this._status.value=e}getPositions(){const e=[];for(let n of this._editingPoints)n.position&&e.push([...n.position]);return e}resetPositions(e){if(this.enabled??Kn.defaults.enabled)return console.warn("MultiPointsEditing.resetPositions error: this.enabled === true"),!1;const n=e||[];return!(n.length===this.editingPoints.length&&n.every((o,s)=>o.every((r,l)=>{const c=this.editingPoints.get(s);return c.position&&c.position[l]===r})))}forceResetPositions(e){(this.enabled??Kn.defaults.enabled)&&(this.enabled=!1),this.resetPositions(e)}get positions(){return this.getPositions()}set positions(e){this.resetPositions(e)}get positionsChanged(){return this._positionsChanged}get czmViewer(){return this._czmViewer}get cursorInfo(){return this._cursorInfo}createPolyline(e){const n=this.ad(new Se(e));this.ad(a.track([n,"color"],[this,"polylineColor"])),this.ad(a.track([n,"width"],[this,"polylineWidth"])),this.ad(a.track([n,"show"],[this,"polylineShow"])),this.ad(a.track([n,"arcType"],[this,"polylineArcType"])),this.ad(a.track([n,"loop"],[this,"loop"]));{const o=()=>{const s=[];for(const r of this.getPositions())r[2]-=e.editingHeightOffset??0,s.push(r);n.positions=s};o(),this.ad(this.positionsChanged.don(o))}}_createCursorInfo(e){const n=this._cursorInfo=this.ad(new a.CursorInfo(e.container,a.CursorFloatDiv));this.dispose(this.statusChanged.disposableOn(()=>{const o=this.status;if(n){if(!this.hideCursorInfo){n.show=!1;return}o==="Adding"?(n.text="右键/BackSpace键:删除上一个控制点;Esc键或左键双击:退出添加状态,进入修改状态",n.show=!0):o==="Modifying"||o==="Modifying_Point"?(n.text="Esc键或左键双击:退出编辑状态",n.show=!0):o==="None"&&(n.text="",n.show=!1)}}))}};m(Kn,"baseImageUrl","${earthsdk3-assets-script-dir}/assets/img/"),m(Kn,"defaults",{...Gt.defaults,debug:!1,polylineShow:!1,polylineWidth:1,polylineColor:[1,1,1,1],polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,loop:!1,firstControlPointImageUrl:Kn.baseImageUrl+"point-green.png",otherControlPointImageUrl:Kn.baseImageUrl+"point-yellow.png"});let ri=Kn;(t=>{t.createDefaultProps=()=>({...Gt.createDefaultProps(),loop:!1,debug:!1,polylineShow:!0,polylineWidth:1,polylineColor:a.reactArray([1,1,1,1]),polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,firstControlPointImageUrl:t.baseImageUrl+"point-green.png",otherControlPointImageUrl:t.baseImageUrl+"point-yellow.png",hideCursorInfo:!1,middlePointShow:!0})})(ri||(ri={})),a.extendClassProps(ri.prototype,ri.createDefaultProps);let dF=0;class fC extends a.Destroyable{constructor(e,n){super();m(this,"_position",this.disposeVar(a.reactArrayWithUndefined(void 0)));m(this,"_id",dF++);m(this,"_menuPoi");n&&(this.position=n),e.debug&&console.log(`PolylinePositionEditor creating! ${this.id}`),this.dispose(()=>{e.debug&&console.log(`PolylinePositionEditor destroying! ${this.id}`)});const o=this._menuPoi=this.ad(new rs(e.czmViewer));o.enabled=!1,this.ad(a.track([o,"show"],[e,"enabled"]));{const s=()=>{if(this.position===void 0){o.position=void 0;return}const r=[...this.position];r[2]-=e.czmViewer.editingHeightOffset??0,o.position=r,e.positionsChanged.emit()};s(),this.d(this.positionChanged.don(s))}{const s=()=>{const r=e.editingPoints.indexOf(this)+1;r!==0&&(o.title=`控制点${r}`,r===1?o.imageUri=e.firstControlPointImageUrl??ri.defaults.firstControlPointImageUrl:o.imageUri=e.otherControlPointImageUrl??ri.defaults.otherControlPointImageUrl)};s(),this.dispose(e.editingPoints.changedEvent.disposableOn(s))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get id(){return this._id}get menuPoi(){return this._menuPoi}}class gC extends fC{constructor(i,e){super(i,e)}}class Ye extends ri{constructor(e){super(e);m(this,"_deletePreviousPointWhileAddingEvent",this.disposeVar(new a.Event));m(this,"placeEditing");if(!e.viewer)return;const n=this.placeEditing=this.ad(new Ni(e));n.enabled=!1,this.currentProcess=this.disposeVar(a.createProcessingFromAsyncFunc(async o=>{o.disposer.dispose(()=>{(this.debug??Ye.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),(this.debug??Ye.defaults.debug)&&console.log("直接进入Adding状态"),this.status="Adding",await o.promise(a.step(o,async s=>{const r=s.disposer,l=r.ad(this._addingEditingProcessing());r.dispose(()=>"adding canceled!"),r.dispose(this.cancelEvent.disposableOn(()=>l.cancel())),await s.promise(new Promise(c=>{r.dispose(l.completeEvent.disposableOnce(c))}))}))})),this.dispose(e.clickEvent.don(o=>{var s;((s=o.pointerEvent)==null?void 0:s.button)===2&&this.deletePreviousPointWhileAdding()}))}deletePreviousPointWhileAdding(){this._deletePreviousPointWhileAddingEvent.emit()}resetPositions(e){if(!super.resetPositions(e))return!0;const n=e?e.map(o=>new gC(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...n),!0}_addingEditingProcessing(){const e=()=>{if(this.maxPointsNum!==void 0)return this.editingPoints.length>=this.maxPointsNum&&(this.debug??Ye.defaults.debug)&&console.log("impl.positionEditors.length >= impl.maxPointsNum"),this.editingPoints.length>=this.maxPointsNum},n=a.createProcessingFromAsyncFunc(async o=>{let s=this.editingPoints.length;this.menuPoiEnabled=!1,await o.promise(a.step(o,async l=>{let c;!e()&&(c=l.disposer.disposeVar(new pF(this,s)));const d=l.disposer.disposeVar(new gF(this,s));return l.disposer.dispose(this._deletePreviousPointWhileAddingEvent.disposableOn(()=>d.do())),await l.promise(new Promise(p=>{c&&l.disposer.dispose(c.overEvent.disposableOnce(f=>{f?(s++,p(!0)):p(!1)})),l.disposer.dispose(d.overEvent.disposableOnce(f=>{f?(s--,p(!0)):p(!1)})),l.disposer.dispose(this.cancelEvent.disposableOn(()=>p(!1)))}))}))&&n.restart()});return n.start(),n}}(t=>{t.createDefaultProps=()=>({...ri.createDefaultProps()})})(Ye||(Ye={})),a.extendClassProps(Ye.prototype,Ye.createDefaultProps);class pF extends a.Destroyable{constructor(e,n){super();m(this,"_overEvent",this.disposeVar(new a.Event));const{placeEditing:o}=e;let s=new gC(e,void 0);e.editingPoints.splice(n,0,s);const r=()=>{(e.debug??Ye.defaults.debug)&&console.log("delete currentPosEditor");const u=e.editingPoints.indexOf(s);if(u===-1)throw new Error("currentPosEditor not found");e.editingPoints.splice(u,1)};if(o.enabled??!1)throw console.error("placeEditing.enabled is true!"),new Error("placeEditing.enabled is true!");this.dispose(a.track([s,"position"],[o,"position"])),o.enabled=!0;let l=!1;const c=()=>{r(),this._overEvent.emit(!1)};this.dispose(()=>{o.enabled=!1,!l&&c()}),this.dispose(o.overEvent.disposableOnce(()=>{l=!0,s.position===void 0?c():this._overEvent.emit(!0)})),(e.debug??Ye.defaults.debug)&&console.log(`PointAdding creating! index(${n})`),this.dispose(()=>{(e.debug??Ye.defaults.debug)&&console.log(`PointAdding destroying! index(${n})`)})}get overEvent(){return this._overEvent}}function fF(t,i){const e=t.editingPoints,n=i-1;return n<0?(console.warn("previousIndex < 0, cannot delete the point!"),!1):(e.splice(n,1),!0)}class gF extends a.Destroyable{constructor(e,n){super();m(this,"_overEvent",this.disposeVar(new a.Event));m(this,"_doEvent",this.disposeVar(new a.Event));this.dispose(this._doEvent.disposableOn(()=>this._overEvent.emit(fF(e,n)))),(e.debug??Ye.defaults.debug)&&console.log(`PreviousPointDeleting creating! currentIndex(${n})`),this.dispose(()=>{(e.debug??Ye.defaults.debug)&&console.log(`PreviousPointDeleting destroying! currentIndex(${n})`)})}get overEvent(){return this._overEvent}do(){return this._doEvent.emit()}}class mC extends Ye{constructor(i){super(i),this.loop=!1}}class vC extends Ye{constructor(i){super(i),this.loop=!0}}class Vh extends fC{constructor(i,e){super(i,e);{const{menuPoi:n}=this;n.commands=[["add","增加控制点","",xe.baseImageUrl+"add.png"],["delete","删除当前控制点","",xe.baseImageUrl+"delete.png"],["modify","修改当前控制点","",xe.baseImageUrl+"modify.png"]],n.clickCommandName="modify",n.rightClickCommandName="delete",this.dispose(n.commandEvent.disposableOn(o=>{i.menuPoiCommand(this,o)})),this.dispose(n.dbclickEvent.disposableOn(()=>{i.menuPoiCommand(this,"dbClick")}))}if(i.middlePointShow){const n=this.ad(new _i(i.czmViewer));{n.imageUri=i.firstControlPointImageUrl??xe.defaults.firstControlPointImageUrl,n.tooltip="点击增加一个控制点",n.bgColor=[0,0,0,.6],n.fgColor=[1,1,1,1],n.size=[8,8],n.originRatioAndOffset=[.5,.5,0,0];{const o=()=>{n.enabled=n.show=!1},s=()=>{var g;if(!(i.enabled??xe.defaults.enabled))return o();const r=i.editingPoints.indexOf(this),l=i.editingPoints,c=l.length;if(r===-1||c===0||!(i.loop??xe.defaults.loop)&&r+1>=c)return o();const u=this.position;if(!u)return o();const d=(g=l.get((r+1)%c))==null?void 0:g.position;if(!d)return o();const p=lu(u,d);if(!p)return o();p[2]-=i.czmViewer.editingHeightOffset??0,n.position=p;const f=c<(i.maxPointsNum??xe.defaults.maxPointsNum);n.enabled=n.show=f};s(),this.dispose(i.positionsChanged.disposableOn(s)),this.dispose(i.loopChanged.disposableOn(s)),this.dispose(i.enabledChanged.disposableOn(s))}this.dispose(n.clickEvent.disposableOn(o=>{if(o.button!==0||i.editingPoints.length>=(i.maxPointsNum??xe.defaults.maxPointsNum))return;const s=i.editingPoints.indexOf(this);if(s===-1)return;const r=n.position?[...n.position]:void 0;r&&(r[2]+=i.czmViewer.editingHeightOffset??0);let l=new Vh(i,r);i.editingPoints.splice(s+1,0,l),i.modify(l)}))}}}}class xe extends ri{constructor(e){super(e);m(this,"_menuPoiCommand",this.disposeVar(new a.Event));m(this,"_forceModifyPosEditorEvent",this.disposeVar(new a.Event));m(this,"_overEvent",this.disposeVar(new a.Event));m(this,"translationEditing");{const s=this.ad(a.createNextAnimateFrameEvent(this.moveWithFirstPositionChanged,this.editingPoints.changedEvent));this.ad(new a.ObjResettingWithEvent(s,()=>{if(!(!this.moveWithFirstPosition||this.editingPoints.length<=1))return new mF(this.editingPoints.get(0),this)}))}const n=this.translationEditing=this.disposeVar(new on(e));n.enabled=!1;const o=async(s,r)=>{if((this.debug??xe.defaults.debug)&&console.log("进入Modifying修改状态"),this.status="Modifying",r=await s.promise(a.step(s,async l=>{const c=l.disposer,u=c.ad(new vF(this));return c.dispose(()=>"modifying canceled!"),this.editingPoints.length>0&&u.modify(this.editingPoints.get(r===-1||r>=this.editingPoints.length?0:r)),c.dispose(this.cancelEvent.disposableOn(()=>u.cancel())),c.dispose(this._forceModifyPosEditorEvent.disposableOn(p=>u.modify(p))),await l.promise(new Promise(p=>{c.dispose(u.overEvent.disposableOnce(f=>{p(f)}))}))})),r===-1)(this.debug??xe.defaults.debug)&&console.log("退出编辑状态");else{if(this.editingPoints.length>=(this.maxPointsNum??xe.defaults.maxPointsNum))return;if(this.editingPoints.length===0){console.error("impl.positionEditors.length === 0!");return}this.loop??xe.defaults.loop;const c=this.editingPoints.get(r-1).position;if(!c)return;let u=r%this.editingPoints.length;const p=this.editingPoints.get(u).position;if(!p)return;const f=lu(c,p);if(!f)return;f&&(f[2]+=this.czmViewer.editingHeightOffset??0);let g=new Vh(this,f);this.editingPoints.splice(r,0,g),await o(s,r)}};this.currentProcess=this.disposeVar(a.createProcessingFromAsyncFunc(async s=>{s.disposer.dispose(()=>{(this.debug??xe.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),await o(s,-1),this.status="None",this.enabled=!1}))}menuPoiCommand(e,n){this._menuPoiCommand.emit(e,n)}modify(e){this._forceModifyPosEditorEvent.emit(e)}resetPositions(e){if(!super.resetPositions(e))return!0;const n=e?e.map(o=>new Vh(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...n),!0}get overEvent(){return this._overEvent}}(t=>{t.createDefaultProps=()=>({...ri.createDefaultProps(),moveWithFirstPosition:!1})})(xe||(xe={})),a.extendClassProps(xe.prototype,xe.createDefaultProps);class mF extends a.Destroyable{constructor(i,e){super(),this._firstPositionEditor=i,this.multiPointsModifyEditing=e,this._firstPositionEditor.positionChanged.disposableOn((n,o)=>{if(n===void 0||o===void 0)return;var s=[n[0]-o[0],n[1]-o[1],n[2]-o[2]];const r=this.multiPointsModifyEditing.editingPoints.length;for(let l=1;l<r;l++){const c=this.multiPointsModifyEditing.editingPoints.get(l),u=c.position;u!==void 0&&(c.position=[u[0]+s[0],u[1]+s[1],u[2]+s[2]])}})}}class vF extends a.Destroyable{constructor(e){super();m(this,"_overEvent",this.disposeVar(new a.Event));m(this,"_cancelEvent",this.disposeVar(new a.Event));m(this,"_forceModifyPosEditorEvent",this.disposeVar(new a.Event));e.menuPoiEnabled=!0,this.dispose(()=>e.menuPoiEnabled=!1);let n;const o=()=>{n==null||n.destroy(),n=void 0,e.status="Modifying"};this.dispose(o);const s=r=>{o(),e.status="Modifying_Point",n=new yF(e,r),n.dispose(n.overEvent.disposableOn(()=>{o()}))};this.dispose(this._forceModifyPosEditorEvent.disposableOn(s)),this.dispose(e._menuPoiCommand.disposableOn((r,l)=>{if(l==="delete"){if(e.editingPoints.length<=2)return;const c=e.editingPoints.indexOf(r);if(c===-1)throw console.error("posEditor not found"),new Error("posEditor not found");e.editingPoints.splice(c,1)}else if(l==="modify")s(r);else if(l==="add"){const c=e.editingPoints.indexOf(r);if(c===-1)throw console.error("posEditor not found"),new Error("posEditor not found");this._overEvent.emit(c+1)}else l==="dbClick"?this._overEvent.emit(-1):alert(`未知的commandName(${l})`)})),this.dispose(this._cancelEvent.disposableOn(()=>{this._overEvent.emit(-1)}))}get overEvent(){return this._overEvent}cancel(){this._cancelEvent.emit()}modify(e){this._forceModifyPosEditorEvent.emit(e)}}class yF extends a.Destroyable{constructor(e,n){super();m(this,"_overEvent",this.disposeVar(new a.Event));this._modifying=e,this._posEditor=n,this.dispose(this._posEditor.toDestroyEvent.disposableOn(()=>{this._overEvent.emit()}));const{translationEditing:o}=this._modifying;if(o.enabled=!0,o.heading=0,this.dispose(()=>{o.enabled=!1}),!this._posEditor.position)throw console.error("!this._posEditor.position"),new Error("!this._posEditor.position");o.position=this._posEditor.position,this.dispose(a.track([this._posEditor,"position"],[o,"position"])),this.dispose(o.enabledChanged.disposableOnce(s=>{s||this._overEvent.emit()}))}get overEvent(){return this._overEvent}}class yC extends xe{constructor(i){super(i),this.loop=!1}}class wC extends xe{constructor(i){super(i),this.loop=!0}}class ir extends Ye{init(){const i=this.startPosition;if(!i)return;const e=this.distance,n=this.rotation,o=e*Math.cos(n[1]*Math.PI/180),s=a.geoDestination(i,o,n[0]);if(!s){this.positions=[i];return}const r=e*Math.sin(n[1]*Math.PI/180);s[2]+=r,this.positions=[i,s],this.editingPoints.length==2&&(this.editingPoints.get(0).position=i,this.editingPoints.get(1).position=s)}constructor(i){super(i),this.loop=!0,this.maxPointsNum=2;{const e=()=>{if(!this.positions||this.positions.length==0){this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];return}if(this.positions.length==1){this.distance=1,this.rotation=[90,0,0];return}this.startPosition=this.positions[0],this.endPosition=this.positions[1];const n=a.geoHeading(this.startPosition,this.endPosition),o=a.geoDistance(this.startPosition,this.endPosition);if(o<=0){this.rotation=[90,0,0],this.distance=1;return}const s=this.endPosition[2]-this.startPosition[2],r=Math.atan(s/o)*180/Math.PI,l=Math.sqrt(o*o+s*s);this.rotation=[n,r,0],this.distance=l};e(),this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Ye.createDefaultProps(),startPosition:a.reactArrayWithUndefined(void 0),endPosition:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([90,0,0]),distance:a.react(1)})})(ir||(ir={})),a.extendClassProps(ir.prototype,ir.createDefaultProps);class Bo extends xe{init(){const i=this.startPosition;if(!i)return;const e=this.distance,n=this.rotation,o=e*Math.cos(n[1]*Math.PI/180),s=a.geoDestination(i,o,n[0]);if(!s){this.positions=[i];return}const r=e*Math.sin(n[1]*Math.PI/180);s[2]+=r,this.positions=[i,s],this.editingPoints.length==2&&(this.editingPoints.get(0).position=i,this.editingPoints.get(1).position=s)}constructor(i){super(i),this.loop=!0,this.maxPointsNum=2,this.middlePointShow=!1,this.moveWithFirstPosition=!0;{const e=()=>{var l;if(!((l=this.positions)!=null&&l.length))return this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];if(this.startPosition=this.positions[0],this.positions.length==1)return this.editingPoints.get(0).menuPoi.commands=[["add","增加控制点","",xe.baseImageUrl+"add.png"],["delete","删除当前控制点","",xe.baseImageUrl+"delete.png"],["modify","修改当前控制点","",xe.baseImageUrl+"modify.png"]],this.rotation=[90,0,0],this.distance=1;this.endPosition=this.positions[1];for(let c of this.editingPoints)c.menuPoi.commands=[["delete","删除当前控制点","",xe.baseImageUrl+"delete.png"],["modify","修改当前控制点","",xe.baseImageUrl+"modify.png"]];const n=a.geoDistance(this.startPosition,this.endPosition);if(Math.abs(n)<=0)return this.rotation=[90,0,0],this.distance=1;const o=a.geoHeading(this.startPosition,this.endPosition),s=this.endPosition[2]-this.startPosition[2],r=Math.atan(s/n)*180/Math.PI;this.rotation=[o,r,0],this.distance=Math.hypot(n,s)};this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...xe.createDefaultProps(),startPosition:a.reactArrayWithUndefined(void 0),endPosition:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),distance:a.react(0)})})(Bo||(Bo={})),a.extendClassProps(Bo.prototype,Bo.createDefaultProps);class CC extends Ye{constructor(i){super(i),this.loop=!1,this.polylineShow=!1}}class _C extends xe{constructor(i){super(i),this.loop=!1,this.polylineShow=!1,this.middlePointShow=!1}}class nr extends Ye{constructor(i){super(i),i.viewer||(this.loop=!1);{const e=()=>{if(!this.positions||this.positions.length<2){this.visibilityPositions=void 0;return}const n=[...this.positions[0]];n[2]-=i.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=i.editingHeightOffset??0,[n,o]))};e(),this.ad(this.positionsChanged.don(e))}}createPolyline(i){const e=this.ad(new pi(i));e.topOrBottom="bottom",this.ad(a.track([e,"color"],[this,"polylineColor"])),this.ad(a.track([e,"width"],[this,"polylineWidth"])),this.ad(a.track([e,"show"],[this,"polylineShow"])),this.ad(a.track([e,"arcType"],[this,"polylineArcType"])),this.ad(a.track([e,"loop"],[this,"loop"])),this.ad(a.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Ye.createDefaultProps(),visibilityPositions:a.reactPositionsSet(void 0)})})(nr||(nr={})),a.extendClassProps(nr.prototype,nr.createDefaultProps);class or extends xe{constructor(i){if(super(i),!!i.viewer){this.loop=!1,this.middlePointShow=!1;{const e=()=>{if(!this.positions||this.positions.length<2)return;const n=[...this.positions[0]];n[2]-=i.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=i.editingHeightOffset??0,[n,o]))};e(),this.ad(this.positionsChanged.don(e))}}}createPolyline(i){const e=this.ad(new pi(i));e.topOrBottom="bottom",this.ad(a.track([e,"color"],[this,"polylineColor"])),this.ad(a.track([e,"width"],[this,"polylineWidth"])),this.ad(a.track([e,"show"],[this,"polylineShow"])),this.ad(a.track([e,"arcType"],[this,"polylineArcType"])),this.ad(a.track([e,"loop"],[this,"loop"])),this.ad(a.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...xe.createDefaultProps(),visibilityPositions:a.reactPositionsSet(void 0)})})(or||(or={})),a.extendClassProps(or.prototype,or.createDefaultProps);class PC extends Bo{constructor(i){super(i),this.firstControlPointImageUrl=this.otherControlPointImageUrl,this.translationEditing.xAxisShow=!1,this.translationEditing.yAxisShow=!1,this.translationEditing.zAxisShow=!0,this.translationEditing.showCircle=!1,this.rotation=[0,90,0]}}class Pt extends a.EngineObject{constructor(e,n,o){super(e,n,o??!0);m(this,"_currentEditing",this.disposeVar(a.react(void 0)));this.ad(this.toDestroyEvent.don(()=>{var s;if(this.currentEditing)if(this.currentEditing instanceof Ye&&((s=this.currentEditing.currentProcess)!=null&&s.isRunning))if(this.currentEditing.currentProcess.cancel(),e!=null&&e.position){if(this.currentEditing.positions.length>1)return;e.position=this.currentEditing.positions[0]??[0,0,0],e!=null&&e.rotation&&(e.rotation=[0,0,0]),e!=null&&e.far&&(e.far=1),e!=null&&e.radius&&(e.radius=1),e!=null&&e.distance&&(e.distance=1)}else e.points=this.currentEditing.positions;else this.currentEditing instanceof Ni&&this.currentEditing.enabled&&(e.position=[0,0,0])}))}get currentEditing(){return this._currentEditing.value}set currentEditing(e){this._currentEditing.value=e}get currentEditingChanged(){return this._currentEditing.changed}}const kl=class kl extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new Ni(e));if(this.ad(e.clickEvent.don(o=>{var s;((s=o.pointerEvent)==null?void 0:s.button)==2&&(n.enabled=!0)})),Reflect.has(i,"position")){const o=i;this.ad(a.bind([n,"position"],[o,"position"])),n.enabled=!n.position||a.equalsN3(n.position,[0,0,0])}else throw new Error(`PlaceEditingWrapper:${i.typeName} 坐标属性无法绑定位置编辑`)}};m(kl,"type",kl.registerEditing("ESCesiumViewer",a.ESJEditingMode.Place,kl));let ag=kl;const Kl=class Kl extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new yi(e));if(n.rotation=[90,0,0],this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),i instanceof a.ES3DTileset)a.registerCreatedEventUpdate(this,i,()=>{const o=e.getEngineObject(i);o&&(this.ad(a.bind([n,"position"],[o.czm3DTiles,"position"])),this.ad(a.bind([n,"selfRotation"],[i,"rotation"])))});else if(Reflect.has(i,"position")&&Reflect.has(i,"rotation")){const o=i;this.ad(a.bind([n,"position"],[o,"position"])),this.ad(a.bind([n,"selfRotation"],[o,"rotation"]))}else throw new Error(`RotationEditingWrapper:${i.typeName} 旋转属性无法绑定旋转编辑`)}};m(Kl,"type",Kl.registerEditing("ESCesiumViewer",a.ESJEditingMode.Rotation,Kl));let lg=Kl;const Jl=class Jl extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new sn(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"position")&&Reflect.has(i,"scale")){const o=i;this.ad(a.bind([n,"position"],[o,"position"])),this.ad(a.bind([n,"scale"],[o,"scale"]))}else throw new Error(`ScaleEditingWrapper:${i.typeName} 缩放属性无法绑定缩放编辑`)}};m(Jl,"type",Jl.registerEditing("ESCesiumViewer",a.ESJEditingMode.Scale,Jl));let cg=Jl;const jl=class jl extends Pt{constructor(i,e){super(Array.isArray(i)?i[0]:i,e,!0);const n=this.currentEditing=this.ad(new on(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Array.isArray(i)){const o=[];for(let s=0;s<i.length;s++){const r=i[s];Reflect.has(r,"position")?o.push(r.position):r.points&&o.push(...r.points)}n.position=a.getMinMaxCorner(o).center,this.ad(n.positionChanged.disposableOn((s,r)=>{if(!(!s||!r)){var l=Dt({originPosition:r},[s])[0][0];i.forEach(c=>{const u=c;if(Reflect.has(c,"position")){const d=Dt({originPosition:r},[u.position])[0][0];u.position=yn({originPosition:r},[[d[0]+l[0],d[1]+l[1],d[2]+l[2]]])[0][0]}else if(Reflect.has(u,"points")&&u.points){const d=Dt({originPosition:r},u.points)[0];u.points=yn({originPosition:r},d.map(p=>[p[0]+l[0],p[1]+l[1],p[2]+l[2]]))[0]}})}}))}else if(Reflect.has(i,"position"))this.ad(a.bind([n,"position"],[i,"position"]));else if(i instanceof a.ES3DTileset)a.registerCreatedEventUpdate(this,i,()=>{const o=e.getEngineObject(i);this.ad(a.bind([n,"position"],[o.czm3DTiles,"position"]))});else if(Reflect.has(i,"points")){const o=i;if(o.points===void 0||o.points.length===0){this.destroy();return}n.position=a.getMinMaxCorner(o.points).center,this.ad(n.positionChanged.disposableOn((s,r)=>{if(s===void 0||r===void 0||o.points===void 0||o.points.length===0){this.destroy();return}var l=Dt({originPosition:r},[s])[0][0];const c=Dt({originPosition:r},o.points)[0];o.points=yn({originPosition:r},c.map(u=>[u[0]+l[0],u[1]+l[1],u[2]+l[2]]))[0]}))}else throw new Error(`TranslationEditingWrapper:${i.typeName} 坐标属性无法绑定平移编辑`)}};m(jl,"type",jl.registerEditing("ESCesiumViewer",a.ESJEditingMode.Translation,jl));let Uh=jl;const ec=class ec extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new ir(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"position")){const o=i;if(this.ad(a.bind([n,"startPosition"],[o,"position"])),this.ad(Je([n,"rotation"],[o,"rotation"])),Reflect.has(o,"far"))this.ad(a.bind([n,"distance"],[o,"far"]));else if(Reflect.has(o,"radius"))this.ad(a.bind([n,"distance"],[o,"radius"]));else if(Reflect.has(o,"distance"))this.ad(a.bind([n,"distance"],[o,"distance"]));else{const s=Ie(o.position);if(h.Cartesian3.ZERO.equals(s)||!e.viewer)return;n.distance=Wi(e.viewer.scene,s,100)??1}}else if(Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`DoublePointsAppendEditingWrapper:${i.typeName} 坐标属性无法绑定双点追加编辑`);n.startPosition&&!a.equalsN3(n.startPosition,[0,0,0])&&n.init(),n.enabled=!0}};m(ec,"type",ec.registerEditing("ESCesiumViewer",a.ESJEditingMode.DoublePointsAppend,ec));let hg=ec;const tc=class tc extends Pt{constructor(i,e){if(super(i,e,!0),!e.viewer)return;const n=this.currentEditing=this.ad(new Bo(e));if(Reflect.has(i,"position")){const s=i;if(this.ad(a.bind([n,"startPosition"],[s,"position"])),this.ad(Je([n,"rotation"],[s,"rotation"])),Reflect.has(s,"far"))this.ad(a.bind([n,"distance"],[s,"far"]));else if(Reflect.has(s,"radius"))this.ad(a.bind([n,"distance"],[s,"radius"]));else if(Reflect.has(s,"distance"))this.ad(a.bind([n,"distance"],[s,"distance"]));else{const r=Ie(s.position);if(h.Cartesian3.ZERO.equals(r)||!e.viewer)return;n.distance=Wi(e.viewer.scene,r,100)??1}}else if(Reflect.has(i,"points")){const s=i;if(s.points.length!=2)throw new Error(`DoublePointsModifyEditingWrapper:${i.typeName} 坐标属性无法绑定双点修改编辑`);n.moveWithFirstPosition=!1;const r=()=>n.positions=s.points??[];r(),this.ad(s.pointsChanged.don(()=>!n.enabled&&r())),this.ad(a.track([s,"points"],[n,"positions"]))}else throw new Error(`DoublePointsModifyEditingWrapper:${i.typeName} 坐标属性无法绑定双点修改编辑`);n.init(),n.enabled=!0;const o=this.ad(a.createNextAnimateFrameEvent(n.enabledChanged,n.startPositionChanged));this.ad(o.don(()=>{(!n.enabled||!n.startPosition||a.equalsN3(n.startPosition,[0,0,0]))&&this.destroy()}))}};m(tc,"type",tc.registerEditing("ESCesiumViewer",a.ESJEditingMode.DoublePointsModify,tc));let ug=tc;const ic=class ic extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new vC(e));this.ad(n.enabledChanged.don(s=>{!s&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))}));const o=i;if(Reflect.has(o,"points")){const s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`CircularAppendEditingWrapper:${o.typeName} 坐标属性无法绑定环形追加编辑`)}};m(ic,"type",ic.registerEditing("ESCesiumViewer",a.ESJEditingMode.CircularAppend,ic));let dg=ic;const nc=class nc extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new wC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`CircularInsertEditingWrapper:${i.typeName} 坐标属性无法绑定环形插值编辑`)}};m(nc,"type",nc.registerEditing("ESCesiumViewer",a.ESJEditingMode.CircularInsert,nc));let pg=nc;const oc=class oc extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new mC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`LineStringAppendEditingWrapper:${i.typeName} 坐标属性无法绑定线段追加编辑`)}};m(oc,"type",oc.registerEditing("ESCesiumViewer",a.ESJEditingMode.LineStringAppend,oc));let fg=oc;const sc=class sc extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new yC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`LineStringInsertEditingWrapper:${i.typeName} 坐标属性无法绑定线段插入编辑`)}};m(sc,"type",sc.registerEditing("ESCesiumViewer",a.ESJEditingMode.LineStringInsert,sc));let gg=sc;const rc=class rc extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new CC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`ScatterAppendEditingWrapper:${i.typeName} 坐标属性无法绑定散点追加编辑`)}};m(rc,"type",rc.registerEditing("ESCesiumViewer",a.ESJEditingMode.ScatterAppend,rc));let mg=rc;const ac=class ac extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new _C(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`ScatterModifyEditingWrapper:${i.typeName} 坐标属性无法绑定散点修改编辑`)}};m(ac,"type",ac.registerEditing("ESCesiumViewer",a.ESJEditingMode.ScatterModify,ac));let vg=ac;const lc=class lc extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new nr(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`VisibilityAppendEditingWrapper:${i.typeName} 坐标属性无法绑定可见性追加编辑`)}};m(lc,"type",lc.registerEditing("ESCesiumViewer",a.ESJEditingMode.VisibilityAppend,lc));let yg=lc;const cc=class cc extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new or(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`VisibilityModifyEditingWrapper:${i.typeName} 坐标属性无法绑定可见性修改编辑`)}};m(cc,"type",cc.registerEditing("ESCesiumViewer",a.ESJEditingMode.VisibilityModify,cc));let wg=cc;const hc=class hc extends Pt{constructor(i,e){if(super(i,e,!0),!e.viewer)return;const n=this.currentEditing=this.ad(new PC(e));if(Reflect.has(i,"points")){const s=i,r=Reflect.has(s,"extrudedHeight"),l=Reflect.has(s,"height"),c=Reflect.has(s,"perPositionHeight")?s.perPositionHeight:!r,u=s instanceof a.ESClassification||s instanceof a.ESPolygonFence;let d=a.getMinMaxCorner(s.points).center,p=[...d],f=u?s.points[0][2]:0;c?r?p[2]=s.extrudedHeight:p[2]=s.height+f:(l&&(d[2]=s.height),r&&(p[2]=s.extrudedHeight)),n.startPosition=d,n.distance=p[2]-d[2],n.moveWithFirstPosition=!1;let g=[...d];this.ad(n.positionsChanged.don(()=>{n.positions.length===2&&(c?(s.points=s.points.map(v=>[v[0],v[1],v[2]+n.positions[0][2]-g[2]]),r?s.extrudedHeight=n.positions[1][2]:l&&(s.height=n.positions[1][2]-(u?n.positions[0][2]:0))):(l&&(s.height=n.positions[0][2]),r&&(s.extrudedHeight=n.positions[1][2])),g=[...n.positions[0]])}))}else throw new Error(`HeightModifyEditingWrapper:${i.typeName} 坐标属性无法绑定高度修改编辑`);n.init(),n.enabled=!0;const o=this.ad(a.createNextAnimateFrameEvent(n.enabledChanged,n.startPositionChanged));this.ad(o.don(()=>{(!n.enabled||!n.startPosition||a.equalsN3(n.startPosition,[0,0,0]))&&this.destroy()}))}};m(hc,"type",hc.registerEditing("ESCesiumViewer",a.ESJEditingMode.HeightModify,hc));let Cg=hc;const rt=class rt extends a.Destroyable{constructor(e,n,o,s=!0){super();m(this,"czmViewer");m(this,"sceneObject");m(this,"editingModes",[]);m(this,"editingID");m(this,"useKeyToSwitch");m(this,"currentIndex",0);m(this,"currentEditingMode");m(this,"currentEditingWrapper");m(this,"_notSupportedEditCount",this.disposeVar(a.react(0)));m(this,"_onEditEnd",()=>{this._cleanupCurrentWrapper(),this.notSupportedEditCount<this.editingModes.length&&a.nextAnimateFrame(()=>this._createEditingMode(this.currentIndex+1))});this.czmViewer=e,this.sceneObject=n;const r=(Array.isArray(o)?o:[o]).filter(l=>n.supportEditingModes().includes(l));if(this.editingModes=r,this.editingID=n.editingID,this.useKeyToSwitch=s,this.editingModes.length)console.log("[ESEditMode] 可用的编辑模式",r);else{console.warn("[ESEditMode] 无可用的编辑模式");return}this._bindEvents(),this._createEditingMode(this.currentIndex),this._emitEditingEvent("start",{modes:this.editingModes})}get notSupportedEditCount(){return this._notSupportedEditCount.value}set notSupportedEditCount(e){this._notSupportedEditCount.value=e}get notSupportedEditCountChanged(){return this._notSupportedEditCount.changed}_emitEditingEvent(e,n){this.czmViewer.editingEvent.emit({objectIDs:[this.sceneObject.parentID],editingID:this.editingID,type:e,add:n})}_bindEvents(){this.ad(this.sceneObject.toDestroyEvent.don(rt.stop)),this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===rt.KEY_ESCAPE&&rt.stop())),this.ad(this.czmViewer.dblclickEvent.don(e=>{var n;return((n=e.pointerEvent)==null?void 0:n.button)===rt.MOUSE_LEFT&&a.nextAnimateFrame(()=>{rt.stop()})})),this.useKeyToSwitch&&this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===rt.KEY_SPACE&&this._onEditEnd())),this.ad(()=>this._cleanupCurrentWrapper()),this.ad(this.notSupportedEditCountChanged.don(()=>{this.notSupportedEditCount>=this.editingModes.length&&rt.stop()}))}_cleanupCurrentWrapper(){this.currentEditingWrapper&&!this.currentEditingWrapper.isDestroyed()&&this.currentEditingWrapper.destroy(),this.currentEditingWrapper=void 0}_createEditingMode(e){if(this.editingModes.length){e>=this.editingModes.length&&(e=0),this.currentIndex=e,this.currentEditingMode=this.editingModes[e];try{const n=a.EngineObject.contextEditing.getEngineObjConstructor(this.currentEditingMode,this.czmViewer.typeName);if(!n){this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd();return}this.currentEditingWrapper=new n(this.sceneObject,this.czmViewer),this._emitEditingEvent("changed",{cMode:this.currentEditingMode,cIndex:e}),this.notSupportedEditCount=0}catch(n){this.notSupportedEditCount++,console.error(`[ESEditMode] 创建编辑模式${this.currentEditingMode}失败`,n),this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd()}}}static create(e,n,o,s=!0){rt.stop(),rt.esEditModeInstance=new rt(e,n,o,s)}static stop(){const e=rt.esEditModeInstance;if(e&&!e.isDestroyed()){const{czmViewer:n,sceneObject:o,editingID:s,editingModes:r}=e;e.destroy(),n.editingEvent.emit({objectIDs:[o.parentID],editingID:s,type:"end",add:{modes:r}})}rt.esEditModeInstance=void 0}};m(rt,"KEY_ESCAPE","Escape"),m(rt,"KEY_SPACE","Space"),m(rt,"MOUSE_LEFT",0),m(rt,"esEditModeInstance");let Wh=rt;function bC(){const t=a.createProcessingFromAsyncFunc(async(i,e,n,o)=>{e.editingEvent.emit({objectIDs:n.map(c=>c.parentID),editingID:o,type:"start"});const s=()=>{e.editingEvent.emit({objectIDs:n.map(c=>c.parentID),editingID:o,type:"end"}),t.isRunning&&t.cancel()};i.disposer.ad(s);const r=c=>{c.code=="Escape"&&s()};i.disposer.ad(e.keyDownEvent.don(r));const l=new Uh(n,e);i.disposer.ad(()=>{!l.isDestroyed()&&l.destroy()}),await i.promise(new Promise(c=>{l.isDestroyed()&&c(),i.disposer.ad(l.toDestroyEvent.don(()=>{console.log("移动结束"),c()})),i.disposer.ad(e.dblclickEvent.don(()=>c()))}))});return t}class wF extends a.Destroyable{constructor(i,e){super(),this._czmViewer=i,a.registerCreatedEventUpdate(this,e,()=>{let n;const o=i.getEngineObject(e);e instanceof a.ESBoxClipping&&(n=o.czmBoxClippingPlanes),!(!n||!("computedClippingPlanes"in n)||!("computedClippingPlanesChanged"in n))&&(this.dispose(a.track([this._czmViewer,"sceneGlobeClippingPlanes"],[n,"computedClippingPlanes"])),this.dispose(()=>this._czmViewer.sceneGlobeClippingPlanes=void 0))})}}class CF extends a.Destroyable{constructor(e){super();m(this,"_clippingPlanesSceneObjectWithId",this.disposeVar(new a.ESSceneObjectWithId));this.dispose(a.track([this._clippingPlanesSceneObjectWithId,"id"],[e,"sceneGlobeClippingPlanesId"])),this.disposeVar(new a.ObjResettingWithEvent(this._clippingPlanesSceneObjectWithId.sceneObjectChanged,()=>{const{sceneObject:n}=this._clippingPlanesSceneObjectWithId;if(n)return new wF(e,n)}))}}class _F extends a.Destroyable{constructor(i){super(),this.dv(new a.ObjResettingWithEvent(i.sceneGlobeClippingPolygonsIdChanged,(e,n)=>{if(!(!e||e===n||e&&e.length===0))return new PF(i)}))}}class PF extends a.Destroyable{constructor(i){super(),this._czmViewer=i,this.d(()=>this._czmViewer.sceneGlobeClippingPolygons=void 0);const e=this._czmViewer.sceneGlobeClippingPolygonsId,n=o=>{if(!o)return;const s=this.dv(a.createNextAnimateFrameEvent(o.positionsChanged,o.reverseChanged,o.enabledChanged,o.showHelperChanged));this.dv(new a.ObjResettingWithEvent(s,()=>{if(o)return new bF(i,o)}))};for(let o=0;o<e.length;o++){const s=e[o],r=a.ESSceneObject.getSceneObjById(s);if(!r)return;let l;r instanceof a.ESExcavate?a.registerCreatedEventUpdate(this,r,()=>{l=i.getEngineObject(r).czmPolygonClipping,n(l)}):r instanceof a.ESHole&&a.registerCreatedEventUpdate(this,r.excavate,()=>{l=i.getEngineObject(r.excavate).czmPolygonClipping,n(l)})}}}class bF extends a.Destroyable{constructor(i,e){super(),this._czmViewer=i;const n=this._czmViewer.sceneGlobeClippingPolygonsId,o=e.enabled?e.reverse:void 0;if(n&&n.length>0){const s={polygons:[],enabled:!0,inverse:!1};for(let r=0;r<n.length;r++){const l=n[r],c=a.ESSceneObject.getSceneObjById(l);if(!c)return;let u;if(c instanceof a.ESExcavate?u=i.getEngineObject(c).czmPolygonClipping:c instanceof a.ESHole&&(u=i.getEngineObject(c.excavate).czmPolygonClipping),!u)return;u&&u.positions&&u.positions.length>=3&&u.enabled&&(s.polygons[r]={positions:u.positions},s.inverse=o??u.reverse)}this._czmViewer.sceneGlobeClippingPolygons=s}}}class SF extends a.Destroyable{constructor(i,e){var r;super(),this._viewer=i;const n=(r=this._viewer.extensions)==null?void 0:r.pickingManager;if(!n)return;const{objectsToExclude:o}=n,s=Array.isArray(e)?[...e]:[e];for(const l of s){if(o.includes(l))throw new Error("objectsToExclude.includes(p)");o.push(l)}this.dispose(()=>{for(let l of s){const c=o.indexOf(l);if(c===-1)throw new Error("-1 === objectsToExclude.indexOf(p)");o.splice(c,1)}})}}class EF extends a.Destroyable{constructor(e){var r;super();m(this,"_czmGlobeMaterial");this._czmViewer=e,this._czmGlobeMaterial=this.dv(new _o(e)),this._czmGlobeMaterial.show=!0;let n=Object.assign({},Re.defaults.terrainShader,this._czmViewer.terrainShader),o=(r=this._czmViewer.viewer)==null?void 0:r.scene.preUpdate.addEventListener(()=>{var c;const l=n.elevationContour.show&&(((c=this._czmViewer.getCameraInfo())==null?void 0:c.position[2])??0)<=n.elevationContour.spacing*1e3;this._czmGlobeMaterial.enableContour!==l&&(this._czmGlobeMaterial.enableContour=l)});this.d(()=>{o&&o()});const s=()=>{n=Object.assign({},Re.defaults.terrainShader,this._czmViewer.terrainShader),this._czmGlobeMaterial.shadingMode="none",n.aspect.show&&(this._czmGlobeMaterial.shadingMode="aspect"),n.slope.show&&(this._czmGlobeMaterial.shadingMode="slope"),n.elevationRamp.show&&(this._czmGlobeMaterial.shadingMode="elevation"),this._czmGlobeMaterial.contourSpacing=n.elevationContour.spacing,this._czmGlobeMaterial.contourWidth=n.elevationContour.width,this._czmGlobeMaterial.contourColor=n.elevationContour.color,this._czmGlobeMaterial.elevationParam={minHeight:n.elevationRamp.minHeight,maxHeight:n.elevationRamp.maxHeight,color:n.elevationRamp.color}};s(),this.d(this._czmViewer.terrainShaderChanged.don(s))}get czmGlobeMaterial(){return this._czmGlobeMaterial}}async function xF(t,i){const e={animation:!1,baseLayerPicker:!1,fullscreenButton:!1,geocoder:!1,homeButton:!1,infoBox:!1,sceneModePicker:!1,selectionIndicator:!1,timeline:!1,navigationHelpButton:!1,navigationInstructionsInitiallyVisible:!1,scene3DOnly:!0,...i??{}},n=new h.Viewer(t,e);return n.imageryLayers.removeAll(),n.extend(h.viewerCesiumInspectorMixin),n.cesiumInspector.container.style.display="none",n.extend(h.viewerCesium3DTilesInspectorMixin),n.cesium3DTilesInspector.container.style.display="none",n.cesium3DTilesInspector.viewModel.picking=!1,n.clock.currentTime=h.JulianDate.fromDate(new Date("2022-04-19T20:00:53.10067292911116965Z")),n.scene.screenSpaceCameraController.lookEventTypes=[{eventType:h.CameraEventType.RIGHT_DRAG}],n.scene.screenSpaceCameraController.zoomEventTypes=[h.CameraEventType.WHEEL,h.CameraEventType.PINCH,{eventType:h.CameraEventType.RIGHT_DRAG,modifier:h.KeyboardEventModifier.SHIFT}],n.scene.screenSpaceCameraController.tiltEventTypes=[h.CameraEventType.MIDDLE_DRAG,h.CameraEventType.PINCH,{eventType:h.CameraEventType.LEFT_DRAG,modifier:h.KeyboardEventModifier.CTRL},{eventType:h.CameraEventType.RIGHT_DRAG,modifier:h.KeyboardEventModifier.CTRL}],n.screenSpaceEventHandler.removeInputAction(h.ScreenSpaceEventType.LEFT_CLICK),n.screenSpaceEventHandler.removeInputAction(h.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),n._cesiumWidget._creditContainer.style.display="none",n}function AF(){h.Cesium3DTile.prototype.updateTransform=function(t,i){t=t??h.Matrix4.IDENTITY;const e=h.Matrix4.multiplyTransformation(t,this.transform,new h.Matrix4),n=!h.Matrix4.equals(e,this.computedTransform),o=h.defined(i)&&(this._verticalExaggeration!==i.verticalExaggeration||this._verticalExaggerationRelativeHeight!==i.verticalExaggerationRelativeHeight);if(!n&&!o)return;n&&h.Matrix4.clone(e,this.computedTransform),o&&(this._verticalExaggeration=i.verticalExaggeration,this._verticalExaggerationRelativeHeight=i.verticalExaggerationRelativeHeight);const s=this._header,r=this._contentHeader;this._boundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform),h.defined(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform)),h.defined(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(s.viewerRequestVolume,this.computedTransform)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()}}function TF(){Reflect.getOwnPropertyDescriptor(h.Camera.prototype,"_currentFlight")||Object.defineProperties(h.Camera.prototype,{_currentFlight:{get:function(){return this._vtxf_currentFlight},set:function(t){if(this._vtxf_currentFlight!==t){this._vtxf_currentFlight=t;var i=this._vtxf_currentFlight,e=t;this.currentFlightEvent.raiseEvent(e,i)}}},currentFlightEvent:{get:function(){return typeof this._vtxf_currentFlightEvent>"u"&&(this._vtxf_currentFlightEvent=new h.Event),this._vtxf_currentFlightEvent}}})}function MF(){const t=new h.Matrix4;function i(n,o){const s=n.positionWC;h.Matrix4.clone(n.transform,t),n.lookAtTransform(h.Matrix4.IDENTITY),n.look(s,o),n.lookAtTransform(t)}const e=Math.PI/60;h.Camera.prototype.lookLeft=function(n){n=n??e,this._mode!==h.SceneMode.SCENE2D&&i(this,-n)},h.Camera.prototype.lookRight=function(n){this.lookLeft(-n)}}function IF(){if(!h.DepthPlane.xbsjFixed){h.DepthPlane.xbsjFixed=!0;var t=h.DepthPlane.prototype.update;h.DepthPlane.prototype.update=function(){t.bind(this)(...arguments);var i=arguments[0];if(!this.hasXbsjIndexBuffer&&this._va){this.hasXbsjIndexBuffer=!0;var e=i.context,n=new h.Geometry({attributes:{position:new h.GeometryAttribute({componentDatatype:h.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(15)})},indices:[0,1,4,1,3,4,3,2,4,2,0,4],primitiveType:h.PrimitiveType.TRIANGLES});this._va=h.VertexArray.fromGeometry({context:e,geometry:n,attributeLocations:{position:0},bufferUsage:h.BufferUsage.DYNAMIC_DRAW}),this._command.vertexArray=this._va}}}}function DF(t){const i=t.BoundingSphere,e=t.Cartesian3,n=t.defined,o=t.OrientedBoundingBox,s=t.Rectangle,r=t.TaskProcessor,l=t.TerrainData,c=t.TerrainEncoding,u=t.TerrainMesh,d=t.GoogleEarthEnterpriseTerrainData,p="createVerticesFromGoogleEarthEnterpriseBuffer",f=new r(p),g=new r(p,l.maximumAsynchronousTasks),v=new s,y=new s;d.prototype.createMesh=function(w){w=w??ye.Frozen.EMPTY_OBJECT;const P=w.tilingScheme,C=w.x,S=w.y,x=w.level,A=w.exaggeration??1,R=w.exaggerationRelativeHeight??0,L=w.throttle??!0,B=P.ellipsoid;P.tileXYToNativeRectangle(C,S,x,v),P.tileXYToRectangle(C,S,x,y);const V=B.cartographicToCartesian(s.center(y));this._skirtHeight=6378137*.3;const O=(L?g:f).scheduleTask({buffer:this._buffer,nativeRectangle:v,rectangle:s.clone(y),relativeToCenter:V,ellipsoid:B,skirtHeight:this._skirtHeight,exaggeration:A,exaggerationRelativeHeight:R,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!n(O))return;const N=this;return O.then(function(_){return N._mesh=new u(V,new Float32Array(_.vertices),new Uint16Array(_.indices),_.indexCountWithoutSkirts,_.vertexCountWithoutSkirts,_.minimumHeight,_.maximumHeight,i.clone(_.boundingSphere3D),e.clone(_.occludeePointInScaledSpace),_.numberOfAttributes,o.clone(_.orientedBoundingBox),c.clone(_.encoding),_.westIndicesSouthToNorth,_.southIndicesEastToWest,_.eastIndicesNorthToSouth,_.northIndicesWestToEast),N._minimumHeight=_.minimumHeight,N._maximumHeight=_.maximumHeight,N._buffer=void 0,N._mesh})}}function RF(){return h.VERSION.split(".").map(i=>parseInt(i))}let _g;function FF(){return _g||(_g=RF()),_g}function zF(){const t=FF();t[0]===1&&t[1]>=92?DF(h):console.warn(`don't need to fixGoogleEarth, cesium version is ${t.join(".")}`)}function LF(){const t=h.Resource.prototype.fetchJson,i=h.Resource.prototype.fetchArrayBuffer;h.Resource.prototype.fetchJson=function(...e){if(this.url.startsWith(`https://${a.defaultLocalFileServer.prefix}`)){const n=this.url.substring(8);return a.defaultLocalFileServer.getJson(n)}else return t.call(this,...e)},h.Resource.prototype.fetchArrayBuffer=function(...e){if(this.url.startsWith(`https://${a.defaultLocalFileServer.prefix}`)){const n=this.url.substring(8);return a.defaultLocalFileServer.getArrayBuffer(n).then(o=>{if(!o)throw new Error("result is undefined!");return o})}else return i.call(this,...e)}}function OF(){const t=h.ModelSceneGraph.prototype.buildDrawCommands;h.ModelSceneGraph.prototype.buildDrawCommands=function(...i){const e=this._model,n=e.modelMatrix;e.modelMatrix=h.Matrix4.IDENTITY;const o=t.call(this,...i);return e.modelMatrix=n,o}}function NF(){const t=h.ShaderSource._czmBuiltinsAndUniforms;t.czm_materialInput.indexOf("vec4 color")===-1&&(t.czm_materialInput=t.czm_materialInput.replace("float aspect;","float aspect; vec4 color;"))}const BF=`#ifdef GL_OES_standard_derivatives
1925
+ `,uniformMap:{u_color:[1,1,0,1]},name:"CzmCustomPrimitive_47fd",attributes:{position:{typedArray:{type:"Float32Array",array:[0,0,0,0,0,1]},componentsPerAttribute:3}}},ze,t)}class dF extends a.HasOwner{constructor(i){super(i);const{czmViewer:e}=this.owner;let n;this.dispose(()=>this.owner.hoveredPlaneType="none");const o=this._createRotatorMoveProcessing();this.dispose(e.pointerMoveEvent.disposableOn(s=>{const r=n=this._getStartInfo(s.pointerEvent);r&&(this.owner.hoveredPlaneType=r.currentPlaneType)})),this.dispose(e.pointerDownEvent.disposableOn(s=>{n&&n.currentPlaneType!=="none"&&(o.restart(void 0,e,n),n=void 0)})),this.dispose(e.dblclickEvent.disposableOn(s=>{const r=this._getStartInfo(s.pointerEvent);if(r&&r.currentPlaneType!=="none"){const{currentPlaneType:l}=r,c=[...this.owner.selfRotation];c[yi.rotationNum[l]]=0,this.owner.selfRotation=c;return}this.owner.enabled=!1}))}_createRotatorMoveProcessing(){return this.ad(a.createProcessingFromAsyncFunc(async(i,e,n)=>{const o=this.owner.circles[n.currentPlaneType];e.incrementDisabledInputStack(),i.disposer.dispose(()=>e.decrementDisabledInputStack()),i.disposer.dispose(e.pointerMoveEvent.don(s=>{if(n&&s.pointerEvent){const{offsetX:r,offsetY:l}=s.pointerEvent,c=[r,l],{currentPlaneType:u}=n;if(u==="none")return;const d=this.owner.getPlane(u);if(!n.currentV)return;const p=d.pick(c);if(!p||!this.owner.cartesian)return;const f=h.Cartesian3.subtract(n.currentV,this.owner.cartesian,new h.Cartesian3);h.Cartesian3.normalize(f,f);const g=h.Cartesian3.subtract(p,this.owner.cartesian,new h.Cartesian3);if(h.Cartesian3.normalize(g,g),!d.normal||!d.origin)return;const v=rg(f,g,d.normal),y=rg(d.origin,f,d.normal),w=rg(d.origin,g,d.normal);{const P=[...this.owner.selfRotation];P[yi.rotationNum[u]]=n.startRotation+v,this.owner.selfRotation=P,o.circleStartRotation=y,o.circleEndRotation=w}}})),this.owner.movingPlaneType=n.currentPlaneType,i.disposer.dispose(()=>{this.owner.movingPlaneType="none"}),i.disposer.dispose(()=>{o.circleStartRotation=0,o.circleEndRotation=0}),await a.step(i,s=>new Promise((r,l)=>{s.disposer.dispose(l),s.disposer.dispose(e.pointerUpEvent.don(()=>{r()})),s.disposer.dispose(e.pointerOutEvent.don(()=>{r()}))}))}))}_pickPlane(i,e,n,o,s){const r=this.owner.cartesian;if(!r)return;const{selfRotation:l}=this.owner,c=this.owner.getPlane(n).pick(o);if(!c)return;const u=h.Cartesian3.distance(r,c),d=s/4,p=d*3/128;if(!(u>=d-p&&u<=d+p))return;const g=h.Cartesian3.distance(e.camera.positionWC,c);i.currentD2c<=g||(i.currentPlaneType=n,i.currentD2c=g,i.currentV=c,i.startRotation=l[yi.rotationNum[n]])}_getStartInfo(i){var d;const{czmViewer:e}=this.owner,n=(d=e.viewer)==null?void 0:d.scene;if(!this.owner.position||!this.owner.cartesian)return;const o=Wi(n,this.owner.cartesian,this.owner.pixelSize);if(!o)return;const{offsetX:s,offsetY:r}=i,l=[s,r],c=i.pointerId,u={currentPlaneType:"none",currentD2c:Number.POSITIVE_INFINITY,currentV:void 0,startRotation:0,pointerId:c};return this._pickPlane(u,n,"heading",l,o),this._pickPlane(u,n,"pitch",l,o),this._pickPlane(u,n,"roll",l,o),u}}function rg(t,i,e){const n=h.Cartesian3.cross(i,t,new h.Cartesian3);if(n.equals(h.Cartesian3.ZERO))return 0;h.Cartesian3.normalize(n,n);const o=h.Cartesian3.dot(n,e);let s=Math.acos(h.Cartesian3.dot(t,i))*180/Math.PI;return s=o>0?s:-s,s}const Yo=class Yo extends kt{constructor(e){super();m(this,"_hoveredPlaneType",this.disposeVar(a.react("none")));m(this,"_movingPlaneType",this.disposeVar(a.react("none")));m(this,"_circles");m(this,"_czmCameraModel");m(this,"_cartesian");m(this,"_planes",{heading:this.disposeVar(new aF(this)),pitch:this.disposeVar(new lF(this)),roll:this.disposeVar(new cF(this))});m(this,"_rotatorRunningResetting");this._czmViewer=e;const n=this._czmViewer;if(this._rotatorRunningResetting=this.disposeVar(new a.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new dF(this)})),this._circles={heading:this._createRotatorCircle(n,"heading"),pitch:this._createRotatorCircle(n,"pitch"),roll:this._createRotatorCircle(n,"roll")},!!n.viewer){{const s=()=>{this._cartesian=this.position&&Ie(this.position)||void 0};s(),this.dispose(this.positionChanged.disposableOn(s))}this._createCameraModel(n)}}get hoveredPlaneType(){return this._hoveredPlaneType.value}set hoveredPlaneType(e){this._hoveredPlaneType.value=e}get hoveredPlaneTypeChanged(){return this._hoveredPlaneType.changed}get movingPlaneType(){return this._movingPlaneType.value}set movingPlaneType(e){this._movingPlaneType.value=e}get movingPlaneTypeChanged(){return this._movingPlaneType.changed}get circles(){return this._circles}get czmCameraModel(){return this._czmCameraModel}get cartesian(){return this._cartesian}get czmViewer(){return this._czmViewer}getPlane(e){return this._planes[e]}get rotatorRunningResetting(){return this._rotatorRunningResetting}_createCameraModel(e){this._czmCameraModel=new lt(e),this._czmCameraModel.url="${earthsdk3-assets-script-dir}/assets/glb/camera1/camera1.gltf",this._czmCameraModel.localRotation=[90,0,0],this._czmCameraModel.allowPicking=!1,this._czmCameraModel.opaquePass="OVERLAY",this.dispose(a.track([this._czmCameraModel,"pixelSize"],[this,"pixelSize"],n=>n*.1)),this.dispose(a.track([this._czmCameraModel,"position"],[this,"position"])),this.dispose(a.track([this._czmCameraModel,"rotation"],[this,"rotation"]));{const n=()=>{const o=Fe({rotation:this.selfRotation});if(!o)throw new Error("!rm");this._czmCameraModel&&(this._czmCameraModel.localModelMatrix=h.Matrix4.toArray(o))};n(),this.dispose(this.selfRotationChanged.disposableOn(n))}{const n=()=>{this.circles.heading.show=this.enabled,this.circles.pitch.show=this.enabled,this.circles.roll.show=this.enabled,this._czmCameraModel&&(this._czmCameraModel.show=this.enabled&&this.showHelper)};n(),this.dispose(this.enabledChanged.disposableOn(n)),this.dispose(this.showHelperChanged.disposableOn(n))}}_createRotatorCircle(e,n){const o=this.ad(new tr(e));this.dispose(a.track([o,"position"],[this,"position"])),this.dispose(a.track([o,"pixelSize"],[this,"pixelSize"])),this.dispose(a.track([o,"debug"],[this,"debug"])),this.dispose(a.track([o,"rotation"],[this,"rotation"]));{const s=()=>{o.selfRotation=Yo.rotationFuncs[n](this.selfRotation),o.circleRotation=this.selfRotation[Yo.rotationNum[n]]};s(),this.dispose(this.selfRotationChanged.disposableOn(s))}{const s=()=>{const r=this.movingPlaneType===n,l=this.hoveredPlaneType===n,u=[0,0,0,r||l?1:.8];u[Yo.rotationNum[n]]=1,o.color=u};s(),this.dispose(this.movingPlaneTypeChanged.disposableOn(s)),this.dispose(this.hoveredPlaneTypeChanged.disposableOn(s))}return o}};m(Yo,"rotationNum",{heading:0,pitch:1,roll:2}),m(Yo,"rotationFuncs",{heading:([e,n,o])=>[0,0,0],pitch:([e,n,o])=>[e,0,-90],roll:([e,n,o])=>[e,n+90,0]});let yi=Yo;(t=>{t.createDefaultProps=()=>({...kt.createDefaultProps(),rotation:a.reactArray([0,0,0]),selfRotation:a.reactArray([0,0,0]),pixelSize:300,showHelper:!1,debug:!1})})(yi||(yi={})),a.extendClassProps(yi.prototype,yi.createDefaultProps);const Zo=class Zo extends a.Destroyable{get startPosition(){return this.positions&&this.positions[0]}set startPosition(i){this.positions=[i??Zo.defaults.positions[0],this.stopPosition??Zo.defaults.positions[1]]}get startPositionChanged(){return this.positionsChanged}get stopPosition(){return this.positions&&this.positions[1]}set stopPosition(i){this.positions=[this.startPosition??Zo.defaults.positions[0],i??Zo.defaults.positions[1]]}get stopPositionChanged(){return this.positionsChanged}constructor(i,e){if(super(),!i.viewer)return;const o=this.ad(new Se(i,e));o.arcType="RHUMB";const s=this.ad(new ti(i,e));this.ad(a.track([o,"allowPicking"],[this,"allowPicking"])),this.ad(a.track([s,"allowPicking"],[this,"allowPicking"]));{const r=()=>{o.show=s.show=this.show};r(),this.ad(this.showChanged.don(r))}{const r=()=>{o.width=this.width/2,s.pixelSize=this.width};r(),this.ad(this.widthChanged.don(r))}{const r=()=>{o.color=s.color=this.color};r(),this.ad(this.colorChanged.don(r))}{const r=()=>{o.positions=this.positions,s.position=this.stopPosition};r(),this.dispose(this.startPositionChanged.disposableOn(r)),this.dispose(this.stopPositionChanged.disposableOn(r))}}};m(Zo,"defaults",{positions:[[0,0,0],[0,0,1e6]]});let No=Zo;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(t.defaults.positions),width:10,color:a.reactArray([1,0,0,1])})})(No||(No={})),a.extendClassProps(No.prototype,No.createDefaultProps);class sn extends kt{constructor(e){super();m(this,"_lastPosition");m(this,"_opInfo",{step:this.ad(a.react(!1)),moved:this.ad(a.react(!1)),constraintMode:this.disposeVar(a.react("none")),originPosition:this.disposeVar(a.reactArray([0,0,0])),originHeading:this.disposeVar(a.react(0)),originDimensions:this.disposeVar(a.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(a.reactArray([0,0,0])),movingPosition:this.disposeVar(a.reactArray([0,0,0])),targetPosition:this.disposeVar(a.reactArray([0,0,0])),targetHeading:this.disposeVar(a.react(0))});m(this,"_scaleAxis");m(this,"_pickingXYProcessing",e=>this.disposeVar(new a.Processing((n,o,s)=>{const r=[0,0,0],l=new h.Cartographic;return e.pointerMoveEvent.disposableOn(c=>{if(!c.pointerEvent||!e.viewer)return;const u=ui(a.getDomEventCurrentTargetPos(c.pointerEvent));if(!Jo(e.viewer.scene,u,this._opInfo.originPosition.value[2],l))return;Jn(l,r),this._opInfo.constraintMode.value==="x"?eo(this._opInfo.originPosition.value,this._opInfo.originHeading.value,r,r):this._opInfo.constraintMode.value==="y"?eo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,r,r):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=r,this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const d=[0,0,0];a.geoRhumbDestination(r,s,o,d),this._opInfo.targetPosition.value=d;let p=this.scale[0],f=this.scale[1];const g=a.geoDistance(d,this._opInfo.originPosition.value)-a.geoDistance(this._lastPosition,this._opInfo.originPosition.value);this._lastPosition=[...d];const v=this._opInfo.originDimensions.value[0]/100;g!=0&&this._opInfo.constraintMode.value==="y"&&(g>0?p+=v:p-=v),g!=0&&this._opInfo.constraintMode.value==="x"&&(g>0?f+=v:f-=v),p<=0&&(p+=v),f<=0&&(f+=v),this.scale=[p??1,f??1,this.scale[2]??1]})})));m(this,"_pickingZProcessing",e=>this.disposeVar(new a.Processing(()=>{const n=new h.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.disposableOn(s=>{if(!s.pointerEvent||!e.viewer)return;const r=ui(a.getDomEventCurrentTargetPos(s.pointerEvent));if(!mc(e.viewer.scene,Ie(this._opInfo.originPosition.value),r,n))return;this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const l=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(se(n,o)){this._opInfo.movingPosition.value=o;const c=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[c[0],c[1],o[2]+l];let u=this.scale[2];const d=o[2]-this._lastPosition[2];this._lastPosition=[...o];const p=this._opInfo.originDimensions.value[0]/100;d!=0&&(d>0?u+=p:u-=p),u<=0&&(u+=p),this.scale=[this.scale[0]??1,this.scale[1]??1,u??1]}})})));const n=e.viewer;if(!n)return;const{scene:o}=n;this.ad(new mu(e,this.positionReact,this._opInfo.originDimensions,this.axisPixelSize)),this.ad(e.dblclickEvent.don(()=>{this.enabled=!1})),this._scaleAxis={zAxis:this._createScaleAxis(e,"zAxis"),yAxis:this._createScaleAxis(e,"yAxis"),xAxis:this._createScaleAxis(e,"xAxis")};{const s=()=>{if(!this._scaleAxis)return;const{zAxis:r,yAxis:l,xAxis:c}=this._scaleAxis,u=this._opInfo.constraintMode.value,d=this._opInfo.step;r.color=[0,0,1,.99],l.color=[0,1,0,.99],c.color=[1,0,0,.99],u==="x"?c.color=d?[1,1,0,.8]:[1,1,0,.99]:u==="y"?l.color=d?[1,1,0,.8]:[1,1,0,.99]:u==="z"&&(r.color=d?[1,1,0,.8]:[1,1,0,.99])};s(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(s)),this.dispose(this._opInfo.step.changed.disposableOn(s))}{const s=()=>{if(!this._scaleAxis)return;const{position:l=sn.defaults.position}=this,{zAxis:c,yAxis:u,xAxis:d}=this._scaleAxis;c.startPosition=u.startPosition=d.startPosition=l;const[p,f,g]=l;c.stopPosition=[p,f,g+this._opInfo.originDimensions.value[2]];const v=a.geoRhumbDestination(l,this._opInfo.originDimensions.value[0],90);v&&(d.stopPosition=v);const y=a.geoRhumbDestination(l,this._opInfo.originDimensions.value[1],0);y&&(u.stopPosition=y)};s();const r=this.ad(a.createNextAnimateFrameEvent(this.positionChanged,this._opInfo.originDimensions.changed));this.ad(r.don(s))}{const s=()=>{if(this._opInfo.constraintMode.value==="none"){this._opInfo.moved.value=!1;return}if(this._opInfo.originHeading.value!==this._opInfo.targetHeading.value){this._opInfo.moved.value=!0;return}if(!this._opInfo.originPosition.value.every((r,l)=>r===this._opInfo.targetPosition.value[l])){this._opInfo.moved.value=!0;return}};s(),this.dispose(this._opInfo.originHeading.changed.disposableOn(s)),this.dispose(this._opInfo.originPosition.changed.disposableOn(s)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(s)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(s))}{const s=this._pickingXYProcessing(e),r=this._pickingZProcessing(e),l=()=>{const f=[...this.position??sn.defaults.position];e.editingHeightOffset&&(f[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=f},c={constraintMode:"none",startDragPos:[0,0,0]},u=f=>{if(!this.position)return;const g={position:this.position,dimensions:this._opInfo.originDimensions.value,heading:0};ou(f,o,g,this.axisSnapPixelSize,c),this._opInfo.constraintMode.value=c.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=c.startDragPos},d=this.disposeVar(a.createProcessingFromAsyncFunc(async f=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",f.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await a.step(f,async g=>{g.disposer.dispose((l(),this.positionChanged.disposableOn(l))),g.disposer.dispose(e.pointerMoveEvent.disposableOn(v=>{v.pointerEvent&&u(v.pointerEvent)})),await a.step(g,v=>new Promise((y,w)=>{v.disposer.dispose(w),v.disposer.dispose(e.pointerDownEvent.don(P=>{P.pointerEvent&&u(P.pointerEvent),P.pointerEvent&&P.pointerEvent.button===0&&c.constraintMode!=="none"&&y()}))}))}),this._opInfo.step.value=!1,await a.step(f,async g=>{if(e.incrementDisabledInputStack(),g.disposer.dispose(()=>e.decrementDisabledInputStack()),["x","y"].includes(this._opInfo.constraintMode.value)){const v=a.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),y=a.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);s.restart(void 0,v,y),g.disposer.dispose(()=>s.cancel())}else this._opInfo.constraintMode.value==="z"&&(r.restart(),g.disposer.dispose(()=>r.cancel()));await a.step(g,v=>new Promise((y,w)=>{v.disposer.dispose(w),v.disposer.dispose(e.pointerUpEvent.don(()=>{y()})),v.disposer.dispose(e.pointerOutEvent.don(()=>{y()}))})),this._lastPosition=void 0}),d.restart()})),p=()=>{this.enabled?d.restart():d.isRunning&&d.cancel()};p(),this.dispose(this.enabledChanged.disposableOn(p))}}get scaleAxis(){return this._scaleAxis}_createScaleAxis(e,n){const o=this.ad(new No(e));return o.width=10,this.ad(a.track([o,"show"],[this,"enabled"])),o}}(t=>{t.createDefaultProps=()=>({...kt.createDefaultProps(),scale:a.reactArray([1,1,1]),axisPixelSize:100,axisSnapPixelSize:5})})(sn||(sn={})),a.extendClassProps(sn.prototype,sn.createDefaultProps);const Kn=class Kn extends Gt{constructor(e){super();m(this,"_editingPoints",this.disposeVar(new a.ObservableArray));m(this,"_cancelEvent",this.disposeVar(new a.Event));m(this,"_currentProcess");m(this,"_menuPoiEnabled",this.disposeVar(a.react(!1)));m(this,"_status",this.disposeVar(a.react("None")));m(this,"_positionsChanged",this.ad(new a.Event));m(this,"_cursorInfo");this._czmViewer=e,this.enabled=!1,this.createPolyline(e),this._createCursorInfo(e),this.dispose(()=>this.resetPositions()),this.dispose(()=>this.editingPoints.length=0),this.dispose(this.editingPoints.changedEvent.disposableOn(()=>this.positionsChanged.emit())),this.dispose(this.editingPoints.toChangeEvent.disposableOn(n=>{for(let{start:o,deleteCount:s,items:r}of n){for(const l of r)l.menuPoi.enabled=this.menuPoiEnabled??!1;for(let l=o;l<o+s;++l)this.editingPoints.get(l).destroy()}})),this.dispose(this.menuPoiEnabledChanged.disposableOn(()=>{for(let n of this.editingPoints)n.menuPoi.enabled=this.menuPoiEnabled??!1})),this.dispose(e.dblclickEvent.don(n=>{this.ad(()=>{var o;((o=n.pointerEvent)==null?void 0:o.button)===0&&this.enabled&&this.currentProcess&&this.currentProcess.cancel()})})),this.dispose(this.enabledChanged.disposableOn(n=>{this._currentProcess&&(n?this._currentProcess.restart():this._currentProcess.isRunning&&this._currentProcess.cancel())}));{const n=()=>{this.polylineShow=this.czmViewer.editingLineShow};n(),this.ad(this.czmViewer.editingLineShowChanged.don(n))}}get editingPoints(){return this._editingPoints}get cancelEvent(){return this._cancelEvent}cancel(){this._cancelEvent.emit()}get currentProcess(){return this._currentProcess}set currentProcess(e){this._currentProcess=e}get menuPoiEnabled(){return this._menuPoiEnabled.value}set menuPoiEnabled(e){this._menuPoiEnabled.value=e}get menuPoiEnabledChanged(){return this._menuPoiEnabled.changed}get status(){return this._status.value}get statusChanged(){return this._status.changed}set status(e){this._status.value=e}getPositions(){const e=[];for(let n of this._editingPoints)n.position&&e.push([...n.position]);return e}resetPositions(e){if(this.enabled??Kn.defaults.enabled)return console.warn("MultiPointsEditing.resetPositions error: this.enabled === true"),!1;const n=e||[];return!(n.length===this.editingPoints.length&&n.every((o,s)=>o.every((r,l)=>{const c=this.editingPoints.get(s);return c.position&&c.position[l]===r})))}forceResetPositions(e){(this.enabled??Kn.defaults.enabled)&&(this.enabled=!1),this.resetPositions(e)}get positions(){return this.getPositions()}set positions(e){this.resetPositions(e)}get positionsChanged(){return this._positionsChanged}get czmViewer(){return this._czmViewer}get cursorInfo(){return this._cursorInfo}createPolyline(e){const n=this.ad(new Se(e));this.ad(a.track([n,"color"],[this,"polylineColor"])),this.ad(a.track([n,"width"],[this,"polylineWidth"])),this.ad(a.track([n,"show"],[this,"polylineShow"])),this.ad(a.track([n,"arcType"],[this,"polylineArcType"])),this.ad(a.track([n,"loop"],[this,"loop"]));{const o=()=>{const s=[];for(const r of this.getPositions())r[2]-=e.editingHeightOffset??0,s.push(r);n.positions=s};o(),this.ad(this.positionsChanged.don(o))}}_createCursorInfo(e){const n=this._cursorInfo=this.ad(new a.CursorInfo(e.container,a.CursorFloatDiv));this.dispose(this.statusChanged.disposableOn(()=>{const o=this.status;if(n){if(!this.hideCursorInfo){n.show=!1;return}o==="Adding"?(n.text="右键/BackSpace键:删除上一个控制点;Esc键或左键双击:退出添加状态,进入修改状态",n.show=!0):o==="Modifying"||o==="Modifying_Point"?(n.text="Esc键或左键双击:退出编辑状态",n.show=!0):o==="None"&&(n.text="",n.show=!1)}}))}};m(Kn,"baseImageUrl","${earthsdk3-assets-script-dir}/assets/img/"),m(Kn,"defaults",{...Gt.defaults,debug:!1,polylineShow:!1,polylineWidth:1,polylineColor:[1,1,1,1],polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,loop:!1,firstControlPointImageUrl:Kn.baseImageUrl+"point-green.png",otherControlPointImageUrl:Kn.baseImageUrl+"point-yellow.png"});let ri=Kn;(t=>{t.createDefaultProps=()=>({...Gt.createDefaultProps(),loop:!1,debug:!1,polylineShow:!0,polylineWidth:1,polylineColor:a.reactArray([1,1,1,1]),polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,firstControlPointImageUrl:t.baseImageUrl+"point-green.png",otherControlPointImageUrl:t.baseImageUrl+"point-yellow.png",hideCursorInfo:!1,middlePointShow:!0})})(ri||(ri={})),a.extendClassProps(ri.prototype,ri.createDefaultProps);let pF=0;class fC extends a.Destroyable{constructor(e,n){super();m(this,"_position",this.disposeVar(a.reactArrayWithUndefined(void 0)));m(this,"_id",pF++);m(this,"_menuPoi");n&&(this.position=n),e.debug&&console.log(`PolylinePositionEditor creating! ${this.id}`),this.dispose(()=>{e.debug&&console.log(`PolylinePositionEditor destroying! ${this.id}`)});const o=this._menuPoi=this.ad(new rs(e.czmViewer));o.enabled=!1,this.ad(a.track([o,"show"],[e,"enabled"]));{const s=()=>{if(this.position===void 0){o.position=void 0;return}const r=[...this.position];r[2]-=e.czmViewer.editingHeightOffset??0,o.position=r,e.positionsChanged.emit()};s(),this.d(this.positionChanged.don(s))}{const s=()=>{const r=e.editingPoints.indexOf(this)+1;r!==0&&(o.title=`控制点${r}`,r===1?o.imageUri=e.firstControlPointImageUrl??ri.defaults.firstControlPointImageUrl:o.imageUri=e.otherControlPointImageUrl??ri.defaults.otherControlPointImageUrl)};s(),this.dispose(e.editingPoints.changedEvent.disposableOn(s))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get id(){return this._id}get menuPoi(){return this._menuPoi}}class gC extends fC{constructor(i,e){super(i,e)}}class Ye extends ri{constructor(e){super(e);m(this,"_deletePreviousPointWhileAddingEvent",this.disposeVar(new a.Event));m(this,"placeEditing");if(!e.viewer)return;const n=this.placeEditing=this.ad(new Ni(e));n.enabled=!1,this.currentProcess=this.disposeVar(a.createProcessingFromAsyncFunc(async o=>{o.disposer.dispose(()=>{(this.debug??Ye.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),(this.debug??Ye.defaults.debug)&&console.log("直接进入Adding状态"),this.status="Adding",await o.promise(a.step(o,async s=>{const r=s.disposer,l=r.ad(this._addingEditingProcessing());r.dispose(()=>"adding canceled!"),r.dispose(this.cancelEvent.disposableOn(()=>l.cancel())),await s.promise(new Promise(c=>{r.dispose(l.completeEvent.disposableOnce(c))}))}))})),this.dispose(e.clickEvent.don(o=>{var s;((s=o.pointerEvent)==null?void 0:s.button)===2&&this.deletePreviousPointWhileAdding()}))}deletePreviousPointWhileAdding(){this._deletePreviousPointWhileAddingEvent.emit()}resetPositions(e){if(!super.resetPositions(e))return!0;const n=e?e.map(o=>new gC(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...n),!0}_addingEditingProcessing(){const e=()=>{if(this.maxPointsNum!==void 0)return this.editingPoints.length>=this.maxPointsNum&&(this.debug??Ye.defaults.debug)&&console.log("impl.positionEditors.length >= impl.maxPointsNum"),this.editingPoints.length>=this.maxPointsNum},n=a.createProcessingFromAsyncFunc(async o=>{let s=this.editingPoints.length;this.menuPoiEnabled=!1,await o.promise(a.step(o,async l=>{let c;!e()&&(c=l.disposer.disposeVar(new fF(this,s)));const d=l.disposer.disposeVar(new mF(this,s));return l.disposer.dispose(this._deletePreviousPointWhileAddingEvent.disposableOn(()=>d.do())),await l.promise(new Promise(p=>{c&&l.disposer.dispose(c.overEvent.disposableOnce(f=>{f?(s++,p(!0)):p(!1)})),l.disposer.dispose(d.overEvent.disposableOnce(f=>{f?(s--,p(!0)):p(!1)})),l.disposer.dispose(this.cancelEvent.disposableOn(()=>p(!1)))}))}))&&n.restart()});return n.start(),n}}(t=>{t.createDefaultProps=()=>({...ri.createDefaultProps()})})(Ye||(Ye={})),a.extendClassProps(Ye.prototype,Ye.createDefaultProps);class fF extends a.Destroyable{constructor(e,n){super();m(this,"_overEvent",this.disposeVar(new a.Event));const{placeEditing:o}=e;let s=new gC(e,void 0);e.editingPoints.splice(n,0,s);const r=()=>{(e.debug??Ye.defaults.debug)&&console.log("delete currentPosEditor");const u=e.editingPoints.indexOf(s);if(u===-1)throw new Error("currentPosEditor not found");e.editingPoints.splice(u,1)};if(o.enabled??!1)throw console.error("placeEditing.enabled is true!"),new Error("placeEditing.enabled is true!");this.dispose(a.track([s,"position"],[o,"position"])),o.enabled=!0;let l=!1;const c=()=>{r(),this._overEvent.emit(!1)};this.dispose(()=>{o.enabled=!1,!l&&c()}),this.dispose(o.overEvent.disposableOnce(()=>{l=!0,s.position===void 0?c():this._overEvent.emit(!0)})),(e.debug??Ye.defaults.debug)&&console.log(`PointAdding creating! index(${n})`),this.dispose(()=>{(e.debug??Ye.defaults.debug)&&console.log(`PointAdding destroying! index(${n})`)})}get overEvent(){return this._overEvent}}function gF(t,i){const e=t.editingPoints,n=i-1;return n<0?(console.warn("previousIndex < 0, cannot delete the point!"),!1):(e.splice(n,1),!0)}class mF extends a.Destroyable{constructor(e,n){super();m(this,"_overEvent",this.disposeVar(new a.Event));m(this,"_doEvent",this.disposeVar(new a.Event));this.dispose(this._doEvent.disposableOn(()=>this._overEvent.emit(gF(e,n)))),(e.debug??Ye.defaults.debug)&&console.log(`PreviousPointDeleting creating! currentIndex(${n})`),this.dispose(()=>{(e.debug??Ye.defaults.debug)&&console.log(`PreviousPointDeleting destroying! currentIndex(${n})`)})}get overEvent(){return this._overEvent}do(){return this._doEvent.emit()}}class mC extends Ye{constructor(i){super(i),this.loop=!1}}class vC extends Ye{constructor(i){super(i),this.loop=!0}}class Vh extends fC{constructor(i,e){super(i,e);{const{menuPoi:n}=this;n.commands=[["add","增加控制点","",xe.baseImageUrl+"add.png"],["delete","删除当前控制点","",xe.baseImageUrl+"delete.png"],["modify","修改当前控制点","",xe.baseImageUrl+"modify.png"]],n.clickCommandName="modify",n.rightClickCommandName="delete",this.dispose(n.commandEvent.disposableOn(o=>{i.menuPoiCommand(this,o)})),this.dispose(n.dbclickEvent.disposableOn(()=>{i.menuPoiCommand(this,"dbClick")}))}if(i.middlePointShow){const n=this.ad(new _i(i.czmViewer));{n.imageUri=i.firstControlPointImageUrl??xe.defaults.firstControlPointImageUrl,n.tooltip="点击增加一个控制点",n.bgColor=[0,0,0,.6],n.fgColor=[1,1,1,1],n.size=[8,8],n.originRatioAndOffset=[.5,.5,0,0];{const o=()=>{n.enabled=n.show=!1},s=()=>{var g;if(!(i.enabled??xe.defaults.enabled))return o();const r=i.editingPoints.indexOf(this),l=i.editingPoints,c=l.length;if(r===-1||c===0||!(i.loop??xe.defaults.loop)&&r+1>=c)return o();const u=this.position;if(!u)return o();const d=(g=l.get((r+1)%c))==null?void 0:g.position;if(!d)return o();const p=lu(u,d);if(!p)return o();p[2]-=i.czmViewer.editingHeightOffset??0,n.position=p;const f=c<(i.maxPointsNum??xe.defaults.maxPointsNum);n.enabled=n.show=f};s(),this.dispose(i.positionsChanged.disposableOn(s)),this.dispose(i.loopChanged.disposableOn(s)),this.dispose(i.enabledChanged.disposableOn(s))}this.dispose(n.clickEvent.disposableOn(o=>{if(o.button!==0||i.editingPoints.length>=(i.maxPointsNum??xe.defaults.maxPointsNum))return;const s=i.editingPoints.indexOf(this);if(s===-1)return;const r=n.position?[...n.position]:void 0;r&&(r[2]+=i.czmViewer.editingHeightOffset??0);let l=new Vh(i,r);i.editingPoints.splice(s+1,0,l),i.modify(l)}))}}}}class xe extends ri{constructor(e){super(e);m(this,"_menuPoiCommand",this.disposeVar(new a.Event));m(this,"_forceModifyPosEditorEvent",this.disposeVar(new a.Event));m(this,"_overEvent",this.disposeVar(new a.Event));m(this,"translationEditing");{const s=this.ad(a.createNextAnimateFrameEvent(this.moveWithFirstPositionChanged,this.editingPoints.changedEvent));this.ad(new a.ObjResettingWithEvent(s,()=>{if(!(!this.moveWithFirstPosition||this.editingPoints.length<=1))return new vF(this.editingPoints.get(0),this)}))}const n=this.translationEditing=this.disposeVar(new on(e));n.enabled=!1;const o=async(s,r)=>{if((this.debug??xe.defaults.debug)&&console.log("进入Modifying修改状态"),this.status="Modifying",r=await s.promise(a.step(s,async l=>{const c=l.disposer,u=c.ad(new yF(this));return c.dispose(()=>"modifying canceled!"),this.editingPoints.length>0&&u.modify(this.editingPoints.get(r===-1||r>=this.editingPoints.length?0:r)),c.dispose(this.cancelEvent.disposableOn(()=>u.cancel())),c.dispose(this._forceModifyPosEditorEvent.disposableOn(p=>u.modify(p))),await l.promise(new Promise(p=>{c.dispose(u.overEvent.disposableOnce(f=>{p(f)}))}))})),r===-1)(this.debug??xe.defaults.debug)&&console.log("退出编辑状态");else{if(this.editingPoints.length>=(this.maxPointsNum??xe.defaults.maxPointsNum))return;if(this.editingPoints.length===0){console.error("impl.positionEditors.length === 0!");return}this.loop??xe.defaults.loop;const c=this.editingPoints.get(r-1).position;if(!c)return;let u=r%this.editingPoints.length;const p=this.editingPoints.get(u).position;if(!p)return;const f=lu(c,p);if(!f)return;f&&(f[2]+=this.czmViewer.editingHeightOffset??0);let g=new Vh(this,f);this.editingPoints.splice(r,0,g),await o(s,r)}};this.currentProcess=this.disposeVar(a.createProcessingFromAsyncFunc(async s=>{s.disposer.dispose(()=>{(this.debug??xe.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),await o(s,-1),this.status="None",this.enabled=!1}))}menuPoiCommand(e,n){this._menuPoiCommand.emit(e,n)}modify(e){this._forceModifyPosEditorEvent.emit(e)}resetPositions(e){if(!super.resetPositions(e))return!0;const n=e?e.map(o=>new Vh(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...n),!0}get overEvent(){return this._overEvent}}(t=>{t.createDefaultProps=()=>({...ri.createDefaultProps(),moveWithFirstPosition:!1})})(xe||(xe={})),a.extendClassProps(xe.prototype,xe.createDefaultProps);class vF extends a.Destroyable{constructor(i,e){super(),this._firstPositionEditor=i,this.multiPointsModifyEditing=e,this._firstPositionEditor.positionChanged.disposableOn((n,o)=>{if(n===void 0||o===void 0)return;var s=[n[0]-o[0],n[1]-o[1],n[2]-o[2]];const r=this.multiPointsModifyEditing.editingPoints.length;for(let l=1;l<r;l++){const c=this.multiPointsModifyEditing.editingPoints.get(l),u=c.position;u!==void 0&&(c.position=[u[0]+s[0],u[1]+s[1],u[2]+s[2]])}})}}class yF extends a.Destroyable{constructor(e){super();m(this,"_overEvent",this.disposeVar(new a.Event));m(this,"_cancelEvent",this.disposeVar(new a.Event));m(this,"_forceModifyPosEditorEvent",this.disposeVar(new a.Event));e.menuPoiEnabled=!0,this.dispose(()=>e.menuPoiEnabled=!1);let n;const o=()=>{n==null||n.destroy(),n=void 0,e.status="Modifying"};this.dispose(o);const s=r=>{o(),e.status="Modifying_Point",n=new wF(e,r),n.dispose(n.overEvent.disposableOn(()=>{o()}))};this.dispose(this._forceModifyPosEditorEvent.disposableOn(s)),this.dispose(e._menuPoiCommand.disposableOn((r,l)=>{if(l==="delete"){if(e.editingPoints.length<=2)return;const c=e.editingPoints.indexOf(r);if(c===-1)throw console.error("posEditor not found"),new Error("posEditor not found");e.editingPoints.splice(c,1)}else if(l==="modify")s(r);else if(l==="add"){const c=e.editingPoints.indexOf(r);if(c===-1)throw console.error("posEditor not found"),new Error("posEditor not found");this._overEvent.emit(c+1)}else l==="dbClick"?this._overEvent.emit(-1):alert(`未知的commandName(${l})`)})),this.dispose(this._cancelEvent.disposableOn(()=>{this._overEvent.emit(-1)}))}get overEvent(){return this._overEvent}cancel(){this._cancelEvent.emit()}modify(e){this._forceModifyPosEditorEvent.emit(e)}}class wF extends a.Destroyable{constructor(e,n){super();m(this,"_overEvent",this.disposeVar(new a.Event));this._modifying=e,this._posEditor=n,this.dispose(this._posEditor.toDestroyEvent.disposableOn(()=>{this._overEvent.emit()}));const{translationEditing:o}=this._modifying;if(o.enabled=!0,o.heading=0,this.dispose(()=>{o.enabled=!1}),!this._posEditor.position)throw console.error("!this._posEditor.position"),new Error("!this._posEditor.position");o.position=this._posEditor.position,this.dispose(a.track([this._posEditor,"position"],[o,"position"])),this.dispose(o.enabledChanged.disposableOnce(s=>{s||this._overEvent.emit()}))}get overEvent(){return this._overEvent}}class yC extends xe{constructor(i){super(i),this.loop=!1}}class wC extends xe{constructor(i){super(i),this.loop=!0}}class ir extends Ye{init(){const i=this.startPosition;if(!i)return;const e=this.distance,n=this.rotation,o=e*Math.cos(n[1]*Math.PI/180),s=a.geoDestination(i,o,n[0]);if(!s){this.positions=[i];return}const r=e*Math.sin(n[1]*Math.PI/180);s[2]+=r,this.positions=[i,s],this.editingPoints.length==2&&(this.editingPoints.get(0).position=i,this.editingPoints.get(1).position=s)}constructor(i){super(i),this.loop=!0,this.maxPointsNum=2;{const e=()=>{if(!this.positions||this.positions.length==0){this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];return}if(this.positions.length==1){this.distance=1,this.rotation=[90,0,0];return}this.startPosition=this.positions[0],this.endPosition=this.positions[1];const n=a.geoHeading(this.startPosition,this.endPosition),o=a.geoDistance(this.startPosition,this.endPosition);if(o<=0){this.rotation=[90,0,0],this.distance=1;return}const s=this.endPosition[2]-this.startPosition[2],r=Math.atan(s/o)*180/Math.PI,l=Math.sqrt(o*o+s*s);this.rotation=[n,r,0],this.distance=l};e(),this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Ye.createDefaultProps(),startPosition:a.reactArrayWithUndefined(void 0),endPosition:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([90,0,0]),distance:a.react(1)})})(ir||(ir={})),a.extendClassProps(ir.prototype,ir.createDefaultProps);class Bo extends xe{init(){const i=this.startPosition;if(!i)return;const e=this.distance,n=this.rotation,o=e*Math.cos(n[1]*Math.PI/180),s=a.geoDestination(i,o,n[0]);if(!s){this.positions=[i];return}const r=e*Math.sin(n[1]*Math.PI/180);s[2]+=r,this.positions=[i,s],this.editingPoints.length==2&&(this.editingPoints.get(0).position=i,this.editingPoints.get(1).position=s)}constructor(i){super(i),this.loop=!0,this.maxPointsNum=2,this.middlePointShow=!1,this.moveWithFirstPosition=!0;{const e=()=>{var l;if(!((l=this.positions)!=null&&l.length))return this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];if(this.startPosition=this.positions[0],this.positions.length==1)return this.editingPoints.get(0).menuPoi.commands=[["add","增加控制点","",xe.baseImageUrl+"add.png"],["delete","删除当前控制点","",xe.baseImageUrl+"delete.png"],["modify","修改当前控制点","",xe.baseImageUrl+"modify.png"]],this.rotation=[90,0,0],this.distance=1;this.endPosition=this.positions[1];for(let c of this.editingPoints)c.menuPoi.commands=[["delete","删除当前控制点","",xe.baseImageUrl+"delete.png"],["modify","修改当前控制点","",xe.baseImageUrl+"modify.png"]];const n=a.geoDistance(this.startPosition,this.endPosition);if(Math.abs(n)<=0)return this.rotation=[90,0,0],this.distance=1;const o=a.geoHeading(this.startPosition,this.endPosition),s=this.endPosition[2]-this.startPosition[2],r=Math.atan(s/n)*180/Math.PI;this.rotation=[o,r,0],this.distance=Math.hypot(n,s)};this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...xe.createDefaultProps(),startPosition:a.reactArrayWithUndefined(void 0),endPosition:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),distance:a.react(0)})})(Bo||(Bo={})),a.extendClassProps(Bo.prototype,Bo.createDefaultProps);class CC extends Ye{constructor(i){super(i),this.loop=!1,this.polylineShow=!1}}class _C extends xe{constructor(i){super(i),this.loop=!1,this.polylineShow=!1,this.middlePointShow=!1}}class nr extends Ye{constructor(i){super(i),i.viewer||(this.loop=!1);{const e=()=>{if(!this.positions||this.positions.length<2){this.visibilityPositions=void 0;return}const n=[...this.positions[0]];n[2]-=i.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=i.editingHeightOffset??0,[n,o]))};e(),this.ad(this.positionsChanged.don(e))}}createPolyline(i){const e=this.ad(new pi(i));e.topOrBottom="bottom",this.ad(a.track([e,"color"],[this,"polylineColor"])),this.ad(a.track([e,"width"],[this,"polylineWidth"])),this.ad(a.track([e,"show"],[this,"polylineShow"])),this.ad(a.track([e,"arcType"],[this,"polylineArcType"])),this.ad(a.track([e,"loop"],[this,"loop"])),this.ad(a.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Ye.createDefaultProps(),visibilityPositions:a.reactPositionsSet(void 0)})})(nr||(nr={})),a.extendClassProps(nr.prototype,nr.createDefaultProps);class or extends xe{constructor(i){if(super(i),!!i.viewer){this.loop=!1,this.middlePointShow=!1;{const e=()=>{if(!this.positions||this.positions.length<2)return;const n=[...this.positions[0]];n[2]-=i.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=i.editingHeightOffset??0,[n,o]))};e(),this.ad(this.positionsChanged.don(e))}}}createPolyline(i){const e=this.ad(new pi(i));e.topOrBottom="bottom",this.ad(a.track([e,"color"],[this,"polylineColor"])),this.ad(a.track([e,"width"],[this,"polylineWidth"])),this.ad(a.track([e,"show"],[this,"polylineShow"])),this.ad(a.track([e,"arcType"],[this,"polylineArcType"])),this.ad(a.track([e,"loop"],[this,"loop"])),this.ad(a.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...xe.createDefaultProps(),visibilityPositions:a.reactPositionsSet(void 0)})})(or||(or={})),a.extendClassProps(or.prototype,or.createDefaultProps);class PC extends Bo{constructor(i){super(i),this.firstControlPointImageUrl=this.otherControlPointImageUrl,this.translationEditing.xAxisShow=!1,this.translationEditing.yAxisShow=!1,this.translationEditing.zAxisShow=!0,this.translationEditing.showCircle=!1,this.rotation=[0,90,0]}}class Pt extends a.EngineObject{constructor(e,n,o){super(e,n,o??!0);m(this,"_currentEditing",this.disposeVar(a.react(void 0)));this.ad(this.toDestroyEvent.don(()=>{var s;if(this.currentEditing)if(this.currentEditing instanceof Ye&&((s=this.currentEditing.currentProcess)!=null&&s.isRunning))if(this.currentEditing.currentProcess.cancel(),e!=null&&e.position){if(this.currentEditing.positions.length>1)return;e.position=this.currentEditing.positions[0]??[0,0,0],e!=null&&e.rotation&&(e.rotation=[0,0,0]),e!=null&&e.far&&(e.far=1),e!=null&&e.radius&&(e.radius=1),e!=null&&e.distance&&(e.distance=1)}else e.points=this.currentEditing.positions;else this.currentEditing instanceof Ni&&this.currentEditing.enabled&&(e.position=[0,0,0])}))}get currentEditing(){return this._currentEditing.value}set currentEditing(e){this._currentEditing.value=e}get currentEditingChanged(){return this._currentEditing.changed}}const kl=class kl extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new Ni(e));if(this.ad(e.clickEvent.don(o=>{var s;((s=o.pointerEvent)==null?void 0:s.button)==2&&(n.enabled=!0)})),Reflect.has(i,"position")){const o=i;this.ad(a.bind([n,"position"],[o,"position"])),n.enabled=!n.position||a.equalsN3(n.position,[0,0,0])}else throw new Error(`PlaceEditingWrapper:${i.typeName} 坐标属性无法绑定位置编辑`)}};m(kl,"type",kl.registerEditing("ESCesiumViewer",a.ESJEditingMode.Place,kl));let ag=kl;const Kl=class Kl extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new yi(e));if(n.rotation=[90,0,0],this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),i instanceof a.ES3DTileset)a.registerCreatedEventUpdate(this,i,()=>{const o=e.getEngineObject(i);o&&(this.ad(a.bind([n,"position"],[o.czm3DTiles,"position"])),this.ad(a.bind([n,"selfRotation"],[i,"rotation"])))});else if(Reflect.has(i,"position")&&Reflect.has(i,"rotation")){const o=i;this.ad(a.bind([n,"position"],[o,"position"])),this.ad(a.bind([n,"selfRotation"],[o,"rotation"]))}else throw new Error(`RotationEditingWrapper:${i.typeName} 旋转属性无法绑定旋转编辑`)}};m(Kl,"type",Kl.registerEditing("ESCesiumViewer",a.ESJEditingMode.Rotation,Kl));let lg=Kl;const Jl=class Jl extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new sn(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"position")&&Reflect.has(i,"scale")){const o=i;this.ad(a.bind([n,"position"],[o,"position"])),this.ad(a.bind([n,"scale"],[o,"scale"]))}else throw new Error(`ScaleEditingWrapper:${i.typeName} 缩放属性无法绑定缩放编辑`)}};m(Jl,"type",Jl.registerEditing("ESCesiumViewer",a.ESJEditingMode.Scale,Jl));let cg=Jl;const jl=class jl extends Pt{constructor(i,e){super(Array.isArray(i)?i[0]:i,e,!0);const n=this.currentEditing=this.ad(new on(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Array.isArray(i)){const o=[];for(let s=0;s<i.length;s++){const r=i[s];Reflect.has(r,"position")?o.push(r.position):r.points&&o.push(...r.points)}n.position=a.getMinMaxCorner(o).center,this.ad(n.positionChanged.disposableOn((s,r)=>{if(!(!s||!r)){var l=Dt({originPosition:r},[s])[0][0];i.forEach(c=>{const u=c;if(Reflect.has(c,"position")){const d=Dt({originPosition:r},[u.position])[0][0];u.position=yn({originPosition:r},[[d[0]+l[0],d[1]+l[1],d[2]+l[2]]])[0][0]}else if(Reflect.has(u,"points")&&u.points){const d=Dt({originPosition:r},u.points)[0];u.points=yn({originPosition:r},d.map(p=>[p[0]+l[0],p[1]+l[1],p[2]+l[2]]))[0]}})}}))}else if(Reflect.has(i,"position"))this.ad(a.bind([n,"position"],[i,"position"]));else if(i instanceof a.ES3DTileset)a.registerCreatedEventUpdate(this,i,()=>{const o=e.getEngineObject(i);this.ad(a.bind([n,"position"],[o.czm3DTiles,"position"]))});else if(Reflect.has(i,"points")){const o=i;if(o.points===void 0||o.points.length===0){this.destroy();return}n.position=a.getMinMaxCorner(o.points).center,this.ad(n.positionChanged.disposableOn((s,r)=>{if(s===void 0||r===void 0||o.points===void 0||o.points.length===0){this.destroy();return}var l=Dt({originPosition:r},[s])[0][0];const c=Dt({originPosition:r},o.points)[0];o.points=yn({originPosition:r},c.map(u=>[u[0]+l[0],u[1]+l[1],u[2]+l[2]]))[0]}))}else throw new Error(`TranslationEditingWrapper:${i.typeName} 坐标属性无法绑定平移编辑`)}};m(jl,"type",jl.registerEditing("ESCesiumViewer",a.ESJEditingMode.Translation,jl));let Uh=jl;const ec=class ec extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new ir(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"position")){const o=i;if(this.ad(a.bind([n,"startPosition"],[o,"position"])),this.ad(Je([n,"rotation"],[o,"rotation"])),Reflect.has(o,"far"))this.ad(a.bind([n,"distance"],[o,"far"]));else if(Reflect.has(o,"radius"))this.ad(a.bind([n,"distance"],[o,"radius"]));else if(Reflect.has(o,"distance"))this.ad(a.bind([n,"distance"],[o,"distance"]));else{const s=Ie(o.position);if(h.Cartesian3.ZERO.equals(s)||!e.viewer)return;n.distance=Wi(e.viewer.scene,s,100)??1}}else if(Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`DoublePointsAppendEditingWrapper:${i.typeName} 坐标属性无法绑定双点追加编辑`);n.startPosition&&!a.equalsN3(n.startPosition,[0,0,0])&&n.init(),n.enabled=!0}};m(ec,"type",ec.registerEditing("ESCesiumViewer",a.ESJEditingMode.DoublePointsAppend,ec));let hg=ec;const tc=class tc extends Pt{constructor(i,e){if(super(i,e,!0),!e.viewer)return;const n=this.currentEditing=this.ad(new Bo(e));if(Reflect.has(i,"position")){const s=i;if(this.ad(a.bind([n,"startPosition"],[s,"position"])),this.ad(Je([n,"rotation"],[s,"rotation"])),Reflect.has(s,"far"))this.ad(a.bind([n,"distance"],[s,"far"]));else if(Reflect.has(s,"radius"))this.ad(a.bind([n,"distance"],[s,"radius"]));else if(Reflect.has(s,"distance"))this.ad(a.bind([n,"distance"],[s,"distance"]));else{const r=Ie(s.position);if(h.Cartesian3.ZERO.equals(r)||!e.viewer)return;n.distance=Wi(e.viewer.scene,r,100)??1}}else if(Reflect.has(i,"points")){const s=i;if(s.points.length!=2)throw new Error(`DoublePointsModifyEditingWrapper:${i.typeName} 坐标属性无法绑定双点修改编辑`);n.moveWithFirstPosition=!1;const r=()=>n.positions=s.points??[];r(),this.ad(s.pointsChanged.don(()=>!n.enabled&&r())),this.ad(a.track([s,"points"],[n,"positions"]))}else throw new Error(`DoublePointsModifyEditingWrapper:${i.typeName} 坐标属性无法绑定双点修改编辑`);n.init(),n.enabled=!0;const o=this.ad(a.createNextAnimateFrameEvent(n.enabledChanged,n.startPositionChanged));this.ad(o.don(()=>{(!n.enabled||!n.startPosition||a.equalsN3(n.startPosition,[0,0,0]))&&this.destroy()}))}};m(tc,"type",tc.registerEditing("ESCesiumViewer",a.ESJEditingMode.DoublePointsModify,tc));let ug=tc;const ic=class ic extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new vC(e));this.ad(n.enabledChanged.don(s=>{!s&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))}));const o=i;if(Reflect.has(o,"points")){const s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`CircularAppendEditingWrapper:${o.typeName} 坐标属性无法绑定环形追加编辑`)}};m(ic,"type",ic.registerEditing("ESCesiumViewer",a.ESJEditingMode.CircularAppend,ic));let dg=ic;const nc=class nc extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new wC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`CircularInsertEditingWrapper:${i.typeName} 坐标属性无法绑定环形插值编辑`)}};m(nc,"type",nc.registerEditing("ESCesiumViewer",a.ESJEditingMode.CircularInsert,nc));let pg=nc;const oc=class oc extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new mC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`LineStringAppendEditingWrapper:${i.typeName} 坐标属性无法绑定线段追加编辑`)}};m(oc,"type",oc.registerEditing("ESCesiumViewer",a.ESJEditingMode.LineStringAppend,oc));let fg=oc;const sc=class sc extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new yC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`LineStringInsertEditingWrapper:${i.typeName} 坐标属性无法绑定线段插入编辑`)}};m(sc,"type",sc.registerEditing("ESCesiumViewer",a.ESJEditingMode.LineStringInsert,sc));let gg=sc;const rc=class rc extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new CC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`ScatterAppendEditingWrapper:${i.typeName} 坐标属性无法绑定散点追加编辑`)}};m(rc,"type",rc.registerEditing("ESCesiumViewer",a.ESJEditingMode.ScatterAppend,rc));let mg=rc;const ac=class ac extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new _C(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`ScatterModifyEditingWrapper:${i.typeName} 坐标属性无法绑定散点修改编辑`)}};m(ac,"type",ac.registerEditing("ESCesiumViewer",a.ESJEditingMode.ScatterModify,ac));let vg=ac;const lc=class lc extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new nr(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`VisibilityAppendEditingWrapper:${i.typeName} 坐标属性无法绑定可见性追加编辑`)}};m(lc,"type",lc.registerEditing("ESCesiumViewer",a.ESJEditingMode.VisibilityAppend,lc));let yg=lc;const cc=class cc extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new or(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`VisibilityModifyEditingWrapper:${i.typeName} 坐标属性无法绑定可见性修改编辑`)}};m(cc,"type",cc.registerEditing("ESCesiumViewer",a.ESJEditingMode.VisibilityModify,cc));let wg=cc;const hc=class hc extends Pt{constructor(i,e){if(super(i,e,!0),!e.viewer)return;const n=this.currentEditing=this.ad(new PC(e));if(Reflect.has(i,"points")){const s=i,r=Reflect.has(s,"extrudedHeight"),l=Reflect.has(s,"height"),c=Reflect.has(s,"perPositionHeight")?s.perPositionHeight:!r,u=s instanceof a.ESClassification||s instanceof a.ESPolygonFence;let d=a.getMinMaxCorner(s.points).center,p=[...d],f=u?s.points[0][2]:0;c?r?p[2]=s.extrudedHeight:p[2]=s.height+f:(l&&(d[2]=s.height),r&&(p[2]=s.extrudedHeight)),n.startPosition=d,n.distance=p[2]-d[2],n.moveWithFirstPosition=!1;let g=[...d];this.ad(n.positionsChanged.don(()=>{n.positions.length===2&&(c?(s.points=s.points.map(v=>[v[0],v[1],v[2]+n.positions[0][2]-g[2]]),r?s.extrudedHeight=n.positions[1][2]:l&&(s.height=n.positions[1][2]-(u?n.positions[0][2]:0))):(l&&(s.height=n.positions[0][2]),r&&(s.extrudedHeight=n.positions[1][2])),g=[...n.positions[0]])}))}else throw new Error(`HeightModifyEditingWrapper:${i.typeName} 坐标属性无法绑定高度修改编辑`);n.init(),n.enabled=!0;const o=this.ad(a.createNextAnimateFrameEvent(n.enabledChanged,n.startPositionChanged));this.ad(o.don(()=>{(!n.enabled||!n.startPosition||a.equalsN3(n.startPosition,[0,0,0]))&&this.destroy()}))}};m(hc,"type",hc.registerEditing("ESCesiumViewer",a.ESJEditingMode.HeightModify,hc));let Cg=hc;const rt=class rt extends a.Destroyable{constructor(e,n,o,s=!0){super();m(this,"czmViewer");m(this,"sceneObject");m(this,"editingModes",[]);m(this,"editingID");m(this,"useKeyToSwitch");m(this,"currentIndex",0);m(this,"currentEditingMode");m(this,"currentEditingWrapper");m(this,"_notSupportedEditCount",this.disposeVar(a.react(0)));m(this,"_onEditEnd",()=>{this._cleanupCurrentWrapper(),this.notSupportedEditCount<this.editingModes.length&&a.nextAnimateFrame(()=>this._createEditingMode(this.currentIndex+1))});this.czmViewer=e,this.sceneObject=n;const r=(Array.isArray(o)?o:[o]).filter(l=>n.supportEditingModes().includes(l));if(this.editingModes=r,this.editingID=n.editingID,this.useKeyToSwitch=s,this.editingModes.length)console.log("[ESEditMode] 可用的编辑模式",r);else{console.warn("[ESEditMode] 无可用的编辑模式");return}this._bindEvents(),this._createEditingMode(this.currentIndex),this._emitEditingEvent("start",{modes:this.editingModes})}get notSupportedEditCount(){return this._notSupportedEditCount.value}set notSupportedEditCount(e){this._notSupportedEditCount.value=e}get notSupportedEditCountChanged(){return this._notSupportedEditCount.changed}_emitEditingEvent(e,n){this.czmViewer.editingEvent.emit({objectIDs:[this.sceneObject.parentID],editingID:this.editingID,type:e,add:n})}_bindEvents(){this.ad(this.sceneObject.toDestroyEvent.don(rt.stop)),this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===rt.KEY_ESCAPE&&rt.stop())),this.ad(this.czmViewer.dblclickEvent.don(e=>{var n;return((n=e.pointerEvent)==null?void 0:n.button)===rt.MOUSE_LEFT&&a.nextAnimateFrame(()=>{rt.stop()})})),this.useKeyToSwitch&&this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===rt.KEY_SPACE&&this._onEditEnd())),this.ad(()=>this._cleanupCurrentWrapper()),this.ad(this.notSupportedEditCountChanged.don(()=>{this.notSupportedEditCount>=this.editingModes.length&&rt.stop()}))}_cleanupCurrentWrapper(){this.currentEditingWrapper&&!this.currentEditingWrapper.isDestroyed()&&this.currentEditingWrapper.destroy(),this.currentEditingWrapper=void 0}_createEditingMode(e){if(this.editingModes.length){e>=this.editingModes.length&&(e=0),this.currentIndex=e,this.currentEditingMode=this.editingModes[e];try{const n=a.EngineObject.contextEditing.getEngineObjConstructor(this.currentEditingMode,this.czmViewer.typeName);if(!n){this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd();return}this.currentEditingWrapper=new n(this.sceneObject,this.czmViewer),this._emitEditingEvent("changed",{cMode:this.currentEditingMode,cIndex:e}),this.notSupportedEditCount=0}catch(n){this.notSupportedEditCount++,console.error(`[ESEditMode] 创建编辑模式${this.currentEditingMode}失败`,n),this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd()}}}static create(e,n,o,s=!0){rt.stop(),rt.esEditModeInstance=new rt(e,n,o,s)}static stop(){const e=rt.esEditModeInstance;if(e&&!e.isDestroyed()){const{czmViewer:n,sceneObject:o,editingID:s,editingModes:r}=e;e.destroy(),n.editingEvent.emit({objectIDs:[o.parentID],editingID:s,type:"end",add:{modes:r}})}rt.esEditModeInstance=void 0}};m(rt,"KEY_ESCAPE","Escape"),m(rt,"KEY_SPACE","Space"),m(rt,"MOUSE_LEFT",0),m(rt,"esEditModeInstance");let Wh=rt;function bC(){const t=a.createProcessingFromAsyncFunc(async(i,e,n,o)=>{e.editingEvent.emit({objectIDs:n.map(c=>c.parentID),editingID:o,type:"start"});const s=()=>{e.editingEvent.emit({objectIDs:n.map(c=>c.parentID),editingID:o,type:"end"}),t.isRunning&&t.cancel()};i.disposer.ad(s);const r=c=>{c.code=="Escape"&&s()};i.disposer.ad(e.keyDownEvent.don(r));const l=new Uh(n,e);i.disposer.ad(()=>{!l.isDestroyed()&&l.destroy()}),await i.promise(new Promise(c=>{l.isDestroyed()&&c(),i.disposer.ad(l.toDestroyEvent.don(()=>{console.log("移动结束"),c()})),i.disposer.ad(e.dblclickEvent.don(()=>c()))}))});return t}class CF extends a.Destroyable{constructor(i,e){super(),this._czmViewer=i,a.registerCreatedEventUpdate(this,e,()=>{let n;const o=i.getEngineObject(e);e instanceof a.ESBoxClipping&&(n=o.czmBoxClippingPlanes),!(!n||!("computedClippingPlanes"in n)||!("computedClippingPlanesChanged"in n))&&(this.dispose(a.track([this._czmViewer,"sceneGlobeClippingPlanes"],[n,"computedClippingPlanes"])),this.dispose(()=>this._czmViewer.sceneGlobeClippingPlanes=void 0))})}}class _F extends a.Destroyable{constructor(e){super();m(this,"_clippingPlanesSceneObjectWithId",this.disposeVar(new a.ESSceneObjectWithId));this.dispose(a.track([this._clippingPlanesSceneObjectWithId,"id"],[e,"sceneGlobeClippingPlanesId"])),this.disposeVar(new a.ObjResettingWithEvent(this._clippingPlanesSceneObjectWithId.sceneObjectChanged,()=>{const{sceneObject:n}=this._clippingPlanesSceneObjectWithId;if(n)return new CF(e,n)}))}}class PF extends a.Destroyable{constructor(i){super(),this.dv(new a.ObjResettingWithEvent(i.sceneGlobeClippingPolygonsIdChanged,(e,n)=>{if(!(!e||e===n||e&&e.length===0))return new bF(i)}))}}class bF extends a.Destroyable{constructor(i){super(),this._czmViewer=i,this.d(()=>this._czmViewer.sceneGlobeClippingPolygons=void 0);const e=this._czmViewer.sceneGlobeClippingPolygonsId,n=o=>{if(!o)return;const s=this.dv(a.createNextAnimateFrameEvent(o.positionsChanged,o.reverseChanged,o.enabledChanged,o.showHelperChanged));this.dv(new a.ObjResettingWithEvent(s,()=>{if(o)return new SF(i,o)}))};for(let o=0;o<e.length;o++){const s=e[o],r=a.ESSceneObject.getSceneObjById(s);if(!r)return;let l;r instanceof a.ESExcavate?a.registerCreatedEventUpdate(this,r,()=>{l=i.getEngineObject(r).czmPolygonClipping,n(l)}):r instanceof a.ESHole&&a.registerCreatedEventUpdate(this,r.excavate,()=>{l=i.getEngineObject(r.excavate).czmPolygonClipping,n(l)})}}}class SF extends a.Destroyable{constructor(i,e){super(),this._czmViewer=i;const n=this._czmViewer.sceneGlobeClippingPolygonsId,o=e.enabled?e.reverse:void 0;if(n&&n.length>0){const s={polygons:[],enabled:!0,inverse:!1};for(let r=0;r<n.length;r++){const l=n[r],c=a.ESSceneObject.getSceneObjById(l);if(!c)return;let u;if(c instanceof a.ESExcavate?u=i.getEngineObject(c).czmPolygonClipping:c instanceof a.ESHole&&(u=i.getEngineObject(c.excavate).czmPolygonClipping),!u)return;u&&u.positions&&u.positions.length>=3&&u.enabled&&(s.polygons[r]={positions:u.positions},s.inverse=o??u.reverse)}this._czmViewer.sceneGlobeClippingPolygons=s}}}class EF extends a.Destroyable{constructor(i,e){var r;super(),this._viewer=i;const n=(r=this._viewer.extensions)==null?void 0:r.pickingManager;if(!n)return;const{objectsToExclude:o}=n,s=Array.isArray(e)?[...e]:[e];for(const l of s){if(o.includes(l))throw new Error("objectsToExclude.includes(p)");o.push(l)}this.dispose(()=>{for(let l of s){const c=o.indexOf(l);if(c===-1)throw new Error("-1 === objectsToExclude.indexOf(p)");o.splice(c,1)}})}}class xF extends a.Destroyable{constructor(e){var r;super();m(this,"_czmGlobeMaterial");this._czmViewer=e,this._czmGlobeMaterial=this.dv(new _o(e)),this._czmGlobeMaterial.show=!0;let n=Object.assign({},Re.defaults.terrainShader,this._czmViewer.terrainShader),o=(r=this._czmViewer.viewer)==null?void 0:r.scene.preUpdate.addEventListener(()=>{var c;const l=n.elevationContour.show&&(((c=this._czmViewer.getCameraInfo())==null?void 0:c.position[2])??0)<=n.elevationContour.spacing*1e3;this._czmGlobeMaterial.enableContour!==l&&(this._czmGlobeMaterial.enableContour=l)});this.d(()=>{o&&o()});const s=()=>{n=Object.assign({},Re.defaults.terrainShader,this._czmViewer.terrainShader),this._czmGlobeMaterial.shadingMode="none",n.aspect.show&&(this._czmGlobeMaterial.shadingMode="aspect"),n.slope.show&&(this._czmGlobeMaterial.shadingMode="slope"),n.elevationRamp.show&&(this._czmGlobeMaterial.shadingMode="elevation"),this._czmGlobeMaterial.contourSpacing=n.elevationContour.spacing,this._czmGlobeMaterial.contourWidth=n.elevationContour.width,this._czmGlobeMaterial.contourColor=n.elevationContour.color,this._czmGlobeMaterial.elevationParam={minHeight:n.elevationRamp.minHeight,maxHeight:n.elevationRamp.maxHeight,color:n.elevationRamp.color}};s(),this.d(this._czmViewer.terrainShaderChanged.don(s))}get czmGlobeMaterial(){return this._czmGlobeMaterial}}async function AF(t,i){const e={animation:!1,baseLayerPicker:!1,fullscreenButton:!1,geocoder:!1,homeButton:!1,infoBox:!1,sceneModePicker:!1,selectionIndicator:!1,timeline:!1,navigationHelpButton:!1,navigationInstructionsInitiallyVisible:!1,scene3DOnly:!0,...i??{}},n=new h.Viewer(t,e);return n.imageryLayers.removeAll(),n.extend(h.viewerCesiumInspectorMixin),n.cesiumInspector.container.style.display="none",n.extend(h.viewerCesium3DTilesInspectorMixin),n.cesium3DTilesInspector.container.style.display="none",n.cesium3DTilesInspector.viewModel.picking=!1,n.clock.currentTime=h.JulianDate.fromDate(new Date("2022-04-19T20:00:53.10067292911116965Z")),n.scene.screenSpaceCameraController.lookEventTypes=[{eventType:h.CameraEventType.RIGHT_DRAG}],n.scene.screenSpaceCameraController.zoomEventTypes=[h.CameraEventType.WHEEL,h.CameraEventType.PINCH,{eventType:h.CameraEventType.RIGHT_DRAG,modifier:h.KeyboardEventModifier.SHIFT}],n.scene.screenSpaceCameraController.tiltEventTypes=[h.CameraEventType.MIDDLE_DRAG,h.CameraEventType.PINCH,{eventType:h.CameraEventType.LEFT_DRAG,modifier:h.KeyboardEventModifier.CTRL},{eventType:h.CameraEventType.RIGHT_DRAG,modifier:h.KeyboardEventModifier.CTRL}],n.screenSpaceEventHandler.removeInputAction(h.ScreenSpaceEventType.LEFT_CLICK),n.screenSpaceEventHandler.removeInputAction(h.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),n._cesiumWidget._creditContainer.style.display="none",n}function TF(){h.Cesium3DTile.prototype.updateTransform=function(t,i){t=t??h.Matrix4.IDENTITY;const e=h.Matrix4.multiplyTransformation(t,this.transform,new h.Matrix4),n=!h.Matrix4.equals(e,this.computedTransform),o=h.defined(i)&&(this._verticalExaggeration!==i.verticalExaggeration||this._verticalExaggerationRelativeHeight!==i.verticalExaggerationRelativeHeight);if(!n&&!o)return;n&&h.Matrix4.clone(e,this.computedTransform),o&&(this._verticalExaggeration=i.verticalExaggeration,this._verticalExaggerationRelativeHeight=i.verticalExaggerationRelativeHeight);const s=this._header,r=this._contentHeader;this._boundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform),h.defined(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform)),h.defined(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(s.viewerRequestVolume,this.computedTransform)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()}}function MF(){Reflect.getOwnPropertyDescriptor(h.Camera.prototype,"_currentFlight")||Object.defineProperties(h.Camera.prototype,{_currentFlight:{get:function(){return this._vtxf_currentFlight},set:function(t){if(this._vtxf_currentFlight!==t){this._vtxf_currentFlight=t;var i=this._vtxf_currentFlight,e=t;this.currentFlightEvent.raiseEvent(e,i)}}},currentFlightEvent:{get:function(){return typeof this._vtxf_currentFlightEvent>"u"&&(this._vtxf_currentFlightEvent=new h.Event),this._vtxf_currentFlightEvent}}})}function IF(){const t=new h.Matrix4;function i(n,o){const s=n.positionWC;h.Matrix4.clone(n.transform,t),n.lookAtTransform(h.Matrix4.IDENTITY),n.look(s,o),n.lookAtTransform(t)}const e=Math.PI/60;h.Camera.prototype.lookLeft=function(n){n=n??e,this._mode!==h.SceneMode.SCENE2D&&i(this,-n)},h.Camera.prototype.lookRight=function(n){this.lookLeft(-n)}}function DF(){if(!h.DepthPlane.xbsjFixed){h.DepthPlane.xbsjFixed=!0;var t=h.DepthPlane.prototype.update;h.DepthPlane.prototype.update=function(){t.bind(this)(...arguments);var i=arguments[0];if(!this.hasXbsjIndexBuffer&&this._va){this.hasXbsjIndexBuffer=!0;var e=i.context,n=new h.Geometry({attributes:{position:new h.GeometryAttribute({componentDatatype:h.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(15)})},indices:[0,1,4,1,3,4,3,2,4,2,0,4],primitiveType:h.PrimitiveType.TRIANGLES});this._va=h.VertexArray.fromGeometry({context:e,geometry:n,attributeLocations:{position:0},bufferUsage:h.BufferUsage.DYNAMIC_DRAW}),this._command.vertexArray=this._va}}}}function RF(t){const i=t.BoundingSphere,e=t.Cartesian3,n=t.defined,o=t.OrientedBoundingBox,s=t.Rectangle,r=t.TaskProcessor,l=t.TerrainData,c=t.TerrainEncoding,u=t.TerrainMesh,d=t.GoogleEarthEnterpriseTerrainData,p="createVerticesFromGoogleEarthEnterpriseBuffer",f=new r(p),g=new r(p,l.maximumAsynchronousTasks),v=new s,y=new s;d.prototype.createMesh=function(w){w=w??ye.Frozen.EMPTY_OBJECT;const P=w.tilingScheme,C=w.x,S=w.y,x=w.level,A=w.exaggeration??1,R=w.exaggerationRelativeHeight??0,L=w.throttle??!0,B=P.ellipsoid;P.tileXYToNativeRectangle(C,S,x,v),P.tileXYToRectangle(C,S,x,y);const V=B.cartographicToCartesian(s.center(y));this._skirtHeight=6378137*.3;const O=(L?g:f).scheduleTask({buffer:this._buffer,nativeRectangle:v,rectangle:s.clone(y),relativeToCenter:V,ellipsoid:B,skirtHeight:this._skirtHeight,exaggeration:A,exaggerationRelativeHeight:R,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!n(O))return;const N=this;return O.then(function(_){return N._mesh=new u(V,new Float32Array(_.vertices),new Uint16Array(_.indices),_.indexCountWithoutSkirts,_.vertexCountWithoutSkirts,_.minimumHeight,_.maximumHeight,i.clone(_.boundingSphere3D),e.clone(_.occludeePointInScaledSpace),_.numberOfAttributes,o.clone(_.orientedBoundingBox),c.clone(_.encoding),_.westIndicesSouthToNorth,_.southIndicesEastToWest,_.eastIndicesNorthToSouth,_.northIndicesWestToEast),N._minimumHeight=_.minimumHeight,N._maximumHeight=_.maximumHeight,N._buffer=void 0,N._mesh})}}function FF(){return h.VERSION.split(".").map(i=>parseInt(i))}let _g;function zF(){return _g||(_g=FF()),_g}function LF(){const t=zF();t[0]===1&&t[1]>=92?RF(h):console.warn(`don't need to fixGoogleEarth, cesium version is ${t.join(".")}`)}function OF(){const t=h.Resource.prototype.fetchJson,i=h.Resource.prototype.fetchArrayBuffer;h.Resource.prototype.fetchJson=function(...e){if(this.url.startsWith(`https://${a.defaultLocalFileServer.prefix}`)){const n=this.url.substring(8);return a.defaultLocalFileServer.getJson(n)}else return t.call(this,...e)},h.Resource.prototype.fetchArrayBuffer=function(...e){if(this.url.startsWith(`https://${a.defaultLocalFileServer.prefix}`)){const n=this.url.substring(8);return a.defaultLocalFileServer.getArrayBuffer(n).then(o=>{if(!o)throw new Error("result is undefined!");return o})}else return i.call(this,...e)}}function NF(){const t=h.ModelSceneGraph.prototype.buildDrawCommands;h.ModelSceneGraph.prototype.buildDrawCommands=function(...i){const e=this._model,n=e.modelMatrix;e.modelMatrix=h.Matrix4.IDENTITY;const o=t.call(this,...i);return e.modelMatrix=n,o}}function BF(){const t=h.ShaderSource._czmBuiltinsAndUniforms;t.czm_materialInput.indexOf("vec4 color")===-1&&(t.czm_materialInput=t.czm_materialInput.replace("float aspect;","float aspect; vec4 color;"))}const VF=`#ifdef GL_OES_standard_derivatives
1926
1926
  #extension GL_OES_standard_derivatives : enable
1927
1927
  #endif
1928
1928
 
@@ -1956,7 +1956,7 @@ material.alpha = materialInput.color.a;
1956
1956
 
1957
1957
  return material;
1958
1958
  }
1959
- `;h.Material.GlobeLevelMaterialType="GlobelLevel",h.Material._materialCache.addMaterial(h.Material.GlobeLevelMaterialType,{fabric:{type:h.Material.GlobeLevelMaterialType,uniforms:{input_shadows:new h.Cartesian3(0,0,0),input_highlights:new h.Cartesian3(1,1,1),midtones:new h.Cartesian3(.5,.5,.5),output_shadows:new h.Cartesian3(0,0,0),output_highlights:new h.Cartesian3(1,1,1)},source:BF},translucent:!1});const{PrimitiveRenderResources:VF,ModelUtility:UF,Cartesian3:ai,Matrix4:sr,ModelRenderResources:WF,defined:GF,NodeRenderResources:HF,BoundingSphere:rn,ModelDrawCommands:$F}=h,qF=new ai,XF=new ai,SC=new ai,EC=new ai;class YF extends VF{constructor(i,e,n){if(super(i,e),!i.runtimeNode.instancingTranslationMin||!i.runtimeNode.instancingTranslationMax)return;const o=sr.inverse(n,new sr),s=UF.getPositionMinMax(e.primitive,sr.multiplyByPoint(o,i.runtimeNode.instancingTranslationMin,SC),sr.multiplyByPoint(o,i.runtimeNode.instancingTranslationMax,EC));this.positionMin=ai.clone(s.min,new ai),this.positionMax=ai.clone(s.max,new ai),this.boundingSphere=rn.fromCornerPoints(this.positionMin,this.positionMax,new rn)}}function ZF(){h.ModelSceneGraph.prototype.buildDrawCommands=function(t){const i=this._model,e=new WF(i);i.statistics.clear(),this.configurePipeline(t);const n=this.modelPipelineStages;let o,s,r;for(o=0;o<n.length;o++)n[o].process(e,i,t);const l=ai.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,qF),c=ai.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,XF);for(o=0;o<this._runtimeNodes.length;o++){const u=this._runtimeNodes[o];if(!GF(u))continue;u.configurePipeline();const d=u.pipelineStages,p=new HF(e,u);for(s=0;s<d.length;s++)d[s].process(p,u.node,t);const f=u.computedTransform;for(s=0;s<u.runtimePrimitives.length;s++){const g=u.runtimePrimitives[s];g.configurePipeline(t);const v=g.pipelineStages,y=new YF(p,g,f);for(r=0;r<v.length;r++)v[r].process(y,g.primitive,t);g.boundingSphere=rn.clone(y.boundingSphere,new rn);const w=sr.multiplyByPoint(f,y.positionMin,SC),P=sr.multiplyByPoint(f,y.positionMax,EC);ai.minimumByComponent(l,w,l),ai.maximumByComponent(c,P,c);const C=$F.buildModelDrawCommand(y,t);g.drawCommand=C}}this._boundingSphere=rn.fromCornerPoints(l,c,new rn),this._boundingSphere=rn.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=rn.transform(this._boundingSphere,this._components.transform,this._boundingSphere),i._boundingSphere=rn.transform(this._boundingSphere,i.modelMatrix,i._boundingSphere),i._initialRadius=i._boundingSphere.radius,i._boundingSphere.radius*=i._clampedScale}}const uc=class uc extends a.Destroyable{constructor(){super(),h.ParticleSystem.prototype.update=function(i){const e=i.time;i.time=this._falseTime;try{uc.oldUpdate.call(this,i),this._particles.forEach(n=>{h.Billboard.prototype&&(n._billboard.ESSceneObjectID=this.ESSceneObjectID)})}catch{}i.time=e},this.d(()=>{h.ParticleSystem.prototype.update=uc.oldUpdate})}};m(uc,"oldUpdate",h.ParticleSystem.prototype.update);let Pg=uc;function QF(){if(h.ParticleSystem.prototype.timeStamp!==void 0){console.warn("fixParticleSystem已经执行过!");return}Object.defineProperties(h.ParticleSystem.prototype,{timeStamp:{get(){return this._innerCurrentTimeStamp===void 0&&(this._innerCurrentTimeStamp=0),this._innerCurrentTimeStamp},set(t){this.timeStamp!==t&&(this._innerCurrentTimeStamp=t,h.JulianDate.fromDate(new Date(t),this._falseTime))}},_falseTime:{get(){return this.__falseTime||(this.__falseTime=h.JulianDate.fromDate(new Date(0))),this.__falseTime}}})}class kF{constructor(i){m(this,"index");m(this,"image");m(this,"resolve");m(this,"reject");m(this,"rectangle");this.index=i.index,this.image=i.image,this.resolve=i.resolve,this.reject=i.reject,this.rectangle=void 0}}function KF(){h.TextureAtlas.prototype._resize=function(t,i=0){const e=this._borderWidthInPixels,n=this._rectangles,o=this._imagesToAddQueue,s=this._texture;let r=s.width,l=s.height;const c=this._subRegions,u=n.map((P,C)=>new kF({index:C,image:P})).filter((P,C)=>h.defined(P.image)&&!h.defined(c.get(C)));let d=0,p=0,f=0;for(let P=i;P<o.length;++P){const{width:C,height:S}=o[P].image;d=Math.max(d,C),p=Math.max(p,S),f+=C*S,u.push(o[P])}r=Math.max(d,r),l=Math.max(p,l),t.webgl2||(r=h.Math.nextPowerOfTwo(r),l=h.Math.nextPowerOfTwo(l));const g=Math.sqrt(f);l*=Math.ceil(g/l),r*=Math.ceil(g/r),u.sort(({image:P},{image:C})=>C.height*C.width-P.height*P.width);const v=new Array(this._nextIndex);for(const P of this._subRegions.keys())h.defined(c.get(P))&&(v[P]=n[P]);let y,w=!1;for(;!w;){y=new h.TexturePacker({height:l,width:r,borderPadding:e});let P;for(P=0;P<u.length;++P){const{index:C,image:S}=u[P];if(!h.defined(S))continue;const x=y.pack(C,S);if(!h.defined(x)){r>l?l*=2:r*=2;break}v[C]=x.rectangle}w=P===u.length}this._texturePacker=y,this._texture=this._copyFromTexture(t,r,l,v),s.destroy(),this._rectangles=v,this._guid=h.createGuid()}}const $n={LOADED:2,PROCESSING:3,FAILED:7},{Attribute:JF,Indices:jF,FeatureIdAttribute:xC,FeatureIdTexture:AC,FeatureIdImplicitRange:TC,MorphTarget:ez,Primitive:tz,Instances:iz,Skin:nz,Node:oz,AnimatedPropertyType:sz,AnimationSampler:rz,AnimationTarget:az,AnimationChannel:lz,Animation:cz,ArticulationStage:hz,Articulation:uz,Asset:dz,Scene:pz,Components:fz,MetallicRoughness:gz,SpecularGlossiness:mz,Specular:vz,Anisotropy:bg,Clearcoat:Sg,Material:yz}=h.ModelComponents;function wz(){h.GltfLoader.prototype.process=function(t){if(h.Check.typeOf.object("frameState",t),this._state===$n.LOADED&&!h.defined(this._loadResourcesPromise)&&(this._loadResourcesPromise=Cz(this,t).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),h.defined(this._processError)){this._state=$n.FAILED;const o=this._processError;this._processError=void 0,Eg(this,o)}const i=this._textureErrors.pop();if(h.defined(i)){const o=this.getError("Failed to load glTF texture",i);throw o.name="TextureError",o}if(this._state===$n.FAILED)return!1;let e=!1;try{e=this._process(t)}catch(o){this._state=$n.FAILED,Eg(this,o)}let n=!1;try{n=this._processTextures(t)}catch(o){this._textureState=$n.FAILED,Eg(this,o)}return this._incrementallyLoadTextures?e:e&&n}}async function Cz(t,i){h.FeatureDetection.supportsWebP.initialized||await h.FeatureDetection.supportsWebP.initialize(),t._supportedImageFormats=new h.SupportedImageFormats({webp:h.FeatureDetection.supportsWebP(),basis:i.context.supportsBasis});const e=Pz(t,i);return t._state=$n.PROCESSING,t._textureState=$n.PROCESSING,h.defined(t._gltfJsonLoader)&&t._releaseGltfJson&&(h.ResourceCache.unload(t._gltfJsonLoader),t._gltfJsonLoader=void 0),e}const _z=new h.Cartesian3;function Pz(t,i){const e=t.gltfJson,n=e.extensions??h.Frozen.EMPTY_OBJECT,o=n.EXT_structural_metadata,s=n.EXT_feature_metadata,r=n.CESIUM_RTC;if(h.defined(s)){const C=s.featureTables,S=s.featureTextures,x=h.defined(C)?C:[],A=h.defined(S)?S:[];t._sortedPropertyTableIds=Object.keys(x).sort(),t._sortedFeatureTextureIds=Object.keys(A).sort()}const l=bz(t,i),c=Tz(t,l),u=Mz(t,l),d=Iz(e),p=Dz(e,l),f=new fz,g=new dz,v=e.asset.copyright;if(h.defined(v)){const C=v.split(";").map(function(S){return new h.Credit(S.trim())});g.credits=C}if(f.asset=g,f.scene=p,f.nodes=l,f.skins=c,f.animations=u,f.articulations=d,f.upAxis=t._upAxis,f.forwardAxis=t._forwardAxis,h.defined(r)){const C=h.Cartesian3.fromArray(r.center,0,_z);f.transform=h.Matrix4.fromTranslation(C,f.transform)}if(t._components=f,h.defined(o)||h.defined(s)){const C=Rz(t,o,s,i);t._loaderPromises.push(C)}const y=n.NGA_gpm_local;if(h.defined(y)){const C=h.GltfGpmLoader.load(y);t._components.extensions.NGA_gpm_local=C}const w=e.meshes;if(h.defined(w))for(const C of w){const S=C.primitives;if(h.defined(S))for(const x of S){const A=x.extensions;if(h.defined(A)){const R=A.NGA_gpm_local;if(h.defined(R)){const L=Fz(t,e,R,i);t._loaderPromises.push(L)}}}}const P=[];return NC(P,t._loaderPromises),t._incrementallyLoadTextures||NC(P,t._texturesPromises),Promise.all(P)}function bz(t,i){const e=t.gltfJson.nodes;if(!h.defined(e))return[];const n=e.map(function(o,s){const r=Sz(t,o,i);return r.index=s,r});for(let o=0;o<n.length;++o){const s=e[o].children;if(h.defined(s))for(let r=0;r<s.length;++r)n[o].children.push(n[s[r]])}return n}function Sz(t,i,e){const n=new oz;n.name=i.name,n.matrix=Kt(h.Matrix4,i.matrix),n.translation=Kt(h.Cartesian3,i.translation),n.rotation=Kt(h.Quaternion,i.rotation),n.scale=Kt(h.Cartesian3,i.scale);const o=i.extensions??h.Frozen.EMPTY_OBJECT,s=o.EXT_mesh_gpu_instancing,r=o.AGI_articulations;if(h.defined(s)){if(t._loadForClassification)throw new h.RuntimeError("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");n.instances=zz(t,o,e)}h.defined(r)&&(n.articulationName=r.articulationName);const l=i.mesh;if(h.defined(l)){const c=t.gltfJson.meshes[l],u=c.primitives;for(let f=0;f<u.length;++f)n.primitives.push(Ez(t,u[f],h.defined(n.instances),e));const d=i.weights??c.weights,p=n.primitives[0].morphTargets;n.morphWeights=h.defined(d)?d.slice():new Array(p.length).fill(0)}return n}function Ez(t,i,e,n){const o=new tz,s=new h.PrimitiveLoadPlan(o);t._primitiveLoadPlans.push(s);const r=i.material;h.defined(r)&&(o.material=xz(t,t.gltfJson.materials[r],n));const l=i.extensions??h.Frozen.EMPTY_OBJECT;let c=!1;const u=l.CESIUM_primitive_outline;t._loadPrimitiveOutline&&h.defined(u)&&(c=!0,s.needsOutlines=!0,s.outlineIndices=Lz(t,u));const d=l.KHR_spz_gaussian_splats_compression;h.defined(d)&&(c=!0,s.needsGaussianSplats=!0);const p=t._loadForClassification,f=l.KHR_draco_mesh_compression;let g=!1;const v=i.attributes;if(h.defined(v))for(const R in v){if(!v.hasOwnProperty(R))continue;const L=v[R],B=xg(t,h.VertexAttributeSemantic,R),V=B.modelSemantic;if(p&&!Nz(V))continue;V===h.VertexAttributeSemantic.FEATURE_ID&&(g=!0);const G=MC(t,L,B,i,f,d,e,c,n);s.attributePlans.push(G),o.attributes.push(G.attribute)}const y=i.targets;if(h.defined(y)&&!p)for(let R=0;R<y.length;++R)o.morphTargets.push(Bz(t,y[R],c,s,n));const w=i.indices;if(h.defined(w)){const R=Vz(t,w,i,f,g,c,n);h.defined(R)&&(s.indicesPlan=R,o.indices=R.indices)}const P=l.EXT_structural_metadata,C=l.EXT_mesh_features,S=l.EXT_feature_metadata,x=h.defined(S);h.defined(C)?Uz(t,o,C,n):x&&Wz(t,o,S,n),h.defined(P)?Gz(o,P):x&&Hz(t,o,S);const A=i.mode;if(p&&A!==h.PrimitiveType.TRIANGLES)throw new h.RuntimeError("Only triangle meshes can be used for classification.");return o.primitiveType=A,o}function xz(t,i,e){const n=new yz,o=i.extensions??h.Frozen.EMPTY_OBJECT,s=o.KHR_materials_pbrSpecularGlossiness,r=o.KHR_materials_specular,l=o.KHR_materials_anisotropy,c=o.KHR_materials_clearcoat,u=i.pbrMetallicRoughness;return n.unlit=h.defined(o.KHR_materials_unlit),h.defined(s)?n.specularGlossiness=Az(t,s,e):(h.defined(u)&&(n.metallicRoughness=$z(t,u,e)),h.defined(r)&&!n.unlit&&(n.specular=qz(t,r,e)),h.defined(l)&&!n.unlit&&(n.anisotropy=Xz(t,l,e)),h.defined(c)&&!n.unlit&&(n.clearcoat=Yz(t,c,e))),h.defined(i.emissiveTexture)&&(n.emissiveTexture=Et(t,i.emissiveTexture,e,void 0)),h.defined(i.normalTexture)&&!t._loadForClassification&&(n.normalTexture=Et(t,i.normalTexture,e,void 0)),h.defined(i.occlusionTexture)&&(n.occlusionTexture=Et(t,i.occlusionTexture,e,void 0)),n.emissiveFactor=Kt(h.Cartesian3,i.emissiveFactor),n.alphaMode=i.alphaMode,n.alphaCutoff=i.alphaCutoff,n.doubleSided=i.doubleSided,n.name=i.name,n}function Az(t,i,e){const{diffuseTexture:n,specularGlossinessTexture:o,diffuseFactor:s,specularFactor:r,glossinessFactor:l}=i,c=new mz;return h.defined(n)&&(c.diffuseTexture=Et(t,n,e,void 0)),h.defined(o)&&(c.specularGlossinessTexture=Et(t,o,e,void 0)),c.diffuseFactor=Kt(h.Cartesian4,s),c.specularFactor=Kt(h.Cartesian3,r),c.glossinessFactor=l,c}function Eg(t,i){throw t.unload(),t.getError("Failed to load glTF",i)}function Tz(t,i){const e=t.gltfJson.skins;if(t._loadForClassification||!h.defined(e))return[];const n=e.map(function(s,r){const l=Zz(t,s,i);return l.index=r,l}),o=t.gltfJson.nodes;for(let s=0;s<i.length;++s){const r=o[s].skin;h.defined(r)&&(i[s].skin=n[r])}return n}function Mz(t,i){const e=t.gltfJson.animations;return t._loadForClassification||!h.defined(e)?[]:e.map(function(o,s){const r=Qz(t,o,i);return r.index=s,r})}function Iz(t){var n;const e=(n=(t.extensions??h.Frozen.EMPTY_OBJECT).AGI_articulations)==null?void 0:n.articulations;return h.defined(e)?e.map(kz):[]}function Dz(t,i){const e=new pz,n=Kz(t);return e.nodes=n.map(function(o){return i[o]}),e}async function Rz(t,i,e,n){const o=new h.GltfStructuralMetadataLoader({gltf:t.gltfJson,extension:i,extensionLegacy:e,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:n,asynchronous:t._asynchronous});return t._structuralMetadataLoader=o,o.load()}async function Fz(t,i,e,n){const o=new h.GltfMeshPrimitiveGpmLoader({gltf:i,extension:e,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:n,asynchronous:t._asynchronous});return t._meshPrimitiveGpmLoader=o,o.load()}function Kt(t,i){if(h.defined(i))return t===Number?i[0]:t.unpack(i)}function zz(t,i,e){const n=i.EXT_mesh_gpu_instancing,o=new iz,s=n.attributes;if(h.defined(s))for(const u in s){if(!s.hasOwnProperty(u))continue;const d=s[u];o.attributes.push(Jz(t,d,s,u,e))}const r=n.extensions??h.Frozen.EMPTY_OBJECT,l=i.EXT_instance_features,c=r.EXT_feature_metadata;return h.defined(l)?jz(o,l):h.defined(c)&&eL(t.gltfJson,o,c,t._sortedPropertyTableIds),o}function Lz(t,i){const e=i.indices,n=t.gltfJson.accessors[e];return Gh(t,n,!1)}const Oz={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function xg(t,i,e){let n=e;t._renameBatchIdSemantic&&(e==="_BATCHID"||e==="BATCHID")&&(n="_FEATURE_ID_0");const o=i.fromGltfSemantic(n),s=Oz;return s.gltfSemantic=e,s.renamedSemantic=n,s.modelSemantic=o,s}function Nz(t){const i=t===h.VertexAttributeSemantic.POSITION,e=t===h.VertexAttributeSemantic.FEATURE_ID,n=t===h.VertexAttributeSemantic.TEXCOORD;return i||e||n}function MC(t,i,e,n,o,s,r,l,c){const u=e.modelSemantic,d=u===h.VertexAttributeSemantic.POSITION,p=u===h.VertexAttributeSemantic.FEATURE_ID,f=d&&!r&&t._loadAttributesFor2D&&!c.scene3DOnly,g=d&&t._enablePick&&!c.context.webgl2,v=t._loadForClassification&&p,y=t._loadAttributesAsTypedArray,w=!y,P=y||f||g||v,x=IC(t,i,e,n,o,s,l?!1:w,l?!0:P,c),A=new h.PrimitiveLoadPlan.AttributeLoadPlan(x);return A.loadBuffer=w,A.loadTypedArray=P,A}function Bz(t,i,e,n,o){const s=new ez,r=void 0,l=void 0,c=void 0,u=!1;for(const d in i){if(!i.hasOwnProperty(d))continue;const p=i[d],f=xg(t,VertexAttributeSemantic,d),g=MC(t,p,f,r,l,c,u,e,o);s.attributes.push(g.attribute),n.attributePlans.push(g)}return s}function Vz(t,i,e,n,o,s,r){const l=t.gltfJson.accessors[i],c=l.bufferView;if(!h.defined(n)&&!h.defined(c))return;const u=new jF;u.count=l.count;const d=t._loadAttributesAsTypedArray,p=(t._loadIndicesForWireframe||t._enablePick)&&!r.context.webgl2,f=t._loadForClassification&&o,v=!d,y=d||p||f,C=tL(t,i,e,n,s?!1:v,s?!0:y,r),S=t._geometryLoaders.length;t._geometryLoaders.push(C);const x=C.load();t._loaderPromises.push(x),t._geometryCallbacks[S]=()=>{u.indexDatatype=C.indexDatatype,u.buffer=C.buffer,u.typedArray=C.typedArray};const A=new h.PrimitiveLoadPlan.IndicesLoadPlan(u);return A.loadBuffer=v,A.loadTypedArray=y,A}function Uz(t,i,e,n){let o;h.defined(e)&&h.defined(e.featureIds)?o=e.featureIds:o=[];for(let s=0;s<o.length;s++){const r=o[s],l=`featureId_${s}`;let c;h.defined(r.texture)?c=iL(t,r,n,l):h.defined(r.attribute)?c=DC(r,l):c=RC(r,l),i.featureIds.push(c)}}function Wz(t,i,e,n){const{featureTables:o}=t.gltfJson.extensions.EXT_feature_metadata;let s=0;const r=e.featureIdAttributes;if(h.defined(r))for(let c=0;c<r.length;++c){const u=r[c],d=u.featureTable,p=t._sortedPropertyTableIds.indexOf(d),f=o[d].count,g=`featureId_${s}`;s++;let v;h.defined(u.featureIds.attribute)?v=FC(u,p,f,g):v=zC(u,p,f,g),i.featureIds.push(v)}const l=e.featureIdTextures;if(h.defined(l))for(let c=0;c<l.length;++c){const u=l[c],d=u.featureTable,p=t._sortedPropertyTableIds.indexOf(d),f=o[d].count,g=`featureId_${s}`;s++;const v=nL(t,u,p,n,f,g);i.featureIds.push(v)}}function Gz(t,i){if(!h.defined(i))return;const{propertyTextures:e,propertyAttributes:n}=i;h.defined(e)&&(t.propertyTextureIds=e),h.defined(n)&&(t.propertyAttributeIds=n)}function Hz(t,i,e){h.defined(e.featureTextures)&&(i.propertyTextureIds=e.featureTextures.map(function(n){return t._sortedFeatureTextureIds.indexOf(n)}))}function $z(t,i,e){const{baseColorTexture:n,metallicRoughnessTexture:o,baseColorFactor:s,metallicFactor:r,roughnessFactor:l}=i,c=new gz;return h.defined(n)&&(c.baseColorTexture=Et(t,n,e,void 0)),h.defined(o)&&(c.metallicRoughnessTexture=Et(t,o,e,void 0)),c.baseColorFactor=Kt(h.Cartesian4,s),c.metallicFactor=r,c.roughnessFactor=l,c}function qz(t,i,e){const{specularFactor:n,specularTexture:o,specularColorFactor:s,specularColorTexture:r}=i,l=new vz;return h.defined(o)&&(l.specularTexture=Et(t,o,e,void 0)),h.defined(r)&&(l.specularColorTexture=Et(t,r,e,void 0)),l.specularFactor=n,l.specularColorFactor=Kt(h.Cartesian3,s),l}function Xz(t,i,e){const{anisotropyStrength:n=bg.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=bg.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:s}=i,r=new bg;return h.defined(s)&&(r.anisotropyTexture=Et(t,s,e,void 0)),r.anisotropyStrength=n,r.anisotropyRotation=o,r}function Yz(t,i,e){const{clearcoatFactor:n=Sg.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:s=Sg.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:r,clearcoatNormalTexture:l}=i,c=new Sg;return h.defined(o)&&(c.clearcoatTexture=Et(t,o,e,void 0)),h.defined(r)&&(c.clearcoatRoughnessTexture=Et(t,r,e,void 0)),h.defined(l)&&(c.clearcoatNormalTexture=Et(t,l,e,void 0)),c.clearcoatFactor=n,c.clearcoatRoughnessFactor=s,c}function Et(t,i,e,n){const o=t.gltfJson,s=h.GltfLoaderUtil.getImageIdFromTexture({gltf:o,textureId:i.index,supportedImageFormats:t._supportedImageFormats});if(!h.defined(s))return;const r=h.ResourceCache.getTextureLoader({gltf:o,textureInfo:i,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:e,asynchronous:t._asynchronous}),l=h.GltfLoaderUtil.createModelTextureReader({textureInfo:i}),c=t._textureLoaders.length;t._textureLoaders.push(r);const u=r.load().catch(d=>{if(!t.isDestroyed()){if(!t._incrementallyLoadTextures)throw d;t._textureState=$n.FAILED,t._textureErrors.push(d)}});return t._texturesPromises.push(u),t._textureCallbacks[c]=()=>{l.texture=r.texture,h.defined(n)&&(l.texture.sampler=n)},l}function Zz(t,i,e){const n=new nz,o=i.joints;n.joints=o.map(r=>e[r]);const s=i.inverseBindMatrices;if(h.defined(s)){const r=t.gltfJson.accessors[s];n.inverseBindMatrices=Gh(t,r,void 0)}else n.inverseBindMatrices=new Array(o.length).fill(h.Matrix4.IDENTITY);return n}function Qz(t,i,e){const n=new cz;n.name=i.name;const o=i.samplers.map(function(r,l){const c=oL(t,r);return c.index=l,c}),s=i.channels.map(function(r){return sL(r,o,e)});return n.samplers=o,n.channels=s,n}function kz(t){const i=new uz;return i.name=t.name,i.stages=t.stages.map(aL),i}function Kz(t){let i;return h.defined(t.scenes)&&h.defined(t.scene)&&(i=t.scenes[t.scene].nodes),i=i??t.nodes,i=h.defined(i)?i:[],i}function Jz(t,i,e,n,o){const s=t.gltfJson.accessors,r=h.defined(e.ROTATION),l=h.defined(e.TRANSLATION)&&h.defined(s[e.TRANSLATION].min)&&h.defined(s[e.TRANSLATION].max),c=xg(t,h.InstanceAttributeSemantic,n),u=c.modelSemantic,d=u===h.InstanceAttributeSemantic.TRANSLATION||u===h.InstanceAttributeSemantic.ROTATION||u===h.InstanceAttributeSemantic.SCALE,p=u===h.InstanceAttributeSemantic.TRANSLATION,f=t._loadAttributesAsTypedArray||r&&d||!o.context.instancedArrays,g=t._enablePick&&!o.context.webgl2,v=!f,y=t._loadAttributesFor2D&&!o.scene3DOnly;return IC(t,i,c,void 0,void 0,void 0,v,f||p&&(!l||y||g),o)}function jz(t,i){const e=i.featureIds;for(let n=0;n<e.length;n++){const o=e[n],s=`instanceFeatureId_${n}`;let r;h.defined(o.attribute)?r=DC(o,s):r=RC(o,s),t.featureIds.push(r)}}function eL(t,i,e,n){const o=t.extensions.EXT_feature_metadata.featureTables,s=e.featureIdAttributes;if(h.defined(s))for(let r=0;r<s.length;++r){const l=s[r],c=l.featureTable,u=n.indexOf(c),d=o[c].count,p=`instanceFeatureId_${r}`;let f;h.defined(l.featureIds.attribute)?f=FC(l,u,d,p):f=zC(l,u,d,p),i.featureIds.push(f)}}function Gh(t,i,e){const n=new Array(i.count),o=i.bufferView;if(h.defined(o)){const s=rL(t,o),r=lL(t,s,i,e,n);return t._loaderPromises.push(r),n}return cL(i,n)}function IC(t,i,e,n,o,s,r,l,c){const u=t.gltfJson,d=u.accessors[i],p=d.bufferView,f=e.gltfSemantic,g=e.renamedSemantic,v=e.modelSemantic,y=h.defined(v)?LC(g):void 0,P=hL(u,i,f,v,y);if(!h.defined(o)&&!h.defined(p)&&!h.defined(s))return P;const C=uL(t,i,f,n,o,s,r,l,c),S=t._geometryLoaders.length;t._geometryLoaders.push(C);const x=C.load();return t._loaderPromises.push(x),t._geometryCallbacks[S]=()=>{h.defined(o)&&h.defined(o.attributes)&&h.defined(o.attributes[f])?dL(P,C,r,l):h.defined(s)?pL(P,C,r,l):fL(u,d,P,C,r,l)},P}function tL(t,i,e,n,o,s,r){return h.ResourceCache.getIndexBufferLoader({gltf:t.gltfJson,accessorId:i,gltfResource:t._gltfResource,baseResource:t._baseResource,frameState:r,primitive:e,draco:n,asynchronous:t._asynchronous,loadBuffer:o,loadTypedArray:s})}function iL(t,i,e,n){const o=new AC;o.featureCount=i.featureCount,o.nullFeatureId=i.nullFeatureId,o.propertyTableId=i.propertyTable,o.label=i.label,o.positionalLabel=n;const s=i.texture;o.textureReader=Et(t,s,e,h.Sampler.NEAREST);const l=(h.defined(s.channels)?s.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return o.textureReader.channels=l,o}function DC(t,i){const e=new xC;return e.featureCount=t.featureCount,e.nullFeatureId=t.nullFeatureId,e.propertyTableId=t.propertyTable,e.setIndex=t.attribute,e.label=t.label,e.positionalLabel=i,e}function RC(t,i){const e=new TC;return e.propertyTableId=t.propertyTable,e.featureCount=t.featureCount,e.nullFeatureId=t.nullFeatureId,e.label=t.label,e.positionalLabel=i,e.offset=0,e.repeat=1,e}function FC(t,i,e,n){const o=new xC,s=t.featureIds;return o.featureCount=e,o.propertyTableId=i,o.setIndex=LC(s.attribute),o.positionalLabel=n,o}function zC(t,i,e,n){const o=new TC,s=t.featureIds;o.propertyTableId=i,o.featureCount=e,o.offset=s.constant??0;const r=s.divisor??0;return o.repeat=r===0?void 0:r,o.positionalLabel=n,o}function nL(t,i,e,n,o,s){const r=new AC,l=i.featureIds,c=l.texture;return r.featureCount=o,r.propertyTableId=e,r.textureReader=Et(t,c,n,h.Sampler.NEAREST),r.textureReader.channels=l.channels,r.positionalLabel=s,r}function oL(t,i){const e=new rz,n=t.gltfJson.accessors,o=n[i.input];e.input=Gh(t,o,void 0);const s=i.interpolation;e.interpolation=h.InterpolationType[s]??h.InterpolationType.LINEAR;const r=n[i.output];return e.output=Gh(t,r,!0),e}function sL(t,i,e){const n=new lz,o=t.sampler;return n.sampler=i[o],n.target=gL(t.target,e),n}function rL(t,i){const e=h.ResourceCache.getBufferViewLoader({gltf:t.gltfJson,bufferViewId:i,gltfResource:t._gltfResource,baseResource:t._baseResource});return t._bufferViewLoaders.push(e),e}function aL(t){const i=new hz;i.name=t.name;const e=t.type.toUpperCase();return i.type=h.ArticulationStageType[e],i.minimumValue=t.minimumValue,i.maximumValue=t.maximumValue,i.initialValue=t.initialValue,i}async function lL(t,i,e,n,o){const{gltfJson:s}=t;if(await i.load(),t.isDestroyed())return;const r=OC(s,e,i.typedArray);n=n??!1,mL(e,r,o,n)}function cL(t,i){const e=t.type;if(e===h.AttributeType.SCALAR)return i.fill(0);const n=h.AttributeType.getMathType(e);return i.fill(n.clone(n.ZERO))}function LC(t){const e=/^\w+_(\d+)$/.exec(t);if(e!==null)return parseInt(e[1])}function hL(t,i,e,n,o){var p;const s=t.accessors[i],r=h.AttributeType.getMathType(s.type),l=s.normalized??!1,c=new JF;c.name=e,c.semantic=n,c.setIndex=o,c.constant=vL(r),c.componentDatatype=s.componentType,c.normalized=l,c.count=s.count,c.type=s.type,c.min=Kt(r,s.min),c.max=Kt(r,s.max),c.byteOffset=s.byteOffset,c.byteStride=h.getAccessorByteStride(t,s),h.hasExtension(s,"WEB3D_quantized_attributes")&&yL(s.extensions.WEB3D_quantized_attributes,c,r);const u=c.semantic===h.VertexAttributeSemantic.POSITION||c.semantic===h.VertexAttributeSemantic.NORMAL||c.semantic===h.VertexAttributeSemantic.TANGENT||c.semantic===h.VertexAttributeSemantic.TEXCOORD||c.semantic===h.VertexAttributeSemantic.FEATURE_ID||c.semantic===h.VertexAttributeSemantic.SCALE||c.semantic===h.VertexAttributeSemantic.ROTATION;return((p=t.extensionsRequired)==null?void 0:p.includes("KHR_mesh_quantization"))&&l&&u&&CL(c,r),c}function uL(t,i,e,n,o,s,r,l,c){const u=t.gltfJson,p=u.accessors[i].bufferView;return h.ResourceCache.getVertexBufferLoader({gltf:u,gltfResource:t._gltfResource,baseResource:t._baseResource,frameState:c,bufferViewId:p,primitive:n,draco:o,spz:s,attributeSemantic:e,accessorId:i,asynchronous:t._asynchronous,loadBuffer:r,loadTypedArray:l})}function dL(t,i,e,n){if(t.byteOffset=0,t.byteStride=void 0,t.quantization=i.quantization,e&&(t.buffer=i.buffer),n){const o=h.defined(i.quantization)?i.quantization.componentDatatype:t.componentDatatype;t.typedArray=h.ComponentDatatype.createArrayBufferView(o,i.typedArray.buffer)}}function pL(t,i,e,n){if(t.byteOffset=0,t.byteStride=void 0,e&&(t.buffer=i.buffer),n&&h.defined(i.typedArray)&&(t.typedArray=h.ComponentDatatype.createArrayBufferView(t.componentDatatype,i.typedArray.buffer)),t.semantic===h.VertexAttributeSemantic.POSITION){const o=r=>{let l=1/0,c=-1/0,u=1/0,d=-1/0,p=1/0,f=-1/0;for(let g=0;g<r.length;g+=3){const v=r[g],y=r[g+1],w=r[g+2];l=Math.min(l,v),c=Math.max(c,v),u=Math.min(u,y),d=Math.max(d,y),p=Math.min(p,w),f=Math.max(f,w)}return[new h.Cartesian3(l,u,p),new h.Cartesian3(c,d,f)]},s=t.typedArray;[t.min,t.max]=o(s)}}function fL(t,i,e,n,o,s){if(o&&(e.buffer=n.buffer),s){const r=n.typedArray;e.typedArray=OC(t,i,r),o||(e.byteOffset=0,e.byteStride=void 0)}}function gL(t,i){const e=new az,n=t.node;if(!h.defined(n))return;e.node=i[n];const o=t.path.toUpperCase();return e.path=sz[o],e}function OC(t,i,e){let n=i.byteOffset;const o=h.getAccessorByteStride(t,i),s=i.count,r=h.numberOfComponentsForType(i.type),l=i.componentType,c=h.ComponentDatatype.getSizeInBytes(l),u=c*r,d=s*r;if(o===u)return e=new Uint8Array(e),h.ComponentDatatype.createArrayBufferView(l,e.buffer,e.byteOffset+n,d);const p=h.ComponentDatatype.createTypedArray(l,d),f=new DataView(e.buffer),g=new Array(r),v=h.getComponentReader(i.componentType);n=e.byteOffset+n;for(let y=0;y<s;++y){v(f,n,r,c,g);for(let w=0;w<r;++w)p[y*r+w]=g[w];n+=o}return p}function mL(t,i,e,n){const o=t.type,s=t.count;if(o===h.AttributeType.SCALAR)for(let r=0;r<s;r++)e[r]=i[r];else if(o===h.AttributeType.VEC4&&n)for(let r=0;r<s;r++)e[r]=h.Quaternion.unpack(i,r*4);else{const r=h.AttributeType.getMathType(o),l=h.AttributeType.getNumberOfComponents(o);for(let c=0;c<s;c++)e[c]=r.unpack(i,c*l)}return e}function vL(t){return t===Number?0:new t}function yL(t,i,e){const n=t.decodeMatrix,o=Kt(e,t.decodedMin),s=Kt(e,t.decodedMax);h.defined(o)&&h.defined(s)&&(i.min=o,i.max=s);const r=new h.ModelComponents.Quantization;r.componentDatatype=i.componentDatatype,r.type=i.type,n.length===4?(r.quantizedVolumeOffset=n[2],r.quantizedVolumeStepSize=n[0]):n.length===9?(r.quantizedVolumeOffset=new h.Cartesian2(n[6],n[7]),r.quantizedVolumeStepSize=new h.Cartesian2(n[0],n[4])):n.length===16?(r.quantizedVolumeOffset=new h.Cartesian3(n[12],n[13],n[14]),r.quantizedVolumeStepSize=new h.Cartesian3(n[0],n[5],n[10])):n.length===25&&(r.quantizedVolumeOffset=new h.Cartesian4(n[20],n[21],n[22],n[23]),r.quantizedVolumeStepSize=new h.Cartesian4(n[0],n[6],n[12],n[18])),i.quantization=r}const wL={VEC2:new h.Cartesian2(-1,-1),VEC3:new h.Cartesian3(-1,-1,-1),VEC4:new h.Cartesian4(-1,-1,-1,-1)};function CL(t,i){const e=_L(t.componentDatatype),n=wL[t.type];let o=t.min;h.defined(o)&&(o=i.divideByScalar(o,e,o),o=i.maximumByComponent(o,n,o));let s=t.max;h.defined(s)&&(s=i.divideByScalar(s,e,s),s=i.maximumByComponent(s,n,s)),t.min=o,t.max=s}function _L(t){switch(t){case h.ComponentDatatype.BYTE:return 127;case h.ComponentDatatype.UNSIGNED_BYTE:return 255;case h.ComponentDatatype.SHORT:return 32767;case h.ComponentDatatype.UNSIGNED_SHORT:return 65535;default:return 1}}function NC(t,i){if(!h.defined(i))return;const e=i.length;if(e===0)return;const n=t.length;t.length+=e;for(let o=0;o<e;o++)t[n+o]=i[o]}h.Material.XbsjPolylineArrow="XbsjPolylineArrow",h.Material._materialCache.addMaterial(h.Material.XbsjPolylineArrow,{fabric:{type:h.Material.XbsjPolylineArrow,uniforms:{color:new h.Color(1,1,1,1),image:a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/signal.png"),speed:1,repeat:60},source:`
1959
+ `;h.Material.GlobeLevelMaterialType="GlobelLevel",h.Material._materialCache.addMaterial(h.Material.GlobeLevelMaterialType,{fabric:{type:h.Material.GlobeLevelMaterialType,uniforms:{input_shadows:new h.Cartesian3(0,0,0),input_highlights:new h.Cartesian3(1,1,1),midtones:new h.Cartesian3(.5,.5,.5),output_shadows:new h.Cartesian3(0,0,0),output_highlights:new h.Cartesian3(1,1,1)},source:VF},translucent:!1});const{PrimitiveRenderResources:UF,ModelUtility:WF,Cartesian3:ai,Matrix4:sr,ModelRenderResources:GF,defined:HF,NodeRenderResources:$F,BoundingSphere:rn,ModelDrawCommands:qF}=h,XF=new ai,YF=new ai,SC=new ai,EC=new ai;class ZF extends UF{constructor(i,e,n){if(super(i,e),!i.runtimeNode.instancingTranslationMin||!i.runtimeNode.instancingTranslationMax)return;const o=sr.inverse(n,new sr),s=WF.getPositionMinMax(e.primitive,sr.multiplyByPoint(o,i.runtimeNode.instancingTranslationMin,SC),sr.multiplyByPoint(o,i.runtimeNode.instancingTranslationMax,EC));this.positionMin=ai.clone(s.min,new ai),this.positionMax=ai.clone(s.max,new ai),this.boundingSphere=rn.fromCornerPoints(this.positionMin,this.positionMax,new rn)}}function QF(){h.ModelSceneGraph.prototype.buildDrawCommands=function(t){const i=this._model,e=new GF(i);i.statistics.clear(),this.configurePipeline(t);const n=this.modelPipelineStages;let o,s,r;for(o=0;o<n.length;o++)n[o].process(e,i,t);const l=ai.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,XF),c=ai.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,YF);for(o=0;o<this._runtimeNodes.length;o++){const u=this._runtimeNodes[o];if(!HF(u))continue;u.configurePipeline();const d=u.pipelineStages,p=new $F(e,u);for(s=0;s<d.length;s++)d[s].process(p,u.node,t);const f=u.computedTransform;for(s=0;s<u.runtimePrimitives.length;s++){const g=u.runtimePrimitives[s];g.configurePipeline(t);const v=g.pipelineStages,y=new ZF(p,g,f);for(r=0;r<v.length;r++)v[r].process(y,g.primitive,t);g.boundingSphere=rn.clone(y.boundingSphere,new rn);const w=sr.multiplyByPoint(f,y.positionMin,SC),P=sr.multiplyByPoint(f,y.positionMax,EC);ai.minimumByComponent(l,w,l),ai.maximumByComponent(c,P,c);const C=qF.buildModelDrawCommand(y,t);g.drawCommand=C}}this._boundingSphere=rn.fromCornerPoints(l,c,new rn),this._boundingSphere=rn.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=rn.transform(this._boundingSphere,this._components.transform,this._boundingSphere),i._boundingSphere=rn.transform(this._boundingSphere,i.modelMatrix,i._boundingSphere),i._initialRadius=i._boundingSphere.radius,i._boundingSphere.radius*=i._clampedScale}}const uc=class uc extends a.Destroyable{constructor(){super(),h.ParticleSystem.prototype.update=function(i){const e=i.time;i.time=this._falseTime;try{uc.oldUpdate.call(this,i),this._particles.forEach(n=>{h.Billboard.prototype&&(n._billboard.ESSceneObjectID=this.ESSceneObjectID)})}catch{}i.time=e},this.d(()=>{h.ParticleSystem.prototype.update=uc.oldUpdate})}};m(uc,"oldUpdate",h.ParticleSystem.prototype.update);let Pg=uc;function kF(){if(h.ParticleSystem.prototype.timeStamp!==void 0){console.warn("fixParticleSystem已经执行过!");return}Object.defineProperties(h.ParticleSystem.prototype,{timeStamp:{get(){return this._innerCurrentTimeStamp===void 0&&(this._innerCurrentTimeStamp=0),this._innerCurrentTimeStamp},set(t){this.timeStamp!==t&&(this._innerCurrentTimeStamp=t,h.JulianDate.fromDate(new Date(t),this._falseTime))}},_falseTime:{get(){return this.__falseTime||(this.__falseTime=h.JulianDate.fromDate(new Date(0))),this.__falseTime}}})}class KF{constructor(i){m(this,"index");m(this,"image");m(this,"resolve");m(this,"reject");m(this,"rectangle");this.index=i.index,this.image=i.image,this.resolve=i.resolve,this.reject=i.reject,this.rectangle=void 0}}function JF(){h.TextureAtlas.prototype._resize=function(t,i=0){const e=this._borderWidthInPixels,n=this._rectangles,o=this._imagesToAddQueue,s=this._texture;let r=s.width,l=s.height;const c=this._subRegions,u=n.map((P,C)=>new KF({index:C,image:P})).filter((P,C)=>h.defined(P.image)&&!h.defined(c.get(C)));let d=0,p=0,f=0;for(let P=i;P<o.length;++P){const{width:C,height:S}=o[P].image;d=Math.max(d,C),p=Math.max(p,S),f+=C*S,u.push(o[P])}r=Math.max(d,r),l=Math.max(p,l),t.webgl2||(r=h.Math.nextPowerOfTwo(r),l=h.Math.nextPowerOfTwo(l));const g=Math.sqrt(f);l*=Math.ceil(g/l),r*=Math.ceil(g/r),u.sort(({image:P},{image:C})=>C.height*C.width-P.height*P.width);const v=new Array(this._nextIndex);for(const P of this._subRegions.keys())h.defined(c.get(P))&&(v[P]=n[P]);let y,w=!1;for(;!w;){y=new h.TexturePacker({height:l,width:r,borderPadding:e});let P;for(P=0;P<u.length;++P){const{index:C,image:S}=u[P];if(!h.defined(S))continue;const x=y.pack(C,S);if(!h.defined(x)){r>l?l*=2:r*=2;break}v[C]=x.rectangle}w=P===u.length}this._texturePacker=y,this._texture=this._copyFromTexture(t,r,l,v),s.destroy(),this._rectangles=v,this._guid=h.createGuid()}}const $n={LOADED:2,PROCESSING:3,FAILED:7},{Attribute:jF,Indices:ez,FeatureIdAttribute:xC,FeatureIdTexture:AC,FeatureIdImplicitRange:TC,MorphTarget:tz,Primitive:iz,Instances:nz,Skin:oz,Node:sz,AnimatedPropertyType:rz,AnimationSampler:az,AnimationTarget:lz,AnimationChannel:cz,Animation:hz,ArticulationStage:uz,Articulation:dz,Asset:pz,Scene:fz,Components:gz,MetallicRoughness:mz,SpecularGlossiness:vz,Specular:yz,Anisotropy:bg,Clearcoat:Sg,Material:wz}=h.ModelComponents;function Cz(){h.GltfLoader.prototype.process=function(t){if(h.Check.typeOf.object("frameState",t),this._state===$n.LOADED&&!h.defined(this._loadResourcesPromise)&&(this._loadResourcesPromise=_z(this,t).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),h.defined(this._processError)){this._state=$n.FAILED;const o=this._processError;this._processError=void 0,Eg(this,o)}const i=this._textureErrors.pop();if(h.defined(i)){const o=this.getError("Failed to load glTF texture",i);throw o.name="TextureError",o}if(this._state===$n.FAILED)return!1;let e=!1;try{e=this._process(t)}catch(o){this._state=$n.FAILED,Eg(this,o)}let n=!1;try{n=this._processTextures(t)}catch(o){this._textureState=$n.FAILED,Eg(this,o)}return this._incrementallyLoadTextures?e:e&&n}}async function _z(t,i){h.FeatureDetection.supportsWebP.initialized||await h.FeatureDetection.supportsWebP.initialize(),t._supportedImageFormats=new h.SupportedImageFormats({webp:h.FeatureDetection.supportsWebP(),basis:i.context.supportsBasis});const e=bz(t,i);return t._state=$n.PROCESSING,t._textureState=$n.PROCESSING,h.defined(t._gltfJsonLoader)&&t._releaseGltfJson&&(h.ResourceCache.unload(t._gltfJsonLoader),t._gltfJsonLoader=void 0),e}const Pz=new h.Cartesian3;function bz(t,i){const e=t.gltfJson,n=e.extensions??h.Frozen.EMPTY_OBJECT,o=n.EXT_structural_metadata,s=n.EXT_feature_metadata,r=n.CESIUM_RTC;if(h.defined(s)){const C=s.featureTables,S=s.featureTextures,x=h.defined(C)?C:[],A=h.defined(S)?S:[];t._sortedPropertyTableIds=Object.keys(x).sort(),t._sortedFeatureTextureIds=Object.keys(A).sort()}const l=Sz(t,i),c=Mz(t,l),u=Iz(t,l),d=Dz(e),p=Rz(e,l),f=new gz,g=new pz,v=e.asset.copyright;if(h.defined(v)){const C=v.split(";").map(function(S){return new h.Credit(S.trim())});g.credits=C}if(f.asset=g,f.scene=p,f.nodes=l,f.skins=c,f.animations=u,f.articulations=d,f.upAxis=t._upAxis,f.forwardAxis=t._forwardAxis,h.defined(r)){const C=h.Cartesian3.fromArray(r.center,0,Pz);f.transform=h.Matrix4.fromTranslation(C,f.transform)}if(t._components=f,h.defined(o)||h.defined(s)){const C=Fz(t,o,s,i);t._loaderPromises.push(C)}const y=n.NGA_gpm_local;if(h.defined(y)){const C=h.GltfGpmLoader.load(y);t._components.extensions.NGA_gpm_local=C}const w=e.meshes;if(h.defined(w))for(const C of w){const S=C.primitives;if(h.defined(S))for(const x of S){const A=x.extensions;if(h.defined(A)){const R=A.NGA_gpm_local;if(h.defined(R)){const L=zz(t,e,R,i);t._loaderPromises.push(L)}}}}const P=[];return NC(P,t._loaderPromises),t._incrementallyLoadTextures||NC(P,t._texturesPromises),Promise.all(P)}function Sz(t,i){const e=t.gltfJson.nodes;if(!h.defined(e))return[];const n=e.map(function(o,s){const r=Ez(t,o,i);return r.index=s,r});for(let o=0;o<n.length;++o){const s=e[o].children;if(h.defined(s))for(let r=0;r<s.length;++r)n[o].children.push(n[s[r]])}return n}function Ez(t,i,e){const n=new sz;n.name=i.name,n.matrix=Kt(h.Matrix4,i.matrix),n.translation=Kt(h.Cartesian3,i.translation),n.rotation=Kt(h.Quaternion,i.rotation),n.scale=Kt(h.Cartesian3,i.scale);const o=i.extensions??h.Frozen.EMPTY_OBJECT,s=o.EXT_mesh_gpu_instancing,r=o.AGI_articulations;if(h.defined(s)){if(t._loadForClassification)throw new h.RuntimeError("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");n.instances=Lz(t,o,e)}h.defined(r)&&(n.articulationName=r.articulationName);const l=i.mesh;if(h.defined(l)){const c=t.gltfJson.meshes[l],u=c.primitives;for(let f=0;f<u.length;++f)n.primitives.push(xz(t,u[f],h.defined(n.instances),e));const d=i.weights??c.weights,p=n.primitives[0].morphTargets;n.morphWeights=h.defined(d)?d.slice():new Array(p.length).fill(0)}return n}function xz(t,i,e,n){const o=new iz,s=new h.PrimitiveLoadPlan(o);t._primitiveLoadPlans.push(s);const r=i.material;h.defined(r)&&(o.material=Az(t,t.gltfJson.materials[r],n));const l=i.extensions??h.Frozen.EMPTY_OBJECT;let c=!1;const u=l.CESIUM_primitive_outline;t._loadPrimitiveOutline&&h.defined(u)&&(c=!0,s.needsOutlines=!0,s.outlineIndices=Oz(t,u));const d=l.KHR_spz_gaussian_splats_compression;h.defined(d)&&(c=!0,s.needsGaussianSplats=!0);const p=t._loadForClassification,f=l.KHR_draco_mesh_compression;let g=!1;const v=i.attributes;if(h.defined(v))for(const R in v){if(!v.hasOwnProperty(R))continue;const L=v[R],B=xg(t,h.VertexAttributeSemantic,R),V=B.modelSemantic;if(p&&!Bz(V))continue;V===h.VertexAttributeSemantic.FEATURE_ID&&(g=!0);const G=MC(t,L,B,i,f,d,e,c,n);s.attributePlans.push(G),o.attributes.push(G.attribute)}const y=i.targets;if(h.defined(y)&&!p)for(let R=0;R<y.length;++R)o.morphTargets.push(Vz(t,y[R],c,s,n));const w=i.indices;if(h.defined(w)){const R=Uz(t,w,i,f,g,c,n);h.defined(R)&&(s.indicesPlan=R,o.indices=R.indices)}const P=l.EXT_structural_metadata,C=l.EXT_mesh_features,S=l.EXT_feature_metadata,x=h.defined(S);h.defined(C)?Wz(t,o,C,n):x&&Gz(t,o,S,n),h.defined(P)?Hz(o,P):x&&$z(t,o,S);const A=i.mode;if(p&&A!==h.PrimitiveType.TRIANGLES)throw new h.RuntimeError("Only triangle meshes can be used for classification.");return o.primitiveType=A,o}function Az(t,i,e){const n=new wz,o=i.extensions??h.Frozen.EMPTY_OBJECT,s=o.KHR_materials_pbrSpecularGlossiness,r=o.KHR_materials_specular,l=o.KHR_materials_anisotropy,c=o.KHR_materials_clearcoat,u=i.pbrMetallicRoughness;return n.unlit=h.defined(o.KHR_materials_unlit),h.defined(s)?n.specularGlossiness=Tz(t,s,e):(h.defined(u)&&(n.metallicRoughness=qz(t,u,e)),h.defined(r)&&!n.unlit&&(n.specular=Xz(t,r,e)),h.defined(l)&&!n.unlit&&(n.anisotropy=Yz(t,l,e)),h.defined(c)&&!n.unlit&&(n.clearcoat=Zz(t,c,e))),h.defined(i.emissiveTexture)&&(n.emissiveTexture=Et(t,i.emissiveTexture,e,void 0)),h.defined(i.normalTexture)&&!t._loadForClassification&&(n.normalTexture=Et(t,i.normalTexture,e,void 0)),h.defined(i.occlusionTexture)&&(n.occlusionTexture=Et(t,i.occlusionTexture,e,void 0)),n.emissiveFactor=Kt(h.Cartesian3,i.emissiveFactor),n.alphaMode=i.alphaMode,n.alphaCutoff=i.alphaCutoff,n.doubleSided=i.doubleSided,n.name=i.name,n}function Tz(t,i,e){const{diffuseTexture:n,specularGlossinessTexture:o,diffuseFactor:s,specularFactor:r,glossinessFactor:l}=i,c=new vz;return h.defined(n)&&(c.diffuseTexture=Et(t,n,e,void 0)),h.defined(o)&&(c.specularGlossinessTexture=Et(t,o,e,void 0)),c.diffuseFactor=Kt(h.Cartesian4,s),c.specularFactor=Kt(h.Cartesian3,r),c.glossinessFactor=l,c}function Eg(t,i){throw t.unload(),t.getError("Failed to load glTF",i)}function Mz(t,i){const e=t.gltfJson.skins;if(t._loadForClassification||!h.defined(e))return[];const n=e.map(function(s,r){const l=Qz(t,s,i);return l.index=r,l}),o=t.gltfJson.nodes;for(let s=0;s<i.length;++s){const r=o[s].skin;h.defined(r)&&(i[s].skin=n[r])}return n}function Iz(t,i){const e=t.gltfJson.animations;return t._loadForClassification||!h.defined(e)?[]:e.map(function(o,s){const r=kz(t,o,i);return r.index=s,r})}function Dz(t){var n;const e=(n=(t.extensions??h.Frozen.EMPTY_OBJECT).AGI_articulations)==null?void 0:n.articulations;return h.defined(e)?e.map(Kz):[]}function Rz(t,i){const e=new fz,n=Jz(t);return e.nodes=n.map(function(o){return i[o]}),e}async function Fz(t,i,e,n){const o=new h.GltfStructuralMetadataLoader({gltf:t.gltfJson,extension:i,extensionLegacy:e,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:n,asynchronous:t._asynchronous});return t._structuralMetadataLoader=o,o.load()}async function zz(t,i,e,n){const o=new h.GltfMeshPrimitiveGpmLoader({gltf:i,extension:e,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:n,asynchronous:t._asynchronous});return t._meshPrimitiveGpmLoader=o,o.load()}function Kt(t,i){if(h.defined(i))return t===Number?i[0]:t.unpack(i)}function Lz(t,i,e){const n=i.EXT_mesh_gpu_instancing,o=new nz,s=n.attributes;if(h.defined(s))for(const u in s){if(!s.hasOwnProperty(u))continue;const d=s[u];o.attributes.push(jz(t,d,s,u,e))}const r=n.extensions??h.Frozen.EMPTY_OBJECT,l=i.EXT_instance_features,c=r.EXT_feature_metadata;return h.defined(l)?eL(o,l):h.defined(c)&&tL(t.gltfJson,o,c,t._sortedPropertyTableIds),o}function Oz(t,i){const e=i.indices,n=t.gltfJson.accessors[e];return Gh(t,n,!1)}const Nz={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function xg(t,i,e){let n=e;t._renameBatchIdSemantic&&(e==="_BATCHID"||e==="BATCHID")&&(n="_FEATURE_ID_0");const o=i.fromGltfSemantic(n),s=Nz;return s.gltfSemantic=e,s.renamedSemantic=n,s.modelSemantic=o,s}function Bz(t){const i=t===h.VertexAttributeSemantic.POSITION,e=t===h.VertexAttributeSemantic.FEATURE_ID,n=t===h.VertexAttributeSemantic.TEXCOORD;return i||e||n}function MC(t,i,e,n,o,s,r,l,c){const u=e.modelSemantic,d=u===h.VertexAttributeSemantic.POSITION,p=u===h.VertexAttributeSemantic.FEATURE_ID,f=d&&!r&&t._loadAttributesFor2D&&!c.scene3DOnly,g=d&&t._enablePick&&!c.context.webgl2,v=t._loadForClassification&&p,y=t._loadAttributesAsTypedArray,w=!y,P=y||f||g||v,x=IC(t,i,e,n,o,s,l?!1:w,l?!0:P,c),A=new h.PrimitiveLoadPlan.AttributeLoadPlan(x);return A.loadBuffer=w,A.loadTypedArray=P,A}function Vz(t,i,e,n,o){const s=new tz,r=void 0,l=void 0,c=void 0,u=!1;for(const d in i){if(!i.hasOwnProperty(d))continue;const p=i[d],f=xg(t,VertexAttributeSemantic,d),g=MC(t,p,f,r,l,c,u,e,o);s.attributes.push(g.attribute),n.attributePlans.push(g)}return s}function Uz(t,i,e,n,o,s,r){const l=t.gltfJson.accessors[i],c=l.bufferView;if(!h.defined(n)&&!h.defined(c))return;const u=new ez;u.count=l.count;const d=t._loadAttributesAsTypedArray,p=(t._loadIndicesForWireframe||t._enablePick)&&!r.context.webgl2,f=t._loadForClassification&&o,v=!d,y=d||p||f,C=iL(t,i,e,n,s?!1:v,s?!0:y,r),S=t._geometryLoaders.length;t._geometryLoaders.push(C);const x=C.load();t._loaderPromises.push(x),t._geometryCallbacks[S]=()=>{u.indexDatatype=C.indexDatatype,u.buffer=C.buffer,u.typedArray=C.typedArray};const A=new h.PrimitiveLoadPlan.IndicesLoadPlan(u);return A.loadBuffer=v,A.loadTypedArray=y,A}function Wz(t,i,e,n){let o;h.defined(e)&&h.defined(e.featureIds)?o=e.featureIds:o=[];for(let s=0;s<o.length;s++){const r=o[s],l=`featureId_${s}`;let c;h.defined(r.texture)?c=nL(t,r,n,l):h.defined(r.attribute)?c=DC(r,l):c=RC(r,l),i.featureIds.push(c)}}function Gz(t,i,e,n){const{featureTables:o}=t.gltfJson.extensions.EXT_feature_metadata;let s=0;const r=e.featureIdAttributes;if(h.defined(r))for(let c=0;c<r.length;++c){const u=r[c],d=u.featureTable,p=t._sortedPropertyTableIds.indexOf(d),f=o[d].count,g=`featureId_${s}`;s++;let v;h.defined(u.featureIds.attribute)?v=FC(u,p,f,g):v=zC(u,p,f,g),i.featureIds.push(v)}const l=e.featureIdTextures;if(h.defined(l))for(let c=0;c<l.length;++c){const u=l[c],d=u.featureTable,p=t._sortedPropertyTableIds.indexOf(d),f=o[d].count,g=`featureId_${s}`;s++;const v=oL(t,u,p,n,f,g);i.featureIds.push(v)}}function Hz(t,i){if(!h.defined(i))return;const{propertyTextures:e,propertyAttributes:n}=i;h.defined(e)&&(t.propertyTextureIds=e),h.defined(n)&&(t.propertyAttributeIds=n)}function $z(t,i,e){h.defined(e.featureTextures)&&(i.propertyTextureIds=e.featureTextures.map(function(n){return t._sortedFeatureTextureIds.indexOf(n)}))}function qz(t,i,e){const{baseColorTexture:n,metallicRoughnessTexture:o,baseColorFactor:s,metallicFactor:r,roughnessFactor:l}=i,c=new mz;return h.defined(n)&&(c.baseColorTexture=Et(t,n,e,void 0)),h.defined(o)&&(c.metallicRoughnessTexture=Et(t,o,e,void 0)),c.baseColorFactor=Kt(h.Cartesian4,s),c.metallicFactor=r,c.roughnessFactor=l,c}function Xz(t,i,e){const{specularFactor:n,specularTexture:o,specularColorFactor:s,specularColorTexture:r}=i,l=new yz;return h.defined(o)&&(l.specularTexture=Et(t,o,e,void 0)),h.defined(r)&&(l.specularColorTexture=Et(t,r,e,void 0)),l.specularFactor=n,l.specularColorFactor=Kt(h.Cartesian3,s),l}function Yz(t,i,e){const{anisotropyStrength:n=bg.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=bg.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:s}=i,r=new bg;return h.defined(s)&&(r.anisotropyTexture=Et(t,s,e,void 0)),r.anisotropyStrength=n,r.anisotropyRotation=o,r}function Zz(t,i,e){const{clearcoatFactor:n=Sg.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:s=Sg.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:r,clearcoatNormalTexture:l}=i,c=new Sg;return h.defined(o)&&(c.clearcoatTexture=Et(t,o,e,void 0)),h.defined(r)&&(c.clearcoatRoughnessTexture=Et(t,r,e,void 0)),h.defined(l)&&(c.clearcoatNormalTexture=Et(t,l,e,void 0)),c.clearcoatFactor=n,c.clearcoatRoughnessFactor=s,c}function Et(t,i,e,n){const o=t.gltfJson,s=h.GltfLoaderUtil.getImageIdFromTexture({gltf:o,textureId:i.index,supportedImageFormats:t._supportedImageFormats});if(!h.defined(s))return;const r=h.ResourceCache.getTextureLoader({gltf:o,textureInfo:i,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:e,asynchronous:t._asynchronous}),l=h.GltfLoaderUtil.createModelTextureReader({textureInfo:i}),c=t._textureLoaders.length;t._textureLoaders.push(r);const u=r.load().catch(d=>{if(!t.isDestroyed()){if(!t._incrementallyLoadTextures)throw d;t._textureState=$n.FAILED,t._textureErrors.push(d)}});return t._texturesPromises.push(u),t._textureCallbacks[c]=()=>{l.texture=r.texture,h.defined(n)&&(l.texture.sampler=n)},l}function Qz(t,i,e){const n=new oz,o=i.joints;n.joints=o.map(r=>e[r]);const s=i.inverseBindMatrices;if(h.defined(s)){const r=t.gltfJson.accessors[s];n.inverseBindMatrices=Gh(t,r,void 0)}else n.inverseBindMatrices=new Array(o.length).fill(h.Matrix4.IDENTITY);return n}function kz(t,i,e){const n=new hz;n.name=i.name;const o=i.samplers.map(function(r,l){const c=sL(t,r);return c.index=l,c}),s=i.channels.map(function(r){return rL(r,o,e)});return n.samplers=o,n.channels=s,n}function Kz(t){const i=new dz;return i.name=t.name,i.stages=t.stages.map(lL),i}function Jz(t){let i;return h.defined(t.scenes)&&h.defined(t.scene)&&(i=t.scenes[t.scene].nodes),i=i??t.nodes,i=h.defined(i)?i:[],i}function jz(t,i,e,n,o){const s=t.gltfJson.accessors,r=h.defined(e.ROTATION),l=h.defined(e.TRANSLATION)&&h.defined(s[e.TRANSLATION].min)&&h.defined(s[e.TRANSLATION].max),c=xg(t,h.InstanceAttributeSemantic,n),u=c.modelSemantic,d=u===h.InstanceAttributeSemantic.TRANSLATION||u===h.InstanceAttributeSemantic.ROTATION||u===h.InstanceAttributeSemantic.SCALE,p=u===h.InstanceAttributeSemantic.TRANSLATION,f=t._loadAttributesAsTypedArray||r&&d||!o.context.instancedArrays,g=t._enablePick&&!o.context.webgl2,v=!f,y=t._loadAttributesFor2D&&!o.scene3DOnly;return IC(t,i,c,void 0,void 0,void 0,v,f||p&&(!l||y||g),o)}function eL(t,i){const e=i.featureIds;for(let n=0;n<e.length;n++){const o=e[n],s=`instanceFeatureId_${n}`;let r;h.defined(o.attribute)?r=DC(o,s):r=RC(o,s),t.featureIds.push(r)}}function tL(t,i,e,n){const o=t.extensions.EXT_feature_metadata.featureTables,s=e.featureIdAttributes;if(h.defined(s))for(let r=0;r<s.length;++r){const l=s[r],c=l.featureTable,u=n.indexOf(c),d=o[c].count,p=`instanceFeatureId_${r}`;let f;h.defined(l.featureIds.attribute)?f=FC(l,u,d,p):f=zC(l,u,d,p),i.featureIds.push(f)}}function Gh(t,i,e){const n=new Array(i.count),o=i.bufferView;if(h.defined(o)){const s=aL(t,o),r=cL(t,s,i,e,n);return t._loaderPromises.push(r),n}return hL(i,n)}function IC(t,i,e,n,o,s,r,l,c){const u=t.gltfJson,d=u.accessors[i],p=d.bufferView,f=e.gltfSemantic,g=e.renamedSemantic,v=e.modelSemantic,y=h.defined(v)?LC(g):void 0,P=uL(u,i,f,v,y);if(!h.defined(o)&&!h.defined(p)&&!h.defined(s))return P;const C=dL(t,i,f,n,o,s,r,l,c),S=t._geometryLoaders.length;t._geometryLoaders.push(C);const x=C.load();return t._loaderPromises.push(x),t._geometryCallbacks[S]=()=>{h.defined(o)&&h.defined(o.attributes)&&h.defined(o.attributes[f])?pL(P,C,r,l):h.defined(s)?fL(P,C,r,l):gL(u,d,P,C,r,l)},P}function iL(t,i,e,n,o,s,r){return h.ResourceCache.getIndexBufferLoader({gltf:t.gltfJson,accessorId:i,gltfResource:t._gltfResource,baseResource:t._baseResource,frameState:r,primitive:e,draco:n,asynchronous:t._asynchronous,loadBuffer:o,loadTypedArray:s})}function nL(t,i,e,n){const o=new AC;o.featureCount=i.featureCount,o.nullFeatureId=i.nullFeatureId,o.propertyTableId=i.propertyTable,o.label=i.label,o.positionalLabel=n;const s=i.texture;o.textureReader=Et(t,s,e,h.Sampler.NEAREST);const l=(h.defined(s.channels)?s.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return o.textureReader.channels=l,o}function DC(t,i){const e=new xC;return e.featureCount=t.featureCount,e.nullFeatureId=t.nullFeatureId,e.propertyTableId=t.propertyTable,e.setIndex=t.attribute,e.label=t.label,e.positionalLabel=i,e}function RC(t,i){const e=new TC;return e.propertyTableId=t.propertyTable,e.featureCount=t.featureCount,e.nullFeatureId=t.nullFeatureId,e.label=t.label,e.positionalLabel=i,e.offset=0,e.repeat=1,e}function FC(t,i,e,n){const o=new xC,s=t.featureIds;return o.featureCount=e,o.propertyTableId=i,o.setIndex=LC(s.attribute),o.positionalLabel=n,o}function zC(t,i,e,n){const o=new TC,s=t.featureIds;o.propertyTableId=i,o.featureCount=e,o.offset=s.constant??0;const r=s.divisor??0;return o.repeat=r===0?void 0:r,o.positionalLabel=n,o}function oL(t,i,e,n,o,s){const r=new AC,l=i.featureIds,c=l.texture;return r.featureCount=o,r.propertyTableId=e,r.textureReader=Et(t,c,n,h.Sampler.NEAREST),r.textureReader.channels=l.channels,r.positionalLabel=s,r}function sL(t,i){const e=new az,n=t.gltfJson.accessors,o=n[i.input];e.input=Gh(t,o,void 0);const s=i.interpolation;e.interpolation=h.InterpolationType[s]??h.InterpolationType.LINEAR;const r=n[i.output];return e.output=Gh(t,r,!0),e}function rL(t,i,e){const n=new cz,o=t.sampler;return n.sampler=i[o],n.target=mL(t.target,e),n}function aL(t,i){const e=h.ResourceCache.getBufferViewLoader({gltf:t.gltfJson,bufferViewId:i,gltfResource:t._gltfResource,baseResource:t._baseResource});return t._bufferViewLoaders.push(e),e}function lL(t){const i=new uz;i.name=t.name;const e=t.type.toUpperCase();return i.type=h.ArticulationStageType[e],i.minimumValue=t.minimumValue,i.maximumValue=t.maximumValue,i.initialValue=t.initialValue,i}async function cL(t,i,e,n,o){const{gltfJson:s}=t;if(await i.load(),t.isDestroyed())return;const r=OC(s,e,i.typedArray);n=n??!1,vL(e,r,o,n)}function hL(t,i){const e=t.type;if(e===h.AttributeType.SCALAR)return i.fill(0);const n=h.AttributeType.getMathType(e);return i.fill(n.clone(n.ZERO))}function LC(t){const e=/^\w+_(\d+)$/.exec(t);if(e!==null)return parseInt(e[1])}function uL(t,i,e,n,o){var p;const s=t.accessors[i],r=h.AttributeType.getMathType(s.type),l=s.normalized??!1,c=new jF;c.name=e,c.semantic=n,c.setIndex=o,c.constant=yL(r),c.componentDatatype=s.componentType,c.normalized=l,c.count=s.count,c.type=s.type,c.min=Kt(r,s.min),c.max=Kt(r,s.max),c.byteOffset=s.byteOffset,c.byteStride=h.getAccessorByteStride(t,s),h.hasExtension(s,"WEB3D_quantized_attributes")&&wL(s.extensions.WEB3D_quantized_attributes,c,r);const u=c.semantic===h.VertexAttributeSemantic.POSITION||c.semantic===h.VertexAttributeSemantic.NORMAL||c.semantic===h.VertexAttributeSemantic.TANGENT||c.semantic===h.VertexAttributeSemantic.TEXCOORD||c.semantic===h.VertexAttributeSemantic.FEATURE_ID||c.semantic===h.VertexAttributeSemantic.SCALE||c.semantic===h.VertexAttributeSemantic.ROTATION;return((p=t.extensionsRequired)==null?void 0:p.includes("KHR_mesh_quantization"))&&l&&u&&_L(c,r),c}function dL(t,i,e,n,o,s,r,l,c){const u=t.gltfJson,p=u.accessors[i].bufferView;return h.ResourceCache.getVertexBufferLoader({gltf:u,gltfResource:t._gltfResource,baseResource:t._baseResource,frameState:c,bufferViewId:p,primitive:n,draco:o,spz:s,attributeSemantic:e,accessorId:i,asynchronous:t._asynchronous,loadBuffer:r,loadTypedArray:l})}function pL(t,i,e,n){if(t.byteOffset=0,t.byteStride=void 0,t.quantization=i.quantization,e&&(t.buffer=i.buffer),n){const o=h.defined(i.quantization)?i.quantization.componentDatatype:t.componentDatatype;t.typedArray=h.ComponentDatatype.createArrayBufferView(o,i.typedArray.buffer)}}function fL(t,i,e,n){if(t.byteOffset=0,t.byteStride=void 0,e&&(t.buffer=i.buffer),n&&h.defined(i.typedArray)&&(t.typedArray=h.ComponentDatatype.createArrayBufferView(t.componentDatatype,i.typedArray.buffer)),t.semantic===h.VertexAttributeSemantic.POSITION){const o=r=>{let l=1/0,c=-1/0,u=1/0,d=-1/0,p=1/0,f=-1/0;for(let g=0;g<r.length;g+=3){const v=r[g],y=r[g+1],w=r[g+2];l=Math.min(l,v),c=Math.max(c,v),u=Math.min(u,y),d=Math.max(d,y),p=Math.min(p,w),f=Math.max(f,w)}return[new h.Cartesian3(l,u,p),new h.Cartesian3(c,d,f)]},s=t.typedArray;[t.min,t.max]=o(s)}}function gL(t,i,e,n,o,s){if(o&&(e.buffer=n.buffer),s){const r=n.typedArray;e.typedArray=OC(t,i,r),o||(e.byteOffset=0,e.byteStride=void 0)}}function mL(t,i){const e=new lz,n=t.node;if(!h.defined(n))return;e.node=i[n];const o=t.path.toUpperCase();return e.path=rz[o],e}function OC(t,i,e){let n=i.byteOffset;const o=h.getAccessorByteStride(t,i),s=i.count,r=h.numberOfComponentsForType(i.type),l=i.componentType,c=h.ComponentDatatype.getSizeInBytes(l),u=c*r,d=s*r;if(o===u)return e=new Uint8Array(e),h.ComponentDatatype.createArrayBufferView(l,e.buffer,e.byteOffset+n,d);const p=h.ComponentDatatype.createTypedArray(l,d),f=new DataView(e.buffer),g=new Array(r),v=h.getComponentReader(i.componentType);n=e.byteOffset+n;for(let y=0;y<s;++y){v(f,n,r,c,g);for(let w=0;w<r;++w)p[y*r+w]=g[w];n+=o}return p}function vL(t,i,e,n){const o=t.type,s=t.count;if(o===h.AttributeType.SCALAR)for(let r=0;r<s;r++)e[r]=i[r];else if(o===h.AttributeType.VEC4&&n)for(let r=0;r<s;r++)e[r]=h.Quaternion.unpack(i,r*4);else{const r=h.AttributeType.getMathType(o),l=h.AttributeType.getNumberOfComponents(o);for(let c=0;c<s;c++)e[c]=r.unpack(i,c*l)}return e}function yL(t){return t===Number?0:new t}function wL(t,i,e){const n=t.decodeMatrix,o=Kt(e,t.decodedMin),s=Kt(e,t.decodedMax);h.defined(o)&&h.defined(s)&&(i.min=o,i.max=s);const r=new h.ModelComponents.Quantization;r.componentDatatype=i.componentDatatype,r.type=i.type,n.length===4?(r.quantizedVolumeOffset=n[2],r.quantizedVolumeStepSize=n[0]):n.length===9?(r.quantizedVolumeOffset=new h.Cartesian2(n[6],n[7]),r.quantizedVolumeStepSize=new h.Cartesian2(n[0],n[4])):n.length===16?(r.quantizedVolumeOffset=new h.Cartesian3(n[12],n[13],n[14]),r.quantizedVolumeStepSize=new h.Cartesian3(n[0],n[5],n[10])):n.length===25&&(r.quantizedVolumeOffset=new h.Cartesian4(n[20],n[21],n[22],n[23]),r.quantizedVolumeStepSize=new h.Cartesian4(n[0],n[6],n[12],n[18])),i.quantization=r}const CL={VEC2:new h.Cartesian2(-1,-1),VEC3:new h.Cartesian3(-1,-1,-1),VEC4:new h.Cartesian4(-1,-1,-1,-1)};function _L(t,i){const e=PL(t.componentDatatype),n=CL[t.type];let o=t.min;h.defined(o)&&(o=i.divideByScalar(o,e,o),o=i.maximumByComponent(o,n,o));let s=t.max;h.defined(s)&&(s=i.divideByScalar(s,e,s),s=i.maximumByComponent(s,n,s)),t.min=o,t.max=s}function PL(t){switch(t){case h.ComponentDatatype.BYTE:return 127;case h.ComponentDatatype.UNSIGNED_BYTE:return 255;case h.ComponentDatatype.SHORT:return 32767;case h.ComponentDatatype.UNSIGNED_SHORT:return 65535;default:return 1}}function NC(t,i){if(!h.defined(i))return;const e=i.length;if(e===0)return;const n=t.length;t.length+=e;for(let o=0;o<e;o++)t[n+o]=i[o]}h.Material.XbsjPolylineArrow="XbsjPolylineArrow",h.Material._materialCache.addMaterial(h.Material.XbsjPolylineArrow,{fabric:{type:h.Material.XbsjPolylineArrow,uniforms:{color:new h.Color(1,1,1,1),image:a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/signal.png"),speed:1,repeat:60},source:`
1960
1960
  uniform vec4 color; // 叠加颜色
1961
1961
  uniform sampler2D image; // 箭头贴图
1962
1962
  uniform float repeat; // 重复像素
@@ -1991,8 +1991,8 @@ return material;
1991
1991
  material.alpha = fragColor.a;
1992
1992
 
1993
1993
  return material;
1994
- }`},translucent:!0}),TF(),MF(),IF(),zF(),LF(),OF(),NF(),AF(),ZF(),QF(),KF(),wz(),h.Camera.DEFAULT_VIEW_RECTANGLE=h.Rectangle.fromDegrees(70,5,140,55);function PL(){return new Promise((t,i)=>h.GroundPolylinePrimitive.initializeTerrainHeights().then(t))}class bL extends a.Destroyable{constructor(i,e,n,o){super();const s=()=>{e.setStatus("Raw");const{viewer:l}=e;if(l){const c=et(l);if(c&&(c.destroy(),Ag(l,void 0)),h.defined(l)){l.entities.removeAll(),l.dataSources.removeAll(),l.imageryLayers.removeAll(),l.scene.primitives.removeAll(),l.scene.groundPrimitives.removeAll(),l.scene.postProcessStages.removeAll();let u=l.scene.context._originalGLContext;u.canvas.width=u.canvas.height=1,u.getExtension("WEBGL_lose_context").loseContext(),u=null}l.destroy(),n(void 0)}};this.d(s);const r=this.dv(a.createProcessingFromAsyncFunc(async(l,c)=>{e.setStatus("Creating"),e.setStatusLog("正在创建Cesium视口...");const u=xF;await l.promise(PL());const d=await l.promise(a.createCancelablePromise(u(c,o)));d.scene._xbsjOriginSkyAtmosphere=d.scene.skyAtmosphere,d.scene._xbsjOriginSkyBox=d.scene.skyBox,d.scene.renderError.removeEventListener(d.cesiumWidget._onRenderError),d.clockViewModel.currentTime=h.JulianDate.fromDate(new Date(e.currentTime)),this.dispose(e.currentTimeChanged.disposableOn(()=>{if(e.currentTime===void 0)return;const p=h.JulianDate.fromDate(new Date(e.currentTime));h.JulianDate.equals(p,d.clockViewModel.currentTime)||(d.clockViewModel.currentTime=p)})),this.dispose(Ci(d.clockViewModel,"currentTime",p=>{const f=h.JulianDate.toDate(d.clockViewModel.currentTime).getTime();f!==e.currentTime&&(e.currentTime=f)}));{const p=new qC(d,e);Ag(d,p)}e.setStatus("Created"),e.setStatusLog("成功创建Cesium视口!"),n(d)}));r.start(i),r.errorEvent.don(l=>{console.error(l),e.setStatus("Error"),e.setStatusLog("创建Cesium视口失败!")})}}const SL=new h.EllipsoidTerrainProvider;class BC extends a.Destroyable{constructor(e){super();m(this,"_terrainMap",new Map);m(this,"_nextAnimateFrame",this.dv(a.createNextAnimateFrame()));m(this,"selectedTerrain");this._viewer=e;const n=this._viewer,o=n.scene.globe.terrainProviderChanged.addEventListener(()=>{this.selectedTerrain&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit())});this.ad(()=>{o&&o()}),this.dispose(this._changed.disposableOn(()=>{this.selectedTerrain=void 0;let s=Number.MIN_SAFE_INTEGER;for(let r of this._terrainMap.keys())r.sceneObject.activate=!1,(r.sceneObject.show??!0)&&r.sceneObject.zIndex>=s&&(this.selectedTerrain&&console.warn(`存在多个terrain,只能显示一个,当前terrian:${this.selectedTerrain.sceneObject.name}(${this.selectedTerrain.sceneObject.id}), 即将被替换成${r.sceneObject.name}(${r.sceneObject.id})`),s=r.sceneObject.zIndex,this.selectedTerrain=r);this.selectedTerrain&&!this.selectedTerrain.provider&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit()),n.scene.terrainProvider=(this.selectedTerrain&&this.selectedTerrain.provider)??SL}))}_makeDirty(){this._nextAnimateFrame.restartIfNotRunning()}get _changed(){return this._nextAnimateFrame.completeEvent}add(e){if(this._terrainMap.has(e)){console.warn("this._terrainMap.has(imagery)");return}const n=new a.Destroyable;n.dispose(e.providerChanged.disposableOn(()=>this._makeDirty())),n.dispose(e.sceneObject.showChanged.disposableOn(()=>this._makeDirty())),this._terrainMap.set(e,()=>n.destroy()),this._makeDirty();const o=this.ad(a.createNextAnimateFrameEvent(e.sceneObject.zIndexChanged));this.d(o.don(()=>{this._changed.emit()}))}delete(e){if(!this._terrainMap.has(e)){console.warn("!this._imageriesMap.has(imagery)");return}const n=this._terrainMap.get(e);if(!n){console.error("!disposeFunc");return}n(),this._terrainMap.delete(e),this.selectedTerrain===e&&(this.selectedTerrain=void 0),this._makeDirty()}}class VC extends a.Destroyable{constructor(e){super();m(this,"_labelMap",{div:new Map,canvas:new Map});this._viewer=e,this.d(e.scene.camera.changed.addEventListener(()=>{this._updateZOrder()}))}add(e){const n=e instanceof He?"div":"canvas";if(this._labelMap[n].has(e)){console.warn(`this._labelMap[${n}].has(poi)`,e);return}const o=new a.Destroyable;{const s=o.dv(a.createNextAnimateFrameEvent(e.zOrderChanged,e.positionChanged));o.dispose(s.don(()=>{this._updateZOrder()}))}this._labelMap[n].set(e,()=>o.destroy()),this._updateZOrder()}delete(e){const n=e instanceof He?"div":"canvas";if(!this._labelMap[n].has(e)){console.warn(`!this._labelMap[${n}].has(poi)`,e);return}const o=this._labelMap[n].get(e);if(!o){console.error("!disposeFunc");return}o(),this._labelMap[n].delete(e),this._updateZOrder()}_updateZOrder(){for(const e in this._labelMap)Object.prototype.hasOwnProperty.call(this._labelMap,e)&&this._updateLabelZOrder(this._labelMap[e],e)}_updateLabelZOrder(e,n){const o={};for(const l of e.keys())o[l.zOrder]||(o[l.zOrder]=new Map),o[l.zOrder].set(l,l instanceof He?l.czmDivPoi?l.czmDivPoi.depth:0:l.canvasObj?l.canvasObj.czmCanvasPoi.depth:0);const s=Object.keys(o).sort((l,c)=>n=="div"?Number(c)-Number(l):Number(l)-Number(c));let r=e.size;for(let l=0;l<s.length;l++)new Map([...o[s[l]]].sort((u,d)=>Number(d[1])-Number(u[1]))).forEach((u,d)=>{d instanceof He&&d.czmDivPoi&&(d.czmDivPoi.zOrder=r),d instanceof $i&&d.canvasObj&&(d.canvasObj.czmCanvasPoi.zOrder=r),r--})}}class EL extends a.Destroyable{constructor(e){super();m(this,"_czmImageryLayerWrappers",new Set);m(this,"_zIndexChangedEvent",this.dv(new a.Event));this._viewer=e,this.d(this._zIndexChangedEvent.don(()=>{const n=[...this.czmImageryLayerWrappers.values()];n.sort((o,s)=>{const r=o.czmImageryWrapper.imagery.zIndex??a.ESImageryLayer.defaults.zIndex,l=s.czmImageryWrapper.imagery.zIndex??a.ESImageryLayer.defaults.zIndex;return r-l});for(const o of n)this.viewer.imageryLayers.raiseToTop(o.imageryLayer)}))}get viewer(){return this._viewer}get czmImageryLayerWrappers(){return this._czmImageryLayerWrappers}add(e){this._czmImageryLayerWrappers.add(e),this.viewer.imageryLayers.add(e.imageryLayer),this.zIndexChange()}delete(e){this.viewer.imageryLayers.remove(e.imageryLayer,!1),this._czmImageryLayerWrappers.delete(e)}zIndexChange(){this._zIndexChangedEvent.emit()}}class xL extends a.Destroyable{constructor(e){super();m(this,"_imageryLayer");if(this._czmImageryWrapper=e,!this._czmImageryWrapper.imagery.layer)throw new Error("this._czmCzmImageryWrapper.imagery.czmImagery");this._imageryLayer=this._czmImageryWrapper.imagery.layer;const{czmImageryWrapper:n}=this,o=n.manager.czmImageriesManager;o.add(this),this.d(()=>o.delete(this)),this.d(this._czmImageryWrapper.imagery.zIndexChanged.don(()=>o.zIndexChange()))}get imageryLayer(){return this._imageryLayer}get czmImageryWrapper(){return this._czmImageryWrapper}}class AL extends a.Destroyable{constructor(e){super();m(this,"_objResetting");this._czmImageryWrapper=e,this._objResetting=this.dv(new a.ObjResettingWithEvent(this.czmImageryWrapper.imagery.showChanged,()=>{if(this.czmImageryWrapper.imagery.show??!0)return new xL(this.czmImageryWrapper)}))}get czmImageryWrapper(){return this._czmImageryWrapper}get objResetting(){return this._objResetting}}class TL extends a.Destroyable{constructor(e,n){super();m(this,"_czmImageryLayerWrapperObjResetting");this._imagery=e,this._manager=n,this._czmImageryLayerWrapperObjResetting=this.dv(new a.ObjResettingWithEvent(this.imagery.layerChanged,()=>{if(this.imagery.layer)return new AL(this)}))}get imagery(){return this._imagery}get manager(){return this._manager}get czmImageryLayerWrapperObjResetting(){return this._czmImageryLayerWrapperObjResetting}}class UC extends a.Destroyable{constructor(e){super();m(this,"_czmImageryWrappers",new Set);m(this,"_czmImageryLayersManager");this._viewer=e,this._czmImageryLayersManager=this.dv(new EL(this.viewer))}get czmImageryWrappers(){return this._czmImageryWrappers}get czmImageriesManager(){return this._czmImageryLayersManager}get viewer(){return this._viewer}add(e){for(let n of this.czmImageryWrappers)if(n.imagery===e){console.warn("imageriesManager add error: has already added!",e);return}this.czmImageryWrappers.add(new TL(e,this))}has(e){for(let n of this.czmImageryWrappers)if(n.imagery===e)return!0;return!1}delete(e){for(const n of this.czmImageryWrappers)if(n.imagery===e){this.czmImageryWrappers.delete(n);return}console.warn("imageriesManager delete error!",e)}}class WC extends a.Destroyable{constructor(e){super();m(this,"_pause",this.disposeVar(a.react(!1)));m(this,"_pickPositionTasks",[]);m(this,"_pickTasks",[]);m(this,"pickHeightMustGreaterThanZero",!0);m(this,"objectsToExclude",[]);const n=e.viewer;{this.dispose(()=>{this._pickPositionTasks.length>0&&(this._pickPositionTasks.forEach(l=>l[3]("CzmViewer销毁,任务不再执行!")),this._pickPositionTasks.length=0),this._pickTasks.length>0&&(this._pickTasks.forEach(l=>l[4]("CzmViewer销毁,任务不再执行!")),this._pickTasks.length=0)});const o=()=>{const l=[...this._pickPositionTasks];this._pickPositionTasks.length=0;for(let u of l){const[d,p,f,g]=u;try{(async()=>{const{scene:v,camera:y}=n,w=Pe(d),P=y.getPickRay(w);if(P){let A;if(p?A=await v.pickFromRayMostDetailed(P,this.objectsToExclude):A=v.pickFromRay(P,this.objectsToExclude),A&&A.position){const R=se(A.position);return R?f(R):g(new Error("positionFromCartesian failed"))}if(!(v.terrainProvider instanceof h.EllipsoidTerrainProvider)){const R=v.globe.pick(P,v);if(!R)return g(new Error("scene.globe.pick failed"));const L=se(R);return L?(this.pickHeightMustGreaterThanZero&&L[2]<0&&(L[2]=0),f(L)):g(new Error("positionFromCartesian failed"))}}const C=v.terrainProvider instanceof h.EllipsoidTerrainProvider?v.terrainProvider.tilingScheme.ellipsoid:n.scene.globe.ellipsoid,S=n.camera.pickEllipsoid(Pe(d),C);if(!S)return g(new Error("Pick failed"));const x=se(S);return x?f(x):g(new Error("positionFromCartesian failed"))})()}catch(v){g(v)}}const c=[...this._pickTasks];this._pickTasks.length=0;for(let u of c){const[d,p,f,g,v]=u;e.pickCustomAttachedInfo=f;try{(async()=>{var A,R,L,B;let y=n.scene.pick(Pe(d),p&&p[0],p&&p[1]);!y&&h.defined(n.scene.globe)&&(y=await ML(n,Pe(d)));let w;if(y&&y instanceof h.Cesium3DTileFeature){w={};try{y&&y.getPropertyIds().forEach(G=>{w&&(w[G]=y.getProperty(G))})}catch(V){console.warn(V)}}if(!y){const{left:V,top:G}=e.container.getBoundingClientRect();y=(A=document.elementFromPoint(d[0]+V,d[1]+G))==null?void 0:A.closest("[data-es-scene-object-id]")}let P;y&&(y.id&&y.id instanceof h.Entity&&y.id.ESSceneObjectID?P=y.id.ESSceneObjectID:y.collection&&y.collection.ESSceneObjectID?P=y.collection.ESSceneObjectID:y.primitive&&y.primitive.ESSceneObjectID?P=y.primitive.ESSceneObjectID:Array.isArray(y)&&y[0]instanceof h.ImageryLayerFeatureInfo?P=y[0].imageryLayer.ESSceneObjectID:y instanceof HTMLElement&&(P=y.dataset.esSceneObjectId));let C=P?a.ESSceneObject.getSceneObject(P):void 0;C&&C.parentID&&(C=a.ESSceneObject.getSceneObject(C.parentID));let S={};if(C&&Reflect.has(C,"allowPicking")&&Reflect.has(C,"pickedEvent")&&(C.allowPicking??!1)){if(C instanceof a.ESEntityCluster){const V=new h.JulianDate;S=y.id instanceof h.Entity?{name:y.id.label.text.getValue(V),properties:(R=y.id.properties)==null?void 0:R.getValue(V),coordinates:vr(y.id.position.getValue(V))}:(L=y.id)==null?void 0:L.map(G=>{var O;return{name:G.id,properties:(O=G.properties)==null?void 0:O.getValue(V),coordinates:vr(G.position.getValue(V))}})}else if(C instanceof a.ESGeoJson){const V=new h.JulianDate;if(!y.id.entityCollection)return;const G=y.id.polygon?"Polygon":y.id.polyline?"LineString":"Point",O=((B=y.id.properties)==null?void 0:B.getValue(V))??{},N=G=="Point"?se(y.id.position.getValue(V)):G=="LineString"?y.id.polyline.positions.getValue(V).map(_=>se(_)):gu(y.id.polygon.hierarchy.getValue(V));S=C.pickedInfoType=="FeatureCollection"||C.pickedInfoType=="Feature"?{type:"Feature",geometry:{type:G,coordinates:N},properties:O}:{type:G,coordinates:N,properties:O}}else if(C instanceof a.ESGltfModel){let V;Reflect.has(y,"featureId")?V=y.featureId:Reflect.has(y,"instanceId")&&(V=y.instanceId),V&&(y.id=y.primitive.structuralMetadata.getPropertyTable(0).getProperty(y.instanceId,"id"))}C.pickedEvent.emit(new a.ESJPickedResult(y,C,w,S,f,d))}C&&Reflect.has(C,"allowPicking")&&!C.allowPicking&&g(new a.ESJPickedResult);const x=new a.ESJPickedResult(y,C,w,S,f,d);g(x)})()}catch(y){v(y)}}};let s=n.scene.postRender.addEventListener(o);const r=()=>{s&&s(),s=void 0};this.ad(r),this.ad(this.pauseChanged.don(l=>{l?r():s=n.scene.postRender.addEventListener(o)}))}}get pause(){return this._pause.value}set pause(e){this._pause.value=e}get pauseChanged(){return this._pause.changed}pickPosition(e){return new Promise((n,o)=>{this._pickPositionTasks.push([e,!0,n,o])})}quickPickPosition(e){return new Promise((n,o)=>{this._pickPositionTasks.push([e,!1,n,o])})}pick(e,n,o){return new Promise((s,r)=>{this._pickTasks.push([e,n,o,s,r])})}}function ML(t,i){const e=t.scene,n=e.camera.getPickRay(i);if(!n)return;const o=e.imageryLayers.pickImageryLayerFeatures(n,e);if(h.defined(o))return o}class IL extends a.Destroyable{constructor(e){super();m(this,"_enabled",this.disposeVar(a.react(!1)));m(this,"_cursorPosition",a.react(void 0));m(this,"quickPickPosition",!0);let n=new a.Destroyable;const o=()=>{n&&(n.destroy(),n=void 0)};this.dispose(o);const s=()=>{if(o(),!this._enabled.value||!e)return;const r=et(e);if(!r)return;n=new a.Destroyable;const l=n.disposeVar(a.react(void 0)),c=n.disposeVar(a.createNextAnimateFrameEvent(l.changed));n.dispose(r.czmViewer.pointerMoveEvent.disposableOn(d=>{d.pointerEvent&&(l.value=a.getDomEventCurrentTargetPos(d.pointerEvent))}));const u=n.disposeVar(a.createProcessingFromAsyncFunc(async d=>{if(r.pickingManager&&l.value)if(this.quickPickPosition){const p=await d.promise(a.createCancelablePromise(r.pickingManager.quickPickPosition(l.value)));this._cursorPosition.value=p}else{const p=await d.promise(a.createCancelablePromise(r.pickingManager.pickPosition(l.value)));this._cursorPosition.value=p}}));n.dispose(c.disposableOn(()=>{u.restart()}))};s(),this.dispose(this._enabled.changed.disposableOn(s))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}function DL(t){const i=t.cloneNode(!0);i.style.position="absolute",i.style.top="0",i.style.zIndex="-1",document.body.appendChild(i);const e=i.getBoundingClientRect();return document.body.removeChild(i),{width:e.width,height:e.height}}const GC=["label","billboard","rectangle"];class RL extends a.Destroyable{constructor(e,n){super();m(this,"id",a.createGuid());m(this,"position",h.Cartesian3.ZERO);m(this,"label");m(this,"billboard");m(this,"rectangle");m(this,"zOrder");m(this,"_showEvent",this.disposeVar(new a.Event));this.id=e,this.position=n,this.ad(this.showEvent.don(o=>{this.updateShow(o)}))}get showEvent(){return this._showEvent}show(e){this._showEvent.emit(e)}updateShow(e){this.label&&(this.label.show=e),this.billboard&&(this.billboard.show=e),this.rectangle&&(this.rectangle.show=e)}}class FL extends a.Destroyable{constructor(e){super();m(this,"objects",new Map);m(this,"screenManager");m(this,"czmViewer");m(this,"viewer");this.screenManager=e,this.czmViewer=e.czmViewer,this.viewer=e.viewer,this.ad(()=>{this.objects.clear()})}layerIsEffective(){return this.objects.size>0}addLabel(e,n,o){const s=this.makeScreenObjectId(e,o.index??a.createGuid()),r=Ie(o.position),l=this.getOrCreateObject(s,r);if(l.label)return s;const c=this.screenManager.labelCollection.add({...n,position:r,id:s,text:o.name});return c.ESSceneObjectID=e,l.label=c,l.zOrder=o.zOrder,s}addImage(e,n,o){const s=this.makeScreenObjectId(e,o.index??a.createGuid()),r=Ie(o.position),l=this.getOrCreateObject(s,r);if(l.billboard)return s;const c=this.screenManager.billboardCollection.add({...n,position:r,id:s});return c.ESSceneObjectID=e,l.billboard=c,l.zOrder=o.zOrder,s}addRectangle(e,n,o,s){const r=this.makeScreenObjectId(e,o.index??a.createGuid()),l=Ie(o.position),c=this.getOrCreateObject(r,l);if(c.rectangle)return r;const u=this.screenManager.rectangleCollection.add({...DL(n.element),...n,id:r,position:l,callback:s});return s(!0),c.rectangle=u,c.zOrder=o.zOrder,r}update(e,n){const o=Array.isArray(e)?e:[e];for(const s of o){const r=this.objects.get(s);if(r)for(const l of GC){const c=Object.assign({},n[l],(n==null?void 0:n.all)??{});if(!c)continue;const u=r[l];if(u)for(const d in c)d!=="position"&&d!=="id"&&(u[d]=c[d])}}return!0}remove(e){const n=Array.isArray(e)?e:typeof e=="string"?[e]:e;if(Array.isArray(n)){for(const o of n){const s=this.objects.get(o);s&&(s.label&&(this.screenManager.labelCollection.remove(s.label),s.label=void 0),s.billboard&&(this.screenManager.billboardCollection.remove(s.billboard),s.billboard=void 0),s.rectangle&&(this.screenManager.rectangleCollection.remove(s.rectangle),s.rectangle=void 0),this.tryDeleteEmpty(o))}return!0}else{for(const o of Object.keys(n)){const s=Array.isArray(n[o])?n[o]:[n[o]];for(const r of s){if(!r)continue;const l=this.objects.get(r);if(!l)continue;const c=l[o];c&&(this.screenManager.collectionMap[o].remove(c),l[o]=void 0),this.tryDeleteEmpty(r)}}return!0}}makeScreenObjectId(e,n){return`${e}_${n}`}getOrCreateObject(e,n){let o=this.objects.get(e);return o||(o=new RL(e,n),this.objects.set(e,o)),o}tryDeleteEmpty(e){const n=this.objects.get(e);n&&!n.label&&!n.billboard&&!n.rectangle&&this.objects.delete(e)}}function zL(t,i){const e=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER];for(const n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&GC.includes(n)){const o=i[n];if(!o)continue;const s=o.computeScreenSpacePosition(t.scene);let r=h[o instanceof h.Label?"Label":"Billboard"].getScreenSpaceBoundingBox(o,s),{x:l,y:c,width:u,height:d}=r;e[0]=Math.min(e[0],l),e[1]=Math.min(e[1],c),e[2]=Math.max(e[2],l+u),e[3]=Math.max(e[3],c+d)}return new h.Rectangle(...e)}class LL extends a.Destroyable{constructor(e){super();m(this,"rectangleCollisionCheck",new h.RectangleCollisionChecker);m(this,"screenManager");m(this,"enable",!1);m(this,"forceRebuildNext",!1);m(this,"avoidanceLayers",[]);m(this,"_processingQueue",[]);m(this,"_isProcessing",!1);m(this,"BATCH_SIZE",1e3);m(this,"_cache",new Map);m(this,"_lastCameraState",{});m(this,"CAMERA_MOVE_THRESHOLD",5e-4);this.screenManager=e,this.ad(()=>{this.rectangleCollisionCheck._tree.clear(),this._cache.clear(),this._processingQueue.length=0})}update(){if(this.avoidanceLayers.length==0)return;const e=this._shouldForceRebuild();this._buildProcessingQueue(e),this._isProcessing||(this._isProcessing=!0,requestAnimationFrame(()=>this._processBatch()))}setAvoidanceLayer(){for(let e=0;e<this.avoidanceLayers.length;e++){const n=this.screenManager.getLayer(this.avoidanceLayers[e]);n.layerIsEffective()&&n.objects.forEach((o,s)=>{o.show(!0)})}this.forceRebuildNext=!0,this.update()}updateAvoidanceLayer(e,n){this.enable=(e==null?void 0:e.enabled)??!1,n?e!=null&&e.enabled?this.avoidanceLayers.includes(n)||this.avoidanceLayers.push(n):this.avoidanceLayers=this.avoidanceLayers.filter(o=>o!=n):e!=null&&e.enabled?this.avoidanceLayers=Array.from(this.screenManager.layers.keys()):(this.setAvoidanceLayer(),this.avoidanceLayers=[]),this.setAvoidanceLayer()}_shouldForceRebuild(){if(this.forceRebuildNext)return this.forceRebuildNext=!1,this._updateLastCameraState(),!0;const e=this.screenManager.viewer.camera,n=e.positionWC,o=e.directionWC,s=this._lastCameraState.position,r=this._lastCameraState.direction;if(!s||!r)return this._updateLastCameraState(),!0;const l=h.Cartesian3.distanceSquared(n,s),c=h.Cartesian3.distanceSquared(o,r);return l>this.CAMERA_MOVE_THRESHOLD||c>this.CAMERA_MOVE_THRESHOLD?(this._updateLastCameraState(),!0):!1}_updateLastCameraState(){const e=this.screenManager.viewer.camera;this._lastCameraState.position=h.Cartesian3.clone(e.positionWC),this._lastCameraState.direction=h.Cartesian3.clone(e.directionWC)}_buildProcessingQueue(e){e&&(this.rectangleCollisionCheck._tree.clear(),this._cache.clear()),this._processingQueue.length=0;for(let n=0;n<this.avoidanceLayers.length;n++){const o=this.screenManager.getLayer(this.avoidanceLayers[n]);o.layerIsEffective()&&o.objects.forEach((s,r)=>{this._processingQueue.push(s)})}this._processingQueue.sort((n,o)=>(o.zOrder||0)-(n.zOrder||0))}_processBatch(){performance.now();const e=this._processingQueue,n=this.BATCH_SIZE;let o=0;for(;e.length>0&&o<n;){const s=e.shift();this._updateSingleObject(s),o++}e.length>0?requestAnimationFrame(()=>this._processBatch()):this._isProcessing=!1}_updateSingleObject(e){try{if(!this.screenManager.czmViewer.isPointVisible(e.position)){e.show(!1),this._cache.has(e.id.toString())&&this._cache.delete(e.id.toString());return}const n=e.id.toString(),o=this._cache.get(n),s=h.Cartesian3.clone(e.position);let r;if(o&&h.Cartesian3.equalsEpsilon(o.worldPos,s,1e-6))r=o.rect,this.rectangleCollisionCheck.remove(n,r);else{if(r=zL(this.screenManager.viewer,e),isNaN(r.width)||isNaN(r.height)){e.show(!1),this._cache.has(e.id.toString())&&this._cache.delete(e.id.toString());return}this._cache.set(n,{rect:r,worldPos:s,lastFrame:Date.now()})}this.rectangleCollisionCheck.collides(r)?e.show(!1):(e.show(!0),this.rectangleCollisionCheck.insert(e.id.toString(),r))}catch(n){console.error("ScreenManager update object error",n)}}}class HC extends a.Destroyable{constructor(){super();m(this,"_collection",[]);this.ad(()=>this._collection=[])}get length(){return this._collection.length}add(e){return this._collection.push(e),e._index=this._collection.length,e}remove(e){this._collection[e._index]=void 0}}class $C extends a.Destroyable{constructor(e){super();m(this,"layers",new Map);m(this,"czmViewer");m(this,"viewer");m(this,"avoidanceManager");m(this,"labelCollection");m(this,"billboardCollection");m(this,"rectangleCollection",this.ad(new HC));m(this,"canvasCollection",this.ad(new HC));m(this,"collectionMap");m(this,"_refreshEvent",this.ad(new a.Event));this.czmViewer=e,this.viewer=e.viewer,this.avoidanceManager=this.ad(new LL(this)),this.labelCollection=new h.LabelCollection({scene:this.viewer.scene}),this.billboardCollection=new h.BillboardCollection({scene:this.viewer.scene}),this.viewer.scene.primitives.add(this.labelCollection),this.viewer.scene.primitives.add(this.billboardCollection),this.collectionMap={label:this.labelCollection,billboard:this.billboardCollection,rectangle:this.rectangleCollection},this.ad(a.createEventsCallFunc([this.czmViewer.cameraChanged,this.refreshEvent],()=>{this.avoidanceManager.update()},{immediate:!0})),this.ad(()=>{this.layers.forEach(n=>n.destroy()),this.layers.clear(),this.labelCollection.removeAll(),this.billboardCollection.removeAll(),this.viewer.scene.primitives.remove(this.labelCollection),this.viewer.scene.primitives.remove(this.billboardCollection)})}get refreshEvent(){return this._refreshEvent}refresh(){this._refreshEvent.emit()}getLayer(e){let n=this.layers.get(e);return n||(n=new FL(this),this.layers.set(e,n),this.avoidanceManager.enable&&this.avoidanceManager.updateAvoidanceLayer({enabled:!0})),n}addLabel(e,n,o,s){const l=this.getLayer(n).addLabel(e,o,s);return this.refresh(),{layer:n,id:e,screenObjectId:l}}addImage(e,n,o,s){const l=this.getLayer(n).addImage(e,o,s);return this.refresh(),{layer:n,id:e,screenObjectId:l}}addRectangle(e,n,o,s,r){const c=this.getLayer(n).addRectangle(e,o,s,r);return this.refresh(),{layer:n,id:e,screenObjectId:c}}update(e,n,o,s){const r=this.getLayer(e);return!o||o.length===0?!1:(r.update(o,s),this.refresh(),!0)}remove(e,n,o){const s=this.getLayer(e);if(!s.remove(o)){console.warn(`屏幕管理器,删除${n}下的内容失败!`);return}!s.layerIsEffective()&&!s.isDestroyed()&&(s.destroy(),this.layers.delete(e)),this.refresh()}setRules(e,n){Reflect.has(e,"avoidance")&&this.avoidanceManager.updateAvoidanceLayer(e.avoidance,n),this.refresh()}}function et(t){return a.getExtProp(t,"_viewerExtensions")}function Ag(t,i){a.setExtProp(t,"_viewerExtensions",i)}class qC extends a.Destroyable{constructor(e,n){super();m(this,"_imageriesManager");m(this,"_terrainManager");m(this,"_labelManager");m(this,"_pickingManager");m(this,"_poiContext");m(this,"_cursorPositionInfo");m(this,"_screenManager");this._viewer=e,this._czmViewer=n,this._imageriesManager=this.dv(new UC(this.viewer)),this._terrainManager=this.dv(new BC(this.viewer)),this._labelManager=this.dv(new VC(this.viewer)),this._poiContext=this.disposeVar(new Dm(this._viewer)),this._cursorPositionInfo=this.disposeVar(new IL(this._viewer)),this.ad(n.viewerChanged.don(()=>{this._pickingManager=this.dv(new WC(n)),this._screenManager=this.ad(new $C(n)),this.ad(a.createEventsCallFunc(this.czmViewer.textAvoidanceChanged,()=>{this.screenManager.setRules({avoidance:{enabled:this.czmViewer.textAvoidance}})},{immediate:!0}))}))}get viewer(){return this._viewer}get czmViewer(){return this._czmViewer}get imageriesManager(){return this._imageriesManager}get terrainManager(){return this._terrainManager}get labelManager(){return this._labelManager}get pickingManager(){return this._pickingManager}get poiContext(){return this._poiContext}get cursorPositionInfo(){return this._cursorPositionInfo}get screenManager(){return this._screenManager}}var XC=new h.Cartesian3,YC=new h.Cartesian3;function ZC(t,i,e){let n=h.Matrix4.clone(t.transform);t.lookAtTransform(h.Matrix4.IDENTITY);var o=t.positionCartographic.height,s=t.positionWC,r=h.Cartesian3.normalize(s,XC),l=h.Cartesian3.dot(t.direction,r);if(l>-.9&&l<.9)var c=h.Cartesian3.cross(t.direction,r,YC);else var c=h.Cartesian3.cross(t.up,r,YC);var u=c;if(e){var d=h.Cartesian3.cross(r,c,XC);u=d}var p=h.Cartesian3.magnitude(s);t.rotate(u,i/p);var f=t.positionCartographic,g=f.longitude,v=f.latitude;h.Cartesian3.fromRadians(g,v,o,void 0,t.position),t.lookAtTransform(n)}function QC(t,i){ZC(t,i,!1)}function kC(t,i){ZC(t,-i,!0)}class OL extends a.Destroyable{constructor(e){super();m(this,"_actions",{MoveForward:!1,MoveBackword:!1,MoveLeft:!1,MoveRight:!1});this._running=e;const{controller:n}=this,{viewer:o}=n.firstPersonController,{camera:s}=o;this.dispose(this.running.keyStatus.currentKeyIdsChanged.disposableOn(()=>{this._updateActions()})),this.dispose(this.controller.keyDownEvent.disposableOn(r=>{const{keyStatusMap:l}=this.running.keyboardCameraController;l[r.code]==="SpeedUp"?this.controller.speed=this.controller.speed*2:l[r.code]==="SpeedDown"&&(this.controller.speed=this.controller.speed*.5)})),this.dispose(this.controller.keyDownEvent.disposableOn(r=>{const{keyStatusMap:l}=this.running.keyboardCameraController;l[r.code]==="SwitchAlwaysWithCamera"&&(this.controller.alwaysWithCamera=!this.controller.alwaysWithCamera)}));{const{actions:r}=this;let l=Date.now();const c=()=>{const u=Date.now(),d=u-l;l=u;const p=this.controller.speed;r.WithCamera||this.controller.alwaysWithCamera?(r.MoveForward&&s.moveForward(d*p),r.MoveBackword&&s.moveBackward(d*p),r.MoveLeft&&s.moveLeft(d*p),r.MoveRight&&s.moveRight(d*p)):(r.MoveForward&&QC(s,d*p),r.MoveBackword&&QC(s,-d*p),r.MoveLeft&&kC(s,-d*p),r.MoveRight&&kC(s,d*p));{const{rotateSpeed:f}=this.controller,g=h.Math.toRadians(f*d);r.RotateRight?s.lookRight(g):r.RotateLeft?s.lookRight(-g):r.RotateUp?s.lookDown(-g):r.RotateDown&&s.lookDown(g)}};o.scene.preUpdate.addEventListener(c),this.dispose(()=>o.scene.preUpdate.removeEventListener(c))}}get running(){return this._running}get controller(){return this.running.keyboardCameraController}get actions(){return this._actions}_resetActions(){const e=Object.keys(this._actions);for(let n of e)this._actions[n]=!1}_updateActions(){const{running:e}=this,{keyStatus:n}=e,{actions:o}=this;this._resetActions();const{keyStatusMap:s}=this.running.keyboardCameraController;for(let r of n.currentKeyIds)o[s[r]]=!0}}class Hh extends a.Destroyable{constructor(e){super();m(this,"_currentKeyIds",new Set);m(this,"_currentKeyIdsChanged",this.dv(new a.Event));m(this,"_debug",this.dv(a.react(!1)));m(this,"_debugResetting",this.dv(new a.ObjResettingWithEvent(this.debugChanged,()=>{if(this.debug)return new class extends a.Destroyable{constructor(e){super();const n=()=>{console.log([...e.currentKeyIds].join(`
1995
- `))};n(),this.d(e.currentKeyIdsChanged.don(n))}}(this)})));this._keyboardCameraControllerRunning=e;const{keyboardCameraController:n}=this._keyboardCameraControllerRunning;{const o=s=>{const r=Hh.getKeyId(s);this._currentKeyIds.has(r)||(this._currentKeyIds.add(r),this._currentKeyIdsChanged.emit())};this.d(n.keyDownEvent.don(o))}{const o=s=>{const r=Hh.getKeyId(s);this._currentKeyIds.has(r)&&(this._currentKeyIds.delete(r),this._currentKeyIdsChanged.emit())};this.d(n.keyUpEvent.don(o))}{const o=()=>{this._currentKeyIds.clear(),this._currentKeyIdsChanged.emit()};this.d(n.abortEvent.don(o))}}static getKeyId(e){return e.code}get currentKeyIds(){return this._currentKeyIds}get currentKeyIdsChanged(){return this._currentKeyIdsChanged}get debug(){return this._debug.value}set debug(e){this._debug.value=e}get debugChanged(){return this._debug.changed}}class NL extends a.Destroyable{constructor(e){super();m(this,"_keyStatus");m(this,"_cameraOp");this._keyboardCameraController=e,this._keyStatus=this.dv(new Hh(this)),this._cameraOp=this.dv(new OL(this))}get keyboardCameraController(){return this._keyboardCameraController}get keyStatus(){return this._keyStatus}get cameraOp(){return this._cameraOp}}const kh=class kh extends a.Destroyable{constructor(e){super();m(this,"_enabled",this.dv(a.react(!1)));m(this,"_keyStatusMap",this.dv(a.react(kh.defaultKeyStatusMap)));m(this,"_speed",this.dv(a.react(1)));m(this,"_rotateSpeed",this.dv(a.react(.01)));m(this,"_alwaysWithCamera",this.dv(a.react(!1)));m(this,"_keyDownEvent",this.dv(new a.Event));m(this,"_keyUpEvent",this.dv(new a.Event));m(this,"_abortEvent",this.dv(new a.Event));this._firstPersonController=e,this.dv(new a.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new NL(this)}))}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get keyStatusMap(){return this._keyStatusMap.value}set keyStatusMap(e){this._keyStatusMap.value=e}get keyStatusMapChanged(){return this._keyStatusMap.changed}get speed(){return this._speed.value}set speed(e){this._speed.value=e}get speedChanged(){return this._speed.changed}get rotateSpeed(){return this._rotateSpeed.value}set rotateSpeed(e){this._rotateSpeed.value=e}get rotateSpeedChanged(){return this._rotateSpeed.changed}get alwaysWithCamera(){return this._alwaysWithCamera.value}set alwaysWithCamera(e){this._alwaysWithCamera.value=e}get alwaysWithCameraChanged(){return this._alwaysWithCamera.changed}get keyDownEvent(){return this._keyDownEvent}keyDown(e){this._keyDownEvent.emit(e)}get keyUpEvent(){return this._keyUpEvent}keyUp(e){this._keyUpEvent.emit(e)}get abortEvent(){return this._abortEvent}abort(){this._abortEvent.emit()}};m(kh,"defaultKeyStatusMap",{ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"MoveLeft",ArrowRight:"MoveRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"});let $h=kh;function BL(t,i){t.lookRight(h.Math.toRadians(i.movementX)*.1),t.lookDown(h.Math.toRadians(i.movementY)*.1);const e=t.pitch,n=h.Math.clamp(e,-h.Math.PI_OVER_TWO,h.Math.PI_OVER_TWO);n!==e&&t.setView({destination:t.positionWC,orientation:{heading:t.heading,pitch:n,roll:t.roll}})}class VL extends a.Destroyable{constructor(i,e){super(),this._firstPersonController=i,this._mouseCameraController=e;const{canvas:n}=this._firstPersonController.viewer;{const o=s=>{const{camera:r}=this._firstPersonController.viewer.scene;BL(r,s)};n.addEventListener("pointermove",o),this.dispose(()=>n.removeEventListener("pointermove",o))}}}const Kh=class Kh extends a.Destroyable{constructor(e){super();m(this,"_mouseMoving",this.dv(new VL(this.firstPersonController,this.mouseCameraController)));this._mouseCameraController=e;const{viewer:n}=this.firstPersonController;this.mouseCameraController.enableViewerOriginInputs(!1),this.dispose(()=>this.mouseCameraController.enableViewerOriginInputs(!0)),Element.prototype.setPointerCapture=()=>{},this.dispose(()=>Element.prototype.setPointerCapture=Kh.origin_setPointerCapture);const o=n.canvas;o.requestPointerLock(),this.dispose(()=>document.exitPointerLock());{const s=()=>{document.pointerLockElement!==o&&(this.firstPersonController.mouseEnabled=!1)};document.addEventListener("pointerlockchange",s,!1),this.dispose(()=>document.removeEventListener("pointerlockchange",s,!1))}{const s=()=>{this.firstPersonController.mouseEnabled=!1,console.log("Error locking pointer")};document.addEventListener("pointerlockerror",s)}}get mouseCameraController(){return this._mouseCameraController}get firstPersonController(){return this.mouseCameraController.firstPersonController}get mouseMoving(){return this._mouseMoving}};m(Kh,"origin_setPointerCapture",Element.prototype.setPointerCapture);let Tg=Kh;class UL extends a.Destroyable{constructor(e){super();m(this,"_enabled",this.dv(a.react(!1)));m(this,"enableViewerOriginInputs",e=>{e?this.firstPersonController.czmViewer.incrementDisabledInputStack():this.firstPersonController.czmViewer.decrementDisabledInputStack()});m(this,"_mouseResetting",this.dv(new a.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new Tg(this)})));this._firstPersonController=e}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get mouseResetting(){return this._mouseResetting}}class WL extends a.Destroyable{constructor(e){super();m(this,"viewer");m(this,"_mouseCameraController",this.dv(new UL(this)));m(this,"_keyboardCameraController",this.dv(new $h(this)));if(this._viewer=e,!this._viewer.viewer)throw new Error("Cesium.Viewer不存在!");this.viewer=this._viewer.viewer}get czmViewer(){return this._viewer}get mouseCameraController(){return this._mouseCameraController}get mouseEnabled(){return this.mouseCameraController.enabled}set mouseEnabled(e){this.mouseCameraController.enabled=e}get mouseEnabledChanged(){return this.mouseCameraController.enabledChanged}get keyboardCameraController(){return this._keyboardCameraController}get keyboardEnabled(){return this.keyboardCameraController.enabled}set keyboardEnabled(e){this.keyboardCameraController.enabled=e}get keyboardEnabledChanged(){return this.keyboardCameraController.enabledChanged}}function KC(t){t.removeInputAction(h.ScreenSpaceEventType.LEFT_DOWN),t.removeInputAction(h.ScreenSpaceEventType.RIGHT_DOWN),t.removeInputAction(h.ScreenSpaceEventType.MIDDLE_DOWN),t.removeInputAction(h.ScreenSpaceEventType.MOUSE_MOVE),t.removeInputAction(h.ScreenSpaceEventType.LEFT_UP),t.removeInputAction(h.ScreenSpaceEventType.RIGHT_UP),t.removeInputAction(h.ScreenSpaceEventType.MIDDLE_UP)}function Mg(t,i,e,n=void 0){const s=t.camera,r=new h.Cartesian2;r.x=i.startPosition.x,r.y=0;const l=new h.Cartesian2;l.x=i.endPosition.x,l.y=0;let c=s.getPickRay(r,new h.Ray),u=s.getPickRay(l,new h.Ray),d=0,p,f;if(!c||!u)return;s.frustum instanceof h.OrthographicFrustum?(p=c.origin,f=u.origin,h.Cartesian3.add(s.direction,p,p),h.Cartesian3.add(s.direction,f,f),h.Cartesian3.subtract(p,s.position,p),h.Cartesian3.subtract(f,s.position,f),h.Cartesian3.normalize(p,p),h.Cartesian3.normalize(f,f)):(p=c.direction,f=u.direction);let g=h.Cartesian3.dot(p,f);g<1&&(d=Math.acos(g)),d=i.startPosition.x>i.endPosition.x?d:-d;const v=e._horizontalRotationAxis;if(h.defined(n)?s.look(n,-d):h.defined(v)?s.look(v,-d):s.lookLeft(d),r.x=0,r.y=i.startPosition.y,l.x=0,l.y=i.endPosition.y,c=s.getPickRay(r,new h.Ray),u=s.getPickRay(l,new h.Ray),d=0,!(!c||!u))if(s.frustum instanceof h.OrthographicFrustum?(p=c.origin,f=u.origin,h.Cartesian3.add(s.direction,p,p),h.Cartesian3.add(s.direction,f,f),h.Cartesian3.subtract(p,s.position,p),h.Cartesian3.subtract(f,s.position,f),h.Cartesian3.normalize(p,p),h.Cartesian3.normalize(f,f)):(p=c.direction,f=u.direction),g=h.Cartesian3.dot(p,f),g<1&&(d=Math.acos(g)),d=i.startPosition.y>i.endPosition.y?d:-d,n=n??v,h.defined(n)){const y=s.direction,w=h.Cartesian3.negate(n,new h.Cartesian3),P=h.Cartesian3.equalsEpsilon(y,n,h.Math.EPSILON2),C=h.Cartesian3.equalsEpsilon(y,w,h.Math.EPSILON2);if(!P&&!C){g=h.Cartesian3.dot(y,n);let S=h.Math.acosClamped(g);d>0&&d>S&&(d=S-h.Math.EPSILON4),g=h.Cartesian3.dot(y,w),S=h.Math.acosClamped(g),d<0&&-d>S&&(d=-S+h.Math.EPSILON4);const x=h.Cartesian3.cross(n,y,new h.Cartesian3);s.look(x,d)}else(P&&d<0||C&&d>0)&&s.look(s.right,-d)}else s.lookUp(d)}class GL extends a.Destroyable{constructor(i,e){super();const n=e.viewer;if(!n)throw new Error("viewer is undefined");let o=!0;this.d(i.positionChanged.don(()=>o=!0)),this.d(i.rotationChanged.don(()=>o=!0)),this.d(i.offsetHeightChanged.don(()=>o=!0)),this.d(i.viewDistanceChanged.don(()=>o=!0)),this.d(i.offsetRotationChanged.don(()=>o=!0)),this.d(i.relativeRotationChanged.don(()=>o=!0));const s=[0,0,0],r=[0,0,0];this.d(n.clock.onTick.addEventListener(()=>{if(!o)return;if(o=!1,!i.position){console.warn("相机控制器未能设置位置,无法启用!");return}if(i.viewDistance===void 0){console.warn("相机控制器未能设置视距,将自动设置视距!");const p=Ie(i.position),f=n.camera.positionWC,g=h.Cartesian3.distance(p,f);i.viewDistance=g}a.Vector.clone(i.position,r),i.offsetHeight&&(r[2]+=i.offsetHeight);const{rotation:l,offsetRotation:c=Bi.defaults.offsetRotation}=i,u=[...c];a.Vector.set(s,0,0,0),l&&(i.relativeRotation??Bi.defaults.relativeRotation)&&(a.Vector.add(l,s,s),u[0]+=90),a.Vector.add(u,s,s);const d={distance:i.viewDistance,heading:s[0],pitch:s[1],flyDuration:0,hDelta:0,pDelta:0};e.flyTo(d,r)})),e.incrementDisabledInputStack(),this.d(()=>{e.decrementDisabledInputStack()}),this.d(e.pointerMoveEvent.don(l=>{const c=l==null?void 0:l.pointerEvent;if(c&&i.enabledRotationInput&&(c.buttons===1||c.buttons===2)){const{movementX:u,movementY:d}=c;i.offsetRotation=a.Vector.add(i.offsetRotation??Bi.defaults.offsetRotation,[u*.2,d*-.2,0])}})),this.d(e.wheelEvent.don(l=>{if(!i.enabledScaleInput)return;const c=l.deltaY,d=Math.max(1,i.viewDistance)*(c*.001);i.viewDistance=i.viewDistance+d}))}}class Bi extends a.Destroyable{constructor(e){super();m(this,"_resetWithCameraEvent",this.dv(new a.Event));const n=e.viewer;if(!n)throw new Error("viewer is undefined");const o=this;let s;const r=()=>{s&&(s.destroy(),s=void 0)};this.d(r);const l=()=>{r(),o.enabled&&(s=new GL(o,e))};l(),this.d(o.enabledChanged.don(l)),this.d(o.resetWithCameraEvent.don(c=>{if(!e.actived)return;const u=Ko(n.camera);if(!u)return;const d=o.rotation;o.offsetRotation=[u[0]-(o.relativeRotation?d[0]:90),u[1]-(o.relativeRotation?d[1]:0),u[2]-(o.relativeRotation?d[2]:0)]}))}get resetWithCameraEvent(){return this._resetWithCameraEvent}resetWithCamera(e){this._resetWithCameraEvent.emit(e)}}m(Bi,"defaults",{position:[116.39,39.9,0],rotation:[0,0,0],offsetRotation:[0,-60,0],relativeRotation:!0}),(t=>{t.createDefaultProps=()=>({enabled:!1,showTarget:!1,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArrayWithUndefined(void 0),rotationEditing:!1,viewDistance:1e3,offsetHeight:0,offsetRotation:a.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,relativeRotation:!0})})(Bi||(Bi={})),a.extendClassProps(Bi.prototype,Bi.createDefaultProps);class pa extends a.Destroyable{constructor(e){super();m(this,"_geoCameraController");m(this,"_geoPolylinePath");this._geoCameraController=this.dv(new Bi(e)),this._geoPolylinePath=this.dv(new Ms(e)),this._geoPolylinePath.show=!1,this._geoPolylinePath.currentTime=0;const n=()=>{(this.usePathPosition??!0)&&(this._geoCameraController.position=this._geoPolylinePath.currentPosition),(this.usePathRotation??!0)&&(this._geoCameraController.rotation=this._geoPolylinePath.currentRotation)};n(),this.d(this._geoPolylinePath.currentPositionChanged.don(n)),this.d(this._geoPolylinePath.currentRotationChanged.don(n)),this.dispose(a.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dispose(a.bind([this._geoCameraController,"viewDistance"],[this,"viewDistance"])),this.dispose(a.bind([this._geoCameraController,"offsetHeight"],[this,"offsetHeight"])),this.dispose(a.bind([this._geoCameraController,"offsetRotation"],[this,"offsetRotation"])),this.dispose(a.track([this._geoCameraController,"enabledRotationInput"],[this,"enabledRotationInput"])),this.dispose(a.track([this._geoCameraController,"enabledScaleInput"],[this,"enabledScaleInput"])),this.dv(new a.ObjResettingWithEvent(this.lineModeChanged,()=>{if(this.lineMode!==void 0){if(this.lineMode==="auto")return new HL(this,e);if(this.lineMode==="manual")return new $L(this,e)}}))}get geoCameraController(){return this._geoCameraController}get polylinePath(){return this._geoPolylinePath}get position(){return this._geoCameraController.position}get positionChanged(){return this._geoCameraController.positionChanged}get rotation(){return this._geoCameraController.rotation}get roataionChanged(){return this._geoCameraController.rotationChanged}}(t=>{t.createDefaultProps=()=>({enabled:!1,usePathPosition:!0,usePathRotation:!0,viewDistance:1e3,offsetHeight:0,offsetRotation:a.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,lineMode:void 0})})(pa||(pa={})),a.extendClassProps(pa.prototype,pa.createDefaultProps);class HL extends a.Destroyable{constructor(i,e){if(super(),!e.viewer)throw new Error("viewer is undefined");i.offsetRotation=[-90,0,0]}}class $L extends a.Destroyable{constructor(i,e){if(super(),!e.viewer)throw new Error("viewer is undefined");const o=s=>{(s.key==="w"||s.key==="s")&&(i.polylinePath.playing=s.type==="keydown",i.polylinePath.speed=s.key==="w"||s.type==="keyup"?1:-1)};this.dispose(e.keyDownEvent.don(o)),this.dispose(e.keyUpEvent.don(o))}}class qL extends a.Destroyable{constructor(i,e){super();const n=e.positionPropertyName??"position",o=e.positionChangedPropertyName??n+"Changed",s=e.rotationPropertyName??"rotation",r=e.rotationChangedPropertyName??s+"Changed",l=(e.positionTracking??!0)&&Reflect.has(i,n)&&Reflect.has(i,o),c=(e.rotationTracking??!0)&&Reflect.has(i,s)&&Reflect.has(i,r);if(!(!l&&!c)){if(l){const u=()=>{e.geoCameraController.position=i[n]};u();const d=i[o];this.d(d.don(u))}if(c){const u=()=>{e.geoCameraController.rotation=i[s]};u();const d=i[o];this.d(d.don(u))}}}}class XL extends a.Destroyable{constructor(i,e){super();const n=this.dv(new a.ESSceneObjectWithId);n.id=i;const o=this.dv(a.createNextAnimateFrameEvent(e.enabledChanged,e.positionTrackingChanged,e.rotationTrackingChanged,e.positionPropertyNameChanged,e.positionChangedPropertyNameChanged,e.rotationPropertyNameChanged,e.rotationChangedPropertyNameChanged,n.sceneObjectChanged));this.disposeVar(new a.ObjResettingWithEvent(o,()=>{const{sceneObject:s}=n;if(!(!e.enabled||!s))return new qL(s,e)}))}}class fa extends a.Destroyable{constructor(e){super();m(this,"_geoCameraController");this._geoCameraController=this.dv(new Bi(e)),this.d(a.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dv(new a.ObjResettingWithEvent(this.sceneObjectIdChanged,()=>{if(this.sceneObjectId)return new XL(this.sceneObjectId,this)}))}get geoCameraController(){return this._geoCameraController}}(t=>{t.createDefaultProps=()=>({enabled:void 0,sceneObjectId:void 0,positionTracking:void 0,rotationTracking:void 0,positionPropertyName:void 0,positionChangedPropertyName:void 0,rotationPropertyName:void 0,rotationChangedPropertyName:void 0})})(fa||(fa={})),a.extendClassProps(fa.prototype,fa.createDefaultProps);class YL extends a.Destroyable{constructor(e){super();m(this,"height",1e7);m(this,"cycle",60);m(this,"latitude",38*3.1415926/18);m(this,"_running",!1);m(this,"_sseh");m(this,"_eventDisposer");m(this,"leftDownCancel",!0);this._viewer=e,this._sseh=this.dv(new h.ScreenSpaceEventHandler(this._viewer.canvas)),this._sseh.setInputAction(()=>{this.leftDownCancel&&this.cancel()},h.ScreenSpaceEventType.LEFT_DOWN),this.d(()=>{this.cancel()})}get viewer(){return this._viewer}get sseh(){return this._sseh}start(){if(this._running)return;const e=this._viewer.camera,n=e.positionCartographic;e.flyTo({destination:h.Cartesian3.fromRadians(n.longitude,this.latitude,this.height),orientation:{heading:0,pitch:-.5*h.Math.PI,roll:0},complete:()=>{this._running=!0;var o=void 0;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((s,r)=>{if(!o){o=new Date().getTime();return}const l=(new Date().getTime()-o)/1e3,c=e.positionCartographic.longitude+l*h.Math.PI*2/this.cycle;e.setView({destination:h.Cartesian3.fromRadians(c,this.latitude,this.height),orientation:{heading:0,pitch:-.5*h.Math.PI,roll:0}}),o=new Date().getTime()})},duration:.5})}cancel(){this._running&&(this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1)}}class ZL extends a.Destroyable{constructor(e){super();m(this,"_height",this.dv(a.react(1e7)));m(this,"_cycle",this.dv(a.react(60)));m(this,"_latitude",this.dv(a.react(38)));m(this,"_inner");this._czmViewer=e;const n=this._czmViewer.viewer;if(!n)throw new Error("未初始化viewer");this._inner=this.dv(new YL(n)),this._inner.leftDownCancel=!1;{const o=()=>{this._inner.height=this.height,this._inner.cycle=this.cycle,this._inner.latitude=this.latitude*Math.PI/180};o(),this.d(this.heightChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.latitudeChanged.don(o))}}get height(){return this._height.value}set height(e){this._height.value=e}get heightChanged(){return this._height.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get latitude(){return this._latitude.value}set latitude(e){this._latitude.value=e}get latitudeChanged(){return this._latitude.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class QL extends a.Destroyable{constructor(e){super();m(this,"_position",this.dv(a.reactArrayWithUndefined(void 0)));m(this,"_distance",this.dv(a.react(5e4)));m(this,"_cycle",this.dv(a.react(60)));m(this,"_heading",this.dv(a.react(0)));m(this,"_pitch",this.dv(a.react(-30)));m(this,"_transform");m(this,"_headingRadius");m(this,"_pitchRadius");m(this,"_running",!1);m(this,"_sseh");m(this,"_eventDisposer");this._viewer=e;const n=this.viewer.scene,o=this.viewer.camera;this._sseh=this.dv(new h.ScreenSpaceEventHandler(this.viewer.canvas)),this.d(()=>{this.cancel()});{const s=()=>{let r;if(this.position==null){var l=o.getPickRay(new h.Cartesian2(n.canvas.width*.5,n.canvas.height*.5));if(!l)return;r=n.globe.pick(l,n)}else r=h.Cartesian3.fromDegrees(...this.position);r&&(this._transform=h.Transforms.eastNorthUpToFixedFrame(r),this.start())};s(),this.d(this.positionChanged.don(s))}{const s=()=>{this._headingRadius=h.Math.toRadians(this.heading)};s(),this.d(this.headingChanged.don(s))}{const s=()=>{this._pitchRadius=h.Math.toRadians(this.pitch)};s(),this.d(this.pitchChanged.don(s))}}get viewer(){return this._viewer}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get sseh(){return this._sseh}start(){if(this._running)return;const e=this.viewer.camera;e.lookAtTransform(this._transform);var n=this.distance*Math.sin(this._pitchRadius),o=this.distance*Math.cos(this._pitchRadius),s=new h.Cartesian3(0,n,o);e.flyTo({destination:h.Matrix4.multiplyByPoint(this._transform,s,new h.Cartesian3),orientation:{heading:this._headingRadius,pitch:this._pitchRadius,roll:0},endTransform:this._transform,complete:()=>{this._running=!0;let r;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((l,c)=>{if(!r){r=new Date().getTime();return}const u=(new Date().getTime()-r)/1e3;this._headingRadius+=u*h.Math.PI*2/this.cycle,e.lookAtTransform(this._transform,new h.HeadingPitchRange(this._headingRadius,this._pitchRadius,this.distance)),r=new Date().getTime()})},duration:.5,maximumHeight:e.positionCartographic.height})}cancel(){if(!this._running)return;this.viewer.camera.lookAtTransform(h.Matrix4.IDENTITY),this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1}}class kL extends a.Destroyable{constructor(e){super();m(this,"_position",this.dv(a.reactArrayWithUndefined(void 0)));m(this,"_distance",this.dv(a.react(5e4)));m(this,"_cycle",this.dv(a.react(60)));m(this,"_heading",this.dv(a.react(0)));m(this,"_pitch",this.dv(a.react(-30)));m(this,"_inner");this._czmViewer=e;const n=this._czmViewer.viewer;if(!n)throw new Error("viewer is undefined");this._inner=this.dv(new QL(n));{const o=()=>{this.inner.distance=this.distance,this.inner.cycle=this.cycle,this.inner.position=this.position,this.inner.heading=this.heading,this.inner.pitch=this.pitch};o(),this.d(this.distanceChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.positionChanged.don(o)),this.d(this.headingChanged.don(o)),this.d(this.pitchChanged.don(o))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class KL extends a.Destroyable{constructor(e){super();m(this,"_firstPersonController");m(this,"_rotateGlobe");m(this,"_rotatePoint");m(this,"_followController");m(this,"_pathCameraController");m(this,"_handler");this._viewer=e;{this._firstPersonController=this.dv(new WL(e)),this.d(this._viewer.keyDownEvent.don(n=>this._firstPersonController.keyboardCameraController.keyDown(n))),this.d(this._viewer.keyUpEvent.don(n=>this._firstPersonController.keyboardCameraController.keyUp(n)));{const{subContainer:n}=this._viewer;if(!n)throw new Error("_firstPersonControllerInit error!");const o=()=>this._firstPersonController.keyboardCameraController.abort();n.addEventListener("blur",o,!1),this.d(()=>n.removeEventListener("blur",o,!1))}this._firstPersonController.keyboardEnabled=!1,this._firstPersonController.mouseEnabled=!1,this._firstPersonController.keyboardCameraController.speed=.006,this._firstPersonController.keyboardCameraController.rotateSpeed=.05,this._firstPersonController.keyboardCameraController.alwaysWithCamera=!1,this._firstPersonController.keyboardCameraController.keyStatusMap=$h.defaultKeyStatusMap,this.d(this._firstPersonController.keyboardEnabledChanged.don(()=>{var n;(n=this._viewer.subContainer)==null||n.focus()}))}this._rotateGlobe=this.dv(new ZL(e)),this._rotatePoint=this.dv(new kL(e)),this._followController=this.dv(new fa(e)),this._pathCameraController=this.dv(new pa(e))}get firstPersonController(){return this._firstPersonController}get rotateGlobe(){return this._rotateGlobe}get rotatePoint(){return this._rotatePoint}get followController(){return this._followController}get pathCameraController(){return this._pathCameraController}resetNavigation(){this._firstPersonController.keyboardEnabled=!1,this._rotateGlobe.cancel(),this._rotatePoint.cancel(),this._followController.enabled=!1,this._followController.sceneObjectId=void 0,this._followController.geoCameraController.offsetRotation=[-90,0,0],this._followController.geoCameraController.viewDistance=0,this._pathCameraController.enabled=!1,this._pathCameraController.polylinePath.playing=!1,this._pathCameraController.polylinePath.currentTime=0,this._pathCameraController.polylinePath.loop=!1,this._pathCameraController.geoCameraController.offsetHeight=0,this._pathCameraController.polylinePath.positions=void 0,this._pathCameraController.lineMode=void 0}changeToMap(){this.resetNavigation(),this._changedMouseEvent("Map")}changeToWalk(e,n=4.2,o=1.6){this.resetNavigation();const s=this._viewer.navigationMode!="Walk";this._changedMouseEvent("Walk");const r=this._viewer.getCameraInfo(),l=[(r==null?void 0:r.rotation[0])??0,0,0];this._viewer.getHeightByLonLat(e[0],e[1]).then(c=>{s?this._viewer.flyIn([e[0],e[1],(c??0)+o],l):this._viewer.viewer&&(this._viewer.viewer.camera.position=h.Cartesian3.fromDegrees(e[0],e[1],(c??0)+o)),this.firstPersonController.keyboardEnabled=!0,this.firstPersonController.keyboardCameraController.speed=.006,this.firstPersonController.keyboardCameraController.rotateSpeed=.05,this.firstPersonController.keyboardCameraController.keyStatusMap={ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"RotateLeft",ArrowRight:"RotateRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"}})}changeToRotateGlobe(e=38,n=1e7,o=60){this.resetNavigation(),this._changedMouseEvent("RotateGlobe"),this._rotateGlobe.latitude=e,this._rotateGlobe.height=n,this._rotateGlobe.cycle=o,this._rotateGlobe.start()}changeToRotatePoint(e,n=5e4,o=60,s=0,r=-30){this.resetNavigation(),this._changedMouseEvent("RotatePoint"),this._rotatePoint.position=e,this._rotatePoint.distance=n,this._rotatePoint.cycle=o,this._rotatePoint.heading=s,this._rotatePoint.pitch=r,this._rotatePoint.start()}changeToFollow(e,n=0,o=0,s=-30,r=!0){this.resetNavigation(),this._changedMouseEvent("Follow"),this._followController.sceneObjectId=e,this._followController.geoCameraController.offsetRotation=[o,s,0],this._followController.geoCameraController.relativeRotation=r,n!==0?this._followController.geoCameraController.viewDistance=n:this._followController.geoCameraController.viewDistance=1e3,this._followController.enabled=!0}changeToLine(e,n=10,o=10,s=!0,r=10,l="auto"){this.resetNavigation(),this._changedMouseEvent("Line");const c=l==="auto",u=a.ESSceneObject.getSceneObjById(e);if(!u)return;const{points:d}=u;if(!d)return;const p=a.getDistancesFromPositions(d,"NONE"),f=p[p.length-1];this._pathCameraController.viewDistance=0,this._pathCameraController.polylinePath.positions=[...d],this._pathCameraController.polylinePath.duration=f/n*1e3,this._pathCameraController.polylinePath.loop=s,this._pathCameraController.offsetHeight=o;const g=um(d);this._pathCameraController.polylinePath.rotationRadius=!c||g==!1?[0]:g.map(v=>v/r*n),this._pathCameraController.enabledRotationInput=!c,this._pathCameraController.enabledScaleInput=!1,this._pathCameraController.polylinePath.playing=c,this._pathCameraController.lineMode=l,this._pathCameraController.enabled=!0}_changedMouseEvent(e){const n=this._viewer.viewer;if(!n)return;this._handler||(this._handler=new h.ScreenSpaceEventHandler(n.scene.canvas));const o=this._handler,s=n.scene.screenSpaceCameraController;this.d(()=>{o&&KC(o)}),e=="Walk"||e=="RotateGlobe"?(s.lookEventTypes=void 0,s.rotateEventTypes=void 0,s.tiltEventTypes=void 0,s.zoomEventTypes=void 0,s.translateEventTypes=void 0,o&&e=="Walk"&&(o.setInputAction(r=>{o.setInputAction(l=>{Mg(n.scene,l,s)},h.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(l=>{o.removeInputAction(h.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(h.ScreenSpaceEventType.LEFT_UP)},h.ScreenSpaceEventType.LEFT_UP)},h.ScreenSpaceEventType.LEFT_DOWN),o.setInputAction(r=>{o.setInputAction(l=>{Mg(n.scene,l,s)},h.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(l=>{o.removeInputAction(h.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(h.ScreenSpaceEventType.RIGHT_UP)},h.ScreenSpaceEventType.RIGHT_UP)},h.ScreenSpaceEventType.RIGHT_DOWN),o.setInputAction(r=>{o.setInputAction(l=>{Mg(n.scene,l,s)},h.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(l=>{o.removeInputAction(h.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(h.ScreenSpaceEventType.MIDDLE_UP)},h.ScreenSpaceEventType.MIDDLE_UP)},h.ScreenSpaceEventType.MIDDLE_DOWN))):(o&&KC(o),s.lookEventTypes=h.CameraEventType.RIGHT_DRAG,s.rotateEventTypes=h.CameraEventType.LEFT_DRAG,s.tiltEventTypes=[h.CameraEventType.MIDDLE_DRAG,h.CameraEventType.PINCH,{eventType:h.CameraEventType.LEFT_DRAG,modifier:h.KeyboardEventModifier.CTRL},{eventType:h.CameraEventType.RIGHT_DRAG,modifier:h.KeyboardEventModifier.CTRL}],s.translateEventTypes=h.CameraEventType.LEFT_DRAG,s.zoomEventTypes=[h.CameraEventType.WHEEL,h.CameraEventType.PINCH,{eventType:h.CameraEventType.RIGHT_DRAG,modifier:h.KeyboardEventModifier.SHIFT}])}}const JL=[{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3558367297943,39.93163726456884,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30223283037274,39.92688664316035,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.43707387584969,39.922782714050356,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.27929428317248,39.895318074706246,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36181901056395,39.89720944386167,3553.618347252562]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.40050587550184,39.87565113086582,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.31629153797958,39.88888615917464,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.38662084727662,39.93026695192356,5222.983612030221]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.35985958294472,39.879559968940974,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30061281533665,39.86521469244785,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.33589491695909,39.85251691437225,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3978491755026,39.92191230041099,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.404556165088,39.901554635269065,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3371677114933,39.90666589456628,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30329238580244,39.90598342431921,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.25047545555285,39.927295935589235,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33129680063607,39.98205319015022,5500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.38241622722414,39.864780790627634,5800]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.24126681456984,39.85629130246847,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.4476299820832,39.9015287845667,5233.181711832771]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33116617802452,39.824241891065384,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.15206905891218,39.90872966468676,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.24197212869294,39.88630968655299,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.43381133281572,39.96058832885812,5700]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.21635435523064,39.966450178376924,7e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.17908072725879,39.87211951629164,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.32516866705241,39.94534681561764,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36086721251684,39.948381883306446,3400]}];class jL extends a.Destroyable{constructor(e){super();m(this,"_show",this.dv(a.react(!1)));m(this,"cloudsPostProcess");const n=e.viewer;if(!n)throw new Error("Cesium Viewer is not initialized");const o=new h.CloudCollection;n.scene.primitives.add(o),this.dispose(()=>n.scene.primitives.remove(o));{const s=()=>{o.show=this.show};s(),this.dispose(this.showChanged.disposableOn(s))}{const s=l=>({slice:l.slice,brightness:l.brightness,scale:Pe(l.scale),maximumSize:hi(l.maximumSize),color:te(l.color),position:Ie(l.position)});(()=>{o.removeAll();for(let l of JL)o.add(s(l))})()}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}class ga extends a.Destroyable{constructor(i){super();const e=i.viewer;if(!e){console.warn("viewer is undefined!");return}const n=e.scene.postProcessStages.add(h.PostProcessStageLibrary.createDepthOfFieldStage());this.d(()=>e.scene.postProcessStages.remove(n));{const o=()=>{n.enabled=this.show};o(),this.d(this.showChanged.don(o))}{const o=()=>{n.uniforms.fogByDistance=this.focalDistance};o(),this.d(this.focalDistanceChanged.don(o))}{const o=()=>{n.uniforms.delta=this.delta};o(),this.d(this.deltaChanged.don(o))}{const o=()=>{n.uniforms.sigma=this.sigma};o(),this.d(this.sigmaChanged.don(o))}{const o=()=>{n.uniforms.stepSize=this.stepSize};o(),this.d(this.stepSizeChanged.don(o))}}}(t=>{t.createDefaultProps=()=>({show:!1,focalDistance:87,delta:1,sigma:3.78,stepSize:2.46})})(ga||(ga={})),a.extendClassProps(ga.prototype,ga.createDefaultProps);const e4=`
1994
+ }`},translucent:!0}),MF(),IF(),DF(),LF(),OF(),NF(),BF(),TF(),QF(),kF(),JF(),Cz(),h.Camera.DEFAULT_VIEW_RECTANGLE=h.Rectangle.fromDegrees(70,5,140,55);function bL(){return new Promise((t,i)=>h.GroundPolylinePrimitive.initializeTerrainHeights().then(t))}class SL extends a.Destroyable{constructor(i,e,n,o){super();const s=()=>{e.setStatus("Raw");const{viewer:l}=e;if(l){const c=et(l);if(c&&(c.destroy(),Ag(l,void 0)),h.defined(l)){l.entities.removeAll(),l.dataSources.removeAll(),l.imageryLayers.removeAll(),l.scene.primitives.removeAll(),l.scene.groundPrimitives.removeAll(),l.scene.postProcessStages.removeAll();let u=l.scene.context._originalGLContext;u.canvas.width=u.canvas.height=1,u.getExtension("WEBGL_lose_context").loseContext(),u=null}l.destroy(),n(void 0)}};this.d(s);const r=this.dv(a.createProcessingFromAsyncFunc(async(l,c)=>{e.setStatus("Creating"),e.setStatusLog("正在创建Cesium视口...");const u=AF;await l.promise(bL());const d=await l.promise(a.createCancelablePromise(u(c,o)));d.scene._xbsjOriginSkyAtmosphere=d.scene.skyAtmosphere,d.scene._xbsjOriginSkyBox=d.scene.skyBox,d.scene.renderError.removeEventListener(d.cesiumWidget._onRenderError),d.clockViewModel.currentTime=h.JulianDate.fromDate(new Date(e.currentTime)),this.dispose(e.currentTimeChanged.disposableOn(()=>{if(e.currentTime===void 0)return;const p=h.JulianDate.fromDate(new Date(e.currentTime));h.JulianDate.equals(p,d.clockViewModel.currentTime)||(d.clockViewModel.currentTime=p)})),this.dispose(Ci(d.clockViewModel,"currentTime",p=>{const f=h.JulianDate.toDate(d.clockViewModel.currentTime).getTime();f!==e.currentTime&&(e.currentTime=f)}));{const p=new qC(d,e);Ag(d,p)}e.setStatus("Created"),e.setStatusLog("成功创建Cesium视口!"),n(d)}));r.start(i),r.errorEvent.don(l=>{console.error(l),e.setStatus("Error"),e.setStatusLog("创建Cesium视口失败!")})}}const EL=new h.EllipsoidTerrainProvider;class BC extends a.Destroyable{constructor(e){super();m(this,"_terrainMap",new Map);m(this,"_nextAnimateFrame",this.dv(a.createNextAnimateFrame()));m(this,"selectedTerrain");this._viewer=e;const n=this._viewer,o=n.scene.globe.terrainProviderChanged.addEventListener(()=>{this.selectedTerrain&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit())});this.ad(()=>{o&&o()}),this.dispose(this._changed.disposableOn(()=>{this.selectedTerrain=void 0;let s=Number.MIN_SAFE_INTEGER;for(let r of this._terrainMap.keys())r.sceneObject.activate=!1,(r.sceneObject.show??!0)&&r.sceneObject.zIndex>=s&&(this.selectedTerrain&&console.warn(`存在多个terrain,只能显示一个,当前terrian:${this.selectedTerrain.sceneObject.name}(${this.selectedTerrain.sceneObject.id}), 即将被替换成${r.sceneObject.name}(${r.sceneObject.id})`),s=r.sceneObject.zIndex,this.selectedTerrain=r);this.selectedTerrain&&!this.selectedTerrain.provider&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit()),n.scene.terrainProvider=(this.selectedTerrain&&this.selectedTerrain.provider)??EL}))}_makeDirty(){this._nextAnimateFrame.restartIfNotRunning()}get _changed(){return this._nextAnimateFrame.completeEvent}add(e){if(this._terrainMap.has(e)){console.warn("this._terrainMap.has(imagery)");return}const n=new a.Destroyable;n.dispose(e.providerChanged.disposableOn(()=>this._makeDirty())),n.dispose(e.sceneObject.showChanged.disposableOn(()=>this._makeDirty())),this._terrainMap.set(e,()=>n.destroy()),this._makeDirty();const o=this.ad(a.createNextAnimateFrameEvent(e.sceneObject.zIndexChanged));this.d(o.don(()=>{this._changed.emit()}))}delete(e){if(!this._terrainMap.has(e)){console.warn("!this._imageriesMap.has(imagery)");return}const n=this._terrainMap.get(e);if(!n){console.error("!disposeFunc");return}n(),this._terrainMap.delete(e),this.selectedTerrain===e&&(this.selectedTerrain=void 0),this._makeDirty()}}class VC extends a.Destroyable{constructor(e){super();m(this,"_labelMap",{div:new Map,canvas:new Map});this._viewer=e,this.d(e.scene.camera.changed.addEventListener(()=>{this._updateZOrder()}))}add(e){const n=e instanceof He?"div":"canvas";if(this._labelMap[n].has(e)){console.warn(`this._labelMap[${n}].has(poi)`,e);return}const o=new a.Destroyable;{const s=o.dv(a.createNextAnimateFrameEvent(e.zOrderChanged,e.positionChanged));o.dispose(s.don(()=>{this._updateZOrder()}))}this._labelMap[n].set(e,()=>o.destroy()),this._updateZOrder()}delete(e){const n=e instanceof He?"div":"canvas";if(!this._labelMap[n].has(e)){console.warn(`!this._labelMap[${n}].has(poi)`,e);return}const o=this._labelMap[n].get(e);if(!o){console.error("!disposeFunc");return}o(),this._labelMap[n].delete(e),this._updateZOrder()}_updateZOrder(){for(const e in this._labelMap)Object.prototype.hasOwnProperty.call(this._labelMap,e)&&this._updateLabelZOrder(this._labelMap[e],e)}_updateLabelZOrder(e,n){const o={};for(const l of e.keys())o[l.zOrder]||(o[l.zOrder]=new Map),o[l.zOrder].set(l,l instanceof He?l.czmDivPoi?l.czmDivPoi.depth:0:l.canvasObj?l.canvasObj.czmCanvasPoi.depth:0);const s=Object.keys(o).sort((l,c)=>n=="div"?Number(c)-Number(l):Number(l)-Number(c));let r=e.size;for(let l=0;l<s.length;l++)new Map([...o[s[l]]].sort((u,d)=>Number(d[1])-Number(u[1]))).forEach((u,d)=>{d instanceof He&&d.czmDivPoi&&(d.czmDivPoi.zOrder=r),d instanceof $i&&d.canvasObj&&(d.canvasObj.czmCanvasPoi.zOrder=r),r--})}}class xL extends a.Destroyable{constructor(e){super();m(this,"_czmImageryLayerWrappers",new Set);m(this,"_zIndexChangedEvent",this.dv(new a.Event));this._viewer=e,this.d(this._zIndexChangedEvent.don(()=>{const n=[...this.czmImageryLayerWrappers.values()];n.sort((o,s)=>{const r=o.czmImageryWrapper.imagery.zIndex??a.ESImageryLayer.defaults.zIndex,l=s.czmImageryWrapper.imagery.zIndex??a.ESImageryLayer.defaults.zIndex;return r-l});for(const o of n)this.viewer.imageryLayers.raiseToTop(o.imageryLayer)}))}get viewer(){return this._viewer}get czmImageryLayerWrappers(){return this._czmImageryLayerWrappers}add(e){this._czmImageryLayerWrappers.add(e),this.viewer.imageryLayers.add(e.imageryLayer),this.zIndexChange()}delete(e){this.viewer.imageryLayers.remove(e.imageryLayer,!1),this._czmImageryLayerWrappers.delete(e)}zIndexChange(){this._zIndexChangedEvent.emit()}}class AL extends a.Destroyable{constructor(e){super();m(this,"_imageryLayer");if(this._czmImageryWrapper=e,!this._czmImageryWrapper.imagery.layer)throw new Error("this._czmCzmImageryWrapper.imagery.czmImagery");this._imageryLayer=this._czmImageryWrapper.imagery.layer;const{czmImageryWrapper:n}=this,o=n.manager.czmImageriesManager;o.add(this),this.d(()=>o.delete(this)),this.d(this._czmImageryWrapper.imagery.zIndexChanged.don(()=>o.zIndexChange()))}get imageryLayer(){return this._imageryLayer}get czmImageryWrapper(){return this._czmImageryWrapper}}class TL extends a.Destroyable{constructor(e){super();m(this,"_objResetting");this._czmImageryWrapper=e,this._objResetting=this.dv(new a.ObjResettingWithEvent(this.czmImageryWrapper.imagery.showChanged,()=>{if(this.czmImageryWrapper.imagery.show??!0)return new AL(this.czmImageryWrapper)}))}get czmImageryWrapper(){return this._czmImageryWrapper}get objResetting(){return this._objResetting}}class ML extends a.Destroyable{constructor(e,n){super();m(this,"_czmImageryLayerWrapperObjResetting");this._imagery=e,this._manager=n,this._czmImageryLayerWrapperObjResetting=this.dv(new a.ObjResettingWithEvent(this.imagery.layerChanged,()=>{if(this.imagery.layer)return new TL(this)}))}get imagery(){return this._imagery}get manager(){return this._manager}get czmImageryLayerWrapperObjResetting(){return this._czmImageryLayerWrapperObjResetting}}class UC extends a.Destroyable{constructor(e){super();m(this,"_czmImageryWrappers",new Set);m(this,"_czmImageryLayersManager");this._viewer=e,this._czmImageryLayersManager=this.dv(new xL(this.viewer))}get czmImageryWrappers(){return this._czmImageryWrappers}get czmImageriesManager(){return this._czmImageryLayersManager}get viewer(){return this._viewer}add(e){for(let n of this.czmImageryWrappers)if(n.imagery===e){console.warn("imageriesManager add error: has already added!",e);return}this.czmImageryWrappers.add(new ML(e,this))}has(e){for(let n of this.czmImageryWrappers)if(n.imagery===e)return!0;return!1}delete(e){for(const n of this.czmImageryWrappers)if(n.imagery===e){this.czmImageryWrappers.delete(n);return}console.warn("imageriesManager delete error!",e)}}class WC extends a.Destroyable{constructor(e){super();m(this,"_pause",this.disposeVar(a.react(!1)));m(this,"_pickPositionTasks",[]);m(this,"_pickTasks",[]);m(this,"pickHeightMustGreaterThanZero",!0);m(this,"objectsToExclude",[]);const n=e.viewer;{this.dispose(()=>{this._pickPositionTasks.length>0&&(this._pickPositionTasks.forEach(l=>l[3]("CzmViewer销毁,任务不再执行!")),this._pickPositionTasks.length=0),this._pickTasks.length>0&&(this._pickTasks.forEach(l=>l[4]("CzmViewer销毁,任务不再执行!")),this._pickTasks.length=0)});const o=()=>{const l=[...this._pickPositionTasks];this._pickPositionTasks.length=0;for(let u of l){const[d,p,f,g]=u;try{(async()=>{const{scene:v,camera:y}=n,w=Pe(d),P=y.getPickRay(w);if(P){let A;if(p?A=await v.pickFromRayMostDetailed(P,this.objectsToExclude):A=v.pickFromRay(P,this.objectsToExclude),A&&A.position){const R=se(A.position);return R?f(R):g(new Error("positionFromCartesian failed"))}if(!(v.terrainProvider instanceof h.EllipsoidTerrainProvider)){const R=v.globe.pick(P,v);if(!R)return g(new Error("scene.globe.pick failed"));const L=se(R);return L?(this.pickHeightMustGreaterThanZero&&L[2]<0&&(L[2]=0),f(L)):g(new Error("positionFromCartesian failed"))}}const C=v.terrainProvider instanceof h.EllipsoidTerrainProvider?v.terrainProvider.tilingScheme.ellipsoid:n.scene.globe.ellipsoid,S=n.camera.pickEllipsoid(Pe(d),C);if(!S)return g(new Error("Pick failed"));const x=se(S);return x?f(x):g(new Error("positionFromCartesian failed"))})()}catch(v){g(v)}}const c=[...this._pickTasks];this._pickTasks.length=0;for(let u of c){const[d,p,f,g,v]=u;e.pickCustomAttachedInfo=f;try{(async()=>{var A,R,L,B;let y=n.scene.pick(Pe(d),p&&p[0],p&&p[1]);!y&&h.defined(n.scene.globe)&&(y=await IL(n,Pe(d)));let w;if(y&&y instanceof h.Cesium3DTileFeature){w={};try{y&&y.getPropertyIds().forEach(G=>{w&&(w[G]=y.getProperty(G))})}catch(V){console.warn(V)}}if(!y){const{left:V,top:G}=e.container.getBoundingClientRect();y=(A=document.elementFromPoint(d[0]+V,d[1]+G))==null?void 0:A.closest("[data-es-scene-object-id]")}let P;y&&(y.id&&y.id instanceof h.Entity&&y.id.ESSceneObjectID?P=y.id.ESSceneObjectID:y.collection&&y.collection.ESSceneObjectID?P=y.collection.ESSceneObjectID:y.primitive&&y.primitive.ESSceneObjectID?P=y.primitive.ESSceneObjectID:Array.isArray(y)&&y[0]instanceof h.ImageryLayerFeatureInfo?P=y[0].imageryLayer.ESSceneObjectID:y instanceof HTMLElement&&(P=y.dataset.esSceneObjectId));let C=P?a.ESSceneObject.getSceneObject(P):void 0;C&&C.parentID&&(C=a.ESSceneObject.getSceneObject(C.parentID));let S={};if(C&&Reflect.has(C,"allowPicking")&&Reflect.has(C,"pickedEvent")&&(C.allowPicking??!1)){if(C instanceof a.ESEntityCluster){const V=new h.JulianDate;S=y.id instanceof h.Entity?{name:y.id.label.text.getValue(V),properties:(R=y.id.properties)==null?void 0:R.getValue(V),coordinates:vr(y.id.position.getValue(V))}:(L=y.id)==null?void 0:L.map(G=>{var O;return{name:G.id,properties:(O=G.properties)==null?void 0:O.getValue(V),coordinates:vr(G.position.getValue(V))}})}else if(C instanceof a.ESGeoJson){const V=new h.JulianDate;if(!y.id.entityCollection)return;const G=y.id.polygon?"Polygon":y.id.polyline?"LineString":"Point",O=((B=y.id.properties)==null?void 0:B.getValue(V))??{},N=G=="Point"?se(y.id.position.getValue(V)):G=="LineString"?y.id.polyline.positions.getValue(V).map(_=>se(_)):gu(y.id.polygon.hierarchy.getValue(V));S=C.pickedInfoType=="FeatureCollection"||C.pickedInfoType=="Feature"?{type:"Feature",geometry:{type:G,coordinates:N},properties:O}:{type:G,coordinates:N,properties:O}}else if(C instanceof a.ESGltfModel){let V;Reflect.has(y,"featureId")?V=y.featureId:Reflect.has(y,"instanceId")&&(V=y.instanceId),V&&(y.id=y.primitive.structuralMetadata.getPropertyTable(0).getProperty(y.instanceId,"id"))}C.pickedEvent.emit(new a.ESJPickedResult(y,C,w,S,f,d))}C&&Reflect.has(C,"allowPicking")&&!C.allowPicking&&g(new a.ESJPickedResult);const x=new a.ESJPickedResult(y,C,w,S,f,d);g(x)})()}catch(y){v(y)}}};let s=n.scene.postRender.addEventListener(o);const r=()=>{s&&s(),s=void 0};this.ad(r),this.ad(this.pauseChanged.don(l=>{l?r():s=n.scene.postRender.addEventListener(o)}))}}get pause(){return this._pause.value}set pause(e){this._pause.value=e}get pauseChanged(){return this._pause.changed}pickPosition(e){return new Promise((n,o)=>{this._pickPositionTasks.push([e,!0,n,o])})}quickPickPosition(e){return new Promise((n,o)=>{this._pickPositionTasks.push([e,!1,n,o])})}pick(e,n,o){return new Promise((s,r)=>{this._pickTasks.push([e,n,o,s,r])})}}function IL(t,i){const e=t.scene,n=e.camera.getPickRay(i);if(!n)return;const o=e.imageryLayers.pickImageryLayerFeatures(n,e);if(h.defined(o))return o}class DL extends a.Destroyable{constructor(e){super();m(this,"_enabled",this.disposeVar(a.react(!1)));m(this,"_cursorPosition",a.react(void 0));m(this,"quickPickPosition",!0);let n=new a.Destroyable;const o=()=>{n&&(n.destroy(),n=void 0)};this.dispose(o);const s=()=>{if(o(),!this._enabled.value||!e)return;const r=et(e);if(!r)return;n=new a.Destroyable;const l=n.disposeVar(a.react(void 0)),c=n.disposeVar(a.createNextAnimateFrameEvent(l.changed));n.dispose(r.czmViewer.pointerMoveEvent.disposableOn(d=>{d.pointerEvent&&(l.value=a.getDomEventCurrentTargetPos(d.pointerEvent))}));const u=n.disposeVar(a.createProcessingFromAsyncFunc(async d=>{if(r.pickingManager&&l.value)if(this.quickPickPosition){const p=await d.promise(a.createCancelablePromise(r.pickingManager.quickPickPosition(l.value)));this._cursorPosition.value=p}else{const p=await d.promise(a.createCancelablePromise(r.pickingManager.pickPosition(l.value)));this._cursorPosition.value=p}}));n.dispose(c.disposableOn(()=>{u.restart()}))};s(),this.dispose(this._enabled.changed.disposableOn(s))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}function RL(t){const i=t.cloneNode(!0);i.style.position="absolute",i.style.top="0",i.style.zIndex="-1",document.body.appendChild(i);const e=i.getBoundingClientRect();return document.body.removeChild(i),{width:e.width,height:e.height}}const GC=["label","billboard","rectangle"];class FL extends a.Destroyable{constructor(e,n){super();m(this,"id",a.createGuid());m(this,"position",h.Cartesian3.ZERO);m(this,"label");m(this,"billboard");m(this,"rectangle");m(this,"zOrder");m(this,"labelRefCount",1);m(this,"billboardRefCount",1);m(this,"rectangleRefCount",1);m(this,"_showEvent",this.disposeVar(new a.Event));this.id=e,this.position=n,this.ad(this.showEvent.don(o=>{this.updateShow(o)}))}get showEvent(){return this._showEvent}show(e){this._showEvent.emit(e)}updateShow(e){this.label&&(this.label.show=e),this.billboard&&(this.billboard.show=e),this.rectangle&&(this.rectangle.show=e)}}class zL extends a.Destroyable{constructor(e){super();m(this,"objects",new Map);m(this,"screenManager");m(this,"czmViewer");m(this,"viewer");this.screenManager=e,this.czmViewer=e.czmViewer,this.viewer=e.viewer,this.ad(()=>{this.objects.clear()})}layerIsEffective(){return this.objects.size>0}addLabel(e,n,o){const s=this.makeScreenObjectId(e,o.index??a.createGuid()),r=Ie(o.position),l=this.getOrCreateObject(s,r);if(l.label)return l.labelRefCount++,s;const c=this.screenManager.labelCollection.add({...n,position:r,id:s,text:o.name});return c.ESSceneObjectID=e,l.label=c,l.zOrder=o.zOrder,s}addImage(e,n,o){const s=this.makeScreenObjectId(e,o.index??a.createGuid()),r=Ie(o.position),l=this.getOrCreateObject(s,r);if(l.billboard)return l.billboardRefCount++,s;const c=this.screenManager.billboardCollection.add({...n,position:r,id:s});return c.ESSceneObjectID=e,l.billboard=c,l.zOrder=o.zOrder,s}addRectangle(e,n,o,s){const r=this.makeScreenObjectId(e,o.index??a.createGuid()),l=Ie(o.position),c=this.getOrCreateObject(r,l);if(c.rectangle)return c.rectangleRefCount++,r;const u=this.screenManager.rectangleCollection.add({...RL(n.element),...n,id:r,position:l,callback:s});return s(!0),c.rectangle=u,c.zOrder=o.zOrder,r}update(e,n){const o=Array.isArray(e)?e:[e];for(const s of o){const r=this.objects.get(s);if(r)for(const l of GC){const c=Object.assign({},n[l],(n==null?void 0:n.all)??{});if(!c)continue;const u=r[l];if(u)for(const d in c)d!=="position"&&d!=="id"&&(u[d]=c[d])}}return!0}remove(e){const n=Array.isArray(e)?e:typeof e=="string"?[e]:e;if(Array.isArray(n)){for(const o of n){const s=this.objects.get(o);s&&(s.label&&(s.labelRefCount>1?s.labelRefCount--:(this.screenManager.labelCollection.remove(s.label),s.label=void 0)),s.billboard&&(s.billboardRefCount>1?s.billboardRefCount--:(this.screenManager.billboardCollection.remove(s.billboard),s.billboard=void 0)),s.rectangle&&(s.rectangleRefCount>1?s.rectangleRefCount--:(this.screenManager.rectangleCollection.remove(s.rectangle),s.rectangle=void 0)),this.tryDeleteEmpty(o))}return!0}else{for(const o of Object.keys(n)){const s=Array.isArray(n[o])?n[o]:[n[o]];for(const r of s){if(!r)continue;const l=this.objects.get(r);if(!l)continue;const c=l[o];c&&(this.screenManager.collectionMap[o].remove(c),l[o]=void 0),this.tryDeleteEmpty(r)}}return!0}}makeScreenObjectId(e,n){return`${e}_${n}`}getOrCreateObject(e,n){let o=this.objects.get(e);return o||(o=new FL(e,n),this.objects.set(e,o)),o}tryDeleteEmpty(e){const n=this.objects.get(e);n&&!n.label&&!n.billboard&&!n.rectangle&&this.objects.delete(e)}}function LL(t,i){const e=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER];for(const n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&GC.includes(n)){const o=i[n];if(!o)continue;const s=o.computeScreenSpacePosition(t.scene);let r=h[o instanceof h.Label?"Label":"Billboard"].getScreenSpaceBoundingBox(o,s),{x:l,y:c,width:u,height:d}=r;e[0]=Math.min(e[0],l),e[1]=Math.min(e[1],c),e[2]=Math.max(e[2],l+u),e[3]=Math.max(e[3],c+d)}return new h.Rectangle(...e)}class OL extends a.Destroyable{constructor(e){super();m(this,"rectangleCollisionCheck",new h.RectangleCollisionChecker);m(this,"screenManager");m(this,"enable",!1);m(this,"forceRebuildNext",!1);m(this,"avoidanceLayers",[]);m(this,"_processingQueue",[]);m(this,"_isProcessing",!1);m(this,"BATCH_SIZE",1e3);m(this,"_cache",new Map);m(this,"_lastCameraState",{});m(this,"CAMERA_MOVE_THRESHOLD",5e-4);this.screenManager=e,this.ad(()=>{this.rectangleCollisionCheck._tree.clear(),this._cache.clear(),this._processingQueue.length=0})}update(){if(this.avoidanceLayers.length==0)return;const e=this._shouldForceRebuild();this._buildProcessingQueue(e),this._isProcessing||(this._isProcessing=!0,requestAnimationFrame(()=>this._processBatch()))}setAvoidanceLayer(){for(let e=0;e<this.avoidanceLayers.length;e++){const n=this.screenManager.getLayer(this.avoidanceLayers[e]);n.layerIsEffective()&&n.objects.forEach((o,s)=>{o.show(!0)})}this.forceRebuildNext=!0}updateAvoidanceLayer(e,n){this.enable=(e==null?void 0:e.enabled)??!1,n?e!=null&&e.enabled?this.avoidanceLayers.includes(n)||this.avoidanceLayers.push(n):this.avoidanceLayers=this.avoidanceLayers.filter(o=>o!=n):e!=null&&e.enabled?this.avoidanceLayers=Array.from(this.screenManager.layers.keys()):(this.setAvoidanceLayer(),this.avoidanceLayers=[]),this.setAvoidanceLayer()}_shouldForceRebuild(){if(this.forceRebuildNext)return this.forceRebuildNext=!1,this._updateLastCameraState(),!0;const e=this.screenManager.viewer.camera,n=e.positionWC,o=e.directionWC,s=this._lastCameraState.position,r=this._lastCameraState.direction;if(!s||!r)return this._updateLastCameraState(),!0;const l=h.Cartesian3.distanceSquared(n,s),c=h.Cartesian3.distanceSquared(o,r);return l>this.CAMERA_MOVE_THRESHOLD||c>this.CAMERA_MOVE_THRESHOLD?(this._updateLastCameraState(),!0):!1}_updateLastCameraState(){const e=this.screenManager.viewer.camera;this._lastCameraState.position=h.Cartesian3.clone(e.positionWC),this._lastCameraState.direction=h.Cartesian3.clone(e.directionWC)}_buildProcessingQueue(e){e&&(this.rectangleCollisionCheck._tree.clear(),this._cache.clear()),this._processingQueue.length=0;for(let n=0;n<this.avoidanceLayers.length;n++){const o=this.screenManager.getLayer(this.avoidanceLayers[n]);o.layerIsEffective()&&o.objects.forEach((s,r)=>{this._processingQueue.push(s)})}this._processingQueue.sort((n,o)=>(o.zOrder||0)-(n.zOrder||0))}_processBatch(){performance.now();const e=this._processingQueue,n=this.BATCH_SIZE;let o=0;for(;e.length>0&&o<n;){const s=e.shift();this._updateSingleObject(s),o++}e.length>0?requestAnimationFrame(()=>this._processBatch()):this._isProcessing=!1}_updateSingleObject(e){try{if(!this.screenManager.czmViewer.isPointVisible(e.position)){e.show(!1),this._cache.has(e.id.toString())&&this._cache.delete(e.id.toString());return}const n=e.id.toString(),o=this._cache.get(n),s=h.Cartesian3.clone(e.position);let r;if(o&&h.Cartesian3.equalsEpsilon(o.worldPos,s,1e-6))r=o.rect,this.rectangleCollisionCheck.remove(n,r);else{if(r=LL(this.screenManager.viewer,e),isNaN(r.width)||isNaN(r.height)){e.show(!1),this._cache.has(e.id.toString())&&this._cache.delete(e.id.toString());return}this._cache.set(n,{rect:r,worldPos:s,lastFrame:Date.now()})}this.rectangleCollisionCheck.collides(r)?e.show(!1):(e.show(!0),this.rectangleCollisionCheck.insert(e.id.toString(),r))}catch(n){console.error("ScreenManager update object error",n)}}}class HC extends a.Destroyable{constructor(){super();m(this,"_collection",[]);this.ad(()=>this._collection=[])}get length(){return this._collection.length}add(e){return this._collection.push(e),e._index=this._collection.length,e}remove(e){this._collection[e._index]=void 0}}class $C extends a.Destroyable{constructor(e){super();m(this,"layers",new Map);m(this,"czmViewer");m(this,"viewer");m(this,"avoidanceManager");m(this,"labelCollection");m(this,"billboardCollection");m(this,"rectangleCollection",this.ad(new HC));m(this,"canvasCollection",this.ad(new HC));m(this,"collectionMap");m(this,"_refreshEvent",this.ad(new a.Event));this.czmViewer=e,this.viewer=e.viewer,this.avoidanceManager=this.ad(new OL(this)),this.labelCollection=new h.LabelCollection({scene:this.viewer.scene}),this.billboardCollection=new h.BillboardCollection({scene:this.viewer.scene}),this.viewer.scene.primitives.add(this.labelCollection),this.viewer.scene.primitives.add(this.billboardCollection),this.collectionMap={label:this.labelCollection,billboard:this.billboardCollection,rectangle:this.rectangleCollection},this.ad(a.createEventsCallFunc([this.czmViewer.cameraChanged,this.refreshEvent],()=>{this.avoidanceManager.update()},{immediate:!0})),this.ad(()=>{this.layers.forEach(n=>n.destroy()),this.layers.clear(),this.labelCollection.removeAll(),this.billboardCollection.removeAll(),this.viewer.scene.primitives.remove(this.labelCollection),this.viewer.scene.primitives.remove(this.billboardCollection)})}get refreshEvent(){return this._refreshEvent}refresh(){this._refreshEvent.emit()}getLayer(e){let n=this.layers.get(e);return n||(n=new zL(this),this.layers.set(e,n),this.avoidanceManager.enable&&this.avoidanceManager.updateAvoidanceLayer({enabled:!0})),n}addLabel(e,n,o,s){const l=this.getLayer(n).addLabel(e,o,s);return this.refresh(),{layer:n,id:e,screenObjectId:l}}addImage(e,n,o,s){const l=this.getLayer(n).addImage(e,o,s);return this.refresh(),{layer:n,id:e,screenObjectId:l}}addRectangle(e,n,o,s,r){const c=this.getLayer(n).addRectangle(e,o,s,r);return this.refresh(),{layer:n,id:e,screenObjectId:c}}update(e,n,o,s){const r=this.getLayer(e);return!o||o.length===0?!1:(r.update(o,s),this.refresh(),!0)}remove(e,n,o){const s=this.getLayer(e);if(!s.remove(o)){console.warn(`屏幕管理器,删除${n}下的内容失败!`);return}!s.layerIsEffective()&&!s.isDestroyed()&&(s.destroy(),this.layers.delete(e)),this.refresh()}setRules(e,n){Reflect.has(e,"avoidance")&&this.avoidanceManager.updateAvoidanceLayer(e.avoidance,n),this.refresh()}}function et(t){return a.getExtProp(t,"_viewerExtensions")}function Ag(t,i){a.setExtProp(t,"_viewerExtensions",i)}class qC extends a.Destroyable{constructor(e,n){super();m(this,"_imageriesManager");m(this,"_terrainManager");m(this,"_labelManager");m(this,"_pickingManager");m(this,"_poiContext");m(this,"_cursorPositionInfo");m(this,"_screenManager");this._viewer=e,this._czmViewer=n,this._imageriesManager=this.dv(new UC(this.viewer)),this._terrainManager=this.dv(new BC(this.viewer)),this._labelManager=this.dv(new VC(this.viewer)),this._poiContext=this.disposeVar(new Dm(this._viewer)),this._cursorPositionInfo=this.disposeVar(new DL(this._viewer)),this.ad(n.viewerChanged.don(()=>{this._pickingManager=this.dv(new WC(n)),this._screenManager=this.ad(new $C(n)),this.ad(a.createEventsCallFunc(this.czmViewer.textAvoidanceChanged,()=>{this.screenManager.setRules({avoidance:{enabled:this.czmViewer.textAvoidance}})},{immediate:!0}))}))}get viewer(){return this._viewer}get czmViewer(){return this._czmViewer}get imageriesManager(){return this._imageriesManager}get terrainManager(){return this._terrainManager}get labelManager(){return this._labelManager}get pickingManager(){return this._pickingManager}get poiContext(){return this._poiContext}get cursorPositionInfo(){return this._cursorPositionInfo}get screenManager(){return this._screenManager}}var XC=new h.Cartesian3,YC=new h.Cartesian3;function ZC(t,i,e){let n=h.Matrix4.clone(t.transform);t.lookAtTransform(h.Matrix4.IDENTITY);var o=t.positionCartographic.height,s=t.positionWC,r=h.Cartesian3.normalize(s,XC),l=h.Cartesian3.dot(t.direction,r);if(l>-.9&&l<.9)var c=h.Cartesian3.cross(t.direction,r,YC);else var c=h.Cartesian3.cross(t.up,r,YC);var u=c;if(e){var d=h.Cartesian3.cross(r,c,XC);u=d}var p=h.Cartesian3.magnitude(s);t.rotate(u,i/p);var f=t.positionCartographic,g=f.longitude,v=f.latitude;h.Cartesian3.fromRadians(g,v,o,void 0,t.position),t.lookAtTransform(n)}function QC(t,i){ZC(t,i,!1)}function kC(t,i){ZC(t,-i,!0)}class NL extends a.Destroyable{constructor(e){super();m(this,"_actions",{MoveForward:!1,MoveBackword:!1,MoveLeft:!1,MoveRight:!1});this._running=e;const{controller:n}=this,{viewer:o}=n.firstPersonController,{camera:s}=o;this.dispose(this.running.keyStatus.currentKeyIdsChanged.disposableOn(()=>{this._updateActions()})),this.dispose(this.controller.keyDownEvent.disposableOn(r=>{const{keyStatusMap:l}=this.running.keyboardCameraController;l[r.code]==="SpeedUp"?this.controller.speed=this.controller.speed*2:l[r.code]==="SpeedDown"&&(this.controller.speed=this.controller.speed*.5)})),this.dispose(this.controller.keyDownEvent.disposableOn(r=>{const{keyStatusMap:l}=this.running.keyboardCameraController;l[r.code]==="SwitchAlwaysWithCamera"&&(this.controller.alwaysWithCamera=!this.controller.alwaysWithCamera)}));{const{actions:r}=this;let l=Date.now();const c=()=>{const u=Date.now(),d=u-l;l=u;const p=this.controller.speed;r.WithCamera||this.controller.alwaysWithCamera?(r.MoveForward&&s.moveForward(d*p),r.MoveBackword&&s.moveBackward(d*p),r.MoveLeft&&s.moveLeft(d*p),r.MoveRight&&s.moveRight(d*p)):(r.MoveForward&&QC(s,d*p),r.MoveBackword&&QC(s,-d*p),r.MoveLeft&&kC(s,-d*p),r.MoveRight&&kC(s,d*p));{const{rotateSpeed:f}=this.controller,g=h.Math.toRadians(f*d);r.RotateRight?s.lookRight(g):r.RotateLeft?s.lookRight(-g):r.RotateUp?s.lookDown(-g):r.RotateDown&&s.lookDown(g)}};o.scene.preUpdate.addEventListener(c),this.dispose(()=>o.scene.preUpdate.removeEventListener(c))}}get running(){return this._running}get controller(){return this.running.keyboardCameraController}get actions(){return this._actions}_resetActions(){const e=Object.keys(this._actions);for(let n of e)this._actions[n]=!1}_updateActions(){const{running:e}=this,{keyStatus:n}=e,{actions:o}=this;this._resetActions();const{keyStatusMap:s}=this.running.keyboardCameraController;for(let r of n.currentKeyIds)o[s[r]]=!0}}class Hh extends a.Destroyable{constructor(e){super();m(this,"_currentKeyIds",new Set);m(this,"_currentKeyIdsChanged",this.dv(new a.Event));m(this,"_debug",this.dv(a.react(!1)));m(this,"_debugResetting",this.dv(new a.ObjResettingWithEvent(this.debugChanged,()=>{if(this.debug)return new class extends a.Destroyable{constructor(e){super();const n=()=>{console.log([...e.currentKeyIds].join(`
1995
+ `))};n(),this.d(e.currentKeyIdsChanged.don(n))}}(this)})));this._keyboardCameraControllerRunning=e;const{keyboardCameraController:n}=this._keyboardCameraControllerRunning;{const o=s=>{const r=Hh.getKeyId(s);this._currentKeyIds.has(r)||(this._currentKeyIds.add(r),this._currentKeyIdsChanged.emit())};this.d(n.keyDownEvent.don(o))}{const o=s=>{const r=Hh.getKeyId(s);this._currentKeyIds.has(r)&&(this._currentKeyIds.delete(r),this._currentKeyIdsChanged.emit())};this.d(n.keyUpEvent.don(o))}{const o=()=>{this._currentKeyIds.clear(),this._currentKeyIdsChanged.emit()};this.d(n.abortEvent.don(o))}}static getKeyId(e){return e.code}get currentKeyIds(){return this._currentKeyIds}get currentKeyIdsChanged(){return this._currentKeyIdsChanged}get debug(){return this._debug.value}set debug(e){this._debug.value=e}get debugChanged(){return this._debug.changed}}class BL extends a.Destroyable{constructor(e){super();m(this,"_keyStatus");m(this,"_cameraOp");this._keyboardCameraController=e,this._keyStatus=this.dv(new Hh(this)),this._cameraOp=this.dv(new NL(this))}get keyboardCameraController(){return this._keyboardCameraController}get keyStatus(){return this._keyStatus}get cameraOp(){return this._cameraOp}}const kh=class kh extends a.Destroyable{constructor(e){super();m(this,"_enabled",this.dv(a.react(!1)));m(this,"_keyStatusMap",this.dv(a.react(kh.defaultKeyStatusMap)));m(this,"_speed",this.dv(a.react(1)));m(this,"_rotateSpeed",this.dv(a.react(.01)));m(this,"_alwaysWithCamera",this.dv(a.react(!1)));m(this,"_keyDownEvent",this.dv(new a.Event));m(this,"_keyUpEvent",this.dv(new a.Event));m(this,"_abortEvent",this.dv(new a.Event));this._firstPersonController=e,this.dv(new a.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new BL(this)}))}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get keyStatusMap(){return this._keyStatusMap.value}set keyStatusMap(e){this._keyStatusMap.value=e}get keyStatusMapChanged(){return this._keyStatusMap.changed}get speed(){return this._speed.value}set speed(e){this._speed.value=e}get speedChanged(){return this._speed.changed}get rotateSpeed(){return this._rotateSpeed.value}set rotateSpeed(e){this._rotateSpeed.value=e}get rotateSpeedChanged(){return this._rotateSpeed.changed}get alwaysWithCamera(){return this._alwaysWithCamera.value}set alwaysWithCamera(e){this._alwaysWithCamera.value=e}get alwaysWithCameraChanged(){return this._alwaysWithCamera.changed}get keyDownEvent(){return this._keyDownEvent}keyDown(e){this._keyDownEvent.emit(e)}get keyUpEvent(){return this._keyUpEvent}keyUp(e){this._keyUpEvent.emit(e)}get abortEvent(){return this._abortEvent}abort(){this._abortEvent.emit()}};m(kh,"defaultKeyStatusMap",{ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"MoveLeft",ArrowRight:"MoveRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"});let $h=kh;function VL(t,i){t.lookRight(h.Math.toRadians(i.movementX)*.1),t.lookDown(h.Math.toRadians(i.movementY)*.1);const e=t.pitch,n=h.Math.clamp(e,-h.Math.PI_OVER_TWO,h.Math.PI_OVER_TWO);n!==e&&t.setView({destination:t.positionWC,orientation:{heading:t.heading,pitch:n,roll:t.roll}})}class UL extends a.Destroyable{constructor(i,e){super(),this._firstPersonController=i,this._mouseCameraController=e;const{canvas:n}=this._firstPersonController.viewer;{const o=s=>{const{camera:r}=this._firstPersonController.viewer.scene;VL(r,s)};n.addEventListener("pointermove",o),this.dispose(()=>n.removeEventListener("pointermove",o))}}}const Kh=class Kh extends a.Destroyable{constructor(e){super();m(this,"_mouseMoving",this.dv(new UL(this.firstPersonController,this.mouseCameraController)));this._mouseCameraController=e;const{viewer:n}=this.firstPersonController;this.mouseCameraController.enableViewerOriginInputs(!1),this.dispose(()=>this.mouseCameraController.enableViewerOriginInputs(!0)),Element.prototype.setPointerCapture=()=>{},this.dispose(()=>Element.prototype.setPointerCapture=Kh.origin_setPointerCapture);const o=n.canvas;o.requestPointerLock(),this.dispose(()=>document.exitPointerLock());{const s=()=>{document.pointerLockElement!==o&&(this.firstPersonController.mouseEnabled=!1)};document.addEventListener("pointerlockchange",s,!1),this.dispose(()=>document.removeEventListener("pointerlockchange",s,!1))}{const s=()=>{this.firstPersonController.mouseEnabled=!1,console.log("Error locking pointer")};document.addEventListener("pointerlockerror",s)}}get mouseCameraController(){return this._mouseCameraController}get firstPersonController(){return this.mouseCameraController.firstPersonController}get mouseMoving(){return this._mouseMoving}};m(Kh,"origin_setPointerCapture",Element.prototype.setPointerCapture);let Tg=Kh;class WL extends a.Destroyable{constructor(e){super();m(this,"_enabled",this.dv(a.react(!1)));m(this,"enableViewerOriginInputs",e=>{e?this.firstPersonController.czmViewer.incrementDisabledInputStack():this.firstPersonController.czmViewer.decrementDisabledInputStack()});m(this,"_mouseResetting",this.dv(new a.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new Tg(this)})));this._firstPersonController=e}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get mouseResetting(){return this._mouseResetting}}class GL extends a.Destroyable{constructor(e){super();m(this,"viewer");m(this,"_mouseCameraController",this.dv(new WL(this)));m(this,"_keyboardCameraController",this.dv(new $h(this)));if(this._viewer=e,!this._viewer.viewer)throw new Error("Cesium.Viewer不存在!");this.viewer=this._viewer.viewer}get czmViewer(){return this._viewer}get mouseCameraController(){return this._mouseCameraController}get mouseEnabled(){return this.mouseCameraController.enabled}set mouseEnabled(e){this.mouseCameraController.enabled=e}get mouseEnabledChanged(){return this.mouseCameraController.enabledChanged}get keyboardCameraController(){return this._keyboardCameraController}get keyboardEnabled(){return this.keyboardCameraController.enabled}set keyboardEnabled(e){this.keyboardCameraController.enabled=e}get keyboardEnabledChanged(){return this.keyboardCameraController.enabledChanged}}function KC(t){t.removeInputAction(h.ScreenSpaceEventType.LEFT_DOWN),t.removeInputAction(h.ScreenSpaceEventType.RIGHT_DOWN),t.removeInputAction(h.ScreenSpaceEventType.MIDDLE_DOWN),t.removeInputAction(h.ScreenSpaceEventType.MOUSE_MOVE),t.removeInputAction(h.ScreenSpaceEventType.LEFT_UP),t.removeInputAction(h.ScreenSpaceEventType.RIGHT_UP),t.removeInputAction(h.ScreenSpaceEventType.MIDDLE_UP)}function Mg(t,i,e,n=void 0){const s=t.camera,r=new h.Cartesian2;r.x=i.startPosition.x,r.y=0;const l=new h.Cartesian2;l.x=i.endPosition.x,l.y=0;let c=s.getPickRay(r,new h.Ray),u=s.getPickRay(l,new h.Ray),d=0,p,f;if(!c||!u)return;s.frustum instanceof h.OrthographicFrustum?(p=c.origin,f=u.origin,h.Cartesian3.add(s.direction,p,p),h.Cartesian3.add(s.direction,f,f),h.Cartesian3.subtract(p,s.position,p),h.Cartesian3.subtract(f,s.position,f),h.Cartesian3.normalize(p,p),h.Cartesian3.normalize(f,f)):(p=c.direction,f=u.direction);let g=h.Cartesian3.dot(p,f);g<1&&(d=Math.acos(g)),d=i.startPosition.x>i.endPosition.x?d:-d;const v=e._horizontalRotationAxis;if(h.defined(n)?s.look(n,-d):h.defined(v)?s.look(v,-d):s.lookLeft(d),r.x=0,r.y=i.startPosition.y,l.x=0,l.y=i.endPosition.y,c=s.getPickRay(r,new h.Ray),u=s.getPickRay(l,new h.Ray),d=0,!(!c||!u))if(s.frustum instanceof h.OrthographicFrustum?(p=c.origin,f=u.origin,h.Cartesian3.add(s.direction,p,p),h.Cartesian3.add(s.direction,f,f),h.Cartesian3.subtract(p,s.position,p),h.Cartesian3.subtract(f,s.position,f),h.Cartesian3.normalize(p,p),h.Cartesian3.normalize(f,f)):(p=c.direction,f=u.direction),g=h.Cartesian3.dot(p,f),g<1&&(d=Math.acos(g)),d=i.startPosition.y>i.endPosition.y?d:-d,n=n??v,h.defined(n)){const y=s.direction,w=h.Cartesian3.negate(n,new h.Cartesian3),P=h.Cartesian3.equalsEpsilon(y,n,h.Math.EPSILON2),C=h.Cartesian3.equalsEpsilon(y,w,h.Math.EPSILON2);if(!P&&!C){g=h.Cartesian3.dot(y,n);let S=h.Math.acosClamped(g);d>0&&d>S&&(d=S-h.Math.EPSILON4),g=h.Cartesian3.dot(y,w),S=h.Math.acosClamped(g),d<0&&-d>S&&(d=-S+h.Math.EPSILON4);const x=h.Cartesian3.cross(n,y,new h.Cartesian3);s.look(x,d)}else(P&&d<0||C&&d>0)&&s.look(s.right,-d)}else s.lookUp(d)}class HL extends a.Destroyable{constructor(i,e){super();const n=e.viewer;if(!n)throw new Error("viewer is undefined");let o=!0;this.d(i.positionChanged.don(()=>o=!0)),this.d(i.rotationChanged.don(()=>o=!0)),this.d(i.offsetHeightChanged.don(()=>o=!0)),this.d(i.viewDistanceChanged.don(()=>o=!0)),this.d(i.offsetRotationChanged.don(()=>o=!0)),this.d(i.relativeRotationChanged.don(()=>o=!0));const s=[0,0,0],r=[0,0,0];this.d(n.clock.onTick.addEventListener(()=>{if(!o)return;if(o=!1,!i.position){console.warn("相机控制器未能设置位置,无法启用!");return}if(i.viewDistance===void 0){console.warn("相机控制器未能设置视距,将自动设置视距!");const p=Ie(i.position),f=n.camera.positionWC,g=h.Cartesian3.distance(p,f);i.viewDistance=g}a.Vector.clone(i.position,r),i.offsetHeight&&(r[2]+=i.offsetHeight);const{rotation:l,offsetRotation:c=Bi.defaults.offsetRotation}=i,u=[...c];a.Vector.set(s,0,0,0),l&&(i.relativeRotation??Bi.defaults.relativeRotation)&&(a.Vector.add(l,s,s),u[0]+=90),a.Vector.add(u,s,s);const d={distance:i.viewDistance,heading:s[0],pitch:s[1],flyDuration:0,hDelta:0,pDelta:0};e.flyTo(d,r)})),e.incrementDisabledInputStack(),this.d(()=>{e.decrementDisabledInputStack()}),this.d(e.pointerMoveEvent.don(l=>{const c=l==null?void 0:l.pointerEvent;if(c&&i.enabledRotationInput&&(c.buttons===1||c.buttons===2)){const{movementX:u,movementY:d}=c;i.offsetRotation=a.Vector.add(i.offsetRotation??Bi.defaults.offsetRotation,[u*.2,d*-.2,0])}})),this.d(e.wheelEvent.don(l=>{if(!i.enabledScaleInput)return;const c=l.deltaY,d=Math.max(1,i.viewDistance)*(c*.001);i.viewDistance=i.viewDistance+d}))}}class Bi extends a.Destroyable{constructor(e){super();m(this,"_resetWithCameraEvent",this.dv(new a.Event));const n=e.viewer;if(!n)throw new Error("viewer is undefined");const o=this;let s;const r=()=>{s&&(s.destroy(),s=void 0)};this.d(r);const l=()=>{r(),o.enabled&&(s=new HL(o,e))};l(),this.d(o.enabledChanged.don(l)),this.d(o.resetWithCameraEvent.don(c=>{if(!e.actived)return;const u=Ko(n.camera);if(!u)return;const d=o.rotation;o.offsetRotation=[u[0]-(o.relativeRotation?d[0]:90),u[1]-(o.relativeRotation?d[1]:0),u[2]-(o.relativeRotation?d[2]:0)]}))}get resetWithCameraEvent(){return this._resetWithCameraEvent}resetWithCamera(e){this._resetWithCameraEvent.emit(e)}}m(Bi,"defaults",{position:[116.39,39.9,0],rotation:[0,0,0],offsetRotation:[0,-60,0],relativeRotation:!0}),(t=>{t.createDefaultProps=()=>({enabled:!1,showTarget:!1,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArrayWithUndefined(void 0),rotationEditing:!1,viewDistance:1e3,offsetHeight:0,offsetRotation:a.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,relativeRotation:!0})})(Bi||(Bi={})),a.extendClassProps(Bi.prototype,Bi.createDefaultProps);class pa extends a.Destroyable{constructor(e){super();m(this,"_geoCameraController");m(this,"_geoPolylinePath");this._geoCameraController=this.dv(new Bi(e)),this._geoPolylinePath=this.dv(new Ms(e)),this._geoPolylinePath.show=!1,this._geoPolylinePath.currentTime=0;const n=()=>{(this.usePathPosition??!0)&&(this._geoCameraController.position=this._geoPolylinePath.currentPosition),(this.usePathRotation??!0)&&(this._geoCameraController.rotation=this._geoPolylinePath.currentRotation)};n(),this.d(this._geoPolylinePath.currentPositionChanged.don(n)),this.d(this._geoPolylinePath.currentRotationChanged.don(n)),this.dispose(a.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dispose(a.bind([this._geoCameraController,"viewDistance"],[this,"viewDistance"])),this.dispose(a.bind([this._geoCameraController,"offsetHeight"],[this,"offsetHeight"])),this.dispose(a.bind([this._geoCameraController,"offsetRotation"],[this,"offsetRotation"])),this.dispose(a.track([this._geoCameraController,"enabledRotationInput"],[this,"enabledRotationInput"])),this.dispose(a.track([this._geoCameraController,"enabledScaleInput"],[this,"enabledScaleInput"])),this.dv(new a.ObjResettingWithEvent(this.lineModeChanged,()=>{if(this.lineMode!==void 0){if(this.lineMode==="auto")return new $L(this,e);if(this.lineMode==="manual")return new qL(this,e)}}))}get geoCameraController(){return this._geoCameraController}get polylinePath(){return this._geoPolylinePath}get position(){return this._geoCameraController.position}get positionChanged(){return this._geoCameraController.positionChanged}get rotation(){return this._geoCameraController.rotation}get roataionChanged(){return this._geoCameraController.rotationChanged}}(t=>{t.createDefaultProps=()=>({enabled:!1,usePathPosition:!0,usePathRotation:!0,viewDistance:1e3,offsetHeight:0,offsetRotation:a.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,lineMode:void 0})})(pa||(pa={})),a.extendClassProps(pa.prototype,pa.createDefaultProps);class $L extends a.Destroyable{constructor(i,e){if(super(),!e.viewer)throw new Error("viewer is undefined");i.offsetRotation=[-90,0,0]}}class qL extends a.Destroyable{constructor(i,e){if(super(),!e.viewer)throw new Error("viewer is undefined");const o=s=>{(s.key==="w"||s.key==="s")&&(i.polylinePath.playing=s.type==="keydown",i.polylinePath.speed=s.key==="w"||s.type==="keyup"?1:-1)};this.dispose(e.keyDownEvent.don(o)),this.dispose(e.keyUpEvent.don(o))}}class XL extends a.Destroyable{constructor(i,e){super();const n=e.positionPropertyName??"position",o=e.positionChangedPropertyName??n+"Changed",s=e.rotationPropertyName??"rotation",r=e.rotationChangedPropertyName??s+"Changed",l=(e.positionTracking??!0)&&Reflect.has(i,n)&&Reflect.has(i,o),c=(e.rotationTracking??!0)&&Reflect.has(i,s)&&Reflect.has(i,r);if(!(!l&&!c)){if(l){const u=()=>{e.geoCameraController.position=i[n]};u();const d=i[o];this.d(d.don(u))}if(c){const u=()=>{e.geoCameraController.rotation=i[s]};u();const d=i[o];this.d(d.don(u))}}}}class YL extends a.Destroyable{constructor(i,e){super();const n=this.dv(new a.ESSceneObjectWithId);n.id=i;const o=this.dv(a.createNextAnimateFrameEvent(e.enabledChanged,e.positionTrackingChanged,e.rotationTrackingChanged,e.positionPropertyNameChanged,e.positionChangedPropertyNameChanged,e.rotationPropertyNameChanged,e.rotationChangedPropertyNameChanged,n.sceneObjectChanged));this.disposeVar(new a.ObjResettingWithEvent(o,()=>{const{sceneObject:s}=n;if(!(!e.enabled||!s))return new XL(s,e)}))}}class fa extends a.Destroyable{constructor(e){super();m(this,"_geoCameraController");this._geoCameraController=this.dv(new Bi(e)),this.d(a.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dv(new a.ObjResettingWithEvent(this.sceneObjectIdChanged,()=>{if(this.sceneObjectId)return new YL(this.sceneObjectId,this)}))}get geoCameraController(){return this._geoCameraController}}(t=>{t.createDefaultProps=()=>({enabled:void 0,sceneObjectId:void 0,positionTracking:void 0,rotationTracking:void 0,positionPropertyName:void 0,positionChangedPropertyName:void 0,rotationPropertyName:void 0,rotationChangedPropertyName:void 0})})(fa||(fa={})),a.extendClassProps(fa.prototype,fa.createDefaultProps);class ZL extends a.Destroyable{constructor(e){super();m(this,"height",1e7);m(this,"cycle",60);m(this,"latitude",38*3.1415926/18);m(this,"_running",!1);m(this,"_sseh");m(this,"_eventDisposer");m(this,"leftDownCancel",!0);this._viewer=e,this._sseh=this.dv(new h.ScreenSpaceEventHandler(this._viewer.canvas)),this._sseh.setInputAction(()=>{this.leftDownCancel&&this.cancel()},h.ScreenSpaceEventType.LEFT_DOWN),this.d(()=>{this.cancel()})}get viewer(){return this._viewer}get sseh(){return this._sseh}start(){if(this._running)return;const e=this._viewer.camera,n=e.positionCartographic;e.flyTo({destination:h.Cartesian3.fromRadians(n.longitude,this.latitude,this.height),orientation:{heading:0,pitch:-.5*h.Math.PI,roll:0},complete:()=>{this._running=!0;var o=void 0;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((s,r)=>{if(!o){o=new Date().getTime();return}const l=(new Date().getTime()-o)/1e3,c=e.positionCartographic.longitude+l*h.Math.PI*2/this.cycle;e.setView({destination:h.Cartesian3.fromRadians(c,this.latitude,this.height),orientation:{heading:0,pitch:-.5*h.Math.PI,roll:0}}),o=new Date().getTime()})},duration:.5})}cancel(){this._running&&(this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1)}}class QL extends a.Destroyable{constructor(e){super();m(this,"_height",this.dv(a.react(1e7)));m(this,"_cycle",this.dv(a.react(60)));m(this,"_latitude",this.dv(a.react(38)));m(this,"_inner");this._czmViewer=e;const n=this._czmViewer.viewer;if(!n)throw new Error("未初始化viewer");this._inner=this.dv(new ZL(n)),this._inner.leftDownCancel=!1;{const o=()=>{this._inner.height=this.height,this._inner.cycle=this.cycle,this._inner.latitude=this.latitude*Math.PI/180};o(),this.d(this.heightChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.latitudeChanged.don(o))}}get height(){return this._height.value}set height(e){this._height.value=e}get heightChanged(){return this._height.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get latitude(){return this._latitude.value}set latitude(e){this._latitude.value=e}get latitudeChanged(){return this._latitude.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class kL extends a.Destroyable{constructor(e){super();m(this,"_position",this.dv(a.reactArrayWithUndefined(void 0)));m(this,"_distance",this.dv(a.react(5e4)));m(this,"_cycle",this.dv(a.react(60)));m(this,"_heading",this.dv(a.react(0)));m(this,"_pitch",this.dv(a.react(-30)));m(this,"_transform");m(this,"_headingRadius");m(this,"_pitchRadius");m(this,"_running",!1);m(this,"_sseh");m(this,"_eventDisposer");this._viewer=e;const n=this.viewer.scene,o=this.viewer.camera;this._sseh=this.dv(new h.ScreenSpaceEventHandler(this.viewer.canvas)),this.d(()=>{this.cancel()});{const s=()=>{let r;if(this.position==null){var l=o.getPickRay(new h.Cartesian2(n.canvas.width*.5,n.canvas.height*.5));if(!l)return;r=n.globe.pick(l,n)}else r=h.Cartesian3.fromDegrees(...this.position);r&&(this._transform=h.Transforms.eastNorthUpToFixedFrame(r),this.start())};s(),this.d(this.positionChanged.don(s))}{const s=()=>{this._headingRadius=h.Math.toRadians(this.heading)};s(),this.d(this.headingChanged.don(s))}{const s=()=>{this._pitchRadius=h.Math.toRadians(this.pitch)};s(),this.d(this.pitchChanged.don(s))}}get viewer(){return this._viewer}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get sseh(){return this._sseh}start(){if(this._running)return;const e=this.viewer.camera;e.lookAtTransform(this._transform);var n=this.distance*Math.sin(this._pitchRadius),o=this.distance*Math.cos(this._pitchRadius),s=new h.Cartesian3(0,n,o);e.flyTo({destination:h.Matrix4.multiplyByPoint(this._transform,s,new h.Cartesian3),orientation:{heading:this._headingRadius,pitch:this._pitchRadius,roll:0},endTransform:this._transform,complete:()=>{this._running=!0;let r;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((l,c)=>{if(!r){r=new Date().getTime();return}const u=(new Date().getTime()-r)/1e3;this._headingRadius+=u*h.Math.PI*2/this.cycle,e.lookAtTransform(this._transform,new h.HeadingPitchRange(this._headingRadius,this._pitchRadius,this.distance)),r=new Date().getTime()})},duration:.5,maximumHeight:e.positionCartographic.height})}cancel(){if(!this._running)return;this.viewer.camera.lookAtTransform(h.Matrix4.IDENTITY),this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1}}class KL extends a.Destroyable{constructor(e){super();m(this,"_position",this.dv(a.reactArrayWithUndefined(void 0)));m(this,"_distance",this.dv(a.react(5e4)));m(this,"_cycle",this.dv(a.react(60)));m(this,"_heading",this.dv(a.react(0)));m(this,"_pitch",this.dv(a.react(-30)));m(this,"_inner");this._czmViewer=e;const n=this._czmViewer.viewer;if(!n)throw new Error("viewer is undefined");this._inner=this.dv(new kL(n));{const o=()=>{this.inner.distance=this.distance,this.inner.cycle=this.cycle,this.inner.position=this.position,this.inner.heading=this.heading,this.inner.pitch=this.pitch};o(),this.d(this.distanceChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.positionChanged.don(o)),this.d(this.headingChanged.don(o)),this.d(this.pitchChanged.don(o))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class JL extends a.Destroyable{constructor(e){super();m(this,"_firstPersonController");m(this,"_rotateGlobe");m(this,"_rotatePoint");m(this,"_followController");m(this,"_pathCameraController");m(this,"_handler");this._viewer=e;{this._firstPersonController=this.dv(new GL(e)),this.d(this._viewer.keyDownEvent.don(n=>this._firstPersonController.keyboardCameraController.keyDown(n))),this.d(this._viewer.keyUpEvent.don(n=>this._firstPersonController.keyboardCameraController.keyUp(n)));{const{subContainer:n}=this._viewer;if(!n)throw new Error("_firstPersonControllerInit error!");const o=()=>this._firstPersonController.keyboardCameraController.abort();n.addEventListener("blur",o,!1),this.d(()=>n.removeEventListener("blur",o,!1))}this._firstPersonController.keyboardEnabled=!1,this._firstPersonController.mouseEnabled=!1,this._firstPersonController.keyboardCameraController.speed=.006,this._firstPersonController.keyboardCameraController.rotateSpeed=.05,this._firstPersonController.keyboardCameraController.alwaysWithCamera=!1,this._firstPersonController.keyboardCameraController.keyStatusMap=$h.defaultKeyStatusMap,this.d(this._firstPersonController.keyboardEnabledChanged.don(()=>{var n;(n=this._viewer.subContainer)==null||n.focus()}))}this._rotateGlobe=this.dv(new QL(e)),this._rotatePoint=this.dv(new KL(e)),this._followController=this.dv(new fa(e)),this._pathCameraController=this.dv(new pa(e))}get firstPersonController(){return this._firstPersonController}get rotateGlobe(){return this._rotateGlobe}get rotatePoint(){return this._rotatePoint}get followController(){return this._followController}get pathCameraController(){return this._pathCameraController}resetNavigation(){this._firstPersonController.keyboardEnabled=!1,this._rotateGlobe.cancel(),this._rotatePoint.cancel(),this._followController.enabled=!1,this._followController.sceneObjectId=void 0,this._followController.geoCameraController.offsetRotation=[-90,0,0],this._followController.geoCameraController.viewDistance=0,this._pathCameraController.enabled=!1,this._pathCameraController.polylinePath.playing=!1,this._pathCameraController.polylinePath.currentTime=0,this._pathCameraController.polylinePath.loop=!1,this._pathCameraController.geoCameraController.offsetHeight=0,this._pathCameraController.polylinePath.positions=void 0,this._pathCameraController.lineMode=void 0}changeToMap(){this.resetNavigation(),this._changedMouseEvent("Map")}changeToWalk(e,n=4.2,o=1.6){this.resetNavigation();const s=this._viewer.navigationMode!="Walk";this._changedMouseEvent("Walk");const r=this._viewer.getCameraInfo(),l=[(r==null?void 0:r.rotation[0])??0,0,0];this._viewer.getHeightByLonLat(e[0],e[1]).then(c=>{s?this._viewer.flyIn([e[0],e[1],(c??0)+o],l):this._viewer.viewer&&(this._viewer.viewer.camera.position=h.Cartesian3.fromDegrees(e[0],e[1],(c??0)+o)),this.firstPersonController.keyboardEnabled=!0,this.firstPersonController.keyboardCameraController.speed=.006,this.firstPersonController.keyboardCameraController.rotateSpeed=.05,this.firstPersonController.keyboardCameraController.keyStatusMap={ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"RotateLeft",ArrowRight:"RotateRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"}})}changeToRotateGlobe(e=38,n=1e7,o=60){this.resetNavigation(),this._changedMouseEvent("RotateGlobe"),this._rotateGlobe.latitude=e,this._rotateGlobe.height=n,this._rotateGlobe.cycle=o,this._rotateGlobe.start()}changeToRotatePoint(e,n=5e4,o=60,s=0,r=-30){this.resetNavigation(),this._changedMouseEvent("RotatePoint"),this._rotatePoint.position=e,this._rotatePoint.distance=n,this._rotatePoint.cycle=o,this._rotatePoint.heading=s,this._rotatePoint.pitch=r,this._rotatePoint.start()}changeToFollow(e,n=0,o=0,s=-30,r=!0){this.resetNavigation(),this._changedMouseEvent("Follow"),this._followController.sceneObjectId=e,this._followController.geoCameraController.offsetRotation=[o,s,0],this._followController.geoCameraController.relativeRotation=r,n!==0?this._followController.geoCameraController.viewDistance=n:this._followController.geoCameraController.viewDistance=1e3,this._followController.enabled=!0}changeToLine(e,n=10,o=10,s=!0,r=10,l="auto"){this.resetNavigation(),this._changedMouseEvent("Line");const c=l==="auto",u=a.ESSceneObject.getSceneObjById(e);if(!u)return;const{points:d}=u;if(!d)return;const p=a.getDistancesFromPositions(d,"NONE"),f=p[p.length-1];this._pathCameraController.viewDistance=0,this._pathCameraController.polylinePath.positions=[...d],this._pathCameraController.polylinePath.duration=f/n*1e3,this._pathCameraController.polylinePath.loop=s,this._pathCameraController.offsetHeight=o;const g=um(d);this._pathCameraController.polylinePath.rotationRadius=!c||g==!1?[0]:g.map(v=>v/r*n),this._pathCameraController.enabledRotationInput=!c,this._pathCameraController.enabledScaleInput=!1,this._pathCameraController.polylinePath.playing=c,this._pathCameraController.lineMode=l,this._pathCameraController.enabled=!0}_changedMouseEvent(e){const n=this._viewer.viewer;if(!n)return;this._handler||(this._handler=new h.ScreenSpaceEventHandler(n.scene.canvas));const o=this._handler,s=n.scene.screenSpaceCameraController;this.d(()=>{o&&KC(o)}),e=="Walk"||e=="RotateGlobe"?(s.lookEventTypes=void 0,s.rotateEventTypes=void 0,s.tiltEventTypes=void 0,s.zoomEventTypes=void 0,s.translateEventTypes=void 0,o&&e=="Walk"&&(o.setInputAction(r=>{o.setInputAction(l=>{Mg(n.scene,l,s)},h.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(l=>{o.removeInputAction(h.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(h.ScreenSpaceEventType.LEFT_UP)},h.ScreenSpaceEventType.LEFT_UP)},h.ScreenSpaceEventType.LEFT_DOWN),o.setInputAction(r=>{o.setInputAction(l=>{Mg(n.scene,l,s)},h.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(l=>{o.removeInputAction(h.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(h.ScreenSpaceEventType.RIGHT_UP)},h.ScreenSpaceEventType.RIGHT_UP)},h.ScreenSpaceEventType.RIGHT_DOWN),o.setInputAction(r=>{o.setInputAction(l=>{Mg(n.scene,l,s)},h.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(l=>{o.removeInputAction(h.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(h.ScreenSpaceEventType.MIDDLE_UP)},h.ScreenSpaceEventType.MIDDLE_UP)},h.ScreenSpaceEventType.MIDDLE_DOWN))):(o&&KC(o),s.lookEventTypes=h.CameraEventType.RIGHT_DRAG,s.rotateEventTypes=h.CameraEventType.LEFT_DRAG,s.tiltEventTypes=[h.CameraEventType.MIDDLE_DRAG,h.CameraEventType.PINCH,{eventType:h.CameraEventType.LEFT_DRAG,modifier:h.KeyboardEventModifier.CTRL},{eventType:h.CameraEventType.RIGHT_DRAG,modifier:h.KeyboardEventModifier.CTRL}],s.translateEventTypes=h.CameraEventType.LEFT_DRAG,s.zoomEventTypes=[h.CameraEventType.WHEEL,h.CameraEventType.PINCH,{eventType:h.CameraEventType.RIGHT_DRAG,modifier:h.KeyboardEventModifier.SHIFT}])}}const jL=[{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3558367297943,39.93163726456884,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30223283037274,39.92688664316035,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.43707387584969,39.922782714050356,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.27929428317248,39.895318074706246,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36181901056395,39.89720944386167,3553.618347252562]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.40050587550184,39.87565113086582,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.31629153797958,39.88888615917464,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.38662084727662,39.93026695192356,5222.983612030221]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.35985958294472,39.879559968940974,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30061281533665,39.86521469244785,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.33589491695909,39.85251691437225,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3978491755026,39.92191230041099,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.404556165088,39.901554635269065,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3371677114933,39.90666589456628,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30329238580244,39.90598342431921,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.25047545555285,39.927295935589235,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33129680063607,39.98205319015022,5500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.38241622722414,39.864780790627634,5800]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.24126681456984,39.85629130246847,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.4476299820832,39.9015287845667,5233.181711832771]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33116617802452,39.824241891065384,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.15206905891218,39.90872966468676,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.24197212869294,39.88630968655299,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.43381133281572,39.96058832885812,5700]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.21635435523064,39.966450178376924,7e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.17908072725879,39.87211951629164,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.32516866705241,39.94534681561764,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36086721251684,39.948381883306446,3400]}];class e4 extends a.Destroyable{constructor(e){super();m(this,"_show",this.dv(a.react(!1)));m(this,"cloudsPostProcess");const n=e.viewer;if(!n)throw new Error("Cesium Viewer is not initialized");const o=new h.CloudCollection;n.scene.primitives.add(o),this.dispose(()=>n.scene.primitives.remove(o));{const s=()=>{o.show=this.show};s(),this.dispose(this.showChanged.disposableOn(s))}{const s=l=>({slice:l.slice,brightness:l.brightness,scale:Pe(l.scale),maximumSize:hi(l.maximumSize),color:te(l.color),position:Ie(l.position)});(()=>{o.removeAll();for(let l of jL)o.add(s(l))})()}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}class ga extends a.Destroyable{constructor(i){super();const e=i.viewer;if(!e){console.warn("viewer is undefined!");return}const n=e.scene.postProcessStages.add(h.PostProcessStageLibrary.createDepthOfFieldStage());this.d(()=>e.scene.postProcessStages.remove(n));{const o=()=>{n.enabled=this.show};o(),this.d(this.showChanged.don(o))}{const o=()=>{n.uniforms.fogByDistance=this.focalDistance};o(),this.d(this.focalDistanceChanged.don(o))}{const o=()=>{n.uniforms.delta=this.delta};o(),this.d(this.deltaChanged.don(o))}{const o=()=>{n.uniforms.sigma=this.sigma};o(),this.d(this.sigmaChanged.don(o))}{const o=()=>{n.uniforms.stepSize=this.stepSize};o(),this.d(this.stepSizeChanged.don(o))}}}(t=>{t.createDefaultProps=()=>({show:!1,focalDistance:87,delta:1,sigma:3.78,stepSize:2.46})})(ga||(ga={})),a.extendClassProps(ga.prototype,ga.createDefaultProps);const t4=`
1996
1996
  float getDistance(sampler2D depthTexture, vec2 texCoords)
1997
1997
  {
1998
1998
  float depth = czm_unpackDepth(texture(depthTexture, texCoords));
@@ -2028,7 +2028,7 @@ return material;
2028
2028
  vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount);
2029
2029
  out_FragColor = alphaBlend(finalFogColor, sceneColor);
2030
2030
  }
2031
- `;class t4 extends a.Destroyable{constructor(e){super();m(this,"_show",this.dv(a.react(!1)));m(this,"postProcess");const n=e.viewer;if(!n){console.warn("viewer is undefined!");return}const o=()=>{this.postProcess&&(n.scene.postProcessStages.remove(this.postProcess),this.postProcess=void 0)};this.d(o);const s=()=>{o(),(this.show??!0)&&(this.postProcess||(this.postProcess=new h.PostProcessStage({name:"earthsdk3_fog",fragmentShader:e4,uniforms:{fogByDistance:new h.Cartesian4(10,0,1e3,.9),fogColor:h.Color.WHITE}}),n.scene.postProcessStages.add(this.postProcess)))};s(),this.d(this.showChanged.don(s))}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}const i4=`
2031
+ `;class i4 extends a.Destroyable{constructor(e){super();m(this,"_show",this.dv(a.react(!1)));m(this,"postProcess");const n=e.viewer;if(!n){console.warn("viewer is undefined!");return}const o=()=>{this.postProcess&&(n.scene.postProcessStages.remove(this.postProcess),this.postProcess=void 0)};this.d(o);const s=()=>{o(),(this.show??!0)&&(this.postProcess||(this.postProcess=new h.PostProcessStage({name:"earthsdk3_fog",fragmentShader:t4,uniforms:{fogByDistance:new h.Cartesian4(10,0,1e3,.9),fogColor:h.Color.WHITE}}),n.scene.postProcessStages.add(this.postProcess)))};s(),this.d(this.showChanged.don(s))}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}const n4=`
2032
2032
  uniform sampler2D colorTexture;
2033
2033
  in vec2 v_textureCoordinates;
2034
2034
 
@@ -2055,7 +2055,7 @@ void main(void){
2055
2055
 
2056
2056
  out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(c,1), 0.5);
2057
2057
  }
2058
- `;class n4 extends a.Destroyable{constructor(e){super();m(this,"_show",this.dv(a.react(!1)));m(this,"rainPostProcess");const n=e.viewer;if(!n){console.warn("viewer is undefined!");return}const o=()=>{this.rainPostProcess&&(n.scene.postProcessStages.remove(this.rainPostProcess),this.rainPostProcess=void 0)};this.d(o);const s=()=>{o(),(this.show??!0)&&(this.rainPostProcess||(this.rainPostProcess=new h.PostProcessStage({name:"earthsdk3_rain",fragmentShader:i4}),n.scene.postProcessStages.add(this.rainPostProcess)))};s(),this.d(this.showChanged.don(s))}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}const o4=`
2058
+ `;class o4 extends a.Destroyable{constructor(e){super();m(this,"_show",this.dv(a.react(!1)));m(this,"rainPostProcess");const n=e.viewer;if(!n){console.warn("viewer is undefined!");return}const o=()=>{this.rainPostProcess&&(n.scene.postProcessStages.remove(this.rainPostProcess),this.rainPostProcess=void 0)};this.d(o);const s=()=>{o(),(this.show??!0)&&(this.rainPostProcess||(this.rainPostProcess=new h.PostProcessStage({name:"earthsdk3_rain",fragmentShader:n4}),n.scene.postProcessStages.add(this.rainPostProcess)))};s(),this.d(this.showChanged.don(s))}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}const s4=`
2059
2059
  uniform sampler2D colorTexture; //输入的场景渲染照片
2060
2060
  in vec2 v_textureCoordinates;
2061
2061
 
@@ -2086,7 +2086,7 @@ void main(void){
2086
2086
  finalColor=(vec3(c)); //屏幕上雪的颜色
2087
2087
  out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(finalColor,1), 0.5); //将雪和三维场景融合
2088
2088
  }
2089
- `,s4=`
2089
+ `,r4=`
2090
2090
  #extension GL_OES_standard_derivatives : enable
2091
2091
  uniform sampler2D colorTexture;
2092
2092
  uniform sampler2D depthTexture;
@@ -2126,7 +2126,7 @@ void main() {
2126
2126
  }
2127
2127
  out_FragColor = mix(color, vec4(1.0), dotNumWC*alpha);
2128
2128
  }
2129
- `;class r4 extends a.Destroyable{constructor(e){super();m(this,"_show",this.dv(a.react(!1)));m(this,"_alpha",this.dv(a.react(0)));m(this,"snow");m(this,"snowCover");const n=e.viewer;if(!n){console.warn("viewer is undefined!");return}let{snow:o,snowCover:s}=this;const r=()=>{o&&(n.scene.postProcessStages.remove(o),o=void 0)};this.d(r);const l=()=>{s&&(n.scene.postProcessStages.remove(s),s=void 0)};this.d(l);const c=()=>{if(!s)return;const d=h.Math.clamp(this.alpha,0,1);s.uniforms.alpha=d};c(),this.d(this.alphaChanged.don(c));const u=()=>{r(),l(),(this.show??!0)&&(o=new h.PostProcessStage({name:"earthsdk3_snow",fragmentShader:o4}),n.scene.postProcessStages.add(o),s=new h.PostProcessStage({name:"earthsdk3_snowCover",fragmentShader:s4,uniforms:{alpha:this.alpha}}),n.scene.postProcessStages.add(s),c())};u(),this.d(this.showChanged.don(u))}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}get alpha(){return this._alpha.value}set alpha(e){this._alpha.value=e}get alphaChanged(){return this._alpha.changed}}class a4 extends a.Destroyable{constructor(e){super();m(this,"rain");m(this,"cloud");m(this,"snow");m(this,"fog");m(this,"depthOfField");const n=e.viewer;if(!n)throw new Error("Cesium.Viewer不存在!");const o=this.dv(new n4(e)),s=this.dv(new jL(e)),r=this.dv(new r4(e)),l=this.dv(new t4(e)),c=this.dv(new ga(e));this.rain=o,this.cloud=s,this.snow=r,this.fog=l,this.depthOfField=c;{const{scene:u}=n,d=()=>{u.sun&&(u.sun.show=e.sun??Re.defaults.sun),u.globe.enableLighting=e.sun??Re.defaults.sun,e.rain>0&&e.rain<=1?o.show=!0:o.show=!1,e.cloud>0&&e.cloud<=1?s.show=!0:s.show=!1,e.snow>0&&e.snow<=1?(r.show=!0,r.alpha=e.snow):r.show=!1,e.fog>0&&e.fog<=1?l.show=!0:l.show=!1,e.depthOfField>0&&e.depthOfField<=1?c.show=!0:c.show=!1};d();const p=this.dv(a.createNextAnimateFrameEvent(e.sunChanged,e.rainChanged,e.cloudChanged,e.snowChanged,e.fogChanged,e.depthOfFieldChanged,e.atmosphereChanged));this.d(p.don(d))}}}const Ig=h.BoundingRectangle,l4=h.Color,qn=h.defined,c4=h.destroyObject,JC=h.DeveloperError,h4=h.RenderState,u4=h.ShaderSource,d4=h._shadersViewportQuadFS,p4=h.BlendingState,jC=h.Material;function qh(t){this.show=!0;let i;qn(i)||(i=new Ig),this.rectangle=Ig.clone(i),qn(t)||(t=jC.fromType(jC.ColorType,{color:new l4(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}qh.prototype.update=function(t){if(this.show){if(!qn(this.material))throw new JC("this.material must be defined.");if(!qn(this.rectangle))throw new JC("this.rectangle must be defined.");this.rectangle.width=t.context.drawingBufferWidth,this.rectangle.height=t.context.drawingBufferHeight;var i=this._rs;(!qn(i)||!Ig.equals(i.viewport,this.rectangle))&&(this._rs=h4.fromCache({blending:p4.ALPHA_BLEND,viewport:this.rectangle}),this._overlayCommand&&(this._overlayCommand.renderState=this._rs));var e=t.passes;if(e.render){var n=t.context;if(this._material!==this.material||!qn(this._overlayCommand)){this._material=this.material,qn(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();var o=new u4({sources:[this._material.shaderSource,d4]});this._overlayCommand=n.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this})}this._material.update(n),this._overlayCommand.uniformMap=this._material._uniforms}return this._overlayCommand}},qh.prototype.isDestroyed=function(){return!1},qh.prototype.destroy=function(){return qn(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),c4(this)};function e_(t){const{positiveX:i,negativeX:e,positiveY:n,negativeY:o,positiveZ:s,negativeZ:r}=t;if(!i||!e||!n||!o||!s||!r){console.warn("sceneSkyBoxSources的信息不全,无法设置skybox!");return}return{positiveX:a.ESSceneObject.context.getStrFromEnv(i),negativeX:a.ESSceneObject.context.getStrFromEnv(e),positiveY:a.ESSceneObject.context.getStrFromEnv(n),negativeY:a.ESSceneObject.context.getStrFromEnv(o),positiveZ:a.ESSceneObject.context.getStrFromEnv(s),negativeZ:a.ESSceneObject.context.getStrFromEnv(r)}}const f4=`in vec3 v_outerPositionWC;
2129
+ `;class a4 extends a.Destroyable{constructor(e){super();m(this,"_show",this.dv(a.react(!1)));m(this,"_alpha",this.dv(a.react(0)));m(this,"snow");m(this,"snowCover");const n=e.viewer;if(!n){console.warn("viewer is undefined!");return}let{snow:o,snowCover:s}=this;const r=()=>{o&&(n.scene.postProcessStages.remove(o),o=void 0)};this.d(r);const l=()=>{s&&(n.scene.postProcessStages.remove(s),s=void 0)};this.d(l);const c=()=>{if(!s)return;const d=h.Math.clamp(this.alpha,0,1);s.uniforms.alpha=d};c(),this.d(this.alphaChanged.don(c));const u=()=>{r(),l(),(this.show??!0)&&(o=new h.PostProcessStage({name:"earthsdk3_snow",fragmentShader:s4}),n.scene.postProcessStages.add(o),s=new h.PostProcessStage({name:"earthsdk3_snowCover",fragmentShader:r4,uniforms:{alpha:this.alpha}}),n.scene.postProcessStages.add(s),c())};u(),this.d(this.showChanged.don(u))}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}get alpha(){return this._alpha.value}set alpha(e){this._alpha.value=e}get alphaChanged(){return this._alpha.changed}}class l4 extends a.Destroyable{constructor(e){super();m(this,"rain");m(this,"cloud");m(this,"snow");m(this,"fog");m(this,"depthOfField");const n=e.viewer;if(!n)throw new Error("Cesium.Viewer不存在!");const o=this.dv(new o4(e)),s=this.dv(new e4(e)),r=this.dv(new a4(e)),l=this.dv(new i4(e)),c=this.dv(new ga(e));this.rain=o,this.cloud=s,this.snow=r,this.fog=l,this.depthOfField=c;{const{scene:u}=n,d=()=>{u.sun&&(u.sun.show=e.sun??Re.defaults.sun),u.globe.enableLighting=e.sun??Re.defaults.sun,e.rain>0&&e.rain<=1?o.show=!0:o.show=!1,e.cloud>0&&e.cloud<=1?s.show=!0:s.show=!1,e.snow>0&&e.snow<=1?(r.show=!0,r.alpha=e.snow):r.show=!1,e.fog>0&&e.fog<=1?l.show=!0:l.show=!1,e.depthOfField>0&&e.depthOfField<=1?c.show=!0:c.show=!1};d();const p=this.dv(a.createNextAnimateFrameEvent(e.sunChanged,e.rainChanged,e.cloudChanged,e.snowChanged,e.fogChanged,e.depthOfFieldChanged,e.atmosphereChanged));this.d(p.don(d))}}}const Ig=h.BoundingRectangle,c4=h.Color,qn=h.defined,h4=h.destroyObject,JC=h.DeveloperError,u4=h.RenderState,d4=h.ShaderSource,p4=h._shadersViewportQuadFS,f4=h.BlendingState,jC=h.Material;function qh(t){this.show=!0;let i;qn(i)||(i=new Ig),this.rectangle=Ig.clone(i),qn(t)||(t=jC.fromType(jC.ColorType,{color:new c4(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}qh.prototype.update=function(t){if(this.show){if(!qn(this.material))throw new JC("this.material must be defined.");if(!qn(this.rectangle))throw new JC("this.rectangle must be defined.");this.rectangle.width=t.context.drawingBufferWidth,this.rectangle.height=t.context.drawingBufferHeight;var i=this._rs;(!qn(i)||!Ig.equals(i.viewport,this.rectangle))&&(this._rs=u4.fromCache({blending:f4.ALPHA_BLEND,viewport:this.rectangle}),this._overlayCommand&&(this._overlayCommand.renderState=this._rs));var e=t.passes;if(e.render){var n=t.context;if(this._material!==this.material||!qn(this._overlayCommand)){this._material=this.material,qn(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();var o=new d4({sources:[this._material.shaderSource,p4]});this._overlayCommand=n.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this})}this._material.update(n),this._overlayCommand.uniformMap=this._material._uniforms}return this._overlayCommand}},qh.prototype.isDestroyed=function(){return!1},qh.prototype.destroy=function(){return qn(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),h4(this)};function e_(t){const{positiveX:i,negativeX:e,positiveY:n,negativeY:o,positiveZ:s,negativeZ:r}=t;if(!i||!e||!n||!o||!s||!r){console.warn("sceneSkyBoxSources的信息不全,无法设置skybox!");return}return{positiveX:a.ESSceneObject.context.getStrFromEnv(i),negativeX:a.ESSceneObject.context.getStrFromEnv(e),positiveY:a.ESSceneObject.context.getStrFromEnv(n),negativeY:a.ESSceneObject.context.getStrFromEnv(o),positiveZ:a.ESSceneObject.context.getStrFromEnv(s),negativeZ:a.ESSceneObject.context.getStrFromEnv(r)}}const g4=`in vec3 v_outerPositionWC;
2130
2130
 
2131
2131
  uniform vec3 u_hsbShift;
2132
2132
 
@@ -2205,7 +2205,7 @@ void main (void)
2205
2205
  out_FragColor = color;
2206
2206
  // ------------------ skybox vtxf end -------------------
2207
2207
  }
2208
- `,Xn=h.Cartesian3,an=h.defined,g4=h.destroyObject,m4=h.Ellipsoid,t_=h.EllipsoidGeometry,v4=h.GeometryPipeline,rr=h.Math,ln=h.Matrix4,y4=h.VertexFormat,w4=h.BufferUsage,C4=h.DrawCommand,_4=h.RenderState,P4=h.ShaderProgram,i_=h.ShaderSource,b4=h.VertexArray,n_=h._shadersAtmosphereCommon,o_=h._shadersSkyAtmosphereCommon,S4=h._shadersSkyAtmosphereVS,E4=h.Axis,x4=h.BlendingState,A4=h.CullFace,s_=h.SceneMode,Xh=h.Transforms,T4=h.Matrix3,r_=h.DeveloperError,M4=h.loadCubeMap,I4=h.CubeMap;function ar(t,i){t=t??m4.WGS84,this.show=!0,this.sources=i,this.perFragmentAtmosphere=!1,this._ellipsoid=t;const e=1.025,n=Xn.multiplyByScalar(t.radii,e,new Xn);this._scaleMatrix=ln.fromScale(n),this._modelMatrix=new ln,this._command=new C4({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new Xn(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new Xn(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new Xn;const o=new Xn;o.x=t.maximumRadius*e,o.y=t.maximumRadius,o.z=0,this._radiiAndDynamicAtmosphereColor=o;const s=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return s._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return s._hueSaturationBrightness.x=s.hueShift,s._hueSaturationBrightness.y=s.saturationShift,s._hueSaturationBrightness.z=s.brightnessShift,s._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return s.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return s.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return s.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return s.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return s.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return s.atmosphereMieAnisotropy},u_rotateMatrix:function(){return s._scratchRoateMatrix=s._scratchRoateMatrix||new T4,ln.getMatrix3(s._eunMatrix||ln.IDENTITY,s._scratchRoateMatrix)},u_cubeMap:function(){return s._cubeMap}}}Object.defineProperties(ar.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),ar.prototype.setDynamicLighting=function(t){this._radiiAndDynamicAtmosphereColor.z=t};const Dg=new ln;ar.prototype.update=function(t,i){if(!this.show)return;const e=t.mode;if(e!==s_.SCENE3D&&e!==s_.MORPHING||!t.passes.render)return;if(this._sources!==this.sources){const v=t.context;var n=this;this._sources=this.sources;var o=this.sources;if(!an(o.positiveX)||!an(o.negativeX)||!an(o.positiveY)||!an(o.negativeY)||!an(o.positiveZ)||!an(o.negativeZ))throw new r_("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof o.positiveX!=typeof o.negativeX||typeof o.positiveX!=typeof o.positiveY||typeof o.positiveX!=typeof o.negativeY||typeof o.positiveX!=typeof o.positiveZ||typeof o.positiveX!=typeof o.negativeZ)throw new r_("this.sources properties must all be the same type.");typeof o.positiveX=="string"?M4(v,this._sources).then(function(y){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=y}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new I4({context:v,source:o}))}const s=ln.fromRotationTranslation(t.context.uniformState.inverseViewRotation,Xn.ZERO,Dg),r=ln.multiplyTransformation(s,E4.Y_UP_TO_Z_UP,Dg),l=ln.multiply(this._scaleMatrix,r,Dg);ln.clone(l,this._modelMatrix);const c=t.context,u=D4(this),d=t.globeTranslucencyState.translucent,p=this.perFragmentAtmosphere||d||!an(i)||!i.show,f=this._command;if(Xh.eastUpNorthToFixedFrame=Xh.eastUpNorthToFixedFrame||Xh.localFrameToFixedFrameGenerator("east","up"),this._eunMatrix=Xh.eastUpNorthToFixedFrame(t.camera._positionWC,void 0,this._eunMatrix),!an(f.vertexArray)){const v=t_.createGeometry(new t_({radii:new Xn(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:y4.POSITION_ONLY}));f.vertexArray=b4.fromGeometry({context:c,geometry:v,attributeLocations:v4.createAttributeLocations(v),bufferUsage:w4.STATIC_DRAW}),f.renderState=_4.fromCache({cull:{enabled:!0,face:A4.FRONT},blending:x4.ALPHA_BLEND,depthMask:!1})}const g=u|p<<2|d<<3;if(g!==this._flags){this._flags=g;const v=[];u&&v.push("COLOR_CORRECT"),p&&v.push("PER_FRAGMENT_ATMOSPHERE"),d&&v.push("GLOBE_TRANSLUCENT");const y=new i_({defines:v,sources:[n_,o_,S4]}),w=new i_({defines:v,sources:[n_,o_,f4]});this._spSkyAtmosphere=P4.fromCache({context:c,vertexShaderSource:y,fragmentShaderSource:w}),f.shaderProgram=this._spSkyAtmosphere}if(an(this._cubeMap))return f};function D4(t){return!(rr.equalsEpsilon(t.hueShift,0,rr.EPSILON7)&&rr.equalsEpsilon(t.saturationShift,0,rr.EPSILON7)&&rr.equalsEpsilon(t.brightnessShift,0,rr.EPSILON7))}ar.prototype.isDestroyed=function(){return!1},ar.prototype.destroy=function(){const t=this._command;return t.vertexArray=t.vertexArray&&t.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),g4(this)};const mr=class mr extends a.Destroyable{constructor(e,n){super();m(this,"_navigationManager");m(this,"_envManager");m(this,"_reu",(e,n)=>a.registerEventUpdate(this,e,n));this._czmViewer=e,this._viewer=n;const o=this.viewer,s=this.czmViewer,r=o.scene.screenSpaceCameraController;this._navigationManager=this.dv(new KL(s)),this._envManager=this.dv(new a4(s)),this.disposeVar(new a.ObjResettingWithEvent(this._czmViewer.xbsjUseBackgroundChanged,()=>{if(this._czmViewer.xbsjUseBackground)return new mr.BackGroundResetting(this._czmViewer,this._viewer)})),this.disposeVar(new a.ObjResettingWithEvent(this._czmViewer.xbsjLocalBoxSourcesChanged,()=>{if(!this._czmViewer.xbsjLocalBoxSources)return;const l=e_(this._czmViewer.xbsjLocalBoxSources);if(l)return new mr.LocalSkyBoxResetting(this._czmViewer,this._viewer,l)}));{this._reu(s.disabledInputStackChanged,()=>{const c=s.disabledInputStack===0;r.enableInputs=c,r.enableTranslate=c,r.enableZoom=c,r.enableRotate=c,r.enableTilt=c,r.enableLook=c});class l extends a.Destroyable{constructor(){super(),s.incrementDisabledInputStack(),this.dispose(()=>s.decrementDisabledInputStack())}}this.disposeVar(new a.ObjResettingWithEvent(s.sceneSsccEnableInputsChanged,()=>s.sceneSsccEnableInputs??!0?void 0:new l))}this.d(o.scene.camera.changed.addEventListener(()=>s.cameraChanged.emit()));{const l=()=>{const c=Re.latestDefaultAccessToken??Re.currentDefaultAccessToken;h.Ion.defaultAccessToken=s.ionAccessToken===""?c:s.ionAccessToken};l(),this.dispose(s.ionAccessTokenChanged.disposableOn(l))}{const{scene:l}=o,c=()=>{if(l.globe.show=s.globeShow??!0,"fov"in l.camera.frustum){const d=l.camera.frustum.aspectRatio;if(!d){console.error("aspectRatio is undefined,请检查Cesium的scene.camera.frustum");return}l.camera.frustum.fov=h.Math.toRadians(d>=1?s.fov:s.fov/d)}};c();const u=this.dv(a.createNextAnimateFrameEvent(s.globeShowChanged,s.fovChanged));this.d(u.don(c))}o.clockViewModel.currentTime=h.JulianDate.fromDate(new Date(s.currentTime)),this.dispose(s.currentTimeChanged.disposableOn(()=>{if(s.currentTime===void 0)return;const l=h.JulianDate.fromDate(new Date(s.currentTime));h.JulianDate.equals(l,o.clockViewModel.currentTime)||(o.clockViewModel.currentTime=l)})),this.dispose(Ci(o.clockViewModel,"currentTime",l=>{const c=h.JulianDate.toDate(o.clockViewModel.currentTime).getTime();c!==s.currentTime&&(s.currentTime=c)}));{let l=h.getTimestamp(),c=0;this.d(o.scene.preUpdate.addEventListener(()=>{var u=h.getTimestamp();c++;var d=u-l;d>1e3&&(s._fps.value=c*1e3/d|0,l=u,c=0)}))}{const l=new h.SunLight,c=new h.DirectionalLight({direction:o.scene.camera.directionWC});class u extends a.Destroyable{constructor(){super();const p=s.flashLighting??!1;o.scene.light=p?c:l,p&&this.dispose(o.scene.preRender.addEventListener(function(f,g){c.direction=h.Cartesian3.clone(f.camera.directionWC,f.light.direction)}))}}this.disposeVar(new a.ObjResettingWithEvent(s.flashLightingChanged,()=>new u))}{const{scene:l}=o,{screenSpaceCameraController:c,globe:u}=l,d=(v,y)=>a.registerEventUpdate(this,v,y),p=Re.defaults,f=(v,y)=>d(s[v+"Changed"],()=>{if(!Reflect.has(s,v))throw new Error(`!Reflect.has(czmViewer, ${v})`);if(!Reflect.has(p,v))throw new Error(`!Reflect.has(CzmViewer.defaults, ${v})`);y(s[v]??p[v])}),g=(v,y)=>d(s[v+"Changed"],()=>{if(!Reflect.has(s,v))throw new Error(`!Reflect.has(czmViewer, ${v})`);y(s[v])});f("splitPosition",v=>o.scene.splitPosition=v),f("resolutionScale",v=>o.resolutionScale=v),f("msaaSamples",v=>o.scene.msaaSamples=v),g("shadows",v=>o.shadows=v),f("scenePpsfxaaEnabled",v=>l.postProcessStages.fxaa.enabled=v),g("scenePpsAmbientOcclusionEnabled",v=>l.postProcessStages.ambientOcclusion.enabled=v),g("scenePpsAmbientOcclusionAmbientOcclusionOnly",v=>l.postProcessStages.ambientOcclusion.uniforms.ambientOcclusionOnly=v),g("scenePpsAmbientOcclusionIntensity",v=>l.postProcessStages.ambientOcclusion.uniforms.intensity=v),g("scenePpsAmbientOcclusionBias",v=>l.postProcessStages.ambientOcclusion.uniforms.bias=v),g("scenePpsAmbientOcclusionLengthCap",v=>l.postProcessStages.ambientOcclusion.uniforms.lengthCap=v),g("scenePpsAmbientOcclusionStepSize",v=>l.postProcessStages.ambientOcclusion.uniforms.stepSize=v),g("scenePpsAmbientOcclusionBlurStepSize",v=>l.postProcessStages.ambientOcclusion.uniforms.blurStepSize=v),g("scenePpsBloomEnabled",v=>l.postProcessStages.bloom.enabled=v),g("scenePpsBloomGlowOnly",v=>l.postProcessStages.bloom.uniforms.glowOnly=v),g("scenePpsBloomContrast",v=>l.postProcessStages.bloom.uniforms.contrast=v),g("scenePpsBloomBrightness",v=>l.postProcessStages.bloom.uniforms.brightness=v),g("scenePpsBloomDelta",v=>l.postProcessStages.bloom.uniforms.delta=v),g("scenePpsBloomSigma",v=>l.postProcessStages.bloom.uniforms.sigma=v),g("scenePpsBloomStepSize",v=>l.postProcessStages.bloom.uniforms.stepSize=v),f("globeShow",v=>l.globe.show=v),f("depthTestAgainstTerrain",v=>{l.globe.depthTestAgainstTerrain=v}),l.globe.translucency.enabled=!0,f("terrainOpacity",v=>{l.globe.translucency.frontFaceAlpha=l.globe.translucency.backFaceAlpha=a.clamp(v,0,1)}),f("sceneGlobeShadows",v=>l.globe.shadows=h.ShadowMode[v]),g("sceneGlobeTerrainExaggeration",v=>l.globe.terrainExaggeration=v),g("sceneGlobeTerrainExaggerationRelativeHeight",v=>l.globe.terrainExaggerationRelativeHeight=v),g("sceneGlobeVerticalExaggeration",v=>l.globe.verticalExaggeration=v),g("sceneGlobeVerticalExaggerationRelativeHeight",v=>l.globe.verticalExaggerationRelativeHeight=v),g("sceneGlobeBackFaceCulling",v=>l.globe.backFaceCulling=v),g("sceneGlobeShowSkirts",v=>l.globe.showSkirts=v),g("sceneGlobeShowWaterEffect",v=>l.globe.showWaterEffect=v),g("sceneGlobeBaseColor",v=>l.globe.baseColor=te(v)),g("sceneGlobeCartographicLimitRectangle",v=>l.globe.cartographicLimitRectangle=Ue(v)),g("sceneGlobeClippingPlanes",v=>{if(!l.globe.clippingPlanes){l.globe.clippingPlanes=wr(v??{enabled:!1});return}dc(l.globe.clippingPlanes,v)}),g("sceneGlobeClippingPolygons",v=>{l.globe.clippingPolygons=v?pc(v):void 0}),f("sceneSunGlowFactor",v=>l.sun&&(l.sun.glowFactor=v)),f("moon",v=>l.moon&&(l.moon.show=v)),f("sceneMoonOnlySunLighting",v=>l.moon&&(l.moon.onlySunLighting=v)),f("sceneMoonTextureUrl",v=>l.moon&&(l.moon.textureUrl=a.ESSceneObject.context.getStrFromEnv(v))),g("sceneSkyBoxShow",v=>l._xbsjOriginSkyBox.show=v),f("sceneSkyBoxSources",v=>l._xbsjOriginSkyBox.sources=v&&e_(v)),g("atmosphere",v=>o.scene._xbsjOriginSkyAtmosphere.show=v),g("sceneBackgroundColor",v=>o.scene.backgroundColor=te(v)),f("sceneFogEnabled",v=>l.fog.enabled=v),f("sceneFogDensity",v=>l.fog.density=v),f("sceneFogScreenSpaceErrorFactor",v=>l.fog.screenSpaceErrorFactor=v),f("sceneFogMinimumBrightness",v=>l.fog.minimumBrightness=v),f("sceneDebugShowFramesPerSecond",v=>l.debugShowFramesPerSecond=v),f("sceneDebugShowCommands",v=>l.debugShowCommands=v),f("sceneDebugShowFrustums",v=>l.debugShowFrustums=v),f("sceneDebugShowFrustumPlanes",v=>l.debugShowFrustumPlanes=v),f("sceneDebugShowDepthFrustum",v=>l.debugShowDepthFrustum=v),f("sceneGlobeUndergroundColor",v=>u.undergroundColor=te(v)),f("sceneGlobeUndergroundColorAlphaByDistance",v=>u.undergroundColorAlphaByDistance=dn(v)),f("sceneGlobeTranslucencyBackFaceAlphaByDistance",v=>u.translucency.backFaceAlphaByDistance=v&&dn(v)),g("sceneGlobeTranslucencyFrontFaceAlphaByDistance",v=>u.translucency.frontFaceAlphaByDistance=v&&dn(v)),f("sceneGlobeTranslucencyRectangle",v=>u.translucency.rectangle=Ue(v)),f("sceneSplitPosition",v=>l.splitPosition=a.clamp(v,0,1)),f("sceneSsccEnableCollisionDetection",v=>l.screenSpaceCameraController.enableCollisionDetection=v),f("sceneSsccZoomFactor",v=>l.screenSpaceCameraController._zoomFactor=v);{const v=()=>{o.cesiumInspector&&(o.cesiumInspector.container.style.display=s.showCesiumInspector??!1?"block":"none")};v(),this.d(s.showCesiumInspectorChanged.don(v))}f("cesiumInspectorWireframe",v=>{"cesiumInspector"in o&&(o.cesiumInspector.viewModel.wireframe=v)});{const v=()=>{o.cesium3DTilesInspector&&(o.cesium3DTilesInspector.container.style.display=s.showCesium3DTilesInspector??!1?"block":"none")};v(),this.dispose(s.showCesium3DTilesInspectorChanged.disposableOn(v))}this.ad(new a.ObjResettingWithEvent(s.particleGlobalControlChanged,()=>{if(!s.particleGlobalControl)return new Pg}))}}get czmViewer(){return this._czmViewer}get viewer(){return this._viewer}get navigationManager(){return this._navigationManager}get envManager(){return this._envManager}};m(mr,"BackGroundResetting",class extends a.Destroyable{constructor(n,o){super(),this._czmViewer=n,this._viewer=o;const s=new qh;s.material=h.Material.fromType("Image");const r=this._viewer;r.scene.skyBox=s,this.dispose(()=>r.scene.skyBox=r.scene._xbsjOriginSkyBox);{const l=()=>{s.show=this._czmViewer.sceneSkyBoxShow};l(),this.dispose(this._czmViewer.sceneSkyBoxShowChanged.disposableOn(l))}{const l=()=>{s.material.uniforms.color=te(this._czmViewer.xbsjBackgroundColor)};l(),this.dispose(this._czmViewer.xbsjBackgroundColorChanged.disposableOn(l))}{const l=()=>{s.material.uniforms.image=SceneObject.context.getStrFromEnv(this._czmViewer.xbsjBackgroundImageUri)};l(),this.dispose(this._czmViewer.xbsjBackgroundImageUriChanged.disposableOn(l))}}}),m(mr,"LocalSkyBoxResetting",class extends a.Destroyable{constructor(o,s,r){super();m(this,"_skyAtmosphere");this._czmViewer=o,this._viewer=s,this._sources=r,this._skyAtmosphere=new ar(void 0,this._sources);const l=this._viewer;l.scene.skyAtmosphere=this._skyAtmosphere,this.dispose(()=>l.scene.skyAtmosphere=l.scene._xbsjOriginSkyAtmosphere);{const c=()=>{this._skyAtmosphere.show=this._czmViewer.atmosphere};c(),this.dispose(this._czmViewer.atmosphereChanged.disposableOn(c))}}get skyAtmosphere(){return this._skyAtmosphere}});let Rg=mr;function R4(t,i,e,n,o){var s=h.Cartesian3.subtract(t,e,new h.Cartesian3),r=h.Cartesian3.dot(s,i);if(!(r<=0))return r*Math.tan(n*.5)*2/o}async function F4(t){const{viewer:i}=t;if(!i)return;const{width:e,height:n}=i.canvas,o=t.quickPickPosition([e*.5,n*.5]);if(!o)return;const s=await o;if(!s)return;const r=h.Cartesian3.fromDegrees(...s);if(!r)return;const l=i.camera.positionWC,c=i.camera.directionWC,u=i.camera.frustum.fovy;if(u===void 0)return;const d=i.canvas.height;return[R4(r,c,l,u,d),s]}const z4=h.Ellipsoid.WGS84.maximumRadius*2*Math.PI/512;function L4(t){return-Math.log2(t/z4)}var Fg=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];function O4(t){const i=t|0;if(i<1||i>1e8)return;let e=-1;for(;i>=Fg[++e];);const n=i/Fg[e-1]|0;return[n*Fg[e-1],n,e]}class N4 extends a.Destroyable{constructor(){super();m(this,"_lengthInPixels",this.disposeVar(a.react(100)));m(this,"_resolution",this.disposeVar(a.react(void 0)));m(this,"_computedLengthInPixels",this.disposeVar(a.react(void 0)));m(this,"_computedLengthInMeters",this.disposeVar(a.react(void 0)));m(this,"_computedLengthInStr",this.disposeVar(a.react(void 0)));{const e=()=>{let n,o;const{lengthInPixels:s,resolution:r}=this;if(s&&r){const l=O4(s*r);if(l){const[c,u,d]=l;o=c,n=c/r}}this._computedLengthInPixels.value=n,this._computedLengthInMeters.value=o};e(),this.dispose(this.lengthInPixelsChanged.disposableOn(e)),this.dispose(this.resolutionChanged.disposableOn(e))}{const e=()=>{const n=this.computedLengthInMeters;if(!n){this._computedLengthInStr.value=void 0;return}this._computedLengthInStr.value=n>1e3?`${n/1e3|0}km`:`${n}m`};e(),this.dispose(this.computedLengthInMetersChanged.disposableOn(e))}}get lengthInPixels(){return this._lengthInPixels.value}set lengthInPixels(e){this._lengthInPixels.value=e}get lengthInPixelsChanged(){return this._lengthInPixels.changed}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}get resolutionChanged(){return this._resolution.changed}get computedLengthInPixels(){return this._computedLengthInPixels.value}get computedLengthInPixelsChanged(){return this._computedLengthInPixels.changed}get computedLengthInMeters(){return this._computedLengthInMeters.value}get computedLengthInMetersChanged(){return this._computedLengthInMeters.changed}get computedLengthInStr(){return this._computedLengthInStr.value}get computedLengthInStrChanged(){return this._computedLengthInStr.changed}}class B4 extends a.Destroyable{constructor(e){super();m(this,"_enabled",this.dv(a.react(!0)));m(this,"_resolution",this.dv(a.react(void 0)));m(this,"_center",this.dv(a.react(void 0)));m(this,"_zoom",this.dv(a.react(void 0)));m(this,"_legend",this.dv(new N4));this._czmViewer=e;{const n=this.dv(a.createProcessingFromAsyncFunc(async o=>{let s,r,l;await o.promise(a.sleep(1e3));const c=await o.promise(F4(this._czmViewer));if(c){const[u,d]=c;s=u,r=L4(u),l=d}this._resolution.value=s,this._zoom.value=r,this._center.value=l}));n.restart();{const o=()=>{this.enabled?n.restart():n.cancel()};o();const s=this.dv(a.createNextAnimateFrameEvent(this._czmViewer.cameraChanged,this.enabledChanged));this.dispose(s.disposableOn(o))}}{const n=()=>{this._legend.resolution=this.resolution};n(),this.dispose(this.resolutionChanged.disposableOn(n))}}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}get resolutionChanged(){return this._resolution.changed}get center(){return this._center.value}get centerChanged(){return this._center.changed}get zoom(){return this._zoom.value}get zoomChanged(){return this._zoom.changed}get legend(){return this._legend}get length(){return(this.legend.computedLengthInMeters??-1)/(this.legend.computedLengthInPixels??1)}}function V4(t,i){try{const e=h.Ellipsoid.WGS84,n=e.scaleToGeodeticSurface(t);return i=h.Transforms.eastNorthUpToFixedFrame(n,e,i),i}catch{return h.Matrix4.clone(h.Matrix4.IDENTITY,i)}}const{combine:U4}=h,{ShaderDestination:Vo}=h,a_={name:"FlattenedPipelineStage"};a_.process=function(t,i,e){if(i.xbsjFlattened){const n=t.shaderBuilder;n.addDefine("XBSJ_FLATTERN",void 0,Vo.BOTH),n.addUniform("sampler2D","u_flattenedPolygonTexture",Vo.BOTH),n.addUniform("vec4","u_flattenedBound",Vo.BOTH),n.addUniform("bool","u_flattened",Vo.BOTH),n.addUniform("mat4","u_inverseModelElevationMatrix",Vo.BOTH),n.addUniform("mat4","u_inverseElevationModelMatrix",Vo.BOTH),n.addUniform("bool","u_flattenDiscard",Vo.BOTH);const o={u_flattenedBound:function(){return i.xbsjFlattenedBound??h.Cartesian4.ZERO},u_flattened:function(){return i.xbsjFlattened},u_inverseModelElevationMatrix:function(){const s=e.context.uniformState.inverseModel??h.Matrix4.IDENTITY;return i._uniformElevationInverseModelMatrix=h.Matrix4.multiply(s,i.xbsjElevationMatrix??h.Matrix4.IDENTITY,i._uniformElevationInverseModelMatrix??new h.Matrix4),i._uniformElevationInverseModelMatrix},u_inverseElevationModelMatrix:function(){const s=e.context.uniformState.model??h.Matrix4.IDENTITY;return i._uniformInverseElevationModelMatrix=h.Matrix4.multiply(i.xbsjElevationMatrixInv??h.Matrix4.IDENTITY,s,i._uniformInverseElevationModelMatrix??new h.Matrix4),i._uniformInverseElevationModelMatrix},u_flattenedPolygonTexture:function(){return i.xbsjGetFlattenedTextureFunc?i.xbsjGetFlattenedTextureFunc()??e.context.defaultTexture:e.context.defaultTexture}};t.uniformMap=U4(o,t.uniformMap)}};function l_(){Object.defineProperties(h.Model.prototype,{xbsjFlattened:{get:function(){return this._xbsjFlattened??!1},set:function(t){t!==this._xbsjFlattened&&this.resetDrawCommands(),this._xbsjFlattened=t}},xbsjElevationMatrix:{get:function(){return this._xbsjElevationMatrix},set:function(t){t!==this._xbsjElevationMatrix&&this.resetDrawCommands(),this._xbsjElevationMatrix=t,this._xbsjElevationMatrixInv=this._xbsjElevationMatrix&&h.Matrix4.inverseTransformation(this._xbsjElevationMatrix,new h.Matrix4)}},xbsjElevationMatrixInv:{get:function(){return this._xbsjElevationMatrixInv}},xbsjFlattenedBound:{get:function(){return this._xbsjFlattenedBound},set:function(t){t!==this._xbsjFlattenedBound&&this.resetDrawCommands(),this._xbsjFlattenedBound=t}},xbsjGetFlattenedTextureFunc:{get:function(){return this._xbsjGetFlattenedTextureFunc},set:function(t){t!==this._xbsjGetFlattenedTextureFunc&&this.resetDrawCommands(),this._xbsjGetFlattenedTextureFunc=t}}})}function c_(){Object.defineProperties(h.Cesium3DTileset.prototype,{xbsjFlattened:{get:function(){return this._xbsjFlattened??!1},set:function(t){this._xbsjFlattened=t}},xbsjElevationMatrix:{get:function(){return this._xbsjElevationMatrix},set:function(t){this._xbsjElevationMatrix=t}},xbsjFlattenedBound:{get:function(){return this._xbsjFlattenedBound},set:function(t){this._xbsjFlattenedBound=t}},xbsjGetFlattenedTextureFunc:{get:function(){return this._xbsjGetFlattenedTextureFunc},set:function(t){this._xbsjGetFlattenedTextureFunc=t}}})}function h_(){const t=h.Model3DTileContent.prototype.update;h.Model3DTileContent.prototype.update=function(i,e,...n){const o=this._model;return o.xbsjFlattened=i.xbsjFlattened,o.xbsjElevationMatrix=i.xbsjElevationMatrix,o.xbsjFlattenedBound=i.xbsjFlattenedBound,o.xbsjGetFlattenedTextureFunc=i.xbsjGetFlattenedTextureFunc,t.call(this,i,e,...n)}}function u_(){const t=h.ModelSceneGraph.prototype.configurePipeline;h.ModelSceneGraph.prototype.configurePipeline=function(i,...e){const n=t.call(this,i,...e),o=this._model,s=this.modelPipelineStages;return o.xbsjFlattened&&s.push(a_),n}}l_(),c_(),h_(),u_();const W4=()=>({createCesiumViewerFuncStr:void 0,flashLighting:void 0,resolutionScale:void 0,msaaSamples:void 0,shadows:!1,sceneSplitPosition:void 0,sceneGlobeShadows:void 0,sceneGlobeTerrainExaggeration:1,sceneGlobeTerrainExaggerationRelativeHeight:0,sceneGlobeVerticalExaggeration:1,sceneGlobeVerticalExaggerationRelativeHeight:0,sceneGlobeBackFaceCulling:!0,sceneGlobeShowSkirts:!0,sceneGlobeShowWaterEffect:!0,sceneGlobeBaseColor:a.reactArray([0,0,1,0]),sceneGlobeCartographicLimitRectangle:a.reactArray([-180,-90,180,90]),sceneGlobeClippingPlanes:a.reactJson(void 0),sceneGlobeClippingPlanesId:"",sceneGlobeClippingPolygons:a.reactJsonWithUndefined(void 0),sceneGlobeClippingPolygonsId:a.reactArray([]),sceneGlobeUndergroundColor:a.reactArrayWithUndefined(void 0),sceneGlobeUndergroundColorAlphaByDistance:a.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyBackFaceAlphaByDistance:a.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyFrontFaceAlphaByDistance:a.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyRectangle:a.reactArrayWithUndefined(void 0),sun:void 0,sceneSunGlowFactor:void 0,moon:void 0,sceneMoonTextureUrl:void 0,sceneMoonOnlySunLighting:void 0,sceneSkyBoxShow:!0,sceneSkyBoxSources:a.reactJson(Re.defaults.sceneSkyBoxSources),xbsjUseBackground:!1,xbsjBackgroundImageUri:"",xbsjBackgroundColor:a.reactArray([1,1,1,1]),xbsjLocalBoxSources:a.reactJsonWithUndefined(void 0),sceneBackgroundColor:a.reactArray([0,0,0,0]),sceneFogEnabled:void 0,sceneFogDensity:void 0,sceneFogScreenSpaceErrorFactor:void 0,sceneFogMinimumBrightness:void 0,sceneSsccEnableInputs:void 0,sceneSsccEnableCollisionDetection:void 0,sceneSsccZoomFactor:void 0,scenePpsfxaaEnabled:void 0,scenePpsAmbientOcclusionEnabled:!1,scenePpsAmbientOcclusionAmbientOcclusionOnly:!1,scenePpsAmbientOcclusionIntensity:3,scenePpsAmbientOcclusionBias:.1,scenePpsAmbientOcclusionLengthCap:.03,scenePpsAmbientOcclusionStepSize:1,scenePpsAmbientOcclusionBlurStepSize:.86,scenePpsBloomEnabled:!1,scenePpsBloomGlowOnly:!1,scenePpsBloomContrast:128,scenePpsBloomBrightness:-.3,scenePpsBloomDelta:1,scenePpsBloomSigma:3.78,scenePpsBloomStepSize:5,sceneDebugShowFramesPerSecond:void 0,sceneDebugShowCommands:void 0,sceneDebugShowFrustums:void 0,sceneDebugShowFrustumPlanes:void 0,sceneDebugShowDepthFrustum:void 0,showCesiumInspector:void 0,cesiumInspectorWireframe:void 0,showCesium3DTilesInspector:void 0,particleGlobalControl:!1}),G4=`
2208
+ `,Xn=h.Cartesian3,an=h.defined,m4=h.destroyObject,v4=h.Ellipsoid,t_=h.EllipsoidGeometry,y4=h.GeometryPipeline,rr=h.Math,ln=h.Matrix4,w4=h.VertexFormat,C4=h.BufferUsage,_4=h.DrawCommand,P4=h.RenderState,b4=h.ShaderProgram,i_=h.ShaderSource,S4=h.VertexArray,n_=h._shadersAtmosphereCommon,o_=h._shadersSkyAtmosphereCommon,E4=h._shadersSkyAtmosphereVS,x4=h.Axis,A4=h.BlendingState,T4=h.CullFace,s_=h.SceneMode,Xh=h.Transforms,M4=h.Matrix3,r_=h.DeveloperError,I4=h.loadCubeMap,D4=h.CubeMap;function ar(t,i){t=t??v4.WGS84,this.show=!0,this.sources=i,this.perFragmentAtmosphere=!1,this._ellipsoid=t;const e=1.025,n=Xn.multiplyByScalar(t.radii,e,new Xn);this._scaleMatrix=ln.fromScale(n),this._modelMatrix=new ln,this._command=new _4({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new Xn(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new Xn(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new Xn;const o=new Xn;o.x=t.maximumRadius*e,o.y=t.maximumRadius,o.z=0,this._radiiAndDynamicAtmosphereColor=o;const s=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return s._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return s._hueSaturationBrightness.x=s.hueShift,s._hueSaturationBrightness.y=s.saturationShift,s._hueSaturationBrightness.z=s.brightnessShift,s._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return s.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return s.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return s.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return s.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return s.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return s.atmosphereMieAnisotropy},u_rotateMatrix:function(){return s._scratchRoateMatrix=s._scratchRoateMatrix||new M4,ln.getMatrix3(s._eunMatrix||ln.IDENTITY,s._scratchRoateMatrix)},u_cubeMap:function(){return s._cubeMap}}}Object.defineProperties(ar.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),ar.prototype.setDynamicLighting=function(t){this._radiiAndDynamicAtmosphereColor.z=t};const Dg=new ln;ar.prototype.update=function(t,i){if(!this.show)return;const e=t.mode;if(e!==s_.SCENE3D&&e!==s_.MORPHING||!t.passes.render)return;if(this._sources!==this.sources){const v=t.context;var n=this;this._sources=this.sources;var o=this.sources;if(!an(o.positiveX)||!an(o.negativeX)||!an(o.positiveY)||!an(o.negativeY)||!an(o.positiveZ)||!an(o.negativeZ))throw new r_("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof o.positiveX!=typeof o.negativeX||typeof o.positiveX!=typeof o.positiveY||typeof o.positiveX!=typeof o.negativeY||typeof o.positiveX!=typeof o.positiveZ||typeof o.positiveX!=typeof o.negativeZ)throw new r_("this.sources properties must all be the same type.");typeof o.positiveX=="string"?I4(v,this._sources).then(function(y){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=y}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new D4({context:v,source:o}))}const s=ln.fromRotationTranslation(t.context.uniformState.inverseViewRotation,Xn.ZERO,Dg),r=ln.multiplyTransformation(s,x4.Y_UP_TO_Z_UP,Dg),l=ln.multiply(this._scaleMatrix,r,Dg);ln.clone(l,this._modelMatrix);const c=t.context,u=R4(this),d=t.globeTranslucencyState.translucent,p=this.perFragmentAtmosphere||d||!an(i)||!i.show,f=this._command;if(Xh.eastUpNorthToFixedFrame=Xh.eastUpNorthToFixedFrame||Xh.localFrameToFixedFrameGenerator("east","up"),this._eunMatrix=Xh.eastUpNorthToFixedFrame(t.camera._positionWC,void 0,this._eunMatrix),!an(f.vertexArray)){const v=t_.createGeometry(new t_({radii:new Xn(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:w4.POSITION_ONLY}));f.vertexArray=S4.fromGeometry({context:c,geometry:v,attributeLocations:y4.createAttributeLocations(v),bufferUsage:C4.STATIC_DRAW}),f.renderState=P4.fromCache({cull:{enabled:!0,face:T4.FRONT},blending:A4.ALPHA_BLEND,depthMask:!1})}const g=u|p<<2|d<<3;if(g!==this._flags){this._flags=g;const v=[];u&&v.push("COLOR_CORRECT"),p&&v.push("PER_FRAGMENT_ATMOSPHERE"),d&&v.push("GLOBE_TRANSLUCENT");const y=new i_({defines:v,sources:[n_,o_,E4]}),w=new i_({defines:v,sources:[n_,o_,g4]});this._spSkyAtmosphere=b4.fromCache({context:c,vertexShaderSource:y,fragmentShaderSource:w}),f.shaderProgram=this._spSkyAtmosphere}if(an(this._cubeMap))return f};function R4(t){return!(rr.equalsEpsilon(t.hueShift,0,rr.EPSILON7)&&rr.equalsEpsilon(t.saturationShift,0,rr.EPSILON7)&&rr.equalsEpsilon(t.brightnessShift,0,rr.EPSILON7))}ar.prototype.isDestroyed=function(){return!1},ar.prototype.destroy=function(){const t=this._command;return t.vertexArray=t.vertexArray&&t.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),m4(this)};const mr=class mr extends a.Destroyable{constructor(e,n){super();m(this,"_navigationManager");m(this,"_envManager");m(this,"_reu",(e,n)=>a.registerEventUpdate(this,e,n));this._czmViewer=e,this._viewer=n;const o=this.viewer,s=this.czmViewer,r=o.scene.screenSpaceCameraController;this._navigationManager=this.dv(new JL(s)),this._envManager=this.dv(new l4(s)),this.disposeVar(new a.ObjResettingWithEvent(this._czmViewer.xbsjUseBackgroundChanged,()=>{if(this._czmViewer.xbsjUseBackground)return new mr.BackGroundResetting(this._czmViewer,this._viewer)})),this.disposeVar(new a.ObjResettingWithEvent(this._czmViewer.xbsjLocalBoxSourcesChanged,()=>{if(!this._czmViewer.xbsjLocalBoxSources)return;const l=e_(this._czmViewer.xbsjLocalBoxSources);if(l)return new mr.LocalSkyBoxResetting(this._czmViewer,this._viewer,l)}));{this._reu(s.disabledInputStackChanged,()=>{const c=s.disabledInputStack===0;r.enableInputs=c,r.enableTranslate=c,r.enableZoom=c,r.enableRotate=c,r.enableTilt=c,r.enableLook=c});class l extends a.Destroyable{constructor(){super(),s.incrementDisabledInputStack(),this.dispose(()=>s.decrementDisabledInputStack())}}this.disposeVar(new a.ObjResettingWithEvent(s.sceneSsccEnableInputsChanged,()=>s.sceneSsccEnableInputs??!0?void 0:new l))}this.d(o.scene.camera.changed.addEventListener(()=>s.cameraChanged.emit()));{const l=()=>{const c=Re.latestDefaultAccessToken??Re.currentDefaultAccessToken;h.Ion.defaultAccessToken=s.ionAccessToken===""?c:s.ionAccessToken};l(),this.dispose(s.ionAccessTokenChanged.disposableOn(l))}{const{scene:l}=o,c=()=>{if(l.globe.show=s.globeShow??!0,"fov"in l.camera.frustum){const d=l.camera.frustum.aspectRatio;if(!d){console.error("aspectRatio is undefined,请检查Cesium的scene.camera.frustum");return}l.camera.frustum.fov=h.Math.toRadians(d>=1?s.fov:s.fov/d)}};c();const u=this.dv(a.createNextAnimateFrameEvent(s.globeShowChanged,s.fovChanged));this.d(u.don(c))}o.clockViewModel.currentTime=h.JulianDate.fromDate(new Date(s.currentTime)),this.dispose(s.currentTimeChanged.disposableOn(()=>{if(s.currentTime===void 0)return;const l=h.JulianDate.fromDate(new Date(s.currentTime));h.JulianDate.equals(l,o.clockViewModel.currentTime)||(o.clockViewModel.currentTime=l)})),this.dispose(Ci(o.clockViewModel,"currentTime",l=>{const c=h.JulianDate.toDate(o.clockViewModel.currentTime).getTime();c!==s.currentTime&&(s.currentTime=c)}));{let l=h.getTimestamp(),c=0;this.d(o.scene.preUpdate.addEventListener(()=>{var u=h.getTimestamp();c++;var d=u-l;d>1e3&&(s._fps.value=c*1e3/d|0,l=u,c=0)}))}{const l=new h.SunLight,c=new h.DirectionalLight({direction:o.scene.camera.directionWC});class u extends a.Destroyable{constructor(){super();const p=s.flashLighting??!1;o.scene.light=p?c:l,p&&this.dispose(o.scene.preRender.addEventListener(function(f,g){c.direction=h.Cartesian3.clone(f.camera.directionWC,f.light.direction)}))}}this.disposeVar(new a.ObjResettingWithEvent(s.flashLightingChanged,()=>new u))}{const{scene:l}=o,{screenSpaceCameraController:c,globe:u}=l,d=(v,y)=>a.registerEventUpdate(this,v,y),p=Re.defaults,f=(v,y)=>d(s[v+"Changed"],()=>{if(!Reflect.has(s,v))throw new Error(`!Reflect.has(czmViewer, ${v})`);if(!Reflect.has(p,v))throw new Error(`!Reflect.has(CzmViewer.defaults, ${v})`);y(s[v]??p[v])}),g=(v,y)=>d(s[v+"Changed"],()=>{if(!Reflect.has(s,v))throw new Error(`!Reflect.has(czmViewer, ${v})`);y(s[v])});f("splitPosition",v=>o.scene.splitPosition=v),f("resolutionScale",v=>o.resolutionScale=v),f("msaaSamples",v=>o.scene.msaaSamples=v),g("shadows",v=>o.shadows=v),f("scenePpsfxaaEnabled",v=>l.postProcessStages.fxaa.enabled=v),g("scenePpsAmbientOcclusionEnabled",v=>l.postProcessStages.ambientOcclusion.enabled=v),g("scenePpsAmbientOcclusionAmbientOcclusionOnly",v=>l.postProcessStages.ambientOcclusion.uniforms.ambientOcclusionOnly=v),g("scenePpsAmbientOcclusionIntensity",v=>l.postProcessStages.ambientOcclusion.uniforms.intensity=v),g("scenePpsAmbientOcclusionBias",v=>l.postProcessStages.ambientOcclusion.uniforms.bias=v),g("scenePpsAmbientOcclusionLengthCap",v=>l.postProcessStages.ambientOcclusion.uniforms.lengthCap=v),g("scenePpsAmbientOcclusionStepSize",v=>l.postProcessStages.ambientOcclusion.uniforms.stepSize=v),g("scenePpsAmbientOcclusionBlurStepSize",v=>l.postProcessStages.ambientOcclusion.uniforms.blurStepSize=v),g("scenePpsBloomEnabled",v=>l.postProcessStages.bloom.enabled=v),g("scenePpsBloomGlowOnly",v=>l.postProcessStages.bloom.uniforms.glowOnly=v),g("scenePpsBloomContrast",v=>l.postProcessStages.bloom.uniforms.contrast=v),g("scenePpsBloomBrightness",v=>l.postProcessStages.bloom.uniforms.brightness=v),g("scenePpsBloomDelta",v=>l.postProcessStages.bloom.uniforms.delta=v),g("scenePpsBloomSigma",v=>l.postProcessStages.bloom.uniforms.sigma=v),g("scenePpsBloomStepSize",v=>l.postProcessStages.bloom.uniforms.stepSize=v),f("globeShow",v=>l.globe.show=v),f("depthTestAgainstTerrain",v=>{l.globe.depthTestAgainstTerrain=v}),l.globe.translucency.enabled=!0,f("terrainOpacity",v=>{l.globe.translucency.frontFaceAlpha=l.globe.translucency.backFaceAlpha=a.clamp(v,0,1)}),f("sceneGlobeShadows",v=>l.globe.shadows=h.ShadowMode[v]),g("sceneGlobeTerrainExaggeration",v=>l.globe.terrainExaggeration=v),g("sceneGlobeTerrainExaggerationRelativeHeight",v=>l.globe.terrainExaggerationRelativeHeight=v),g("sceneGlobeVerticalExaggeration",v=>l.globe.verticalExaggeration=v),g("sceneGlobeVerticalExaggerationRelativeHeight",v=>l.globe.verticalExaggerationRelativeHeight=v),g("sceneGlobeBackFaceCulling",v=>l.globe.backFaceCulling=v),g("sceneGlobeShowSkirts",v=>l.globe.showSkirts=v),g("sceneGlobeShowWaterEffect",v=>l.globe.showWaterEffect=v),g("sceneGlobeBaseColor",v=>l.globe.baseColor=te(v)),g("sceneGlobeCartographicLimitRectangle",v=>l.globe.cartographicLimitRectangle=Ue(v)),g("sceneGlobeClippingPlanes",v=>{if(!l.globe.clippingPlanes){l.globe.clippingPlanes=wr(v??{enabled:!1});return}dc(l.globe.clippingPlanes,v)}),g("sceneGlobeClippingPolygons",v=>{l.globe.clippingPolygons=v?pc(v):void 0}),f("sceneSunGlowFactor",v=>l.sun&&(l.sun.glowFactor=v)),f("moon",v=>l.moon&&(l.moon.show=v)),f("sceneMoonOnlySunLighting",v=>l.moon&&(l.moon.onlySunLighting=v)),f("sceneMoonTextureUrl",v=>l.moon&&(l.moon.textureUrl=a.ESSceneObject.context.getStrFromEnv(v))),g("sceneSkyBoxShow",v=>l._xbsjOriginSkyBox.show=v),f("sceneSkyBoxSources",v=>l._xbsjOriginSkyBox.sources=v&&e_(v)),g("atmosphere",v=>o.scene._xbsjOriginSkyAtmosphere.show=v),g("sceneBackgroundColor",v=>o.scene.backgroundColor=te(v)),f("sceneFogEnabled",v=>l.fog.enabled=v),f("sceneFogDensity",v=>l.fog.density=v),f("sceneFogScreenSpaceErrorFactor",v=>l.fog.screenSpaceErrorFactor=v),f("sceneFogMinimumBrightness",v=>l.fog.minimumBrightness=v),f("sceneDebugShowFramesPerSecond",v=>l.debugShowFramesPerSecond=v),f("sceneDebugShowCommands",v=>l.debugShowCommands=v),f("sceneDebugShowFrustums",v=>l.debugShowFrustums=v),f("sceneDebugShowFrustumPlanes",v=>l.debugShowFrustumPlanes=v),f("sceneDebugShowDepthFrustum",v=>l.debugShowDepthFrustum=v),f("sceneGlobeUndergroundColor",v=>u.undergroundColor=te(v)),f("sceneGlobeUndergroundColorAlphaByDistance",v=>u.undergroundColorAlphaByDistance=dn(v)),f("sceneGlobeTranslucencyBackFaceAlphaByDistance",v=>u.translucency.backFaceAlphaByDistance=v&&dn(v)),g("sceneGlobeTranslucencyFrontFaceAlphaByDistance",v=>u.translucency.frontFaceAlphaByDistance=v&&dn(v)),f("sceneGlobeTranslucencyRectangle",v=>u.translucency.rectangle=Ue(v)),f("sceneSplitPosition",v=>l.splitPosition=a.clamp(v,0,1)),f("sceneSsccEnableCollisionDetection",v=>l.screenSpaceCameraController.enableCollisionDetection=v),f("sceneSsccZoomFactor",v=>l.screenSpaceCameraController._zoomFactor=v);{const v=()=>{o.cesiumInspector&&(o.cesiumInspector.container.style.display=s.showCesiumInspector??!1?"block":"none")};v(),this.d(s.showCesiumInspectorChanged.don(v))}f("cesiumInspectorWireframe",v=>{"cesiumInspector"in o&&(o.cesiumInspector.viewModel.wireframe=v)});{const v=()=>{o.cesium3DTilesInspector&&(o.cesium3DTilesInspector.container.style.display=s.showCesium3DTilesInspector??!1?"block":"none")};v(),this.dispose(s.showCesium3DTilesInspectorChanged.disposableOn(v))}this.ad(new a.ObjResettingWithEvent(s.particleGlobalControlChanged,()=>{if(!s.particleGlobalControl)return new Pg}))}}get czmViewer(){return this._czmViewer}get viewer(){return this._viewer}get navigationManager(){return this._navigationManager}get envManager(){return this._envManager}};m(mr,"BackGroundResetting",class extends a.Destroyable{constructor(n,o){super(),this._czmViewer=n,this._viewer=o;const s=new qh;s.material=h.Material.fromType("Image");const r=this._viewer;r.scene.skyBox=s,this.dispose(()=>r.scene.skyBox=r.scene._xbsjOriginSkyBox);{const l=()=>{s.show=this._czmViewer.sceneSkyBoxShow};l(),this.dispose(this._czmViewer.sceneSkyBoxShowChanged.disposableOn(l))}{const l=()=>{s.material.uniforms.color=te(this._czmViewer.xbsjBackgroundColor)};l(),this.dispose(this._czmViewer.xbsjBackgroundColorChanged.disposableOn(l))}{const l=()=>{s.material.uniforms.image=SceneObject.context.getStrFromEnv(this._czmViewer.xbsjBackgroundImageUri)};l(),this.dispose(this._czmViewer.xbsjBackgroundImageUriChanged.disposableOn(l))}}}),m(mr,"LocalSkyBoxResetting",class extends a.Destroyable{constructor(o,s,r){super();m(this,"_skyAtmosphere");this._czmViewer=o,this._viewer=s,this._sources=r,this._skyAtmosphere=new ar(void 0,this._sources);const l=this._viewer;l.scene.skyAtmosphere=this._skyAtmosphere,this.dispose(()=>l.scene.skyAtmosphere=l.scene._xbsjOriginSkyAtmosphere);{const c=()=>{this._skyAtmosphere.show=this._czmViewer.atmosphere};c(),this.dispose(this._czmViewer.atmosphereChanged.disposableOn(c))}}get skyAtmosphere(){return this._skyAtmosphere}});let Rg=mr;function F4(t,i,e,n,o){var s=h.Cartesian3.subtract(t,e,new h.Cartesian3),r=h.Cartesian3.dot(s,i);if(!(r<=0))return r*Math.tan(n*.5)*2/o}async function z4(t){const{viewer:i}=t;if(!i)return;const{width:e,height:n}=i.canvas,o=t.quickPickPosition([e*.5,n*.5]);if(!o)return;const s=await o;if(!s)return;const r=h.Cartesian3.fromDegrees(...s);if(!r)return;const l=i.camera.positionWC,c=i.camera.directionWC,u=i.camera.frustum.fovy;if(u===void 0)return;const d=i.canvas.height;return[F4(r,c,l,u,d),s]}const L4=h.Ellipsoid.WGS84.maximumRadius*2*Math.PI/512;function O4(t){return-Math.log2(t/L4)}var Fg=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];function N4(t){const i=t|0;if(i<1||i>1e8)return;let e=-1;for(;i>=Fg[++e];);const n=i/Fg[e-1]|0;return[n*Fg[e-1],n,e]}class B4 extends a.Destroyable{constructor(){super();m(this,"_lengthInPixels",this.disposeVar(a.react(100)));m(this,"_resolution",this.disposeVar(a.react(void 0)));m(this,"_computedLengthInPixels",this.disposeVar(a.react(void 0)));m(this,"_computedLengthInMeters",this.disposeVar(a.react(void 0)));m(this,"_computedLengthInStr",this.disposeVar(a.react(void 0)));{const e=()=>{let n,o;const{lengthInPixels:s,resolution:r}=this;if(s&&r){const l=N4(s*r);if(l){const[c,u,d]=l;o=c,n=c/r}}this._computedLengthInPixels.value=n,this._computedLengthInMeters.value=o};e(),this.dispose(this.lengthInPixelsChanged.disposableOn(e)),this.dispose(this.resolutionChanged.disposableOn(e))}{const e=()=>{const n=this.computedLengthInMeters;if(!n){this._computedLengthInStr.value=void 0;return}this._computedLengthInStr.value=n>1e3?`${n/1e3|0}km`:`${n}m`};e(),this.dispose(this.computedLengthInMetersChanged.disposableOn(e))}}get lengthInPixels(){return this._lengthInPixels.value}set lengthInPixels(e){this._lengthInPixels.value=e}get lengthInPixelsChanged(){return this._lengthInPixels.changed}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}get resolutionChanged(){return this._resolution.changed}get computedLengthInPixels(){return this._computedLengthInPixels.value}get computedLengthInPixelsChanged(){return this._computedLengthInPixels.changed}get computedLengthInMeters(){return this._computedLengthInMeters.value}get computedLengthInMetersChanged(){return this._computedLengthInMeters.changed}get computedLengthInStr(){return this._computedLengthInStr.value}get computedLengthInStrChanged(){return this._computedLengthInStr.changed}}class V4 extends a.Destroyable{constructor(e){super();m(this,"_enabled",this.dv(a.react(!0)));m(this,"_resolution",this.dv(a.react(void 0)));m(this,"_center",this.dv(a.react(void 0)));m(this,"_zoom",this.dv(a.react(void 0)));m(this,"_legend",this.dv(new B4));this._czmViewer=e;{const n=this.dv(a.createProcessingFromAsyncFunc(async o=>{let s,r,l;await o.promise(a.sleep(1e3));const c=await o.promise(z4(this._czmViewer));if(c){const[u,d]=c;s=u,r=O4(u),l=d}this._resolution.value=s,this._zoom.value=r,this._center.value=l}));n.restart();{const o=()=>{this.enabled?n.restart():n.cancel()};o();const s=this.dv(a.createNextAnimateFrameEvent(this._czmViewer.cameraChanged,this.enabledChanged));this.dispose(s.disposableOn(o))}}{const n=()=>{this._legend.resolution=this.resolution};n(),this.dispose(this.resolutionChanged.disposableOn(n))}}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}get resolutionChanged(){return this._resolution.changed}get center(){return this._center.value}get centerChanged(){return this._center.changed}get zoom(){return this._zoom.value}get zoomChanged(){return this._zoom.changed}get legend(){return this._legend}get length(){return(this.legend.computedLengthInMeters??-1)/(this.legend.computedLengthInPixels??1)}}function U4(t,i){try{const e=h.Ellipsoid.WGS84,n=e.scaleToGeodeticSurface(t);return i=h.Transforms.eastNorthUpToFixedFrame(n,e,i),i}catch{return h.Matrix4.clone(h.Matrix4.IDENTITY,i)}}const{combine:W4}=h,{ShaderDestination:Vo}=h,a_={name:"FlattenedPipelineStage"};a_.process=function(t,i,e){if(i.xbsjFlattened){const n=t.shaderBuilder;n.addDefine("XBSJ_FLATTERN",void 0,Vo.BOTH),n.addUniform("sampler2D","u_flattenedPolygonTexture",Vo.BOTH),n.addUniform("vec4","u_flattenedBound",Vo.BOTH),n.addUniform("bool","u_flattened",Vo.BOTH),n.addUniform("mat4","u_inverseModelElevationMatrix",Vo.BOTH),n.addUniform("mat4","u_inverseElevationModelMatrix",Vo.BOTH),n.addUniform("bool","u_flattenDiscard",Vo.BOTH);const o={u_flattenedBound:function(){return i.xbsjFlattenedBound??h.Cartesian4.ZERO},u_flattened:function(){return i.xbsjFlattened},u_inverseModelElevationMatrix:function(){const s=e.context.uniformState.inverseModel??h.Matrix4.IDENTITY;return i._uniformElevationInverseModelMatrix=h.Matrix4.multiply(s,i.xbsjElevationMatrix??h.Matrix4.IDENTITY,i._uniformElevationInverseModelMatrix??new h.Matrix4),i._uniformElevationInverseModelMatrix},u_inverseElevationModelMatrix:function(){const s=e.context.uniformState.model??h.Matrix4.IDENTITY;return i._uniformInverseElevationModelMatrix=h.Matrix4.multiply(i.xbsjElevationMatrixInv??h.Matrix4.IDENTITY,s,i._uniformInverseElevationModelMatrix??new h.Matrix4),i._uniformInverseElevationModelMatrix},u_flattenedPolygonTexture:function(){return i.xbsjGetFlattenedTextureFunc?i.xbsjGetFlattenedTextureFunc()??e.context.defaultTexture:e.context.defaultTexture}};t.uniformMap=W4(o,t.uniformMap)}};function l_(){Object.defineProperties(h.Model.prototype,{xbsjFlattened:{get:function(){return this._xbsjFlattened??!1},set:function(t){t!==this._xbsjFlattened&&this.resetDrawCommands(),this._xbsjFlattened=t}},xbsjElevationMatrix:{get:function(){return this._xbsjElevationMatrix},set:function(t){t!==this._xbsjElevationMatrix&&this.resetDrawCommands(),this._xbsjElevationMatrix=t,this._xbsjElevationMatrixInv=this._xbsjElevationMatrix&&h.Matrix4.inverseTransformation(this._xbsjElevationMatrix,new h.Matrix4)}},xbsjElevationMatrixInv:{get:function(){return this._xbsjElevationMatrixInv}},xbsjFlattenedBound:{get:function(){return this._xbsjFlattenedBound},set:function(t){t!==this._xbsjFlattenedBound&&this.resetDrawCommands(),this._xbsjFlattenedBound=t}},xbsjGetFlattenedTextureFunc:{get:function(){return this._xbsjGetFlattenedTextureFunc},set:function(t){t!==this._xbsjGetFlattenedTextureFunc&&this.resetDrawCommands(),this._xbsjGetFlattenedTextureFunc=t}}})}function c_(){Object.defineProperties(h.Cesium3DTileset.prototype,{xbsjFlattened:{get:function(){return this._xbsjFlattened??!1},set:function(t){this._xbsjFlattened=t}},xbsjElevationMatrix:{get:function(){return this._xbsjElevationMatrix},set:function(t){this._xbsjElevationMatrix=t}},xbsjFlattenedBound:{get:function(){return this._xbsjFlattenedBound},set:function(t){this._xbsjFlattenedBound=t}},xbsjGetFlattenedTextureFunc:{get:function(){return this._xbsjGetFlattenedTextureFunc},set:function(t){this._xbsjGetFlattenedTextureFunc=t}}})}function h_(){const t=h.Model3DTileContent.prototype.update;h.Model3DTileContent.prototype.update=function(i,e,...n){const o=this._model;return o.xbsjFlattened=i.xbsjFlattened,o.xbsjElevationMatrix=i.xbsjElevationMatrix,o.xbsjFlattenedBound=i.xbsjFlattenedBound,o.xbsjGetFlattenedTextureFunc=i.xbsjGetFlattenedTextureFunc,t.call(this,i,e,...n)}}function u_(){const t=h.ModelSceneGraph.prototype.configurePipeline;h.ModelSceneGraph.prototype.configurePipeline=function(i,...e){const n=t.call(this,i,...e),o=this._model,s=this.modelPipelineStages;return o.xbsjFlattened&&s.push(a_),n}}l_(),c_(),h_(),u_();const G4=()=>({createCesiumViewerFuncStr:void 0,flashLighting:void 0,resolutionScale:void 0,msaaSamples:void 0,shadows:!1,sceneSplitPosition:void 0,sceneGlobeShadows:void 0,sceneGlobeTerrainExaggeration:1,sceneGlobeTerrainExaggerationRelativeHeight:0,sceneGlobeVerticalExaggeration:1,sceneGlobeVerticalExaggerationRelativeHeight:0,sceneGlobeBackFaceCulling:!0,sceneGlobeShowSkirts:!0,sceneGlobeShowWaterEffect:!0,sceneGlobeBaseColor:a.reactArray([0,0,1,0]),sceneGlobeCartographicLimitRectangle:a.reactArray([-180,-90,180,90]),sceneGlobeClippingPlanes:a.reactJson(void 0),sceneGlobeClippingPlanesId:"",sceneGlobeClippingPolygons:a.reactJsonWithUndefined(void 0),sceneGlobeClippingPolygonsId:a.reactArray([]),sceneGlobeUndergroundColor:a.reactArrayWithUndefined(void 0),sceneGlobeUndergroundColorAlphaByDistance:a.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyBackFaceAlphaByDistance:a.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyFrontFaceAlphaByDistance:a.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyRectangle:a.reactArrayWithUndefined(void 0),sun:void 0,sceneSunGlowFactor:void 0,moon:void 0,sceneMoonTextureUrl:void 0,sceneMoonOnlySunLighting:void 0,sceneSkyBoxShow:!0,sceneSkyBoxSources:a.reactJson(Re.defaults.sceneSkyBoxSources),xbsjUseBackground:!1,xbsjBackgroundImageUri:"",xbsjBackgroundColor:a.reactArray([1,1,1,1]),xbsjLocalBoxSources:a.reactJsonWithUndefined(void 0),sceneBackgroundColor:a.reactArray([0,0,0,0]),sceneFogEnabled:void 0,sceneFogDensity:void 0,sceneFogScreenSpaceErrorFactor:void 0,sceneFogMinimumBrightness:void 0,sceneSsccEnableInputs:void 0,sceneSsccEnableCollisionDetection:void 0,sceneSsccZoomFactor:void 0,scenePpsfxaaEnabled:void 0,scenePpsAmbientOcclusionEnabled:!1,scenePpsAmbientOcclusionAmbientOcclusionOnly:!1,scenePpsAmbientOcclusionIntensity:3,scenePpsAmbientOcclusionBias:.1,scenePpsAmbientOcclusionLengthCap:.03,scenePpsAmbientOcclusionStepSize:1,scenePpsAmbientOcclusionBlurStepSize:.86,scenePpsBloomEnabled:!1,scenePpsBloomGlowOnly:!1,scenePpsBloomContrast:128,scenePpsBloomBrightness:-.3,scenePpsBloomDelta:1,scenePpsBloomSigma:3.78,scenePpsBloomStepSize:5,sceneDebugShowFramesPerSecond:void 0,sceneDebugShowCommands:void 0,sceneDebugShowFrustums:void 0,sceneDebugShowFrustumPlanes:void 0,sceneDebugShowDepthFrustum:void 0,showCesiumInspector:void 0,cesiumInspectorWireframe:void 0,showCesium3DTilesInspector:void 0,particleGlobalControl:!1}),H4=`
2209
2209
  #### 示例代码1
2210
2210
  \`\`\`
2211
2211
  async function initCesiumViewer(container, czmViewer) {
@@ -2280,7 +2280,7 @@ async function initCesiumViewer(container, czmViewer) {
2280
2280
  return viewer;
2281
2281
  }
2282
2282
  \`\`\`
2283
- `,H4=`async function initCesiumViewer(container, czmViewer) {
2283
+ `,$4=`async function initCesiumViewer(container, czmViewer) {
2284
2284
  const viewer = await XE2.g.defaultCreateCesiumViewerFunc(container, czmViewer);
2285
2285
 
2286
2286
  // 若原Czm版权信息展示位置遮挡重要信息,可将以下语句解注释,在别的位置展示
@@ -2288,13 +2288,13 @@ async function initCesiumViewer(container, czmViewer) {
2288
2288
 
2289
2289
  return viewer;
2290
2290
  }
2291
- `;function $4(){const t="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
2291
+ `;function q4(){const t="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
2292
2292
  github地址:https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/Ion.js#L7
2293
2293
  gitee地址:${t}
2294
- `;console.log(e);const n=window.prompt(e,t);n&&window.open(n,"_blank")}const at=class at extends a.ESViewer{constructor(e){super(e);m(this,"_disabledInputStack",this.disposeVar(a.react(0)));m(this,"_viewer",this.dv(a.react(void 0)));m(this,"_viewerInstance");m(this,"_viewerLegend");m(this,"pickCustomAttachedInfo");m(this,"_fps",this.dv(a.react(0)));m(this,"_notSupportEditingCount",this.disposeVar(a.react(0)));m(this,"_editingSystem",Wh);m(this,"_moveObjectsProcess",this.ad(bC()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new CF(this)),this.ad(new _F(this)),this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new EF(this)})),this._viewerLegend=this.dv(new B4(this)),this._viewerInstance=this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Rg(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=te([1,1,1,1]))}));const n=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new a.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new bL(this.subContainer,this,o=>this._viewer.value=o,n.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&et(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,n,o){if(!this.extensions)return;const{pickingManager:s}=this.extensions;return await s.pick(e,void 0,n)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:n}=this;if(!n)return;const o=h.Cartographic.fromDegrees(e[0],e[1],e[2],at.getHeightsScartchCarto);return n.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Ht(e),rotation:Ko(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:n}=this.viewer;if(!n||!e)return;const o=h.Cartesian3.fromDegrees(...e),s=h.Transforms.eastNorthUpToFixedFrame(o),r=h.Matrix4.inverse(s,new h.Matrix4),l=h.Matrix4.multiplyByPoint(r,n.positionWC,new h.Cartesian3),c=h.Cartesian3.magnitude(l);let u=-Math.asin(l.z/c);u=h.Math.toDegrees(u);let d=h.Math.PI_OVER_TWO-Math.atan(l.y/l.x);l.x>0&&(d+=l.y<0?-h.Math.PI:h.Math.PI),d=h.Math.toDegrees(d);const p=Ko(n),f=p[0]-d,g=p[1]-u;return{distance:c,heading:d,pitch:u,flyDuration:1,hDelta:f,pDelta:g}}flyIn(e,n,o,s="default"){var c;if(!n)return;const r={position:e,rotation:n,duration:(o??1)*1e3},l=(c=this.viewer)==null?void 0:c.camera;return l&&Er(l,r,s)}flyTo(e,n,o="default"){var g;const{distance:s,heading:r,pitch:l,flyDuration:c,hDelta:u,pDelta:d}=e,p={position:n,viewDistance:s,rotation:[r,l,0],duration:c*1e3,hdelta:u,pdelta:d},f=(g=this.viewer)==null?void 0:g.camera;return f&&Er(f,p,o)}flyToBoundingSphere(e,n,o=1){var p;const s=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],r=a.getGeoBoundingSphereFromPositions(s);if(!r)return;const{center:l,radius:c}=r,u={position:l,viewDistance:n??c,rotation:[0,-90,0],duration:o*1e3},d=(p=this.viewer)==null?void 0:p.camera;return d&&Er(d,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Ht(e),rotation:Ko(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,n=4.2,o=1.6){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToWalk(e,n,o),this._navigationMode.value="Walk"}changeToMap(){var e,n;(n=(e=this._viewerInstance)==null?void 0:e.obj)==null||n.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,n,o){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToRotateGlobe(e,n,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,n,o,s,r,l){var c,u;(u=(c=this._viewerInstance)==null?void 0:c.obj)==null||u.navigationManager.changeToLine(e,n,o,s,r,l),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToRotatePoint(e,n,o,s,r),this._navigationMode.value="RotatePoint"}changeToFollow(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToFollow(e,n,o,s,r),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=window.g_XE3CopyRights??{};return e.cesium={version:h.VERSION},e}async getHeightByLonLat(e,n,o){if(!this.viewer)return null;const s=h.Cartographic.fromDegrees(e,n,void 0,at.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(s)??null}async getHeightsByLonLats(e,n){const o=e.map(r=>this.getHeightByLonLat(...r));return await Promise.all(o)}async capture(e,n){if(this.viewer)return await Pm(this.viewer.scene,e,n)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(Ie(e));if(n)return[n.x,n.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,n,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const s=e.components.main??e;s&&n!=null&&(s.editingID=`${o.callSource}_${a.createGuid()}`,this._editingSystem.create(this,s,n,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const n=[],o=a.createGuid();for(let s=0;s<e.length;s++){const r=e[s],l=r.components.main??r;l.editingID=o,l&&n.push(l)}this._moveObjectsProcess.restart(void 0,this,n,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=at.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!at.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=at.latestDefaultAccessToken}positionsToLocalPositions(e,n){return Dt(e,n)}localPositionsToPositions(e,n){return yn(e,n)}isPointVisible(e){if(!this.viewer)return!1;const n=e instanceof h.Cartesian3?e:Ie(e),o=new h.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(n))return!1;const s=this.viewer.scene.cartesianToCanvasCoordinates(n);return!(!s||s.x<0||s.y<0)}getESProperties(){const e={...super.getESProperties()},n=at.defaults;return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",H4,G4,!0),new a.FunctionProperty([],()=>at.getCesiumIonToken(),[],"获取官方token"),new a.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new a.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new a.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new a.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new a.GroupProperty([],"Viewer","Viewer"),new a.NumberProperty([this,"resolutionScale"],"分辨率比率",n.resolutionScale,!0),new a.NumberProperty([this,"msaaSamples"],"msaaSamples",n.msaaSamples,!0),new a.BooleanProperty([this,"shadows"]),new a.GroupProperty([],"比例尺","比例尺(Legend)"),new a.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new a.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new a.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new a.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new a.GroupProperty([],"场景","场景(Scene)"),new a.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new a.GroupProperty([],"Globe","Globe"),new a.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",n.sceneGlobeShadows,!0),new a.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new a.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new a.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new a.BooleanProperty([this,"sceneGlobeShowSkirts"]),new a.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new a.ColorProperty([this,"sceneGlobeBaseColor"]),new a.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new a.JsonProperty([this,"sceneGlobeClippingPlanes"]),new a.StringProperty([this,"sceneGlobeClippingPlanesId"]),new a.JsonProperty([this,"sceneGlobeClippingPolygons"]),new a.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new a.GroupProperty([],"underground","underground"),new a.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new a.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new a.GroupProperty([],"Translucency","Translucency"),new a.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",n.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",n.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",n.sceneGlobeTranslucencyRectangle,!0),new a.GroupProperty([],"Sun","Sun"),new a.BooleanProperty([this,"sun"],"sun",n.sun,!0),new a.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new a.GroupProperty([],"Moon","Moon"),new a.BooleanProperty([this,"moon"],"moon",n.moon,!0),new a.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",n.sceneMoonTextureUrl,!0),new a.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",n.sceneMoonOnlySunLighting,!0),new a.GroupProperty([],"SkyBox","SkyBox"),new a.BooleanProperty([this,"sceneSkyBoxShow"]),new a.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new a.GroupProperty([],"Background","Background"),new a.BooleanProperty([this,"xbsjUseBackground"]),new a.StringProperty([this,"xbsjBackgroundImageUri"]),new a.ColorProperty([this,"xbsjBackgroundColor"]),new a.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new a.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new a.ColorProperty([this,"sceneBackgroundColor"]),new a.GroupProperty([],"Fog","Fog"),new a.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",n.sceneFogEnabled,!0),new a.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",n.sceneFogDensity,!0),new a.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",n.sceneFogScreenSpaceErrorFactor,!0),new a.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",n.sceneFogMinimumBrightness,!0),new a.GroupProperty([],"Sscc","Sscc"),new a.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",n.sceneSsccEnableInputs,!0),new a.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",n.sceneSsccEnableCollisionDetection,!0),new a.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",n.sceneSsccZoomFactor,!0),new a.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new a.GroupProperty([],"后处理","后处理"),new a.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new a.GroupProperty([],"环境遮蔽","环境遮蔽"),new a.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new a.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new a.GroupProperty([],"Bloom","Bloom"),new a.BooleanProperty([this,"scenePpsBloomEnabled"]),new a.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new a.NumberProperty([this,"scenePpsBloomContrast"]),new a.NumberProperty([this,"scenePpsBloomBrightness"]),new a.NumberProperty([this,"scenePpsBloomDelta"]),new a.NumberProperty([this,"scenePpsBloomSigma"]),new a.NumberProperty([this,"scenePpsBloomStepSize"]),new a.GroupProperty([],"调试","调试"),new a.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",n.sceneDebugShowFramesPerSecond,!0),new a.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",n.sceneDebugShowCommands,!0),new a.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",n.sceneDebugShowFrustums,!0),new a.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",n.sceneDebugShowFrustumPlanes,!0),new a.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",n.sceneDebugShowDepthFrustum,!0),new a.GroupProperty([],"Inspector","Inspector"),new a.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",n.showCesiumInspector,!0),new a.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",n.cesiumInspectorWireframe,!0),new a.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",n.showCesium3DTilesInspector,!0)]}}};m(at,"type",at.register("ESCesiumViewer",at)),m(at,"getCesiumIonToken",$4),m(at,"currentDefaultAccessToken",h.Ion.defaultAccessToken),m(at,"latestDefaultAccessToken"),m(at,"ObjectsToExcludeWrapper",SF),m(at,"defaults",{...a.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyRectangle:[-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966].map(e=>180*e/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:h.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mz.jpg")},xbsjLocalBoxSources:{positiveX:"${earthsdk3-assets-script-dir}/assets/img/skybox/east.jpg",negativeX:"${earthsdk3-assets-script-dir}/assets/img/skybox/west.jpg",positiveY:"${earthsdk3-assets-script-dir}/assets/img/skybox/bottom.jpg",negativeY:"${earthsdk3-assets-script-dir}/assets/img/skybox/top.jpg",positiveZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/north.jpg",negativeZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/south.jpg"},sceneFogEnabled:!0,sceneFogDensity:2e-4,sceneFogScreenSpaceErrorFactor:2,sceneFogMinimumBrightness:.03,sceneSsccEnableInputs:!0,sceneSsccEnableCollisionDetection:!0,sceneSsccZoomFactor:5,scenePpsfxaaEnabled:!0,sceneDebugShowFramesPerSecond:!1,sceneDebugShowCommands:!1,sceneDebugShowFrustums:!1,sceneDebugShowFrustumPlanes:!1,sceneDebugShowDepthFrustum:1,showCesiumInspector:!1,cesiumInspectorWireframe:!1,showCesium3DTilesInspector:!1,particleGlobalControl:!1}),m(at,"getHeightsScartchCarto",new h.Cartographic);let Re=at;(t=>{t.createDefaultProps=()=>({...a.ESViewer.createDefaultProps(),...W4()})})(Re||(Re={})),a.extendClassProps(Re.prototype,Re.createDefaultProps),M.copyright=void 0;try{const t="earthsdk3-cesium",i="3.6.0-beta.119",e="2025-11-04T07:08:24.000Z",n="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="f414a145e6204a2d8a0b511ec4636c035d8718a6",l=((Date.now()-1762240104e3)/36e5).toFixed(1),c=`%c🌏 ${t}%c ${i}.${s.slice(0,8)}.${e} (距今${l}个小时)
2294
+ `;console.log(e);const n=window.prompt(e,t);n&&window.open(n,"_blank")}const at=class at extends a.ESViewer{constructor(e){super(e);m(this,"_disabledInputStack",this.disposeVar(a.react(0)));m(this,"_viewer",this.dv(a.react(void 0)));m(this,"_viewerInstance");m(this,"_viewerLegend");m(this,"pickCustomAttachedInfo");m(this,"_fps",this.dv(a.react(0)));m(this,"_notSupportEditingCount",this.disposeVar(a.react(0)));m(this,"_editingSystem",Wh);m(this,"_moveObjectsProcess",this.ad(bC()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new _F(this)),this.ad(new PF(this)),this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new xF(this)})),this._viewerLegend=this.dv(new V4(this)),this._viewerInstance=this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Rg(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=te([1,1,1,1]))}));const n=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new a.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new SL(this.subContainer,this,o=>this._viewer.value=o,n.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&et(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,n,o){if(!this.extensions)return;const{pickingManager:s}=this.extensions;return await s.pick(e,void 0,n)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:n}=this;if(!n)return;const o=h.Cartographic.fromDegrees(e[0],e[1],e[2],at.getHeightsScartchCarto);return n.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Ht(e),rotation:Ko(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:n}=this.viewer;if(!n||!e)return;const o=h.Cartesian3.fromDegrees(...e),s=h.Transforms.eastNorthUpToFixedFrame(o),r=h.Matrix4.inverse(s,new h.Matrix4),l=h.Matrix4.multiplyByPoint(r,n.positionWC,new h.Cartesian3),c=h.Cartesian3.magnitude(l);let u=-Math.asin(l.z/c);u=h.Math.toDegrees(u);let d=h.Math.PI_OVER_TWO-Math.atan(l.y/l.x);l.x>0&&(d+=l.y<0?-h.Math.PI:h.Math.PI),d=h.Math.toDegrees(d);const p=Ko(n),f=p[0]-d,g=p[1]-u;return{distance:c,heading:d,pitch:u,flyDuration:1,hDelta:f,pDelta:g}}flyIn(e,n,o,s="default"){var c;if(!n)return;const r={position:e,rotation:n,duration:(o??1)*1e3},l=(c=this.viewer)==null?void 0:c.camera;return l&&Er(l,r,s)}flyTo(e,n,o="default"){var g;const{distance:s,heading:r,pitch:l,flyDuration:c,hDelta:u,pDelta:d}=e,p={position:n,viewDistance:s,rotation:[r,l,0],duration:c*1e3,hdelta:u,pdelta:d},f=(g=this.viewer)==null?void 0:g.camera;return f&&Er(f,p,o)}flyToBoundingSphere(e,n,o=1){var p;const s=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],r=a.getGeoBoundingSphereFromPositions(s);if(!r)return;const{center:l,radius:c}=r,u={position:l,viewDistance:n??c,rotation:[0,-90,0],duration:o*1e3},d=(p=this.viewer)==null?void 0:p.camera;return d&&Er(d,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Ht(e),rotation:Ko(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,n=4.2,o=1.6){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToWalk(e,n,o),this._navigationMode.value="Walk"}changeToMap(){var e,n;(n=(e=this._viewerInstance)==null?void 0:e.obj)==null||n.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,n,o){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToRotateGlobe(e,n,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,n,o,s,r,l){var c,u;(u=(c=this._viewerInstance)==null?void 0:c.obj)==null||u.navigationManager.changeToLine(e,n,o,s,r,l),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToRotatePoint(e,n,o,s,r),this._navigationMode.value="RotatePoint"}changeToFollow(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToFollow(e,n,o,s,r),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=window.g_XE3CopyRights??{};return e.cesium={version:h.VERSION},e}async getHeightByLonLat(e,n,o){if(!this.viewer)return null;const s=h.Cartographic.fromDegrees(e,n,void 0,at.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(s)??null}async getHeightsByLonLats(e,n){const o=e.map(r=>this.getHeightByLonLat(...r));return await Promise.all(o)}async capture(e,n){if(this.viewer)return await Pm(this.viewer.scene,e,n)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(Ie(e));if(n)return[n.x,n.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,n,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const s=e.components.main??e;s&&n!=null&&(s.editingID=`${o.callSource}_${a.createGuid()}`,this._editingSystem.create(this,s,n,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const n=[],o=a.createGuid();for(let s=0;s<e.length;s++){const r=e[s],l=r.components.main??r;l.editingID=o,l&&n.push(l)}this._moveObjectsProcess.restart(void 0,this,n,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=at.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!at.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=at.latestDefaultAccessToken}positionsToLocalPositions(e,n){return Dt(e,n)}localPositionsToPositions(e,n){return yn(e,n)}isPointVisible(e){if(!this.viewer)return!1;const n=e instanceof h.Cartesian3?e:Ie(e),o=new h.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(n))return!1;const s=this.viewer.scene.cartesianToCanvasCoordinates(n);return!(!s||s.x<0||s.y<0)}getESProperties(){const e={...super.getESProperties()},n=at.defaults;return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",$4,H4,!0),new a.FunctionProperty([],()=>at.getCesiumIonToken(),[],"获取官方token"),new a.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new a.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new a.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new a.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new a.GroupProperty([],"Viewer","Viewer"),new a.NumberProperty([this,"resolutionScale"],"分辨率比率",n.resolutionScale,!0),new a.NumberProperty([this,"msaaSamples"],"msaaSamples",n.msaaSamples,!0),new a.BooleanProperty([this,"shadows"]),new a.GroupProperty([],"比例尺","比例尺(Legend)"),new a.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new a.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new a.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new a.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new a.GroupProperty([],"场景","场景(Scene)"),new a.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new a.GroupProperty([],"Globe","Globe"),new a.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",n.sceneGlobeShadows,!0),new a.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new a.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new a.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new a.BooleanProperty([this,"sceneGlobeShowSkirts"]),new a.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new a.ColorProperty([this,"sceneGlobeBaseColor"]),new a.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new a.JsonProperty([this,"sceneGlobeClippingPlanes"]),new a.StringProperty([this,"sceneGlobeClippingPlanesId"]),new a.JsonProperty([this,"sceneGlobeClippingPolygons"]),new a.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new a.GroupProperty([],"underground","underground"),new a.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new a.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new a.GroupProperty([],"Translucency","Translucency"),new a.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",n.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",n.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",n.sceneGlobeTranslucencyRectangle,!0),new a.GroupProperty([],"Sun","Sun"),new a.BooleanProperty([this,"sun"],"sun",n.sun,!0),new a.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new a.GroupProperty([],"Moon","Moon"),new a.BooleanProperty([this,"moon"],"moon",n.moon,!0),new a.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",n.sceneMoonTextureUrl,!0),new a.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",n.sceneMoonOnlySunLighting,!0),new a.GroupProperty([],"SkyBox","SkyBox"),new a.BooleanProperty([this,"sceneSkyBoxShow"]),new a.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new a.GroupProperty([],"Background","Background"),new a.BooleanProperty([this,"xbsjUseBackground"]),new a.StringProperty([this,"xbsjBackgroundImageUri"]),new a.ColorProperty([this,"xbsjBackgroundColor"]),new a.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new a.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new a.ColorProperty([this,"sceneBackgroundColor"]),new a.GroupProperty([],"Fog","Fog"),new a.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",n.sceneFogEnabled,!0),new a.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",n.sceneFogDensity,!0),new a.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",n.sceneFogScreenSpaceErrorFactor,!0),new a.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",n.sceneFogMinimumBrightness,!0),new a.GroupProperty([],"Sscc","Sscc"),new a.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",n.sceneSsccEnableInputs,!0),new a.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",n.sceneSsccEnableCollisionDetection,!0),new a.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",n.sceneSsccZoomFactor,!0),new a.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new a.GroupProperty([],"后处理","后处理"),new a.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new a.GroupProperty([],"环境遮蔽","环境遮蔽"),new a.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new a.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new a.GroupProperty([],"Bloom","Bloom"),new a.BooleanProperty([this,"scenePpsBloomEnabled"]),new a.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new a.NumberProperty([this,"scenePpsBloomContrast"]),new a.NumberProperty([this,"scenePpsBloomBrightness"]),new a.NumberProperty([this,"scenePpsBloomDelta"]),new a.NumberProperty([this,"scenePpsBloomSigma"]),new a.NumberProperty([this,"scenePpsBloomStepSize"]),new a.GroupProperty([],"调试","调试"),new a.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",n.sceneDebugShowFramesPerSecond,!0),new a.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",n.sceneDebugShowCommands,!0),new a.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",n.sceneDebugShowFrustums,!0),new a.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",n.sceneDebugShowFrustumPlanes,!0),new a.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",n.sceneDebugShowDepthFrustum,!0),new a.GroupProperty([],"Inspector","Inspector"),new a.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",n.showCesiumInspector,!0),new a.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",n.cesiumInspectorWireframe,!0),new a.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",n.showCesium3DTilesInspector,!0)]}}};m(at,"type",at.register("ESCesiumViewer",at)),m(at,"getCesiumIonToken",q4),m(at,"currentDefaultAccessToken",h.Ion.defaultAccessToken),m(at,"latestDefaultAccessToken"),m(at,"ObjectsToExcludeWrapper",EF),m(at,"defaults",{...a.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyRectangle:[-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966].map(e=>180*e/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:h.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mz.jpg")},xbsjLocalBoxSources:{positiveX:"${earthsdk3-assets-script-dir}/assets/img/skybox/east.jpg",negativeX:"${earthsdk3-assets-script-dir}/assets/img/skybox/west.jpg",positiveY:"${earthsdk3-assets-script-dir}/assets/img/skybox/bottom.jpg",negativeY:"${earthsdk3-assets-script-dir}/assets/img/skybox/top.jpg",positiveZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/north.jpg",negativeZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/south.jpg"},sceneFogEnabled:!0,sceneFogDensity:2e-4,sceneFogScreenSpaceErrorFactor:2,sceneFogMinimumBrightness:.03,sceneSsccEnableInputs:!0,sceneSsccEnableCollisionDetection:!0,sceneSsccZoomFactor:5,scenePpsfxaaEnabled:!0,sceneDebugShowFramesPerSecond:!1,sceneDebugShowCommands:!1,sceneDebugShowFrustums:!1,sceneDebugShowFrustumPlanes:!1,sceneDebugShowDepthFrustum:1,showCesiumInspector:!1,cesiumInspectorWireframe:!1,showCesium3DTilesInspector:!1,particleGlobalControl:!1}),m(at,"getHeightsScartchCarto",new h.Cartographic);let Re=at;(t=>{t.createDefaultProps=()=>({...a.ESViewer.createDefaultProps(),...G4()})})(Re||(Re={})),a.extendClassProps(Re.prototype,Re.createDefaultProps),M.copyright=void 0;try{const t="earthsdk3-cesium",i="3.6.0-beta.121",e="2025-11-05T02:39:09.000Z",n="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="f37d1422a6b0b8a0489d1bcf153ee59a0a39c2d5",l=((Date.now()-1762310349e3)/36e5).toFixed(1),c=`%c🌏 ${t}%c ${i}.${s.slice(0,8)}.${e} (距今${l}个小时)
2295
2295
  %c${o?o+`
2296
2296
  `:""}当前网站正在使用${t},此软件版权归${n}所有
2297
- `;M.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","f414a145e6204a2d8a0b511ec4636c035d8718a6")},get info(){return c},get date(){return"2025-11-04T07:08:24.000Z"},get author(){return"suplyang"},get version(){return"3.6.0-beta.119"},get name(){return"earthsdk3-cesium"},get commitId(){return"f414a145e6204a2d8a0b511ec4636c035d8718a6"},print(){console.info(this.info,`
2297
+ `;M.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","f37d1422a6b0b8a0489d1bcf153ee59a0a39c2d5")},get info(){return c},get date(){return"2025-11-05T02:39:09.000Z"},get author(){return"suplyang"},get version(){return"3.6.0-beta.121"},get name(){return"earthsdk3-cesium"},get commitId(){return"f37d1422a6b0b8a0489d1bcf153ee59a0a39c2d5"},print(){console.info(this.info,`
2298
2298
  font-size: 18px;
2299
2299
  font-weight: 1000;
2300
2300
  line-height: 1;
@@ -2311,4 +2311,4 @@ async function initCesiumViewer(container, czmViewer) {
2311
2311
  color: rgb(0, 120, 215);
2312
2312
  padding-bottom: 2px;
2313
2313
  padding-left: 35px;
2314
- `)}}),window.g_XE3CopyRights=window.g_XE3CopyRights||{},window.g_XE3CopyRights[t]=M.copyright,window.g_earthsdk_copyright_print=window.g_earthsdk_copyright_print??!0,window.g_earthsdk_copyright_print&&M.copyright.print()}catch{}y_(),M.BaseEditingWrapper=Pt,M.CircularAppendEditing=vC,M.CircularAppendEditingWrapper=dg,M.CircularInsertEditing=wC,M.CircularInsertEditingWrapper=pg,M.CurrentPositionsCenter=vu,M.CurrentScale=mu,M.CurrentSceneScalePoi=ym,M.CursorFloatDiv=DP,M.CursorInfo=RP,M.Czm3DTiles=be,M.CzmCameraChanged=gc,M.CzmCanvasAndDivSwitchPoi=zP,M.CzmCanvasPoi=Ru,M.CzmCircle=po,M.CzmCircleGroundPrimitive=xn,M.CzmCircleOutlinePrimitive=An,M.CzmCirclePrimitive=En,M.CzmClippingPlanes=Is,M.CzmClock=le,M.CzmCustomPrimitive=ze,M.CzmDivPoi=Fu,M.CzmES3DTileset=Ds,M.CzmESAlarm=Vd,M.CzmESApertureEffect=Ud,M.CzmESAreaMeasurement=Wd,M.CzmESBlastParticleSystem=Gd,M.CzmESBoxClipping=Hd,M.CzmESCameraView=$d,M.CzmESCameraVisibleRange=qd,M.CzmESCar=Xd,M.CzmESCityBasePoint=Zd,M.CzmESClassification=Qd,M.CzmESClippingPlane=Od,M.CzmESCustomPrimitive=Wp,M.CzmESCzml=kd,M.CzmESDataMesh=Kd,M.CzmESDirectionMeasurement=Jd,M.CzmESDistanceMeasurement=jd,M.CzmESDynamicWater=Gp,M.CzmESEntityCluster=Hp,M.CzmESExcavate=ep,M.CzmESFireParticleSystem=tp,M.CzmESGeHistoryImagery=$p,M.CzmESGeoBezierPath=np,M.CzmESGeoDiv=op,M.CzmESGeoDivTextPoi=sp,M.CzmESGeoExtrudedPolygon=Qf,M.CzmESGeoJson=rp,M.CzmESGeoLineString=Os,M.CzmESGeoPoints=ng,M.CzmESGeoPolygon=Yt,M.CzmESGeoPolygonImpl=Mi,M.CzmESGeoRectangle=ap,M.CzmESGeoSmoothPolygon=lp,M.CzmESGeoVector=yt,M.CzmESGeoWater=qp,M.CzmESGltfModel=cp,M.CzmESHeatMap=ig,M.CzmESHeightMeasurement=hp,M.CzmESHuman=dp,M.CzmESHumanPoi=kf,M.CzmESImageLabel=pp,M.CzmESImageryLayer=fp,M.CzmESKml=Tp,M.CzmESLabel=Hr,M.CzmESLocalCircle=Mp,M.CzmESLocalLineString=Ip,M.CzmESLocalLineStringZ=Dp,M.CzmESLocalPolygon=Rp,M.CzmESLocalPolygonZ=Fp,M.CzmESLocalRectangle=zp,M.CzmESLocalSkyBox=gp,M.CzmESLocalVector=dh,M.CzmESLocationMeasurement=mp,M.CzmESMVTLayer=Xp,M.CzmESMsTileset=jf,M.CzmESNavigator=Lp,M.CzmESObjectWithLocation=me,M.CzmESParticleSystemPrimitive=vp,M.CzmESPath=Op,M.CzmESPipeFence=Yp,M.CzmESPipeline=Zp,M.CzmESPipeserTileset=kp,M.CzmESPit=Kp,M.CzmESPoi2D=yp,M.CzmESPoi3D=wp,M.CzmESPolygonFence=Np,M.CzmESPolygonFlattenedPlane=Bd,M.CzmESPolygonWithHole=Jp,M.CzmESRectangle=Bp,M.CzmESRoad=Vp,M.CzmESRtsFeatureEditing=Jf,M.CzmESRtsTileset=Kf,M.CzmESScale=Up,M.CzmESSignalTransmission=cf,M.CzmESSkylineAnalysis=tg,M.CzmESStaticMesh=eg,M.CzmESSubmergingAnalysis=Cp,M.CzmESSunshineAnalysis=Gf,M.CzmESSurfaceAreaMeasurement=$f,M.CzmESTerrainLayer=_p,M.CzmESTextLabel=Pp,M.CzmESUEWidget=bp,M.CzmESUnrealActor=Sp,M.CzmESVideoFusion=Ep,M.CzmESViewShed=xp,M.CzmESViewerStatusBar=qf,M.CzmESViewerStatusBarScale=Xf,M.CzmESVisibilityAnalysis=Yf,M.CzmESVisualObject=jt,M.CzmESVolumeMeasurement=Zf,M.CzmESWidget=Ap,M.CzmFlattenedPlane=Nn,M.CzmGlobeMaterial=_o,M.CzmImageModel=qi,M.CzmImagery=Ln,M.CzmModelPrimitive=lt,M.CzmParticleSystemPrimitive=bi,M.CzmPicking=mm,M.CzmPoint=ti,M.CzmPointPrimitiveCollection=go,M.CzmPoisContext=Dm,M.CzmPolygon=ss,M.CzmPolygonClipping=Ns,M.CzmPolygonGroundPrimitive=os,M.CzmPolygonGroundPrimitiveWithHeight=hs,M.CzmPolygonPrimitive=Cn,M.CzmPolygonPrimitiveWithHeight=bn,M.CzmPolygonWithHeight=Sn,M.CzmPolyline=Se,M.CzmPolylineGroundPrimitive=ls,M.CzmPolylinePrimitive=cs,M.CzmPolylines=pi,M.CzmPolylinesGroundPrimitive=ns,M.CzmPolylinesPrimitive=Xt,M.CzmRectangle=Si,M.CzmSignalTransmission=Bn,M.CzmTexture=Be,M.CzmView=Ft,M.CzmViewDistanceRangeControl=jn,M.CzmWater=fo,M.CzmWaterPrimitive=Mr,M.DoublePointsAppendEditing=ir,M.DoublePointsAppendEditingWrapper=hg,M.DoublePointsModifyEditing=Bo,M.DoublePointsModifyEditingWrapper=ug,M.ESCesiumViewer=Re,M.ESCustomPrimitive=yh,M.ESGeHistoryImagery=gh,M.ESGeoBezierPath=_h,M.ESGeoSmoothPolygon=Yr,M.ESKml=mh,M.ESLocalLineString=vh,M.ESLocalLineStringZ=Xr,M.ESMVTLayer=fh,M.ESRoad=Ch,M.ESSignalTransmission=wh,M.GeoCanvasImagePoi=_i,M.GeoCanvasMenuPoi=rs,M.GeoCanvasPoi=$i,M.GeoCanvasPointPoi=_n,M.GeoCustomDivPoi=He,M.GeoDivSwitchPoi=ho,M.GeoDivTextPoi=Pi,M.GeoPolylinePath=Bs,M.HeightModifyEditing=PC,M.HeightModifyEditingWrapper=Cg,M.ImageLabel2D=Ly,M.ImageLabel3D=Oy,M.ImageriesManager=UC,M.LabelManager=VC,M.LineStringAppendEditing=mC,M.LineStringAppendEditingWrapper=fg,M.LineStringInsertEditing=yC,M.LineStringInsertEditingWrapper=gg,M.PickingManager=WC,M.PlaceEditing=Ni,M.PlaceEditingWrapper=ag,M.PolylinePath=Ms,M.ResourceHandler=is,M.RotationEditing=yi,M.RotationEditingWrapper=lg,M.ScaleEditing=sn,M.ScaleEditingWrapper=cg,M.ScatterAppendEditing=CC,M.ScatterAppendEditingWrapper=mg,M.ScatterModifyEditing=_C,M.ScatterModifyEditingWrapper=vg,M.ScreenManager=$C,M.SharedTexturePool=Mm,M.SmoothMoving=vm,M.TerrainManager=BC,M.TextLabel2D=By,M.TextLabel3D=Vy,M.ToGCJ02WebMercatorTilingScheme=ey,M.ToWGS84WebMercatorTilingScheme=ty,M.TranslationEditing=on,M.TranslationEditingWrapper=Uh,M.ViewerExtensions=qC,M.VisibilityAppendEditing=nr,M.VisibilityAppendEditingWrapper=yg,M.VisibilityModifyEditing=or,M.VisibilityModifyEditingWrapper=wg,M.Widget2D=Pn,M.Widget3D=Mc,M.WinPosFromCartesian=vc,M.XbsjGroundPolylinePrimitive=Ti,M._ESEditModeInstance=Wh,M.angleToHumanStr=br,M.areaToHumanStr=z1,M.bindNorthRotation=Je,M.capture=Pm,M.checkAndConvertImage=F1,M.computeCutPoint=uC,M.computeCzmModelMatrix=Fe,M.computePickingInfoWithCoordinates=ou,M.createClippingPlaneCollection=wr,M.createClippingPolygonCollection=pc,M.createGeoBoudingSphereReactFromPositions=_m,M.createHelperLine=G_,M.createInfoPoi=Eu,M.createInnerClassFromJson=_u,M.createInnerHtmlWithWhiteTextBlackBackground=ao,M.createMaterialFromJson=Zg,M.createMaterialRef=di,M.createMoveObjectsProcessing=bC,M.createPolygonHierarchy=Gi,M.createTexture=so,M.createTextureFromImage=Iu,M.createTilingSchema=wi,M.czmEllipsoidWGS84=xm,M.czmFlyTo=Er,M.czmModelActiveAnimationsWithVisible=_c,M.czmSubscribeAndEvaluate=Ci,M.defaultFlyToRotation=ei,M.distanceToHumanStr=bc,M.extendComponentProps=L1,M.flyTo=ne,M.flyWithPosition=qt,M.flyWithPositions=oe,M.flyWithPrimitive=Rt,M.fromCartesian=C_,M.fromCartesian2=Og,M.fromCartesian3=vr,M.fromCartesian4=Ng,M.fromCartographic=Jn,M.fromColor=P_,M.fromDistanceDisplayCondition=E_,M.fromEllipsoid=F_,M.fromHeadingPitchRoll=S_,M.fromNearFarScalar=b_,M.fromQuaternion=A_,M.fromRectangle=D_,M.generateCartesianArc=am,M.geoNeareastPointOnRhumbLine=eo,M.geoNeareastPointOnRhumbLine2=H_,M.geoPolylineToBezierSpline=xu,M.getCameraPosition=Ht,M.getCameraRotation=Ko,M.getCameraTargetPos=Wg,M.getCenterAndViewDistance=Au,M.getCzmCode=M1,M.getDefaultComponentProps=O1,M.getDefaultWinPosAndDepth=K_,M.getDetailedTerrainDistance=Em,M.getDirectionVectorFromRotation=Jg,M.getDistancesAndTimePosRotsFromPositions=pu,M.getElevationMatrix=V4,M.getEllipsoidGeodesicCenter=lu,M.getFlyToCenterAndRotation=Sc,M.getFoveatedInterpolationCallback=dy,M.getFuncFromStr=Pu,M.getGroundTerrainDistance=Sm,M.getGroundTerrainDistances=bm,M.getIncludedAngleFromPositions=um,M.getInverseModelMatrix=cm,M.getMinMaxPosition=Cm,M.getModelMatrixFromPosition=fu,M.getObjectProperties=lo,M.getPointerEventButton=Hi,M.getPolygonPointsFromHierarchy=gu,M.getQuaternion=eu,M.getQuaternionWithXForwardZUp=Vg,M.getQuaternionWithYForwardZUp=fc,M.getResource=$t,M.getSceneScaleForScreenPixelSize=Wi,M.getSharedTexturePool=Im,M.getTilingSchemeStr=$E,M.getViewerExtensions=et,M.getWinPos=Kg,M.getXbsjWaterMaterial=pm,M.hackCesium3DTileset=c_,M.hackCzmModel3DTileContent=h_,M.hackModel=l_,M.hackModelSceneGraph=u_,M.imgUrlToBase64=co,M.localPositionToPosition=vn,M.localPositionsToPositions=yn,M.merge3dTilesServer=P1,M.pickHeightPosition=mc,M.pickPosition=Xg,M.pickVirtualEarth=Jo,M.pickVirtualPlane=Yg,M.positionAndRotationToQuaternion=I_,M.positionFromCartesian=se,M.positionToCartesian=Ie,M.positionToHumanStr=bu,M.positionToLocalPosition=hm,M.positionsToLocalPositions=Dt,M.positionsToUniqueCartesians=pt,M.rectangleIsGlobal=Cu,M.rpToap=Pc,M.setClippingPlaneCollection=dc,M.setCylinderGeometry=Su,M.setModelMaterial=Pr,M.setRectangleGeometry=wm,M.setViewerExtensions=Ag,M.toCartesian=ui,M.toCartesian2=Pe,M.toCartesian3=hi,M.toCartesian4=jh,M.toCartographic=__,M.toCoefficients=wu,M.toColor=te,M.toDistanceDisplayCondition=yr,M.toEllipsoid=we,M.toHeadingPitchRoll=Bg,M.toNearFarScalar=dn,M.toQuaternion=x_,M.toRectangle=Ue,M.toRgbaString=wn,M.updateEnvironmentMapManager=yu,M.updateMaterialFromJson=au,M.waterType=Ec,M.winPosAndDepthEqual=kg,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});
2314
+ `)}}),window.g_XE3CopyRights=window.g_XE3CopyRights||{},window.g_XE3CopyRights[t]=M.copyright,window.g_earthsdk_copyright_print=window.g_earthsdk_copyright_print??!0,window.g_earthsdk_copyright_print&&M.copyright.print()}catch{}y_(),M.BaseEditingWrapper=Pt,M.CircularAppendEditing=vC,M.CircularAppendEditingWrapper=dg,M.CircularInsertEditing=wC,M.CircularInsertEditingWrapper=pg,M.CurrentPositionsCenter=vu,M.CurrentScale=mu,M.CurrentSceneScalePoi=ym,M.CursorFloatDiv=DP,M.CursorInfo=RP,M.Czm3DTiles=be,M.CzmCameraChanged=gc,M.CzmCanvasAndDivSwitchPoi=zP,M.CzmCanvasPoi=Ru,M.CzmCircle=po,M.CzmCircleGroundPrimitive=xn,M.CzmCircleOutlinePrimitive=An,M.CzmCirclePrimitive=En,M.CzmClippingPlanes=Is,M.CzmClock=le,M.CzmCustomPrimitive=ze,M.CzmDivPoi=Fu,M.CzmES3DTileset=Ds,M.CzmESAlarm=Vd,M.CzmESApertureEffect=Ud,M.CzmESAreaMeasurement=Wd,M.CzmESBlastParticleSystem=Gd,M.CzmESBoxClipping=Hd,M.CzmESCameraView=$d,M.CzmESCameraVisibleRange=qd,M.CzmESCar=Xd,M.CzmESCityBasePoint=Zd,M.CzmESClassification=Qd,M.CzmESClippingPlane=Od,M.CzmESCustomPrimitive=Wp,M.CzmESCzml=kd,M.CzmESDataMesh=Kd,M.CzmESDirectionMeasurement=Jd,M.CzmESDistanceMeasurement=jd,M.CzmESDynamicWater=Gp,M.CzmESEntityCluster=Hp,M.CzmESExcavate=ep,M.CzmESFireParticleSystem=tp,M.CzmESGeHistoryImagery=$p,M.CzmESGeoBezierPath=np,M.CzmESGeoDiv=op,M.CzmESGeoDivTextPoi=sp,M.CzmESGeoExtrudedPolygon=Qf,M.CzmESGeoJson=rp,M.CzmESGeoLineString=Os,M.CzmESGeoPoints=ng,M.CzmESGeoPolygon=Yt,M.CzmESGeoPolygonImpl=Mi,M.CzmESGeoRectangle=ap,M.CzmESGeoSmoothPolygon=lp,M.CzmESGeoVector=yt,M.CzmESGeoWater=qp,M.CzmESGltfModel=cp,M.CzmESHeatMap=ig,M.CzmESHeightMeasurement=hp,M.CzmESHuman=dp,M.CzmESHumanPoi=kf,M.CzmESImageLabel=pp,M.CzmESImageryLayer=fp,M.CzmESKml=Tp,M.CzmESLabel=Hr,M.CzmESLocalCircle=Mp,M.CzmESLocalLineString=Ip,M.CzmESLocalLineStringZ=Dp,M.CzmESLocalPolygon=Rp,M.CzmESLocalPolygonZ=Fp,M.CzmESLocalRectangle=zp,M.CzmESLocalSkyBox=gp,M.CzmESLocalVector=dh,M.CzmESLocationMeasurement=mp,M.CzmESMVTLayer=Xp,M.CzmESMsTileset=jf,M.CzmESNavigator=Lp,M.CzmESObjectWithLocation=me,M.CzmESParticleSystemPrimitive=vp,M.CzmESPath=Op,M.CzmESPipeFence=Yp,M.CzmESPipeline=Zp,M.CzmESPipeserTileset=kp,M.CzmESPit=Kp,M.CzmESPoi2D=yp,M.CzmESPoi3D=wp,M.CzmESPolygonFence=Np,M.CzmESPolygonFlattenedPlane=Bd,M.CzmESPolygonWithHole=Jp,M.CzmESRectangle=Bp,M.CzmESRoad=Vp,M.CzmESRtsFeatureEditing=Jf,M.CzmESRtsTileset=Kf,M.CzmESScale=Up,M.CzmESSignalTransmission=cf,M.CzmESSkylineAnalysis=tg,M.CzmESStaticMesh=eg,M.CzmESSubmergingAnalysis=Cp,M.CzmESSunshineAnalysis=Gf,M.CzmESSurfaceAreaMeasurement=$f,M.CzmESTerrainLayer=_p,M.CzmESTextLabel=Pp,M.CzmESUEWidget=bp,M.CzmESUnrealActor=Sp,M.CzmESVideoFusion=Ep,M.CzmESViewShed=xp,M.CzmESViewerStatusBar=qf,M.CzmESViewerStatusBarScale=Xf,M.CzmESVisibilityAnalysis=Yf,M.CzmESVisualObject=jt,M.CzmESVolumeMeasurement=Zf,M.CzmESWidget=Ap,M.CzmFlattenedPlane=Nn,M.CzmGlobeMaterial=_o,M.CzmImageModel=qi,M.CzmImagery=Ln,M.CzmModelPrimitive=lt,M.CzmParticleSystemPrimitive=bi,M.CzmPicking=mm,M.CzmPoint=ti,M.CzmPointPrimitiveCollection=go,M.CzmPoisContext=Dm,M.CzmPolygon=ss,M.CzmPolygonClipping=Ns,M.CzmPolygonGroundPrimitive=os,M.CzmPolygonGroundPrimitiveWithHeight=hs,M.CzmPolygonPrimitive=Cn,M.CzmPolygonPrimitiveWithHeight=bn,M.CzmPolygonWithHeight=Sn,M.CzmPolyline=Se,M.CzmPolylineGroundPrimitive=ls,M.CzmPolylinePrimitive=cs,M.CzmPolylines=pi,M.CzmPolylinesGroundPrimitive=ns,M.CzmPolylinesPrimitive=Xt,M.CzmRectangle=Si,M.CzmSignalTransmission=Bn,M.CzmTexture=Be,M.CzmView=Ft,M.CzmViewDistanceRangeControl=jn,M.CzmWater=fo,M.CzmWaterPrimitive=Mr,M.DoublePointsAppendEditing=ir,M.DoublePointsAppendEditingWrapper=hg,M.DoublePointsModifyEditing=Bo,M.DoublePointsModifyEditingWrapper=ug,M.ESCesiumViewer=Re,M.ESCustomPrimitive=yh,M.ESGeHistoryImagery=gh,M.ESGeoBezierPath=_h,M.ESGeoSmoothPolygon=Yr,M.ESKml=mh,M.ESLocalLineString=vh,M.ESLocalLineStringZ=Xr,M.ESMVTLayer=fh,M.ESRoad=Ch,M.ESSignalTransmission=wh,M.GeoCanvasImagePoi=_i,M.GeoCanvasMenuPoi=rs,M.GeoCanvasPoi=$i,M.GeoCanvasPointPoi=_n,M.GeoCustomDivPoi=He,M.GeoDivSwitchPoi=ho,M.GeoDivTextPoi=Pi,M.GeoPolylinePath=Bs,M.HeightModifyEditing=PC,M.HeightModifyEditingWrapper=Cg,M.ImageLabel2D=Ly,M.ImageLabel3D=Oy,M.ImageriesManager=UC,M.LabelManager=VC,M.LineStringAppendEditing=mC,M.LineStringAppendEditingWrapper=fg,M.LineStringInsertEditing=yC,M.LineStringInsertEditingWrapper=gg,M.PickingManager=WC,M.PlaceEditing=Ni,M.PlaceEditingWrapper=ag,M.PolylinePath=Ms,M.ResourceHandler=is,M.RotationEditing=yi,M.RotationEditingWrapper=lg,M.ScaleEditing=sn,M.ScaleEditingWrapper=cg,M.ScatterAppendEditing=CC,M.ScatterAppendEditingWrapper=mg,M.ScatterModifyEditing=_C,M.ScatterModifyEditingWrapper=vg,M.ScreenManager=$C,M.SharedTexturePool=Mm,M.SmoothMoving=vm,M.TerrainManager=BC,M.TextLabel2D=By,M.TextLabel3D=Vy,M.ToGCJ02WebMercatorTilingScheme=ey,M.ToWGS84WebMercatorTilingScheme=ty,M.TranslationEditing=on,M.TranslationEditingWrapper=Uh,M.ViewerExtensions=qC,M.VisibilityAppendEditing=nr,M.VisibilityAppendEditingWrapper=yg,M.VisibilityModifyEditing=or,M.VisibilityModifyEditingWrapper=wg,M.Widget2D=Pn,M.Widget3D=Mc,M.WinPosFromCartesian=vc,M.XbsjGroundPolylinePrimitive=Ti,M._ESEditModeInstance=Wh,M.angleToHumanStr=br,M.areaToHumanStr=z1,M.bindNorthRotation=Je,M.capture=Pm,M.checkAndConvertImage=F1,M.computeCutPoint=uC,M.computeCzmModelMatrix=Fe,M.computePickingInfoWithCoordinates=ou,M.createClippingPlaneCollection=wr,M.createClippingPolygonCollection=pc,M.createGeoBoudingSphereReactFromPositions=_m,M.createHelperLine=G_,M.createInfoPoi=Eu,M.createInnerClassFromJson=_u,M.createInnerHtmlWithWhiteTextBlackBackground=ao,M.createMaterialFromJson=Zg,M.createMaterialRef=di,M.createMoveObjectsProcessing=bC,M.createPolygonHierarchy=Gi,M.createTexture=so,M.createTextureFromImage=Iu,M.createTilingSchema=wi,M.czmEllipsoidWGS84=xm,M.czmFlyTo=Er,M.czmModelActiveAnimationsWithVisible=_c,M.czmSubscribeAndEvaluate=Ci,M.defaultFlyToRotation=ei,M.distanceToHumanStr=bc,M.extendComponentProps=L1,M.flyTo=ne,M.flyWithPosition=qt,M.flyWithPositions=oe,M.flyWithPrimitive=Rt,M.fromCartesian=C_,M.fromCartesian2=Og,M.fromCartesian3=vr,M.fromCartesian4=Ng,M.fromCartographic=Jn,M.fromColor=P_,M.fromDistanceDisplayCondition=E_,M.fromEllipsoid=F_,M.fromHeadingPitchRoll=S_,M.fromNearFarScalar=b_,M.fromQuaternion=A_,M.fromRectangle=D_,M.generateCartesianArc=am,M.geoNeareastPointOnRhumbLine=eo,M.geoNeareastPointOnRhumbLine2=H_,M.geoPolylineToBezierSpline=xu,M.getCameraPosition=Ht,M.getCameraRotation=Ko,M.getCameraTargetPos=Wg,M.getCenterAndViewDistance=Au,M.getCzmCode=M1,M.getDefaultComponentProps=O1,M.getDefaultWinPosAndDepth=K_,M.getDetailedTerrainDistance=Em,M.getDirectionVectorFromRotation=Jg,M.getDistancesAndTimePosRotsFromPositions=pu,M.getElevationMatrix=U4,M.getEllipsoidGeodesicCenter=lu,M.getFlyToCenterAndRotation=Sc,M.getFoveatedInterpolationCallback=dy,M.getFuncFromStr=Pu,M.getGroundTerrainDistance=Sm,M.getGroundTerrainDistances=bm,M.getIncludedAngleFromPositions=um,M.getInverseModelMatrix=cm,M.getMinMaxPosition=Cm,M.getModelMatrixFromPosition=fu,M.getObjectProperties=lo,M.getPointerEventButton=Hi,M.getPolygonPointsFromHierarchy=gu,M.getQuaternion=eu,M.getQuaternionWithXForwardZUp=Vg,M.getQuaternionWithYForwardZUp=fc,M.getResource=$t,M.getSceneScaleForScreenPixelSize=Wi,M.getSharedTexturePool=Im,M.getTilingSchemeStr=$E,M.getViewerExtensions=et,M.getWinPos=Kg,M.getXbsjWaterMaterial=pm,M.hackCesium3DTileset=c_,M.hackCzmModel3DTileContent=h_,M.hackModel=l_,M.hackModelSceneGraph=u_,M.imgUrlToBase64=co,M.localPositionToPosition=vn,M.localPositionsToPositions=yn,M.merge3dTilesServer=P1,M.pickHeightPosition=mc,M.pickPosition=Xg,M.pickVirtualEarth=Jo,M.pickVirtualPlane=Yg,M.positionAndRotationToQuaternion=I_,M.positionFromCartesian=se,M.positionToCartesian=Ie,M.positionToHumanStr=bu,M.positionToLocalPosition=hm,M.positionsToLocalPositions=Dt,M.positionsToUniqueCartesians=pt,M.rectangleIsGlobal=Cu,M.rpToap=Pc,M.setClippingPlaneCollection=dc,M.setCylinderGeometry=Su,M.setModelMaterial=Pr,M.setRectangleGeometry=wm,M.setViewerExtensions=Ag,M.toCartesian=ui,M.toCartesian2=Pe,M.toCartesian3=hi,M.toCartesian4=jh,M.toCartographic=__,M.toCoefficients=wu,M.toColor=te,M.toDistanceDisplayCondition=yr,M.toEllipsoid=we,M.toHeadingPitchRoll=Bg,M.toNearFarScalar=dn,M.toQuaternion=x_,M.toRectangle=Ue,M.toRgbaString=wn,M.updateEnvironmentMapManager=yu,M.updateMaterialFromJson=au,M.waterType=Ec,M.winPosAndDepthEqual=kg,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});