define(["./when-92c6cf3c","./Rectangle-bab7abf0","./ArcType-31298545","./arrayFill-0358accf","./BoundingRectangle-418864a2","./buildModuleUrl-3d15f25c","./Cartesian2-6033fa5d","./Cartographic-67e73ef9","./Check-52a7d806","./ComponentDatatype-81047f82","./EllipsoidGeodesic-04ac0e77","./EllipsoidTangentPlane-53184efd","./GeometryAttribute-ef657318","./GeometryInstance-da5e91bc","./GeometryOffsetAttribute-b4d599f5","./GeometryPipeline-f4eddf07","./IndexDatatype-4c0e98b8","./Math-92c3b5f7","./PrimitiveType-cdfe443e","./PolygonGeometryLibrary-7c66403e","./PolygonPipeline-b86e8785","./VertexFormat-f496a3f1","./WindingOrder-1b9c8a87","./Intersect-b97e930a","./Event-3390cd7d","./RuntimeError-c6a62a80","./WebGLConstants-71f10989","./Cartesian4-ad128b5d","./IntersectionTests-a42760d9","./Plane-f8d22530","./FeatureDetection-067cb23c","./AttributeCompression-49f7b62a","./EncodedCartesian3-b86c8d65","./arrayRemoveDuplicates-f7eaafa2","./EllipsoidRhumbLine-8847d1a1","./GeometryAttributes-7f66ea53"],(function(t,e,o,r,i,n,a,s,l,u,p,c,d,g,h,y,m,f,_,v,b,T,w,x,A,P,E,I,C,H,N,O,R,D,F,G){"use strict";var L=new s.t$1,B=new s.t$1;function S(t,e,o,r){var i=r.cartesianToCartographic(t,L).height,n=r.cartesianToCartographic(e,B);n.height=i,r.cartographicToCartesian(n,e);var a=r.cartesianToCartographic(o,B);a.height=i-100,r.cartographicToCartesian(a,o)}var V=new i.f,k=new s.t,z=new s.t,M=new s.t,W=new s.t,U=new s.t,Y=new s.t,j=new s.t,$=new s.t,q=new s.t,K=new a.o,Q=new a.o,Z=new s.t,J=new d.n,X=new _.p,tt=new _.p;function et(e){var o=e.vertexFormat,i=e.geometry,n=e.shadowVolume,l=i.attributes.position.values,p=l.length,c=e.wall,g=e.top,y=e.bottom;if(o.st||o.normal||o.tangent||o.bitangent||n){var m=e.boundingRectangle,v=e.tangentPlane,b=e.ellipsoid,T=e.stRotation,w=e.perPositionHeight,x=K;x.x=m.x,x.y=m.y;var A,P=e.isComputeTexCoord?new Float32Array(p):new Float32Array(p/3*2),E=o.st?P:void 0;o.normal&&(A=w&&g&&!c?i.attributes.normal.values:new Float32Array(p));var I=o.tangent?new Float32Array(p):void 0,C=o.bitangent?new Float32Array(p):void 0,H=n?new Float32Array(p):void 0,N=0,O=0,R=z,D=M,F=W,G=!0,L=X,B=tt;if(0!==T){var V=d.n.fromAxisAngle(v._plane.normal,T,J);L=_.p.fromQuaternion(V,L),V=d.n.fromAxisAngle(v._plane.normal,-T,J),B=_.p.fromQuaternion(V,B)}else L=_.p.clone(_.p.IDENTITY,L),B=_.p.clone(_.p.IDENTITY,B);var et=0;(g&&y||c)&&(et=p/2,p/=2);var ot=1,rt=[];if(o.st&&c&&e.isComputeTexCoord){let t=[...e.outerPositions,e.outerPositions[0]];for(let e=1;e1){let t=Math.ceil(it/6)-1;lt=rt[t]?rt[t]/ot:0,E[N]=1-lt,E[N+1]=1,E[N+2]=0,E[N+et]=1-lt,E[N+1+et]=0,E[N+2+et]=0}y&&(E[N+et]=lt,E[N+1+et]=ut,e.isComputeTexCoord&&(E[N+2+et]=-1)),g&&(E[N]=lt,E[N+1]=ut,e.isComputeTexCoord&&(E[N+2]=1)),e.isComputeTexCoord?N+=3:N+=2}if(o.normal||o.tangent||o.bitangent||n){var pt=O+1,ct=O+2;if(c){if(it+3it.west-it.east&&(s.east=it.east,s.west=it.west),s}var st=new s.t$1;function lt(t,e,o,r){for(var i=t.surfaceDistance,n=Math.ceil(i*e),a=n>0?i/(n-1):Number.POSITIVE_INFINITY,s=0,l=0;l0?Math.min(p,r.west):r.west,r.east=p<0?Math.max(p,r.east):r.east}}var ut=[];function pt(t,e,o,r,i,n,a,s,l,u,p){var d,h={walls:[]};if(n||a){var y,f,_=v.y.createGeometryFromPositions(t,e,o,i,s,l),T=_.attributes.position.values,x=_.indices;if(n&&a){var A=T.concat(T);y=A.length/3,(f=m.IndexDatatype.createTypedArray(y,2*x.length)).set(x);var P=x.length,E=y/2;for(d=0;d