* 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.
*/
vari=Object.create;varu=Object.defineProperty;varr=Object.getOwnPropertyDescriptor;varl=Object.getOwnPropertyNames;varo=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty;vara=(n=>typeofrequire<"u"?require:typeofProxy<"u"?newProxy(n,{get:(e,d)=>(typeofrequire<"u"?require:e)[d]}):n)(function(n){if(typeofrequire<"u")returnrequire.apply(this,arguments);throwError('Dynamic require of "'+n+'" is not supported')}),b=n=>e=>{vard=n[e];if(d)returnd();thrownewError("Module not found in bundle: "+e)};varg=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);varp=(n,e,d,t)=>{if(e&&typeofe=="object"||typeofe=="function")for(letfofl(e))!c.call(n,f)&&f!==d&&u(n,f,{get:()=>e[f],enumerable:!(t=r(e,f))||t.enumerable});returnn};varh=(n,e,d)=>(d=n!=null?i(o(n)):{},p(e||!n||!n.__esModule?u(d,"default",{value:n,enumerable:!0}):d,n));functionx(n){returnn!=null}vark=x;export{a,b,gasc,hasd,kase};
* 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{aasQ}from"./chunk-ICZXFP3D.js";import{aasz}from"./chunk-ZFTFDHK4.js";import{aas_}from"./chunk-74GQJJ7R.js";import{aasK}from"./chunk-NNHN6WUY.js";import{aasH}from"./chunk-T7ERZ2CJ.js";import{basJ,casW,dasP}from"./chunk-GSNDLQ4C.js";import{dasj}from"./chunk-BKSIEBAA.js";import{aasL}from"./chunk-VTVHUB7E.js";import{aasb,cask}from"./chunk-JMSSU44E.js";import{aasZ}from"./chunk-4UYSGV57.js";import{aasx}from"./chunk-VLPNAR64.js";import{aasF}from"./chunk-GE5NEIZC.js";import{easg}from"./chunk-35CVRQTC.js";varM=newk,ot=newb,nt=newb,it=newb,st=newb;functionO(t){t=x(t,x.EMPTY_OBJECT);letn=t.length,e=t.topRadius,h=t.bottomRadius,o=x(t.vertexFormat,_.DEFAULT),r=x(t.slices,128);if(!g(n))thrownewF("options.length must be defined.");if(!g(e))thrownewF("options.topRadius must be defined.");if(!g(h))thrownewF("options.bottomRadius must be defined.");if(r<3)thrownewF("options.slices must be greater than or equal to 3.");if(g(t.offsetAttribute)&&t.offsetAttribute===z.TOP)thrownewF("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=n,this._topRadius=e,this._bottomRadius=h,this._vertexFormat=_.clone(o),this._slices=r,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderGeometry"}O.packedLength=_.packedLength+5;O.pack=function(t,n,e){if(!g(t))thrownewF("value is required");if(!g(n))thrownewF("array is required");returne=x(e,0),_.pack(t._vertexFormat,n,e),e+=_.packedLength,n[e++]=t._length,n[e++]=t._topRadius,n[e++]=t._bottomRadius,n[e++]=t._slices,n[e]=x(t._offsetAttribute,-1),n};varX=new_,C={vertexFormat:X,length:void0,topRadius:void0,bottomRadius:void0,slices:void0,offsetAttribute:void0};O.unpack=function(t,n,e){if(!g(t))thrownewF("array is required");n=x(n,0);leth=_.unpack(t,n,X);n+=_.packedLength;leto=t[n++],r=t[n++],p=t[n++],D=t[n++],w=t[n];returng(e)?(e._vertexFormat=_.clone(h,e._vertexFormat),e._length=o,e._topRadius=r,e._bottomRadius=p,e._slices=D,e._offsetAttribute=w===-1?void0:w,e):(C.length=o,C.topRadius=r,C.bottomRadius=p,C.slices=D,C.offsetAttribute=w===-1?void0:w,newO(C))};O.createGeometry=function(t){letn=t._length,e=t._topRadius,h=t._bottomRadius,o=t._vertexFormat,r=t._slices;if(n<=0||e<0||h<0||e===0&&h===0)return;letp=r+r,D=r+p,w=p+p,E=Q.computePositions(n,e,h,r,!0),N=o.st?newFloat32Array(w*2):void0,c=o.normal?newFloat32Array(w*3):void0,m=o.tangent?newFloat32Array(w*3):void0,u=o.bitangent?newFloat32Array(w*3):void0,i,U=o.normal||o.tangent||o.bitangent;if(U){letT=o.tangent||o.bitangent,f=0,d=0,l=0,q=Math.atan2(h-e,n),A=ot;A.z=Math.sin(q);letB=Math.cos(q),R=it,y=nt;for(i=0;i<r;i++){letY=i/r*Z.TWO_PI,tt=B*Math.cos(Y),et=B*Math.sin(Y);U&&(A.x=tt,A.y=et,T&&(R=b.normalize(b.cross(b.UNIT_Z,A,R),R)),o.normal&&(c[f++]=A.x,c[f++]=A.y,c[f++]=A.z,c[f++]=A.x,c[f++]=A.y,c[f++]=A.z),o.tangent&&(m[d++]=R.x,m[d++]=R.y,m[d++]=R.z,m[d++]=R.x,m[d++]=R.y,m[d++]=R.z),o.bitangent&&(y=b.normalize(b.cross(A,R,y),y),u[l++]=y.x,u[l++]=y.y,u[l++]=y.z,u[l++]=y.x,u[l++]=y.y,u[l++]=y.z))}for(i=0;i<r;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=-1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=-1,u[l++]=0);for(i=0;i<r;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=1,u[l++]=0)}let$=12*r-12,s=K.createTypedArray(w,$),a=0,v=0;for(i=0;i<r-1;i++)s[a++]=v,s[a++]=v+2,s[a++]=v+3,s[a++]=v,s[a++]=v+3,s[a++]=v+1,v+=2;for(s[a++]=p-2,s[a++]=0,s[a++]=1,s[a++]=p-2,s[a++]=1,s[a++]=p-1,i=1;i<r-1;i++)s[a++]=p+i+1,s[a++]=p+i,s[a++]=p;for(i=1;i<r-1;i++)s[a++]=D,s[a++]=D+i,s[a++]=D+i+1;letV=0;if(o.st){letT=Math.max(e,h);for(i=0;i<w;i++){letf=b.fromArray(E,i*3,st);N[V++]=(f.x+T)/(2*T),N[V++]=(f.y+T)/(2*T)}}letS=newH;o.position&&(S.position=newP({componentDatatype:L.DOUBLE,componentsPerAttribute:3,values:E})),o.normal&&(S.normal=newP({componentDatatype:L.FLOAT,componentsPerAttribute:3,values:c})),o.tangent&&(S.tangent=newP({componentDatatype:L.FLOAT,componentsPerAttribute:3,values:m})),o.bitangent&&(S.bitangent=newP({componentDatatype:L.FLOAT,componentsPerAttribute:3,values:u})),o.st&&(S.st=newP({componentDatatype:L.FLOAT,componentsPerAttribute:2,values:N})),M.x=n*.5,M.y=Math.max(h,e);letI=newj(b.ZERO,k.magnitude(M));if(g(t._offsetAttribute)){n=E.length;letT=t._offsetAttribute===z.NONE?0:1,f=newUint8Array(n/3).fill(T);S.applyOffset=newP({componentDatatype:L.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}returnnewW({attributes:S,indices:s,primitiveType:J.TRIANGLES,boundingSphere:I,offsetAttribute:t._offsetAttribute})};varG;O.getUnitCylinder=function(){returng(G)||(G=O.createGeometry(newO({topRadius:1,bottomRadius:1,length:1,vertexFormat:_.POSITION_ONLY}))),G};varyt=O;export{ytasa};
* 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{aasb}from"./chunk-ZFTFDHK4.js";import{aasu}from"./chunk-74GQJJ7R.js";import{aasO}from"./chunk-T7ERZ2CJ.js";import{basw,cash,dasx}from"./chunk-GSNDLQ4C.js";import{d}from"./chunk-BKSIEBAA.js";import{aasy}from"./chunk-VTVHUB7E.js";import{aasi}from"./chunk-JMSSU44E.js";import{aasp}from"./chunk-VLPNAR64.js";import{aasz,basc}from"./chunk-GE5NEIZC.js";import{easA}from"./chunk-35CVRQTC.js";varD=newi;functionf(r){r=p(r,p.EMPTY_OBJECT);leto=r.minimum,m=r.maximum;if(c.typeOf.object("min",o),c.typeOf.object("max",m),A(r.offsetAttribute)&&r.offsetAttribute===b.TOP)thrownewz("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");leta=p(r.vertexFormat,u.DEFAULT);this._minimum=i.clone(o),this._maximum=i.clone(m),this._vertexFormat=a,this._offsetAttribute=r.offsetAttribute,this._workerName="createBoxGeometry"}f.fromDimensions=function(r){r=p(r,p.EMPTY_OBJECT);leto=r.dimensions;c.typeOf.object("dimensions",o),c.typeOf.number.greaterThanOrEquals("dimensions.x",o.x,0),c.typeOf.number.greaterThanOrEquals("dimensions.y",o.y,0),c.typeOf.number.greaterThanOrEquals("dimensions.z",o.z,0);letm=i.multiplyByScalar(o,.5,newi);returnnewf({minimum:i.negate(m,newi),maximum:m,vertexFormat:r.vertexFormat,offsetAttribute:r.offsetAttribute})};f.fromAxisAlignedBoundingBox=function(r){returnc.typeOf.object("boundingBox",r),newf({minimum:r.minimum,maximum:r.maximum})};f.packedLength=2*i.packedLength+u.packedLength+1;f.pack=function(r,o,m){returnc.typeOf.object("value",r),c.defined("array",o),m=p(m,0),i.pack(r._minimum,o,m),i.pack(r._maximum,o,m+i.packedLength),u.pack(r._vertexFormat,o,m+2*i.packedLength),o[m+2*i.packedLength+u.packedLength]=p(r._offsetAttribute,-1),o};var_=newi,g=newi,k=newu,F={minimum:_,maximum:g,vertexFormat:k,offsetAttribute:void0};f.unpack=function(r,o,m){c.defined("array",r),o=p(o,0);leta=i.unpack(r,o,_),s=i.unpack(r,o+i.packedLength,g),n=u.unpack(r,o+2*i.packedLength,k),e=r[o+2*i.packedLength+u.packedLength];returnA(m)?(m._minimum=i.clone(a,m._minimum),m._maximum=i.clone(s,m._maximum),m._vertexFormat=u.clone(n,m._vertexFormat),m._offsetAttribute=e===-1?void0:e,m):(F.offsetAttribute=e===-1?void0:e,newf(F))};f.createGeometry=function(r){leto=r._minimum,m=r._maximum,a=r._vertexFormat;if(i.equals(o,m))return;lets=newO,n,e;if(a.position&&(a.st||a.normal||a.tangent||a.bitangent)){if(a.position&&(e=newFloat64Array(6*4*3),e[0]=o.x,e[1]=o.y,e[2]=m.z,e[3]=m.x,e[4]=o.y,e[5]=m.z,e[6]=m.x,e[7]=m.y,e[8]=m.z,e[9]=o.x,e[10]=m.y,e[11]=m.z,e[12]=o.x,e[13]=o.y,e[14]=o.z,e[15]=m.x,e[16]=o.y,e[17]=o.z,e[18]=m.x,e[19]=m.y,e[20]=o.z,e[21]=o.x,e[22]=m.y,e[23]=o.z,e[24]=m.x,e[25]=o.y,e[26]=o.z,e[27]=m.x,e[28]=m.y,e[29]=o.z,e[30]=m.x,e[31]=m.y,e[32]=m.z,e[33]=m.x,e[34]=o.y,e[35]=m.z,e[36]=o.x,e[37]=o.y,e[38]=o.z,e[39]=o.x,e[40]=m.y,e[41]=o.z,e[42]=o.x,e[43]=m.y,e[44]=m.z,e[45]=o.x,e[46]=o.y,e[47]=m.z,e[48]=o.x,e[49]=m.y,e[50]=o.z,e[51]=m.x,e[52]=m.y,e[53]=o.z,e[54]=m.x,e[55]=m.y,e[56]=m.z,e[57]=o.x,e[58]=m.y,e[59]=m.z,e[60]=o.x,e[61]=o.y,e[62]=o.z,e[63]=m.x,e[64]=o.y,e[65]=o.z,e[66]=m.x,e[67]=o.y,e[68]=m.z,e[69]=o.x,e[70]=o.y,e[71]=m.z,s.position=newx({componentDatatype:y.DOUBLE,componentsPerAttribute:3,values:e})),a.normal){lett=newFloat32Array(72);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=1,t[9]=0,t[10]=0,t[11]=1,t[12]=0,t[13]=0,t[14]=-1,t[15]=0,t[16]=0,t[17]=-1,t[18]=0,t[19]=0,t[20]=-1,t[21]=0,t[22]=0,t[23]=-1,t[24]=1,t[25]=0,t[26]=0,t[27]=1,t[28]=0,t[29]=0,t[30]=1,t[31]=0,t[32]=0,t[33]=1,t[34]=0,t[35]=0,t[36]=-1,t[37]=0,t[38]=0,t[39]=-1,t[40]=0,t[41]=0,t[42]=-1,t[43]=0,t[44]=0,t[45]=-1,t[46]=0,t[47]=0,t[48]=0,t[49]=1,t[50]=0,t[51]=0,t[52]=1,t[53]=0,t[54]=0,t[55]=1,t[56]=0,t[57]=0,t[58]=1,t[59]=0,t[60]=0,t[61]=-1,t[62]=0,t[63]=0,t[64]=-1,t[65]=0,t[66]=0,t[67]=-1,t[68]=0,t[69]=0,t[70]=-1,t[71]=0,s.normal=newx({componentDatatype:y.FLOAT,componentsPerAttribute:3,values:t})}if(a.st){lett=newFloat32Array(48);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,t[8]=1,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=1,t[14]=1,t[15]=1,t[16]=0,t[17]=0,t[18]=1,t[19]=0,t[20]=1,t[21]=1,t[22]=0,t[23]=1,t[24]=1,t[25]=0,t[26]=0,t[27]=0,t[28]=0,t[29]=1,t[30]=1,t[31]=1,t[32]=1,t[33]=0,t[34]=0,t[35]=0,t[36]=0,t[37]=1,t[38]=1,t[39]=1,t[40]=0,t[41]=0,t[42]=1,t[43]=0,t[44]=1,t[45]=1,t[46]=0,t[47]=1,s.st=newx({componentDatatype:y.FLOAT,componentsPerAttribute:2,values:t})}if(a.tangent){lett=newFloat32Array(72);t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=1,t[10]=0,t[11]=0,t[12]=-1,t[13]=0,t[14]=0,t[15]=-1,t[16]=0,t[17]=0,t[18]=-1,t[19]=0,t[20]=0,t[21]=-1,t[22]=0,t[23]=0,t[24]=0,t[25]=1,t[26]=0,t[27]=0,t[28]=1,t[29]=0,t[30]=0,t[31]=1,t[32]=0,t[33]=0,t[34]=1,t[35]=0,t[36]=0,t[37]=-1,t[38]=0,t[39]=0,t[40]=-1,t[41]=0,t[42]=0,t[43]=-1,t[44]=0,t[45]=0,t[46]=-1,t[47]=0,t[48]=-1,t[49]=0,t[50]=0,t[51]=-1,t[52]=0,t[53]=0,t[54]=-1,t[55]=0,t[56]=0,t[57]=-1,t[58]=0,t[59]=0,t[60]=1,t[61]=0,t[62]=0,t[63]=1,t[64]=0,t[65]=0,t[66]=1,t[67]=0,t[68]=0,t[69]=1,t[70]=0,t[71]=0,s.tangent=newx({componentDatatype:y.FLOAT,componentsPerAttribute:3,values:t})}if(a.bitangent){lett=newFloat32Array(72);t[0]=0,t[1]=1,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=1,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=1,t[14]=0,t[15]=0,t[16]=1,t[17]=0,t[18]=0,t[19]=1,t[20]=0,t[21]=0,t[22]=1,t[23]=0,t[24]=0,t[25]=0,t[26]=1,t[27]=0,t[28]=0,t[29]=1,t[30]=0,t[31]=0,t[32]=1,t[33]=0,t[34]=0,t[35]=1,t[36]=0,t[37]=0,t[38]=1,t[39]=0,t[40]=0,t[41]=1,t[42]=0,t[43]=0,t[44]=1,t[45]=0,t[46]=0,t[47]=1,t[48]=0,t[49]=0,t[50]=1,t[51]=0,t[52]=0,t[53]=1,t[54]=0,t[55]=0,t[56]=1,t[57]=0,t[58]=0,t[59]=1,t[60]=0,t[61]=0,t[62]=1,t[63]=0,t[64]=0,t[65]=1,t[66]=0,t[67]=0,t[68]=1,t[69]=0,t[70]=0,t[71]=1,s.bitangent=newx({componentDatatype:y.FLOAT,componentsPerAttribute:3,values:t})}n=newUint16Array(6*2*3),n[0]=0,n[1]=1,n[2]=2,n[3]=0,n[4]=2,n[5]=3,n[6]=6,n[7]=5,n[8]=4,n[9]=7,n[10]=6,n[11]=4,n[12]=8,n[13]=9,n[14]=10,n[15]=8,n[16]=10,n[17]=11,n[18]=14,n[19]=13,n[20]=12,n[21]=15,n[22]=14,n[23]=12,n[24]=18,n[25]=17,n[26]=16,n[27]=19,n[28]=18,n[29]=16,n[30]=20,n[31]=21,n[32]=22,n[33]=20,n[34]=22,n[35]=23}elsee=newFloat64Array(8*3),e[0]=o.x,e[1]=o.y,e[2]=o.z,e[3]=m.x,e[4]=o.y,e[5]=o.z,e[6]=m.x,e[7]=m.y,e[8]=o.z,e[9]=o.x,e[10]=m.y,e[11]=o.z,e[12]=o.x,e[13]=o.y,e[14]=m.z,e[15]=m.x,e[16]=o.y,e[17]=m.z,e[18]=m.x,e[19]=m.y,e[20]=m.z,e[21]=o.x,e[22]=m.y,e[23]=m.z,s.position=newx({componentDatatype:y.DOUBLE,componentsPerAttribute:3,values:e}),n=newUint16Array(6*2*3),n[0]=4,n[1]=5,n[2]=6,n[3]=4,n[4]=6,n[5]=7,n[6]=1,n[7]=0,n[8]=3,n[9]=1,n[10]=3,n[11]=2,n[12]=1,n[13]=6,n[14]=5,n[15]=1,n[16]=2,n[17]=6,n[18]=2,n[19]=3,n[20]=7,n[21]=2,n[22]=7,n[23]=6,n[24]=3,n[25]=0,n[26]=4,n[27]=3,n[28]=4,n[29]=7,n[30]=0,n[31]=1,n[32]=5,n[33]=0,n[34]=5,n[35]=4;letv=i.subtract(m,o,D),L=i.magnitude(v)*.5;if(A(r._offsetAttribute)){lett=e.length,T=r._offsetAttribute===b.NONE?0:1,E=newUint8Array(t/3).fill(T);s.applyOffset=newx({componentDatatype:y.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}returnnewh({attributes:s,indices:n,primitiveType:w.TRIANGLES,boundingSphere:newd(i.ZERO,L),offsetAttribute:r._offsetAttribute})};varl;f.getUnitBox=function(){returnA(l)||(l=f.createGeometry(f.fromDimensions({dimensions:newi(1,1,1),vertexFormat:u.POSITION_ONLY}))),l};varR=f;export{Rasa};
* 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{aasf}from"./chunk-VLPNAR64.js";import{aasn,basc}from"./chunk-GE5NEIZC.js";import{casI,das_,easo}from"./chunk-35CVRQTC.js";varP=I((O,d)=>{varu=function(t){t==null&&(t=newDate().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=newArray(this.N),this.mti=this.N+1,t.constructor==Array?this.init_by_array(t,t.length):this.init_seed(t)};u.prototype.init_seed=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){vart=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((t&4294901760)>>>16)*1812433253<<16)+(t&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};u.prototype.init_by_array=function(t,i){vare,s,h;for(this.init_seed(19650218),e=1,s=0,h=this.N>i?this.N:i;h;h--){vara=this.mt[e-1]^this.mt[e-1]>>>30;this.mt[e]=(this.mt[e]^(((a&4294901760)>>>16)*1664525<<16)+(a&65535)*1664525)+t[s]+s,this.mt[e]>>>=0,e++,s++,e>=this.N&&(this.mt[0]=this.mt[this.N-1],e=1),s>=i&&(s=0)}for(h=this.N-1;h;h--){vara=this.mt[e-1]^this.mt[e-1]>>>30;this.mt[e]=(this.mt[e]^(((a&4294901760)>>>16)*1566083941<<16)+(a&65535)*1566083941)-e,this.mt[e]>>>=0,e++,e>=this.N&&(this.mt[0]=this.mt[this.N-1],e=1)}this.mt[0]=2147483648};u.prototype.random_int=function(){vart,i=newArray(0,this.MATRIX_A);if(this.mti>=this.N){vare;for(this.mti==this.N+1&&this.init_seed(5489),e=0;e<this.N-this.M;e++)t=this.mt[e]&this.UPPER_MASK|this.mt[e+1]&this.LOWER_MASK,this.mt[e]=this.mt[e+this.M]^t>>>1^i[t&1];for(;e<this.N-1;e++)t=this.mt[e]&this.UPPER_MASK|this.mt[e+1]&this.LOWER_MASK,this.mt[e]=this.mt[e+(this.M-this.N)]^t>>>1^i[t&1];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^i[t&1],this.mti=0}returnt=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0};u.prototype.random_int31=function(){returnthis.random_int()>>>1};u.prototype.random_incl=function(){returnthis.random_int()*(1/4294967295)};u.prototype.random=function(){returnthis.random_int()*(1/4294967296)};u.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};u.prototype.random_long=function(){vart=this.random_int()>>>5,i=this.random_int()>>>6;return(t*67108864+i)*(1/9007199254740992)};d.exports=u});varm=_(P(),1);varr={};r.EPSILON1=.1;r.EPSILON2=.01;r.EPSILON3=.001;r.EPSILON4=1e-4;r.EPSILON5=1e-5;r.EPSILON6=1e-6;r.EPSILON7=1e-7;r.EPSILON8=1e-8;r.EPSILON9=1e-9;r.EPSILON10=1e-10;r.EPSILON11=1e-11;r.EPSILON12=1e-12;r.EPSILON13=1e-13;r.EPSILON14=1e-14;r.EPSILON15=1e-15;r.EPSILON16=1e-16;r.EPSILON17=1e-17;r.EPSILON18=1e-18;r.EPSILON19=1e-19;r.EPSILON20=1e-20;r.EPSILON21=1e-21;r.GRAVITATIONALPARAMETER=3986004418e5;r.SOLAR_RADIUS=6955e5;r.LUNAR_RADIUS=1737400;r.SIXTY_FOUR_KILOBYTES=64*1024;r.FOUR_GIGABYTES=4*1024*1024*1024;r.sign=f(Math.sign,function(i){returni=+i,i===0||i!==i?i:i>0?1:-1});r.signNotZero=function(t){returnt<0?-1:1};r.toSNorm=function(t,i){returni=f(i,255),Math.round((r.clamp(t,-1,1)*.5+.5)*i)};r.fromSNorm=function(t,i){returni=f(i,255),r.clamp(t,0,i)/i*2-1};r.normalize=function(t,i,e){returne=Math.max(e-i,0),e===0?0:r.clamp((t-i)/e,0,1)};r.sinh=f(Math.sinh,function(i){return(Math.exp(i)-Math.exp(-i))/2});r.cosh=f(Math.cosh,function(i){return(Math.exp(i)+Math.exp(-i))/2});r.lerp=function(t,i,e){return(1-e)*t+e*i};r.PI=Math.PI;r.ONE_OVER_PI=1/Math.PI;r.PI_OVER_TWO=Math.PI/2;r.PI_OVER_THREE=Math.PI/3;r.PI_OVER_FOUR=Math.PI/4;r.PI_OVER_SIX=Math.PI/6;r.THREE_PI_OVER_TWO=3*Math.PI/2;r.TWO_PI=2*Math.PI;r.ONE_OVER_TWO_PI=1/(2*Math.PI);r.RADIANS_PER_DEGREE=Math.PI/180;r.DEGREES_PER_RADIAN=180/Math.PI;r.RADIANS_PER_ARCSECOND=r.RADIANS_PER_DEGREE/3600;r.toRadians=function(t){if(!o(t))thrownewn("degrees is required.");returnt*r.RADIANS_PER_DEGREE};r.toDegrees=function(t){if(!o(t))thrownewn("radians is required.");returnt*r.DEGREES_PER_RADIAN};r.convertLongitudeRange=function(t){if(!o(t))thrownewn("angle is required.");leti=r.TWO_PI,e=t-Math.floor(t/i)*i;returne<-Math.PI?e+i:e>=Math.PI?e-i:e};r.clampToLatitudeRange=function(t){if(!o(t))thrownewn("angle is required.");returnr.clamp(t,-1*r.PI_OVER_TWO,r.PI_OVER_TWO)};r.negativePiToPi=function(t){if(!o(t))thrownewn("angle is required.");returnt>=-r.PI&&t<=r.PI?t:r.zeroToTwoPi(t+r.PI)-r.PI};r.zeroToTwoPi=function(t){if(!o(t))thrownewn("angle is required.");if(t>=0&&t<=r.TWO_PI)returnt;leti=r.mod(t,r.TWO_PI);returnMath.abs(i)<r.EPSILON14&&Math.abs(t)>r.EPSILON14?r.TWO_PI:i};r.mod=function(t,i){if(!o(t))thrownewn("m is required.");if(!o(i))thrownewn("n is required.");if(i===0)thrownewn("divisor cannot be 0.");returnr.sign(t)===r.sign(i)&&Math.abs(t)<Math.abs(i)?t:(t%i+i)%i};r.equalsEpsilon=function(t,i,e,s){if(!o(t))thrownewn("left is required.");if(!o(i))thrownewn("right is required.");e=f(e,0),s=f(s,e);leth=Math.abs(t-i);returnh<=s||h<=e*Math.max(Math.abs(t),Math.abs(i))};r.lessThan=function(t,i,e){if(!o(t))thrownewn("first is required.");if(!o(i))thrownewn("second is required.");if(!o(e))thrownewn("absoluteEpsilon is required.");returnt-i<-e};r.lessThanOrEquals=function(t,i,e){if(!o(t))thrownewn("first is required.");if(!o(i))thrownewn("second is required.");if(!o(e))thrownewn("absoluteEpsilon is required.");returnt-i<e};r.greaterThan=function(t,i,e){if(!o(t))thrownewn("first is required.");if(!o(i))thrownewn("second is required.");if(!o(e))thrownewn("absoluteEpsilon is required.");returnt-i>e};r.greaterThanOrEquals=function(t,i,e){if(!o(t))thrownewn("first is required.");if(!o(i))thrownewn("second is required.");if(!o(e))thrownewn("absoluteEpsilon is required.");returnt-i>-e};varw=[1];r.factorial=function(t){if(typeoft!="number"||t<0)thrownewn("A number greater than or equal to 0 is required.");leti=w.length;if(t>=i){lete=w[i-1];for(lets=i;s<=t;s++){leth=e*s;w.push(h),e=h}}returnw[t]};r.incrementWrap=function(t,i,e){if(e=f(e,0),!o(t))thrownewn("n is required.");if(i<=e)thrownewn("maximumValue must be greater than minimumValue.");return++t,t>i&&(t=e),t};r.isPowerOfTwo=function(t){if(typeoft!="number"||t<0||t>4294967295)thrownewn("A number between 0 and (2^32)-1 is required.");returnt!==0&&(t&t-1)===0};r.nextPowerOfTwo=function(t){if(typeoft!="number"||t<0||t>2147483648)thrownewn("A number between 0 and 2^31 is required.");return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t};r.previousPowerOfTwo=function(t){if(typeoft!="number"||t<0||t>4294967295)thrownewn("A number between 0 and (2^32)-1 is required.");returnt|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,t|=t>>32,t=(t>>>0)-(t>>>1),t};r.clamp=function(t,i,e){returnc.typeOf.number("value",t),c.typeOf.number("min",i),c.typeOf.number("max",e),t<i?i:t>e?e:t};varE=newm.default;r.setRandomNumberSeed=function(t){if(!o(t))thrownewn("seed is required.");E=newm.default(t)};r.nextRandomNumber=function(){returnE.random()};r.randomBetween=function(t,i){returnr.nextRandomNumber()*(i-t)+t};r.acosClamped=function(t){if(!o(t))thrownewn("value is required.");returnMath.acos(r.clamp(t,-1,1))};r.asinClamped=function(t){if(!o(t))thrownewn("value is required.");returnMath.asin(r.clamp(t,-1,1))};r.chordLength=function(t,i){if(!o(t))thrownewn("angle is required.");if(!o(i))thrownewn("radius is required.");return2*i*Math.sin(t*.5)};r.logBase=function(t,i){if(!o(t))thrownewn("number is required.");if(!o(i))thrownewn("base is required.");returnMath.log(t)/Math.log(i)};r.cbrt=f(Math.cbrt,function(i){lete=Math.pow(Math.abs(i),.3333333333333333);returni<0?-e:e});r.log2=f(Math.log2,function(i){returnMath.log(i)*Math.LOG2E});r.fog=function(t,i){lete=t*i;return1-Math.exp(-(e*e))};r.fastApproximateAtan=function(t){returnc.typeOf.number("x",t),t*(-.1784*Math.abs(t)-.0663*t*t+1.0301)};r.fastApproximateAtan2=function(t,i){c.typeOf.number("x",t),c.typeOf.number("y",i);lete,s=Math.abs(t);e=Math.abs(i);leth=Math.max(s,e);e=Math.min(s,e);leta=e/h;if(isNaN(a))thrownewn("either x or y must be nonzero");returns=r.fastApproximateAtan(a),s=Math.abs(i)>Math.abs(t)?r.PI_OVER_TWO-s:s,s=t<0?r.PI-s:s,s=i<0?-s:s,s};varA=r;export{Aasa};
* 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{aaswt}from"./chunk-ZFTFDHK4.js";import{aask}from"./chunk-74GQJJ7R.js";import{aaskt}from"./chunk-NNHN6WUY.js";import{aasCt}from"./chunk-T7ERZ2CJ.js";import{basdt,cas_t,dasR}from"./chunk-GSNDLQ4C.js";import{dasht}from"./chunk-BKSIEBAA.js";import{aasN}from"./chunk-VTVHUB7E.js";import{aass,caspt,dasot}from"./chunk-JMSSU44E.js";import{aasM}from"./chunk-4UYSGV57.js";import{aasp}from"./chunk-VLPNAR64.js";import{aasz}from"./chunk-GE5NEIZC.js";import{easE}from"./chunk-35CVRQTC.js";varyt=news,vt=news,Et=news,Mt=news,Nt=news,Rt=news(1,1,1),Pt=Math.cos,At=Math.sin;functionO(n){n=p(n,p.EMPTY_OBJECT);letm=p(n.radii,Rt),i=p(n.innerRadii,m),P=p(n.minimumClock,0),T=p(n.maximumClock,M.TWO_PI),A=p(n.minimumCone,0),b=p(n.maximumCone,M.PI),a=Math.round(p(n.stackPartitions,64)),u=Math.round(p(n.slicePartitions,64)),h=p(n.vertexFormat,k.DEFAULT);if(u<3)thrownewz("options.slicePartitions cannot be less than three.");if(a<3)thrownewz("options.stackPartitions cannot be less than three.");this._radii=s.clone(m),this._innerRadii=s.clone(i),this._minimumClock=P,this._maximumClock=T,this._minimumCone=A,this._maximumCone=b,this._stackPartitions=a,this._slicePartitions=u,this._vertexFormat=k.clone(h),this._offsetAttribute=n.offsetAttribute,this._workerName="createEllipsoidGeometry"}O.packedLength=2*s.packedLength+k.packedLength+7;O.pack=function(n,m,i){if(!E(n))thrownewz("value is required");if(!E(m))thrownewz("array is required");returni=p(i,0),s.pack(n._radii,m,i),i+=s.packedLength,s.pack(n._innerRadii,m,i),i+=s.packedLength,k.pack(n._vertexFormat,m,i),i+=k.packedLength,m[i++]=n._minimumClock,m[i++]=n._maximumClock,m[i++]=n._minimumCone,m[i++]=n._maximumCone,m[i++]=n._stackPartitions,m[i++]=n._slicePartitions,m[i]=p(n._offsetAttribute,-1),m};varbt=news,xt=news,Ot=newk,y={radii:bt,innerRadii:xt,vertexFormat:Ot,minimumClock:void0,maximumClock:void0,minimumCone:void0,maximumCone:void0,stackPartitions:void0,slicePartitions:void0,offsetAttribute:void0};O.unpack=function(n,m,i){if(!E(n))thrownewz("array is required");m=p(m,0);letP=s.unpack(n,m,bt);m+=s.packedLength;letT=s.unpack(n,m,xt);m+=s.packedLength;letA=k.unpack(n,m,Ot);m+=k.packedLength;letb=n[m++],a=n[m++],u=n[m++],h=n[m++],t=n[m++],o=n[m++],e=n[m];returnE(i)?(i._radii=s.clone(P,i._radii),i._innerRadii=s.clone(T,i._innerRadii),i._vertexFormat=k.clone(A,i._vertexFormat),i._minimumClock=b,i._maximumClock=a,i._minimumCone=u,i._maximumCone=h,i._stackPartitions=t,i._slicePartitions=o,i._offsetAttribute=e===-1?void0:e,i):(y.minimumClock=b,y.maximumClock=a,y.minimumCone=u,y.maximumCone=h,y.stackPartitions=t,y.slicePartitions=o,y.offsetAttribute=e===-1?void0:e,newO(y))};O.createGeometry=function(n){letm=n._radii;if(m.x<=0||m.y<=0||m.z<=0)return;leti=n._innerRadii;if(i.x<=0||i.y<=0||i.z<=0)return;letP=n._minimumClock,T=n._maximumClock,A=n._minimumCone,b=n._maximumCone,a=n._vertexFormat,u=n._slicePartitions+1,h=n._stackPartitions+1;u=Math.round(u*Math.abs(T-P)/M.TWO_PI),h=Math.round(h*Math.abs(b-A)/M.PI),u<2&&(u=2),h<2&&(h=2);lett,o,e=0,D=[A],S=[P];for(t=0;t<h;t++)D.push(A+t*(b-A)/(h-1));for(D.push(b),o=0;o<u;o++)S.push(P+o*(T-P)/(u-1));S.push(T);letf=D.length,c=S.length,U=0,B=1,q=i.x!==m.x||i.y!==m.y||i.z!==m.z,J=!1,rt=!1,ct=!1;q&&(B=2,A>0&&(J=!0,U+=u-1),b<Math.PI&&(rt=!0,U+=u-1),(T-P)%M.TWO_PI?(ct=!0,U+=(h-1)*2+1):U+=1);letw=c*f*B,x=newFloat64Array(w*3),X=newArray(w).fill(!1),st=newArray(w).fill(!1),at=u*h*B,Tt=6*(at+U+1-(u+h)*B),r=kt.createTypedArray(at,Tt),Y=a.normal?newFloat32Array(w*3):void0,j=a.tangent?newFloat32Array(w*3):void0,H=a.bitangent?newFloat32Array(w*3):void0,Z=a.st?newFloat32Array(w*2):void0,V=newArray(f),G=newArray(f);for(t=0;t<f;t++)V[t]=At(D[t]),G[t]=Pt(D[t]);letK=newArray(c),Q=newArray(c);for(o=0;o<c;o++)Q[o]=Pt(S[o]),K[o]=At(S[o]);for(t=0;t<f;t++)for(o=0;o<c;o++)x[e++]=m.x*V[t]*Q[o],x[e++]=m.y*V[t]*K[o],x[e++]=m.z*G[t];let$=w/2;if(q)for(t=0;t<f;t++)for(o=0;o<c;o++)x[e++]=i.x*V[t]*Q[o],x[e++]=i.y*V[t]*K[o],x[e++]=i.z*G[t],X[$]=!0,t>0&&t!==f-1&&o!==0&&o!==c-1&&(st[$]=!0),$++;e=0;letF,L;for(t=1;t<f-2;t++)for(F=t*c,L=(t+1)*c,o=1;o<c-2;o++)r[e++]=L+o,r[e++]=L+o+1,r[e++]=F+o+1,r[e++]=L+o,r[e++]=F+o+1,r[e++]=F+o;if(q){letg=f*c;for(t=1;t<f-2;t++)for(F=g+t*c,L=g+(t+1)*c,o=1;o<c-2;o++)r[e++]=L+o,r[e++]=F+o,r[e++]=F+o+1,r[e++]=L+o,r[e++]=F+o+1,r[e++]=L+o+1}letd,l;if(q){if(J)for(l=f*c,t=1;t<c-2;t++)r[e++]=t,r[e++]=t+1,r[e++]=l+t+1,r[e++]=t,r[e++]=l+t+1,r[e++]=l+t;if(rt)for(d=f*c-c,l=f*c*B-c,t=1;t<c-2;t++)r[e++]=d+t+1,r[e++]=d+t,r[e++]=l+t,r[e++]=d+t+1,r[e++]=l+t,r[e++]=l+t+1}if(ct){for(t=1;t<f-2;t++)l=c*f+c*t,d=c*t,r[e++]=l,r[e++]=d+c,r[e++]=d,r[e++]=l,r[e++]=l+c,r[e++]=d+c;for(t=1;t<f-2;t++)l=c*f+c*(t+1)-1,d=c*(t+1)-1,r[e++]=d+c,r[e++]=l,r[e++]=d,r[e++]=d+c,r[e++]=l+c,r[e++]=l}letv=newCt;a.position&&(v.position=newR({componentDatatype:N.DOUBLE,componentsPerAttribute:3,values:x}));letft=0,I=0,tt=0,nt=0,Ft=w/2,ut,lt=ot.fromCartesian3(m),Lt=ot.fromCartesian3(i);if(a.st||a.normal||a.tangent||a.bitangent){for(t=0;t<w;t++){ut=X[t]?Lt:lt;letg=s.fromArray(x,t*3,yt),C=ut.geodeticSurfaceNormal(g,vt);if(st[t]&&s.negate(C,C),a.st){let_=pt.negate(C,Nt);Z[ft++]=Math.atan2(_.y,_.x)/M.TWO_PI+.5,Z[ft++]=Math.asin(C.z)/Math.PI+.5}if(a.normal&&(Y[I++]=C.x,Y[I++]=C.y,Y[I++]=C.z),a.tangent||a.bitangent){let_=Et,et=0,it;if(X[t]&&(et=Ft),!J&&t>=et&&t<et+c*2?it=s.UNIT_X:it=s.UNIT_Z,s.cross(it,C,_),s.normalize(_,_),a.tangent&&(j[tt++]=_.x,j[tt++]=_.y,j[tt++]=_.z),a.bitangent){letW=s.cross(C,_,Mt);s.normalize(W,W),H[nt++]=W.x,H[nt++]=W.y,H[nt++]=W.z}}}a.st&&(v.st=newR({componentDatatype:N.FLOAT,componentsPerAttribute:2,values:Z})),a.normal&&(v.normal=newR({componentDatatype:N.FLOAT,componentsPerAttribute:3,values:Y})),a.tangent&&(v.tangent=newR({componentDatatype:N.FLOAT,componentsPerAttribute:3,values:j})),a.bitangent&&(v.bitangent=newR({componentDatatype:N.FLOAT,componentsPerAttribute:3,values:H}))}if(E(n._offsetAttribute)){letg=x.length,C=n._offsetAttribute===wt.NONE?0:1,_=newUint8Array(g/3).fill(C);v.applyOffset=newR({componentDatatype:N.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}returnnew_t({attributes:v,indices:r,primitiveType:dt.TRIANGLES,boundingSphere:ht.fromEllipsoid(lt),offsetAttribute:n._offsetAttribute})};varmt;O.getUnitEllipsoid=function(){returnE(mt)||(mt=O.createGeometry(newO({radii:news(1,1,1),vertexFormat:k.POSITION_ONLY}))),mt};varKt=O;export{Ktasa};
* 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{aas_}from"./chunk-M5SITFFN.js";import{aaste}from"./chunk-FNJKWSPR.js";import{aasfe,basj,fasZ,gasme}from"./chunk-YWRPWWKI.js";import{aase,basie,casee,easO}from"./chunk-JMSSU44E.js";import{aasQ}from"./chunk-4UYSGV57.js";import{aasse}from"./chunk-VLPNAR64.js";import{aasle}from"./chunk-GE5NEIZC.js";import{eas$}from"./chunk-35CVRQTC.js";varSe={ROUNDED:0,MITERED:1,BEVELED:2},G=Object.freeze(Se);varue={};functionP(r,n){if(!$(r))thrownewle("identifier is required.");$(ue[r])||(ue[r]=!0,console.warn(se(n,r)))}P.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.";P.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";P.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";P.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";varhe=P;varw=[newe,newe],Te=newe,Be=newe,Ce=newe,ze=newe,Ae=newe,be=newe,Oe=newe,ve=newe,De=newe,I=newe,W=newe,R={},re=newie;functionje(r,n){leta=newArray(r.length);for(leto=0;o<r.length;o++){lett=r[o];re=n.cartesianToCartographic(t,re),a[o]=re.height,r[o]=n.scaleToGeodeticSurface(t,t)}returna}functionne(r,n,a,o){lett=r[0],c=r[1],f=e.angleBetween(t,c),l=Math.ceil(f/o),m=newArray(l),s;if(n===a){for(s=0;s<l;s++)m[s]=n;returnm.push(a),m}letd=(a-n)/l;for(s=1;s<l;s++){letx=n+s*d;m[s]=x}returnm[0]=n,m.push(a),m}varX=newe,Y=newe;functionHe(r,n,a,o){lett=newte(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y),l=ee.angleBetween(c,f);returnf.x*c.y-f.y*c.x>=0?-l:l}varMe=newe(-1,0,0),H=newj,Ve=newj,oe=newO,Ne=O.IDENTITY.clone(),Fe=newe,Ge=newfe,de=newe;functionv(r,n,a,o,t,c,f,l){letm=Fe,s=Ge;H=me.eastNorthUpToFixedFrame(r,t,H),m=j.multiplyByPointAsVector(H,Me,m),m=e.normalize(m,m);letS=He(m,n,r,t);oe=O.fromRotationZ(S,oe),de.z=c,H=j.multiplyTransformation(H,j.fromRotationTranslation(oe,de,Ve),H);letd=Ne;d[0]=f;for(letx=0;x<l;x++)for(leti=0;i<a.length;i+=3)s=e.fromArray(a,i,s),s=O.multiplyByVector(d,s,s),s=j.multiplyByPoint(H,s,s),o.push(s.x,s.y,s.z);returno}varIe=newe;functionce(r,n,a,o,t,c,f){for(letl=0;l<r.length;l+=3){letm=e.fromArray(r,l,Ie);o=v(m,n,a,o,t,c[l/3],f,1)}returno}functionLe(r,n){leta=r.length,o=newArray(a*6),t=0,c=n.x+n.width/2,f=n.y+n.height/2,l=r[0];o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f;for(letm=1;m<a;m++){l=r[m];lets=l.x-c,S=l.y-f;o[t++]=s,o[t++]=0,o[t++]=S,o[t++]=s,o[t++]=0,o[t++]=S}returnl=r[0],o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f,o}functionge(r,n){leta=r.length,o=newArray(a*3),t=0,c=n.x+n.width/2,f=n.y+n.height/2;for(letl=0;l<a;l++)o[t++]=r[l].x-c,o[t++]=0,o[t++]=r[l].y-f;returno}varye=newZ,we=newe,pe=newO;functionxe(r,n,a,o,t,c,f,l,m,s){letS=e.angleBetween(e.subtract(n,r,I),e.subtract(a,r,W)),d=o===G.BEVELED?0:Math.ceil(S/Q.toRadians(5)),x;t?x=O.fromQuaternion(Z.fromAxisAngle(e.negate(r,I),S/(d+1),ye),pe):x=O.fromQuaternion(Z.fromAxisAngle(r,S/(d+1),ye),pe);leti,g;if(n=e.clone(n,we),d>0){letD=s?2:1;for(lety=0;y<d;y++)n=O.multiplyByVector(x,n,n),i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,D)}elsei=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,1),a=e.clone(a,we),i=e.subtract(a,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(a,W),f=v(g,i,l,f,c,m,1,1);returnf}R.removeDuplicatesFromShape=function(r){letn=r.length,a=[];for(leto=n-1,t=0;t<n;o=t++){letc=r[o],f=r[t];ee.equals(c,f)||a.push(f)}returna};R.angleIsGreaterThanPi=function(r,n,a,o){lett=newte(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y);returnf.x*c.y-f.y*c.x>=0};varqe=newe,Pe=newe;R.computePositions=function(r,n,a,o,t){letc=o._ellipsoid,f=je(r,c),l=o._granularity,m=o._cornerType,s=t?Le(n,a):ge(n,a),S=t?ge(n,a):void0,d=a.height/2,x=a.width/2,i=r.length,g=[],D=t?[]:void0,y=Te,b=Be,h=Ce,E=ze,B=Ae,C=be,z=Oe,u=ve,T=De,p=r[0],M=r[1];E=c.geodeticSurfaceNormal(p,E),y=e.subtract(M,p,y),y=e.normalize(y,y),u=e.cross(E,y,u),u=e.normalize(u,u);letV=f[0],A=f[1];t&&(D=v(p,u,S,D,c,V+d,1,1)),T=e.clone(p,T),p=M,b=e.negate(y,b);letN,F;for(letU=1;U<i-1;U++){letae=t?2:1;if(M=r[U+1],p.equals(M)){he("Positions are too close and are considered equivalent with rounding error.");continue}y=e.subtract(M,p,y),y=e.normalize(y,y),E=c.geodeticSurfaceNormal(p,E);letL=e.multiplyByScalar(E,e.dot(y,E),qe);e.subtract(y,L,L),e.normalize(L,L);letq=e.multiplyByScalar(E,e.dot(b,E),Pe);if(e.subtract(b,q,q),e.normalize(q,q),!Q.equalsEpsilon(Math.abs(e.dot(L,q)),1,Q.EPSILON7)){h=e.add(y,b,h),h=e.normalize(h,h),h=e.cross(h,E,h),h=e.cross(E,h,h),h=e.normalize(h,h);letk=1/Math.max(.25,e.magnitude(e.cross(h,b,I))),K=R.angleIsGreaterThanPi(y,b,p,c);K?(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),N=ne(w,V+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,N,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,x,z),z),m===G.ROUNDED||m===G.BEVELED?xe(B,C,z,m,K,c,g,s,A+d,t):(h=e.negate(h,h),g=v(p,h,s,g,c,A+d,k,ae)),T=e.clone(z,T)):(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,-x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),N=ne(w,V+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,N,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,-x,z),z),m===G.ROUNDED||m===G.BEVELED?xe(B,C,z,m,K,c,g,s,A+d,t):g=v(p,h,s,g,c,A+d,k,ae),T=e.clone(z,T)),b=e.negate(y,b)}elseg=v(T,u,s,g,c,V+d,1,1),T=p;V=A,A=f[U+1],p=M}w[0]=e.clone(T,w[0]),w[1]=e.clone(p,w[1]),N=ne(w,V+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,N,1),t&&(D=v(p,u,S,D,c,A+d,1,1)),i=g.length;letEe=t?i+D.length:i,J=newFloat64Array(Ee);returnJ.set(g),t&&J.set(D,i),J};varlt=R;export{Gasa,heasb,ltasc};
* 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{aast}from"./chunk-VLPNAR64.js";import{aasO}from"./chunk-GE5NEIZC.js";import{easf}from"./chunk-35CVRQTC.js";functionn(e){e=t(e,t.EMPTY_OBJECT),this.position=t(e.position,!1),this.normal=t(e.normal,!1),this.st=t(e.st,!1),this.bitangent=t(e.bitangent,!1),this.tangent=t(e.tangent,!1),this.color=t(e.color,!1)}n.POSITION_ONLY=Object.freeze(newn({position:!0}));n.POSITION_AND_NORMAL=Object.freeze(newn({position:!0,normal:!0}));n.POSITION_NORMAL_AND_ST=Object.freeze(newn({position:!0,normal:!0,st:!0}));n.POSITION_AND_ST=Object.freeze(newn({position:!0,st:!0}));n.POSITION_AND_COLOR=Object.freeze(newn({position:!0,color:!0}));n.ALL=Object.freeze(newn({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));n.DEFAULT=n.POSITION_NORMAL_AND_ST;n.packedLength=6;n.pack=function(e,o,i){if(!f(e))thrownewO("value is required");if(!f(o))thrownewO("array is required");returni=t(i,0),o[i++]=e.position?1:0,o[i++]=e.normal?1:0,o[i++]=e.st?1:0,o[i++]=e.tangent?1:0,o[i++]=e.bitangent?1:0,o[i]=e.color?1:0,o};n.unpack=function(e,o,i){if(!f(e))thrownewO("array is required");returno=t(o,0),f(i)||(i=newn),i.position=e[o++]===1,i.normal=e[o++]===1,i.st=e[o++]===1,i.tangent=e[o++]===1,i.bitangent=e[o++]===1,i.color=e[o]===1,i};n.clone=function(e,o){if(f(e))returnf(o)||(o=newn),o.position=e.position,o.normal=e.normal,o.st=e.st,o.tangent=e.tangent,o.bitangent=e.bitangent,o.color=e.color,o};var_=n;export{_asa};
* 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{aaset}from"./chunk-CXNPIJLB.js";import{aasjt}from"./chunk-APUOR5ZJ.js";import{basLt}from"./chunk-V3DSE3OK.js";import{aasEt}from"./chunk-FMRIJYNG.js";import{aasj}from"./chunk-NNHN6WUY.js";import{aasmt,basD,casB,dasU}from"./chunk-GSNDLQ4C.js";import{aas_t,basUt,dasrt}from"./chunk-BKSIEBAA.js";import{aasdt,basH}from"./chunk-YWRPWWKI.js";import{aask}from"./chunk-VTVHUB7E.js";import{aasr,basMt,casR,easOt}from"./chunk-JMSSU44E.js";import{aasN}from"./chunk-4UYSGV57.js";import{aasK}from"./chunk-VLPNAR64.js";import{aasI,baspt}from"./chunk-GE5NEIZC.js";import{easf}from"./chunk-35CVRQTC.js";varYt=newr,Zt=newr,Xt=newr;functionpe(t,e,n,s,i){pt.defined("point",t),pt.defined("p0",e),pt.defined("p1",n),pt.defined("p2",s),f(i)||(i=newr);letc,o,a,p,u,d,m,l;if(f(e.z)){if(r.equalsEpsilon(t,e,N.EPSILON14))returnr.clone(r.UNIT_X,i);if(r.equalsEpsilon(t,n,N.EPSILON14))returnr.clone(r.UNIT_Y,i);if(r.equalsEpsilon(t,s,N.EPSILON14))returnr.clone(r.UNIT_Z,i);c=r.subtract(n,e,Yt),o=r.subtract(s,e,Zt),a=r.subtract(t,e,Xt),p=r.dot(c,c),u=r.dot(c,o),d=r.dot(c,a),m=r.dot(o,o),l=r.dot(o,a)}else{if(R.equalsEpsilon(t,e,N.EPSILON14))returnr.clone(r.UNIT_X,i);if(R.equalsEpsilon(t,n,N.EPSILON14))returnr.clone(r.UNIT_Y,i);if(R.equalsEpsilon(t,s,N.EPSILON14))returnr.clone(r.UNIT_Z,i);c=R.subtract(n,e,Yt),o=R.subtract(s,e,Zt),a=R.subtract(t,e,Xt),p=R.dot(c,c),u=R.dot(c,o),d=R.dot(c,a),m=R.dot(o,o),l=R.dot(o,a)}i.y=m*d-u*l,i.z=p*l-u*d;leth=p*m-u*u;if(h!==0)returni.y/=h,i.z/=h,i.x=1-i.y-i.z,i}varHt=pe;varNt={};Nt.calculateACMR=function(t){t=K(t,K.EMPTY_OBJECT);lete=t.indices,n=t.maximumIndex,s=K(t.cacheSize,24);if(!f(e))thrownewI("indices is required.");leti=e.length;if(i<3||i%3!==0)thrownewI("indices length must be a multiple of three.");if(n<=0)thrownewI("maximumIndex must be greater than zero.");if(s<3)thrownewI("cacheSize must be greater than two.");if(!f(n)){n=0;leta=0,p=e[a];for(;a<i;)p>n&&(n=p),++a,p=e[a]}letc=[];for(leta=0;a<n+1;a++)c[a]=0;leto=s+1;for(leta=0;a<i;++a)o-c[e[a]]>s&&(c[e[a]]=o,++o);return(o-s+1)/(i/3)};Nt.tipsify=function(t){t=K(t,K.EMPTY_OBJECT);lete=t.indices,n=t.maximumIndex,s=K(t.cacheSize,24),i;functionc(C,z,q,V){for(;z.length>=1;){letG=z[z.length-1];if(z.splice(z.length-1,1),C[G].numLiveTriangles>0)returnG}for(;i<V;){if(C[i].numLiveTriangles>0)return++i,i-1;++i}return-1}functiono(C,z,q,V,G,M,J){letY=-1,_,Pt=-1,gt=0;for(;gt<q.length;){letft=q[gt];V[ft].numLiveTriangles&&(_=0,G-V[ft].timeStamp+2*V[ft].numLiveTriangles<=z&&(_=G-V[ft].timeStamp),(_>Pt||Pt===-1)&&(Pt=_,Y=ft)),++gt}returnY===-1?c(V,M,C,J):Y}if(!f(e))thrownewI("indices is required.");leta=e.length;if(a<3||a%3!==0)thrownewI("indices length must be a multiple of three.");if(n<=0)thrownewI("maximumIndex must be greater than zero.");if(s<3)thrownewI("cacheSize must be greater than two.");letp=0,u=0,d=e[u],m=a;if(f(n))p=n+1;else{for(;u<m;)d>p&&(p=d),++u,d=e[u];if(p===-1)return0;++p}letl=[],h;for(h=0;h<p;h++)l[h]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;lety=0;for(;u<m;)l[e[u]].vertexTriangles.push(y),++l[e[u]].numLiveTriangles,l[e[u+1]].vertexTriangles.push(y),++l[e[u+1]].numLiveTriangles,l[e[u+2]].vertexTriangles.push(y),++l[e[u+2]].numLiveTriangles,++y,u+=3;letv=0,b=s+1;i=1;letS=[],x=[],w,A,E=0,P=[],O=a/3,L=[];for(h=0;h<O;h++)L[h]=!1;letg,T;for(;v!==-1;){S=[],A=l[v],T=A.vertexTriangles.length;for(letC=0;C<T;++C)if(y=A.vertexTriangles[C],!L[y]){L[y]=!0,u=y+y+y;for(letz=0;z<3;++z)g=e[u],S.push(g),x.push(g),P[E]=g,++E,w=l[g],--w.numLiveTriangles,b-w.timeStamp>s&&(w.timeStamp=b,++b),++u}v=o(e,s,S,l,b,x,p)}returnP};varWt=Nt;varF={};functionSt(t,e,n,s,i){t[e++]=n,t[e++]=s,t[e++]=s,t[e++]=i,t[e++]=i,t[e]=n}functionde(t){lete=t.length,n=e/3*6,s=j.createTypedArray(e,n),i=0;for(letc=0;c<e;c+=3,i+=6)St(s,i,t[c],t[c+1],t[c+2]);returns}functionme(t){lete=t.length;if(e>=3){letn=(e-2)*6,s=j.createTypedArray(e,n);St(s,0,t[0],t[1],t[2]);leti=6;for(letc=3;c<e;++c,i+=6)St(s,i,t[c-1],t[c],t[c-2]);returns}returnnewUint16Array}functionhe(t){if(t.length>0){lete=t.length-1,n=(e-1)*6,s=j.createTypedArray(e,n),i=t[0],c=0;for(leto=1;o<e;++o,c+=6)St(s,c,i,t[o],t[o+1]);returns}returnnewUint16Array}F.toWireframe=function(t){if(!f(t))thrownewI("geometry is required.");lete=t.indices;if(f(e)){switch(t.primitiveType){caseD.TRIANGLES:t.indices=de(e);break;caseD.TRIANGLE_STRIP:t.indices=me(e);break;caseD.TRIANGLE_FAN:t.indices=he(e);break;default:thrownewI("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}t.primitiveType=D.LINES}returnt};F.createLineSegmentsForVectors=function(t,e,n){if(e=K(e,"normal"),!f(t))thrownewI("geometry is required.");if(!f(t.attributes.position))thrownewI("geometry.attributes.position is required.");if(!f(t.attributes[e]))thrownewI(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${e}.`);n=K(n,1e4);lets=t.attributes.position.values,i=t.attributes[e].values,c=s.length,o=newFloat64Array(2*c),a=0;for(letd=0;d<c;d+=3)o[a++]=s[d],o[a++]=s[d+1],o[a++]=s[d+2],o[a++]=s[d]+i[d]*n,o[a++]=s[d+1]+i[d+1]*n,o[a++]=s[d+2]+i[d+2]*n;letp,u=t.boundingSphere;returnf(u)&&(p=newrt(u.center,u.radius+n)),newB({attributes:{position:newU({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:o})},primitiveType:D.LINES,boundingSphere:p})};F.createAttributeLocations=function(t){if(!f(t))thrownewI("geometry is required.");lete=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=t.attributes,s={},i=0,c,o=e.length;for(c=0;c<o;++c){leta=e[c];f(n[a])&&(s[a]=i++)}for(letainn)n.hasOwnProperty(a)&&!f(s[a])&&(s[a]=i++);returns};F.reorderForPreVertexCache=function(t){if(!f(t))thrownewI("geometry is required.");lete=B.computeNumberOfVertices(t),n=t.indices;if(f(n)){lets=newInt32Array(e);for(letl=0;l<e;l++)s[l]=-1;leti=n,c=i.length,o=j.createTypedArray(e,c),a=0,p=0,u=0,d;for(;a<c;)d=s[i[a]],d!==-1?o[p]=d:(d=i[a],s[d]=u,o[p]=u,++u),++a,++p;t.indices=o;letm=t.attributes;for(letlinm)if(m.hasOwnProperty(l)&&f(m[l])&&f(m[l].values)){leth=m[l],y=h.values,v=0,b=h.componentsPerAttribute,S=k.createTypedArray(h.componentDatatype,u*b);for(;v<e;){letx=s[v];if(x!==-1)for(letw=0;w<b;w++)S[b*x+w]=y[b*v+w];++v}h.values=S}}returnt};F.reorderForPostVertexCache=function(t,e){if(!f(t))thrownewI("geometry is required.");letn=t.indices;if(t.primitiveType===D.TRIANGLES&&f(n)){lets=n.length,i=0;for(letc=0;c<s;c++)n[c]>i&&(i=n[c]);t.indices=Wt.tipsify({indices:n,maximumIndex:i,cacheSize:e})}returnt};function$t(t){lete={};for(letnint)if(t.hasOwnProperty(n)&&f(t[n])&&f(t[n].values)){lets=t[n];e[n]=newU({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:[]})}returne}functionbe(t,e,n){for(letsine)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){leti=e[s];for(letc=0;c<i.componentsPerAttribute;++c)t[s].values.push(i.values[n*i.componentsPerAttribute+c])}}F.fitToUnsignedShortIndices=function(t){if(!f(t))thrownewI("geometry is required.");if(f(t.indices)&&t.primitiveType!==D.TRIANGLES&&t.primitiveType!==D.LINES&&t.primitiveType!==D.POINTS)thrownewI("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");lete=[],n=B.computeNumberOfVertices(t);if(f(t.indices)&&n>=N.SIXTY_FOUR_KILOBYTES){lets=[],i=[],c=0,o=$t(t.attributes),a=t.indices,p=a.length,u;t.primitiveType===D.TRIANGLES?u=3:t.primitiveType===D.LINES?u=2:t.primitiveType===D.POINTS&&(u=1);for(letd=0;d<p;d+=u){for(letm=0;m<u;++m){letl=a[d+m],h=s[l];f(h)||(h=c++,s[l]=h,be(o,t.attributes,l)),i.push(h)}c+u>=N.SIXTY_FOUR_KILOBYTES&&(e.push(newB({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV})),s=[],i=[],c=0,o=$t(t.attributes))}i.length!==0&&e.push(newB({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV}))}elsee.push(t);returne};varJt=newr,we=newMt;F.projectTo2D=function(t,e,n,s,i){if(!f(t))thrownewI("geometry is required.");if(!f(e))thrownewI("attributeName is required.");if(!f(n))thrownewI("attributeName3D is required.");if(!f(s))thrownewI("attributeName2D is required.");if(!f(t.attributes[e]))thrownewI(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==k.DOUBLE)thrownewI("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");letc=t.attributes[e];i=f(i)?i:new_t;leto=i.ellipsoid,a=c.values,p=newFloat64Array(a.length),u=0;for(letd=0;d<a.length;d+=3){letm=r.fromArray(a,d,Jt),l=o.cartesianToCartographic(m,we);if(!f(l))thrownewI(`Could not project point (${m.x}, ${m.y}, ${m.z}) to 2D.`);leth=i.project(l,Jt);p[u++]=h.x,p[u++]=h.y,p[u++]=h.z}returnt.attributes[n]=c,t.attributes[s]=newU({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:p}),deletet.attributes[e],t};varzt={high:0,low:0};F.encodeAttribute=function(t,e,n,s){if(!f(t))thrownewI("geometry is required.");if(!f(e))thrownewI("attributeName is required.");if(!f(n))thrownewI("attributeHighName is required.");if(!f(s))thrownewI("attributeLowName is required.");if(!f(t.attributes[e]))thrownewI(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==k.DOUBLE)thrownewI("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");leti=t.attributes[e],c=i.values,o=c.length,a=newFloat32Array(o),p=newFloat32Array(o);for(letd=0;d<o;++d)jt.encode(c[d],zt),a[d]=zt.high,p[d]=zt.low;letu=i.componentsPerAttribute;returnt.attributes[n]=newU({componentDatatype:k.FLOAT,componentsPerAttribute:u,values:a}),t.attributes[s]=newU({componentDatatype:k.FLOAT,componentsPerAttribute:u,values:p}),deletet.attributes[e],t};var$=newr;functionDt(t,e){if(f(e)){letn=e.values,s=n.length;for(leti=0;i<s;i+=3)r.unpack(n,i,$),H.multiplyByPoint(t,$,$),r.pack($,n,i)}}functionqt(t,e){if(f(e)){letn=e.values,s=n.length;for(leti=0;i<s;i+=3)r.unpack(n,i,$),Ot.multiplyByVector(t,$,$),$=r.normalize($,$),r.pack($,n,i)}}varvt=newH,yt=newOt;F.transformToWorldCoordinates=function(t){if(!f(t))thrownewI("instance is required.");lete=t.modelMatrix;if(H.equals(e,H.IDENTITY))returnt;letn=t.geometry.attributes;Dt(e,n.position),Dt(e,n.prevPosition),Dt(e,n.nextPosition),(f(n.normal)||f(n.tangent)||f(n.bitangent))&&(H.inverse(e,vt),H.transpose(vt,vt),H.getMatrix3(vt,yt),qt(yt,n.normal),qt(yt,n.tangent),qt(yt,n.bitangent));lets=t.geometry.boundingSphere;returnf(s)&&(t.geometry.boundingSphere=rt.transform(s,e,s)),t.modelMatrix=H.clone(H.IDENTITY),t};functionve(t,e){letn=t.length,s={},i=t[0][e].attributes,c;for(cini)if(i.hasOwnProperty(c)&&f(i[c])&&f(i[c].values)){leto=i[c],a=o.values.length,p=!0;for(letu=1;u<n;++u){letd=t[u][e].attributes[c];if(!f(d)||o.componentDatatype!==d.componentDatatype||o.componentsPerAttribute!==d.componentsPerAttribute||o.normalize!==d.normalize){p=!1;break}a+=d.values.length}p&&(s[c]=newU({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:k.createTypedArray(o.componentDatatype,a)}))}returns}varye=newr;functionVt(t,e){letn=t.length,s,i,c,o,a=t[0].modelMatrix,p=f(t[0][e].indices),u=t[0][e].primitiveType;for(i=1;i<n;++i){if(!H.equals(t[i].modelMatrix,a))thrownewI("All instances must have the same modelMatrix.");if(f(t[i][e].indices)!==p)thrownewI("All instance geometries must have an indices or not have one.");if(t[i][e].primitiveType!==u)thrownewI("All instance geometries must have the same primitiveType.")}letd=ve(t,e),m,l,h;for(sind)if(d.hasOwnProperty(s))for(m=d[s].values,o=0,i=0;i<n;++i)for(l=t[i][e].attributes[s].values,h=l.length,c=0;c<h;++c)m[o++]=l[c];lety;if(p){letx=0;for(i=0;i<n;++i)x+=t[i][e].indices.length;letw=B.computeNumberOfVertices(newB({attributes:d,primitiveType:D.POINTS})),A=j.createTypedArray(w,x),E=0,P=0;for(i=0;i<n;++i){letO=t[i][e].indices,L=O.length;for(o=0;o<L;++o)A[E++]=P+O[o];P+=B.computeNumberOfVertices(t[i][e])}y=A}letv=newr,b=0,S;for(i=0;i<n;++i){if(S=t[i][e].boundingSphere,!f(S)){v=void0;break}r.add(S.center,v,v)}if(f(v))for(r.divideByScalar(v,n,v),i=0;i<n;++i){S=t[i][e].boundingSphere;letx=r.magnitude(r.subtract(S.center,v,ye))+S.radius;x>b&&(b=x)}returnnewB({attributes:d,indices:y,primitiveType:u,boundingSphere:f(v)?newrt(v,b):void0})}F.combineInstances=function(t){if(!f(t)||t.length<1)thrownewI("instances is required and must have length greater than zero.");lete=[],n=[],s=t.length;for(letc=0;c<s;++c){leto=t[c];f(o.geometry)?e.push(o):f(o.westHemisphereGeometry)&&f(o.eastHemisphereGeometry)&&n.push(o)}leti=[];returne.length>0&&i.push(Vt(e,"geometry")),n.length>0&&(i.push(Vt(n,"westHemisphereGeometry")),i.push(Vt(n,"eastHemisphereGeometry"))),i};varZ=newr,ht=newr,ct=newr,at=newr;F.computeNormal=function(t){if(!f(t))thrownewI("geometry is required.");if(!f(t.attributes.position)||!f(t.attributes.position.values))thrownewI("geometry.attributes.position.values is required.");if(!f(t.indices))thrownewI("geometry.indices is required.");if(t.indices.length<2||t.indices.length%3!==0)thrownewI("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)thrownewI("geometry.primitiveType must be PrimitiveType.TRIANGLES.");lete=t.indices,n=t.attributes,s=n.position.values,i=n.position.values.length/3,c=e.length,o=newArray(i),a=newArray(c/3),p=newArray(c),u;for(u=0;u<i;u++)o[u]={indexOffset:0,count:0,currentCount:0};letd=0;for(u=0;u<c;u+=3){lety=e[u],v=e[u+1],b=e[u+2],S=y*3,x=v*3,w=b*3;ht.x=s[S],ht.y=s[S+1],ht.z=s[S+2],ct.x=s[x],ct.y=s[x+1],ct.z=s[x+2],at.x=s[w],at.y=s[w+1],at.z=s[w+2],o[y].count++,o[v].count++,o[b].count++,r.subtract(ct,ht,ct),r.subtract(at,ht,at),a[d]=r.cross(ct,at,newr),d++}letm=0;for(u=0;u<i;u++)o[u].indexOffset+=m,m+=o[u].count;d=0;letl;for(u=0;u<c;u+=3){l=o[e[u]];lety=l.indexOffset+l.currentCount;p[y]=d,l.currentCount++,l=o[e[u+1]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,l=o[e[u+2]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,d++}leth=newFloat32Array(i*3);for(u=0;u<i;u++){lety=u*3;if(l=o[u],r.clone(r.ZERO,Z),l.count>0){for(d=0;d<l.count;d++)r.add(Z,a[p[l.indexOffset+d]],Z);r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&r.clone(a[p[l.indexOffset]],Z)}r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&(Z.z=1),r.normalize(Z,Z),h[y]=Z.x,h[y+1]=Z.y,h[y+2]=Z.z}returnt.attributes.normal=newU({componentDatatype:k.FLOAT,componentsPerAttribute:3,values:h}),t};varxe=newr,Kt=newr,Te=newr;F.computeTangentAndBitangent=function(t){if(!f(t))thrownewI("geometry is required.");lete=t.attributes,n=t.indices;if(!f(e.position)||!f(e.position.values))thrownewI("geometry.attributes.position.values is required.");if(!f(e.normal)||!f(e.normal.values))thrownewI("geometry.attributes.normal.values is required.");if(!f(e.st)||!f(e.st.values))thrownewI("geometry.attributes.st.values is required.");if(!f(n))thrownewI("geometry.indices is required.");if(n.length<2||n.length%3!==0)thrownewI("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)thrownewI("geometry.primitiveType must be PrimitiveType.TRIANGLES.");lets=t.attributes.position.values,i=t.attributes.normal.values,c=t.attributes.st.values,o=t.attributes.position.values.length/3,a=n.length,p=newArray(o*3),u;for(u=0;u<p.length;u++)p[u]=0;letd,m,l;for(u=0;u<a;u+=3){letv=n[u],b=n[u+1],S=n[u+2];d=v*3,m=b*3,l=S*3;letx=v*2,w=b*2,A=S*2,E=s[d],P=s[d+1],O=s[d+2],L=c[x],g=c[x+1],T=c[w+1]-g,C=c[A+1]-g,z=1/((c[w]-L)*C-(c[A]-L)*T),q=(C*(s[m]-E)-T*(s[l]-E))*z,V=(C*(s[m+1]-P)-T*(s[l+1]-P))*z,G=(C*(s[m+2]-O)-T*(s[l+2]-O))*z;p[d]+=q,p[d+1]+=V,p[d+2]+=G,p[m]+=q,p[m+1]+=V,p[m+2]+=G,p[l]+=q,p[l+1]+=V,p[l+2]+=G}leth=newFloat32Array(o*3),y=newFloat32Array(o*3);for(u=0;u<o;u++){d=u*3,m=d+1,l=d+2;letv=r.fromArray(i,d,xe),b=r.fromArray(p,d,Te),S=r.dot(v,b);r.multiplyByScalar(v,S,Kt),r.normalize(r.subtract(b,Kt,b),b),h[d]=b.x,h[m]=b.y,h[l]=b.z,r.normalize(r.cross(v,b,b),b),y[d]=b.x,y[m]=b.y,y[l]=b.z}returnt.attributes.tangent=newU({componentDatatype:k.FLOAT,componentsPerAttribute:3,values:h}),t.attributes.bitangent=newU({componentDatatype:k.FLOAT,componentsPerAttribute:3,values:y}),t};varbt=newR,W=newr,Qt=newr,te=newr,xt=newR;F.compressVertices=function(t){if(!f(t))thrownewI("geometry is required.");lete=t.attributes.extrudeDirection,n,s;if(f(e)){letP=e.values;s=P.length/3;letO=newFloat32Array(s*2),L=0;for(n=0;n<s;++n){if(r.fromArray(P,n*3,W),r.equals(W,r.ZERO)){L+=2;continue}xt=et.octEncodeInRange(W,65535,xt),O[L++]=xt.x,O[L++]=xt.y}returnt.attributes.compressedAttributes=newU({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:O}),deletet.attributes.extrudeDirection,t}leti=t.attributes.normal,c=t.attributes.st,o=f(i),a=f(c);if(!o&&!a)returnt;letp=t.attributes.tangent,u=t.attributes.bitangent,d=f(p),m=f(u),l,h,y,v;o&&(l=i.values),a&&(h=c.values),d&&(y=p.values),m&&(v=u.values),s=(o?l.length:h.length)/(o?3:2);letx=s,w=a&&o?2:1;w+=d||m?1:0,x*=w;letA=newFloat32Array(x),E=0;for(n=0;n<s;++n){a&&(R.fromArray(h,n*2,bt),A[E++]=et.compressTextureCoordinates(bt));letP=n*3;o&&f(y)&&f(v)?(r.fromArray(l,P,W),r.fromArray(y,P,Qt),r.fromArray(v,P,te),et.octPack(W,Qt,te,bt),A[E++]=bt.x,A[E++]=bt.y):(o&&(r.fromArray(l,P,W),A[E++]=et.octEncodeFloat(W)),d&&(r.fromArray(y,P,W),A[E++]=et.octEncodeFloat(W)),m&&(r.fromArray(v,P,W),A[E++]=et.octEncodeFloat(W)))}returnt.attributes.compressedAttributes=newU({componentDatatype:k.FLOAT,componentsPerAttribute:w,values:A}),o&&deletet.attributes.normal,a&&deletet.attributes.st,m&&deletet.attributes.bitangent,d&&deletet.attributes.tangent,t};functionAe(t){if(f(t.indices))returnt;lete=B.computeNumberOfVertices(t);if(e<3)thrownewI("The number of vertices must be at least three.");if(e%3!==0)thrownewI("The number of vertices must be a multiple of three.");letn=j.createTypedArray(e,e);for(lets=0;s<e;++s)n[s]=s;returnt.indices=n,t}functionIe(t){lete=B.computeNumberOfVertices(t);if(e<3)thrownewI("The number of vertices must be at least three.");letn=j.createTypedArray(e,(e-2)*3);n[0]=1,n[1]=0,n[2]=2;lets=3;for(leti=3;i<e;++i)n[s++]=i-1,n[s++]=0,n[s++]=i;returnt.indices=n,t.primitiveType=D.TRIANGLES,t}functionSe(t){lete=B.computeNumberOfVertices(t);if(e<3)thrownewI("The number of vertices must be at least 3.");letn=j.createTypedArray(e,(e-2)*3);n[0]=0,n[1]=1,n[2]=2,e>3&&(n[3]=0,n[4]=2,n[5]=3);lets=6;for(leti=3;i<e-1;i+=2)n[s++]=i,n[s++]=i-1,n[s++]=i+1,i+2<e&&(n[s++]=i,n[s++]=i+1,n[s++]=i+2);returnt.indices=n,t.primitiveType=D.TRIANGLES,t}functionPe(t){if(f(t.indices))returnt;lete=B.computeNumberOfVertices(t);if(e<2)thrownewI("The number of vertices must be at least two.");if(e%2!==0)thrownewI("The number of vertices must be a multiple of 2.");letn=j.createTypedArray(e,e);for(lets=0;s<e;++s)n[s]=s;returnt.indices=n,t}functionge(t){lete=B.computeNumberOfVertices(t);if(e<2)thrownewI("The number of vertices must be at least two.");letn=j.createTypedArray(e,(e-1)*2);n[0]=0,n[1]=1;lets=2;for(leti=2;i<e;++i)n[s++]=i-1,n[s++]=i;returnt.indices=n,t.primitiveType=D.LINES,t}functionOe(t){lete=B.computeNumberOfVertices(t);if(e<2)thrownewI("The number of vertices must be at least two.");letn=j.createTypedArray(e,e*2);n[0]=0,n[1]=1;lets=2;for(leti=2;i<e;++i)n[s++]=i-1,n[s++]=i;returnn[s++]=e-1,n[s]=0,t.indices=n,t.primitiveType=D.LINES,t}functionLe(t){switch(t.primitiveType){caseD.TRIANGLE_FAN:returnIe(t);caseD.TRIANGLE_STRIP:returnSe(t);caseD.TRIANGLES:returnAe(t);caseD.LINE_STRIP:returnge(t);caseD.LINE_LOOP:returnOe(t);caseD.LINES:returnPe(t)}returnt}functiontt(t,e){Math.abs(t.y)<N.EPSILON6&&(e?t.y=-N.EPSILON6:t.y=N.EPSILON6)}functionEe(t,e,n){if(t.y!==0&&e.y!==0&&n.y!==0){tt(t,t.y<0),tt(e,e.y<0),tt(n,n.y<0);return}lets=Math.abs(t.y),i=Math.abs(e.y),c=Math.abs(n.y),o;s>i?s>c?o=N.sign(t.y):o=N.sign(n.y):i>c?o=N.sign(e.y):o=N.sign(n.y);leta=o<0;tt(t,a),tt(e,a),tt(n,a)}varee=newr;functionX(t,e,n,s){r.add(t,r.multiplyByScalar(r.subtract(e,t,ee),t.y/(t.y-e.y),ee),n),r.clone(n,s),tt(n,!0),tt(s,!1)}varnt=newr,it=newr,st=newr,ot=newr,Rt={positions:newArray(7),indices:newArray(3*3)};functionNe(t,e,n){if(t.x>=0||e.x>=0||n.x>=0)return;Ee(t,e,n);lets=t.y<0,i=e.y<0,c=n.y<0,o=0;o+=s?1:0,o+=i?1:0,o+=c?1:0;leta=Rt.indices;o===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,s?(X(t,e,nt,st),X(t,n,it,ot),a[0]=0,a[3]=1,a[4]=2,a[6]=1):i?(X(e,n,nt,st),X(e,t,it,ot),a[0]=1,a[3]=2,a[4]=0,a[6]=2):c&&(X(n,t,nt,st),X(n,e,it,ot),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):o===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,s?i?c||(X(n,t,nt,st),X(n,e,it,ot),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(X(e,n,nt,st),X(e,t,it,ot),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(X(t,e,nt,st),X(t,n,it,ot),a[0]=1,a[1]=2,a[3]=1,a[6]=0));letp=Rt.positions;returnp[0]=t,p[1]=e,p[2]=n,p.length=3,(o===1||o===2)&&(p[3]=nt,p[4]=it,p[5]=st,p[6]=ot,p.length=7),Rt}functionne(t,e){letn=t.attributes;if(n.position.values.length===0)return;for(letiinn)if(n.hasOwnProperty(i)&&f(n[i])&&f(n[i].values)){letc=n[i];c.values=k.createTypedArray(c.componentDatatype,c.values)}lets=B.computeNumberOfVertices(t);returnt.indices=j.createTypedArray(s,t.indices),e&&(t.boundingSphere=rt.fromVertices(n.position.values)),t}functionlt(t){lete=t.attributes,n={};for(letsine)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){leti=e[s];n[s]=newU({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}returnnewB({attributes:n,indices:[],primitiveType:t.primitiveType})}functionkt(t,e,n){lets=f(t.geometry.boundingSphere);e=ne(e,s),n=ne(n,s),f(n)&&!f(e)?t.geometry=n:!f(n)&&f(e)?t.geometry=e:(t.westHemisphereGeometry=e,t.eastHemisphereGeometry=n,t.geometry=void0)}functionFt(t,e){letn=newt,s=newt,i=newt;returnfunction(c,o,a,p,u,d,m,l){leth=t.fromArray(u,c*e,n),y=t.fromArray(u,o*e,s),v=t.fromArray(u,a*e,i);t.multiplyByScalar(h,p.x,h),t.multiplyByScalar(y,p.y,y),t.multiplyByScalar(v,p.z,v);letb=t.add(h,y,h);t.add(b,v,b),l&&t.normalize(b,b),t.pack(b,d,m*e)}}varze=Ft(dt,4),It=Ft(r,3),ae=Ft(R,2),De=function(t,e,n,s,i,c,o){leta=i[t]*s.x,p=i[e]*s.y,u=i[n]*s.z;c[o]=a+p+u>N.EPSILON6?1:0},wt=newr,Gt=newr,Ct=newr,qe=newr;functionTt(t,e,n,s,i,c,o,a,p,u,d,m,l,h,y,v){if(!f(c)&&!f(o)&&!f(a)&&!f(p)&&!f(u)&&h===0)return;letb=r.fromArray(i,t*3,wt),S=r.fromArray(i,e*3,Gt),x=r.fromArray(i,n*3,Ct),w=Ht(s,b,S,x,qe);if(f(w)){if(f(c)&&It(t,e,n,w,c,m.normal.values,v,!0),f(u)){letA=r.fromArray(u,t*3,wt),E=r.fromArray(u,e*3,Gt),P=r.fromArray(u,n*3,Ct);r.multiplyByScalar(A,w.x,A),r.multiplyByScalar(E,w.y,E),r.multiplyByScalar(P,w.z,P);letO;!r.equals(A,r.ZERO)||!r.equals(E,r.ZERO)||!r.equals(P,r.ZERO)?(O=r.add(A,E,A),r.add(O,P,O),r.normalize(O,O)):(O=wt,O.x=0,O.y=0,O.z=0),r.pack(O,m.extrudeDirection.values,v*3)}if(f(d)&&De(t,e,n,w,d,m.applyOffset.values,v),f(o)&&It(t,e,n,w,o,m.tangent.values,v,!0),f(a)&&It(t,e,n,w,a,m.bitangent.values,v,!0),f(p)&&ae(t,e,n,w,p,m.st.values,v),h>0)for(letA=0;A<h;A++){letE=l[A];Ve(t,e,n,w,v,y[E],m[E])}}}functionVe(t,e,n,s,i,c,o){leta=c.componentsPerAttribute,p=c.values,u=o.values;switch(a){case4:ze(t,e,n,s,p,u,i,!1);break;case3:It(t,e,n,s,p,u,i,!1);break;case2:ae(t,e,n,s,p,u,i,!1);break;default:u[i]=p[t]*s.x+p[e]*s.y+p[n]*s.z}}functionQ(t,e,n,s,i,c){leto=t.position.values.length/3;if(i!==-1){leta=s[i],p=n[a];returnp===-1?(n[a]=o,t.position.values.push(c.x,c.y,c.z),e.push(o),o):(e.push(p),p)}returnt.position.values.push(c.x,c.y,c.z),e.push(o),o}varRe={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};functionie(t){lete=t.geometry,n=e.attributes,s=n.position.values,i=f(n.normal)?n.normal.values:void0,c=f(n.bitangent)?n.bitangent.values:void0,o=f(n.tangent)?n.tangent.values:void0,a=f(n.st)?n.st.values:void0,p=f(n.extrudeDirection)?n.extrudeDirection.values:void0,u=f(n.applyOffset)?n.applyOffset.values:void0,d=e.indices,m=[];for(letOinn)n.hasOwnProperty(O)&&!Re[O]&&f(n[O])&&m.push(O);letl=m.length,h=lt(e),y=lt(e),v,b,S,x,w,A=[];A.length=s.length/3;letE=[];for(E.length=s.length/3,w=0;w<A.length;++w)A[w]=-1,E[w]=-1;letP=d.length;for(w=0;w<P;w+=3){letO=d[w],L=d[w+1],g=d[w+2],T=r.fromArray(s,O*3),C=r.fromArray(s,L*3),z=r.fromArray(s,g*3),q=Ne(T,C,z);if(f(q)&&q.positions.length>3){letV=q.positions,G=q.indices,M=G.length;for(letJ=0;J<M;++J){letY=G[J],_=V[Y];_.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=Q(v,b,S,d,Y<3?w+Y:-1,_),Tt(O,L,g,_,s,i,o,c,a,p,u,v,m,l,n,x)}}elsef(q)&&(T=q.positions[0],C=q.positions[1],z=q.positions[2]),T.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=Q(v,b,S,d,w,T),Tt(O,L,g,T,s,i,o,c,a,p,u,v,m,l,n,x),x=Q(v,b,S,d,w+1,C),Tt(O,L,g,C,s,i,o,c,a,p,u,v,m,l,n,x),x=Q(v,b,S,d,w+2,z),Tt(O,L,g,z,s,i,o,c,a,p,u,v,m,l,n,x)}kt(t,y,h)}varue=Et.fromPointNormal(r.ZERO,r.UNIT_Y),Ge=newr,Ce=newr;functionut(t,e,n,s,i,c,o){if(!f(o))return;leta=r.fromArray(s,t*3,wt);r.equalsEpsilon(a,n,N.EPSILON10)?c.applyOffset.values[i]=o[t]:c.applyOffset.values[i]=o[e]}functionse(t){lete=t.geometry,n=e.attributes,s=n.position.values,i=f(n.applyOffset)?n.applyOffset.values:void0,c=e.indices,o=lt(e),a=lt(e),p,u=c.length,d=[];d.length=s.length/3;letm=[];for(m.length=s.length/3,p=0;p<d.length;++p)d[p]=-1,m[p]=-1;for(p=0;p<u;p+=2){letl=c[p],h=c[p+1],y=r.fromArray(s,l*3,wt),v=r.fromArray(s,h*3,Gt),b;Math.abs(y.y)<N.EPSILON6&&(y.y<0?y.y=-N.EPSILON6:y.y=N.EPSILON6),Math.abs(v.y)<N.EPSILON6&&(v.y<0?v.y=-N.EPSILON6:v.y=N.EPSILON6);letS=o.attributes,x=o.indices,w=m,A=a.attributes,E=a.indices,P=d,O=Lt.lineSegmentPlane(y,v,ue,Ct);if(f(O)){letL=r.multiplyByScalar(r.UNIT_Y,5*N.EPSILON9,Ge);y.y<0&&(r.negate(L,L),S=a.attributes,x=a.indices,w=d,A=o.attributes,E=o.indices,P=m);letg=r.add(O,L,Ce);b=Q(S,x,w,c,p,y),ut(l,h,y,s,b,S,i),b=Q(S,x,w,c,-1,g),ut(l,h,g,s,b,S,i),r.negate(L,L),r.add(O,L,g),b=Q(A,E,P,c,-1,g),ut(l,h,g,s,b,A,i),b=Q(A,E,P,c,p+1,v),ut(l,h,v,s,b,A,i)}else{letL,g,T;y.y<0?(L=a.attributes,g=a.indices,T=d):(L=o.attributes,g=o.indices,T=m),b=Q(L,g,T,c,p,y),ut(l,h,y,s,b,L,i),b=Q(L,g,T,c,p+1,v),ut(l,h,v,s,b,L,i)}}kt(t,a,o)}varoe=newR,Be=newR,le=newr,fe=newr,Bt=newr,ke=newr,Fe=newr,Me=newr,re=newdt;functionce(t){lete=t.attributes,n=e.position.values,s=e.prevPosition.values,i=e.nextPosition.values,c=n.length;for(leto=0;o<c;o+=3){leta=r.unpack(n,o,le);if(a.x>0)continue;letp=r.unpack(s,o,fe);(a.y<0&&p.y>0||a.y>0&&p.y<0)&&(o-3>0?(s[o]=n[o-3],s[o+1]=n[o-2],s[o+2]=n[o-1]):r.pack(a,s,o));letu=r.unpack(i,o,Bt);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(o+3<c?(i[o]=n[o+3],i[o+1]=n[o+4],i[o+2]=n[o+5]):r.pack(a,i,o))}}var_e=5*N.EPSILON9,At=N.EPSILON6;functionUe(t){lete=t.geometry,n=e.attributes,s=n.position.values,i=n.prevPosition.values,c=n.nextPosition.values,o=n.expandAndWidth.values,a=f(n.st)?n.st.values:void0,p=f(n.color)?n.color.values:void0,u=lt(e),d=lt(e),m,l,h,y=!1,v=s.length/3;for(m=0;m<v;m+=4){letb=m,S=m+2,x=r.fromArray(s,b*3,le),w=r.fromArray(s,S*3,fe);if(Math.abs(x.y)<At)for(x.y=At*(w.y<0?-1:1),s[m*3+1]=x.y,s[(m+1)*3+1]=x.y,l=b*3;l<b*3+4*3;l+=3)i[l]=s[m*3],i[l+1]=s[m*3+1],i[l+2]=s[m*3+2];if(Math.abs(w.y)<At)for(w.y=At*(x.y<0?-1:1),s[(m+2)*3+1]=w.y,s[(m+3)*3+1]=w.y,l=b*3;l<b*3+4*3;l+=3)c[l]=s[(m+2)*3],c[l+1]=s[(m+2)*3+1],c[l+2]=s[(m+2)*3+2];letA=u.attributes,E=u.indices,P=d.attributes,O=d.indices,L=Lt.lineSegmentPlane(x,w,ue,ke);if(f(L)){y=!0;letg=r.multiplyByScalar(r.UNIT_Y,_e,Fe);x.y<0&&(r.negate(g,g),A=d.attributes,E=d.indices,P=u.attributes,O=u.indices);letT=r.add(L,g,Me);A.position.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.position.values.push(T.x,T.y,T.z),A.position.values.push(T.x,T.y,T.z),A.prevPosition.values.push(i[b*3],i[b*3+1],i[b*3+2]),A.prevPosition.values.push(i[b*3+3],i[b*3+4],i[b*3+5]),A.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),r.negate(g,g),r.add(L,g,T),P.position.values.push(T.x,T.y,T.z),P.position.values.push(T.x,T.y,T.z),P.position.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.nextPosition.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.nextPosition.values.push(c[S*3],c[S*3+1],c[S*3+2]),P.nextPosition.values.push(c[S*3+3],c[S*3+4],c[S*3+5]);letC=R.fromArray(o,b*2,oe),z=Math.abs(C.y);A.expandAndWidth.values.push(-1,z,1,z),A.expandAndWidth.values.push(-1,-z,1,-z),P.expandAndWidth.values.push(-1,z,1,z),P.expandAndWidth.values.push(-1,-z,1,-z);letq=r.magnitudeSquared(r.subtract(L,x,Bt));if(q/=r.magnitudeSquared(r.subtract(w,x,Bt)),f(p)){letV=dt.fromArray(p,b*4,re),G=dt.fromArray(p,S*4,re),M=N.lerp(V.x,G.x,q),J=N.lerp(V.y,G.y,q),Y=N.lerp(V.z,G.z,q),_=N.lerp(V.w,G.w,q);for(l=b*4;l<b*4+2*4;++l)A.color.values.push(p[l]);for(A.color.values.push(M,J,Y,_),A.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),l=S*4;l<S*4+2*4;++l)P.color.values.push(p[l])}if(f(a)){letV=R.fromArray(a,b*2,oe),G=R.fromArray(a,(m+3)*2,Be),M=N.lerp(V.x,G.x,q);for(l=b*2;l<b*2+2*2;++l)A.st.values.push(a[l]);for(A.st.values.push(M,V.y),A.st.values.push(M,G.y),P.st.values.push(M,V.y),P.st.values.push(M,G.y),l=S*2;l<S*2+2*2;++l)P.st.values.push(a[l])}h=A.position.values.length/3-4,E.push(h,h+2,h+1),E.push(h+1,h+2,h+3),h=P.position.values.length/3-4,O.push(h,h+2,h+1),O.push(h+1,h+2,h+3)}else{letg,T;for(x.y<0?(g=d.attributes,T=d.indices):(g=u.attributes,T=u.indices),g.position.values.push(x.x,x.y,x.z),g.position.values.push(x.x,x.y,x.z),g.position.values.push(w.x,w.y,w.z),g.position.values.push(w.x,w.y,w.z),l=m*3;l<m*3+4*3;++l)g.prevPosition.values.push(i[l]),g.nextPosition.values.push(c[l]);for(l=m*2;l<m*2+4*2;++l)g.expandAndWidth.values.push(o[l]),f(a)&&g.st.values.push(a[l]);if(f(p))for(l=m*4;l<m*4+4*4;++l)g.color.values.push(p[l]);h=g.position.values.length/3-4,T.push(h,h+2,h+1),T.push(h+1,h+2,h+3)}}y&&(ce(d),ce(u)),kt(t,d,u)}F.splitLongitude=function(t){if(!f(t))thrownewI("instance is required.");lete=t.geometry,n=e.boundingSphere;if(f(n)&&(n.center.x-n.radius>0||rt.intersectPlane(n,Et.ORIGIN_ZX_PLANE)!==Ut.INTERSECTING))returnt;if(e.geometryType!==mt.NONE)switch(e.geometryType){casemt.POLYLINES:Ue(t);break;casemt.TRIANGLES:ie(t);break;casemt.LINES:se(t);break}elseLe(e),e.primitiveType===D.TRIANGLES?ie(t):e.primitiveType===D.LINES&&se(t);returnt};vargn=F;export{gnasa};
* 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{aasy}from"./chunk-CXNPIJLB.js";import{dasj}from"./chunk-BKSIEBAA.js";import{basd,hasL}from"./chunk-YWRPWWKI.js";import{aasR}from"./chunk-VTVHUB7E.js";import{aass,basW,casT,dasq}from"./chunk-JMSSU44E.js";import{aasw}from"./chunk-4UYSGV57.js";import{aasP}from"./chunk-VLPNAR64.js";import{aasA,basz}from"./chunk-GE5NEIZC.js";import{easl}from"./chunk-35CVRQTC.js";functionx(o,t){z.typeOf.object("ellipsoid",o),this._ellipsoid=o,this._cameraPosition=news,this._cameraPositionInScaledSpace=news,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(x.prototype,{ellipsoid:{get:function(){returnthis._ellipsoid}},cameraPosition:{get:function(){returnthis._cameraPosition},set:function(o){lete=this._ellipsoid.transformPositionToScaledSpace(o,this._cameraPositionInScaledSpace),a=s.magnitudeSquared(e)-1;s.clone(o,this._cameraPosition),this._cameraPositionInScaledSpace=e,this._distanceToLimbInScaledSpaceSquared=a}}});varU=news;x.prototype.isPointVisible=function(o){lete=this._ellipsoid.transformPositionToScaledSpace(o,U);returnF(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};x.prototype.isScaledSpacePointVisible=function(o){returnF(o,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};varat=news;x.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(o,t){lete=this._ellipsoid,a,i;returnl(t)&&t<0&&e.minimumRadius>-t?(i=at,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),a=i.x*i.x+i.y*i.y+i.z*i.z-1):(i=this._cameraPositionInScaledSpace,a=this._distanceToLimbInScaledSpaceSquared),F(o,i,a)};x.prototype.computeHorizonCullingPoint=function(o,t,e){returnQ(this._ellipsoid,o,t,e)};varv=q.clone(q.UNIT_SPHERE);x.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(o,t,e,a){leti=Z(this._ellipsoid,e,v);returnQ(i,o,t,a)};x.prototype.computeHorizonCullingPointFromVertices=function(o,t,e,a,i){returnJ(this._ellipsoid,o,t,e,a,i)};x.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(o,t,e,a,i,c){letn=Z(this._ellipsoid,i,v);returnJ(n,o,t,e,a,c)};varnt=[];x.prototype.computeHorizonCullingPointFromRectangle=function(o,t,e){z.typeOf.object("rectangle",o);leta=L.subsample(o,t,0,nt),i=j.fromPoints(a);if(!(s.magnitude(i.center)<.1*t.minimumRadius))returnthis.computeHorizonCullingPoint(i.center,a,e)};varst=news;functionZ(o,t,e){if(l(t)&&t<0&&o.minimumRadius>-t){leta=s.fromElements(o.radii.x+t,o.radii.y+t,o.radii.z+t,st);o=q.fromCartesian3(a,e)}returno}functionQ(o,t,e,a){z.typeOf.object("directionToPoint",t),z.defined("positions",e),l(a)||(a=news);leti=Y(o,t),c=0;for(letn=0,r=e.length;n<r;++n){letm=e[n],h=K(o,m,i);if(h<0)return;c=Math.max(c,h)}returnX(i,c,a)}varM=news;functionJ(o,t,e,a,i,c){z.typeOf.object("directionToPoint",t),z.defined("vertices",e),z.typeOf.number("stride",a),l(c)||(c=news),a=P(a,3),i=P(i,s.ZERO);letn=Y(o,t),r=0;for(letm=0,h=e.length;m<h;m+=a){M.x=e[m]+i.x,M.y=e[m+1]+i.y,M.z=e[m+2]+i.z;letu=K(o,M,n);if(u<0)return;r=Math.max(r,u)}returnX(n,r,c)}functionF(o,t,e){leta=t,i=e,c=s.subtract(o,a,U),n=-s.dot(c,a);return!(i<0?n>0:n>i&&n*n/s.magnitudeSquared(c)>i)}varct=news,rt=news;functionK(o,t,e){leta=o.transformPositionToScaledSpace(t,ct),i=s.magnitudeSquared(a),c=Math.sqrt(i),n=s.divideByScalar(a,c,rt);i=Math.max(1,i),c=Math.max(1,c);letr=s.dot(n,e),m=s.magnitude(s.cross(n,e,n)),h=1/c,u=Math.sqrt(i-1)*h;return1/(r*h-m*u)}functionX(o,t,e){if(!(t<=0||t===1/0||t!==t))returns.multiplyByScalar(o,t,e)}varD=news;functionY(o,t){returns.equals(t,s.ZERO)?t:(o.transformPositionToScaledSpace(t,D),s.normalize(D,D))}varPt=x;varO={};O.getHeight=function(o,t,e){if(!Number.isFinite(t))thrownewA("scale must be a finite number.");if(!Number.isFinite(e))thrownewA("relativeHeight must be a finite number.");return(o-e)*t+e};varmt=newW;O.getPosition=function(o,t,e,a,i){letc=t.cartesianToCartographic(o,mt);if(!l(c))returns.clone(o,i);letn=O.getHeight(c.height,e,a);returns.fromRadians(c.longitude,c.latitude,n,t,i)};var$=O;vardt={NONE:0,BITS12:1},S=Object.freeze(dt);varC=news,lt=news,f=newT,V=newd,ht=newd,pt=Math.pow(2,12);functionp(o,t,e,a,i,c,n,r,m,h){letu=S.NONE,g,N;if(l(t)&&l(e)&&l(a)&&l(i)){letE=t.minimum,I=t.maximum,_=s.subtract(I,E,lt),tt=a-e;Math.max(s.maximumComponent(_),tt)<pt-1?u=S.BITS12:u=S.NONE,g=d.inverseTransformation(i,newd);letot=s.negate(E,C);d.multiply(d.fromTranslation(ot,V),g,g);letb=C;b.x=1/_.x,b.y=1/_.y,b.z=1/_.z,d.multiply(d.fromScale(b,V),g,g),N=d.clone(i),d.setTranslation(N,s.ZERO,N),i=d.clone(i,newd);letet=d.fromTranslation(E,V),it=d.fromScale(_,ht),k=d.multiply(et,it,V);d.multiply(i,k,i),d.multiply(N,k,N)}this.quantization=u,this.minimumHeight=e,this.maximumHeight=a,this.center=s.clone(o),this.toScaledENU=g,this.fromScaledENU=i,this.matrix=N,this.hasVertexNormals=c,this.hasWebMercatorT=P(n,!1),this.hasGeodeticSurfaceNormals=P(r,!1),this.exaggeration=P(m,1),this.exaggerationRelativeHeight=P(h,0),this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}p.prototype.encode=function(o,t,e,a,i,c,n,r){letm=a.x,h=a.y;if(this.quantization===S.BITS12){e=d.multiplyByPoint(this.toScaledENU,e,C),e.x=w.clamp(e.x,0,1),e.y=w.clamp(e.y,0,1),e.z=w.clamp(e.z,0,1);letu=this.maximumHeight-this.minimumHeight,g=w.clamp((i-this.minimumHeight)/u,0,1);T.fromElements(e.x,e.y,f);letN=y.compressTextureCoordinates(f);T.fromElements(e.z,g,f);letE=y.compressTextureCoordinates(f);T.fromElements(m,h,f);letI=y.compressTextureCoordinates(f);if(o[t++]=N,o[t++]=E,o[t++]=I,this.hasWebMercatorT){T.fromElements(n,0,f);let_=y.compressTextureCoordinates(f);o[t++]=_}}elses.subtract(e,this.center,C),o[t++]=C.x,o[t++]=C.y,o[t++]=C.z,o[t++]=i,o[t++]=m,o[t++]=h,this.hasWebMercatorT&&(o[t++]=n);returnthis.hasVertexNormals&&(o[t++]=y.octPackFloat(c)),this.hasGeodeticSurfaceNormals&&(o[t++]=r.x,o[t++]=r.y,o[t++]=r.z),t};varut=news,B=news;p.prototype.addGeodeticSurfaceNormals=function(o,t,e){if(this.hasGeodeticSurfaceNormals)return;leta=this.stride,i=o.length/a;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();letc=this.stride;for(letn=0;n<i;n++){for(letu=0;u<a;u++){letg=n*a+u,N=n*c+u;t[N]=o[g]}letr=this.decodePosition(t,n,ut),m=e.geodeticSurfaceNormal(r,B),h=n*c+this._offsetGeodeticSurfaceNormal;t[h]=m.x,t[h+1]=m.y,t[h+2]=m.z}};p.prototype.removeGeodeticSurfaceNormals=function(o,t){if(!this.hasGeodeticSurfaceNormals)return;lete=this.stride,a=o.length/e;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();leti=this.stride;for(letc=0;c<a;c++)for(letn=0;n<i;n++){letr=c*e+n,m=c*i+n;t[m]=o[r]}};p.prototype.decodePosition=function(o,t,e){if(l(e)||(e=news),t*=this.stride,this.quantization===S.BITS12){leta=y.decompressTextureCoordinates(o[t],f);e.x=a.x,e.y=a.y;leti=y.decompressTextureCoordinates(o[t+1],f);returne.z=i.x,d.multiplyByPoint(this.fromScaledENU,e,e)}returne.x=o[t],e.y=o[t+1],e.z=o[t+2],s.add(e,this.center,e)};p.prototype.getExaggeratedPosition=function(o,t,e){e=this.decodePosition(o,t,e);leta=this.exaggeration,i=this.exaggerationRelativeHeight;if(a!==1&&this.hasGeodeticSurfaceNormals){letn=this.decodeGeodeticSurfaceNormal(o,t,B),r=this.decodeHeight(o,t),m=$.getHeight(r,a,i)-r;e.x+=n.x*m,e.y+=n.y*m,e.z+=n.z*m}returne};p.prototype.decodeTextureCoordinates=function(o,t,e){returnl(e)||(e=newT),t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+2],e):T.fromElements(o[t+4],o[t+5],e)};p.prototype.decodeHeight=function(o,t){returnt*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+1],f).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:o[t+3]};p.prototype.decodeWebMercatorT=function(o,t){returnt*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+3],f).x:o[t+6]};p.prototype.getOctEncodedNormal=function(o,t,e){t=t*this.stride+this._offsetVertexNormal;leta=o[t]/256,i=Math.floor(a),c=(a-i)*256;returnT.fromElements(i,c,e)};p.prototype.decodeGeodeticSurfaceNormal=function(o,t,e){returnt=t*this.stride+this._offsetGeodeticSurfaceNormal,e.x=o[t],e.y=o[t+1],e.z=o[t+2],e};p.prototype._calculateStrideAndOffsets=function(){leto=0;switch(this.quantization){caseS.BITS12:o+=3;break;default:o+=6}this.hasWebMercatorT&&(o+=1),this.hasVertexNormals&&(this._offsetVertexNormal=o,o+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=o,o+=3),this.stride=o};varG={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},H={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};p.prototype.getAttributes=function(o){lett=R.FLOAT,e=R.getSizeInBytes(t),a=this.stride*e,i=0,c=[];functionn(r,m){c.push({index:r,vertexBuffer:o,componentDatatype:t,componentsPerAttribute:m,offsetInBytes:i,strideInBytes:a}),i+=m*e}if(this.quantization===S.NONE){n(G.position3DAndHeight,4);letr=2;r+=this.hasWebMercatorT?1:0,r+=this.hasVertexNormals?1:0,n(G.textureCoordAndEncodedNormals,r),this.hasGeodeticSurfaceNormals&&n(G.geodeticSurfaceNormal,3)}else{letr=this.hasWebMercatorT||this.hasVertexNormals,m=this.hasWebMercatorT&&this.hasVertexNormals;n(H.compressed0,r?4:3),m&&n(H.compressed1,1),this.hasGeodeticSurfaceNormals&&n(H.geodeticSurfaceNormal,3)}returnc};p.prototype.getAttributeLocations=function(){returnthis.quantization===S.NONE?G:H};p.clone=function(o,t){if(l(o))returnl(t)||(t=newp),t.quantization=o.quantization,t.minimumHeight=o.minimumHeight,t.maximumHeight=o.maximumHeight,t.center=s.clone(o.center),t.toScaledENU=d.clone(o.toScaledENU),t.fromScaledENU=d.clone(o.fromScaledENU),t.matrix=d.clone(o.matrix),t.hasVertexNormals=o.hasVertexNormals,t.hasWebMercatorT=o.hasWebMercatorT,t.hasGeodeticSurfaceNormals=o.hasGeodeticSurfaceNormals,t.exaggeration=o.exaggeration,t.exaggerationRelativeHeight=o.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};varWt=p;export{Ptasa,Wtasb};
* 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{aasS}from"./chunk-IPMQ7HU7.js";import{aasj}from"./chunk-ZFTFDHK4.js";import{aasD}from"./chunk-NNHN6WUY.js";import{aasV}from"./chunk-T7ERZ2CJ.js";import{basT,casB,dasL}from"./chunk-GSNDLQ4C.js";import{dasO}from"./chunk-BKSIEBAA.js";import{aasx}from"./chunk-VTVHUB7E.js";import{aasc,dasl}from"./chunk-JMSSU44E.js";import{aasE}from"./chunk-4UYSGV57.js";import{aasm}from"./chunk-VLPNAR64.js";import{aas_}from"./chunk-GE5NEIZC.js";import{easd}from"./chunk-35CVRQTC.js";varq=newc,M=newc;functionU(e){lett=e.center;M=c.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,M),e.height,M),M=c.add(t,M,M);leti=newO(M,e.semiMajorAxis),f=S.computeEllipsePositions(e,!1,!0).outerPositions,o=newV({position:newL({componentDatatype:x.DOUBLE,componentsPerAttribute:3,values:S.raisePositionsToHeight(f,e,!1)})}),r=f.length/3,u=D.createTypedArray(r,r*2),h=0;for(letn=0;n<r;++n)u[h++]=n,u[h++]=(n+1)%r;return{boundingSphere:i,attributes:o,indices:u}}varN=newO,P=newO;functionR(e){lett=e.center,i=e.ellipsoid,f=e.semiMajorAxis,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,q),e.height,q);N.center=c.add(t,o,N.center),N.radius=f,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),P.center=c.add(t,o,P.center),P.radius=f;letr=S.computeEllipsePositions(e,!1,!0).outerPositions,u=newV({position:newL({componentDatatype:x.DOUBLE,componentsPerAttribute:3,values:S.raisePositionsToHeight(r,e,!0)})});r=u.position.values;leth=O.union(N,P),n=r.length/3;if(d(e.offsetAttribute)){letg=newUint8Array(n);if(e.offsetAttribute===j.TOP)g=g.fill(1,0,n/2);else{letH=e.offsetAttribute===j.NONE?0:1;g=g.fill(H)}u.applyOffset=newL({componentDatatype:x.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}letp=m(e.numberOfVerticalLines,16);p=E.clamp(p,0,n/2);leta=D.createTypedArray(n,n*2+p*2);n/=2;letA=0,s;for(s=0;s<n;++s)a[A++]=s,a[A++]=(s+1)%n,a[A++]=s+n,a[A++]=(s+1)%n+n;letk;if(p>0){letg=Math.min(p,n);k=Math.round(n/g);letH=Math.min(k*p,n);for(s=0;s<H;s+=k)a[A++]=s,a[A++]=s+n}return{boundingSphere:h,attributes:u,indices:a}}functionw(e){e=m(e,m.EMPTY_OBJECT);lett=e.center,i=m(e.ellipsoid,l.default),f=e.semiMajorAxis,o=e.semiMinorAxis,r=m(e.granularity,E.RADIANS_PER_DEGREE);if(!d(t))thrownew_("center is required.");if(!d(f))thrownew_("semiMajorAxis is required.");if(!d(o))thrownew_("semiMinorAxis is required.");if(f<o)thrownew_("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)thrownew_("granularity must be greater than zero.");letu=m(e.height,0),h=m(e.extrudedHeight,u);this._center=c.clone(t),this._semiMajorAxis=f,this._semiMinorAxis=o,this._ellipsoid=l.clone(i),this._rotation=m(e.rotation,0),this._height=Math.max(h,u),this._granularity=r,this._extrudedHeight=Math.min(h,u),this._numberOfVerticalLines=Math.max(m(e.numberOfVerticalLines,16),0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}w.packedLength=c.packedLength+l.packedLength+8;w.pack=function(e,t,i){if(!d(e))thrownew_("value is required");if(!d(t))thrownew_("array is required");returni=m(i,0),c.pack(e._center,t,i),i+=c.packedLength,l.pack(e._ellipsoid,t,i),i+=l.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._numberOfVerticalLines,t[i]=m(e._offsetAttribute,-1),t};vary=newc,C=newl,b={center:y,ellipsoid:C,semiMajorAxis:void0,semiMinorAxis:void0,rotation:void0,height:void0,granularity:void0,extrudedHeight:void0,numberOfVerticalLines:void0,offsetAttribute:void0};w.unpack=function(e,t,i){if(!d(e))thrownew_("array is required");t=m(t,0);letf=c.unpack(e,t,y);t+=c.packedLength;leto=l.unpack(e,t,C);t+=l.packedLength;letr=e[t++],u=e[t++],h=e[t++],n=e[t++],p=e[t++],a=e[t++],A=e[t++],s=e[t];returnd(i)?(i._center=c.clone(f,i._center),i._ellipsoid=l.clone(o,i._ellipsoid),i._semiMajorAxis=r,i._semiMinorAxis=u,i._rotation=h,i._height=n,i._granularity=p,i._extrudedHeight=a,i._numberOfVerticalLines=A,i._offsetAttribute=s===-1?void0:s,i):(b.height=n,b.extrudedHeight=a,b.granularity=p,b.rotation=h,b.semiMajorAxis=r,b.semiMinorAxis=u,b.numberOfVerticalLines=A,b.offsetAttribute=s===-1?void0:s,neww(b))};w.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;lett=e._height,i=e._extrudedHeight,f=!E.equalsEpsilon(t,i,0,E.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);leto={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(f)o.extrudedHeight=i,o.offsetAttribute=e._offsetAttribute,r=R(o);elseif(r=U(o),d(e._offsetAttribute)){letu=r.attributes.position.values.length,h=e._offsetAttribute===j.NONE?0:1,n=newUint8Array(u/3).fill(h);r.attributes.applyOffset=newL({componentDatatype:x.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}returnnewB({attributes:r.attributes,indices:r.indices,primitiveType:T.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};varie=w;export{ieasa};
* 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{bas_,hasI}from"./chunk-YWRPWWKI.js";import{aasn,basN,dasZ,easA}from"./chunk-JMSSU44E.js";import{aascn}from"./chunk-4UYSGV57.js";import{aasT}from"./chunk-VLPNAR64.js";import{aason,bash}from"./chunk-GE5NEIZC.js";import{easx}from"./chunk-35CVRQTC.js";functionV(e){this._ellipsoid=T(e,Z.default),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(V.prototype,{ellipsoid:{get:function(){returnthis._ellipsoid}}});V.prototype.project=function(e,t){leto=this._semimajorAxis,c=e.longitude*o,r=e.latitude*o,d=e.height;returnx(t)?(t.x=c,t.y=r,t.z=d,t):newn(c,r,d)};V.prototype.unproject=function(e,t){if(!x(e))thrownewon("cartesian is required");leto=this._oneOverSemimajorAxis,c=e.x*o,r=e.y*o,d=e.z;returnx(t)?(t.longitude=c,t.latitude=r,t.height=d,t):newN(c,r,d)};vark=V;varmn={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},U=Object.freeze(mn);functionun(e,t){this.start=T(e,0),this.stop=T(t,0)}varrn=un;functiona(e,t){this.center=n.clone(T(e,n.ZERO)),this.radius=T(t,0)}varF=newn,Y=newn,J=newn,K=newn,Q=newn,$=newn,L=newn,b=newn,H=newn,nn=newn,tn=newn,en=newn,xn=4/3*cn.PI;a.fromPoints=function(e,t){if(x(t)||(t=newa),!x(e)||e.length===0)returnt.center=n.clone(n.ZERO,t.center),t.radius=0,t;leto=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;y<z;y++){n.clone(e[y],o);letR=o.x,M=o.y,w=o.z;R<c.x&&n.clone(o,c),R>f.x&&n.clone(o,f),M<r.y&&n.clone(o,r),M>s.y&&n.clone(o,s),w<d.z&&n.clone(o,d),w>m.z&&n.clone(o,m)}letu=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);letp=H;p.x=(C.x+q.x)*.5,p.y=(C.y+q.y)*.5,p.z=(C.z+q.z)*.5;letS=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;letP=tn;P.x=f.x,P.y=s.y,P.z=m.z;letD=n.midpoint(j,P,en),B=0;for(y=0;y<z;y++){n.clone(e[y],o);letR=n.magnitude(n.subtract(o,D,b));R>B&&(B=R);letM=n.magnitudeSquared(n.subtract(o,p,b));if(M>S){letw=Math.sqrt(M);l=(l+w)*.5,S=l*l;letg=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}}returnl<B?(n.clone(p,t.center),t.radius=l):(n.clone(D,t.center),t.radius=B),t};varan=newk,yn=newn,ln=newn,G=newN,X=newN;a.fromRectangle2D=function(e,t,o){returna.fromRectangleWithHeights2D(e,t,0,0,o)};a.fromRectangleWithHeights2D=function(e,t,o,c,r){if(x(r)||(r=newa),!x(e))returnr.center=n.clone(n.ZERO,r.center),r.radius=0,r;an._ellipsoid=Z.default,t=T(t,an),I.southwest(e,G),G.height=o,I.northeast(e,X),X.height=c;letd=t.project(G,yn),f=t.project(X,ln),s=f.x-d.x,m=f.y-d.y,z=f.z-d.z;r.radius=Math.sqrt(s*s+m*m+z*z)*.5;lety=r.center;returny.x=d.x+s*.5,y.y=d.y+m*.5,y.z=d.z+z*.5,r};varpn=[];a.fromRectangle3D=function(e,t,o,c){if(t=T(t,Z.default),o=T(o,0),x(c)||(c=newa),!x(e))returnc.center=n.clone(n.ZERO,c.center),c.radius=0,c;letr=I.subsample(e,t,o,pn);returna.fromPoints(r,c)};a.fromVertices=function(e,t,o,c){if(x(c)||(c=newa),!x(e)||e.length===0)returnc.center=n.clone(n.ZERO,c.center),c.radius=0,c;t=T(t,n.ZERO),o=T(o,3),h.typeOf.number.greaterThanOrEquals("stride",o,3);letr=L;r.x=e[0]+t.x,r.y=e[1]+t.y,r.z=e[2]+t.z;letd=n.clone(r,F),f=n.clone(r,Y),s=n.clone(r,J),m=n.clone(r,K),z=n.clone(r,Q),y=n.clone(r,$),u=e.length,i;for(i=0;i<u;i+=o){letw=e[i]+t.x,g=e[i+1]+t.y,E=e[i+2]+t.z;r.x=w,r.y=g,r.z=E,w<d.x&&n.clone(r,d),w>m.x&&n.clone(r,m),g<f.y&&n.clone(r,f),g>z.y&&n.clone(r,z),E<s.z&&n.clone(r,s),E>y.z&&n.clone(r,y)}letv=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);letl=H;l.x=(O.x+p.x)*.5,l.y=(O.y+p.y)*.5,l.z=(O.z+p.z)*.5;letj=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;letB=tn;B.x=m.x,B.y=z.y,B.z=y.z;letR=n.midpoint(D,B,en),M=0;for(i=0;i<u;i+=o){r.x=e[i]+t.x,r.y=e[i+1]+t.y,r.z=e[i+2]+t.z;letw=n.magnitude(n.subtract(r,R,b));w>M&&(M=w);letg=n.magnitudeSquared(n.subtract(r,l,b));if(g>j){letE=Math.sqrt(g);P=(P+E)*.5,j=P*P;letW=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}}returnP<M?(n.clone(l,c.center),c.radius=P):(n.clone(R,c.center),c.radius=M),c};a.fromEncodedCartesianVertices=function(e,t,o){if(x(o)||(o=newa),!x(e)||!x(t)||e.length!==t.length||e.length===0)returno.center=n.clone(n.ZERO,o.center),o.radius=0,o;letc=L;c.x=e[0]+t[0],c.y=e[1]+t[1],c.z=e[2]+t[2];letr=n.clone(c,F),d=n.clone(c,Y),f=n.clone(c,J),s=n.clone(c,K),m=n.clone(c,Q),z=n.clone(c,$),y=e.length,u;for(u=0;u<y;u+=3){letM=e[u]+t[u],w=e[u+1]+t[u+1],g=e[u+2]+t[u+2];c.x=M,c.y=w,c.z=g,M<r.x&&n.clone(c,r),M>s.x&&n.clone(c,s),w<d.y&&n.clone(c,d),w>m.y&&n.clone(c,m),g<f.z&&n.clone(c,f),g>z.z&&n.clone(c,z)}leti=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);letS=H;S.x=(q.x+O.x)*.5,S.y=(q.y+O.y)*.5,S.z=(q.z+O.z)*.5;letl=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;letD=tn;D.x=s.x,D.y=m.y,D.z=z.z;letB=n.midpoint(P,D,en),R=0;for(u=0;u<y;u+=3){c.x=e[u]+t[u],c.y=e[u+1]+t[u+1],c.z=e[u+2]+t[u+2];letM=n.magnitude(n.subtract(c,B,b));M>R&&(R=M);letw=n.magnitudeSquared(n.subtract(c,S,b));if(w>l){letg=Math.sqrt(w);j=(j+g)*.5,l=j*j;letE=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}}returnj<R?(n.clone(S,o.center),o.radius=j):(n.clone(B,o.center),o.radius=R),o};a.fromCornerPoints=function(e,t,o){h.typeOf.object("corner",e),h.typeOf.object("oppositeCorner",t),x(o)||(o=newa);letc=n.midpoint(e,t,o.center);returno.radius=n.distance(c,t),o};a.fromEllipsoid=function(e,t){returnh.typeOf.object("ellipsoid",e),x(t)||(t=newa),n.clone(n.ZERO,t.center),t.radius=e.maximumRadius,t};varhn=newn;a.fromBoundingSpheres=function(e,t){if(x(t)||(t=newa),!x(e)||e.length===0)returnt.center=n.clone(n.ZERO,t.center),t.radius=0,t;leto=e.length;if(o===1)returna.clone(e[0],t);if(o===2)returna.union(e[0],e[1],t);letc=[],r;for(r=0;r<o;r++)c.push(e[r].center);t=a.fromPoints(c,t);letd=t.center,f=t.radius;for(r=0;r<o;r++){lets=e[r];f=Math.max(f,n.distance(d,s.center,hn)+s.radius)}returnt.radius=f,t};varzn=newn,Sn=newn,wn=newn;a.fromOrientedBoundingBox=function(e,t){h.defined("orientedBoundingBox",e),x(t)||(t=newa);leto=e.halfAxes,c=A.getColumn(o,0,zn),r=A.getColumn(o,1,Sn),d=A.getColumn(o,2,wn);returnn.add(c,r,c),n.add(c,d,c),t.center=n.clone(e.center,t.center),t.radius=n.magnitude(c),t};varPn=newn,gn=newn;a.fromTransformation=function(e,t){h.typeOf.object("transformation",e),x(t)||(t=newa);leto=_.getTranslation(e,Pn),c=_.getScale(e,gn),r=.5*n.magnitude(c);returnt.center=n.clone(o,t.center),t.radius=r,t};a.clone=function(e,t){if(x(e))returnx(t)?(t.center=n.clone(e.center,t.center),t.radius=e.radius,t):newa(e.center,e.radius)};a.packedLength=4;a.pack=function(e,t,o){h.typeOf.object("value",e),h.defined("array",t),o=T(o,0);letc=e.center;returnt[o++]=c.x,t[o++]=c.y,t[o++]=c.z,t[o]=e.radius,t};a.unpack=function(e,t,o){h.defined("array",e),t=T(t,0),x(o)||(o=newa);letc=o.center;returnc.x=e[t++],c.y=e[t++],c.z=e[t++],o.radius=e[t],o};varOn=newn,jn=newn;a.union=function(e,t,o){h.typeOf.object("left",e),h.typeOf.object("right",t),x(o)||(o=newa);letc=e.center,r=e.radius,d=t.center,f=t.radius,s=n.subtract(d,c,On),m=n.magnitude(s);if(r>=m+f)returne.clone(o),o;if(f>=m+r)returnt.clone(o),o;letz=(r+m+f)*.5,y=n.multiplyByScalar(s,(-r+z)/m,jn);returnn.add(y,c,y),n.clone(y,o.center),o.radius=z,o};varbn=newn;a.expand=function(e,t,o){h.typeOf.object("sphere",e),h.typeOf.object("point",t),o=a.clone(e,o);letc=n.magnitude(n.subtract(t,o.center,bn));returnc>o.radius&&(o.radius=c),o};a.intersectPlane=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("plane",t);leto=e.center,c=e.radius,r=t.normal,d=n.dot(r,o)+t.distance;returnd<-c?U.OUTSIDE:d<c?U.INTERSECTING:U.INSIDE};a.transform=function(e,t,o){returnh.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=newa),o.center=_.multiplyByPoint(t,e.center,o.center),o.radius=_.getMaximumScale(t)*e.radius,o};varqn=newn;a.distanceSquaredTo=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("cartesian",t);leto=n.subtract(e.center,t,qn),c=n.magnitude(o)-e.radius;returnc<=0?0:c*c};a.transformWithoutScale=function(e,t,o){returnh.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=newa),o.center=_.multiplyByPoint(t,e.center,o.center),o.radius=e.radius,o};varMn=newn;a.computePlaneDistances=function(e,t,o,c){h.typeOf.object("sphere",e),h.typeOf.object("position",t),h.typeOf.object("direction",o),x(c)||(c=newrn);letr=n.subtract(e.center,t,Mn),d=n.dot(o,r);returnc.start=d-e.radius,c.stop=d+e.radius,c};vardn=newn,Tn=newn,Cn=newn,Rn=newn,En=newn,Dn=newN,sn=newArray(8);for(lete=0;e<8;++e)sn[e]=newn;varfn=newk;a.projectTo2D=function(e,t,o){h.typeOf.object("sphere",e),fn._ellipsoid=Z.default,t=T(t,fn);letc=t.ellipsoid,r=e.center,d=e.radius,f;n.equals(r,n.ZERO)?f=n.clone(n.UNIT_X,dn):f=c.geodeticSurfaceNormal(r,dn);lets=n.cross(n.UNIT_Z,f,Tn);n.normalize(s,s);letm=n.cross(f,s,Cn);n.normalize(m,m),n.multiplyByScalar(f,d,f),n.multiplyByScalar(m,d,m),n.multiplyByScalar(s,d,s);letz=n.negate(m,En),y=n.negate(s,Rn),u=sn,i=u[0];n.add(f,m,i),n.add(i,s,i),i=u[1],n.add(f,m,i),n.add(i,y,i),i=u[2],n.add(f,z,i),n.add(i,y,i),i=u[3],n.add(f,z,i),n.add(i,s,i),n.negate(f,f),i=u[4],n.add(f,m,i),n.add(i,s,i),i=u[5],n.add(f,m,i),n.add(i,y,i),i=u[6],n.add(f,z,i),n.add(i,y,i),i=u[7],n.add(f,z,i),n.add(i,s,i);letv=u.length;for(letp=0;p<v;++p){letS=u[p];n.add(r,S,S);letl=c.cartesianToCartographic(S,Dn);t.project(l,S)}o=a.fromPoints(u,o),r=o.center;letC=r.x,q=r.y,O=r.z;returnr.x=O,r.y=C,r.z=q,o};a.isOccluded=function(e,t){returnh.typeOf.object("sphere",e),h.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)};a.equals=function(e,t){returne===t||x(e)&&x(t)&&n.equals(e.center,t.center)&&e.radius===t.radius};a.prototype.intersectPlane=function(e){returna.intersectPlane(this,e)};a.prototype.distanceSquaredTo=function(e){returna.distanceSquaredTo(this,e)};a.prototype.computePlaneDistances=function(e,t,o){returna.computePlaneDistances(this,e,t,o)};a.prototype.isOccluded=function(e){returna.isOccluded(this,e)};a.prototype.equals=function(e){returna.equals(this,e)};a.prototype.clone=function(e){returna.clone(this,e)};a.prototype.volume=function(){lete=this.radius;returnxn*e*e*e};varet=a;export{kasa,Uasb,rnasc,etasd};
* 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{aasw,basz,iasS}from"./chunk-YWRPWWKI.js";import{aasy}from"./chunk-VTVHUB7E.js";import{aasC,casT,easx}from"./chunk-JMSSU44E.js";import{aash}from"./chunk-4UYSGV57.js";import{aasu,basa}from"./chunk-GE5NEIZC.js";import{easb}from"./chunk-35CVRQTC.js";varc={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};c.getMathType=function(e){switch(e){casec.SCALAR:returnNumber;casec.VEC2:returnT;casec.VEC3:returnC;casec.VEC4:returnw;casec.MAT2:returnS;casec.MAT3:returnx;casec.MAT4:returnz;default:thrownewu("attributeType is not a valid value.")}};c.getNumberOfComponents=function(e){switch(e){casec.SCALAR:return1;casec.VEC2:return2;casec.VEC3:return3;casec.VEC4:casec.MAT2:return4;casec.MAT3:return9;casec.MAT4:return16;default:thrownewu("attributeType is not a valid value.")}};c.getAttributeLocationCount=function(e){switch(e){casec.SCALAR:casec.VEC2:casec.VEC3:casec.VEC4:return1;casec.MAT2:return2;casec.MAT3:return3;casec.MAT4:return4;default:thrownewu("attributeType is not a valid value.")}};c.getGlslType=function(e){switch(a.typeOf.string("attributeType",e),e){casec.SCALAR:return"float";casec.VEC2:return"vec2";casec.VEC3:return"vec3";casec.VEC4:return"vec4";casec.MAT2:return"mat2";casec.MAT3:return"mat3";casec.MAT4:return"mat4";default:thrownewu("attributeType is not a valid value.")}};varN=Object.freeze(c);varV=1/256,D=256,r={};r.octEncodeInRange=function(e,t,n){a.defined("vector",e),a.defined("result",n);leto=C.magnitudeSquared(e);if(Math.abs(o-1)>h.EPSILON6)thrownewu("vector must be normalized.");if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){leti=n.x,d=n.y;n.x=(1-Math.abs(d))*h.signNotZero(i),n.y=(1-Math.abs(i))*h.signNotZero(d)}returnn.x=h.toSNorm(n.x,t),n.y=h.toSNorm(n.y,t),n};r.octEncode=function(e,t){returnr.octEncodeInRange(e,255,t)};varA=newT,F=newUint8Array(1);functionE(e){returnF[0]=e,F[0]}r.octEncodeToCartesian4=function(e,t){returnr.octEncodeInRange(e,65535,A),t.x=E(A.x*V),t.y=E(A.x),t.z=E(A.y*V),t.w=E(A.y),t};r.octDecodeInRange=function(e,t,n,o){if(a.defined("result",o),e<0||e>n||t<0||t>n)thrownewu(`x and y must be unsigned normalized integers between 0 and ${n}`);if(o.x=h.fromSNorm(e,n),o.y=h.fromSNorm(t,n),o.z=1-(Math.abs(o.x)+Math.abs(o.y)),o.z<0){leti=o.x;o.x=(1-Math.abs(o.y))*h.signNotZero(i),o.y=(1-Math.abs(i))*h.signNotZero(o.y)}returnC.normalize(o,o)};r.octDecode=function(e,t,n){returnr.octDecodeInRange(e,t,255,n)};r.octDecodeFromCartesian4=function(e,t){a.typeOf.object("encoded",e),a.typeOf.object("result",t);letn=e.x,o=e.y,i=e.z,d=e.w;if(n<0||n>255||o<0||o>255||i<0||i>255||d<0||d>255)thrownewu("x, y, z, and w must be unsigned normalized integers between 0 and 255");letf=n*D+o,s=i*D+d;returnr.octDecodeInRange(f,s,65535,t)};r.octPackFloat=function(e){returna.defined("encoded",e),256*e.x+e.y};varl=newT;r.octEncodeFloat=function(e){returnr.octEncode(e,l),r.octPackFloat(l)};r.octDecodeFloat=function(e,t){a.defined("value",e);letn=e/256,o=Math.floor(n),i=(n-o)*256;returnr.octDecode(o,i,t)};r.octPack=function(e,t,n,o){a.defined("v1",e),a.defined("v2",t),a.defined("v3",n),a.defined("result",o);leti=r.octEncodeFloat(e),d=r.octEncodeFloat(t),f=r.octEncode(n,l);returno.x=65536*f.x+i,o.y=65536*f.y+d,o};r.octUnpack=function(e,t,n,o){a.defined("packed",e),a.defined("v1",t),a.defined("v2",n),a.defined("v3",o);leti=e.x/65536,d=Math.floor(i),f=(i-d)*65536;i=e.y/65536;lets=Math.floor(i),m=(i-s)*65536;r.octDecodeFloat(f,t),r.octDecodeFloat(m,n),r.octDecode(d,s,o)};r.compressTextureCoordinates=function(e){a.defined("textureCoordinates",e);lett=e.x*4095|0,n=e.y*4095|0;return4096*t+n};r.decompressTextureCoordinates=function(e,t){a.defined("compressed",e),a.defined("result",t);letn=e/4096,o=Math.floor(n);returnt.x=o/4095,t.y=(e-o*4096)/4095,t};functiong(e){returne>>1^-(e&1)}r.zigZagDeltaDecode=function(e,t,n){a.defined("uBuffer",e),a.defined("vBuffer",t),a.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),b(n)&&a.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);leto=e.length,i=0,d=0,f=0;for(lets=0;s<o;++s)i+=g(e[s]),d+=g(t[s]),e[s]=i,t[s]=d,b(n)&&(f+=g(n[s]),n[s]=f)};r.dequantize=function(e,t,n,o){a.defined("typedArray",e),a.defined("componentDatatype",t),a.defined("type",n),a.defined("count",o);leti=N.getNumberOfComponents(n),d;switch(t){casey.BYTE:d=127;break;casey.UNSIGNED_BYTE:d=255;break;casey.SHORT:d=32767;break;casey.UNSIGNED_SHORT:d=65535;break;casey.INT:d=2147483647;break;casey.UNSIGNED_INT:d=4294967295;break;default:thrownewu(`Cannot dequantize component datatype: ${t}`)}letf=newFloat32Array(o*i);for(lets=0;s<o;s++)for(letm=0;m<i;m++){letp=s*i+m;f[p]=Math.max(e[p]/d,-1)}returnf};r.decodeRGB565=function(e,t){a.defined("typedArray",e);letn=e.length*3;b(t)&&a.typeOf.number.equals("result.length","typedArray.length * 3",t.length,n);leto=e.length;b(t)||(t=newFloat32Array(o*3));leti=31,d=63,f=1/31,s=1/63;for(letm=0;m<o;m++){letp=e[m],R=p>>11,I=p>>5&d,O=p&i,M=3*m;t[M]=R*f,t[M+1]=I*s,t[M+2]=O*f}returnt};varW=r;export{Wasa};
* 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{aasp,basP,dasq}from"./chunk-JMSSU44E.js";import{a}from"./chunk-4UYSGV57.js";import{aasT}from"./chunk-VLPNAR64.js";import{aasI,basg}from"./chunk-GE5NEIZC.js";import{easl}from"./chunk-35CVRQTC.js";functiony(n,i,o){if(n===0)returni*o;lett=n*n,e=t*t,c=e*t,r=c*t,h=r*t,s=h*t,d=o,u=Math.sin(2*d),f=Math.sin(4*d),M=Math.sin(6*d),_=Math.sin(8*d),E=Math.sin(10*d),S=Math.sin(12*d);returni*((1-t/4-3*e/64-5*c/256-175*r/16384-441*h/65536-4851*s/1048576)*d-(3*t/8+3*e/32+45*c/1024+105*r/4096+2205*h/131072+6237*s/524288)*u+(15*e/256+45*c/1024+525*r/16384+1575*h/65536+155925*s/8388608)*f-(35*c/3072+175*r/12288+3675*h/262144+13475*s/1048576)*M+(315*r/131072+2205*h/524288+43659*s/8388608)*_-(693*h/1310720+6237*s/5242880)*E+1001*s/8388608*S)}functionz(n,i,o){lett=n/o;if(i===0)returnt;lete=t*t,c=e*t,r=c*t,h=i,s=h*h,d=s*s,u=d*s,f=u*s,M=f*s,_=M*s,E=Math.sin(2*t),S=Math.cos(2*t),W=Math.sin(4*t),V=Math.cos(4*t),C=Math.sin(6*t),N=Math.cos(6*t),R=Math.sin(8*t),b=Math.cos(8*t),x=Math.sin(10*t),U=Math.cos(10*t),H=Math.sin(12*t);returnt+t*s/4+7*t*d/64+15*t*u/256+579*t*f/16384+1515*t*M/65536+16837*t*_/1048576+(3*t*d/16+45*t*u/256-t*(32*e-561)*f/4096-t*(232*e-1677)*M/16384+t*(399985-90560*e+512*r)*_/5242880)*S+(21*t*u/256+483*t*f/4096-t*(224*e-1969)*M/16384-t*(33152*e-112599)*_/1048576)*V+(151*t*f/4096+4681*t*M/65536+1479*t*_/16384-453*c*_/32768)*N+(1097*t*M/65536+42783*t*_/1048576)*b+8011*t*_/1048576*U+(3*s/8+3*d/16+213*u/2048-3*e*u/64+255*f/4096-33*e*f/512+20861*M/524288-33*e*M/512+r*M/1024+28273*_/1048576-471*e*_/8192+9*r*_/4096)*E+(21*d/256+21*u/256+533*f/8192-21*e*f/512+197*M/4096-315*e*M/4096+584039*_/16777216-12517*e*_/131072+7*r*_/2048)*W+(151*u/6144+151*f/4096+5019*M/131072-453*e*M/16384+26965*_/786432-8607*e*_/131072)*C+(1097*f/131072+1097*M/65536+225797*_/10485760-1097*e*_/65536)*R+(8011*M/2621440+8011*_/1048576)*x+293393*_/251658240*H}functionO(n,i){if(n===0)returnMath.log(Math.tan(.5*(a.PI_OVER_TWO+i)));leto=n*Math.sin(i);returnMath.log(Math.tan(.5*(a.PI_OVER_TWO+i)))-n/2*Math.log((1+o)/(1-o))}functionk(n,i,o,t,e){letc=O(n._ellipticity,o),r=O(n._ellipticity,e);returnMath.atan2(a.negativePiToPi(t-i),r-c)}functionA(n,i,o,t,e,c,r){leth=n._heading,s=c-t,d=0;if(a.equalsEpsilon(Math.abs(h),a.PI_OVER_TWO,a.EPSILON8))if(i===o)d=i*Math.cos(e)*a.negativePiToPi(s);else{letu=Math.sin(e);d=i*Math.cos(e)*a.negativePiToPi(s)/Math.sqrt(1-n._ellipticitySquared*u*u)}else{letu=y(n._ellipticity,i,e);d=(y(n._ellipticity,i,r)-u)/Math.cos(h)}returnMath.abs(d)}varB=newp,w=newp;functionD(n,i,o,t){lete=p.normalize(t.cartographicToCartesian(i,w),B),c=p.normalize(t.cartographicToCartesian(o,w),w);g.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(p.angleBetween(e,c))-Math.PI),.0125);letr=t.maximumRadius,h=t.minimumRadius,s=r*r,d=h*h;n._ellipticitySquared=(s-d)/s,n._ellipticity=Math.sqrt(n._ellipticitySquared),n._start=P.clone(i,n._start),n._start.height=0,n._end=P.clone(o,n._end),n._end.height=0,n._heading=k(n,i.longitude,i.latitude,o.longitude,o.latitude),n._distance=A(n,t.maximumRadius,t.minimumRadius,i.longitude,i.latitude,o.longitude,o.latitude)}functionv(n,i,o,t,e,c){if(o===0)returnP.clone(n,c);letr=e*e,h,s,d;if(Math.abs(a.PI_OVER_TWO-Math.abs(i))>a.EPSILON8){letu=y(e,t,n.latitude),f=o*Math.cos(i),M=u+f;if(s=z(M,e,t),Math.abs(i)<a.EPSILON10)h=a.negativePiToPi(n.longitude);else{let_=O(e,n.latitude),E=O(e,s);d=Math.tan(i)*(E-_),h=a.negativePiToPi(n.longitude+d)}}else{s=n.latitude;letu;if(e===0)u=t*Math.cos(n.latitude);else{letf=Math.sin(n.latitude);u=t*Math.cos(n.latitude)/Math.sqrt(1-r*f*f)}d=o/u,i>0?h=a.negativePiToPi(n.longitude+d):h=a.negativePiToPi(n.longitude-d)}returnl(c)?(c.longitude=h,c.latitude=s,c.height=0,c):newP(h,s,0)}functionm(n,i,o){lett=T(o,q.default);this._ellipsoid=t,this._start=newP,this._end=newP,this._heading=void0,this._distance=void0,this._ellipticity=void0,this._ellipticitySquared=void0,l(n)&&l(i)&&D(this,n,i,t)}Object.defineProperties(m.prototype,{ellipsoid:{get:function(){returnthis._ellipsoid}},surfaceDistance:{get:function(){returng.defined("distance",this._distance),this._distance}},start:{get:function(){returnthis._start}},end:{get:function(){returnthis._end}},heading:{get:function(){returng.defined("distance",this._distance),this._heading}}});m.fromStartHeadingDistance=function(n,i,o,t,e){g.defined("start",n),g.defined("heading",i),g.defined("distance",o),g.typeOf.number.greaterThan("distance",o,0);letc=T(t,q.default),r=c.maximumRadius,h=c.minimumRadius,s=r*r,d=h*h,u=Math.sqrt((s-d)/s);i=a.negativePiToPi(i);letf=v(n,i,o,c.maximumRadius,u);return!l(e)||l(t)&&!t.equals(e.ellipsoid)?newm(n,f,c):(e.setEndPoints(n,f),e)};m.prototype.setEndPoints=function(n,i){g.defined("start",n),g.defined("end",i),D(this,n,i,this._ellipsoid)};m.prototype.interpolateUsingFraction=function(n,i){returnthis.interpolateUsingSurfaceDistance(n*this._distance,i)};m.prototype.interpolateUsingSurfaceDistance=function(n,i){if(g.typeOf.number("distance",n),!l(this._distance)||this._distance===0)thrownewI("EllipsoidRhumbLine must have distinct start and end set.");returnv(this._start,this._heading,n,this._ellipsoid.maximumRadius,this._ellipticity,i)};m.prototype.findIntersectionWithLongitude=function(n,i){if(g.typeOf.number("intersectionLongitude",n),!l(this._distance)||this._distance===0)thrownewI("EllipsoidRhumbLine must have distinct start and end set.");leto=this._ellipticity,t=this._heading,e=Math.abs(t),c=this._start;if(n=a.negativePiToPi(n),a.equalsEpsilon(Math.abs(n),Math.PI,a.EPSILON14)&&(n=a.sign(c.longitude)*Math.PI),l(i)||(i=newP),Math.abs(a.PI_OVER_TWO-e)<=a.EPSILON8)returni.longitude=n,i.latitude=c.latitude,i.height=0,i;if(a.equalsEpsilon(Math.abs(a.PI_OVER_TWO-e),a.PI_OVER_TWO,a.EPSILON8))returna.equalsEpsilon(n,c.longitude,a.EPSILON12)?void0:(i.longitude=n,i.latitude=a.PI_OVER_TWO*a.sign(a.PI_OVER_TWO-t),i.height=0,i);letr=c.latitude,h=o*Math.sin(r),s=Math.tan(.5*(a.PI_OVER_TWO+r))*Math.exp((n-c.longitude)/Math.tan(t)),d=(1+h)/(1-h),u=c.latitude,f;do{f=u;letM=o*Math.sin(f),_=(1+M)/(1-M);u=2*Math.atan(s*Math.pow(_/d,o/2))-a.PI_OVER_TWO}while(!a.equalsEpsilon(u,f,a.EPSILON12));returni.longitude=n,i.latitude=u,i.height=0,i};m.prototype.findIntersectionWithLatitude=function(n,i){if(g.typeOf.number("intersectionLatitude",n),!l(this._distance)||this._distance===0)thrownewI("EllipsoidRhumbLine must have distinct start and end set.");leto=this._ellipticity,t=this._heading,e=this._start;if(a.equalsEpsilon(Math.abs(t),a.PI_OVER_TWO,a.EPSILON8))return;letc=O(o,e.latitude),r=O(o,n),h=Math.tan(t)*(r-c),s=a.negativePiToPi(e.longitude+h);returnl(i)?(i.longitude=s,i.latitude=n,i.height=0,i):newP(s,n,0)};var$=m;export{$asa};
* 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{aasl,basd}from"./chunk-YWRPWWKI.js";import{aast}from"./chunk-JMSSU44E.js";import{aass}from"./chunk-4UYSGV57.js";import{aasf,basr}from"./chunk-GE5NEIZC.js";import{easm}from"./chunk-35CVRQTC.js";functiono(e,n){if(r.typeOf.object("normal",e),!s.equalsEpsilon(t.magnitude(e),1,s.EPSILON6))thrownewf("normal must be normalized.");r.typeOf.number("distance",n),this.normal=t.clone(e),this.distance=n}o.fromPointNormal=function(e,n,a){if(r.typeOf.object("point",e),r.typeOf.object("normal",n),!s.equalsEpsilon(t.magnitude(n),1,s.EPSILON6))thrownewf("normal must be normalized.");letc=-t.dot(n,e);returnm(a)?(t.clone(n,a.normal),a.distance=c,a):newo(n,c)};varb=newt;o.fromCartesian4=function(e,n){r.typeOf.object("coefficients",e);leta=t.fromCartesian4(e,b),c=e.w;if(!s.equalsEpsilon(t.magnitude(a),1,s.EPSILON6))thrownewf("normal must be normalized.");returnm(n)?(t.clone(a,n.normal),n.distance=c,n):newo(a,c)};o.getPointDistance=function(e,n){returnr.typeOf.object("plane",e),r.typeOf.object("point",n),t.dot(e.normal,n)+e.distance};vary=newt;o.projectPointOntoPlane=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("point",n),m(a)||(a=newt);letc=o.getPointDistance(e,n),p=t.multiplyByScalar(e.normal,c,y);returnt.subtract(n,p,a)};varw=newd,j=newl,N=newt;o.transform=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("transform",n);letc=e.normal,p=e.distance,u=d.inverseTranspose(n,w),i=l.fromElements(c.x,c.y,c.z,p,j);i=d.multiplyByVector(u,i,i);letO=t.fromCartesian4(i,N);returni=l.divideByScalar(i,t.magnitude(O),i),o.fromCartesian4(i,a)};o.clone=function(e,n){returnr.typeOf.object("plane",e),m(n)?(t.clone(e.normal,n.normal),n.distance=e.distance,n):newo(e.normal,e.distance)};o.equals=function(e,n){returnr.typeOf.object("left",e),r.typeOf.object("right",n),e.distance===n.distance&&t.equals(e.normal,n.normal)};o.ORIGIN_XY_PLANE=Object.freeze(newo(t.UNIT_Z,0));o.ORIGIN_YZ_PLANE=Object.freeze(newo(t.UNIT_X,0));o.ORIGIN_ZX_PLANE=Object.freeze(newo(t.UNIT_Y,0));varT=o;export{Tasa};