/** * SmartEarth WebSDK - https://websdk.terra-it.cn * Version 5.4.1 */ import{a as N}from"./chunk-7635WVJB.js";import{d as Z}from"./chunk-CLGTNV2A.js";import{b as d,h as U}from"./chunk-RQCJJCAO.js";import{a as D}from"./chunk-7J4RJR4J.js";import{b as a,c as j,d as x,e as b}from"./chunk-UMC5CP2H.js";import{a as E}from"./chunk-72V3KRTJ.js";import{a as R,b as T}from"./chunk-VJ26MOOM.js";import{e as h}from"./chunk-E3YQ3WWZ.js";function z(o,t){T.typeOf.object("ellipsoid",o),this._ellipsoid=o,this._cameraPosition=new a,this._cameraPositionInScaledSpace=new a,this._distanceToLimbInScaledSpaceSquared=0,h(t)&&(this.cameraPosition=t)}Object.defineProperties(z.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,this._cameraPositionInScaledSpace),n=a.magnitudeSquared(e)-1;a.clone(o,this._cameraPosition),this._cameraPositionInScaledSpace=e,this._distanceToLimbInScaledSpaceSquared=n}}});var Q=new a;z.prototype.isPointVisible=function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,Q);return F(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};z.prototype.isScaledSpacePointVisible=function(o){return F(o,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var nt=new a;z.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(o,t){let e=this._ellipsoid,n,i;return h(t)&&t<0&&e.minimumRadius>-t?(i=nt,i.x=this._cameraPosition.x/(e.radii.x+t),i.y=this._cameraPosition.y/(e.radii.y+t),i.z=this._cameraPosition.z/(e.radii.z+t),n=i.x*i.x+i.y*i.y+i.z*i.z-1):(i=this._cameraPositionInScaledSpace,n=this._distanceToLimbInScaledSpaceSquared),F(o,i,n)};z.prototype.computeHorizonCullingPoint=function(o,t,e){return K(this._ellipsoid,o,t,e)};var v=b.clone(b.UNIT_SPHERE);z.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(o,t,e,n){let i=J(this._ellipsoid,e,v);return K(i,o,t,n)};z.prototype.computeHorizonCullingPointFromVertices=function(o,t,e,n,i){return X(this._ellipsoid,o,t,e,n,i)};z.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(o,t,e,n,i,c){let s=J(this._ellipsoid,i,v);return X(s,o,t,e,n,c)};var st=[];z.prototype.computeHorizonCullingPointFromRectangle=function(o,t,e){T.typeOf.object("rectangle",o);let n=U.subsample(o,t,0,st),i=Z.fromPoints(n);if(!(a.magnitude(i.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(i.center,n,e)};var at=new a;function J(o,t,e){if(h(t)&&t<0&&o.minimumRadius>-t){let n=a.fromElements(o.radii.x+t,o.radii.y+t,o.radii.z+t,at);o=b.fromCartesian3(n,e)}return o}function K(o,t,e,n){T.typeOf.object("directionToPoint",t),T.defined("positions",e),h(n)||(n=new a);let i=B(o,t),c=0;for(let s=0,r=e.length;s0:s>i&&s*s/a.magnitudeSquared(c)>i)}var ct=new a,rt=new a;function Y(o,t,e){let n=o.transformPositionToScaledSpace(t,ct),i=a.magnitudeSquared(n),c=Math.sqrt(i),s=a.divideByScalar(n,c,rt);i=Math.max(1,i),c=Math.max(1,c);let r=a.dot(s,e),m=a.magnitude(a.cross(s,e,s)),p=1/c,u=Math.sqrt(i-1)*p;return 1/(r*p-m*u)}function $(o,t,e){if(!(t<=0||t===1/0||t!==t))return a.multiplyByScalar(o,t,e)}var k=new a;function B(o,t){return a.equals(t,a.ZERO)?t:(o.transformPositionToScaledSpace(t,k),a.normalize(k,k))}var xt=z;var G={};G.getHeight=function(o,t,e){if(!Number.isFinite(t))throw new R("scale must be a finite number.");if(!Number.isFinite(e))throw new R("relativeHeight must be a finite number.");return(o-e)*t+e};var mt=new j;G.getPosition=function(o,t,e,n,i){let c=t.cartesianToCartographic(o,mt);if(!h(c))return a.clone(o,i);let s=G.getHeight(c.height,e,n);return a.fromRadians(c.longitude,c.latitude,s,t,i)};var tt=G;var dt={NONE:0,BITS12:1},S=Object.freeze(dt);var _=new a,ht=new a,f=new x,H=new d,lt=new d,pt=Math.pow(2,12);function l(o,t,e,n,i,c,s,r,m,p){let u=S.NONE,y,g;if(h(t)&&h(e)&&h(n)&&h(i)){let C=t.minimum,V=t.maximum,P=a.subtract(V,C,ht),I=n-e;Math.max(a.maximumComponent(P),I)