/** * @license * Cesium - https://github.com/CesiumGS/cesium * Version 1.124 * * Copyright 2011-2022 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Columbus View (Pat. Pend.) * * Portions licensed separately. * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ import{b as _,h as I}from"./chunk-M3A6SPGI.js";import{a as n,b as N,d as Z,e as A}from"./chunk-S4VBGY2U.js";import{a as cn}from"./chunk-UCTPWOTZ.js";import{a as T}from"./chunk-N3A5CZ2S.js";import{a as on,b as h}from"./chunk-G75U3WZT.js";import{e as x}from"./chunk-3THTQ4QB.js";function V(e){this._ellipsoid=T(e,Z.default),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(V.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});V.prototype.project=function(e,t){let o=this._semimajorAxis,c=e.longitude*o,r=e.latitude*o,d=e.height;return x(t)?(t.x=c,t.y=r,t.z=d,t):new n(c,r,d)};V.prototype.unproject=function(e,t){if(!x(e))throw new on("cartesian is required");let o=this._oneOverSemimajorAxis,c=e.x*o,r=e.y*o,d=e.z;return x(t)?(t.longitude=c,t.latitude=r,t.height=d,t):new N(c,r,d)};var k=V;var mn={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},U=Object.freeze(mn);function un(e,t){this.start=T(e,0),this.stop=T(t,0)}var rn=un;function a(e,t){this.center=n.clone(T(e,n.ZERO)),this.radius=T(t,0)}var F=new n,Y=new n,J=new n,K=new n,Q=new n,$=new n,L=new n,b=new n,H=new n,nn=new n,tn=new n,en=new n,xn=4/3*cn.PI;a.fromPoints=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=n.clone(e[0],L),c=n.clone(o,F),r=n.clone(o,Y),d=n.clone(o,J),f=n.clone(o,K),s=n.clone(o,Q),m=n.clone(o,$),z=e.length,y;for(y=1;yf.x&&n.clone(o,f),Ms.y&&n.clone(o,s),wm.z&&n.clone(o,m)}let u=n.magnitudeSquared(n.subtract(f,c,b)),i=n.magnitudeSquared(n.subtract(s,r,b)),v=n.magnitudeSquared(n.subtract(m,d,b)),C=c,q=f,O=u;i>O&&(O=i,C=r,q=s),v>O&&(O=v,C=d,q=m);let p=H;p.x=(C.x+q.x)*.5,p.y=(C.y+q.y)*.5,p.z=(C.z+q.z)*.5;let S=n.magnitudeSquared(n.subtract(q,p,b)),l=Math.sqrt(S),j=nn;j.x=c.x,j.y=r.y,j.z=d.z;let P=tn;P.x=f.x,P.y=s.y,P.z=m.z;let D=n.midpoint(j,P,en),B=0;for(y=0;yB&&(B=R);let M=n.magnitudeSquared(n.subtract(o,p,b));if(M>S){let w=Math.sqrt(M);l=(l+w)*.5,S=l*l;let g=w-l;p.x=(l*p.x+g*o.x)/w,p.y=(l*p.y+g*o.y)/w,p.z=(l*p.z+g*o.z)/w}}return lm.x&&n.clone(r,m),gz.y&&n.clone(r,z),Ey.z&&n.clone(r,y)}let v=n.magnitudeSquared(n.subtract(m,d,b)),C=n.magnitudeSquared(n.subtract(z,f,b)),q=n.magnitudeSquared(n.subtract(y,s,b)),O=d,p=m,S=v;C>S&&(S=C,O=f,p=z),q>S&&(S=q,O=s,p=y);let l=H;l.x=(O.x+p.x)*.5,l.y=(O.y+p.y)*.5,l.z=(O.z+p.z)*.5;let j=n.magnitudeSquared(n.subtract(p,l,b)),P=Math.sqrt(j),D=nn;D.x=d.x,D.y=f.y,D.z=s.z;let B=tn;B.x=m.x,B.y=z.y,B.z=y.z;let R=n.midpoint(D,B,en),M=0;for(i=0;iM&&(M=w);let g=n.magnitudeSquared(n.subtract(r,l,b));if(g>j){let E=Math.sqrt(g);P=(P+E)*.5,j=P*P;let W=E-P;l.x=(P*l.x+W*r.x)/E,l.y=(P*l.y+W*r.y)/E,l.z=(P*l.z+W*r.z)/E}}return Ps.x&&n.clone(c,s),wm.y&&n.clone(c,m),gz.z&&n.clone(c,z)}let i=n.magnitudeSquared(n.subtract(s,r,b)),v=n.magnitudeSquared(n.subtract(m,d,b)),C=n.magnitudeSquared(n.subtract(z,f,b)),q=r,O=s,p=i;v>p&&(p=v,q=d,O=m),C>p&&(p=C,q=f,O=z);let S=H;S.x=(q.x+O.x)*.5,S.y=(q.y+O.y)*.5,S.z=(q.z+O.z)*.5;let l=n.magnitudeSquared(n.subtract(O,S,b)),j=Math.sqrt(l),P=nn;P.x=r.x,P.y=d.y,P.z=f.z;let D=tn;D.x=s.x,D.y=m.y,D.z=z.z;let B=n.midpoint(P,D,en),R=0;for(u=0;uR&&(R=M);let w=n.magnitudeSquared(n.subtract(c,S,b));if(w>l){let g=Math.sqrt(w);j=(j+g)*.5,l=j*j;let E=g-j;S.x=(j*S.x+E*c.x)/g,S.y=(j*S.y+E*c.y)/g,S.z=(j*S.z+E*c.z)/g}}return j=m+f)return e.clone(o),o;if(f>=m+r)return t.clone(o),o;let z=(r+m+f)*.5,y=n.multiplyByScalar(s,(-r+z)/m,jn);return n.add(y,c,y),n.clone(y,o.center),o.radius=z,o};var bn=new n;a.expand=function(e,t,o){h.typeOf.object("sphere",e),h.typeOf.object("point",t),o=a.clone(e,o);let c=n.magnitude(n.subtract(t,o.center,bn));return c>o.radius&&(o.radius=c),o};a.intersectPlane=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("plane",t);let o=e.center,c=e.radius,r=t.normal,d=n.dot(r,o)+t.distance;return d<-c?U.OUTSIDE:d