Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mars3d-cesium

Package Overview
Dependencies
Maintainers
1
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mars3d-cesium - npm Package Compare versions

Comparing version 1.79.2 to 1.80.0

Build/Cesium/Workers/CorridorGeometryLibrary-3981ce9f.js

2

Build/Cesium/Workers/createCoplanarPolygonGeometry.js

@@ -1,1 +0,1 @@

define(["./arrayRemoveDuplicates-fc9e255d","./BoundingRectangle-755c152f","./Transforms-5295b227","./Cartesian2-5b63e672","./Check-64f87f7d","./ComponentDatatype-8f71e605","./CoplanarPolygonGeometryLibrary-f6a57602","./when-ca391574","./GeometryAttribute-7ef2d452","./GeometryAttributes-a356f820","./GeometryInstance-d18842cb","./GeometryPipeline-a588d10d","./IndexDatatype-4e56bcfa","./Math-b53708b3","./PolygonGeometryLibrary-b3087bff","./PolygonPipeline-55053b0a","./VertexFormat-63b3c6da","./RuntimeError-19cb26ba","./WebGLConstants-95ceb4e9","./OrientedBoundingBox-e61df120","./EllipsoidTangentPlane-0fb66b96","./IntersectionTests-f5111308","./Plane-99b2becd","./AttributeCompression-a99f24b9","./EncodedCartesian3-c36ced29","./ArcType-2b58731c","./EllipsoidRhumbLine-21029cef"],function(h,e,L,E,t,T,f,l,D,_,C,v,k,V,x,R,s,n,a,r,o,i,p,y,c,m,u){"use strict";var I=new E.Cartesian3,P=new e.BoundingRectangle,M=new E.Cartesian2,H=new E.Cartesian2,w=new E.Cartesian3,A=new E.Cartesian3,F=new E.Cartesian3,G=new E.Cartesian3,B=new E.Cartesian3,O=new E.Cartesian3,z=new L.Quaternion,S=new L.Matrix3,N=new L.Matrix3,Q=new E.Cartesian3;function d(e){var t=(e=l.defaultValue(e,l.defaultValue.EMPTY_OBJECT)).polygonHierarchy,n=l.defaultValue(e.vertexFormat,s.VertexFormat.DEFAULT);this._vertexFormat=s.VertexFormat.clone(n),this._polygonHierarchy=t,this._stRotation=l.defaultValue(e.stRotation,0),this._ellipsoid=E.Ellipsoid.clone(l.defaultValue(e.ellipsoid,E.Ellipsoid.WGS84)),this._workerName="createCoplanarPolygonGeometry",this.packedLength=x.PolygonGeometryLibrary.computeHierarchyPackedLength(t)+s.VertexFormat.packedLength+E.Ellipsoid.packedLength+2}d.fromPositions=function(e){return new d({polygonHierarchy:{positions:(e=l.defaultValue(e,l.defaultValue.EMPTY_OBJECT)).positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid})},d.pack=function(e,t,n){return n=l.defaultValue(n,0),n=x.PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,n),E.Ellipsoid.pack(e._ellipsoid,t,n),n+=E.Ellipsoid.packedLength,s.VertexFormat.pack(e._vertexFormat,t,n),n+=s.VertexFormat.packedLength,t[n++]=e._stRotation,t[n]=e.packedLength,t};var g=E.Ellipsoid.clone(E.Ellipsoid.UNIT_SPHERE),b=new s.VertexFormat,j={polygonHierarchy:{}};return d.unpack=function(e,t,n){t=l.defaultValue(t,0);var a=x.PolygonGeometryLibrary.unpackPolygonHierarchy(e,t);t=a.startingIndex,delete a.startingIndex;var r=E.Ellipsoid.unpack(e,t,g);t+=E.Ellipsoid.packedLength;var o=s.VertexFormat.unpack(e,t,b);t+=s.VertexFormat.packedLength;var i=e[t++],t=e[t];return(n=!l.defined(n)?new d(j):n)._polygonHierarchy=a,n._ellipsoid=E.Ellipsoid.clone(r,n._ellipsoid),n._vertexFormat=s.VertexFormat.clone(o,n._vertexFormat),n._stRotation=i,n.packedLength=t,n},d.createGeometry=function(e){var t=e._vertexFormat,n=e._polygonHierarchy,a=e._stRotation,r=n.positions;if(!((r=h.arrayRemoveDuplicates(r,E.Cartesian3.equalsEpsilon,!0)).length<3)){var o=w,i=A,l=F,s=B,p=O;if(f.CoplanarPolygonGeometryLibrary.computeProjectTo2DArguments(r,G,s,p)){o=E.Cartesian3.cross(s,p,o);o=E.Cartesian3.normalize(o,o),E.Cartesian3.equalsEpsilon(G,E.Cartesian3.ZERO,V.CesiumMath.EPSILON6)||(y=e._ellipsoid.geodeticSurfaceNormal(G,Q),E.Cartesian3.dot(o,y)<0&&(o=E.Cartesian3.negate(o,o),s=E.Cartesian3.negate(s,s)));var y=f.CoplanarPolygonGeometryLibrary.createProjectPointsTo2DFunction(G,s,p),c=f.CoplanarPolygonGeometryLibrary.createProjectPointTo2DFunction(G,s,p);t.tangent&&(i=E.Cartesian3.clone(s,i)),t.bitangent&&(l=E.Cartesian3.clone(p,l));var n=x.PolygonGeometryLibrary.polygonsFromHierarchy(n,y,!1),y=n.hierarchy,m=n.polygons;if(0!==y.length){for(var r=y[0].outerRing,n=L.BoundingSphere.fromPoints(r),u=x.PolygonGeometryLibrary.computeBoundingRectangle(o,c,r,a,P),d=[],g=0;g<m.length;g++){var b=new C.GeometryInstance({geometry:function(e,t,n,a,r,o,i,l){var s=e.positions,p=R.PolygonPipeline.triangulate(e.positions2D,e.holes);p.length<3&&(p=[0,1,2]),(e=k.IndexDatatype.createTypedArray(s.length,p.length)).set(p);var y=S;0!==a?(p=L.Quaternion.fromAxisAngle(o,a,z),y=L.Matrix3.fromQuaternion(p,y),(t.tangent||t.bitangent)&&(p=L.Quaternion.fromAxisAngle(o,-a,z),u=L.Matrix3.fromQuaternion(p,N),i=E.Cartesian3.normalize(L.Matrix3.multiplyByVector(u,i,i),i),t.bitangent&&(l=E.Cartesian3.normalize(E.Cartesian3.cross(o,i,l),l)))):y=L.Matrix3.clone(L.Matrix3.IDENTITY,y);var c=H;t.st&&(c.x=n.x,c.y=n.y);for(var m=s.length,u=3*m,d=new Float64Array(u),g=t.normal?new Float32Array(u):void 0,b=t.tangent?new Float32Array(u):void 0,h=t.bitangent?new Float32Array(u):void 0,f=t.st?new Float32Array(2*m):void 0,C=0,v=0,x=0,P=0,w=0,A=0;A<m;A++){var F,G=s[A];d[C++]=G.x,d[C++]=G.y,d[C++]=G.z,t.st&&(F=r(L.Matrix3.multiplyByVector(y,G,I),M),E.Cartesian2.subtract(F,c,F),G=V.CesiumMath.clamp(F.x/n.width,0,1),F=V.CesiumMath.clamp(F.y/n.height,0,1),f[w++]=G,f[w++]=F),t.normal&&(g[v++]=o.x,g[v++]=o.y,g[v++]=o.z),t.tangent&&(b[P++]=i.x,b[P++]=i.y,b[P++]=i.z),t.bitangent&&(h[x++]=l.x,h[x++]=l.y,h[x++]=l.z)}return u=new _.GeometryAttributes,t.position&&(u.position=new D.GeometryAttribute({componentDatatype:T.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:d})),t.normal&&(u.normal=new D.GeometryAttribute({componentDatatype:T.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:g})),t.tangent&&(u.tangent=new D.GeometryAttribute({componentDatatype:T.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:b})),t.bitangent&&(u.bitangent=new D.GeometryAttribute({componentDatatype:T.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:h})),t.st&&(u.st=new D.GeometryAttribute({componentDatatype:T.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:f})),new D.Geometry({attributes:u,indices:e,primitiveType:D.PrimitiveType.TRIANGLES})}(m[g],t,u,a,c,o,i,l)});d.push(b)}y=v.GeometryPipeline.combineInstances(d)[0];y.attributes.position.values=new Float64Array(y.attributes.position.values),y.indices=k.IndexDatatype.createTypedArray(y.attributes.position.values.length/3,y.indices);r=y.attributes;return t.position||delete r.position,new D.Geometry({attributes:r,indices:y.indices,primitiveType:y.primitiveType,boundingSphere:n})}}}},function(e,t){return l.defined(t)&&(e=d.unpack(e,t)),d.createGeometry(e)}});
define(["./arrayRemoveDuplicates-fc9e255d","./BoundingRectangle-755c152f","./Transforms-5295b227","./Cartesian2-5b63e672","./Check-64f87f7d","./ComponentDatatype-8f71e605","./CoplanarPolygonGeometryLibrary-f6a57602","./when-ca391574","./GeometryAttribute-7ef2d452","./GeometryAttributes-a356f820","./GeometryInstance-d18842cb","./GeometryPipeline-a588d10d","./IndexDatatype-4e56bcfa","./Math-b53708b3","./PolygonGeometryLibrary-06811a0e","./PolygonPipeline-ff4431d7","./VertexFormat-63b3c6da","./RuntimeError-19cb26ba","./WebGLConstants-95ceb4e9","./OrientedBoundingBox-e61df120","./EllipsoidTangentPlane-0fb66b96","./IntersectionTests-f5111308","./Plane-99b2becd","./AttributeCompression-a99f24b9","./EncodedCartesian3-c36ced29","./ArcType-2b58731c","./EllipsoidRhumbLine-6ee9af74"],function(h,e,L,E,t,T,f,l,D,_,C,v,k,V,x,R,s,n,a,r,o,i,p,y,c,m,u){"use strict";var I=new E.Cartesian3,P=new e.BoundingRectangle,M=new E.Cartesian2,H=new E.Cartesian2,w=new E.Cartesian3,A=new E.Cartesian3,F=new E.Cartesian3,G=new E.Cartesian3,B=new E.Cartesian3,O=new E.Cartesian3,z=new L.Quaternion,S=new L.Matrix3,N=new L.Matrix3,Q=new E.Cartesian3;function d(e){var t=(e=l.defaultValue(e,l.defaultValue.EMPTY_OBJECT)).polygonHierarchy,n=l.defaultValue(e.vertexFormat,s.VertexFormat.DEFAULT);this._vertexFormat=s.VertexFormat.clone(n),this._polygonHierarchy=t,this._stRotation=l.defaultValue(e.stRotation,0),this._ellipsoid=E.Ellipsoid.clone(l.defaultValue(e.ellipsoid,E.Ellipsoid.WGS84)),this._workerName="createCoplanarPolygonGeometry",this.packedLength=x.PolygonGeometryLibrary.computeHierarchyPackedLength(t)+s.VertexFormat.packedLength+E.Ellipsoid.packedLength+2}d.fromPositions=function(e){return new d({polygonHierarchy:{positions:(e=l.defaultValue(e,l.defaultValue.EMPTY_OBJECT)).positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid})},d.pack=function(e,t,n){return n=l.defaultValue(n,0),n=x.PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,n),E.Ellipsoid.pack(e._ellipsoid,t,n),n+=E.Ellipsoid.packedLength,s.VertexFormat.pack(e._vertexFormat,t,n),n+=s.VertexFormat.packedLength,t[n++]=e._stRotation,t[n]=e.packedLength,t};var g=E.Ellipsoid.clone(E.Ellipsoid.UNIT_SPHERE),b=new s.VertexFormat,j={polygonHierarchy:{}};return d.unpack=function(e,t,n){t=l.defaultValue(t,0);var a=x.PolygonGeometryLibrary.unpackPolygonHierarchy(e,t);t=a.startingIndex,delete a.startingIndex;var r=E.Ellipsoid.unpack(e,t,g);t+=E.Ellipsoid.packedLength;var o=s.VertexFormat.unpack(e,t,b);t+=s.VertexFormat.packedLength;var i=e[t++],t=e[t];return(n=!l.defined(n)?new d(j):n)._polygonHierarchy=a,n._ellipsoid=E.Ellipsoid.clone(r,n._ellipsoid),n._vertexFormat=s.VertexFormat.clone(o,n._vertexFormat),n._stRotation=i,n.packedLength=t,n},d.createGeometry=function(e){var t=e._vertexFormat,n=e._polygonHierarchy,a=e._stRotation,r=n.positions;if(!((r=h.arrayRemoveDuplicates(r,E.Cartesian3.equalsEpsilon,!0)).length<3)){var o=w,i=A,l=F,s=B,p=O;if(f.CoplanarPolygonGeometryLibrary.computeProjectTo2DArguments(r,G,s,p)){o=E.Cartesian3.cross(s,p,o);o=E.Cartesian3.normalize(o,o),E.Cartesian3.equalsEpsilon(G,E.Cartesian3.ZERO,V.CesiumMath.EPSILON6)||(y=e._ellipsoid.geodeticSurfaceNormal(G,Q),E.Cartesian3.dot(o,y)<0&&(o=E.Cartesian3.negate(o,o),s=E.Cartesian3.negate(s,s)));var y=f.CoplanarPolygonGeometryLibrary.createProjectPointsTo2DFunction(G,s,p),c=f.CoplanarPolygonGeometryLibrary.createProjectPointTo2DFunction(G,s,p);t.tangent&&(i=E.Cartesian3.clone(s,i)),t.bitangent&&(l=E.Cartesian3.clone(p,l));var n=x.PolygonGeometryLibrary.polygonsFromHierarchy(n,y,!1),y=n.hierarchy,m=n.polygons;if(0!==y.length){for(var r=y[0].outerRing,n=L.BoundingSphere.fromPoints(r),u=x.PolygonGeometryLibrary.computeBoundingRectangle(o,c,r,a,P),d=[],g=0;g<m.length;g++){var b=new C.GeometryInstance({geometry:function(e,t,n,a,r,o,i,l){var s=e.positions,p=R.PolygonPipeline.triangulate(e.positions2D,e.holes);p.length<3&&(p=[0,1,2]),(e=k.IndexDatatype.createTypedArray(s.length,p.length)).set(p);var y=S;0!==a?(p=L.Quaternion.fromAxisAngle(o,a,z),y=L.Matrix3.fromQuaternion(p,y),(t.tangent||t.bitangent)&&(p=L.Quaternion.fromAxisAngle(o,-a,z),u=L.Matrix3.fromQuaternion(p,N),i=E.Cartesian3.normalize(L.Matrix3.multiplyByVector(u,i,i),i),t.bitangent&&(l=E.Cartesian3.normalize(E.Cartesian3.cross(o,i,l),l)))):y=L.Matrix3.clone(L.Matrix3.IDENTITY,y);var c=H;t.st&&(c.x=n.x,c.y=n.y);for(var m=s.length,u=3*m,d=new Float64Array(u),g=t.normal?new Float32Array(u):void 0,b=t.tangent?new Float32Array(u):void 0,h=t.bitangent?new Float32Array(u):void 0,f=t.st?new Float32Array(2*m):void 0,C=0,v=0,x=0,P=0,w=0,A=0;A<m;A++){var F,G=s[A];d[C++]=G.x,d[C++]=G.y,d[C++]=G.z,t.st&&(F=r(L.Matrix3.multiplyByVector(y,G,I),M),E.Cartesian2.subtract(F,c,F),G=V.CesiumMath.clamp(F.x/n.width,0,1),F=V.CesiumMath.clamp(F.y/n.height,0,1),f[w++]=G,f[w++]=F),t.normal&&(g[v++]=o.x,g[v++]=o.y,g[v++]=o.z),t.tangent&&(b[P++]=i.x,b[P++]=i.y,b[P++]=i.z),t.bitangent&&(h[x++]=l.x,h[x++]=l.y,h[x++]=l.z)}return u=new _.GeometryAttributes,t.position&&(u.position=new D.GeometryAttribute({componentDatatype:T.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:d})),t.normal&&(u.normal=new D.GeometryAttribute({componentDatatype:T.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:g})),t.tangent&&(u.tangent=new D.GeometryAttribute({componentDatatype:T.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:b})),t.bitangent&&(u.bitangent=new D.GeometryAttribute({componentDatatype:T.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:h})),t.st&&(u.st=new D.GeometryAttribute({componentDatatype:T.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:f})),new D.Geometry({attributes:u,indices:e,primitiveType:D.PrimitiveType.TRIANGLES})}(m[g],t,u,a,c,o,i,l)});d.push(b)}y=v.GeometryPipeline.combineInstances(d)[0];y.attributes.position.values=new Float64Array(y.attributes.position.values),y.indices=k.IndexDatatype.createTypedArray(y.attributes.position.values.length/3,y.indices);r=y.attributes;return t.position||delete r.position,new D.Geometry({attributes:r,indices:y.indices,primitiveType:y.primitiveType,boundingSphere:n})}}}},function(e,t){return l.defined(t)&&(e=d.unpack(e,t)),d.createGeometry(e)}});

@@ -1,1 +0,1 @@

define(["./arrayRemoveDuplicates-fc9e255d","./Transforms-5295b227","./Cartesian2-5b63e672","./Check-64f87f7d","./ComponentDatatype-8f71e605","./CoplanarPolygonGeometryLibrary-f6a57602","./when-ca391574","./GeometryAttribute-7ef2d452","./GeometryAttributes-a356f820","./GeometryInstance-d18842cb","./GeometryPipeline-a588d10d","./IndexDatatype-4e56bcfa","./PolygonGeometryLibrary-b3087bff","./Math-b53708b3","./RuntimeError-19cb26ba","./WebGLConstants-95ceb4e9","./OrientedBoundingBox-e61df120","./EllipsoidTangentPlane-0fb66b96","./IntersectionTests-f5111308","./Plane-99b2becd","./AttributeCompression-a99f24b9","./EncodedCartesian3-c36ced29","./ArcType-2b58731c","./EllipsoidRhumbLine-21029cef","./PolygonPipeline-55053b0a"],function(a,y,l,e,c,p,o,s,u,d,m,f,b,t,r,n,i,g,h,P,G,v,L,C,T){"use strict";function E(e){e=(e=o.defaultValue(e,o.defaultValue.EMPTY_OBJECT)).polygonHierarchy;this._polygonHierarchy=e,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=b.PolygonGeometryLibrary.computeHierarchyPackedLength(e)+1}E.fromPositions=function(e){return new E({polygonHierarchy:{positions:(e=o.defaultValue(e,o.defaultValue.EMPTY_OBJECT)).positions}})},E.pack=function(e,t,r){return r=o.defaultValue(r,0),t[r=b.PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,r)]=e.packedLength,t};var k={polygonHierarchy:{}};return E.unpack=function(e,t,r){t=o.defaultValue(t,0);var n=b.PolygonGeometryLibrary.unpackPolygonHierarchy(e,t);t=n.startingIndex,delete n.startingIndex;t=e[t];return(r=!o.defined(r)?new E(k):r)._polygonHierarchy=n,r.packedLength=t,r},E.createGeometry=function(e){var t=e._polygonHierarchy,e=t.positions,e=a.arrayRemoveDuplicates(e,l.Cartesian3.equalsEpsilon,!0);if(!(e.length<3)&&p.CoplanarPolygonGeometryLibrary.validOutline(e)){var r=b.PolygonGeometryLibrary.polygonOutlinesFromHierarchy(t,!1);if(0!==r.length){for(var n=[],o=0;o<r.length;o++){var i=new d.GeometryInstance({geometry:function(e){for(var t=e.length,r=new Float64Array(3*t),n=f.IndexDatatype.createTypedArray(t,2*t),o=0,i=0,a=0;a<t;a++){var y=e[a];r[o++]=y.x,r[o++]=y.y,r[o++]=y.z,n[i++]=a,n[i++]=(a+1)%t}var l=new u.GeometryAttributes({position:new s.GeometryAttribute({componentDatatype:c.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:r})});return new s.Geometry({attributes:l,indices:n,primitiveType:s.PrimitiveType.LINES})}(r[o])});n.push(i)}e=m.GeometryPipeline.combineInstances(n)[0],t=y.BoundingSphere.fromPoints(t.positions);return new s.Geometry({attributes:e.attributes,indices:e.indices,primitiveType:e.primitiveType,boundingSphere:t})}}},function(e,t){return(e=o.defined(t)?E.unpack(e,t):e)._ellipsoid=l.Ellipsoid.clone(e._ellipsoid),E.createGeometry(e)}});
define(["./arrayRemoveDuplicates-fc9e255d","./Transforms-5295b227","./Cartesian2-5b63e672","./Check-64f87f7d","./ComponentDatatype-8f71e605","./CoplanarPolygonGeometryLibrary-f6a57602","./when-ca391574","./GeometryAttribute-7ef2d452","./GeometryAttributes-a356f820","./GeometryInstance-d18842cb","./GeometryPipeline-a588d10d","./IndexDatatype-4e56bcfa","./PolygonGeometryLibrary-06811a0e","./Math-b53708b3","./RuntimeError-19cb26ba","./WebGLConstants-95ceb4e9","./OrientedBoundingBox-e61df120","./EllipsoidTangentPlane-0fb66b96","./IntersectionTests-f5111308","./Plane-99b2becd","./AttributeCompression-a99f24b9","./EncodedCartesian3-c36ced29","./ArcType-2b58731c","./EllipsoidRhumbLine-6ee9af74","./PolygonPipeline-ff4431d7"],function(a,y,l,e,c,p,o,s,u,d,m,f,b,t,r,n,i,g,h,P,G,v,L,C,T){"use strict";function E(e){e=(e=o.defaultValue(e,o.defaultValue.EMPTY_OBJECT)).polygonHierarchy;this._polygonHierarchy=e,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=b.PolygonGeometryLibrary.computeHierarchyPackedLength(e)+1}E.fromPositions=function(e){return new E({polygonHierarchy:{positions:(e=o.defaultValue(e,o.defaultValue.EMPTY_OBJECT)).positions}})},E.pack=function(e,t,r){return r=o.defaultValue(r,0),t[r=b.PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,r)]=e.packedLength,t};var k={polygonHierarchy:{}};return E.unpack=function(e,t,r){t=o.defaultValue(t,0);var n=b.PolygonGeometryLibrary.unpackPolygonHierarchy(e,t);t=n.startingIndex,delete n.startingIndex;t=e[t];return(r=!o.defined(r)?new E(k):r)._polygonHierarchy=n,r.packedLength=t,r},E.createGeometry=function(e){var t=e._polygonHierarchy,e=t.positions,e=a.arrayRemoveDuplicates(e,l.Cartesian3.equalsEpsilon,!0);if(!(e.length<3)&&p.CoplanarPolygonGeometryLibrary.validOutline(e)){var r=b.PolygonGeometryLibrary.polygonOutlinesFromHierarchy(t,!1);if(0!==r.length){for(var n=[],o=0;o<r.length;o++){var i=new d.GeometryInstance({geometry:function(e){for(var t=e.length,r=new Float64Array(3*t),n=f.IndexDatatype.createTypedArray(t,2*t),o=0,i=0,a=0;a<t;a++){var y=e[a];r[o++]=y.x,r[o++]=y.y,r[o++]=y.z,n[i++]=a,n[i++]=(a+1)%t}var l=new u.GeometryAttributes({position:new s.GeometryAttribute({componentDatatype:c.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:r})});return new s.Geometry({attributes:l,indices:n,primitiveType:s.PrimitiveType.LINES})}(r[o])});n.push(i)}e=m.GeometryPipeline.combineInstances(n)[0],t=y.BoundingSphere.fromPoints(t.positions);return new s.Geometry({attributes:e.attributes,indices:e.indices,primitiveType:e.primitiveType,boundingSphere:t})}}},function(e,t){return(e=o.defined(t)?E.unpack(e,t):e)._ellipsoid=l.Ellipsoid.clone(e._ellipsoid),E.createGeometry(e)}});

@@ -1,1 +0,1 @@

define(["./GeometryOffsetAttribute-b94750ca","./arrayRemoveDuplicates-fc9e255d","./Transforms-5295b227","./Cartesian2-5b63e672","./Check-64f87f7d","./ComponentDatatype-8f71e605","./PolylineVolumeGeometryLibrary-ec280c2f","./CorridorGeometryLibrary-c6e83d15","./when-ca391574","./GeometryAttribute-7ef2d452","./GeometryAttributes-a356f820","./IndexDatatype-4e56bcfa","./Math-b53708b3","./PolygonPipeline-55053b0a","./VertexFormat-63b3c6da","./RuntimeError-19cb26ba","./WebGLConstants-95ceb4e9","./EllipsoidTangentPlane-0fb66b96","./IntersectionTests-f5111308","./Plane-99b2becd","./PolylinePipeline-00f5e064","./EllipsoidGeodesic-bbea0b0a","./EllipsoidRhumbLine-21029cef"],function(E,y,m,rt,t,at,f,it,ot,nt,st,lt,dt,V,F,e,r,a,i,o,n,s,l){"use strict";var ut=new rt.Cartesian3,mt=new rt.Cartesian3,yt=new rt.Cartesian3,ft=new rt.Cartesian3,L=new rt.Cartesian3,pt=new rt.Cartesian3,ct=new rt.Cartesian3,ht=new rt.Cartesian3;function p(t,e){for(var r=0;r<t.length;r++)t[r]=e.scaleToGeodeticSurface(t[r],t[r]);return t}function gt(t,e,r,a,i,o){var n=t.normals,s=t.tangents,l=t.bitangents,t=rt.Cartesian3.normalize(rt.Cartesian3.cross(r,e,ct),ct);o.normal&&it.CorridorGeometryLibrary.addAttribute(n,e,a,i),o.tangent&&it.CorridorGeometryLibrary.addAttribute(s,t,a,i),o.bitangent&&it.CorridorGeometryLibrary.addAttribute(l,r,a,i)}function P(t,e,r){var a,i=t.positions,o=t.corners,n=t.endPositions,s=t.lefts,l=t.normals,d=new st.GeometryAttributes,u=0,m=0,y=0;for(D=0;D<i.length;D+=2)u+=a=i[D].length-3,y+=2*a,m+=i[D+1].length-3;for(u+=3,m+=3,D=0;D<o.length;D++){var f=o[D],p=o[D].leftPositions;ot.defined(p)?u+=a=p.length:m+=a=o[D].rightPositions.length,y+=a}var c,h=ot.defined(n);h&&(u+=c=n[0].length-3,m+=c,y+=6*(c/=3));var g,b,C,v,t=u+m,A=new Float64Array(t),_={normals:e.normal?new Float32Array(t):void 0,tangents:e.tangent?new Float32Array(t):void 0,bitangents:e.bitangent?new Float32Array(t):void 0},w=0,T=t-1,G=ut,E=mt,V=c/2,F=lt.IndexDatatype.createTypedArray(t/3,y),L=0;if(h)for(var P=yt,x=ft,N=n[0],G=rt.Cartesian3.fromArray(l,0,G),E=rt.Cartesian3.fromArray(s,0,E),D=0;D<V;D++)P=rt.Cartesian3.fromArray(N,3*(V-1-D),P),x=rt.Cartesian3.fromArray(N,3*(V+D),x),it.CorridorGeometryLibrary.addAttribute(A,x,w),it.CorridorGeometryLibrary.addAttribute(A,P,void 0,T),gt(_,G,E,w,T,e),v=(b=w/3)+1,C=(g=(T-2)/3)-1,F[L++]=g,F[L++]=b,F[L++]=C,F[L++]=C,F[L++]=b,F[L++]=v,w+=3,T-=3;var M,O,I=0,S=0,R=i[I++],k=i[I++];for(A.set(R,w),A.set(k,T-k.length+1),E=rt.Cartesian3.fromArray(s,S,E),a=k.length-3,D=0;D<a;D+=3)M=r.geodeticSurfaceNormal(rt.Cartesian3.fromArray(R,D,ct),ct),O=r.geodeticSurfaceNormal(rt.Cartesian3.fromArray(k,a-D,ht),ht),gt(_,G=rt.Cartesian3.normalize(rt.Cartesian3.add(M,O,G),G),E,w,T,e),v=(b=w/3)+1,C=(g=(T-2)/3)-1,F[L++]=g,F[L++]=b,F[L++]=C,F[L++]=C,F[L++]=b,F[L++]=v,w+=3,T-=3;for(M=r.geodeticSurfaceNormal(rt.Cartesian3.fromArray(R,a,ct),ct),O=r.geodeticSurfaceNormal(rt.Cartesian3.fromArray(k,a,ht),ht),G=rt.Cartesian3.normalize(rt.Cartesian3.add(M,O,G),G),S+=3,D=0;D<o.length;D++){var H,z,U,B=(f=o[D]).leftPositions,Y=f.rightPositions,W=pt,q=yt,J=ft;if(G=rt.Cartesian3.fromArray(l,S,G),ot.defined(B)){for(gt(_,G,E,void 0,T,e),T-=3,z=v,U=C,H=0;H<B.length/3;H++)W=rt.Cartesian3.fromArray(B,3*H,W),F[L++]=z,F[L++]=U-H-1,F[L++]=U-H,it.CorridorGeometryLibrary.addAttribute(A,W,void 0,T),q=rt.Cartesian3.fromArray(A,3*(U-H-1),q),J=rt.Cartesian3.fromArray(A,3*z,J),gt(_,G,E=rt.Cartesian3.normalize(rt.Cartesian3.subtract(q,J,E),E),void 0,T,e),T-=3;W=rt.Cartesian3.fromArray(A,3*z,W),q=rt.Cartesian3.subtract(rt.Cartesian3.fromArray(A,3*U,q),W,q),J=rt.Cartesian3.subtract(rt.Cartesian3.fromArray(A,3*(U-H),J),W,J),gt(_,G,E=rt.Cartesian3.normalize(rt.Cartesian3.add(q,J,E),E),w,void 0,e),w+=3}else{for(gt(_,G,E,w,void 0,e),w+=3,z=C,U=v,H=0;H<Y.length/3;H++)W=rt.Cartesian3.fromArray(Y,3*H,W),F[L++]=z,F[L++]=U+H,F[L++]=U+H+1,it.CorridorGeometryLibrary.addAttribute(A,W,w),q=rt.Cartesian3.fromArray(A,3*z,q),J=rt.Cartesian3.fromArray(A,3*(U+H),J),gt(_,G,E=rt.Cartesian3.normalize(rt.Cartesian3.subtract(q,J,E),E),w,void 0,e),w+=3;W=rt.Cartesian3.fromArray(A,3*z,W),q=rt.Cartesian3.subtract(rt.Cartesian3.fromArray(A,3*(U+H),q),W,q),J=rt.Cartesian3.subtract(rt.Cartesian3.fromArray(A,3*U,J),W,J),gt(_,G,E=rt.Cartesian3.normalize(rt.Cartesian3.negate(rt.Cartesian3.add(J,q,E),E),E),void 0,T,e),T-=3}for(R=i[I++],k=i[I++],R.splice(0,3),k.splice(k.length-3,3),A.set(R,w),A.set(k,T-k.length+1),a=k.length-3,S+=3,E=rt.Cartesian3.fromArray(s,S,E),H=0;H<k.length;H+=3)M=r.geodeticSurfaceNormal(rt.Cartesian3.fromArray(R,H,ct),ct),O=r.geodeticSurfaceNormal(rt.Cartesian3.fromArray(k,a-H,ht),ht),gt(_,G=rt.Cartesian3.normalize(rt.Cartesian3.add(M,O,G),G),E,w,T,e),b=(v=w/3)-1,g=(C=(T-2)/3)+1,F[L++]=g,F[L++]=b,F[L++]=C,F[L++]=C,F[L++]=b,F[L++]=v,w+=3,T-=3;w-=3,T+=3}if(gt(_,G=rt.Cartesian3.fromArray(l,l.length-3,G),E,w,T,e),h){w+=3,T-=3,P=yt,x=ft;var j=n[1];for(D=0;D<V;D++)P=rt.Cartesian3.fromArray(j,3*(c-D-1),P),x=rt.Cartesian3.fromArray(j,3*D,x),it.CorridorGeometryLibrary.addAttribute(A,P,void 0,T),it.CorridorGeometryLibrary.addAttribute(A,x,w),gt(_,G,E,w,T,e),b=(v=w/3)-1,g=(C=(T-2)/3)+1,F[L++]=g,F[L++]=b,F[L++]=C,F[L++]=C,F[L++]=b,F[L++]=v,w+=3,T-=3}if(d.position=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:A}),e.st){var K=new Float32Array(t/3*2),Q=0;if(h){u/=3,m/=3;var X,Z=Math.PI/(c+1),$=1/(u-c+1),tt=1/(m-c+1),et=c/2;for(D=1+et;D<c+1;D++)X=dt.CesiumMath.PI_OVER_TWO+Z*D,K[Q++]=tt*(1+Math.cos(X)),K[Q++]=.5*(1+Math.sin(X));for(D=1;D<m-c+1;D++)K[Q++]=D*tt,K[Q++]=0;for(D=c;et<D;D--)X=dt.CesiumMath.PI_OVER_TWO-D*Z,K[Q++]=1-tt*(1+Math.cos(X)),K[Q++]=.5*(1+Math.sin(X));for(D=et;0<D;D--)X=dt.CesiumMath.PI_OVER_TWO-Z*D,K[Q++]=1-$*(1+Math.cos(X)),K[Q++]=.5*(1+Math.sin(X));for(D=u-c;0<D;D--)K[Q++]=D*$,K[Q++]=1;for(D=1;D<1+et;D++)X=dt.CesiumMath.PI_OVER_TWO+Z*D,K[Q++]=$*(1+Math.cos(X)),K[Q++]=.5*(1+Math.sin(X))}else{for($=1/((u/=3)-1),tt=1/((m/=3)-1),D=0;D<m;D++)K[Q++]=D*tt,K[Q++]=0;for(D=u;0<D;D--)K[Q++]=(D-1)*$,K[Q++]=1}d.st=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:K})}return e.normal&&(d.normal=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:_.normals})),e.tangent&&(d.tangent=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:_.tangents})),e.bitangent&&(d.bitangent=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:_.bitangents})),{attributes:d,indices:F}}function x(t,e,r){r[e++]=t[0],r[e++]=t[1],r[e++]=t[2];for(var a=3;a<t.length;a+=3){var i=t[a],o=t[a+1],n=t[a+2];r[e++]=i,r[e++]=o,r[e++]=n,r[e++]=i,r[e++]=o,r[e++]=n}return r[e++]=t[0],r[e++]=t[1],r[e++]=t[2],r}function c(t,e){var r=new F.VertexFormat({position:e.position,normal:e.normal||e.bitangent||t.shadowVolume,tangent:e.tangent,bitangent:e.normal||e.bitangent,st:e.st}),a=t.ellipsoid,i=P(it.CorridorGeometryLibrary.computePositions(t),r,a),o=t.height,n=t.extrudedHeight,s=i.attributes,l=i.indices,d=s.position.values,u=d.length,m=new Float64Array(6*u),r=new Float64Array(u);r.set(d);i=new Float64Array(4*u),i=x(d=V.PolygonPipeline.scaleToGeodeticHeight(d,o,a),0,i);i=x(r=V.PolygonPipeline.scaleToGeodeticHeight(r,n,a),2*u,i),m.set(d),m.set(r,u),m.set(i,2*u),s.position.values=m;var s=function(t,e){if(!(e.normal||e.tangent||e.bitangent||e.st))return t;var r,a=t.position.values;(e.normal||e.bitangent)&&(r=t.normal.values,l=t.bitangent.values);var i=t.position.values.length/18,o=3*i,n=2*i,s=2*o;if(e.normal||e.bitangent||e.tangent){for(var l,d=e.normal?new Float32Array(6*o):void 0,u=e.tangent?new Float32Array(6*o):void 0,m=e.bitangent?new Float32Array(6*o):void 0,y=ut,f=mt,p=yt,c=ft,h=L,g=pt,b=s,C=0;C<o;C+=3){var v=b+s,y=rt.Cartesian3.fromArray(a,C,y),f=rt.Cartesian3.fromArray(a,C+o,f),p=rt.Cartesian3.fromArray(a,(C+3)%o,p);f=rt.Cartesian3.subtract(f,y,f),p=rt.Cartesian3.subtract(p,y,p),c=rt.Cartesian3.normalize(rt.Cartesian3.cross(f,p,c),c),e.normal&&(it.CorridorGeometryLibrary.addAttribute(d,c,v),it.CorridorGeometryLibrary.addAttribute(d,c,v+3),it.CorridorGeometryLibrary.addAttribute(d,c,b),it.CorridorGeometryLibrary.addAttribute(d,c,b+3)),(e.tangent||e.bitangent)&&(g=rt.Cartesian3.fromArray(r,C,g),e.bitangent&&(it.CorridorGeometryLibrary.addAttribute(m,g,v),it.CorridorGeometryLibrary.addAttribute(m,g,v+3),it.CorridorGeometryLibrary.addAttribute(m,g,b),it.CorridorGeometryLibrary.addAttribute(m,g,b+3)),e.tangent&&(h=rt.Cartesian3.normalize(rt.Cartesian3.cross(g,c,h),h),it.CorridorGeometryLibrary.addAttribute(u,h,v),it.CorridorGeometryLibrary.addAttribute(u,h,v+3),it.CorridorGeometryLibrary.addAttribute(u,h,b),it.CorridorGeometryLibrary.addAttribute(u,h,b+3))),b+=6}if(e.normal){for(d.set(r),C=0;C<o;C+=3)d[C+o]=-r[C],d[C+o+1]=-r[C+1],d[C+o+2]=-r[C+2];t.normal.values=d}else t.normal=void 0;e.bitangent?(m.set(l),m.set(l,o),t.bitangent.values=m):t.bitangent=void 0,e.tangent&&(l=t.tangent.values,u.set(l),u.set(l,o),t.tangent.values=u)}if(e.st){var A=t.st.values,_=new Float32Array(6*n);_.set(A),_.set(A,n);for(var w=2*n,T=0;T<2;T++){for(_[w++]=A[0],_[w++]=A[1],C=2;C<n;C+=2){var G=A[C],E=A[C+1];_[w++]=G,_[w++]=E,_[w++]=G,_[w++]=E}_[w++]=A[0],_[w++]=A[1]}t.st.values=_}return t}(s,e),y=u/3;if(t.shadowVolume){for(var f=s.normal.values,u=f.length,i=new Float32Array(6*u),p=0;p<u;p++)f[p]=-f[p];i.set(f,u),i=x(f,4*u,i),s.extrudeDirection=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:i}),e.normal||(s.normal=void 0)}ot.defined(t.offsetAttribute)&&(e=new Uint8Array(6*y),e=t.offsetAttribute===E.GeometryOffsetAttribute.TOP?(e=E.arrayFill(e,1,0,y),E.arrayFill(e,1,2*y,4*y)):(t=t.offsetAttribute===E.GeometryOffsetAttribute.NONE?0:1,E.arrayFill(e,t)),s.applyOffset=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:e}));var c=l.length,h=y+y,g=lt.IndexDatatype.createTypedArray(m.length/3,2*c+3*h);g.set(l);var b,C,v,A,_=c;for(p=0;p<c;p+=3){var w=l[p],T=l[p+1],G=l[p+2];g[_++]=G+y,g[_++]=T+y,g[_++]=w+y}for(p=0;p<h;p+=2)v=(b=p+h)+1,A=(C=b+h)+1,g[_++]=b,g[_++]=C,g[_++]=v,g[_++]=v,g[_++]=C,g[_++]=A;return{attributes:s,indices:g}}var h=new rt.Cartesian3,g=new rt.Cartesian3,b=new rt.Cartographic;function C(t,e,r,a,i,o){var n=rt.Cartesian3.subtract(e,t,h);rt.Cartesian3.normalize(n,n);var s=r.geodeticSurfaceNormal(t,g),l=rt.Cartesian3.cross(n,s,h);rt.Cartesian3.multiplyByScalar(l,a,l);var d=i.latitude,u=i.longitude,e=o.latitude,n=o.longitude;rt.Cartesian3.add(t,l,g),r.cartesianToCartographic(g,b);s=b.latitude,a=b.longitude,d=Math.min(d,s),u=Math.min(u,a),e=Math.max(e,s),n=Math.max(n,a);rt.Cartesian3.subtract(t,l,g),r.cartesianToCartographic(g,b),s=b.latitude,a=b.longitude,d=Math.min(d,s),u=Math.min(u,a),e=Math.max(e,s),n=Math.max(n,a),i.latitude=d,i.longitude=u,o.latitude=e,o.longitude=n}var v=new rt.Cartesian3,A=new rt.Cartesian3,_=new rt.Cartographic,w=new rt.Cartographic;function d(t,e,r,a,i){t=p(t,e);var o=y.arrayRemoveDuplicates(t,rt.Cartesian3.equalsEpsilon),n=o.length;if(n<2||r<=0)return new rt.Rectangle;var s,l,d=.5*r;_.latitude=Number.POSITIVE_INFINITY,_.longitude=Number.POSITIVE_INFINITY,w.latitude=Number.NEGATIVE_INFINITY,w.longitude=Number.NEGATIVE_INFINITY,a===f.CornerType.ROUNDED&&(m=o[0],rt.Cartesian3.subtract(m,o[1],v),rt.Cartesian3.normalize(v,v),rt.Cartesian3.multiplyByScalar(v,d,v),rt.Cartesian3.add(m,v,A),e.cartesianToCartographic(A,b),s=b.latitude,l=b.longitude,_.latitude=Math.min(_.latitude,s),_.longitude=Math.min(_.longitude,l),w.latitude=Math.max(w.latitude,s),w.longitude=Math.max(w.longitude,l));for(var u=0;u<n-1;++u)C(o[u],o[u+1],e,d,_,w);var m=o[n-1];rt.Cartesian3.subtract(m,o[n-2],v),rt.Cartesian3.normalize(v,v),rt.Cartesian3.multiplyByScalar(v,d,v),rt.Cartesian3.add(m,v,A),C(m,A,e,d,_,w),a===f.CornerType.ROUNDED&&(e.cartesianToCartographic(A,b),s=b.latitude,l=b.longitude,_.latitude=Math.min(_.latitude,s),_.longitude=Math.min(_.longitude,l),w.latitude=Math.max(w.latitude,s),w.longitude=Math.max(w.longitude,l));i=ot.defined(i)?i:new rt.Rectangle;return i.north=w.latitude,i.south=_.latitude,i.east=w.longitude,i.west=_.longitude,i}function T(t){var e=(t=ot.defaultValue(t,ot.defaultValue.EMPTY_OBJECT)).positions,r=t.width,a=ot.defaultValue(t.height,0),i=ot.defaultValue(t.extrudedHeight,a);this._positions=e,this._ellipsoid=rt.Ellipsoid.clone(ot.defaultValue(t.ellipsoid,rt.Ellipsoid.WGS84)),this._vertexFormat=F.VertexFormat.clone(ot.defaultValue(t.vertexFormat,F.VertexFormat.DEFAULT)),this._width=r,this._height=Math.max(a,i),this._extrudedHeight=Math.min(a,i),this._cornerType=ot.defaultValue(t.cornerType,f.CornerType.ROUNDED),this._granularity=ot.defaultValue(t.granularity,dt.CesiumMath.RADIANS_PER_DEGREE),this._shadowVolume=ot.defaultValue(t.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=t.offsetAttribute,this._rectangle=void 0,this.packedLength=1+e.length*rt.Cartesian3.packedLength+rt.Ellipsoid.packedLength+F.VertexFormat.packedLength+7}T.pack=function(t,e,r){r=ot.defaultValue(r,0);var a=t._positions,i=a.length;e[r++]=i;for(var o=0;o<i;++o,r+=rt.Cartesian3.packedLength)rt.Cartesian3.pack(a[o],e,r);return rt.Ellipsoid.pack(t._ellipsoid,e,r),r+=rt.Ellipsoid.packedLength,F.VertexFormat.pack(t._vertexFormat,e,r),r+=F.VertexFormat.packedLength,e[r++]=t._width,e[r++]=t._height,e[r++]=t._extrudedHeight,e[r++]=t._cornerType,e[r++]=t._granularity,e[r++]=t._shadowVolume?1:0,e[r]=ot.defaultValue(t._offsetAttribute,-1),e};var G=rt.Ellipsoid.clone(rt.Ellipsoid.UNIT_SPHERE),N=new F.VertexFormat,D={positions:void 0,ellipsoid:G,vertexFormat:N,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};return T.unpack=function(t,e,r){e=ot.defaultValue(e,0);for(var a=t[e++],i=new Array(a),o=0;o<a;++o,e+=rt.Cartesian3.packedLength)i[o]=rt.Cartesian3.unpack(t,e);var n=rt.Ellipsoid.unpack(t,e,G);e+=rt.Ellipsoid.packedLength;var s=F.VertexFormat.unpack(t,e,N);e+=F.VertexFormat.packedLength;var l=t[e++],d=t[e++],u=t[e++],m=t[e++],y=t[e++],f=1===t[e++],p=t[e];return ot.defined(r)?(r._positions=i,r._ellipsoid=rt.Ellipsoid.clone(n,r._ellipsoid),r._vertexFormat=F.VertexFormat.clone(s,r._vertexFormat),r._width=l,r._height=d,r._extrudedHeight=u,r._cornerType=m,r._granularity=y,r._shadowVolume=f,r._offsetAttribute=-1===p?void 0:p,r):(D.positions=i,D.width=l,D.height=d,D.extrudedHeight=u,D.cornerType=m,D.granularity=y,D.shadowVolume=f,D.offsetAttribute=-1===p?void 0:p,new T(D))},T.computeRectangle=function(t,e){var r=(t=ot.defaultValue(t,ot.defaultValue.EMPTY_OBJECT)).positions,a=t.width;return d(r,ot.defaultValue(t.ellipsoid,rt.Ellipsoid.WGS84),a,ot.defaultValue(t.cornerType,f.CornerType.ROUNDED),e)},T.createGeometry=function(t){var e=t._positions,r=t._width,a=t._ellipsoid,e=p(e,a),i=y.arrayRemoveDuplicates(e,rt.Cartesian3.equalsEpsilon);if(!(i.length<2||r<=0)){var o,n=t._height,s=t._extrudedHeight,l=!dt.CesiumMath.equalsEpsilon(n,s,0,dt.CesiumMath.EPSILON2),e=t._vertexFormat,r={ellipsoid:a,positions:i,width:r,cornerType:t._cornerType,granularity:t._granularity,saveAttributes:!0};l?(r.height=n,r.extrudedHeight=s,r.shadowVolume=t._shadowVolume,r.offsetAttribute=t._offsetAttribute,o=c(r,e)):((o=P(it.CorridorGeometryLibrary.computePositions(r),e,a)).attributes.position.values=V.PolygonPipeline.scaleToGeodeticHeight(o.attributes.position.values,n,a),ot.defined(t._offsetAttribute)&&(d=t._offsetAttribute===E.GeometryOffsetAttribute.NONE?0:1,u=o.attributes.position.values.length,u=new Uint8Array(u/3),E.arrayFill(u,d),o.attributes.applyOffset=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})));var d=o.attributes,u=m.BoundingSphere.fromVertices(d.position.values,void 0,3);return e.position||(o.attributes.position.values=void 0),new nt.Geometry({attributes:d,indices:o.indices,primitiveType:nt.PrimitiveType.TRIANGLES,boundingSphere:u,offsetAttribute:t._offsetAttribute})}},T.createShadowVolume=function(t,e,r){var a=t._granularity,i=t._ellipsoid,e=e(a,i),r=r(a,i);return new T({positions:t._positions,width:t._width,cornerType:t._cornerType,ellipsoid:i,granularity:a,extrudedHeight:e,height:r,vertexFormat:F.VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(T.prototype,{rectangle:{get:function(){return ot.defined(this._rectangle)||(this._rectangle=d(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}}),function(t,e){return(t=ot.defined(e)?T.unpack(t,e):t)._ellipsoid=rt.Ellipsoid.clone(t._ellipsoid),T.createGeometry(t)}});
define(["./GeometryOffsetAttribute-b94750ca","./arrayRemoveDuplicates-fc9e255d","./Transforms-5295b227","./Cartesian2-5b63e672","./Check-64f87f7d","./ComponentDatatype-8f71e605","./PolylineVolumeGeometryLibrary-62de9881","./CorridorGeometryLibrary-3981ce9f","./when-ca391574","./GeometryAttribute-7ef2d452","./GeometryAttributes-a356f820","./IndexDatatype-4e56bcfa","./Math-b53708b3","./PolygonPipeline-ff4431d7","./VertexFormat-63b3c6da","./RuntimeError-19cb26ba","./WebGLConstants-95ceb4e9","./EllipsoidTangentPlane-0fb66b96","./IntersectionTests-f5111308","./Plane-99b2becd","./PolylinePipeline-12a23b58","./EllipsoidGeodesic-bbea0b0a","./EllipsoidRhumbLine-6ee9af74"],function(E,y,m,rt,t,at,f,it,ot,nt,st,lt,dt,V,F,e,r,a,i,o,n,s,l){"use strict";var ut=new rt.Cartesian3,mt=new rt.Cartesian3,yt=new rt.Cartesian3,ft=new rt.Cartesian3,L=new rt.Cartesian3,pt=new rt.Cartesian3,ct=new rt.Cartesian3,ht=new rt.Cartesian3;function p(t,e){for(var r=0;r<t.length;r++)t[r]=e.scaleToGeodeticSurface(t[r],t[r]);return t}function gt(t,e,r,a,i,o){var n=t.normals,s=t.tangents,l=t.bitangents,t=rt.Cartesian3.normalize(rt.Cartesian3.cross(r,e,ct),ct);o.normal&&it.CorridorGeometryLibrary.addAttribute(n,e,a,i),o.tangent&&it.CorridorGeometryLibrary.addAttribute(s,t,a,i),o.bitangent&&it.CorridorGeometryLibrary.addAttribute(l,r,a,i)}function P(t,e,r){var a,i=t.positions,o=t.corners,n=t.endPositions,s=t.lefts,l=t.normals,d=new st.GeometryAttributes,u=0,m=0,y=0;for(D=0;D<i.length;D+=2)u+=a=i[D].length-3,y+=2*a,m+=i[D+1].length-3;for(u+=3,m+=3,D=0;D<o.length;D++){var f=o[D],p=o[D].leftPositions;ot.defined(p)?u+=a=p.length:m+=a=o[D].rightPositions.length,y+=a}var c,h=ot.defined(n);h&&(u+=c=n[0].length-3,m+=c,y+=6*(c/=3));var g,b,C,v,t=u+m,A=new Float64Array(t),_={normals:e.normal?new Float32Array(t):void 0,tangents:e.tangent?new Float32Array(t):void 0,bitangents:e.bitangent?new Float32Array(t):void 0},w=0,T=t-1,G=ut,E=mt,V=c/2,F=lt.IndexDatatype.createTypedArray(t/3,y),L=0;if(h)for(var P=yt,x=ft,N=n[0],G=rt.Cartesian3.fromArray(l,0,G),E=rt.Cartesian3.fromArray(s,0,E),D=0;D<V;D++)P=rt.Cartesian3.fromArray(N,3*(V-1-D),P),x=rt.Cartesian3.fromArray(N,3*(V+D),x),it.CorridorGeometryLibrary.addAttribute(A,x,w),it.CorridorGeometryLibrary.addAttribute(A,P,void 0,T),gt(_,G,E,w,T,e),v=(b=w/3)+1,C=(g=(T-2)/3)-1,F[L++]=g,F[L++]=b,F[L++]=C,F[L++]=C,F[L++]=b,F[L++]=v,w+=3,T-=3;var M,O,I=0,S=0,R=i[I++],k=i[I++];for(A.set(R,w),A.set(k,T-k.length+1),E=rt.Cartesian3.fromArray(s,S,E),a=k.length-3,D=0;D<a;D+=3)M=r.geodeticSurfaceNormal(rt.Cartesian3.fromArray(R,D,ct),ct),O=r.geodeticSurfaceNormal(rt.Cartesian3.fromArray(k,a-D,ht),ht),gt(_,G=rt.Cartesian3.normalize(rt.Cartesian3.add(M,O,G),G),E,w,T,e),v=(b=w/3)+1,C=(g=(T-2)/3)-1,F[L++]=g,F[L++]=b,F[L++]=C,F[L++]=C,F[L++]=b,F[L++]=v,w+=3,T-=3;for(M=r.geodeticSurfaceNormal(rt.Cartesian3.fromArray(R,a,ct),ct),O=r.geodeticSurfaceNormal(rt.Cartesian3.fromArray(k,a,ht),ht),G=rt.Cartesian3.normalize(rt.Cartesian3.add(M,O,G),G),S+=3,D=0;D<o.length;D++){var H,z,U,B=(f=o[D]).leftPositions,Y=f.rightPositions,W=pt,q=yt,J=ft;if(G=rt.Cartesian3.fromArray(l,S,G),ot.defined(B)){for(gt(_,G,E,void 0,T,e),T-=3,z=v,U=C,H=0;H<B.length/3;H++)W=rt.Cartesian3.fromArray(B,3*H,W),F[L++]=z,F[L++]=U-H-1,F[L++]=U-H,it.CorridorGeometryLibrary.addAttribute(A,W,void 0,T),q=rt.Cartesian3.fromArray(A,3*(U-H-1),q),J=rt.Cartesian3.fromArray(A,3*z,J),gt(_,G,E=rt.Cartesian3.normalize(rt.Cartesian3.subtract(q,J,E),E),void 0,T,e),T-=3;W=rt.Cartesian3.fromArray(A,3*z,W),q=rt.Cartesian3.subtract(rt.Cartesian3.fromArray(A,3*U,q),W,q),J=rt.Cartesian3.subtract(rt.Cartesian3.fromArray(A,3*(U-H),J),W,J),gt(_,G,E=rt.Cartesian3.normalize(rt.Cartesian3.add(q,J,E),E),w,void 0,e),w+=3}else{for(gt(_,G,E,w,void 0,e),w+=3,z=C,U=v,H=0;H<Y.length/3;H++)W=rt.Cartesian3.fromArray(Y,3*H,W),F[L++]=z,F[L++]=U+H,F[L++]=U+H+1,it.CorridorGeometryLibrary.addAttribute(A,W,w),q=rt.Cartesian3.fromArray(A,3*z,q),J=rt.Cartesian3.fromArray(A,3*(U+H),J),gt(_,G,E=rt.Cartesian3.normalize(rt.Cartesian3.subtract(q,J,E),E),w,void 0,e),w+=3;W=rt.Cartesian3.fromArray(A,3*z,W),q=rt.Cartesian3.subtract(rt.Cartesian3.fromArray(A,3*(U+H),q),W,q),J=rt.Cartesian3.subtract(rt.Cartesian3.fromArray(A,3*U,J),W,J),gt(_,G,E=rt.Cartesian3.normalize(rt.Cartesian3.negate(rt.Cartesian3.add(J,q,E),E),E),void 0,T,e),T-=3}for(R=i[I++],k=i[I++],R.splice(0,3),k.splice(k.length-3,3),A.set(R,w),A.set(k,T-k.length+1),a=k.length-3,S+=3,E=rt.Cartesian3.fromArray(s,S,E),H=0;H<k.length;H+=3)M=r.geodeticSurfaceNormal(rt.Cartesian3.fromArray(R,H,ct),ct),O=r.geodeticSurfaceNormal(rt.Cartesian3.fromArray(k,a-H,ht),ht),gt(_,G=rt.Cartesian3.normalize(rt.Cartesian3.add(M,O,G),G),E,w,T,e),b=(v=w/3)-1,g=(C=(T-2)/3)+1,F[L++]=g,F[L++]=b,F[L++]=C,F[L++]=C,F[L++]=b,F[L++]=v,w+=3,T-=3;w-=3,T+=3}if(gt(_,G=rt.Cartesian3.fromArray(l,l.length-3,G),E,w,T,e),h){w+=3,T-=3,P=yt,x=ft;var j=n[1];for(D=0;D<V;D++)P=rt.Cartesian3.fromArray(j,3*(c-D-1),P),x=rt.Cartesian3.fromArray(j,3*D,x),it.CorridorGeometryLibrary.addAttribute(A,P,void 0,T),it.CorridorGeometryLibrary.addAttribute(A,x,w),gt(_,G,E,w,T,e),b=(v=w/3)-1,g=(C=(T-2)/3)+1,F[L++]=g,F[L++]=b,F[L++]=C,F[L++]=C,F[L++]=b,F[L++]=v,w+=3,T-=3}if(d.position=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:A}),e.st){var K=new Float32Array(t/3*2),Q=0;if(h){u/=3,m/=3;var X,Z=Math.PI/(c+1),$=1/(u-c+1),tt=1/(m-c+1),et=c/2;for(D=1+et;D<c+1;D++)X=dt.CesiumMath.PI_OVER_TWO+Z*D,K[Q++]=tt*(1+Math.cos(X)),K[Q++]=.5*(1+Math.sin(X));for(D=1;D<m-c+1;D++)K[Q++]=D*tt,K[Q++]=0;for(D=c;et<D;D--)X=dt.CesiumMath.PI_OVER_TWO-D*Z,K[Q++]=1-tt*(1+Math.cos(X)),K[Q++]=.5*(1+Math.sin(X));for(D=et;0<D;D--)X=dt.CesiumMath.PI_OVER_TWO-Z*D,K[Q++]=1-$*(1+Math.cos(X)),K[Q++]=.5*(1+Math.sin(X));for(D=u-c;0<D;D--)K[Q++]=D*$,K[Q++]=1;for(D=1;D<1+et;D++)X=dt.CesiumMath.PI_OVER_TWO+Z*D,K[Q++]=$*(1+Math.cos(X)),K[Q++]=.5*(1+Math.sin(X))}else{for($=1/((u/=3)-1),tt=1/((m/=3)-1),D=0;D<m;D++)K[Q++]=D*tt,K[Q++]=0;for(D=u;0<D;D--)K[Q++]=(D-1)*$,K[Q++]=1}d.st=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:K})}return e.normal&&(d.normal=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:_.normals})),e.tangent&&(d.tangent=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:_.tangents})),e.bitangent&&(d.bitangent=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:_.bitangents})),{attributes:d,indices:F}}function x(t,e,r){r[e++]=t[0],r[e++]=t[1],r[e++]=t[2];for(var a=3;a<t.length;a+=3){var i=t[a],o=t[a+1],n=t[a+2];r[e++]=i,r[e++]=o,r[e++]=n,r[e++]=i,r[e++]=o,r[e++]=n}return r[e++]=t[0],r[e++]=t[1],r[e++]=t[2],r}function c(t,e){var r=new F.VertexFormat({position:e.position,normal:e.normal||e.bitangent||t.shadowVolume,tangent:e.tangent,bitangent:e.normal||e.bitangent,st:e.st}),a=t.ellipsoid,i=P(it.CorridorGeometryLibrary.computePositions(t),r,a),o=t.height,n=t.extrudedHeight,s=i.attributes,l=i.indices,d=s.position.values,u=d.length,m=new Float64Array(6*u),r=new Float64Array(u);r.set(d);i=new Float64Array(4*u),i=x(d=V.PolygonPipeline.scaleToGeodeticHeight(d,o,a),0,i);i=x(r=V.PolygonPipeline.scaleToGeodeticHeight(r,n,a),2*u,i),m.set(d),m.set(r,u),m.set(i,2*u),s.position.values=m;var s=function(t,e){if(!(e.normal||e.tangent||e.bitangent||e.st))return t;var r,a=t.position.values;(e.normal||e.bitangent)&&(r=t.normal.values,l=t.bitangent.values);var i=t.position.values.length/18,o=3*i,n=2*i,s=2*o;if(e.normal||e.bitangent||e.tangent){for(var l,d=e.normal?new Float32Array(6*o):void 0,u=e.tangent?new Float32Array(6*o):void 0,m=e.bitangent?new Float32Array(6*o):void 0,y=ut,f=mt,p=yt,c=ft,h=L,g=pt,b=s,C=0;C<o;C+=3){var v=b+s,y=rt.Cartesian3.fromArray(a,C,y),f=rt.Cartesian3.fromArray(a,C+o,f),p=rt.Cartesian3.fromArray(a,(C+3)%o,p);f=rt.Cartesian3.subtract(f,y,f),p=rt.Cartesian3.subtract(p,y,p),c=rt.Cartesian3.normalize(rt.Cartesian3.cross(f,p,c),c),e.normal&&(it.CorridorGeometryLibrary.addAttribute(d,c,v),it.CorridorGeometryLibrary.addAttribute(d,c,v+3),it.CorridorGeometryLibrary.addAttribute(d,c,b),it.CorridorGeometryLibrary.addAttribute(d,c,b+3)),(e.tangent||e.bitangent)&&(g=rt.Cartesian3.fromArray(r,C,g),e.bitangent&&(it.CorridorGeometryLibrary.addAttribute(m,g,v),it.CorridorGeometryLibrary.addAttribute(m,g,v+3),it.CorridorGeometryLibrary.addAttribute(m,g,b),it.CorridorGeometryLibrary.addAttribute(m,g,b+3)),e.tangent&&(h=rt.Cartesian3.normalize(rt.Cartesian3.cross(g,c,h),h),it.CorridorGeometryLibrary.addAttribute(u,h,v),it.CorridorGeometryLibrary.addAttribute(u,h,v+3),it.CorridorGeometryLibrary.addAttribute(u,h,b),it.CorridorGeometryLibrary.addAttribute(u,h,b+3))),b+=6}if(e.normal){for(d.set(r),C=0;C<o;C+=3)d[C+o]=-r[C],d[C+o+1]=-r[C+1],d[C+o+2]=-r[C+2];t.normal.values=d}else t.normal=void 0;e.bitangent?(m.set(l),m.set(l,o),t.bitangent.values=m):t.bitangent=void 0,e.tangent&&(l=t.tangent.values,u.set(l),u.set(l,o),t.tangent.values=u)}if(e.st){var A=t.st.values,_=new Float32Array(6*n);_.set(A),_.set(A,n);for(var w=2*n,T=0;T<2;T++){for(_[w++]=A[0],_[w++]=A[1],C=2;C<n;C+=2){var G=A[C],E=A[C+1];_[w++]=G,_[w++]=E,_[w++]=G,_[w++]=E}_[w++]=A[0],_[w++]=A[1]}t.st.values=_}return t}(s,e),y=u/3;if(t.shadowVolume){for(var f=s.normal.values,u=f.length,i=new Float32Array(6*u),p=0;p<u;p++)f[p]=-f[p];i.set(f,u),i=x(f,4*u,i),s.extrudeDirection=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:i}),e.normal||(s.normal=void 0)}ot.defined(t.offsetAttribute)&&(e=new Uint8Array(6*y),e=t.offsetAttribute===E.GeometryOffsetAttribute.TOP?(e=E.arrayFill(e,1,0,y),E.arrayFill(e,1,2*y,4*y)):(t=t.offsetAttribute===E.GeometryOffsetAttribute.NONE?0:1,E.arrayFill(e,t)),s.applyOffset=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:e}));var c=l.length,h=y+y,g=lt.IndexDatatype.createTypedArray(m.length/3,2*c+3*h);g.set(l);var b,C,v,A,_=c;for(p=0;p<c;p+=3){var w=l[p],T=l[p+1],G=l[p+2];g[_++]=G+y,g[_++]=T+y,g[_++]=w+y}for(p=0;p<h;p+=2)v=(b=p+h)+1,A=(C=b+h)+1,g[_++]=b,g[_++]=C,g[_++]=v,g[_++]=v,g[_++]=C,g[_++]=A;return{attributes:s,indices:g}}var h=new rt.Cartesian3,g=new rt.Cartesian3,b=new rt.Cartographic;function C(t,e,r,a,i,o){var n=rt.Cartesian3.subtract(e,t,h);rt.Cartesian3.normalize(n,n);var s=r.geodeticSurfaceNormal(t,g),l=rt.Cartesian3.cross(n,s,h);rt.Cartesian3.multiplyByScalar(l,a,l);var d=i.latitude,u=i.longitude,e=o.latitude,n=o.longitude;rt.Cartesian3.add(t,l,g),r.cartesianToCartographic(g,b);s=b.latitude,a=b.longitude,d=Math.min(d,s),u=Math.min(u,a),e=Math.max(e,s),n=Math.max(n,a);rt.Cartesian3.subtract(t,l,g),r.cartesianToCartographic(g,b),s=b.latitude,a=b.longitude,d=Math.min(d,s),u=Math.min(u,a),e=Math.max(e,s),n=Math.max(n,a),i.latitude=d,i.longitude=u,o.latitude=e,o.longitude=n}var v=new rt.Cartesian3,A=new rt.Cartesian3,_=new rt.Cartographic,w=new rt.Cartographic;function d(t,e,r,a,i){t=p(t,e);var o=y.arrayRemoveDuplicates(t,rt.Cartesian3.equalsEpsilon),n=o.length;if(n<2||r<=0)return new rt.Rectangle;var s,l,d=.5*r;_.latitude=Number.POSITIVE_INFINITY,_.longitude=Number.POSITIVE_INFINITY,w.latitude=Number.NEGATIVE_INFINITY,w.longitude=Number.NEGATIVE_INFINITY,a===f.CornerType.ROUNDED&&(m=o[0],rt.Cartesian3.subtract(m,o[1],v),rt.Cartesian3.normalize(v,v),rt.Cartesian3.multiplyByScalar(v,d,v),rt.Cartesian3.add(m,v,A),e.cartesianToCartographic(A,b),s=b.latitude,l=b.longitude,_.latitude=Math.min(_.latitude,s),_.longitude=Math.min(_.longitude,l),w.latitude=Math.max(w.latitude,s),w.longitude=Math.max(w.longitude,l));for(var u=0;u<n-1;++u)C(o[u],o[u+1],e,d,_,w);var m=o[n-1];rt.Cartesian3.subtract(m,o[n-2],v),rt.Cartesian3.normalize(v,v),rt.Cartesian3.multiplyByScalar(v,d,v),rt.Cartesian3.add(m,v,A),C(m,A,e,d,_,w),a===f.CornerType.ROUNDED&&(e.cartesianToCartographic(A,b),s=b.latitude,l=b.longitude,_.latitude=Math.min(_.latitude,s),_.longitude=Math.min(_.longitude,l),w.latitude=Math.max(w.latitude,s),w.longitude=Math.max(w.longitude,l));i=ot.defined(i)?i:new rt.Rectangle;return i.north=w.latitude,i.south=_.latitude,i.east=w.longitude,i.west=_.longitude,i}function T(t){var e=(t=ot.defaultValue(t,ot.defaultValue.EMPTY_OBJECT)).positions,r=t.width,a=ot.defaultValue(t.height,0),i=ot.defaultValue(t.extrudedHeight,a);this._positions=e,this._ellipsoid=rt.Ellipsoid.clone(ot.defaultValue(t.ellipsoid,rt.Ellipsoid.WGS84)),this._vertexFormat=F.VertexFormat.clone(ot.defaultValue(t.vertexFormat,F.VertexFormat.DEFAULT)),this._width=r,this._height=Math.max(a,i),this._extrudedHeight=Math.min(a,i),this._cornerType=ot.defaultValue(t.cornerType,f.CornerType.ROUNDED),this._granularity=ot.defaultValue(t.granularity,dt.CesiumMath.RADIANS_PER_DEGREE),this._shadowVolume=ot.defaultValue(t.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=t.offsetAttribute,this._rectangle=void 0,this.packedLength=1+e.length*rt.Cartesian3.packedLength+rt.Ellipsoid.packedLength+F.VertexFormat.packedLength+7}T.pack=function(t,e,r){r=ot.defaultValue(r,0);var a=t._positions,i=a.length;e[r++]=i;for(var o=0;o<i;++o,r+=rt.Cartesian3.packedLength)rt.Cartesian3.pack(a[o],e,r);return rt.Ellipsoid.pack(t._ellipsoid,e,r),r+=rt.Ellipsoid.packedLength,F.VertexFormat.pack(t._vertexFormat,e,r),r+=F.VertexFormat.packedLength,e[r++]=t._width,e[r++]=t._height,e[r++]=t._extrudedHeight,e[r++]=t._cornerType,e[r++]=t._granularity,e[r++]=t._shadowVolume?1:0,e[r]=ot.defaultValue(t._offsetAttribute,-1),e};var G=rt.Ellipsoid.clone(rt.Ellipsoid.UNIT_SPHERE),N=new F.VertexFormat,D={positions:void 0,ellipsoid:G,vertexFormat:N,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};return T.unpack=function(t,e,r){e=ot.defaultValue(e,0);for(var a=t[e++],i=new Array(a),o=0;o<a;++o,e+=rt.Cartesian3.packedLength)i[o]=rt.Cartesian3.unpack(t,e);var n=rt.Ellipsoid.unpack(t,e,G);e+=rt.Ellipsoid.packedLength;var s=F.VertexFormat.unpack(t,e,N);e+=F.VertexFormat.packedLength;var l=t[e++],d=t[e++],u=t[e++],m=t[e++],y=t[e++],f=1===t[e++],p=t[e];return ot.defined(r)?(r._positions=i,r._ellipsoid=rt.Ellipsoid.clone(n,r._ellipsoid),r._vertexFormat=F.VertexFormat.clone(s,r._vertexFormat),r._width=l,r._height=d,r._extrudedHeight=u,r._cornerType=m,r._granularity=y,r._shadowVolume=f,r._offsetAttribute=-1===p?void 0:p,r):(D.positions=i,D.width=l,D.height=d,D.extrudedHeight=u,D.cornerType=m,D.granularity=y,D.shadowVolume=f,D.offsetAttribute=-1===p?void 0:p,new T(D))},T.computeRectangle=function(t,e){var r=(t=ot.defaultValue(t,ot.defaultValue.EMPTY_OBJECT)).positions,a=t.width;return d(r,ot.defaultValue(t.ellipsoid,rt.Ellipsoid.WGS84),a,ot.defaultValue(t.cornerType,f.CornerType.ROUNDED),e)},T.createGeometry=function(t){var e=t._positions,r=t._width,a=t._ellipsoid,e=p(e,a),i=y.arrayRemoveDuplicates(e,rt.Cartesian3.equalsEpsilon);if(!(i.length<2||r<=0)){var o,n=t._height,s=t._extrudedHeight,l=!dt.CesiumMath.equalsEpsilon(n,s,0,dt.CesiumMath.EPSILON2),e=t._vertexFormat,r={ellipsoid:a,positions:i,width:r,cornerType:t._cornerType,granularity:t._granularity,saveAttributes:!0};l?(r.height=n,r.extrudedHeight=s,r.shadowVolume=t._shadowVolume,r.offsetAttribute=t._offsetAttribute,o=c(r,e)):((o=P(it.CorridorGeometryLibrary.computePositions(r),e,a)).attributes.position.values=V.PolygonPipeline.scaleToGeodeticHeight(o.attributes.position.values,n,a),ot.defined(t._offsetAttribute)&&(d=t._offsetAttribute===E.GeometryOffsetAttribute.NONE?0:1,u=o.attributes.position.values.length,u=new Uint8Array(u/3),E.arrayFill(u,d),o.attributes.applyOffset=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})));var d=o.attributes,u=m.BoundingSphere.fromVertices(d.position.values,void 0,3);return e.position||(o.attributes.position.values=void 0),new nt.Geometry({attributes:d,indices:o.indices,primitiveType:nt.PrimitiveType.TRIANGLES,boundingSphere:u,offsetAttribute:t._offsetAttribute})}},T.createShadowVolume=function(t,e,r){var a=t._granularity,i=t._ellipsoid,e=e(a,i),r=r(a,i);return new T({positions:t._positions,width:t._width,cornerType:t._cornerType,ellipsoid:i,granularity:a,extrudedHeight:e,height:r,vertexFormat:F.VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(T.prototype,{rectangle:{get:function(){return ot.defined(this._rectangle)||(this._rectangle=d(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}}),function(t,e){return(t=ot.defined(e)?T.unpack(t,e):t)._ellipsoid=rt.Ellipsoid.clone(t._ellipsoid),T.createGeometry(t)}});

@@ -1,1 +0,1 @@

define(["./GeometryOffsetAttribute-b94750ca","./arrayRemoveDuplicates-fc9e255d","./Transforms-5295b227","./Cartesian2-5b63e672","./Check-64f87f7d","./ComponentDatatype-8f71e605","./PolylineVolumeGeometryLibrary-ec280c2f","./CorridorGeometryLibrary-c6e83d15","./when-ca391574","./GeometryAttribute-7ef2d452","./GeometryAttributes-a356f820","./IndexDatatype-4e56bcfa","./Math-b53708b3","./PolygonPipeline-55053b0a","./RuntimeError-19cb26ba","./WebGLConstants-95ceb4e9","./EllipsoidTangentPlane-0fb66b96","./IntersectionTests-f5111308","./Plane-99b2becd","./PolylinePipeline-00f5e064","./EllipsoidGeodesic-bbea0b0a","./EllipsoidRhumbLine-21029cef"],function(v,u,p,M,e,R,B,U,F,Y,q,W,f,A,t,i,r,o,a,n,s,l){"use strict";var J=new M.Cartesian3,j=new M.Cartesian3,z=new M.Cartesian3;function _(e,t){var i,r=[],o=e.positions,a=e.corners,n=e.endPositions,s=new q.GeometryAttributes,l=0,d=0,u=0;for(L=0;L<o.length;L+=2)l+=i=o[L].length-3,u+=i/3*4,d+=o[L+1].length-3;for(l+=3,d+=3,L=0;L<a.length;L++){var p=a[L],f=a[L].leftPositions;F.defined(f)?l+=i=f.length:d+=i=a[L].rightPositions.length,u+=i/3*2}var h,y=F.defined(n);y&&(l+=h=n[0].length-3,d+=h,u+=4*(h/=3));var c,b,g,m,e=l+d,v=new Float64Array(e),A=0,_=e-1,E=h/2,C=W.IndexDatatype.createTypedArray(e/3,u+4),G=0;if(C[G++]=A/3,C[G++]=(_-2)/3,y){r.push(A/3);for(var T=J,P=j,w=n[0],L=0;L<E;L++)T=M.Cartesian3.fromArray(w,3*(E-1-L),T),P=M.Cartesian3.fromArray(w,3*(E+L),P),U.CorridorGeometryLibrary.addAttribute(v,P,A),U.CorridorGeometryLibrary.addAttribute(v,T,void 0,_),m=(b=A/3)+1,g=(c=(_-2)/3)-1,C[G++]=c,C[G++]=g,C[G++]=b,C[G++]=m,A+=3,_-=3}var D=0,k=o[D++],N=o[D++];for(v.set(k,A),v.set(N,_-N.length+1),i=N.length-3,r.push(A/3,(_-2)/3),L=0;L<i;L+=3)m=(b=A/3)+1,g=(c=(_-2)/3)-1,C[G++]=c,C[G++]=g,C[G++]=b,C[G++]=m,A+=3,_-=3;for(L=0;L<a.length;L++){var O,V,x=(p=a[L]).leftPositions,H=p.rightPositions,I=z;if(F.defined(x)){for(_-=3,V=g,r.push(m),O=0;O<x.length/3;O++)I=M.Cartesian3.fromArray(x,3*O,I),C[G++]=V-O-1,C[G++]=V-O,U.CorridorGeometryLibrary.addAttribute(v,I,void 0,_),_-=3;r.push(V-Math.floor(x.length/6)),t===B.CornerType.BEVELED&&r.push((_-2)/3+1),A+=3}else{for(A+=3,V=m,r.push(g),O=0;O<H.length/3;O++)I=M.Cartesian3.fromArray(H,3*O,I),C[G++]=V+O,C[G++]=V+O+1,U.CorridorGeometryLibrary.addAttribute(v,I,A),A+=3;r.push(V+Math.floor(H.length/6)),t===B.CornerType.BEVELED&&r.push(A/3-1),_-=3}for(k=o[D++],N=o[D++],k.splice(0,3),N.splice(N.length-3,3),v.set(k,A),v.set(N,_-N.length+1),i=N.length-3,O=0;O<N.length;O+=3)b=(m=A/3)-1,c=(g=(_-2)/3)+1,C[G++]=c,C[G++]=g,C[G++]=b,C[G++]=m,A+=3,_-=3;A-=3,_+=3,r.push(A/3,(_-2)/3)}if(y){A+=3,_-=3,T=J,P=j;var S=n[1];for(L=0;L<E;L++)T=M.Cartesian3.fromArray(S,3*(h-L-1),T),P=M.Cartesian3.fromArray(S,3*L,P),U.CorridorGeometryLibrary.addAttribute(v,T,void 0,_),U.CorridorGeometryLibrary.addAttribute(v,P,A),b=(m=A/3)-1,c=(g=(_-2)/3)+1,C[G++]=c,C[G++]=g,C[G++]=b,C[G++]=m,A+=3,_-=3;r.push(A/3)}else r.push(A/3,(_-2)/3);return C[G++]=A/3,C[G++]=(_-2)/3,s.position=new Y.GeometryAttribute({componentDatatype:R.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:v}),{attributes:s,indices:C,wallIndices:r}}function h(e){var t=(e=F.defaultValue(e,F.defaultValue.EMPTY_OBJECT)).positions,i=e.width,r=F.defaultValue(e.height,0),o=F.defaultValue(e.extrudedHeight,r);this._positions=t,this._ellipsoid=M.Ellipsoid.clone(F.defaultValue(e.ellipsoid,M.Ellipsoid.WGS84)),this._width=i,this._height=Math.max(r,o),this._extrudedHeight=Math.min(r,o),this._cornerType=F.defaultValue(e.cornerType,B.CornerType.ROUNDED),this._granularity=F.defaultValue(e.granularity,f.CesiumMath.RADIANS_PER_DEGREE),this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*M.Cartesian3.packedLength+M.Ellipsoid.packedLength+6}h.pack=function(e,t,i){i=F.defaultValue(i,0);var r=e._positions,o=r.length;t[i++]=o;for(var a=0;a<o;++a,i+=M.Cartesian3.packedLength)M.Cartesian3.pack(r[a],t,i);return M.Ellipsoid.pack(e._ellipsoid,t,i),i+=M.Ellipsoid.packedLength,t[i++]=e._width,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._cornerType,t[i++]=e._granularity,t[i]=F.defaultValue(e._offsetAttribute,-1),t};var y=M.Ellipsoid.clone(M.Ellipsoid.UNIT_SPHERE),c={positions:void 0,ellipsoid:y,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};return h.unpack=function(e,t,i){t=F.defaultValue(t,0);for(var r=e[t++],o=new Array(r),a=0;a<r;++a,t+=M.Cartesian3.packedLength)o[a]=M.Cartesian3.unpack(e,t);var n=M.Ellipsoid.unpack(e,t,y);t+=M.Ellipsoid.packedLength;var s=e[t++],l=e[t++],d=e[t++],u=e[t++],p=e[t++],f=e[t];return F.defined(i)?(i._positions=o,i._ellipsoid=M.Ellipsoid.clone(n,i._ellipsoid),i._width=s,i._height=l,i._extrudedHeight=d,i._cornerType=u,i._granularity=p,i._offsetAttribute=-1===f?void 0:f,i):(c.positions=o,c.width=s,c.height=l,c.extrudedHeight=d,c.cornerType=u,c.granularity=p,c.offsetAttribute=-1===f?void 0:f,new h(c))},h.createGeometry=function(e){var t=e._positions,i=e._width,r=e._ellipsoid,t=function(e,t){for(var i=0;i<e.length;i++)e[i]=t.scaleToGeodeticSurface(e[i],e[i]);return e}(t,r),o=u.arrayRemoveDuplicates(t,M.Cartesian3.equalsEpsilon);if(!(o.length<2||i<=0)){var a,n=e._height,s=e._extrudedHeight,t=!f.CesiumMath.equalsEpsilon(n,s,0,f.CesiumMath.EPSILON2),i={ellipsoid:r,positions:o,width:i,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1};t?(i.height=n,i.extrudedHeight=s,i.offsetAttribute=e._offsetAttribute,a=function(e){var t=e.ellipsoid,i=(l=_(U.CorridorGeometryLibrary.computePositions(e),e.cornerType)).wallIndices,r=e.height,o=e.extrudedHeight,a=l.attributes,n=l.indices,s=(d=a.position.values).length;(u=new Float64Array(s)).set(d);var l=new Float64Array(2*s),d=A.PolygonPipeline.scaleToGeodeticHeight(d,r,t),u=A.PolygonPipeline.scaleToGeodeticHeight(u,o,t);l.set(d),l.set(u,s),a.position.values=l,s/=3,F.defined(e.offsetAttribute)&&(u=new Uint8Array(2*s),u=e.offsetAttribute===v.GeometryOffsetAttribute.TOP?v.arrayFill(u,1,0,s):(e=e.offsetAttribute===v.GeometryOffsetAttribute.NONE?0:1,v.arrayFill(u,e)),a.applyOffset=new Y.GeometryAttribute({componentDatatype:R.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:u}));var p=n.length,f=W.IndexDatatype.createTypedArray(l.length/3,2*(p+i.length));f.set(n);for(var h,y,c=p,b=0;b<p;b+=2){var g=n[b],m=n[b+1];f[c++]=g+s,f[c++]=m+s}for(b=0;b<i.length;b++)y=(h=i[b])+s,f[c++]=h,f[c++]=y;return{attributes:a,indices:f}}(i)):((a=_(U.CorridorGeometryLibrary.computePositions(i),i.cornerType)).attributes.position.values=A.PolygonPipeline.scaleToGeodeticHeight(a.attributes.position.values,n,r),F.defined(e._offsetAttribute)&&(l=a.attributes.position.values.length,d=new Uint8Array(l/3),l=e._offsetAttribute===v.GeometryOffsetAttribute.NONE?0:1,v.arrayFill(d,l),a.attributes.applyOffset=new Y.GeometryAttribute({componentDatatype:R.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})));var l=a.attributes,d=p.BoundingSphere.fromVertices(l.position.values,void 0,3);return new Y.Geometry({attributes:l,indices:a.indices,primitiveType:Y.PrimitiveType.LINES,boundingSphere:d,offsetAttribute:e._offsetAttribute})}},function(e,t){return(e=F.defined(t)?h.unpack(e,t):e)._ellipsoid=M.Ellipsoid.clone(e._ellipsoid),h.createGeometry(e)}});
define(["./GeometryOffsetAttribute-b94750ca","./arrayRemoveDuplicates-fc9e255d","./Transforms-5295b227","./Cartesian2-5b63e672","./Check-64f87f7d","./ComponentDatatype-8f71e605","./PolylineVolumeGeometryLibrary-62de9881","./CorridorGeometryLibrary-3981ce9f","./when-ca391574","./GeometryAttribute-7ef2d452","./GeometryAttributes-a356f820","./IndexDatatype-4e56bcfa","./Math-b53708b3","./PolygonPipeline-ff4431d7","./RuntimeError-19cb26ba","./WebGLConstants-95ceb4e9","./EllipsoidTangentPlane-0fb66b96","./IntersectionTests-f5111308","./Plane-99b2becd","./PolylinePipeline-12a23b58","./EllipsoidGeodesic-bbea0b0a","./EllipsoidRhumbLine-6ee9af74"],function(v,u,p,M,e,R,B,U,F,Y,q,W,f,A,t,i,r,o,a,n,s,l){"use strict";var J=new M.Cartesian3,j=new M.Cartesian3,z=new M.Cartesian3;function _(e,t){var i,r=[],o=e.positions,a=e.corners,n=e.endPositions,s=new q.GeometryAttributes,l=0,d=0,u=0;for(L=0;L<o.length;L+=2)l+=i=o[L].length-3,u+=i/3*4,d+=o[L+1].length-3;for(l+=3,d+=3,L=0;L<a.length;L++){var p=a[L],f=a[L].leftPositions;F.defined(f)?l+=i=f.length:d+=i=a[L].rightPositions.length,u+=i/3*2}var h,y=F.defined(n);y&&(l+=h=n[0].length-3,d+=h,u+=4*(h/=3));var c,b,g,m,e=l+d,v=new Float64Array(e),A=0,_=e-1,E=h/2,C=W.IndexDatatype.createTypedArray(e/3,u+4),G=0;if(C[G++]=A/3,C[G++]=(_-2)/3,y){r.push(A/3);for(var T=J,P=j,w=n[0],L=0;L<E;L++)T=M.Cartesian3.fromArray(w,3*(E-1-L),T),P=M.Cartesian3.fromArray(w,3*(E+L),P),U.CorridorGeometryLibrary.addAttribute(v,P,A),U.CorridorGeometryLibrary.addAttribute(v,T,void 0,_),m=(b=A/3)+1,g=(c=(_-2)/3)-1,C[G++]=c,C[G++]=g,C[G++]=b,C[G++]=m,A+=3,_-=3}var D=0,k=o[D++],N=o[D++];for(v.set(k,A),v.set(N,_-N.length+1),i=N.length-3,r.push(A/3,(_-2)/3),L=0;L<i;L+=3)m=(b=A/3)+1,g=(c=(_-2)/3)-1,C[G++]=c,C[G++]=g,C[G++]=b,C[G++]=m,A+=3,_-=3;for(L=0;L<a.length;L++){var O,V,x=(p=a[L]).leftPositions,H=p.rightPositions,I=z;if(F.defined(x)){for(_-=3,V=g,r.push(m),O=0;O<x.length/3;O++)I=M.Cartesian3.fromArray(x,3*O,I),C[G++]=V-O-1,C[G++]=V-O,U.CorridorGeometryLibrary.addAttribute(v,I,void 0,_),_-=3;r.push(V-Math.floor(x.length/6)),t===B.CornerType.BEVELED&&r.push((_-2)/3+1),A+=3}else{for(A+=3,V=m,r.push(g),O=0;O<H.length/3;O++)I=M.Cartesian3.fromArray(H,3*O,I),C[G++]=V+O,C[G++]=V+O+1,U.CorridorGeometryLibrary.addAttribute(v,I,A),A+=3;r.push(V+Math.floor(H.length/6)),t===B.CornerType.BEVELED&&r.push(A/3-1),_-=3}for(k=o[D++],N=o[D++],k.splice(0,3),N.splice(N.length-3,3),v.set(k,A),v.set(N,_-N.length+1),i=N.length-3,O=0;O<N.length;O+=3)b=(m=A/3)-1,c=(g=(_-2)/3)+1,C[G++]=c,C[G++]=g,C[G++]=b,C[G++]=m,A+=3,_-=3;A-=3,_+=3,r.push(A/3,(_-2)/3)}if(y){A+=3,_-=3,T=J,P=j;var S=n[1];for(L=0;L<E;L++)T=M.Cartesian3.fromArray(S,3*(h-L-1),T),P=M.Cartesian3.fromArray(S,3*L,P),U.CorridorGeometryLibrary.addAttribute(v,T,void 0,_),U.CorridorGeometryLibrary.addAttribute(v,P,A),b=(m=A/3)-1,c=(g=(_-2)/3)+1,C[G++]=c,C[G++]=g,C[G++]=b,C[G++]=m,A+=3,_-=3;r.push(A/3)}else r.push(A/3,(_-2)/3);return C[G++]=A/3,C[G++]=(_-2)/3,s.position=new Y.GeometryAttribute({componentDatatype:R.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:v}),{attributes:s,indices:C,wallIndices:r}}function h(e){var t=(e=F.defaultValue(e,F.defaultValue.EMPTY_OBJECT)).positions,i=e.width,r=F.defaultValue(e.height,0),o=F.defaultValue(e.extrudedHeight,r);this._positions=t,this._ellipsoid=M.Ellipsoid.clone(F.defaultValue(e.ellipsoid,M.Ellipsoid.WGS84)),this._width=i,this._height=Math.max(r,o),this._extrudedHeight=Math.min(r,o),this._cornerType=F.defaultValue(e.cornerType,B.CornerType.ROUNDED),this._granularity=F.defaultValue(e.granularity,f.CesiumMath.RADIANS_PER_DEGREE),this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*M.Cartesian3.packedLength+M.Ellipsoid.packedLength+6}h.pack=function(e,t,i){i=F.defaultValue(i,0);var r=e._positions,o=r.length;t[i++]=o;for(var a=0;a<o;++a,i+=M.Cartesian3.packedLength)M.Cartesian3.pack(r[a],t,i);return M.Ellipsoid.pack(e._ellipsoid,t,i),i+=M.Ellipsoid.packedLength,t[i++]=e._width,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._cornerType,t[i++]=e._granularity,t[i]=F.defaultValue(e._offsetAttribute,-1),t};var y=M.Ellipsoid.clone(M.Ellipsoid.UNIT_SPHERE),c={positions:void 0,ellipsoid:y,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};return h.unpack=function(e,t,i){t=F.defaultValue(t,0);for(var r=e[t++],o=new Array(r),a=0;a<r;++a,t+=M.Cartesian3.packedLength)o[a]=M.Cartesian3.unpack(e,t);var n=M.Ellipsoid.unpack(e,t,y);t+=M.Ellipsoid.packedLength;var s=e[t++],l=e[t++],d=e[t++],u=e[t++],p=e[t++],f=e[t];return F.defined(i)?(i._positions=o,i._ellipsoid=M.Ellipsoid.clone(n,i._ellipsoid),i._width=s,i._height=l,i._extrudedHeight=d,i._cornerType=u,i._granularity=p,i._offsetAttribute=-1===f?void 0:f,i):(c.positions=o,c.width=s,c.height=l,c.extrudedHeight=d,c.cornerType=u,c.granularity=p,c.offsetAttribute=-1===f?void 0:f,new h(c))},h.createGeometry=function(e){var t=e._positions,i=e._width,r=e._ellipsoid,t=function(e,t){for(var i=0;i<e.length;i++)e[i]=t.scaleToGeodeticSurface(e[i],e[i]);return e}(t,r),o=u.arrayRemoveDuplicates(t,M.Cartesian3.equalsEpsilon);if(!(o.length<2||i<=0)){var a,n=e._height,s=e._extrudedHeight,t=!f.CesiumMath.equalsEpsilon(n,s,0,f.CesiumMath.EPSILON2),i={ellipsoid:r,positions:o,width:i,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1};t?(i.height=n,i.extrudedHeight=s,i.offsetAttribute=e._offsetAttribute,a=function(e){var t=e.ellipsoid,i=(l=_(U.CorridorGeometryLibrary.computePositions(e),e.cornerType)).wallIndices,r=e.height,o=e.extrudedHeight,a=l.attributes,n=l.indices,s=(d=a.position.values).length;(u=new Float64Array(s)).set(d);var l=new Float64Array(2*s),d=A.PolygonPipeline.scaleToGeodeticHeight(d,r,t),u=A.PolygonPipeline.scaleToGeodeticHeight(u,o,t);l.set(d),l.set(u,s),a.position.values=l,s/=3,F.defined(e.offsetAttribute)&&(u=new Uint8Array(2*s),u=e.offsetAttribute===v.GeometryOffsetAttribute.TOP?v.arrayFill(u,1,0,s):(e=e.offsetAttribute===v.GeometryOffsetAttribute.NONE?0:1,v.arrayFill(u,e)),a.applyOffset=new Y.GeometryAttribute({componentDatatype:R.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:u}));var p=n.length,f=W.IndexDatatype.createTypedArray(l.length/3,2*(p+i.length));f.set(n);for(var h,y,c=p,b=0;b<p;b+=2){var g=n[b],m=n[b+1];f[c++]=g+s,f[c++]=m+s}for(b=0;b<i.length;b++)y=(h=i[b])+s,f[c++]=h,f[c++]=y;return{attributes:a,indices:f}}(i)):((a=_(U.CorridorGeometryLibrary.computePositions(i),i.cornerType)).attributes.position.values=A.PolygonPipeline.scaleToGeodeticHeight(a.attributes.position.values,n,r),F.defined(e._offsetAttribute)&&(l=a.attributes.position.values.length,d=new Uint8Array(l/3),l=e._offsetAttribute===v.GeometryOffsetAttribute.NONE?0:1,v.arrayFill(d,l),a.attributes.applyOffset=new Y.GeometryAttribute({componentDatatype:R.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})));var l=a.attributes,d=p.BoundingSphere.fromVertices(l.position.values,void 0,3);return new Y.Geometry({attributes:l,indices:a.indices,primitiveType:Y.PrimitiveType.LINES,boundingSphere:d,offsetAttribute:e._offsetAttribute})}},function(e,t){return(e=F.defined(t)?h.unpack(e,t):e)._ellipsoid=M.Ellipsoid.clone(e._ellipsoid),h.createGeometry(e)}});

@@ -1,1 +0,1 @@

define(["./Transforms-5295b227","./Cartesian2-5b63e672","./Check-64f87f7d","./when-ca391574","./Math-b53708b3","./ArcType-2b58731c","./arrayRemoveDuplicates-fc9e255d","./ComponentDatatype-8f71e605","./EllipsoidGeodesic-bbea0b0a","./EllipsoidRhumbLine-21029cef","./EncodedCartesian3-c36ced29","./GeometryAttribute-7ef2d452","./IntersectionTests-f5111308","./Plane-99b2becd","./WebMercatorProjection-e0329e39","./RuntimeError-19cb26ba","./WebGLConstants-95ceb4e9"],function(be,Oe,e,B,Pe,j,G,ke,M,V,Ae,Le,Y,r,a,t,n){"use strict";function i(e){e=B.defaultValue(e,B.defaultValue.EMPTY_OBJECT),this._ellipsoid=B.defaultValue(e.ellipsoid,Oe.Ellipsoid.WGS84),this._rectangle=B.defaultValue(e.rectangle,Oe.Rectangle.MAX_VALUE),this._projection=new be.GeographicProjection(this._ellipsoid),this._numberOfLevelZeroTilesX=B.defaultValue(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=B.defaultValue(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(i.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),i.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},i.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},i.prototype.rectangleToNativeRectangle=function(e,a){var t=Pe.CesiumMath.toDegrees(e.west),n=Pe.CesiumMath.toDegrees(e.south),i=Pe.CesiumMath.toDegrees(e.east),e=Pe.CesiumMath.toDegrees(e.north);return B.defined(a)?(a.west=t,a.south=n,a.east=i,a.north=e,a):new Oe.Rectangle(t,n,i,e)},i.prototype.tileXYToNativeRectangle=function(e,a,t,n){n=this.tileXYToRectangle(e,a,t,n);return n.west=Pe.CesiumMath.toDegrees(n.west),n.south=Pe.CesiumMath.toDegrees(n.south),n.east=Pe.CesiumMath.toDegrees(n.east),n.north=Pe.CesiumMath.toDegrees(n.north),n},i.prototype.tileXYToRectangle=function(e,a,t,n){var i=this._rectangle,r=this.getNumberOfXTilesAtLevel(t),s=this.getNumberOfYTilesAtLevel(t),t=i.width/r,r=e*t+i.west,e=(e+1)*t+i.west,t=i.height/s,s=i.north-a*t,t=i.north-(a+1)*t;return(n=!B.defined(n)?new Oe.Rectangle(r,t,e,s):n).west=r,n.south=t,n.east=e,n.north=s,n},i.prototype.positionToTileXY=function(e,a,t){var n=this._rectangle;if(Oe.Rectangle.contains(n,e)){var i=this.getNumberOfXTilesAtLevel(a),r=this.getNumberOfYTilesAtLevel(a),s=n.width/i,o=n.height/r,a=e.longitude;n.east<n.west&&(a+=Pe.CesiumMath.TWO_PI);s=(a-n.west)/s|0;i<=s&&(s=i-1);o=(n.north-e.latitude)/o|0;return(r<=o&&(o=r-1),B.defined(t))?(t.x=s,t.y=o,t):new Oe.Cartesian2(s,o)}};var s=new Oe.Cartesian3,o=new Oe.Cartesian3,l=new Oe.Cartographic,u=new Oe.Cartesian3,c=new Oe.Cartesian3,C=new be.BoundingSphere,p=new i,h=[new Oe.Cartographic,new Oe.Cartographic,new Oe.Cartographic,new Oe.Cartographic],d=new Oe.Cartesian2,Se={};function g(e){Oe.Cartographic.fromRadians(e.east,e.north,0,h[0]),Oe.Cartographic.fromRadians(e.west,e.north,0,h[1]),Oe.Cartographic.fromRadians(e.east,e.south,0,h[2]),Oe.Cartographic.fromRadians(e.west,e.south,0,h[3]);for(var a=0,t=0,n=0,i=0,r=Se._terrainHeightsMaxLevel,s=0;s<=r;++s){for(var o=!1,l=0;l<4;++l){var u=h[l];if(p.positionToTileXY(u,s,d),0===l)n=d.x,i=d.y;else if(n!==d.x||i!==d.y){o=!0;break}}if(o)break;a=n,t=i}if(0!==s)return{x:a,y:t,level:r<s?r:s-1}}Se.initialize=function(){var e=Se._initPromise;return B.defined(e)?e:(e=be.Resource.fetchJson(be.buildModuleUrl("Assets/approximateTerrainHeights.json")).then(function(e){Se._terrainHeights=e}),Se._initPromise=e)},Se.getMinimumMaximumHeights=function(e,a){a=B.defaultValue(a,Oe.Ellipsoid.WGS84);var t=g(e),n=Se._defaultMinTerrainHeight,i=Se._defaultMaxTerrainHeight;return B.defined(t)&&(t=t.level+"-"+t.x+"-"+t.y,t=Se._terrainHeights[t],B.defined(t)&&(n=t[0],i=t[1]),a.cartographicToCartesian(Oe.Rectangle.northeast(e,l),s),a.cartographicToCartesian(Oe.Rectangle.southwest(e,l),o),Oe.Cartesian3.midpoint(o,s,u),a=a.scaleToGeodeticSurface(u,c),n=B.defined(a)?(a=Oe.Cartesian3.distance(u,a),Math.min(n,-a)):Se._defaultMinTerrainHeight),{minimumTerrainHeight:n=Math.max(Se._defaultMinTerrainHeight,n),maximumTerrainHeight:i}},Se.getBoundingSphere=function(e,a){a=B.defaultValue(a,Oe.Ellipsoid.WGS84);var t=g(e),n=Se._defaultMaxTerrainHeight;B.defined(t)&&(i=t.level+"-"+t.x+"-"+t.y,i=Se._terrainHeights[i],B.defined(i)&&(n=i[1]));var i=be.BoundingSphere.fromRectangle3D(e,a,0);return be.BoundingSphere.fromRectangle3D(e,a,n,C),be.BoundingSphere.union(i,C,i)},Se._terrainHeightsMaxLevel=6,Se._defaultMaxTerrainHeight=9e3,Se._defaultMinTerrainHeight=-1e5,Se._terrainHeights=void 0,Se._initPromise=void 0,Object.defineProperties(Se,{initialized:{get:function(){return B.defined(Se._terrainHeights)}}});var F=[be.GeographicProjection,a.WebMercatorProjection],f=F.length,Ie=Math.cos(Pe.CesiumMath.toRadians(30)),m=Math.cos(Pe.CesiumMath.toRadians(150)),q=0,X=1e3;function w(e){var a=(e=B.defaultValue(e,B.defaultValue.EMPTY_OBJECT)).positions;this.width=B.defaultValue(e.width,1),this._positions=a,this.granularity=B.defaultValue(e.granularity,9999),this.loop=B.defaultValue(e.loop,!1),this.arcType=B.defaultValue(e.arcType,j.ArcType.GEODESIC),this._ellipsoid=Oe.Ellipsoid.WGS84,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(w.prototype,{packedLength:{get:function(){return 1+3*this._positions.length+1+1+1+Oe.Ellipsoid.packedLength+1+1}}}),w.setProjectionAndEllipsoid=function(e,a){for(var t=0,n=0;n<f;n++)if(a instanceof F[n]){t=n;break}e._projectionIndex=t,e._ellipsoid=a.ellipsoid};var y=new Oe.Cartesian3,v=new Oe.Cartesian3,T=new Oe.Cartesian3;function W(e,a,t,n,i){var r=Z(n,e,0,y),t=Z(n,e,t,v),a=Z(n,a,0,T),t=xe(t,r,v),r=xe(a,r,T);return Oe.Cartesian3.cross(r,t,i),Oe.Cartesian3.normalize(i,i)}var E=new Oe.Cartographic,_=new Oe.Cartesian3,b=new Oe.Cartesian3,O=new Oe.Cartesian3;function U(e,a,t,n,i,r,s,o,l,u,c){if(0!==i){var C;r===j.ArcType.GEODESIC?C=new M.EllipsoidGeodesic(e,a,s):r===j.ArcType.RHUMB&&(C=new V.EllipsoidRhumbLine(e,a,s));r=C.surfaceDistance;if(!(r<i))for(var p=W(e,a,n,s,O),i=Math.ceil(r/i),h=r/i,d=h,g=i-1,f=o.length,m=0;m<g;m++){var w=C.interpolateUsingSurfaceDistance(d,E),y=Z(s,w,t,_),v=Z(s,w,n,b);Oe.Cartesian3.pack(p,o,f),Oe.Cartesian3.pack(y,l,f),Oe.Cartesian3.pack(v,u,f),c.push(w.latitude),c.push(w.longitude),f+=3,d+=h}}}var P=new Oe.Cartographic;function Z(e,a,t,n){return Oe.Cartographic.clone(a,P),P.height=t,Oe.Cartographic.toCartesian(P,e,n)}function xe(e,a,t){return Oe.Cartesian3.subtract(e,a,t),Oe.Cartesian3.normalize(t,t),t}function k(e,a,t,n){return n=xe(e,a,n),n=Oe.Cartesian3.cross(n,t,n),n=Oe.Cartesian3.normalize(n,n),n=Oe.Cartesian3.cross(t,n,n)}w.pack=function(e,a,t){var n=B.defaultValue(t,0),i=e._positions,r=i.length;a[n++]=r;for(var s=0;s<r;++s){var o=i[s];Oe.Cartesian3.pack(o,a,n),n+=3}return a[n++]=e.granularity,a[n++]=e.loop?1:0,a[n++]=e.arcType,Oe.Ellipsoid.pack(e._ellipsoid,a,n),n+=Oe.Ellipsoid.packedLength,a[n++]=e._projectionIndex,a[n++]=e._scene3DOnly?1:0,a},w.unpack=function(e,a,t){for(var n=B.defaultValue(a,0),i=e[n++],r=new Array(i),s=0;s<i;s++)r[s]=Oe.Cartesian3.unpack(e,n),n+=3;var o=e[n++],l=1===e[n++],u=e[n++],c=Oe.Ellipsoid.unpack(e,n);n+=Oe.Ellipsoid.packedLength;var C=e[n++],a=1===e[n++];return(t=!B.defined(t)?new w({positions:r}):t)._positions=r,t.granularity=o,t.loop=l,t.arcType=u,t._ellipsoid=c,t._projectionIndex=C,t._scene3DOnly=a,t};var A=new Oe.Cartesian3,L=new Oe.Cartesian3,S=new Oe.Cartesian3,I=new Oe.Cartesian3;function J(e,a,t,n,i){t=xe(t,a,I),e=k(e,a,t,A),a=k(n,a,t,L);if(Pe.CesiumMath.equalsEpsilon(Oe.Cartesian3.dot(e,a),-1,Pe.CesiumMath.EPSILON5))return i=Oe.Cartesian3.cross(t,e,i),i=Oe.Cartesian3.normalize(i,i);i=Oe.Cartesian3.add(a,e,i),i=Oe.Cartesian3.normalize(i,i);t=Oe.Cartesian3.cross(t,i,S);return i=Oe.Cartesian3.dot(a,t)<0?Oe.Cartesian3.negate(i,i):i}var Q=r.Plane.fromPointNormal(Oe.Cartesian3.ZERO,Oe.Cartesian3.UNIT_Y),K=new Oe.Cartesian3,$=new Oe.Cartesian3,ee=new Oe.Cartesian3,ae=new Oe.Cartesian3,te=new Oe.Cartesian3,ne=new Oe.Cartesian3,ie=new Oe.Cartographic,re=new Oe.Cartographic,se=new Oe.Cartographic;w.createGeometry=function(e){var a,t,n,i,r,s=!e._scene3DOnly,o=e.loop,l=e._ellipsoid,u=e.granularity,c=e.arcType,C=new F[e._projectionIndex](l),p=q,h=X,d=e._positions,g=d.length;2===g&&(o=!1);for(var f,m,w,y=new V.EllipsoidRhumbLine(void 0,void 0,l),v=[d[0]],M=0;M<g-1;M++)t=d[M],n=d[M+1],f=Y.IntersectionTests.lineSegmentPlane(t,n,Q,ne),!B.defined(f)||Oe.Cartesian3.equalsEpsilon(f,t,Pe.CesiumMath.EPSILON7)||Oe.Cartesian3.equalsEpsilon(f,n,Pe.CesiumMath.EPSILON7)||(e.arcType===j.ArcType.GEODESIC?v.push(Oe.Cartesian3.clone(f)):e.arcType===j.ArcType.RHUMB&&(w=l.cartesianToCartographic(f,ie).longitude,i=l.cartesianToCartographic(t,ie),r=l.cartesianToCartographic(n,re),y.setEndPoints(i,r),m=y.findIntersectionWithLongitude(w,se),f=l.cartographicToCartesian(m,ne),!B.defined(f)||Oe.Cartesian3.equalsEpsilon(f,t,Pe.CesiumMath.EPSILON7)||Oe.Cartesian3.equalsEpsilon(f,n,Pe.CesiumMath.EPSILON7)||v.push(Oe.Cartesian3.clone(f)))),v.push(n);o&&(t=d[g-1],n=d[0],f=Y.IntersectionTests.lineSegmentPlane(t,n,Q,ne),!B.defined(f)||Oe.Cartesian3.equalsEpsilon(f,t,Pe.CesiumMath.EPSILON7)||Oe.Cartesian3.equalsEpsilon(f,n,Pe.CesiumMath.EPSILON7)||(e.arcType===j.ArcType.GEODESIC?v.push(Oe.Cartesian3.clone(f)):e.arcType===j.ArcType.RHUMB&&(w=l.cartesianToCartographic(f,ie).longitude,i=l.cartesianToCartographic(t,ie),r=l.cartesianToCartographic(n,re),y.setEndPoints(i,r),m=y.findIntersectionWithLongitude(w,se),f=l.cartographicToCartesian(m,ne),!B.defined(f)||Oe.Cartesian3.equalsEpsilon(f,t,Pe.CesiumMath.EPSILON7)||Oe.Cartesian3.equalsEpsilon(f,n,Pe.CesiumMath.EPSILON7)||v.push(Oe.Cartesian3.clone(f)))));var T=v.length,E=new Array(T);for(M=0;M<T;M++){var _=Oe.Cartographic.fromCartesian(v[M],l);_.height=0,E[M]=_}if(!((T=(E=G.arrayRemoveDuplicates(E,Oe.Cartographic.equalsEpsilon)).length)<2)){var b=[],O=[],P=[],k=[],A=K,L=$,S=ee,I=ae,x=te,N=E[0],R=E[1];for(A=Z(l,E[T-1],p,A),I=Z(l,R,p,I),L=Z(l,N,p,L),S=Z(l,N,h,S),x=o?J(A,L,S,I,x):W(N,R,h,l,x),Oe.Cartesian3.pack(x,O,0),Oe.Cartesian3.pack(L,P,0),Oe.Cartesian3.pack(S,k,0),b.push(N.latitude),b.push(N.longitude),U(N,R,p,h,u,c,l,O,P,k,b),M=1;M<T-1;++M){var A=Oe.Cartesian3.clone(L,A),L=Oe.Cartesian3.clone(I,L),D=E[M];Z(l,D,h,S),Z(l,E[M+1],p,I),J(A,L,S,I,x),a=O.length,Oe.Cartesian3.pack(x,O,a),Oe.Cartesian3.pack(L,P,a),Oe.Cartesian3.pack(S,k,a),b.push(D.latitude),b.push(D.longitude),U(E[M],E[M+1],p,h,u,c,l,O,P,k,b)}var z=E[T-1],H=E[T-2];if(L=Z(l,z,p,L),S=Z(l,z,h,S),x=o?(R=E[0],J(A=Z(l,H,p,A),L,S,I=Z(l,R,p,I),x)):W(H,z,h,l,x),a=O.length,Oe.Cartesian3.pack(x,O,a),Oe.Cartesian3.pack(L,P,a),Oe.Cartesian3.pack(S,k,a),b.push(z.latitude),b.push(z.longitude),o){for(U(z,N,p,h,u,c,l,O,P,k,b),a=O.length,M=0;M<3;++M)O[a+M]=O[M],P[a+M]=P[M],k[a+M]=k[M];b.push(N.latitude),b.push(N.longitude)}return function(e,a,t,n,i,r,s){var o,l,u,c,C,p,h=a._ellipsoid,d=t.length/3-1,g=8*d,f=4*g,m=36*d,w=new(65535<g?Uint32Array:Uint16Array)(m),y=new Float64Array(3*g),v=new Float32Array(f),M=new Float32Array(f),T=new Float32Array(f),E=new Float32Array(f),_=new Float32Array(f);s&&(u=new Float32Array(f),c=new Float32Array(f),C=new Float32Array(f),p=new Float32Array(2*g));var b=r.length/2,O=0,P=He;P.height=0;var k=Be;k.height=0;var A=je,L=Ge;if(s)for(l=0,o=1;o<b;o++)P.latitude=r[l],P.longitude=r[l+1],k.latitude=r[l+2],k.longitude=r[l+3],A=a.project(P,A),L=a.project(k,L),O+=Oe.Cartesian3.distance(A,L),l+=2;var S=n.length/3;L=Oe.Cartesian3.unpack(n,0,L);var I,x=0;for(l=3,o=1;o<S;o++)A=Oe.Cartesian3.clone(L,A),L=Oe.Cartesian3.unpack(n,l,L),x+=Oe.Cartesian3.distance(A,L),l+=3;l=3;var N=0,R=0,D=0,z=0,H=!1,B=Oe.Cartesian3.unpack(t,0,Ye),j=Oe.Cartesian3.unpack(n,0,Ge),G=Oe.Cartesian3.unpack(i,0,qe);e&&(_e=Oe.Cartesian3.unpack(t,t.length-6,Ve),Ne(G,_e,B,j)&&(G=Oe.Cartesian3.negate(G,G)));var V,Y,F,q,X,W,U,Z=0,J=0,Q=0;for(o=0;o<d;o++){var K=Oe.Cartesian3.clone(B,Ve),$=Oe.Cartesian3.clone(j,je),ee=Oe.Cartesian3.clone(G,Fe);H&&(ee=Oe.Cartesian3.negate(ee,ee)),B=Oe.Cartesian3.unpack(t,l,Ye),j=Oe.Cartesian3.unpack(n,l,Ge),G=Oe.Cartesian3.unpack(i,l,qe),H=Ne(G,K,B,j),P.latitude=r[N],P.longitude=r[N+1],k.latitude=r[N+2],k.longitude=r[N+3],s&&(Me=function(e,a){var t=Math.abs(e.longitude),n=Math.abs(a.longitude);{if(Pe.CesiumMath.equalsEpsilon(t,Pe.CesiumMath.PI,Pe.CesiumMath.EPSILON11)){var i=Pe.CesiumMath.sign(a.longitude);return e.longitude=i*(t-Pe.CesiumMath.EPSILON11),1}if(Pe.CesiumMath.equalsEpsilon(n,Pe.CesiumMath.PI,Pe.CesiumMath.EPSILON11)){e=Pe.CesiumMath.sign(e.longitude);return a.longitude=e*(n-Pe.CesiumMath.EPSILON11),2}}return 0}(P,k),V=a.project(P,Ke),(pe=xe(Y=a.project(k,$e),V,ca)).y=Math.abs(pe.y),F=ea,q=aa,0===Me||Oe.Cartesian3.dot(pe,Oe.Cartesian3.UNIT_Y)>Ie?(F=Re(a,P,ee,V,ea),q=Re(a,k,G,Y,aa)):1===Me?(q=Re(a,k,G,Y,aa),F.x=0,F.y=Pe.CesiumMath.sign(P.longitude-Math.abs(k.longitude)),F.z=0):(F=Re(a,P,ee,V,ea),q.x=0,q.y=Pe.CesiumMath.sign(P.longitude-k.longitude),q.z=0));var ae=Oe.Cartesian3.distance($,j),te=Ae.EncodedCartesian3.fromCartesian(K,la),ne=Oe.Cartesian3.subtract(B,K,ta),ie=Oe.Cartesian3.normalize(ne,ra),re=Oe.Cartesian3.subtract($,K,na);re=Oe.Cartesian3.normalize(re,re);var se=Oe.Cartesian3.cross(ie,re,ra);se=Oe.Cartesian3.normalize(se,se);var oe=Oe.Cartesian3.cross(re,ee,sa);oe=Oe.Cartesian3.normalize(oe,oe);var le=Oe.Cartesian3.subtract(j,B,ia);le=Oe.Cartesian3.normalize(le,le);var ue=Oe.Cartesian3.cross(G,le,oa);ue=Oe.Cartesian3.normalize(ue,ue);var ce=ae/x,Ce=Z/x,pe=0,he=0,de=0;for(s&&(pe=Oe.Cartesian3.distance(V,Y),X=Ae.EncodedCartesian3.fromCartesian(V,ua),W=Oe.Cartesian3.subtract(Y,V,ca),Te=(U=Oe.Cartesian3.normalize(W,Ca)).x,U.x=U.y,U.y=-Te,he=pe/O,de=J/O),I=0;I<8;I++){var ge=z+4*I,fe=R+2*I,me=ge+3,we=I<4?1:-1,ye=2===I||3===I||6===I||7===I?1:-1;Oe.Cartesian3.pack(te.high,v,ge),v[me]=ne.x,Oe.Cartesian3.pack(te.low,M,ge),M[me]=ne.y,Oe.Cartesian3.pack(oe,T,ge),T[me]=ne.z,Oe.Cartesian3.pack(ue,E,ge),E[me]=ce*we,Oe.Cartesian3.pack(se,_,ge);var ve=Ce*ye;0===ve&&ye<0&&(ve=9),_[me]=ve,s&&(u[ge]=X.high.x,u[ge+1]=X.high.y,u[ge+2]=X.low.x,u[ge+3]=X.low.y,C[ge]=-F.y,C[ge+1]=F.x,C[ge+2]=q.y,C[ge+3]=-q.x,c[ge]=W.x,c[ge+1]=W.y,c[ge+2]=U.x,c[ge+3]=U.y,p[fe]=he*we,0===(ve=de*ye)&&ye<0&&(ve=9),p[fe+1]=ve)}var Me=Je,ie=Qe,re=Ue,ee=Ze,le=Oe.Rectangle.fromCartographicArray(Xe,We),Te=Se.getMinimumMaximumHeights(le,h),le=Te.minimumTerrainHeight,Te=Te.maximumTerrainHeight;Q+=le,Q+=Te,De(K,$,le,Te,Me,re),De(B,j,le,Te,ie,ee);Te=Oe.Cartesian3.multiplyByScalar(se,Pe.CesiumMath.EPSILON5,pa);Oe.Cartesian3.add(Me,Te,Me),Oe.Cartesian3.add(ie,Te,ie),Oe.Cartesian3.add(re,Te,re),Oe.Cartesian3.add(ee,Te,ee),ze(Me,ie),ze(re,ee),Oe.Cartesian3.pack(Me,y,D),Oe.Cartesian3.pack(ie,y,D+3),Oe.Cartesian3.pack(ee,y,D+6),Oe.Cartesian3.pack(re,y,D+9),Te=Oe.Cartesian3.multiplyByScalar(se,-2*Pe.CesiumMath.EPSILON5,pa),Oe.Cartesian3.add(Me,Te,Me),Oe.Cartesian3.add(ie,Te,ie),Oe.Cartesian3.add(re,Te,re),Oe.Cartesian3.add(ee,Te,ee),ze(Me,ie),ze(re,ee),Oe.Cartesian3.pack(Me,y,D+12),Oe.Cartesian3.pack(ie,y,D+15),Oe.Cartesian3.pack(ee,y,D+18),Oe.Cartesian3.pack(re,y,D+21),N+=2,l+=3,R+=16,D+=24,z+=32,Z+=ae,J+=pe}var Ee=l=0;for(o=0;o<d;o++){for(I=0;I<ga;I++)w[l+I]=da[I]+Ee;Ee+=8,l+=ga}e=ha;be.BoundingSphere.fromVertices(t,Oe.Cartesian3.ZERO,3,e[0]),be.BoundingSphere.fromVertices(n,Oe.Cartesian3.ZERO,3,e[1]);var _e=be.BoundingSphere.fromBoundingSpheres(e);_e.radius+=Q/(2*d);e={position:new Le.GeometryAttribute({componentDatatype:ke.ComponentDatatype.DOUBLE,componentsPerAttribute:3,normalize:!1,values:y}),startHiAndForwardOffsetX:fa(v),startLoAndForwardOffsetY:fa(M),startNormalAndForwardOffsetZ:fa(T),endNormalAndTextureCoordinateNormalizationX:fa(E),rightNormalAndTextureCoordinateNormalizationY:fa(_)};s&&(e.startHiLo2D=fa(u),e.offsetAndRight2D=fa(c),e.startEndNormals2D=fa(C),e.texcoordNormalization2D=new Le.GeometryAttribute({componentDatatype:ke.ComponentDatatype.FLOAT,componentsPerAttribute:2,normalize:!1,values:p}));return new Le.Geometry({attributes:e,indices:w,boundingSphere:_e})}(o,C,P,k,O,b,s)}};var x=new Oe.Cartesian3,N=new be.Matrix3,R=new be.Quaternion;function Ne(e,a,t,n){a=xe(t,a,x),a=Oe.Cartesian3.dot(a,e);if(Ie<a||a<m){t=xe(n,t,I),a=a<m?Pe.CesiumMath.PI_OVER_TWO:-Pe.CesiumMath.PI_OVER_TWO,a=be.Quaternion.fromAxisAngle(t,a,R),a=be.Matrix3.fromQuaternion(a,N);return be.Matrix3.multiplyByVector(a,e,e),!0}return!1}var D=new Oe.Cartographic,z=new Oe.Cartesian3,H=new Oe.Cartesian3;function Re(e,a,t,n,i){var r=Oe.Cartographic.toCartesian(a,e._ellipsoid,z),s=Oe.Cartesian3.add(r,t,H),o=!1,l=e._ellipsoid,u=l.cartesianToCartographic(s,D);Math.abs(a.longitude-u.longitude)>Pe.CesiumMath.PI_OVER_TWO&&(o=!0,s=Oe.Cartesian3.subtract(r,t,H),u=l.cartesianToCartographic(s,D)),u.height=0;u=e.project(u,i);return(i=Oe.Cartesian3.subtract(u,n,i)).z=0,i=Oe.Cartesian3.normalize(i,i),o&&Oe.Cartesian3.negate(i,i),i}var oe=new Oe.Cartesian3,le=new Oe.Cartesian3;function De(e,a,t,n,i,r){var s=Oe.Cartesian3.subtract(a,e,oe);Oe.Cartesian3.normalize(s,s);t-=q,t=Oe.Cartesian3.multiplyByScalar(s,t,le);Oe.Cartesian3.add(e,t,i);n-=X,t=Oe.Cartesian3.multiplyByScalar(s,n,le);Oe.Cartesian3.add(a,t,r)}var ue=new Oe.Cartesian3;function ze(e,a){var t=r.Plane.getPointDistance(Q,e),n=r.Plane.getPointDistance(Q,a),i=ue;Pe.CesiumMath.equalsEpsilon(t,0,Pe.CesiumMath.EPSILON2)?(i=xe(a,e,i),Oe.Cartesian3.multiplyByScalar(i,Pe.CesiumMath.EPSILON2,i),Oe.Cartesian3.add(e,i,e)):Pe.CesiumMath.equalsEpsilon(n,0,Pe.CesiumMath.EPSILON2)&&(i=xe(e,a,i),Oe.Cartesian3.multiplyByScalar(i,Pe.CesiumMath.EPSILON2,i),Oe.Cartesian3.add(a,i,a))}var He=new Oe.Cartographic,Be=new Oe.Cartographic,je=new Oe.Cartesian3,Ge=new Oe.Cartesian3,Ve=new Oe.Cartesian3,Ye=new Oe.Cartesian3,Fe=new Oe.Cartesian3,qe=new Oe.Cartesian3,Xe=[He,Be],We=new Oe.Rectangle,Ue=new Oe.Cartesian3,Ze=new Oe.Cartesian3,Je=new Oe.Cartesian3,Qe=new Oe.Cartesian3,Ke=new Oe.Cartesian3,$e=new Oe.Cartesian3,ea=new Oe.Cartesian3,aa=new Oe.Cartesian3,ta=new Oe.Cartesian3,na=new Oe.Cartesian3,ia=new Oe.Cartesian3,ra=new Oe.Cartesian3,sa=new Oe.Cartesian3,oa=new Oe.Cartesian3,la=new Ae.EncodedCartesian3,ua=new Ae.EncodedCartesian3,ca=new Oe.Cartesian3,Ca=new Oe.Cartesian3,pa=new Oe.Cartesian3,ha=[new be.BoundingSphere,new be.BoundingSphere],da=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],ga=da.length;function fa(e){return new Le.GeometryAttribute({componentDatatype:ke.ComponentDatatype.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}return w._projectNormal=Re,function(e,a){return Se.initialize().then(function(){return B.defined(a)&&(e=w.unpack(e,a)),w.createGeometry(e)})}});
define(["./Transforms-5295b227","./Cartesian2-5b63e672","./Check-64f87f7d","./when-ca391574","./Math-b53708b3","./ArcType-2b58731c","./arrayRemoveDuplicates-fc9e255d","./ComponentDatatype-8f71e605","./EllipsoidGeodesic-bbea0b0a","./EllipsoidRhumbLine-6ee9af74","./EncodedCartesian3-c36ced29","./GeometryAttribute-7ef2d452","./IntersectionTests-f5111308","./Plane-99b2becd","./WebMercatorProjection-e0329e39","./RuntimeError-19cb26ba","./WebGLConstants-95ceb4e9"],function(be,Oe,e,B,Pe,j,G,ke,M,V,Ae,Le,Y,r,a,t,n){"use strict";function i(e){e=B.defaultValue(e,B.defaultValue.EMPTY_OBJECT),this._ellipsoid=B.defaultValue(e.ellipsoid,Oe.Ellipsoid.WGS84),this._rectangle=B.defaultValue(e.rectangle,Oe.Rectangle.MAX_VALUE),this._projection=new be.GeographicProjection(this._ellipsoid),this._numberOfLevelZeroTilesX=B.defaultValue(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=B.defaultValue(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(i.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),i.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},i.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},i.prototype.rectangleToNativeRectangle=function(e,a){var t=Pe.CesiumMath.toDegrees(e.west),n=Pe.CesiumMath.toDegrees(e.south),i=Pe.CesiumMath.toDegrees(e.east),e=Pe.CesiumMath.toDegrees(e.north);return B.defined(a)?(a.west=t,a.south=n,a.east=i,a.north=e,a):new Oe.Rectangle(t,n,i,e)},i.prototype.tileXYToNativeRectangle=function(e,a,t,n){n=this.tileXYToRectangle(e,a,t,n);return n.west=Pe.CesiumMath.toDegrees(n.west),n.south=Pe.CesiumMath.toDegrees(n.south),n.east=Pe.CesiumMath.toDegrees(n.east),n.north=Pe.CesiumMath.toDegrees(n.north),n},i.prototype.tileXYToRectangle=function(e,a,t,n){var i=this._rectangle,r=this.getNumberOfXTilesAtLevel(t),s=this.getNumberOfYTilesAtLevel(t),t=i.width/r,r=e*t+i.west,e=(e+1)*t+i.west,t=i.height/s,s=i.north-a*t,t=i.north-(a+1)*t;return(n=!B.defined(n)?new Oe.Rectangle(r,t,e,s):n).west=r,n.south=t,n.east=e,n.north=s,n},i.prototype.positionToTileXY=function(e,a,t){var n=this._rectangle;if(Oe.Rectangle.contains(n,e)){var i=this.getNumberOfXTilesAtLevel(a),r=this.getNumberOfYTilesAtLevel(a),s=n.width/i,o=n.height/r,a=e.longitude;n.east<n.west&&(a+=Pe.CesiumMath.TWO_PI);s=(a-n.west)/s|0;i<=s&&(s=i-1);o=(n.north-e.latitude)/o|0;return(r<=o&&(o=r-1),B.defined(t))?(t.x=s,t.y=o,t):new Oe.Cartesian2(s,o)}};var s=new Oe.Cartesian3,o=new Oe.Cartesian3,l=new Oe.Cartographic,u=new Oe.Cartesian3,c=new Oe.Cartesian3,C=new be.BoundingSphere,p=new i,h=[new Oe.Cartographic,new Oe.Cartographic,new Oe.Cartographic,new Oe.Cartographic],d=new Oe.Cartesian2,Se={};function g(e){Oe.Cartographic.fromRadians(e.east,e.north,0,h[0]),Oe.Cartographic.fromRadians(e.west,e.north,0,h[1]),Oe.Cartographic.fromRadians(e.east,e.south,0,h[2]),Oe.Cartographic.fromRadians(e.west,e.south,0,h[3]);for(var a=0,t=0,n=0,i=0,r=Se._terrainHeightsMaxLevel,s=0;s<=r;++s){for(var o=!1,l=0;l<4;++l){var u=h[l];if(p.positionToTileXY(u,s,d),0===l)n=d.x,i=d.y;else if(n!==d.x||i!==d.y){o=!0;break}}if(o)break;a=n,t=i}if(0!==s)return{x:a,y:t,level:r<s?r:s-1}}Se.initialize=function(){var e=Se._initPromise;return B.defined(e)?e:(e=be.Resource.fetchJson(be.buildModuleUrl("Assets/approximateTerrainHeights.json")).then(function(e){Se._terrainHeights=e}),Se._initPromise=e)},Se.getMinimumMaximumHeights=function(e,a){a=B.defaultValue(a,Oe.Ellipsoid.WGS84);var t=g(e),n=Se._defaultMinTerrainHeight,i=Se._defaultMaxTerrainHeight;return B.defined(t)&&(t=t.level+"-"+t.x+"-"+t.y,t=Se._terrainHeights[t],B.defined(t)&&(n=t[0],i=t[1]),a.cartographicToCartesian(Oe.Rectangle.northeast(e,l),s),a.cartographicToCartesian(Oe.Rectangle.southwest(e,l),o),Oe.Cartesian3.midpoint(o,s,u),a=a.scaleToGeodeticSurface(u,c),n=B.defined(a)?(a=Oe.Cartesian3.distance(u,a),Math.min(n,-a)):Se._defaultMinTerrainHeight),{minimumTerrainHeight:n=Math.max(Se._defaultMinTerrainHeight,n),maximumTerrainHeight:i}},Se.getBoundingSphere=function(e,a){a=B.defaultValue(a,Oe.Ellipsoid.WGS84);var t=g(e),n=Se._defaultMaxTerrainHeight;B.defined(t)&&(i=t.level+"-"+t.x+"-"+t.y,i=Se._terrainHeights[i],B.defined(i)&&(n=i[1]));var i=be.BoundingSphere.fromRectangle3D(e,a,0);return be.BoundingSphere.fromRectangle3D(e,a,n,C),be.BoundingSphere.union(i,C,i)},Se._terrainHeightsMaxLevel=6,Se._defaultMaxTerrainHeight=9e3,Se._defaultMinTerrainHeight=-1e5,Se._terrainHeights=void 0,Se._initPromise=void 0,Object.defineProperties(Se,{initialized:{get:function(){return B.defined(Se._terrainHeights)}}});var F=[be.GeographicProjection,a.WebMercatorProjection],f=F.length,Ie=Math.cos(Pe.CesiumMath.toRadians(30)),m=Math.cos(Pe.CesiumMath.toRadians(150)),q=0,X=1e3;function w(e){var a=(e=B.defaultValue(e,B.defaultValue.EMPTY_OBJECT)).positions;this.width=B.defaultValue(e.width,1),this._positions=a,this.granularity=B.defaultValue(e.granularity,9999),this.loop=B.defaultValue(e.loop,!1),this.arcType=B.defaultValue(e.arcType,j.ArcType.GEODESIC),this._ellipsoid=Oe.Ellipsoid.WGS84,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(w.prototype,{packedLength:{get:function(){return 1+3*this._positions.length+1+1+1+Oe.Ellipsoid.packedLength+1+1}}}),w.setProjectionAndEllipsoid=function(e,a){for(var t=0,n=0;n<f;n++)if(a instanceof F[n]){t=n;break}e._projectionIndex=t,e._ellipsoid=a.ellipsoid};var y=new Oe.Cartesian3,v=new Oe.Cartesian3,T=new Oe.Cartesian3;function W(e,a,t,n,i){var r=Z(n,e,0,y),t=Z(n,e,t,v),a=Z(n,a,0,T),t=xe(t,r,v),r=xe(a,r,T);return Oe.Cartesian3.cross(r,t,i),Oe.Cartesian3.normalize(i,i)}var E=new Oe.Cartographic,_=new Oe.Cartesian3,b=new Oe.Cartesian3,O=new Oe.Cartesian3;function U(e,a,t,n,i,r,s,o,l,u,c){if(0!==i){var C;r===j.ArcType.GEODESIC?C=new M.EllipsoidGeodesic(e,a,s):r===j.ArcType.RHUMB&&(C=new V.EllipsoidRhumbLine(e,a,s));r=C.surfaceDistance;if(!(r<i))for(var p=W(e,a,n,s,O),i=Math.ceil(r/i),h=r/i,d=h,g=i-1,f=o.length,m=0;m<g;m++){var w=C.interpolateUsingSurfaceDistance(d,E),y=Z(s,w,t,_),v=Z(s,w,n,b);Oe.Cartesian3.pack(p,o,f),Oe.Cartesian3.pack(y,l,f),Oe.Cartesian3.pack(v,u,f),c.push(w.latitude),c.push(w.longitude),f+=3,d+=h}}}var P=new Oe.Cartographic;function Z(e,a,t,n){return Oe.Cartographic.clone(a,P),P.height=t,Oe.Cartographic.toCartesian(P,e,n)}function xe(e,a,t){return Oe.Cartesian3.subtract(e,a,t),Oe.Cartesian3.normalize(t,t),t}function k(e,a,t,n){return n=xe(e,a,n),n=Oe.Cartesian3.cross(n,t,n),n=Oe.Cartesian3.normalize(n,n),n=Oe.Cartesian3.cross(t,n,n)}w.pack=function(e,a,t){var n=B.defaultValue(t,0),i=e._positions,r=i.length;a[n++]=r;for(var s=0;s<r;++s){var o=i[s];Oe.Cartesian3.pack(o,a,n),n+=3}return a[n++]=e.granularity,a[n++]=e.loop?1:0,a[n++]=e.arcType,Oe.Ellipsoid.pack(e._ellipsoid,a,n),n+=Oe.Ellipsoid.packedLength,a[n++]=e._projectionIndex,a[n++]=e._scene3DOnly?1:0,a},w.unpack=function(e,a,t){for(var n=B.defaultValue(a,0),i=e[n++],r=new Array(i),s=0;s<i;s++)r[s]=Oe.Cartesian3.unpack(e,n),n+=3;var o=e[n++],l=1===e[n++],u=e[n++],c=Oe.Ellipsoid.unpack(e,n);n+=Oe.Ellipsoid.packedLength;var C=e[n++],a=1===e[n++];return(t=!B.defined(t)?new w({positions:r}):t)._positions=r,t.granularity=o,t.loop=l,t.arcType=u,t._ellipsoid=c,t._projectionIndex=C,t._scene3DOnly=a,t};var A=new Oe.Cartesian3,L=new Oe.Cartesian3,S=new Oe.Cartesian3,I=new Oe.Cartesian3;function J(e,a,t,n,i){t=xe(t,a,I),e=k(e,a,t,A),a=k(n,a,t,L);if(Pe.CesiumMath.equalsEpsilon(Oe.Cartesian3.dot(e,a),-1,Pe.CesiumMath.EPSILON5))return i=Oe.Cartesian3.cross(t,e,i),i=Oe.Cartesian3.normalize(i,i);i=Oe.Cartesian3.add(a,e,i),i=Oe.Cartesian3.normalize(i,i);t=Oe.Cartesian3.cross(t,i,S);return i=Oe.Cartesian3.dot(a,t)<0?Oe.Cartesian3.negate(i,i):i}var Q=r.Plane.fromPointNormal(Oe.Cartesian3.ZERO,Oe.Cartesian3.UNIT_Y),K=new Oe.Cartesian3,$=new Oe.Cartesian3,ee=new Oe.Cartesian3,ae=new Oe.Cartesian3,te=new Oe.Cartesian3,ne=new Oe.Cartesian3,ie=new Oe.Cartographic,re=new Oe.Cartographic,se=new Oe.Cartographic;w.createGeometry=function(e){var a,t,n,i,r,s=!e._scene3DOnly,o=e.loop,l=e._ellipsoid,u=e.granularity,c=e.arcType,C=new F[e._projectionIndex](l),p=q,h=X,d=e._positions,g=d.length;2===g&&(o=!1);for(var f,m,w,y=new V.EllipsoidRhumbLine(void 0,void 0,l),v=[d[0]],M=0;M<g-1;M++)t=d[M],n=d[M+1],f=Y.IntersectionTests.lineSegmentPlane(t,n,Q,ne),!B.defined(f)||Oe.Cartesian3.equalsEpsilon(f,t,Pe.CesiumMath.EPSILON7)||Oe.Cartesian3.equalsEpsilon(f,n,Pe.CesiumMath.EPSILON7)||(e.arcType===j.ArcType.GEODESIC?v.push(Oe.Cartesian3.clone(f)):e.arcType===j.ArcType.RHUMB&&(w=l.cartesianToCartographic(f,ie).longitude,i=l.cartesianToCartographic(t,ie),r=l.cartesianToCartographic(n,re),y.setEndPoints(i,r),m=y.findIntersectionWithLongitude(w,se),f=l.cartographicToCartesian(m,ne),!B.defined(f)||Oe.Cartesian3.equalsEpsilon(f,t,Pe.CesiumMath.EPSILON7)||Oe.Cartesian3.equalsEpsilon(f,n,Pe.CesiumMath.EPSILON7)||v.push(Oe.Cartesian3.clone(f)))),v.push(n);o&&(t=d[g-1],n=d[0],f=Y.IntersectionTests.lineSegmentPlane(t,n,Q,ne),!B.defined(f)||Oe.Cartesian3.equalsEpsilon(f,t,Pe.CesiumMath.EPSILON7)||Oe.Cartesian3.equalsEpsilon(f,n,Pe.CesiumMath.EPSILON7)||(e.arcType===j.ArcType.GEODESIC?v.push(Oe.Cartesian3.clone(f)):e.arcType===j.ArcType.RHUMB&&(w=l.cartesianToCartographic(f,ie).longitude,i=l.cartesianToCartographic(t,ie),r=l.cartesianToCartographic(n,re),y.setEndPoints(i,r),m=y.findIntersectionWithLongitude(w,se),f=l.cartographicToCartesian(m,ne),!B.defined(f)||Oe.Cartesian3.equalsEpsilon(f,t,Pe.CesiumMath.EPSILON7)||Oe.Cartesian3.equalsEpsilon(f,n,Pe.CesiumMath.EPSILON7)||v.push(Oe.Cartesian3.clone(f)))));var T=v.length,E=new Array(T);for(M=0;M<T;M++){var _=Oe.Cartographic.fromCartesian(v[M],l);_.height=0,E[M]=_}if(!((T=(E=G.arrayRemoveDuplicates(E,Oe.Cartographic.equalsEpsilon)).length)<2)){var b=[],O=[],P=[],k=[],A=K,L=$,S=ee,I=ae,x=te,N=E[0],R=E[1];for(A=Z(l,E[T-1],p,A),I=Z(l,R,p,I),L=Z(l,N,p,L),S=Z(l,N,h,S),x=o?J(A,L,S,I,x):W(N,R,h,l,x),Oe.Cartesian3.pack(x,O,0),Oe.Cartesian3.pack(L,P,0),Oe.Cartesian3.pack(S,k,0),b.push(N.latitude),b.push(N.longitude),U(N,R,p,h,u,c,l,O,P,k,b),M=1;M<T-1;++M){var A=Oe.Cartesian3.clone(L,A),L=Oe.Cartesian3.clone(I,L),D=E[M];Z(l,D,h,S),Z(l,E[M+1],p,I),J(A,L,S,I,x),a=O.length,Oe.Cartesian3.pack(x,O,a),Oe.Cartesian3.pack(L,P,a),Oe.Cartesian3.pack(S,k,a),b.push(D.latitude),b.push(D.longitude),U(E[M],E[M+1],p,h,u,c,l,O,P,k,b)}var z=E[T-1],H=E[T-2];if(L=Z(l,z,p,L),S=Z(l,z,h,S),x=o?(R=E[0],J(A=Z(l,H,p,A),L,S,I=Z(l,R,p,I),x)):W(H,z,h,l,x),a=O.length,Oe.Cartesian3.pack(x,O,a),Oe.Cartesian3.pack(L,P,a),Oe.Cartesian3.pack(S,k,a),b.push(z.latitude),b.push(z.longitude),o){for(U(z,N,p,h,u,c,l,O,P,k,b),a=O.length,M=0;M<3;++M)O[a+M]=O[M],P[a+M]=P[M],k[a+M]=k[M];b.push(N.latitude),b.push(N.longitude)}return function(e,a,t,n,i,r,s){var o,l,u,c,C,p,h=a._ellipsoid,d=t.length/3-1,g=8*d,f=4*g,m=36*d,w=new(65535<g?Uint32Array:Uint16Array)(m),y=new Float64Array(3*g),v=new Float32Array(f),M=new Float32Array(f),T=new Float32Array(f),E=new Float32Array(f),_=new Float32Array(f);s&&(u=new Float32Array(f),c=new Float32Array(f),C=new Float32Array(f),p=new Float32Array(2*g));var b=r.length/2,O=0,P=He;P.height=0;var k=Be;k.height=0;var A=je,L=Ge;if(s)for(l=0,o=1;o<b;o++)P.latitude=r[l],P.longitude=r[l+1],k.latitude=r[l+2],k.longitude=r[l+3],A=a.project(P,A),L=a.project(k,L),O+=Oe.Cartesian3.distance(A,L),l+=2;var S=n.length/3;L=Oe.Cartesian3.unpack(n,0,L);var I,x=0;for(l=3,o=1;o<S;o++)A=Oe.Cartesian3.clone(L,A),L=Oe.Cartesian3.unpack(n,l,L),x+=Oe.Cartesian3.distance(A,L),l+=3;l=3;var N=0,R=0,D=0,z=0,H=!1,B=Oe.Cartesian3.unpack(t,0,Ye),j=Oe.Cartesian3.unpack(n,0,Ge),G=Oe.Cartesian3.unpack(i,0,qe);e&&(_e=Oe.Cartesian3.unpack(t,t.length-6,Ve),Ne(G,_e,B,j)&&(G=Oe.Cartesian3.negate(G,G)));var V,Y,F,q,X,W,U,Z=0,J=0,Q=0;for(o=0;o<d;o++){var K=Oe.Cartesian3.clone(B,Ve),$=Oe.Cartesian3.clone(j,je),ee=Oe.Cartesian3.clone(G,Fe);H&&(ee=Oe.Cartesian3.negate(ee,ee)),B=Oe.Cartesian3.unpack(t,l,Ye),j=Oe.Cartesian3.unpack(n,l,Ge),G=Oe.Cartesian3.unpack(i,l,qe),H=Ne(G,K,B,j),P.latitude=r[N],P.longitude=r[N+1],k.latitude=r[N+2],k.longitude=r[N+3],s&&(Me=function(e,a){var t=Math.abs(e.longitude),n=Math.abs(a.longitude);{if(Pe.CesiumMath.equalsEpsilon(t,Pe.CesiumMath.PI,Pe.CesiumMath.EPSILON11)){var i=Pe.CesiumMath.sign(a.longitude);return e.longitude=i*(t-Pe.CesiumMath.EPSILON11),1}if(Pe.CesiumMath.equalsEpsilon(n,Pe.CesiumMath.PI,Pe.CesiumMath.EPSILON11)){e=Pe.CesiumMath.sign(e.longitude);return a.longitude=e*(n-Pe.CesiumMath.EPSILON11),2}}return 0}(P,k),V=a.project(P,Ke),(pe=xe(Y=a.project(k,$e),V,ca)).y=Math.abs(pe.y),F=ea,q=aa,0===Me||Oe.Cartesian3.dot(pe,Oe.Cartesian3.UNIT_Y)>Ie?(F=Re(a,P,ee,V,ea),q=Re(a,k,G,Y,aa)):1===Me?(q=Re(a,k,G,Y,aa),F.x=0,F.y=Pe.CesiumMath.sign(P.longitude-Math.abs(k.longitude)),F.z=0):(F=Re(a,P,ee,V,ea),q.x=0,q.y=Pe.CesiumMath.sign(P.longitude-k.longitude),q.z=0));var ae=Oe.Cartesian3.distance($,j),te=Ae.EncodedCartesian3.fromCartesian(K,la),ne=Oe.Cartesian3.subtract(B,K,ta),ie=Oe.Cartesian3.normalize(ne,ra),re=Oe.Cartesian3.subtract($,K,na);re=Oe.Cartesian3.normalize(re,re);var se=Oe.Cartesian3.cross(ie,re,ra);se=Oe.Cartesian3.normalize(se,se);var oe=Oe.Cartesian3.cross(re,ee,sa);oe=Oe.Cartesian3.normalize(oe,oe);var le=Oe.Cartesian3.subtract(j,B,ia);le=Oe.Cartesian3.normalize(le,le);var ue=Oe.Cartesian3.cross(G,le,oa);ue=Oe.Cartesian3.normalize(ue,ue);var ce=ae/x,Ce=Z/x,pe=0,he=0,de=0;for(s&&(pe=Oe.Cartesian3.distance(V,Y),X=Ae.EncodedCartesian3.fromCartesian(V,ua),W=Oe.Cartesian3.subtract(Y,V,ca),Te=(U=Oe.Cartesian3.normalize(W,Ca)).x,U.x=U.y,U.y=-Te,he=pe/O,de=J/O),I=0;I<8;I++){var ge=z+4*I,fe=R+2*I,me=ge+3,we=I<4?1:-1,ye=2===I||3===I||6===I||7===I?1:-1;Oe.Cartesian3.pack(te.high,v,ge),v[me]=ne.x,Oe.Cartesian3.pack(te.low,M,ge),M[me]=ne.y,Oe.Cartesian3.pack(oe,T,ge),T[me]=ne.z,Oe.Cartesian3.pack(ue,E,ge),E[me]=ce*we,Oe.Cartesian3.pack(se,_,ge);var ve=Ce*ye;0===ve&&ye<0&&(ve=9),_[me]=ve,s&&(u[ge]=X.high.x,u[ge+1]=X.high.y,u[ge+2]=X.low.x,u[ge+3]=X.low.y,C[ge]=-F.y,C[ge+1]=F.x,C[ge+2]=q.y,C[ge+3]=-q.x,c[ge]=W.x,c[ge+1]=W.y,c[ge+2]=U.x,c[ge+3]=U.y,p[fe]=he*we,0===(ve=de*ye)&&ye<0&&(ve=9),p[fe+1]=ve)}var Me=Je,ie=Qe,re=Ue,ee=Ze,le=Oe.Rectangle.fromCartographicArray(Xe,We),Te=Se.getMinimumMaximumHeights(le,h),le=Te.minimumTerrainHeight,Te=Te.maximumTerrainHeight;Q+=le,Q+=Te,De(K,$,le,Te,Me,re),De(B,j,le,Te,ie,ee);Te=Oe.Cartesian3.multiplyByScalar(se,Pe.CesiumMath.EPSILON5,pa);Oe.Cartesian3.add(Me,Te,Me),Oe.Cartesian3.add(ie,Te,ie),Oe.Cartesian3.add(re,Te,re),Oe.Cartesian3.add(ee,Te,ee),ze(Me,ie),ze(re,ee),Oe.Cartesian3.pack(Me,y,D),Oe.Cartesian3.pack(ie,y,D+3),Oe.Cartesian3.pack(ee,y,D+6),Oe.Cartesian3.pack(re,y,D+9),Te=Oe.Cartesian3.multiplyByScalar(se,-2*Pe.CesiumMath.EPSILON5,pa),Oe.Cartesian3.add(Me,Te,Me),Oe.Cartesian3.add(ie,Te,ie),Oe.Cartesian3.add(re,Te,re),Oe.Cartesian3.add(ee,Te,ee),ze(Me,ie),ze(re,ee),Oe.Cartesian3.pack(Me,y,D+12),Oe.Cartesian3.pack(ie,y,D+15),Oe.Cartesian3.pack(ee,y,D+18),Oe.Cartesian3.pack(re,y,D+21),N+=2,l+=3,R+=16,D+=24,z+=32,Z+=ae,J+=pe}var Ee=l=0;for(o=0;o<d;o++){for(I=0;I<ga;I++)w[l+I]=da[I]+Ee;Ee+=8,l+=ga}e=ha;be.BoundingSphere.fromVertices(t,Oe.Cartesian3.ZERO,3,e[0]),be.BoundingSphere.fromVertices(n,Oe.Cartesian3.ZERO,3,e[1]);var _e=be.BoundingSphere.fromBoundingSpheres(e);_e.radius+=Q/(2*d);e={position:new Le.GeometryAttribute({componentDatatype:ke.ComponentDatatype.DOUBLE,componentsPerAttribute:3,normalize:!1,values:y}),startHiAndForwardOffsetX:fa(v),startLoAndForwardOffsetY:fa(M),startNormalAndForwardOffsetZ:fa(T),endNormalAndTextureCoordinateNormalizationX:fa(E),rightNormalAndTextureCoordinateNormalizationY:fa(_)};s&&(e.startHiLo2D=fa(u),e.offsetAndRight2D=fa(c),e.startEndNormals2D=fa(C),e.texcoordNormalization2D=new Le.GeometryAttribute({componentDatatype:ke.ComponentDatatype.FLOAT,componentsPerAttribute:2,normalize:!1,values:p}));return new Le.Geometry({attributes:e,indices:w,boundingSphere:_e})}(o,C,P,k,O,b,s)}};var x=new Oe.Cartesian3,N=new be.Matrix3,R=new be.Quaternion;function Ne(e,a,t,n){a=xe(t,a,x),a=Oe.Cartesian3.dot(a,e);if(Ie<a||a<m){t=xe(n,t,I),a=a<m?Pe.CesiumMath.PI_OVER_TWO:-Pe.CesiumMath.PI_OVER_TWO,a=be.Quaternion.fromAxisAngle(t,a,R),a=be.Matrix3.fromQuaternion(a,N);return be.Matrix3.multiplyByVector(a,e,e),!0}return!1}var D=new Oe.Cartographic,z=new Oe.Cartesian3,H=new Oe.Cartesian3;function Re(e,a,t,n,i){var r=Oe.Cartographic.toCartesian(a,e._ellipsoid,z),s=Oe.Cartesian3.add(r,t,H),o=!1,l=e._ellipsoid,u=l.cartesianToCartographic(s,D);Math.abs(a.longitude-u.longitude)>Pe.CesiumMath.PI_OVER_TWO&&(o=!0,s=Oe.Cartesian3.subtract(r,t,H),u=l.cartesianToCartographic(s,D)),u.height=0;u=e.project(u,i);return(i=Oe.Cartesian3.subtract(u,n,i)).z=0,i=Oe.Cartesian3.normalize(i,i),o&&Oe.Cartesian3.negate(i,i),i}var oe=new Oe.Cartesian3,le=new Oe.Cartesian3;function De(e,a,t,n,i,r){var s=Oe.Cartesian3.subtract(a,e,oe);Oe.Cartesian3.normalize(s,s);t-=q,t=Oe.Cartesian3.multiplyByScalar(s,t,le);Oe.Cartesian3.add(e,t,i);n-=X,t=Oe.Cartesian3.multiplyByScalar(s,n,le);Oe.Cartesian3.add(a,t,r)}var ue=new Oe.Cartesian3;function ze(e,a){var t=r.Plane.getPointDistance(Q,e),n=r.Plane.getPointDistance(Q,a),i=ue;Pe.CesiumMath.equalsEpsilon(t,0,Pe.CesiumMath.EPSILON2)?(i=xe(a,e,i),Oe.Cartesian3.multiplyByScalar(i,Pe.CesiumMath.EPSILON2,i),Oe.Cartesian3.add(e,i,e)):Pe.CesiumMath.equalsEpsilon(n,0,Pe.CesiumMath.EPSILON2)&&(i=xe(e,a,i),Oe.Cartesian3.multiplyByScalar(i,Pe.CesiumMath.EPSILON2,i),Oe.Cartesian3.add(a,i,a))}var He=new Oe.Cartographic,Be=new Oe.Cartographic,je=new Oe.Cartesian3,Ge=new Oe.Cartesian3,Ve=new Oe.Cartesian3,Ye=new Oe.Cartesian3,Fe=new Oe.Cartesian3,qe=new Oe.Cartesian3,Xe=[He,Be],We=new Oe.Rectangle,Ue=new Oe.Cartesian3,Ze=new Oe.Cartesian3,Je=new Oe.Cartesian3,Qe=new Oe.Cartesian3,Ke=new Oe.Cartesian3,$e=new Oe.Cartesian3,ea=new Oe.Cartesian3,aa=new Oe.Cartesian3,ta=new Oe.Cartesian3,na=new Oe.Cartesian3,ia=new Oe.Cartesian3,ra=new Oe.Cartesian3,sa=new Oe.Cartesian3,oa=new Oe.Cartesian3,la=new Ae.EncodedCartesian3,ua=new Ae.EncodedCartesian3,ca=new Oe.Cartesian3,Ca=new Oe.Cartesian3,pa=new Oe.Cartesian3,ha=[new be.BoundingSphere,new be.BoundingSphere],da=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],ga=da.length;function fa(e){return new Le.GeometryAttribute({componentDatatype:ke.ComponentDatatype.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}return w._projectNormal=Re,function(e,a){return Se.initialize().then(function(){return B.defined(a)&&(e=w.unpack(e,a)),w.createGeometry(e)})}});

@@ -1,1 +0,1 @@

define(["./when-ca391574","./Cartesian2-5b63e672","./ArcType-2b58731c","./GeometryOffsetAttribute-b94750ca","./BoundingRectangle-755c152f","./Transforms-5295b227","./Check-64f87f7d","./ComponentDatatype-8f71e605","./EllipsoidGeodesic-bbea0b0a","./EllipsoidTangentPlane-0fb66b96","./GeometryAttribute-7ef2d452","./GeometryInstance-d18842cb","./GeometryPipeline-a588d10d","./IndexDatatype-4e56bcfa","./Math-b53708b3","./PolygonGeometryLibrary-b3087bff","./PolygonPipeline-55053b0a","./VertexFormat-63b3c6da","./RuntimeError-19cb26ba","./WebGLConstants-95ceb4e9","./IntersectionTests-f5111308","./Plane-99b2becd","./AttributeCompression-a99f24b9","./EncodedCartesian3-c36ced29","./arrayRemoveDuplicates-fc9e255d","./EllipsoidRhumbLine-21029cef","./GeometryAttributes-a356f820"],function(z,W,c,Y,e,U,t,j,y,A,Q,E,G,O,q,V,F,f,r,o,a,i,n,s,l,u,p){"use strict";var K=new W.Cartographic,Z=new W.Cartographic;var D=new e.BoundingRectangle,J=new W.Cartesian3,X=new W.Cartesian3,$=new W.Cartesian3,ee=new W.Cartesian3,te=new W.Cartesian3,re=new W.Cartesian3,oe=new W.Cartesian3,ae=new W.Cartesian3,ie=new W.Cartesian3,ne=new W.Cartesian2,se=new W.Cartesian2,le=new W.Cartesian3,ue=new U.Quaternion,pe=new U.Matrix3,ce=new U.Matrix3;function L(e){var t,r=e.vertexFormat,o=e.geometry,a=e.shadowVolume,i=o.attributes.position.values,n=i.length,s=e.wall,l=e.top||s,u=e.bottom||s;if(r.st||r.normal||r.tangent||r.bitangent||a){var p=e.boundingRectangle,c=e.tangentPlane,y=e.ellipsoid,m=e.stRotation,g=e.perPositionHeight,d=ne;d.x=p.x,d.y=p.y;var h,f=r.st?new Float32Array(n/3*2):void 0;r.normal&&(h=g&&l&&!s?o.attributes.normal.values:new Float32Array(n));var b,_=r.tangent?new Float32Array(n):void 0,v=r.bitangent?new Float32Array(n):void 0,P=a?new Float32Array(n):void 0,C=0,w=0,x=X,T=$,I=ee,A=!0,E=pe,G=ce;G=0!==m?(b=U.Quaternion.fromAxisAngle(c._plane.normal,m,ue),E=U.Matrix3.fromQuaternion(b,E),b=U.Quaternion.fromAxisAngle(c._plane.normal,-m,ue),U.Matrix3.fromQuaternion(b,G)):(E=U.Matrix3.clone(U.Matrix3.IDENTITY,E),U.Matrix3.clone(U.Matrix3.IDENTITY,G));var O=0,V=0;l&&u&&(O=n/2,V=n/3,n/=2);for(var F=0;F<n;F+=3){var D,L,N,H,R,M,S,B,k=W.Cartesian3.fromArray(i,F,le);r.st&&(D=U.Matrix3.multiplyByVector(E,k,J),D=y.scaleToGeodeticSurface(D,D),L=c.projectPointOntoPlane(D,se),W.Cartesian2.subtract(L,d,L),N=q.CesiumMath.clamp(L.x/p.width,0,1),H=q.CesiumMath.clamp(L.y/p.height,0,1),u&&(f[C+V]=N,f[C+1+V]=H),l&&(f[C]=N,f[C+1]=H),C+=2),(r.normal||r.tangent||r.bitangent||a)&&(R=w+1,M=w+2,s?(F+3<n&&(S=W.Cartesian3.fromArray(i,F+3,te),A&&(B=W.Cartesian3.fromArray(i,F+n,re),g&&(t=k,D=S,L=B,N=void 0,N=(H=y).cartesianToCartographic(t,K).height,(t=H.cartesianToCartographic(D,Z)).height=N,H.cartographicToCartesian(t,D),(D=H.cartesianToCartographic(L,Z)).height=N-100,H.cartographicToCartesian(D,L)),W.Cartesian3.subtract(S,k,S),W.Cartesian3.subtract(B,k,B),x=W.Cartesian3.normalize(W.Cartesian3.cross(B,S,x),x),A=!1),W.Cartesian3.equalsEpsilon(S,k,q.CesiumMath.EPSILON10)&&(A=!0)),(r.tangent||r.bitangent)&&(I=y.geodeticSurfaceNormal(k,I),r.tangent&&(T=W.Cartesian3.normalize(W.Cartesian3.cross(I,x,T),T)))):(x=y.geodeticSurfaceNormal(k,x),(r.tangent||r.bitangent)&&(g&&(oe=W.Cartesian3.fromArray(h,w,oe),ae=W.Cartesian3.cross(W.Cartesian3.UNIT_Z,oe,ae),ae=W.Cartesian3.normalize(U.Matrix3.multiplyByVector(G,ae,ae),ae),r.bitangent&&(ie=W.Cartesian3.normalize(W.Cartesian3.cross(oe,ae,ie),ie))),T=W.Cartesian3.cross(W.Cartesian3.UNIT_Z,x,T),T=W.Cartesian3.normalize(U.Matrix3.multiplyByVector(G,T,T),T),r.bitangent&&(I=W.Cartesian3.normalize(W.Cartesian3.cross(x,T,I),I)))),r.normal&&(e.wall?(h[w+O]=x.x,h[R+O]=x.y,h[M+O]=x.z):u&&(h[w+O]=-x.x,h[R+O]=-x.y,h[M+O]=-x.z),(l&&!g||s)&&(h[w]=x.x,h[R]=x.y,h[M]=x.z)),a&&(s&&(x=y.geodeticSurfaceNormal(k,x)),P[w+O]=-x.x,P[R+O]=-x.y,P[M+O]=-x.z),r.tangent&&(e.wall?(_[w+O]=T.x,_[R+O]=T.y,_[M+O]=T.z):u&&(_[w+O]=-T.x,_[R+O]=-T.y,_[M+O]=-T.z),l&&(g?(_[w]=ae.x,_[R]=ae.y,_[M]=ae.z):(_[w]=T.x,_[R]=T.y,_[M]=T.z))),r.bitangent&&(u&&(v[w+O]=I.x,v[R+O]=I.y,v[M+O]=I.z),l&&(g?(v[w]=ie.x,v[R]=ie.y,v[M]=ie.z):(v[w]=I.x,v[R]=I.y,v[M]=I.z))),w+=3)}r.st&&(o.attributes.st=new Q.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:f})),r.normal&&(o.attributes.normal=new Q.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:h})),r.tangent&&(o.attributes.tangent=new Q.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:_})),r.bitangent&&(o.attributes.bitangent=new Q.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:v})),a&&(o.attributes.extrudeDirection=new Q.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:P}))}return e.extrude&&z.defined(e.offsetAttribute)&&(m=i.length/3,b=new Uint8Array(m),e.offsetAttribute===Y.GeometryOffsetAttribute.TOP?l&&u||s?b=Y.arrayFill(b,1,0,m/2):l&&(b=Y.arrayFill(b,1)):(m=e.offsetAttribute===Y.GeometryOffsetAttribute.NONE?0:1,b=Y.arrayFill(b,m)),o.attributes.applyOffset=new Q.GeometryAttribute({componentDatatype:j.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})),o}var m=new W.Cartographic,g=new W.Cartographic,d={westOverIDL:0,eastOverIDL:0},h=new y.EllipsoidGeodesic;function b(e,t,r,o,a){if(a=z.defaultValue(a,new W.Rectangle),!z.defined(e)||e.length<3)return a.west=0,a.north=0,a.south=0,a.east=0,a;if(r===c.ArcType.RHUMB)return W.Rectangle.fromCartesianArray(e,t,a);h.ellipsoid.equals(t)||(h=new y.EllipsoidGeodesic(void 0,void 0,t)),a.west=Number.POSITIVE_INFINITY,a.east=Number.NEGATIVE_INFINITY,a.south=Number.POSITIVE_INFINITY,a.north=Number.NEGATIVE_INFINITY,d.westOverIDL=Number.POSITIVE_INFINITY,d.eastOverIDL=Number.NEGATIVE_INFINITY;for(var i,n=1/q.CesiumMath.chordLength(o,t.maximumRadius),s=e.length,l=t.cartesianToCartographic(e[0],g),u=m,p=1;p<s;p++)i=u,u=l,l=t.cartesianToCartographic(e[p],i),h.setEndPoints(u,l),v(h,n,a,d);return i=u,u=l,l=t.cartesianToCartographic(e[0],i),h.setEndPoints(u,l),v(h,n,a,d),a.east-a.west>d.eastOverIDL-d.westOverIDL&&(a.west=d.westOverIDL,a.east=d.eastOverIDL,a.east>q.CesiumMath.PI&&(a.east=a.east-q.CesiumMath.TWO_PI),a.west>q.CesiumMath.PI&&(a.west=a.west-q.CesiumMath.TWO_PI)),a}var _=new W.Cartographic;function v(e,t,r,o){for(var a=e.surfaceDistance,i=Math.ceil(a*t),n=0<i?a/(i-1):Number.POSITIVE_INFINITY,s=0,l=0;l<i;l++){var u=e.interpolateUsingSurfaceDistance(s,_);s+=n;var p=u.longitude,u=u.latitude;r.west=Math.min(r.west,p),r.east=Math.max(r.east,p),r.south=Math.min(r.south,u),r.north=Math.max(r.north,u);p=0<=p?p:p+q.CesiumMath.TWO_PI;o.westOverIDL=Math.min(o.westOverIDL,p),o.eastOverIDL=Math.max(o.eastOverIDL,p)}}var N=[];function P(e){var t,r=e.polygonHierarchy,o=z.defaultValue(e.vertexFormat,f.VertexFormat.DEFAULT),a=z.defaultValue(e.ellipsoid,W.Ellipsoid.WGS84),i=z.defaultValue(e.granularity,q.CesiumMath.RADIANS_PER_DEGREE),n=z.defaultValue(e.stRotation,0),s=z.defaultValue(e.perPositionHeight,!1),l=s&&z.defined(e.extrudedHeight),u=z.defaultValue(e.height,0),p=z.defaultValue(e.extrudedHeight,u);l||(t=Math.max(u,p),p=Math.min(u,p),u=t),this._vertexFormat=f.VertexFormat.clone(o),this._ellipsoid=W.Ellipsoid.clone(a),this._granularity=i,this._stRotation=n,this._height=u,this._extrudedHeight=p,this._closeTop=z.defaultValue(e.closeTop,!0),this._closeBottom=z.defaultValue(e.closeBottom,!0),this._polygonHierarchy=r,this._perPositionHeight=s,this._perPositionHeightExtrude=l,this._shadowVolume=z.defaultValue(e.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=z.defaultValue(e.arcType,c.ArcType.GEODESIC),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this.packedLength=V.PolygonGeometryLibrary.computeHierarchyPackedLength(r)+W.Ellipsoid.packedLength+f.VertexFormat.packedLength+12}P.fromPositions=function(e){return new P({polygonHierarchy:{positions:(e=z.defaultValue(e,z.defaultValue.EMPTY_OBJECT)).positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom,offsetAttribute:e.offsetAttribute,arcType:e.arcType})},P.pack=function(e,t,r){return r=z.defaultValue(r,0),r=V.PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,r),W.Ellipsoid.pack(e._ellipsoid,t,r),r+=W.Ellipsoid.packedLength,f.VertexFormat.pack(e._vertexFormat,t,r),r+=f.VertexFormat.packedLength,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._granularity,t[r++]=e._stRotation,t[r++]=e._perPositionHeightExtrude?1:0,t[r++]=e._perPositionHeight?1:0,t[r++]=e._closeTop?1:0,t[r++]=e._closeBottom?1:0,t[r++]=e._shadowVolume?1:0,t[r++]=z.defaultValue(e._offsetAttribute,-1),t[r++]=e._arcType,t[r]=e.packedLength,t};var C=W.Ellipsoid.clone(W.Ellipsoid.UNIT_SPHERE),w=new f.VertexFormat,x={polygonHierarchy:{}};return P.unpack=function(e,t,r){t=z.defaultValue(t,0);var o=V.PolygonGeometryLibrary.unpackPolygonHierarchy(e,t);t=o.startingIndex,delete o.startingIndex;var a=W.Ellipsoid.unpack(e,t,C);t+=W.Ellipsoid.packedLength;var i=f.VertexFormat.unpack(e,t,w);t+=f.VertexFormat.packedLength;var n=e[t++],s=e[t++],l=e[t++],u=e[t++],p=1===e[t++],c=1===e[t++],y=1===e[t++],m=1===e[t++],g=1===e[t++],d=e[t++],h=e[t++],t=e[t];return(r=!z.defined(r)?new P(x):r)._polygonHierarchy=o,r._ellipsoid=W.Ellipsoid.clone(a,r._ellipsoid),r._vertexFormat=f.VertexFormat.clone(i,r._vertexFormat),r._height=n,r._extrudedHeight=s,r._granularity=l,r._stRotation=u,r._perPositionHeightExtrude=p,r._perPositionHeight=c,r._closeTop=y,r._closeBottom=m,r._shadowVolume=g,r._offsetAttribute=-1===d?void 0:d,r._arcType=h,r.packedLength=t,r},P.computeRectangle=function(e,t){var r=z.defaultValue(e.granularity,q.CesiumMath.RADIANS_PER_DEGREE),o=z.defaultValue(e.arcType,c.ArcType.GEODESIC),a=e.polygonHierarchy,e=z.defaultValue(e.ellipsoid,W.Ellipsoid.WGS84);return b(a.positions,e,o,r,t)},P.createGeometry=function(e){var t=e._vertexFormat,r=e._ellipsoid,o=e._granularity,a=e._stRotation,i=e._polygonHierarchy,n=e._perPositionHeight,s=e._closeTop,l=e._closeBottom,u=e._arcType;if(!((g=i.positions).length<3)){var p=A.EllipsoidTangentPlane.fromPoints(g,r),i=V.PolygonGeometryLibrary.polygonsFromHierarchy(i,p.projectPointsOntoPlane.bind(p),!n,r),c=i.hierarchy,y=i.polygons;if(0!==c.length){var m,g=c[0].outerRing,g=V.PolygonGeometryLibrary.computeBoundingRectangle(p.plane.normal,p.projectPointOntoPlane.bind(p),g,a,D),d=[],h=e._height,f=e._extrudedHeight,b={perPositionHeight:n,vertexFormat:t,geometry:void 0,tangentPlane:p,boundingRectangle:g,ellipsoid:r,stRotation:a,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u};if(e._perPositionHeightExtrude||!q.CesiumMath.equalsEpsilon(h,f,0,q.CesiumMath.EPSILON2))for(b.extrude=!0,b.top=s,b.bottom=l,b.shadowVolume=e._shadowVolume,b.offsetAttribute=e._offsetAttribute,m=0;m<y.length;m++){var _,v=function(e,t,r,o,a,i,n,s,l){var u={walls:[]};if(i||n){var p=V.PolygonGeometryLibrary.createGeometryFromPositions(e,t,r,a,s,l),t=p.attributes.position.values,c=p.indices;if(i&&n){var y,i=t.concat(t),m=i.length/3;(y=O.IndexDatatype.createTypedArray(m,2*c.length)).set(c);for(var g=c.length,d=m/2,h=0;h<g;h+=3){var f=y[h]+d,b=y[h+1]+d,_=y[h+2]+d;y[h+g]=_,y[h+1+g]=b,y[h+2+g]=f}p.attributes.position.values=i,a&&s.normal&&(s=p.attributes.normal.values,p.attributes.normal.values=new Float32Array(i.length),p.attributes.normal.values.set(s)),p.indices=y}else if(n){for(m=t.length/3,y=O.IndexDatatype.createTypedArray(m,c.length),h=0;h<c.length;h+=3)y[h]=c[h+2],y[h+1]=c[h+1],y[h+2]=c[h];p.indices=y}u.topAndBottom=new E.GeometryInstance({geometry:p})}var p=o.outerRing,v=A.EllipsoidTangentPlane.fromPoints(p,e).projectPointsOntoPlane(p,N);F.PolygonPipeline.computeWindingOrder2D(v)===F.WindingOrder.CLOCKWISE&&(p=p.slice().reverse());var P=V.PolygonGeometryLibrary.computeWallGeometry(p,e,r,a,l);u.walls.push(new E.GeometryInstance({geometry:P}));var C=o.holes;for(h=0;h<C.length;h++){var w=C[h],v=A.EllipsoidTangentPlane.fromPoints(w,e).projectPointsOntoPlane(w,N);F.PolygonPipeline.computeWindingOrder2D(v)===F.WindingOrder.COUNTER_CLOCKWISE&&(w=w.slice().reverse()),P=V.PolygonGeometryLibrary.computeWallGeometry(w,e,r,a,l),u.walls.push(new E.GeometryInstance({geometry:P}))}return u}(r,y[m],o,c[m],n,s,l,t,u);s&&l?(_=v.topAndBottom,b.geometry=V.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(_.geometry,h,f,r,n)):s?((_=v.topAndBottom).geometry.attributes.position.values=F.PolygonPipeline.scaleToGeodeticHeight(_.geometry.attributes.position.values,h,r,!n),b.geometry=_.geometry):l&&((_=v.topAndBottom).geometry.attributes.position.values=F.PolygonPipeline.scaleToGeodeticHeight(_.geometry.attributes.position.values,f,r,!0),b.geometry=_.geometry),(s||l)&&(b.wall=!1,_.geometry=L(b),d.push(_));var P=v.walls;b.wall=!0;for(var C=0;C<P.length;C++){var w=P[C];b.geometry=V.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(w.geometry,h,f,r,n),w.geometry=L(b),d.push(w)}}else for(m=0;m<y.length;m++){var x,T,I=new E.GeometryInstance({geometry:V.PolygonGeometryLibrary.createGeometryFromPositions(r,y[m],o,n,t,u)});I.geometry.attributes.position.values=F.PolygonPipeline.scaleToGeodeticHeight(I.geometry.attributes.position.values,h,r,!n),b.geometry=I.geometry,I.geometry=L(b),z.defined(e._offsetAttribute)&&(T=I.geometry.attributes.position.values.length,x=new Uint8Array(T/3),T=e._offsetAttribute===Y.GeometryOffsetAttribute.NONE?0:1,Y.arrayFill(x,T),I.geometry.attributes.applyOffset=new Q.GeometryAttribute({componentDatatype:j.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})),d.push(I)}p=G.GeometryPipeline.combineInstances(d)[0];p.attributes.position.values=new Float64Array(p.attributes.position.values),p.indices=O.IndexDatatype.createTypedArray(p.attributes.position.values.length/3,p.indices);g=p.attributes,a=U.BoundingSphere.fromVertices(g.position.values);return t.position||delete g.position,new Q.Geometry({attributes:g,indices:p.indices,primitiveType:p.primitiveType,boundingSphere:a,offsetAttribute:e._offsetAttribute})}}},P.createShadowVolume=function(e,t,r){var o=e._granularity,a=e._ellipsoid,t=t(o,a),r=r(o,a);return new P({polygonHierarchy:e._polygonHierarchy,ellipsoid:a,stRotation:e._stRotation,granularity:o,perPositionHeight:!1,extrudedHeight:t,height:r,vertexFormat:f.VertexFormat.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})},Object.defineProperties(P.prototype,{rectangle:{get:function(){var e;return z.defined(this._rectangle)||(e=this._polygonHierarchy.positions,this._rectangle=b(e,this._ellipsoid,this._arcType,this._granularity)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return z.defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(e){var t=-e._stRotation;if(0==t)return[0,0,0,1,1,0];var r=e._ellipsoid,o=e._polygonHierarchy.positions,e=e.rectangle;return Q.Geometry._textureCoordinateRotationPoints(o,t,r,e)}(this)),this._textureCoordinateRotationPoints}}}),function(e,t){return(e=z.defined(t)?P.unpack(e,t):e)._ellipsoid=W.Ellipsoid.clone(e._ellipsoid),P.createGeometry(e)}});
define(["./when-ca391574","./Cartesian2-5b63e672","./ArcType-2b58731c","./GeometryOffsetAttribute-b94750ca","./BoundingRectangle-755c152f","./Transforms-5295b227","./Check-64f87f7d","./ComponentDatatype-8f71e605","./EllipsoidGeodesic-bbea0b0a","./EllipsoidTangentPlane-0fb66b96","./GeometryAttribute-7ef2d452","./GeometryInstance-d18842cb","./GeometryPipeline-a588d10d","./IndexDatatype-4e56bcfa","./Math-b53708b3","./PolygonGeometryLibrary-06811a0e","./PolygonPipeline-ff4431d7","./VertexFormat-63b3c6da","./RuntimeError-19cb26ba","./WebGLConstants-95ceb4e9","./IntersectionTests-f5111308","./Plane-99b2becd","./AttributeCompression-a99f24b9","./EncodedCartesian3-c36ced29","./arrayRemoveDuplicates-fc9e255d","./EllipsoidRhumbLine-6ee9af74","./GeometryAttributes-a356f820"],function(z,W,c,Y,e,U,t,j,y,A,Q,E,G,O,q,V,F,f,r,o,a,i,n,s,l,u,p){"use strict";var K=new W.Cartographic,Z=new W.Cartographic;var D=new e.BoundingRectangle,J=new W.Cartesian3,X=new W.Cartesian3,$=new W.Cartesian3,ee=new W.Cartesian3,te=new W.Cartesian3,re=new W.Cartesian3,oe=new W.Cartesian3,ae=new W.Cartesian3,ie=new W.Cartesian3,ne=new W.Cartesian2,se=new W.Cartesian2,le=new W.Cartesian3,ue=new U.Quaternion,pe=new U.Matrix3,ce=new U.Matrix3;function L(e){var t,r=e.vertexFormat,o=e.geometry,a=e.shadowVolume,i=o.attributes.position.values,n=i.length,s=e.wall,l=e.top||s,u=e.bottom||s;if(r.st||r.normal||r.tangent||r.bitangent||a){var p=e.boundingRectangle,c=e.tangentPlane,y=e.ellipsoid,m=e.stRotation,g=e.perPositionHeight,d=ne;d.x=p.x,d.y=p.y;var h,f=r.st?new Float32Array(n/3*2):void 0;r.normal&&(h=g&&l&&!s?o.attributes.normal.values:new Float32Array(n));var b,_=r.tangent?new Float32Array(n):void 0,v=r.bitangent?new Float32Array(n):void 0,P=a?new Float32Array(n):void 0,C=0,w=0,x=X,T=$,I=ee,A=!0,E=pe,G=ce;G=0!==m?(b=U.Quaternion.fromAxisAngle(c._plane.normal,m,ue),E=U.Matrix3.fromQuaternion(b,E),b=U.Quaternion.fromAxisAngle(c._plane.normal,-m,ue),U.Matrix3.fromQuaternion(b,G)):(E=U.Matrix3.clone(U.Matrix3.IDENTITY,E),U.Matrix3.clone(U.Matrix3.IDENTITY,G));var O=0,V=0;l&&u&&(O=n/2,V=n/3,n/=2);for(var F=0;F<n;F+=3){var D,L,N,H,R,M,S,B,k=W.Cartesian3.fromArray(i,F,le);r.st&&(D=U.Matrix3.multiplyByVector(E,k,J),D=y.scaleToGeodeticSurface(D,D),L=c.projectPointOntoPlane(D,se),W.Cartesian2.subtract(L,d,L),N=q.CesiumMath.clamp(L.x/p.width,0,1),H=q.CesiumMath.clamp(L.y/p.height,0,1),u&&(f[C+V]=N,f[C+1+V]=H),l&&(f[C]=N,f[C+1]=H),C+=2),(r.normal||r.tangent||r.bitangent||a)&&(R=w+1,M=w+2,s?(F+3<n&&(S=W.Cartesian3.fromArray(i,F+3,te),A&&(B=W.Cartesian3.fromArray(i,F+n,re),g&&(t=k,D=S,L=B,N=void 0,N=(H=y).cartesianToCartographic(t,K).height,(t=H.cartesianToCartographic(D,Z)).height=N,H.cartographicToCartesian(t,D),(D=H.cartesianToCartographic(L,Z)).height=N-100,H.cartographicToCartesian(D,L)),W.Cartesian3.subtract(S,k,S),W.Cartesian3.subtract(B,k,B),x=W.Cartesian3.normalize(W.Cartesian3.cross(B,S,x),x),A=!1),W.Cartesian3.equalsEpsilon(S,k,q.CesiumMath.EPSILON10)&&(A=!0)),(r.tangent||r.bitangent)&&(I=y.geodeticSurfaceNormal(k,I),r.tangent&&(T=W.Cartesian3.normalize(W.Cartesian3.cross(I,x,T),T)))):(x=y.geodeticSurfaceNormal(k,x),(r.tangent||r.bitangent)&&(g&&(oe=W.Cartesian3.fromArray(h,w,oe),ae=W.Cartesian3.cross(W.Cartesian3.UNIT_Z,oe,ae),ae=W.Cartesian3.normalize(U.Matrix3.multiplyByVector(G,ae,ae),ae),r.bitangent&&(ie=W.Cartesian3.normalize(W.Cartesian3.cross(oe,ae,ie),ie))),T=W.Cartesian3.cross(W.Cartesian3.UNIT_Z,x,T),T=W.Cartesian3.normalize(U.Matrix3.multiplyByVector(G,T,T),T),r.bitangent&&(I=W.Cartesian3.normalize(W.Cartesian3.cross(x,T,I),I)))),r.normal&&(e.wall?(h[w+O]=x.x,h[R+O]=x.y,h[M+O]=x.z):u&&(h[w+O]=-x.x,h[R+O]=-x.y,h[M+O]=-x.z),(l&&!g||s)&&(h[w]=x.x,h[R]=x.y,h[M]=x.z)),a&&(s&&(x=y.geodeticSurfaceNormal(k,x)),P[w+O]=-x.x,P[R+O]=-x.y,P[M+O]=-x.z),r.tangent&&(e.wall?(_[w+O]=T.x,_[R+O]=T.y,_[M+O]=T.z):u&&(_[w+O]=-T.x,_[R+O]=-T.y,_[M+O]=-T.z),l&&(g?(_[w]=ae.x,_[R]=ae.y,_[M]=ae.z):(_[w]=T.x,_[R]=T.y,_[M]=T.z))),r.bitangent&&(u&&(v[w+O]=I.x,v[R+O]=I.y,v[M+O]=I.z),l&&(g?(v[w]=ie.x,v[R]=ie.y,v[M]=ie.z):(v[w]=I.x,v[R]=I.y,v[M]=I.z))),w+=3)}r.st&&(o.attributes.st=new Q.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:f})),r.normal&&(o.attributes.normal=new Q.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:h})),r.tangent&&(o.attributes.tangent=new Q.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:_})),r.bitangent&&(o.attributes.bitangent=new Q.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:v})),a&&(o.attributes.extrudeDirection=new Q.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:P}))}return e.extrude&&z.defined(e.offsetAttribute)&&(m=i.length/3,b=new Uint8Array(m),e.offsetAttribute===Y.GeometryOffsetAttribute.TOP?l&&u||s?b=Y.arrayFill(b,1,0,m/2):l&&(b=Y.arrayFill(b,1)):(m=e.offsetAttribute===Y.GeometryOffsetAttribute.NONE?0:1,b=Y.arrayFill(b,m)),o.attributes.applyOffset=new Q.GeometryAttribute({componentDatatype:j.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})),o}var m=new W.Cartographic,g=new W.Cartographic,d={westOverIDL:0,eastOverIDL:0},h=new y.EllipsoidGeodesic;function b(e,t,r,o,a){if(a=z.defaultValue(a,new W.Rectangle),!z.defined(e)||e.length<3)return a.west=0,a.north=0,a.south=0,a.east=0,a;if(r===c.ArcType.RHUMB)return W.Rectangle.fromCartesianArray(e,t,a);h.ellipsoid.equals(t)||(h=new y.EllipsoidGeodesic(void 0,void 0,t)),a.west=Number.POSITIVE_INFINITY,a.east=Number.NEGATIVE_INFINITY,a.south=Number.POSITIVE_INFINITY,a.north=Number.NEGATIVE_INFINITY,d.westOverIDL=Number.POSITIVE_INFINITY,d.eastOverIDL=Number.NEGATIVE_INFINITY;for(var i,n=1/q.CesiumMath.chordLength(o,t.maximumRadius),s=e.length,l=t.cartesianToCartographic(e[0],g),u=m,p=1;p<s;p++)i=u,u=l,l=t.cartesianToCartographic(e[p],i),h.setEndPoints(u,l),v(h,n,a,d);return i=u,u=l,l=t.cartesianToCartographic(e[0],i),h.setEndPoints(u,l),v(h,n,a,d),a.east-a.west>d.eastOverIDL-d.westOverIDL&&(a.west=d.westOverIDL,a.east=d.eastOverIDL,a.east>q.CesiumMath.PI&&(a.east=a.east-q.CesiumMath.TWO_PI),a.west>q.CesiumMath.PI&&(a.west=a.west-q.CesiumMath.TWO_PI)),a}var _=new W.Cartographic;function v(e,t,r,o){for(var a=e.surfaceDistance,i=Math.ceil(a*t),n=0<i?a/(i-1):Number.POSITIVE_INFINITY,s=0,l=0;l<i;l++){var u=e.interpolateUsingSurfaceDistance(s,_);s+=n;var p=u.longitude,u=u.latitude;r.west=Math.min(r.west,p),r.east=Math.max(r.east,p),r.south=Math.min(r.south,u),r.north=Math.max(r.north,u);p=0<=p?p:p+q.CesiumMath.TWO_PI;o.westOverIDL=Math.min(o.westOverIDL,p),o.eastOverIDL=Math.max(o.eastOverIDL,p)}}var N=[];function P(e){var t,r=e.polygonHierarchy,o=z.defaultValue(e.vertexFormat,f.VertexFormat.DEFAULT),a=z.defaultValue(e.ellipsoid,W.Ellipsoid.WGS84),i=z.defaultValue(e.granularity,q.CesiumMath.RADIANS_PER_DEGREE),n=z.defaultValue(e.stRotation,0),s=z.defaultValue(e.perPositionHeight,!1),l=s&&z.defined(e.extrudedHeight),u=z.defaultValue(e.height,0),p=z.defaultValue(e.extrudedHeight,u);l||(t=Math.max(u,p),p=Math.min(u,p),u=t),this._vertexFormat=f.VertexFormat.clone(o),this._ellipsoid=W.Ellipsoid.clone(a),this._granularity=i,this._stRotation=n,this._height=u,this._extrudedHeight=p,this._closeTop=z.defaultValue(e.closeTop,!0),this._closeBottom=z.defaultValue(e.closeBottom,!0),this._polygonHierarchy=r,this._perPositionHeight=s,this._perPositionHeightExtrude=l,this._shadowVolume=z.defaultValue(e.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=z.defaultValue(e.arcType,c.ArcType.GEODESIC),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this.packedLength=V.PolygonGeometryLibrary.computeHierarchyPackedLength(r)+W.Ellipsoid.packedLength+f.VertexFormat.packedLength+12}P.fromPositions=function(e){return new P({polygonHierarchy:{positions:(e=z.defaultValue(e,z.defaultValue.EMPTY_OBJECT)).positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom,offsetAttribute:e.offsetAttribute,arcType:e.arcType})},P.pack=function(e,t,r){return r=z.defaultValue(r,0),r=V.PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,r),W.Ellipsoid.pack(e._ellipsoid,t,r),r+=W.Ellipsoid.packedLength,f.VertexFormat.pack(e._vertexFormat,t,r),r+=f.VertexFormat.packedLength,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._granularity,t[r++]=e._stRotation,t[r++]=e._perPositionHeightExtrude?1:0,t[r++]=e._perPositionHeight?1:0,t[r++]=e._closeTop?1:0,t[r++]=e._closeBottom?1:0,t[r++]=e._shadowVolume?1:0,t[r++]=z.defaultValue(e._offsetAttribute,-1),t[r++]=e._arcType,t[r]=e.packedLength,t};var C=W.Ellipsoid.clone(W.Ellipsoid.UNIT_SPHERE),w=new f.VertexFormat,x={polygonHierarchy:{}};return P.unpack=function(e,t,r){t=z.defaultValue(t,0);var o=V.PolygonGeometryLibrary.unpackPolygonHierarchy(e,t);t=o.startingIndex,delete o.startingIndex;var a=W.Ellipsoid.unpack(e,t,C);t+=W.Ellipsoid.packedLength;var i=f.VertexFormat.unpack(e,t,w);t+=f.VertexFormat.packedLength;var n=e[t++],s=e[t++],l=e[t++],u=e[t++],p=1===e[t++],c=1===e[t++],y=1===e[t++],m=1===e[t++],g=1===e[t++],d=e[t++],h=e[t++],t=e[t];return(r=!z.defined(r)?new P(x):r)._polygonHierarchy=o,r._ellipsoid=W.Ellipsoid.clone(a,r._ellipsoid),r._vertexFormat=f.VertexFormat.clone(i,r._vertexFormat),r._height=n,r._extrudedHeight=s,r._granularity=l,r._stRotation=u,r._perPositionHeightExtrude=p,r._perPositionHeight=c,r._closeTop=y,r._closeBottom=m,r._shadowVolume=g,r._offsetAttribute=-1===d?void 0:d,r._arcType=h,r.packedLength=t,r},P.computeRectangle=function(e,t){var r=z.defaultValue(e.granularity,q.CesiumMath.RADIANS_PER_DEGREE),o=z.defaultValue(e.arcType,c.ArcType.GEODESIC),a=e.polygonHierarchy,e=z.defaultValue(e.ellipsoid,W.Ellipsoid.WGS84);return b(a.positions,e,o,r,t)},P.createGeometry=function(e){var t=e._vertexFormat,r=e._ellipsoid,o=e._granularity,a=e._stRotation,i=e._polygonHierarchy,n=e._perPositionHeight,s=e._closeTop,l=e._closeBottom,u=e._arcType;if(!((g=i.positions).length<3)){var p=A.EllipsoidTangentPlane.fromPoints(g,r),i=V.PolygonGeometryLibrary.polygonsFromHierarchy(i,p.projectPointsOntoPlane.bind(p),!n,r),c=i.hierarchy,y=i.polygons;if(0!==c.length){var m,g=c[0].outerRing,g=V.PolygonGeometryLibrary.computeBoundingRectangle(p.plane.normal,p.projectPointOntoPlane.bind(p),g,a,D),d=[],h=e._height,f=e._extrudedHeight,b={perPositionHeight:n,vertexFormat:t,geometry:void 0,tangentPlane:p,boundingRectangle:g,ellipsoid:r,stRotation:a,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u};if(e._perPositionHeightExtrude||!q.CesiumMath.equalsEpsilon(h,f,0,q.CesiumMath.EPSILON2))for(b.extrude=!0,b.top=s,b.bottom=l,b.shadowVolume=e._shadowVolume,b.offsetAttribute=e._offsetAttribute,m=0;m<y.length;m++){var _,v=function(e,t,r,o,a,i,n,s,l){var u={walls:[]};if(i||n){var p=V.PolygonGeometryLibrary.createGeometryFromPositions(e,t,r,a,s,l),t=p.attributes.position.values,c=p.indices;if(i&&n){var y,i=t.concat(t),m=i.length/3;(y=O.IndexDatatype.createTypedArray(m,2*c.length)).set(c);for(var g=c.length,d=m/2,h=0;h<g;h+=3){var f=y[h]+d,b=y[h+1]+d,_=y[h+2]+d;y[h+g]=_,y[h+1+g]=b,y[h+2+g]=f}p.attributes.position.values=i,a&&s.normal&&(s=p.attributes.normal.values,p.attributes.normal.values=new Float32Array(i.length),p.attributes.normal.values.set(s)),p.indices=y}else if(n){for(m=t.length/3,y=O.IndexDatatype.createTypedArray(m,c.length),h=0;h<c.length;h+=3)y[h]=c[h+2],y[h+1]=c[h+1],y[h+2]=c[h];p.indices=y}u.topAndBottom=new E.GeometryInstance({geometry:p})}var p=o.outerRing,v=A.EllipsoidTangentPlane.fromPoints(p,e).projectPointsOntoPlane(p,N);F.PolygonPipeline.computeWindingOrder2D(v)===F.WindingOrder.CLOCKWISE&&(p=p.slice().reverse());var P=V.PolygonGeometryLibrary.computeWallGeometry(p,e,r,a,l);u.walls.push(new E.GeometryInstance({geometry:P}));var C=o.holes;for(h=0;h<C.length;h++){var w=C[h],v=A.EllipsoidTangentPlane.fromPoints(w,e).projectPointsOntoPlane(w,N);F.PolygonPipeline.computeWindingOrder2D(v)===F.WindingOrder.COUNTER_CLOCKWISE&&(w=w.slice().reverse()),P=V.PolygonGeometryLibrary.computeWallGeometry(w,e,r,a,l),u.walls.push(new E.GeometryInstance({geometry:P}))}return u}(r,y[m],o,c[m],n,s,l,t,u);s&&l?(_=v.topAndBottom,b.geometry=V.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(_.geometry,h,f,r,n)):s?((_=v.topAndBottom).geometry.attributes.position.values=F.PolygonPipeline.scaleToGeodeticHeight(_.geometry.attributes.position.values,h,r,!n),b.geometry=_.geometry):l&&((_=v.topAndBottom).geometry.attributes.position.values=F.PolygonPipeline.scaleToGeodeticHeight(_.geometry.attributes.position.values,f,r,!0),b.geometry=_.geometry),(s||l)&&(b.wall=!1,_.geometry=L(b),d.push(_));var P=v.walls;b.wall=!0;for(var C=0;C<P.length;C++){var w=P[C];b.geometry=V.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(w.geometry,h,f,r,n),w.geometry=L(b),d.push(w)}}else for(m=0;m<y.length;m++){var x,T,I=new E.GeometryInstance({geometry:V.PolygonGeometryLibrary.createGeometryFromPositions(r,y[m],o,n,t,u)});I.geometry.attributes.position.values=F.PolygonPipeline.scaleToGeodeticHeight(I.geometry.attributes.position.values,h,r,!n),b.geometry=I.geometry,I.geometry=L(b),z.defined(e._offsetAttribute)&&(T=I.geometry.attributes.position.values.length,x=new Uint8Array(T/3),T=e._offsetAttribute===Y.GeometryOffsetAttribute.NONE?0:1,Y.arrayFill(x,T),I.geometry.attributes.applyOffset=new Q.GeometryAttribute({componentDatatype:j.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})),d.push(I)}p=G.GeometryPipeline.combineInstances(d)[0];p.attributes.position.values=new Float64Array(p.attributes.position.values),p.indices=O.IndexDatatype.createTypedArray(p.attributes.position.values.length/3,p.indices);g=p.attributes,a=U.BoundingSphere.fromVertices(g.position.values);return t.position||delete g.position,new Q.Geometry({attributes:g,indices:p.indices,primitiveType:p.primitiveType,boundingSphere:a,offsetAttribute:e._offsetAttribute})}}},P.createShadowVolume=function(e,t,r){var o=e._granularity,a=e._ellipsoid,t=t(o,a),r=r(o,a);return new P({polygonHierarchy:e._polygonHierarchy,ellipsoid:a,stRotation:e._stRotation,granularity:o,perPositionHeight:!1,extrudedHeight:t,height:r,vertexFormat:f.VertexFormat.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})},Object.defineProperties(P.prototype,{rectangle:{get:function(){var e;return z.defined(this._rectangle)||(e=this._polygonHierarchy.positions,this._rectangle=b(e,this._ellipsoid,this._arcType,this._granularity)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return z.defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(e){var t=-e._stRotation;if(0==t)return[0,0,0,1,1,0];var r=e._ellipsoid,o=e._polygonHierarchy.positions,e=e.rectangle;return Q.Geometry._textureCoordinateRotationPoints(o,t,r,e)}(this)),this._textureCoordinateRotationPoints}}}),function(e,t){return(e=z.defined(t)?P.unpack(e,t):e)._ellipsoid=W.Ellipsoid.clone(e._ellipsoid),P.createGeometry(e)}});

@@ -1,1 +0,1 @@

define(["./when-ca391574","./Cartesian2-5b63e672","./ArcType-2b58731c","./GeometryOffsetAttribute-b94750ca","./Transforms-5295b227","./Check-64f87f7d","./ComponentDatatype-8f71e605","./EllipsoidTangentPlane-0fb66b96","./GeometryAttribute-7ef2d452","./GeometryAttributes-a356f820","./GeometryInstance-d18842cb","./GeometryPipeline-a588d10d","./IndexDatatype-4e56bcfa","./Math-b53708b3","./PolygonGeometryLibrary-b3087bff","./PolygonPipeline-55053b0a","./RuntimeError-19cb26ba","./WebGLConstants-95ceb4e9","./IntersectionTests-f5111308","./Plane-99b2becd","./AttributeCompression-a99f24b9","./EncodedCartesian3-c36ced29","./arrayRemoveDuplicates-fc9e255d","./EllipsoidRhumbLine-21029cef"],function(m,d,E,b,P,e,A,_,v,G,L,T,H,C,O,D,t,i,r,o,n,a,l,s){"use strict";var x=[],I=[];function c(e){var t,i=e.polygonHierarchy,r=m.defaultValue(e.ellipsoid,d.Ellipsoid.WGS84),o=m.defaultValue(e.granularity,C.CesiumMath.RADIANS_PER_DEGREE),n=m.defaultValue(e.perPositionHeight,!1),a=n&&m.defined(e.extrudedHeight),l=m.defaultValue(e.arcType,E.ArcType.GEODESIC),s=m.defaultValue(e.height,0),y=m.defaultValue(e.extrudedHeight,s);a||(t=Math.max(s,y),y=Math.min(s,y),s=t),this._ellipsoid=d.Ellipsoid.clone(r),this._granularity=o,this._height=s,this._extrudedHeight=y,this._arcType=l,this._polygonHierarchy=i,this._perPositionHeight=n,this._perPositionHeightExtrude=a,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=O.PolygonGeometryLibrary.computeHierarchyPackedLength(i)+d.Ellipsoid.packedLength+8}c.pack=function(e,t,i){return i=m.defaultValue(i,0),i=O.PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,i),d.Ellipsoid.pack(e._ellipsoid,t,i),i+=d.Ellipsoid.packedLength,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._granularity,t[i++]=e._perPositionHeightExtrude?1:0,t[i++]=e._perPositionHeight?1:0,t[i++]=e._arcType,t[i++]=m.defaultValue(e._offsetAttribute,-1),t[i]=e.packedLength,t};var f=d.Ellipsoid.clone(d.Ellipsoid.UNIT_SPHERE),g={polygonHierarchy:{}};return c.unpack=function(e,t,i){t=m.defaultValue(t,0);var r=O.PolygonGeometryLibrary.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;var o=d.Ellipsoid.unpack(e,t,f);t+=d.Ellipsoid.packedLength;var n=e[t++],a=e[t++],l=e[t++],s=1===e[t++],y=1===e[t++],u=e[t++],p=e[t++],t=e[t];return(i=!m.defined(i)?new c(g):i)._polygonHierarchy=r,i._ellipsoid=d.Ellipsoid.clone(o,i._ellipsoid),i._height=n,i._extrudedHeight=a,i._granularity=l,i._perPositionHeight=y,i._perPositionHeightExtrude=s,i._arcType=u,i._offsetAttribute=-1===p?void 0:p,i.packedLength=t,i},c.fromPositions=function(e){return new c({polygonHierarchy:{positions:(e=m.defaultValue(e,m.defaultValue.EMPTY_OBJECT)).positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute})},c.createGeometry=function(e){var t=e._ellipsoid,i=e._granularity,r=e._polygonHierarchy,o=e._perPositionHeight,n=e._arcType,a=O.PolygonGeometryLibrary.polygonOutlinesFromHierarchy(r,!o,t);if(0!==a.length){var l,s,y,u,p,d,c=[],f=C.CesiumMath.chordLength(i,t.maximumRadius),g=e._height,h=e._extrudedHeight;if(e._perPositionHeightExtrude||!C.CesiumMath.equalsEpsilon(g,h,0,C.CesiumMath.EPSILON2))for(l=0;l<a.length;l++)(u=function(e,t,i,r,o){var n,a=_.EllipsoidTangentPlane.fromPoints(t,e).projectPointsOntoPlane(t,x);D.PolygonPipeline.computeWindingOrder2D(a)===D.WindingOrder.CLOCKWISE&&(a.reverse(),t=t.slice().reverse());var l=t.length,s=new Array(l),y=0;if(r)for(n=new Float64Array(2*l*3*2),b=0;b<l;++b){s[b]=y/3;var u=t[b],p=t[(b+1)%l];n[y++]=u.x,n[y++]=u.y,n[y++]=u.z,n[y++]=p.x,n[y++]=p.y,n[y++]=p.z}else{var d,c=0;if(o===E.ArcType.GEODESIC)for(b=0;b<l;b++)c+=O.PolygonGeometryLibrary.subdivideLineCount(t[b],t[(b+1)%l],i);else if(o===E.ArcType.RHUMB)for(b=0;b<l;b++)c+=O.PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[b],t[(b+1)%l],i);for(n=new Float64Array(3*c*2),b=0;b<l;++b){s[b]=y/3,o===E.ArcType.GEODESIC?d=O.PolygonGeometryLibrary.subdivideLine(t[b],t[(b+1)%l],i,I):o===E.ArcType.RHUMB&&(d=O.PolygonGeometryLibrary.subdivideRhumbLine(e,t[b],t[(b+1)%l],i,I));for(var f=d.length,g=0;g<f;++g)n[y++]=d[g]}}for(var l=n.length/6,h=s.length,r=2*(2*l+h),m=H.IndexDatatype.createTypedArray(l+h,r),y=0,b=0;b<l;++b)m[y++]=b,m[y++]=(b+1)%l,m[y++]=b+l,m[y++]=(b+1)%l+l;for(b=0;b<h;b++){var P=s[b];m[y++]=P,m[y++]=P+l}return new L.GeometryInstance({geometry:new v.Geometry({attributes:new G.GeometryAttributes({position:new v.GeometryAttribute({componentDatatype:A.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:n})}),indices:m,primitiveType:v.PrimitiveType.LINES})})}(t,a[l],f,o,n)).geometry=O.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(u.geometry,g,h,t,o),m.defined(e._offsetAttribute)&&(s=u.geometry.attributes.position.values.length/3,y=new Uint8Array(s),y=e._offsetAttribute===b.GeometryOffsetAttribute.TOP?b.arrayFill(y,1,0,s/2):(d=e._offsetAttribute===b.GeometryOffsetAttribute.NONE?0:1,b.arrayFill(y,d)),u.geometry.attributes.applyOffset=new v.GeometryAttribute({componentDatatype:A.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})),c.push(u);else for(l=0;l<a.length;l++)(u=function(e,t,i,r,o){var n,a=_.EllipsoidTangentPlane.fromPoints(t,e).projectPointsOntoPlane(t,x);D.PolygonPipeline.computeWindingOrder2D(a)===D.WindingOrder.CLOCKWISE&&(a.reverse(),t=t.slice().reverse());var l=t.length,s=0;if(r)for(n=new Float64Array(2*l*3),h=0;h<l;h++){var y=t[h],u=t[(h+1)%l];n[s++]=y.x,n[s++]=y.y,n[s++]=y.z,n[s++]=u.x,n[s++]=u.y,n[s++]=u.z}else{var p,d=0;if(o===E.ArcType.GEODESIC)for(h=0;h<l;h++)d+=O.PolygonGeometryLibrary.subdivideLineCount(t[h],t[(h+1)%l],i);else if(o===E.ArcType.RHUMB)for(h=0;h<l;h++)d+=O.PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[h],t[(h+1)%l],i);for(n=new Float64Array(3*d),h=0;h<l;h++){o===E.ArcType.GEODESIC?p=O.PolygonGeometryLibrary.subdivideLine(t[h],t[(h+1)%l],i,I):o===E.ArcType.RHUMB&&(p=O.PolygonGeometryLibrary.subdivideRhumbLine(e,t[h],t[(h+1)%l],i,I));for(var c=p.length,f=0;f<c;++f)n[s++]=p[f]}}for(var r=2*(l=n.length/3),g=H.IndexDatatype.createTypedArray(l,r),s=0,h=0;h<l-1;h++)g[s++]=h,g[s++]=h+1;return g[s++]=l-1,g[s++]=0,new L.GeometryInstance({geometry:new v.Geometry({attributes:new G.GeometryAttributes({position:new v.GeometryAttribute({componentDatatype:A.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:n})}),indices:g,primitiveType:v.PrimitiveType.LINES})})}(t,a[l],f,o,n)).geometry.attributes.position.values=D.PolygonPipeline.scaleToGeodeticHeight(u.geometry.attributes.position.values,g,t,!o),m.defined(e._offsetAttribute)&&(p=u.geometry.attributes.position.values.length,p=new Uint8Array(p/3),d=e._offsetAttribute===b.GeometryOffsetAttribute.NONE?0:1,b.arrayFill(p,d),u.geometry.attributes.applyOffset=new v.GeometryAttribute({componentDatatype:A.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:p})),c.push(u);r=T.GeometryPipeline.combineInstances(c)[0],i=P.BoundingSphere.fromVertices(r.attributes.position.values);return new v.Geometry({attributes:r.attributes,indices:r.indices,primitiveType:r.primitiveType,boundingSphere:i,offsetAttribute:e._offsetAttribute})}},function(e,t){return(e=m.defined(t)?c.unpack(e,t):e)._ellipsoid=d.Ellipsoid.clone(e._ellipsoid),c.createGeometry(e)}});
define(["./when-ca391574","./Cartesian2-5b63e672","./ArcType-2b58731c","./GeometryOffsetAttribute-b94750ca","./Transforms-5295b227","./Check-64f87f7d","./ComponentDatatype-8f71e605","./EllipsoidTangentPlane-0fb66b96","./GeometryAttribute-7ef2d452","./GeometryAttributes-a356f820","./GeometryInstance-d18842cb","./GeometryPipeline-a588d10d","./IndexDatatype-4e56bcfa","./Math-b53708b3","./PolygonGeometryLibrary-06811a0e","./PolygonPipeline-ff4431d7","./RuntimeError-19cb26ba","./WebGLConstants-95ceb4e9","./IntersectionTests-f5111308","./Plane-99b2becd","./AttributeCompression-a99f24b9","./EncodedCartesian3-c36ced29","./arrayRemoveDuplicates-fc9e255d","./EllipsoidRhumbLine-6ee9af74"],function(m,d,E,b,P,e,A,_,v,G,L,T,H,C,O,D,t,i,r,o,n,a,l,s){"use strict";var x=[],I=[];function c(e){var t,i=e.polygonHierarchy,r=m.defaultValue(e.ellipsoid,d.Ellipsoid.WGS84),o=m.defaultValue(e.granularity,C.CesiumMath.RADIANS_PER_DEGREE),n=m.defaultValue(e.perPositionHeight,!1),a=n&&m.defined(e.extrudedHeight),l=m.defaultValue(e.arcType,E.ArcType.GEODESIC),s=m.defaultValue(e.height,0),y=m.defaultValue(e.extrudedHeight,s);a||(t=Math.max(s,y),y=Math.min(s,y),s=t),this._ellipsoid=d.Ellipsoid.clone(r),this._granularity=o,this._height=s,this._extrudedHeight=y,this._arcType=l,this._polygonHierarchy=i,this._perPositionHeight=n,this._perPositionHeightExtrude=a,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=O.PolygonGeometryLibrary.computeHierarchyPackedLength(i)+d.Ellipsoid.packedLength+8}c.pack=function(e,t,i){return i=m.defaultValue(i,0),i=O.PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,i),d.Ellipsoid.pack(e._ellipsoid,t,i),i+=d.Ellipsoid.packedLength,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._granularity,t[i++]=e._perPositionHeightExtrude?1:0,t[i++]=e._perPositionHeight?1:0,t[i++]=e._arcType,t[i++]=m.defaultValue(e._offsetAttribute,-1),t[i]=e.packedLength,t};var f=d.Ellipsoid.clone(d.Ellipsoid.UNIT_SPHERE),g={polygonHierarchy:{}};return c.unpack=function(e,t,i){t=m.defaultValue(t,0);var r=O.PolygonGeometryLibrary.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;var o=d.Ellipsoid.unpack(e,t,f);t+=d.Ellipsoid.packedLength;var n=e[t++],a=e[t++],l=e[t++],s=1===e[t++],y=1===e[t++],u=e[t++],p=e[t++],t=e[t];return(i=!m.defined(i)?new c(g):i)._polygonHierarchy=r,i._ellipsoid=d.Ellipsoid.clone(o,i._ellipsoid),i._height=n,i._extrudedHeight=a,i._granularity=l,i._perPositionHeight=y,i._perPositionHeightExtrude=s,i._arcType=u,i._offsetAttribute=-1===p?void 0:p,i.packedLength=t,i},c.fromPositions=function(e){return new c({polygonHierarchy:{positions:(e=m.defaultValue(e,m.defaultValue.EMPTY_OBJECT)).positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute})},c.createGeometry=function(e){var t=e._ellipsoid,i=e._granularity,r=e._polygonHierarchy,o=e._perPositionHeight,n=e._arcType,a=O.PolygonGeometryLibrary.polygonOutlinesFromHierarchy(r,!o,t);if(0!==a.length){var l,s,y,u,p,d,c=[],f=C.CesiumMath.chordLength(i,t.maximumRadius),g=e._height,h=e._extrudedHeight;if(e._perPositionHeightExtrude||!C.CesiumMath.equalsEpsilon(g,h,0,C.CesiumMath.EPSILON2))for(l=0;l<a.length;l++)(u=function(e,t,i,r,o){var n,a=_.EllipsoidTangentPlane.fromPoints(t,e).projectPointsOntoPlane(t,x);D.PolygonPipeline.computeWindingOrder2D(a)===D.WindingOrder.CLOCKWISE&&(a.reverse(),t=t.slice().reverse());var l=t.length,s=new Array(l),y=0;if(r)for(n=new Float64Array(2*l*3*2),b=0;b<l;++b){s[b]=y/3;var u=t[b],p=t[(b+1)%l];n[y++]=u.x,n[y++]=u.y,n[y++]=u.z,n[y++]=p.x,n[y++]=p.y,n[y++]=p.z}else{var d,c=0;if(o===E.ArcType.GEODESIC)for(b=0;b<l;b++)c+=O.PolygonGeometryLibrary.subdivideLineCount(t[b],t[(b+1)%l],i);else if(o===E.ArcType.RHUMB)for(b=0;b<l;b++)c+=O.PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[b],t[(b+1)%l],i);for(n=new Float64Array(3*c*2),b=0;b<l;++b){s[b]=y/3,o===E.ArcType.GEODESIC?d=O.PolygonGeometryLibrary.subdivideLine(t[b],t[(b+1)%l],i,I):o===E.ArcType.RHUMB&&(d=O.PolygonGeometryLibrary.subdivideRhumbLine(e,t[b],t[(b+1)%l],i,I));for(var f=d.length,g=0;g<f;++g)n[y++]=d[g]}}for(var l=n.length/6,h=s.length,r=2*(2*l+h),m=H.IndexDatatype.createTypedArray(l+h,r),y=0,b=0;b<l;++b)m[y++]=b,m[y++]=(b+1)%l,m[y++]=b+l,m[y++]=(b+1)%l+l;for(b=0;b<h;b++){var P=s[b];m[y++]=P,m[y++]=P+l}return new L.GeometryInstance({geometry:new v.Geometry({attributes:new G.GeometryAttributes({position:new v.GeometryAttribute({componentDatatype:A.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:n})}),indices:m,primitiveType:v.PrimitiveType.LINES})})}(t,a[l],f,o,n)).geometry=O.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(u.geometry,g,h,t,o),m.defined(e._offsetAttribute)&&(s=u.geometry.attributes.position.values.length/3,y=new Uint8Array(s),y=e._offsetAttribute===b.GeometryOffsetAttribute.TOP?b.arrayFill(y,1,0,s/2):(d=e._offsetAttribute===b.GeometryOffsetAttribute.NONE?0:1,b.arrayFill(y,d)),u.geometry.attributes.applyOffset=new v.GeometryAttribute({componentDatatype:A.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})),c.push(u);else for(l=0;l<a.length;l++)(u=function(e,t,i,r,o){var n,a=_.EllipsoidTangentPlane.fromPoints(t,e).projectPointsOntoPlane(t,x);D.PolygonPipeline.computeWindingOrder2D(a)===D.WindingOrder.CLOCKWISE&&(a.reverse(),t=t.slice().reverse());var l=t.length,s=0;if(r)for(n=new Float64Array(2*l*3),h=0;h<l;h++){var y=t[h],u=t[(h+1)%l];n[s++]=y.x,n[s++]=y.y,n[s++]=y.z,n[s++]=u.x,n[s++]=u.y,n[s++]=u.z}else{var p,d=0;if(o===E.ArcType.GEODESIC)for(h=0;h<l;h++)d+=O.PolygonGeometryLibrary.subdivideLineCount(t[h],t[(h+1)%l],i);else if(o===E.ArcType.RHUMB)for(h=0;h<l;h++)d+=O.PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[h],t[(h+1)%l],i);for(n=new Float64Array(3*d),h=0;h<l;h++){o===E.ArcType.GEODESIC?p=O.PolygonGeometryLibrary.subdivideLine(t[h],t[(h+1)%l],i,I):o===E.ArcType.RHUMB&&(p=O.PolygonGeometryLibrary.subdivideRhumbLine(e,t[h],t[(h+1)%l],i,I));for(var c=p.length,f=0;f<c;++f)n[s++]=p[f]}}for(var r=2*(l=n.length/3),g=H.IndexDatatype.createTypedArray(l,r),s=0,h=0;h<l-1;h++)g[s++]=h,g[s++]=h+1;return g[s++]=l-1,g[s++]=0,new L.GeometryInstance({geometry:new v.Geometry({attributes:new G.GeometryAttributes({position:new v.GeometryAttribute({componentDatatype:A.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:n})}),indices:g,primitiveType:v.PrimitiveType.LINES})})}(t,a[l],f,o,n)).geometry.attributes.position.values=D.PolygonPipeline.scaleToGeodeticHeight(u.geometry.attributes.position.values,g,t,!o),m.defined(e._offsetAttribute)&&(p=u.geometry.attributes.position.values.length,p=new Uint8Array(p/3),d=e._offsetAttribute===b.GeometryOffsetAttribute.NONE?0:1,b.arrayFill(p,d),u.geometry.attributes.applyOffset=new v.GeometryAttribute({componentDatatype:A.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:p})),c.push(u);r=T.GeometryPipeline.combineInstances(c)[0],i=P.BoundingSphere.fromVertices(r.attributes.position.values);return new v.Geometry({attributes:r.attributes,indices:r.indices,primitiveType:r.primitiveType,boundingSphere:i,offsetAttribute:e._offsetAttribute})}},function(e,t){return(e=m.defined(t)?c.unpack(e,t):e)._ellipsoid=d.Ellipsoid.clone(e._ellipsoid),c.createGeometry(e)}});

@@ -1,1 +0,1 @@

define(["./when-ca391574","./Cartesian2-5b63e672","./ArcType-2b58731c","./arrayRemoveDuplicates-fc9e255d","./Transforms-5295b227","./Color-821fa62a","./ComponentDatatype-8f71e605","./Check-64f87f7d","./GeometryAttribute-7ef2d452","./GeometryAttributes-a356f820","./IndexDatatype-4e56bcfa","./Math-b53708b3","./PolylinePipeline-00f5e064","./VertexFormat-63b3c6da","./RuntimeError-19cb26ba","./WebGLConstants-95ceb4e9","./EllipsoidGeodesic-bbea0b0a","./EllipsoidRhumbLine-21029cef","./IntersectionTests-f5111308","./Plane-99b2becd"],function(Y,q,z,J,j,K,Q,e,X,Z,$,ee,te,y,t,r,a,o,n,i){"use strict";var re=[];function m(e){var t=(e=Y.defaultValue(e,Y.defaultValue.EMPTY_OBJECT)).positions,r=e.colors,a=Y.defaultValue(e.width,1),o=Y.defaultValue(e.colorsPerVertex,!1);this._positions=t,this._colors=r,this._width=a,this._colorsPerVertex=o,this._vertexFormat=y.VertexFormat.clone(Y.defaultValue(e.vertexFormat,y.VertexFormat.DEFAULT)),this._arcType=Y.defaultValue(e.arcType,z.ArcType.GEODESIC),this._granularity=Y.defaultValue(e.granularity,ee.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=q.Ellipsoid.clone(Y.defaultValue(e.ellipsoid,q.Ellipsoid.WGS84)),this._workerName="createPolylineGeometry";t=1+t.length*q.Cartesian3.packedLength;t+=Y.defined(r)?1+r.length*K.Color.packedLength:1,this.packedLength=t+q.Ellipsoid.packedLength+y.VertexFormat.packedLength+4}m.pack=function(e,t,r){var a;r=Y.defaultValue(r,0);var o=e._positions,n=o.length;for(t[r++]=n,a=0;a<n;++a,r+=q.Cartesian3.packedLength)q.Cartesian3.pack(o[a],t,r);var i=e._colors,n=Y.defined(i)?i.length:0;for(t[r++]=n,a=0;a<n;++a,r+=K.Color.packedLength)K.Color.pack(i[a],t,r);return q.Ellipsoid.pack(e._ellipsoid,t,r),r+=q.Ellipsoid.packedLength,y.VertexFormat.pack(e._vertexFormat,t,r),r+=y.VertexFormat.packedLength,t[r++]=e._width,t[r++]=e._colorsPerVertex?1:0,t[r++]=e._arcType,t[r]=e._granularity,t};var f=q.Ellipsoid.clone(q.Ellipsoid.UNIT_SPHERE),h=new y.VertexFormat,C={positions:void 0,colors:void 0,ellipsoid:f,vertexFormat:h,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};m.unpack=function(e,t,r){t=Y.defaultValue(t,0);for(var a=e[t++],o=new Array(a),n=0;n<a;++n,t+=q.Cartesian3.packedLength)o[n]=q.Cartesian3.unpack(e,t);var i=0<(a=e[t++])?new Array(a):void 0;for(n=0;n<a;++n,t+=K.Color.packedLength)i[n]=K.Color.unpack(e,t);var l=q.Ellipsoid.unpack(e,t,f);t+=q.Ellipsoid.packedLength;var s=y.VertexFormat.unpack(e,t,h);t+=y.VertexFormat.packedLength;var p=e[t++],c=1===e[t++],d=e[t++],u=e[t];return Y.defined(r)?(r._positions=o,r._colors=i,r._ellipsoid=q.Ellipsoid.clone(l,r._ellipsoid),r._vertexFormat=y.VertexFormat.clone(s,r._vertexFormat),r._width=p,r._colorsPerVertex=c,r._arcType=d,r._granularity=u,r):(C.positions=o,C.colors=i,C.width=p,C.colorsPerVertex=c,C.arcType=d,C.granularity=u,new m(C))};var ae=new q.Cartesian3,oe=new q.Cartesian3,ne=new q.Cartesian3,ie=new q.Cartesian3;return m.createGeometry=function(e){var t=e._width,r=e._vertexFormat,a=e._colors,o=e._colorsPerVertex,n=e._arcType,i=e._granularity,l=e._ellipsoid,s=J.arrayRemoveDuplicates(e._positions,q.Cartesian3.equalsEpsilon);if(!((E=s.length)<2||t<=0)){if(n===z.ArcType.GEODESIC||n===z.ArcType.RHUMB){var p,c=n===z.ArcType.GEODESIC?(p=ee.CesiumMath.chordLength(i,l.maximumRadius),te.PolylinePipeline.numberOfPoints):(p=i,te.PolylinePipeline.numberOfPointsRhumbLine),d=te.PolylinePipeline.extractHeights(s,l);if(Y.defined(a)){for(var u=1,y=0;y<E-1;++y)u+=c(s[y],s[y+1],p);var m=new Array(u),f=0;for(y=0;y<E-1;++y){var h=s[y],C=s[y+1],v=a[y],b=c(h,C,p);if(o&&y<u)for(var g=function(e,t,r){var a=re;a.length=r;var o=e.red,n=e.green,i=e.blue,l=e.alpha,s=t.red,p=t.green,c=t.blue,d=t.alpha;if(K.Color.equals(e,t)){for(h=0;h<r;h++)a[h]=K.Color.clone(e);return a}for(var u=(s-o)/r,y=(p-n)/r,m=(c-i)/r,f=(d-l)/r,h=0;h<r;h++)a[h]=new K.Color(o+h*u,n+h*y,i+h*m,l+h*f);return a}(v,a[y+1],b),_=g.length,A=0;A<_;++A)m[f++]=g[A];else for(A=0;A<b;++A)m[f++]=K.Color.clone(v)}m[f]=K.Color.clone(a[a.length-1]),a=m,re.length=0}s=n===z.ArcType.GEODESIC?te.PolylinePipeline.generateCartesianArc({positions:s,minDistance:p,ellipsoid:l,height:d}):te.PolylinePipeline.generateCartesianRhumbArc({positions:s,granularity:p,ellipsoid:l,height:d})}var E,P,w,T,l=4*(E=s.length)-4,x=new Float64Array(3*l),k=new Float64Array(3*l),D=new Float64Array(3*l),V=new Float32Array(2*l),L=r.st?new Float32Array(2*l):void 0,F=Y.defined(a)?new Uint8Array(4*l):void 0,G=0,O=0,R=0,I=0;for(A=0;A<E;++A){0===A?(P=ae,q.Cartesian3.subtract(s[0],s[1],P),q.Cartesian3.add(s[0],P,P)):P=s[A-1],q.Cartesian3.clone(P,ne),q.Cartesian3.clone(s[A],oe),A===E-1?(P=ae,q.Cartesian3.subtract(s[E-1],s[E-2],P),q.Cartesian3.add(s[E-1],P,P)):P=s[A+1],q.Cartesian3.clone(P,ie),Y.defined(F)&&(w=0===A||o?a[A]:a[A-1],A!==E-1&&(T=a[A]));for(var S=A===E-1?2:4,B=0===A?2:0;B<S;++B){q.Cartesian3.pack(oe,x,G),q.Cartesian3.pack(ne,k,G),q.Cartesian3.pack(ie,D,G),G+=3;var U=B-2<0?-1:1;V[O++]=B%2*2-1,V[O++]=U*t,r.st&&(L[R++]=A/(E-1),L[R++]=Math.max(V[O-2],0)),Y.defined(F)&&(U=B<2?w:T,F[I++]=K.Color.floatToByte(U.red),F[I++]=K.Color.floatToByte(U.green),F[I++]=K.Color.floatToByte(U.blue),F[I++]=K.Color.floatToByte(U.alpha))}}d=new Z.GeometryAttributes;d.position=new X.GeometryAttribute({componentDatatype:Q.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:x}),d.prevPosition=new X.GeometryAttribute({componentDatatype:Q.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:k}),d.nextPosition=new X.GeometryAttribute({componentDatatype:Q.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:D}),d.expandAndWidth=new X.GeometryAttribute({componentDatatype:Q.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:V}),r.st&&(d.st=new X.GeometryAttribute({componentDatatype:Q.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:L})),Y.defined(F)&&(d.color=new X.GeometryAttribute({componentDatatype:Q.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:4,values:F,normalize:!0}));var N=$.IndexDatatype.createTypedArray(l,6*E-6),M=0,H=0,W=E-1;for(A=0;A<W;++A)N[H++]=M,N[H++]=M+2,N[H++]=M+1,N[H++]=M+1,N[H++]=M+2,N[H++]=M+3,M+=4;return new X.Geometry({attributes:d,indices:N,primitiveType:X.PrimitiveType.TRIANGLES,boundingSphere:j.BoundingSphere.fromPoints(s),geometryType:X.GeometryType.POLYLINES})}},function(e,t){return(e=Y.defined(t)?m.unpack(e,t):e)._ellipsoid=q.Ellipsoid.clone(e._ellipsoid),m.createGeometry(e)}});
define(["./when-ca391574","./Cartesian2-5b63e672","./ArcType-2b58731c","./arrayRemoveDuplicates-fc9e255d","./Transforms-5295b227","./Color-821fa62a","./ComponentDatatype-8f71e605","./Check-64f87f7d","./GeometryAttribute-7ef2d452","./GeometryAttributes-a356f820","./IndexDatatype-4e56bcfa","./Math-b53708b3","./PolylinePipeline-12a23b58","./VertexFormat-63b3c6da","./RuntimeError-19cb26ba","./WebGLConstants-95ceb4e9","./EllipsoidGeodesic-bbea0b0a","./EllipsoidRhumbLine-6ee9af74","./IntersectionTests-f5111308","./Plane-99b2becd"],function(Y,q,z,J,j,K,Q,e,X,Z,$,ee,te,y,t,r,a,o,n,i){"use strict";var re=[];function m(e){var t=(e=Y.defaultValue(e,Y.defaultValue.EMPTY_OBJECT)).positions,r=e.colors,a=Y.defaultValue(e.width,1),o=Y.defaultValue(e.colorsPerVertex,!1);this._positions=t,this._colors=r,this._width=a,this._colorsPerVertex=o,this._vertexFormat=y.VertexFormat.clone(Y.defaultValue(e.vertexFormat,y.VertexFormat.DEFAULT)),this._arcType=Y.defaultValue(e.arcType,z.ArcType.GEODESIC),this._granularity=Y.defaultValue(e.granularity,ee.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=q.Ellipsoid.clone(Y.defaultValue(e.ellipsoid,q.Ellipsoid.WGS84)),this._workerName="createPolylineGeometry";t=1+t.length*q.Cartesian3.packedLength;t+=Y.defined(r)?1+r.length*K.Color.packedLength:1,this.packedLength=t+q.Ellipsoid.packedLength+y.VertexFormat.packedLength+4}m.pack=function(e,t,r){var a;r=Y.defaultValue(r,0);var o=e._positions,n=o.length;for(t[r++]=n,a=0;a<n;++a,r+=q.Cartesian3.packedLength)q.Cartesian3.pack(o[a],t,r);var i=e._colors,n=Y.defined(i)?i.length:0;for(t[r++]=n,a=0;a<n;++a,r+=K.Color.packedLength)K.Color.pack(i[a],t,r);return q.Ellipsoid.pack(e._ellipsoid,t,r),r+=q.Ellipsoid.packedLength,y.VertexFormat.pack(e._vertexFormat,t,r),r+=y.VertexFormat.packedLength,t[r++]=e._width,t[r++]=e._colorsPerVertex?1:0,t[r++]=e._arcType,t[r]=e._granularity,t};var f=q.Ellipsoid.clone(q.Ellipsoid.UNIT_SPHERE),h=new y.VertexFormat,C={positions:void 0,colors:void 0,ellipsoid:f,vertexFormat:h,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};m.unpack=function(e,t,r){t=Y.defaultValue(t,0);for(var a=e[t++],o=new Array(a),n=0;n<a;++n,t+=q.Cartesian3.packedLength)o[n]=q.Cartesian3.unpack(e,t);var i=0<(a=e[t++])?new Array(a):void 0;for(n=0;n<a;++n,t+=K.Color.packedLength)i[n]=K.Color.unpack(e,t);var l=q.Ellipsoid.unpack(e,t,f);t+=q.Ellipsoid.packedLength;var s=y.VertexFormat.unpack(e,t,h);t+=y.VertexFormat.packedLength;var p=e[t++],c=1===e[t++],d=e[t++],u=e[t];return Y.defined(r)?(r._positions=o,r._colors=i,r._ellipsoid=q.Ellipsoid.clone(l,r._ellipsoid),r._vertexFormat=y.VertexFormat.clone(s,r._vertexFormat),r._width=p,r._colorsPerVertex=c,r._arcType=d,r._granularity=u,r):(C.positions=o,C.colors=i,C.width=p,C.colorsPerVertex=c,C.arcType=d,C.granularity=u,new m(C))};var ae=new q.Cartesian3,oe=new q.Cartesian3,ne=new q.Cartesian3,ie=new q.Cartesian3;return m.createGeometry=function(e){var t=e._width,r=e._vertexFormat,a=e._colors,o=e._colorsPerVertex,n=e._arcType,i=e._granularity,l=e._ellipsoid,s=J.arrayRemoveDuplicates(e._positions,q.Cartesian3.equalsEpsilon);if(!((E=s.length)<2||t<=0)){if(n===z.ArcType.GEODESIC||n===z.ArcType.RHUMB){var p,c=n===z.ArcType.GEODESIC?(p=ee.CesiumMath.chordLength(i,l.maximumRadius),te.PolylinePipeline.numberOfPoints):(p=i,te.PolylinePipeline.numberOfPointsRhumbLine),d=te.PolylinePipeline.extractHeights(s,l);if(Y.defined(a)){for(var u=1,y=0;y<E-1;++y)u+=c(s[y],s[y+1],p);var m=new Array(u),f=0;for(y=0;y<E-1;++y){var h=s[y],C=s[y+1],v=a[y],b=c(h,C,p);if(o&&y<u)for(var g=function(e,t,r){var a=re;a.length=r;var o=e.red,n=e.green,i=e.blue,l=e.alpha,s=t.red,p=t.green,c=t.blue,d=t.alpha;if(K.Color.equals(e,t)){for(h=0;h<r;h++)a[h]=K.Color.clone(e);return a}for(var u=(s-o)/r,y=(p-n)/r,m=(c-i)/r,f=(d-l)/r,h=0;h<r;h++)a[h]=new K.Color(o+h*u,n+h*y,i+h*m,l+h*f);return a}(v,a[y+1],b),_=g.length,A=0;A<_;++A)m[f++]=g[A];else for(A=0;A<b;++A)m[f++]=K.Color.clone(v)}m[f]=K.Color.clone(a[a.length-1]),a=m,re.length=0}s=n===z.ArcType.GEODESIC?te.PolylinePipeline.generateCartesianArc({positions:s,minDistance:p,ellipsoid:l,height:d}):te.PolylinePipeline.generateCartesianRhumbArc({positions:s,granularity:p,ellipsoid:l,height:d})}var E,P,w,T,l=4*(E=s.length)-4,x=new Float64Array(3*l),k=new Float64Array(3*l),D=new Float64Array(3*l),V=new Float32Array(2*l),L=r.st?new Float32Array(2*l):void 0,F=Y.defined(a)?new Uint8Array(4*l):void 0,G=0,O=0,R=0,I=0;for(A=0;A<E;++A){0===A?(P=ae,q.Cartesian3.subtract(s[0],s[1],P),q.Cartesian3.add(s[0],P,P)):P=s[A-1],q.Cartesian3.clone(P,ne),q.Cartesian3.clone(s[A],oe),A===E-1?(P=ae,q.Cartesian3.subtract(s[E-1],s[E-2],P),q.Cartesian3.add(s[E-1],P,P)):P=s[A+1],q.Cartesian3.clone(P,ie),Y.defined(F)&&(w=0===A||o?a[A]:a[A-1],A!==E-1&&(T=a[A]));for(var S=A===E-1?2:4,B=0===A?2:0;B<S;++B){q.Cartesian3.pack(oe,x,G),q.Cartesian3.pack(ne,k,G),q.Cartesian3.pack(ie,D,G),G+=3;var U=B-2<0?-1:1;V[O++]=B%2*2-1,V[O++]=U*t,r.st&&(L[R++]=A/(E-1),L[R++]=Math.max(V[O-2],0)),Y.defined(F)&&(U=B<2?w:T,F[I++]=K.Color.floatToByte(U.red),F[I++]=K.Color.floatToByte(U.green),F[I++]=K.Color.floatToByte(U.blue),F[I++]=K.Color.floatToByte(U.alpha))}}d=new Z.GeometryAttributes;d.position=new X.GeometryAttribute({componentDatatype:Q.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:x}),d.prevPosition=new X.GeometryAttribute({componentDatatype:Q.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:k}),d.nextPosition=new X.GeometryAttribute({componentDatatype:Q.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:D}),d.expandAndWidth=new X.GeometryAttribute({componentDatatype:Q.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:V}),r.st&&(d.st=new X.GeometryAttribute({componentDatatype:Q.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:L})),Y.defined(F)&&(d.color=new X.GeometryAttribute({componentDatatype:Q.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:4,values:F,normalize:!0}));var N=$.IndexDatatype.createTypedArray(l,6*E-6),M=0,H=0,W=E-1;for(A=0;A<W;++A)N[H++]=M,N[H++]=M+2,N[H++]=M+1,N[H++]=M+1,N[H++]=M+2,N[H++]=M+3,M+=4;return new X.Geometry({attributes:d,indices:N,primitiveType:X.PrimitiveType.TRIANGLES,boundingSphere:j.BoundingSphere.fromPoints(s),geometryType:X.GeometryType.POLYLINES})}},function(e,t){return(e=Y.defined(t)?m.unpack(e,t):e)._ellipsoid=q.Ellipsoid.clone(e._ellipsoid),m.createGeometry(e)}});

@@ -1,1 +0,1 @@

define(["./when-ca391574","./Cartesian2-5b63e672","./arrayRemoveDuplicates-fc9e255d","./BoundingRectangle-755c152f","./Transforms-5295b227","./ComponentDatatype-8f71e605","./PolylineVolumeGeometryLibrary-ec280c2f","./Check-64f87f7d","./GeometryAttribute-7ef2d452","./GeometryAttributes-a356f820","./GeometryPipeline-a588d10d","./IndexDatatype-4e56bcfa","./Math-b53708b3","./PolygonPipeline-55053b0a","./VertexFormat-63b3c6da","./RuntimeError-19cb26ba","./WebGLConstants-95ceb4e9","./EllipsoidTangentPlane-0fb66b96","./IntersectionTests-f5111308","./Plane-99b2becd","./PolylinePipeline-00f5e064","./EllipsoidGeodesic-bbea0b0a","./EllipsoidRhumbLine-21029cef","./AttributeCompression-a99f24b9","./EncodedCartesian3-c36ced29"],function(c,u,r,a,G,A,o,e,R,D,I,O,i,S,g,t,n,l,s,p,d,y,m,h,f){"use strict";var b={};function B(e,t){c.defined(b[e])||(b[e]=!0,console.warn(c.defaultValue(t,e)))}function v(e){var t=(e=c.defaultValue(e,c.defaultValue.EMPTY_OBJECT)).polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=u.Ellipsoid.clone(c.defaultValue(e.ellipsoid,u.Ellipsoid.WGS84)),this._cornerType=c.defaultValue(e.cornerType,o.CornerType.ROUNDED),this._vertexFormat=g.VertexFormat.clone(c.defaultValue(e.vertexFormat,g.VertexFormat.DEFAULT)),this._granularity=c.defaultValue(e.granularity,i.CesiumMath.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";t=1+t.length*u.Cartesian3.packedLength;t+=1+n.length*u.Cartesian2.packedLength,this.packedLength=t+u.Ellipsoid.packedLength+g.VertexFormat.packedLength+2}B.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.",B.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",B.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",B.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored",v.pack=function(e,t,n){var i;n=c.defaultValue(n,0);var r=e._positions,a=r.length;for(t[n++]=a,i=0;i<a;++i,n+=u.Cartesian3.packedLength)u.Cartesian3.pack(r[i],t,n);var o=e._shape,a=o.length;for(t[n++]=a,i=0;i<a;++i,n+=u.Cartesian2.packedLength)u.Cartesian2.pack(o[i],t,n);return u.Ellipsoid.pack(e._ellipsoid,t,n),n+=u.Ellipsoid.packedLength,g.VertexFormat.pack(e._vertexFormat,t,n),n+=g.VertexFormat.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var E=u.Ellipsoid.clone(u.Ellipsoid.UNIT_SPHERE),P=new g.VertexFormat,_={polylinePositions:void 0,shapePositions:void 0,ellipsoid:E,vertexFormat:P,cornerType:void 0,granularity:void 0};v.unpack=function(e,t,n){t=c.defaultValue(t,0);for(var i=e[t++],r=new Array(i),a=0;a<i;++a,t+=u.Cartesian3.packedLength)r[a]=u.Cartesian3.unpack(e,t);var i=e[t++],o=new Array(i);for(a=0;a<i;++a,t+=u.Cartesian2.packedLength)o[a]=u.Cartesian2.unpack(e,t);var l=u.Ellipsoid.unpack(e,t,E);t+=u.Ellipsoid.packedLength;var s=g.VertexFormat.unpack(e,t,P);t+=g.VertexFormat.packedLength;var p=e[t++],d=e[t];return c.defined(n)?(n._positions=r,n._shape=o,n._ellipsoid=u.Ellipsoid.clone(l,n._ellipsoid),n._vertexFormat=g.VertexFormat.clone(s,n._vertexFormat),n._cornerType=p,n._granularity=d,n):(_.polylinePositions=r,_.shapePositions=o,_.cornerType=p,_.granularity=d,new v(_))};var x=new a.BoundingRectangle;return v.createGeometry=function(e){var t=e._positions,n=r.arrayRemoveDuplicates(t,u.Cartesian3.equalsEpsilon),i=e._shape,i=o.PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(i);if(!(n.length<2||i.length<3)){S.PolygonPipeline.computeWindingOrder2D(i)===S.WindingOrder.CLOCKWISE&&i.reverse();t=a.BoundingRectangle.fromPoints(i,x);return function(e,t,n,i){var r=new D.GeometryAttributes;i.position&&(r.position=new R.GeometryAttribute({componentDatatype:A.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}));var a,o,l,s,p,d=t.length,c=e.length/3,u=(c-2*d)/(2*d),g=S.PolygonPipeline.triangulate(t),y=(u-1)*d*6+2*g.length,m=O.IndexDatatype.createTypedArray(c,y),h=2*d,f=0;for(C=0;C<u-1;C++){for(a=0;a<d-1;a++)p=(o=2*a+C*d*2)+h,s=(l=o+1)+h,m[f++]=l,m[f++]=o,m[f++]=s,m[f++]=s,m[f++]=o,m[f++]=p;s=(l=(o=2*d-2+C*d*2)+1)+h,p=o+h,m[f++]=l,m[f++]=o,m[f++]=s,m[f++]=s,m[f++]=o,m[f++]=p}if(i.st||i.tangent||i.bitangent){for(var b,v,E=new Float32Array(2*c),P=1/(u-1),_=1/n.height,x=n.height/2,k=0,C=0;C<u;C++){for(b=C*P,v=_*(t[0].y+x),E[k++]=b,E[k++]=v,a=1;a<d;a++)v=_*(t[a].y+x),E[k++]=b,E[k++]=v,E[k++]=b,E[k++]=v;v=_*(t[0].y+x),E[k++]=b,E[k++]=v}for(a=0;a<d;a++)b=0,v=_*(t[a].y+x),E[k++]=b,E[k++]=v;for(a=0;a<d;a++)b=(u-1)*P,v=_*(t[a].y+x),E[k++]=b,E[k++]=v;r.st=new R.GeometryAttribute({componentDatatype:A.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(E)})}var V=c-2*d;for(C=0;C<g.length;C+=3){var L=g[C]+V,w=g[C+1]+V,F=g[C+2]+V;m[f++]=L,m[f++]=w,m[f++]=F,m[f++]=F+d,m[f++]=w+d,m[f++]=L+d}var T=new R.Geometry({attributes:r,indices:m,boundingSphere:G.BoundingSphere.fromVertices(e),primitiveType:R.PrimitiveType.TRIANGLES});if(i.normal&&(T=I.GeometryPipeline.computeNormal(T)),i.tangent||i.bitangent){try{T=I.GeometryPipeline.computeTangentAndBitangent(T)}catch(e){B("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(T.attributes.tangent=void 0),i.bitangent||(T.attributes.bitangent=void 0),i.st||(T.attributes.st=void 0)}return T}(o.PolylineVolumeGeometryLibrary.computePositions(n,i,t,e,!0),i,t,e._vertexFormat)}},function(e,t){return(e=c.defined(t)?v.unpack(e,t):e)._ellipsoid=u.Ellipsoid.clone(e._ellipsoid),v.createGeometry(e)}});
define(["./when-ca391574","./Cartesian2-5b63e672","./arrayRemoveDuplicates-fc9e255d","./BoundingRectangle-755c152f","./Transforms-5295b227","./ComponentDatatype-8f71e605","./PolylineVolumeGeometryLibrary-62de9881","./Check-64f87f7d","./GeometryAttribute-7ef2d452","./GeometryAttributes-a356f820","./GeometryPipeline-a588d10d","./IndexDatatype-4e56bcfa","./Math-b53708b3","./PolygonPipeline-ff4431d7","./VertexFormat-63b3c6da","./RuntimeError-19cb26ba","./WebGLConstants-95ceb4e9","./EllipsoidTangentPlane-0fb66b96","./IntersectionTests-f5111308","./Plane-99b2becd","./PolylinePipeline-12a23b58","./EllipsoidGeodesic-bbea0b0a","./EllipsoidRhumbLine-6ee9af74","./AttributeCompression-a99f24b9","./EncodedCartesian3-c36ced29"],function(u,c,r,a,G,A,o,e,R,D,I,O,i,S,g,t,n,l,s,p,d,y,m,h,f){"use strict";var b={};function B(e,t){u.defined(b[e])||(b[e]=!0,console.warn(u.defaultValue(t,e)))}function v(e){var t=(e=u.defaultValue(e,u.defaultValue.EMPTY_OBJECT)).polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=c.Ellipsoid.clone(u.defaultValue(e.ellipsoid,c.Ellipsoid.WGS84)),this._cornerType=u.defaultValue(e.cornerType,o.CornerType.ROUNDED),this._vertexFormat=g.VertexFormat.clone(u.defaultValue(e.vertexFormat,g.VertexFormat.DEFAULT)),this._granularity=u.defaultValue(e.granularity,i.CesiumMath.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";t=1+t.length*c.Cartesian3.packedLength;t+=1+n.length*c.Cartesian2.packedLength,this.packedLength=t+c.Ellipsoid.packedLength+g.VertexFormat.packedLength+2}B.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.",B.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",B.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",B.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored",v.pack=function(e,t,n){var i;n=u.defaultValue(n,0);var r=e._positions,a=r.length;for(t[n++]=a,i=0;i<a;++i,n+=c.Cartesian3.packedLength)c.Cartesian3.pack(r[i],t,n);var o=e._shape,a=o.length;for(t[n++]=a,i=0;i<a;++i,n+=c.Cartesian2.packedLength)c.Cartesian2.pack(o[i],t,n);return c.Ellipsoid.pack(e._ellipsoid,t,n),n+=c.Ellipsoid.packedLength,g.VertexFormat.pack(e._vertexFormat,t,n),n+=g.VertexFormat.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var E=c.Ellipsoid.clone(c.Ellipsoid.UNIT_SPHERE),P=new g.VertexFormat,_={polylinePositions:void 0,shapePositions:void 0,ellipsoid:E,vertexFormat:P,cornerType:void 0,granularity:void 0};v.unpack=function(e,t,n){t=u.defaultValue(t,0);for(var i=e[t++],r=new Array(i),a=0;a<i;++a,t+=c.Cartesian3.packedLength)r[a]=c.Cartesian3.unpack(e,t);var i=e[t++],o=new Array(i);for(a=0;a<i;++a,t+=c.Cartesian2.packedLength)o[a]=c.Cartesian2.unpack(e,t);var l=c.Ellipsoid.unpack(e,t,E);t+=c.Ellipsoid.packedLength;var s=g.VertexFormat.unpack(e,t,P);t+=g.VertexFormat.packedLength;var p=e[t++],d=e[t];return u.defined(n)?(n._positions=r,n._shape=o,n._ellipsoid=c.Ellipsoid.clone(l,n._ellipsoid),n._vertexFormat=g.VertexFormat.clone(s,n._vertexFormat),n._cornerType=p,n._granularity=d,n):(_.polylinePositions=r,_.shapePositions=o,_.cornerType=p,_.granularity=d,new v(_))};var x=new a.BoundingRectangle;return v.createGeometry=function(e){var t=e._positions,n=r.arrayRemoveDuplicates(t,c.Cartesian3.equalsEpsilon),i=e._shape,i=o.PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(i);if(!(n.length<2||i.length<3)){S.PolygonPipeline.computeWindingOrder2D(i)===S.WindingOrder.CLOCKWISE&&i.reverse();t=a.BoundingRectangle.fromPoints(i,x);return function(e,t,n,i){var r=new D.GeometryAttributes;i.position&&(r.position=new R.GeometryAttribute({componentDatatype:A.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}));var a,o,l,s,p,d=t.length,u=e.length/3,c=(u-2*d)/(2*d),g=S.PolygonPipeline.triangulate(t),y=(c-1)*d*6+2*g.length,m=O.IndexDatatype.createTypedArray(u,y),h=2*d,f=0;for(C=0;C<c-1;C++){for(a=0;a<d-1;a++)p=(o=2*a+C*d*2)+h,s=(l=o+1)+h,m[f++]=l,m[f++]=o,m[f++]=s,m[f++]=s,m[f++]=o,m[f++]=p;s=(l=(o=2*d-2+C*d*2)+1)+h,p=o+h,m[f++]=l,m[f++]=o,m[f++]=s,m[f++]=s,m[f++]=o,m[f++]=p}if(i.st||i.tangent||i.bitangent){for(var b,v,E=new Float32Array(2*u),P=1/(c-1),_=1/n.height,x=n.height/2,k=0,C=0;C<c;C++){for(b=C*P,v=_*(t[0].y+x),E[k++]=b,E[k++]=v,a=1;a<d;a++)v=_*(t[a].y+x),E[k++]=b,E[k++]=v,E[k++]=b,E[k++]=v;v=_*(t[0].y+x),E[k++]=b,E[k++]=v}for(a=0;a<d;a++)b=0,v=_*(t[a].y+x),E[k++]=b,E[k++]=v;for(a=0;a<d;a++)b=(c-1)*P,v=_*(t[a].y+x),E[k++]=b,E[k++]=v;r.st=new R.GeometryAttribute({componentDatatype:A.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(E)})}var V=u-2*d;for(C=0;C<g.length;C+=3){var L=g[C]+V,w=g[C+1]+V,F=g[C+2]+V;m[f++]=L,m[f++]=w,m[f++]=F,m[f++]=F+d,m[f++]=w+d,m[f++]=L+d}var T=new R.Geometry({attributes:r,indices:m,boundingSphere:G.BoundingSphere.fromVertices(e),primitiveType:R.PrimitiveType.TRIANGLES});if(i.normal&&(T=I.GeometryPipeline.computeNormal(T)),i.tangent||i.bitangent){try{T=I.GeometryPipeline.computeTangentAndBitangent(T)}catch(e){B("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(T.attributes.tangent=void 0),i.bitangent||(T.attributes.bitangent=void 0),i.st||(T.attributes.st=void 0)}return T}(o.PolylineVolumeGeometryLibrary.computePositions(n,i,t,e,!0),i,t,e._vertexFormat)}},function(e,t){return(e=u.defined(t)?v.unpack(e,t):e)._ellipsoid=c.Ellipsoid.clone(e._ellipsoid),v.createGeometry(e)}});

@@ -1,1 +0,1 @@

define(["./when-ca391574","./Cartesian2-5b63e672","./arrayRemoveDuplicates-fc9e255d","./BoundingRectangle-755c152f","./Transforms-5295b227","./ComponentDatatype-8f71e605","./PolylineVolumeGeometryLibrary-ec280c2f","./Check-64f87f7d","./GeometryAttribute-7ef2d452","./GeometryAttributes-a356f820","./IndexDatatype-4e56bcfa","./Math-b53708b3","./PolygonPipeline-55053b0a","./RuntimeError-19cb26ba","./WebGLConstants-95ceb4e9","./EllipsoidTangentPlane-0fb66b96","./IntersectionTests-f5111308","./Plane-99b2becd","./PolylinePipeline-00f5e064","./EllipsoidGeodesic-bbea0b0a","./EllipsoidRhumbLine-21029cef"],function(d,c,a,r,u,y,o,e,h,f,g,t,l,i,n,s,p,m,b,E,v){"use strict";function P(e){var i=(e=d.defaultValue(e,d.defaultValue.EMPTY_OBJECT)).polylinePositions,n=e.shapePositions;this._positions=i,this._shape=n,this._ellipsoid=c.Ellipsoid.clone(d.defaultValue(e.ellipsoid,c.Ellipsoid.WGS84)),this._cornerType=d.defaultValue(e.cornerType,o.CornerType.ROUNDED),this._granularity=d.defaultValue(e.granularity,t.CesiumMath.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";i=1+i.length*c.Cartesian3.packedLength;i+=1+n.length*c.Cartesian2.packedLength,this.packedLength=i+c.Ellipsoid.packedLength+2}P.pack=function(e,i,n){var t;n=d.defaultValue(n,0);var a=e._positions,r=a.length;for(i[n++]=r,t=0;t<r;++t,n+=c.Cartesian3.packedLength)c.Cartesian3.pack(a[t],i,n);var o=e._shape,r=o.length;for(i[n++]=r,t=0;t<r;++t,n+=c.Cartesian2.packedLength)c.Cartesian2.pack(o[t],i,n);return c.Ellipsoid.pack(e._ellipsoid,i,n),n+=c.Ellipsoid.packedLength,i[n++]=e._cornerType,i[n]=e._granularity,i};var _=c.Ellipsoid.clone(c.Ellipsoid.UNIT_SPHERE),k={polylinePositions:void 0,shapePositions:void 0,ellipsoid:_,height:void 0,cornerType:void 0,granularity:void 0};P.unpack=function(e,i,n){i=d.defaultValue(i,0);for(var t=e[i++],a=new Array(t),r=0;r<t;++r,i+=c.Cartesian3.packedLength)a[r]=c.Cartesian3.unpack(e,i);var t=e[i++],o=new Array(t);for(r=0;r<t;++r,i+=c.Cartesian2.packedLength)o[r]=c.Cartesian2.unpack(e,i);var l=c.Ellipsoid.unpack(e,i,_);i+=c.Ellipsoid.packedLength;var s=e[i++],p=e[i];return d.defined(n)?(n._positions=a,n._shape=o,n._ellipsoid=c.Ellipsoid.clone(l,n._ellipsoid),n._cornerType=s,n._granularity=p,n):(k.polylinePositions=a,k.shapePositions=o,k.cornerType=s,k.granularity=p,new P(k))};var C=new r.BoundingRectangle;return P.createGeometry=function(e){var i=e._positions,n=a.arrayRemoveDuplicates(i,c.Cartesian3.equalsEpsilon),t=e._shape,t=o.PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(t);if(!(n.length<2||t.length<3)){l.PolygonPipeline.computeWindingOrder2D(t)===l.WindingOrder.CLOCKWISE&&t.reverse();i=r.BoundingRectangle.fromPoints(t,C);return function(e,i){var n=new f.GeometryAttributes;n.position=new h.GeometryAttribute({componentDatatype:y.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e});var t=i.length,i=n.position.values.length/3,a=e.length/3/t,r=g.IndexDatatype.createTypedArray(i,2*t*(1+a)),o=0,l=0,s=l*t;for(c=0;c<t-1;c++)r[o++]=c+s,r[o++]=c+s+1;for(r[o++]=t-1+s,r[o++]=s,s=(l=a-1)*t,c=0;c<t-1;c++)r[o++]=c+s,r[o++]=c+s+1;for(r[o++]=t-1+s,r[o++]=s,l=0;l<a-1;l++)for(var p=t*l,d=p+t,c=0;c<t;c++)r[o++]=c+p,r[o++]=c+d;return new h.Geometry({attributes:n,indices:g.IndexDatatype.createTypedArray(i,r),boundingSphere:u.BoundingSphere.fromVertices(e),primitiveType:h.PrimitiveType.LINES})}(o.PolylineVolumeGeometryLibrary.computePositions(n,t,i,e,!1),t)}},function(e,i){return(e=d.defined(i)?P.unpack(e,i):e)._ellipsoid=c.Ellipsoid.clone(e._ellipsoid),P.createGeometry(e)}});
define(["./when-ca391574","./Cartesian2-5b63e672","./arrayRemoveDuplicates-fc9e255d","./BoundingRectangle-755c152f","./Transforms-5295b227","./ComponentDatatype-8f71e605","./PolylineVolumeGeometryLibrary-62de9881","./Check-64f87f7d","./GeometryAttribute-7ef2d452","./GeometryAttributes-a356f820","./IndexDatatype-4e56bcfa","./Math-b53708b3","./PolygonPipeline-ff4431d7","./RuntimeError-19cb26ba","./WebGLConstants-95ceb4e9","./EllipsoidTangentPlane-0fb66b96","./IntersectionTests-f5111308","./Plane-99b2becd","./PolylinePipeline-12a23b58","./EllipsoidGeodesic-bbea0b0a","./EllipsoidRhumbLine-6ee9af74"],function(d,u,a,r,c,y,o,e,h,f,g,t,l,i,n,s,p,m,b,E,v){"use strict";function P(e){var i=(e=d.defaultValue(e,d.defaultValue.EMPTY_OBJECT)).polylinePositions,n=e.shapePositions;this._positions=i,this._shape=n,this._ellipsoid=u.Ellipsoid.clone(d.defaultValue(e.ellipsoid,u.Ellipsoid.WGS84)),this._cornerType=d.defaultValue(e.cornerType,o.CornerType.ROUNDED),this._granularity=d.defaultValue(e.granularity,t.CesiumMath.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";i=1+i.length*u.Cartesian3.packedLength;i+=1+n.length*u.Cartesian2.packedLength,this.packedLength=i+u.Ellipsoid.packedLength+2}P.pack=function(e,i,n){var t;n=d.defaultValue(n,0);var a=e._positions,r=a.length;for(i[n++]=r,t=0;t<r;++t,n+=u.Cartesian3.packedLength)u.Cartesian3.pack(a[t],i,n);var o=e._shape,r=o.length;for(i[n++]=r,t=0;t<r;++t,n+=u.Cartesian2.packedLength)u.Cartesian2.pack(o[t],i,n);return u.Ellipsoid.pack(e._ellipsoid,i,n),n+=u.Ellipsoid.packedLength,i[n++]=e._cornerType,i[n]=e._granularity,i};var _=u.Ellipsoid.clone(u.Ellipsoid.UNIT_SPHERE),k={polylinePositions:void 0,shapePositions:void 0,ellipsoid:_,height:void 0,cornerType:void 0,granularity:void 0};P.unpack=function(e,i,n){i=d.defaultValue(i,0);for(var t=e[i++],a=new Array(t),r=0;r<t;++r,i+=u.Cartesian3.packedLength)a[r]=u.Cartesian3.unpack(e,i);var t=e[i++],o=new Array(t);for(r=0;r<t;++r,i+=u.Cartesian2.packedLength)o[r]=u.Cartesian2.unpack(e,i);var l=u.Ellipsoid.unpack(e,i,_);i+=u.Ellipsoid.packedLength;var s=e[i++],p=e[i];return d.defined(n)?(n._positions=a,n._shape=o,n._ellipsoid=u.Ellipsoid.clone(l,n._ellipsoid),n._cornerType=s,n._granularity=p,n):(k.polylinePositions=a,k.shapePositions=o,k.cornerType=s,k.granularity=p,new P(k))};var C=new r.BoundingRectangle;return P.createGeometry=function(e){var i=e._positions,n=a.arrayRemoveDuplicates(i,u.Cartesian3.equalsEpsilon),t=e._shape,t=o.PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(t);if(!(n.length<2||t.length<3)){l.PolygonPipeline.computeWindingOrder2D(t)===l.WindingOrder.CLOCKWISE&&t.reverse();i=r.BoundingRectangle.fromPoints(t,C);return function(e,i){var n=new f.GeometryAttributes;n.position=new h.GeometryAttribute({componentDatatype:y.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e});var t=i.length,i=n.position.values.length/3,a=e.length/3/t,r=g.IndexDatatype.createTypedArray(i,2*t*(1+a)),o=0,l=0,s=l*t;for(u=0;u<t-1;u++)r[o++]=u+s,r[o++]=u+s+1;for(r[o++]=t-1+s,r[o++]=s,s=(l=a-1)*t,u=0;u<t-1;u++)r[o++]=u+s,r[o++]=u+s+1;for(r[o++]=t-1+s,r[o++]=s,l=0;l<a-1;l++)for(var p=t*l,d=p+t,u=0;u<t;u++)r[o++]=u+p,r[o++]=u+d;return new h.Geometry({attributes:n,indices:g.IndexDatatype.createTypedArray(i,r),boundingSphere:c.BoundingSphere.fromVertices(e),primitiveType:h.PrimitiveType.LINES})}(o.PolylineVolumeGeometryLibrary.computePositions(n,t,i,e,!1),t)}},function(e,i){return(e=d.defined(i)?P.unpack(e,i):e)._ellipsoid=u.Ellipsoid.clone(e._ellipsoid),P.createGeometry(e)}});

@@ -1,1 +0,1 @@

define(["./when-ca391574","./Cartesian2-5b63e672","./GeometryOffsetAttribute-b94750ca","./Transforms-5295b227","./Check-64f87f7d","./ComponentDatatype-8f71e605","./GeometryAttribute-7ef2d452","./GeometryAttributes-a356f820","./GeometryInstance-d18842cb","./GeometryPipeline-a588d10d","./IndexDatatype-4e56bcfa","./Math-b53708b3","./PolygonPipeline-55053b0a","./RectangleGeometryLibrary-8c98c500","./VertexFormat-63b3c6da","./RuntimeError-19cb26ba","./WebGLConstants-95ceb4e9","./AttributeCompression-a99f24b9","./EncodedCartesian3-c36ced29","./IntersectionTests-f5111308","./Plane-99b2becd","./EllipsoidRhumbLine-21029cef"],function(Q,W,J,N,t,j,Z,r,K,$,tt,et,at,S,rt,e,a,n,i,o,s,l){"use strict";var nt=new W.Cartesian3,it=new W.Cartesian3,ot=new W.Cartesian3,st=new W.Cartesian3,p=new W.Rectangle,I=new W.Cartesian2,d=new N.BoundingSphere,g=new N.BoundingSphere;function lt(t,e){var a=new Z.Geometry({attributes:new r.GeometryAttributes,primitiveType:Z.PrimitiveType.TRIANGLES});return a.attributes.position=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e.positions}),t.normal&&(a.attributes.normal=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.normals})),t.tangent&&(a.attributes.tangent=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.tangents})),t.bitangent&&(a.attributes.bitangent=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.bitangents})),a}var ut=new W.Cartesian3,ct=new W.Cartesian3;function mt(t,e){var a=t._vertexFormat,r=t._ellipsoid,n=e.height,i=e.width,o=e.northCap,s=e.southCap,l=0,u=n,c=n,t=0;o&&(--c,t+=l=1),s&&(--u,--c,t+=1),t+=i*c;for(var m=a.position?new Float64Array(3*t):void 0,p=a.st?new Float32Array(2*t):void 0,d=0,g=0,y=nt,f=I,h=Number.MAX_VALUE,b=Number.MAX_VALUE,v=-Number.MAX_VALUE,_=-Number.MAX_VALUE,A=l;A<u;++A)for(var x=0;x<i;++x)S.RectangleGeometryLibrary.computePosition(e,r,a.st,A,x,y,f),m[d++]=y.x,m[d++]=y.y,m[d++]=y.z,a.st&&(p[g++]=f.x,p[g++]=f.y,h=Math.min(h,f.x),b=Math.min(b,f.y),v=Math.max(v,f.x),_=Math.max(_,f.y));if(o&&(S.RectangleGeometryLibrary.computePosition(e,r,a.st,0,0,y,f),m[d++]=y.x,m[d++]=y.y,m[d++]=y.z,a.st&&(p[g++]=f.x,p[g++]=f.y,h=f.x,b=f.y,v=f.x,_=f.y)),s&&(S.RectangleGeometryLibrary.computePosition(e,r,a.st,n-1,0,y,f),m[d++]=y.x,m[d++]=y.y,m[d]=y.z,a.st&&(p[g++]=f.x,p[g]=f.y,h=Math.min(h,f.x),b=Math.min(b,f.y),v=Math.max(v,f.x),_=Math.max(_,f.y))),a.st&&(h<0||b<0||1<v||1<_))for(var w=0;w<p.length;w+=2)p[w]=(p[w]-h)/(v-h),p[w+1]=(p[w+1]-b)/(_-b);l=function(t,e,a,r){var n=t.length,i=e.normal?new Float32Array(n):void 0,o=e.tangent?new Float32Array(n):void 0,s=e.bitangent?new Float32Array(n):void 0,l=0,u=st,c=ot,m=it;if(e.normal||e.tangent||e.bitangent)for(var p=0;p<n;p+=3){var d=W.Cartesian3.fromArray(t,p,nt),g=l+1,y=l+2,m=a.geodeticSurfaceNormal(d,m);(e.tangent||e.bitangent)&&(W.Cartesian3.cross(W.Cartesian3.UNIT_Z,m,c),N.Matrix3.multiplyByVector(r,c,c),W.Cartesian3.normalize(c,c),e.bitangent&&W.Cartesian3.normalize(W.Cartesian3.cross(m,c,u),u)),e.normal&&(i[l]=m.x,i[g]=m.y,i[y]=m.z),e.tangent&&(o[l]=c.x,o[g]=c.y,o[y]=c.z),e.bitangent&&(s[l]=u.x,s[g]=u.y,s[y]=u.z),l+=3}return lt(e,{positions:t,normals:i,tangents:o,bitangents:s})}(m,a,r,e.tangentRotationMatrix),n=6*(i-1)*(c-1);o&&(n+=3*(i-1)),s&&(n+=3*(i-1));for(var C=tt.IndexDatatype.createTypedArray(t,n),R=0,E=0,F=0;F<c-1;++F){for(var G=0;G<i-1;++G){var P=R+i,V=P+1,L=R+1;C[E++]=R,C[E++]=P,C[E++]=L,C[E++]=L,C[E++]=P,C[E++]=V,++R}++R}if(o||s){var D,M,T=t-1,O=t-1;if(o&&s&&(T=t-2),R=0,o)for(F=0;F<i-1;F++)M=(D=R)+1,C[E++]=T,C[E++]=D,C[E++]=M,++R;if(s)for(R=(c-1)*i,F=0;F<i-1;F++)M=(D=R)+1,C[E++]=D,C[E++]=O,C[E++]=M,++R}return l.indices=C,a.st&&(l.attributes.st=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:p})),l}function pt(t,e,a,r,n){return t[e++]=r[a],t[e++]=r[a+1],t[e++]=r[a+2],t[e++]=n[a],t[e++]=n[a+1],t[e]=n[a+2],t}function dt(t,e,a,r){return t[e++]=r[a],t[e++]=r[a+1],t[e++]=r[a],t[e]=r[a+1],t}var gt=new rt.VertexFormat;function y(t,e){var a=t._shadowVolume,r=t._offsetAttribute,n=t._vertexFormat,i=t._extrudedHeight,o=t._surfaceHeight,s=t._ellipsoid,l=e.height,u=e.width;a&&((b=rt.VertexFormat.clone(n,gt)).normal=!0,t._vertexFormat=b);var c=mt(t,e);a&&(t._vertexFormat=n);var m=at.PolygonPipeline.scaleToGeodeticHeight(c.attributes.position.values,o,s,!1),p=2*(z=(m=new Float64Array(m)).length),d=new Float64Array(p);d.set(m);var g=at.PolygonPipeline.scaleToGeodeticHeight(c.attributes.position.values,i,s);d.set(g,z),c.attributes.position.values=d;var y,f,h,b=n.normal?new Float32Array(p):void 0,t=n.tangent?new Float32Array(p):void 0,o=n.bitangent?new Float32Array(p):void 0,i=n.st?new Float32Array(p/3*2):void 0;if(n.normal){for(f=c.attributes.normal.values,b.set(f),_=0;_<z;_++)f[_]=-f[_];b.set(f,z),c.attributes.normal.values=b}if(a){f=c.attributes.normal.values,n.normal||(c.attributes.normal=void 0);for(var v=new Float32Array(p),_=0;_<z;_++)f[_]=-f[_];v.set(f,z),c.attributes.extrudeDirection=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:v})}d=Q.defined(r);if(d&&(b=z/3*2,v=new Uint8Array(b),v=r===J.GeometryOffsetAttribute.TOP?J.arrayFill(v,1,0,b/2):(h=r===J.GeometryOffsetAttribute.NONE?0:1,J.arrayFill(v,h)),c.attributes.applyOffset=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:v})),n.tangent){var A=c.attributes.tangent.values;for(t.set(A),_=0;_<z;_++)A[_]=-A[_];t.set(A,z),c.attributes.tangent.values=t}n.bitangent&&(E=c.attributes.bitangent.values,o.set(E),o.set(E,z),c.attributes.bitangent.values=o),n.st&&(y=c.attributes.st.values,i.set(y),i.set(y,z/3*2),c.attributes.st.values=i);var x=c.indices,w=x.length,C=z/3,R=tt.IndexDatatype.createTypedArray(p/3,2*w);for(R.set(x),_=0;_<w;_+=3)R[_+w]=x[_+2]+C,R[_+1+w]=x[_+1]+C,R[_+2+w]=x[_]+C;c.indices=R;var t=e.northCap,E=e.southCap,o=l,i=2,p=0,e=4,l=4;t&&(--i,--o,p+=1,e-=2,--l),E&&(--i,--o,p+=1,e-=2,--l);var l=2*((p+=i*u+2*o-e)+l),F=new Float64Array(3*l),G=a?new Float32Array(3*l):void 0,P=d?new Uint8Array(l):void 0,V=n.st?new Float32Array(2*l):void 0,L=r===J.GeometryOffsetAttribute.TOP;d&&!L&&(h=r===J.GeometryOffsetAttribute.ALL?1:0,P=J.arrayFill(P,h));var D=0,M=0,T=0,O=0,N=u*o;for(_=0;_<N;_+=u)F=pt(F,D,I=3*_,m,g),D+=6,n.st&&(V=dt(V,M,2*_,y),M+=4),a&&(T+=3,G[T++]=f[I],G[T++]=f[I+1],G[T++]=f[I+2]),L&&(P[O++]=1,O+=1);if(E){var S=t?1+N:N,I=3*S;for(_=0;_<2;_++)F=pt(F,D,I,m,g),D+=6,n.st&&(V=dt(V,M,2*S,y),M+=4),a&&(T+=3,G[T++]=f[I],G[T++]=f[I+1],G[T++]=f[I+2]),L&&(P[O++]=1,O+=1)}else for(_=N-u;_<N;_++)F=pt(F,D,I=3*_,m,g),D+=6,n.st&&(V=dt(V,M,2*_,y),M+=4),a&&(T+=3,G[T++]=f[I],G[T++]=f[I+1],G[T++]=f[I+2]),L&&(P[O++]=1,O+=1);for(_=N-1;0<_;_-=u)F=pt(F,D,I=3*_,m,g),D+=6,n.st&&(V=dt(V,M,2*_,y),M+=4),a&&(T+=3,G[T++]=f[I],G[T++]=f[I+1],G[T++]=f[I+2]),L&&(P[O++]=1,O+=1);if(t){var k=N;for(I=3*k,_=0;_<2;_++)F=pt(F,D,I,m,g),D+=6,n.st&&(V=dt(V,M,2*k,y),M+=4),a&&(T+=3,G[T++]=f[I],G[T++]=f[I+1],G[T++]=f[I+2]),L&&(P[O++]=1,O+=1)}else for(_=u-1;0<=_;_--)F=pt(F,D,I=3*_,m,g),D+=6,n.st&&(V=dt(V,M,2*_,y),M+=4),a&&(T+=3,G[T++]=f[I],G[T++]=f[I+1],G[T++]=f[I+2]),L&&(P[O++]=1,O+=1);s=function(t,e,a){var r=t.length,n=e.normal?new Float32Array(r):void 0,i=e.tangent?new Float32Array(r):void 0,o=e.bitangent?new Float32Array(r):void 0,s=0,l=0,u=0,c=!0,m=st,p=ot,d=it;if(e.normal||e.tangent||e.bitangent)for(var g=0;g<r;g+=6){var y,f=W.Cartesian3.fromArray(t,g,nt),h=W.Cartesian3.fromArray(t,(g+6)%r,ut);c&&(y=W.Cartesian3.fromArray(t,(g+3)%r,ct),W.Cartesian3.subtract(h,f,h),W.Cartesian3.subtract(y,f,y),d=W.Cartesian3.normalize(W.Cartesian3.cross(y,h,d),d),c=!1),W.Cartesian3.equalsEpsilon(h,f,et.CesiumMath.EPSILON10)&&(c=!0),(e.tangent||e.bitangent)&&(m=a.geodeticSurfaceNormal(f,m),e.tangent&&(p=W.Cartesian3.normalize(W.Cartesian3.cross(m,d,p),p))),e.normal&&(n[s++]=d.x,n[s++]=d.y,n[s++]=d.z,n[s++]=d.x,n[s++]=d.y,n[s++]=d.z),e.tangent&&(i[l++]=p.x,i[l++]=p.y,i[l++]=p.z,i[l++]=p.x,i[l++]=p.y,i[l++]=p.z),e.bitangent&&(o[u++]=m.x,o[u++]=m.y,o[u++]=m.z,o[u++]=m.x,o[u++]=m.y,o[u++]=m.z)}return lt(e,{positions:t,normals:n,tangents:i,bitangents:o})}(F,n,s);n.st&&(s.attributes.st=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:V})),a&&(s.attributes.extrudeDirection=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:G})),d&&(s.attributes.applyOffset=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:P}));var H=tt.IndexDatatype.createTypedArray(l,6*p),z=F.length/3,B=0;for(_=0;_<z-1;_+=2){var U,Y=((U=_)+2)%z,q=W.Cartesian3.fromArray(F,3*U,ut),X=W.Cartesian3.fromArray(F,3*Y,ct);W.Cartesian3.equalsEpsilon(q,X,et.CesiumMath.EPSILON10)||(X=(2+(q=(U+1)%z))%z,H[B++]=U,H[B++]=q,H[B++]=Y,H[B++]=Y,H[B++]=q,H[B++]=X)}return s.indices=H,(s=$.GeometryPipeline.combineInstances([new K.GeometryInstance({geometry:c}),new K.GeometryInstance({geometry:s})]))[0]}var u=[new W.Cartesian3,new W.Cartesian3,new W.Cartesian3,new W.Cartesian3],f=new W.Cartographic,h=new W.Cartographic;function c(t,e,a,r,n){if(0===a)return W.Rectangle.clone(t,n);var i=S.RectangleGeometryLibrary.computeOptions(t,e,a,0,p,f),t=i.height,e=i.width,a=u;return S.RectangleGeometryLibrary.computePosition(i,r,!1,0,0,a[0]),S.RectangleGeometryLibrary.computePosition(i,r,!1,0,e-1,a[1]),S.RectangleGeometryLibrary.computePosition(i,r,!1,t-1,0,a[2]),S.RectangleGeometryLibrary.computePosition(i,r,!1,t-1,e-1,a[3]),W.Rectangle.fromCartesianArray(a,r,n)}function b(t){var e=(t=Q.defaultValue(t,Q.defaultValue.EMPTY_OBJECT)).rectangle,a=Q.defaultValue(t.height,0),r=Q.defaultValue(t.extrudedHeight,a);this._rectangle=W.Rectangle.clone(e),this._granularity=Q.defaultValue(t.granularity,et.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=W.Ellipsoid.clone(Q.defaultValue(t.ellipsoid,W.Ellipsoid.WGS84)),this._surfaceHeight=Math.max(a,r),this._rotation=Q.defaultValue(t.rotation,0),this._stRotation=Q.defaultValue(t.stRotation,0),this._vertexFormat=rt.VertexFormat.clone(Q.defaultValue(t.vertexFormat,rt.VertexFormat.DEFAULT)),this._extrudedHeight=Math.min(a,r),this._shadowVolume=Q.defaultValue(t.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=t.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}b.packedLength=W.Rectangle.packedLength+W.Ellipsoid.packedLength+rt.VertexFormat.packedLength+7,b.pack=function(t,e,a){return a=Q.defaultValue(a,0),W.Rectangle.pack(t._rectangle,e,a),a+=W.Rectangle.packedLength,W.Ellipsoid.pack(t._ellipsoid,e,a),a+=W.Ellipsoid.packedLength,rt.VertexFormat.pack(t._vertexFormat,e,a),a+=rt.VertexFormat.packedLength,e[a++]=t._granularity,e[a++]=t._surfaceHeight,e[a++]=t._rotation,e[a++]=t._stRotation,e[a++]=t._extrudedHeight,e[a++]=t._shadowVolume?1:0,e[a]=Q.defaultValue(t._offsetAttribute,-1),e};var v=new W.Rectangle,_=W.Ellipsoid.clone(W.Ellipsoid.UNIT_SPHERE),A={rectangle:v,ellipsoid:_,vertexFormat:gt,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};b.unpack=function(t,e,a){e=Q.defaultValue(e,0);var r=W.Rectangle.unpack(t,e,v);e+=W.Rectangle.packedLength;var n=W.Ellipsoid.unpack(t,e,_);e+=W.Ellipsoid.packedLength;var i=rt.VertexFormat.unpack(t,e,gt);e+=rt.VertexFormat.packedLength;var o=t[e++],s=t[e++],l=t[e++],u=t[e++],c=t[e++],m=1===t[e++],e=t[e];return Q.defined(a)?(a._rectangle=W.Rectangle.clone(r,a._rectangle),a._ellipsoid=W.Ellipsoid.clone(n,a._ellipsoid),a._vertexFormat=rt.VertexFormat.clone(i,a._vertexFormat),a._granularity=o,a._surfaceHeight=s,a._rotation=l,a._stRotation=u,a._extrudedHeight=c,a._shadowVolume=m,a._offsetAttribute=-1===e?void 0:e,a):(A.granularity=o,A.height=s,A.rotation=l,A.stRotation=u,A.extrudedHeight=c,A.shadowVolume=m,A.offsetAttribute=-1===e?void 0:e,new b(A))},b.computeRectangle=function(t,e){var a=(t=Q.defaultValue(t,Q.defaultValue.EMPTY_OBJECT)).rectangle,r=Q.defaultValue(t.granularity,et.CesiumMath.RADIANS_PER_DEGREE),n=Q.defaultValue(t.ellipsoid,W.Ellipsoid.WGS84);return c(a,r,Q.defaultValue(t.rotation,0),n,e)};var x=new N.Matrix3,w=new N.Quaternion,C=new W.Cartographic;b.createGeometry=function(t){if(!et.CesiumMath.equalsEpsilon(t._rectangle.north,t._rectangle.south,et.CesiumMath.EPSILON10)&&!et.CesiumMath.equalsEpsilon(t._rectangle.east,t._rectangle.west,et.CesiumMath.EPSILON10)){var e=t._rectangle,a=t._ellipsoid,r=t._rotation,n=t._stRotation,i=t._vertexFormat,o=S.RectangleGeometryLibrary.computeOptions(e,t._granularity,r,n,p,f,h),s=x;0!==n||0!==r?(c=W.Rectangle.center(e,C),m=a.geodeticSurfaceNormalCartographic(c,ut),N.Quaternion.fromAxisAngle(m,-n,w),N.Matrix3.fromQuaternion(w,s)):N.Matrix3.clone(N.Matrix3.IDENTITY,s);var l,u,c=t._surfaceHeight,m=t._extrudedHeight,n=!et.CesiumMath.equalsEpsilon(c,m,0,et.CesiumMath.EPSILON2);return o.lonScalar=1/t._rectangle.width,o.latScalar=1/t._rectangle.height,o.tangentRotationMatrix=s,e=t._rectangle,c=n?(l=y(t,o),n=N.BoundingSphere.fromRectangle3D(e,a,c,g),u=N.BoundingSphere.fromRectangle3D(e,a,m,d),N.BoundingSphere.union(n,u)):((l=mt(t,o)).attributes.position.values=at.PolygonPipeline.scaleToGeodeticHeight(l.attributes.position.values,c,a,!1),Q.defined(t._offsetAttribute)&&(u=l.attributes.position.values.length,o=new Uint8Array(u/3),u=t._offsetAttribute===J.GeometryOffsetAttribute.NONE?0:1,J.arrayFill(o,u),l.attributes.applyOffset=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:o})),N.BoundingSphere.fromRectangle3D(e,a,c)),i.position||delete l.attributes.position,new Z.Geometry({attributes:l.attributes,indices:l.indices,primitiveType:l.primitiveType,boundingSphere:c,offsetAttribute:t._offsetAttribute})}},b.createShadowVolume=function(t,e,a){var r=t._granularity,n=t._ellipsoid,e=e(r,n),a=a(r,n);return new b({rectangle:t._rectangle,rotation:t._rotation,ellipsoid:n,stRotation:t._stRotation,granularity:r,extrudedHeight:a,height:e,vertexFormat:rt.VertexFormat.POSITION_ONLY,shadowVolume:!0})};var m=new W.Rectangle,R=[new W.Cartesian2,new W.Cartesian2,new W.Cartesian2],E=new Z.Matrix2,F=new W.Cartographic;return Object.defineProperties(b.prototype,{rectangle:{get:function(){return Q.defined(this._rotatedRectangle)||(this._rotatedRectangle=c(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return Q.defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(t){if(0===t._stRotation)return[0,0,0,1,1,0];var e=W.Rectangle.clone(t._rectangle,m),a=t._granularity,r=t._ellipsoid,e=c(e,a,t._rotation-t._stRotation,r,m),n=R;n[0].x=e.west,n[0].y=e.south,n[1].x=e.west,n[1].y=e.north,n[2].x=e.east,n[2].y=e.south;for(var i=t.rectangle,o=Z.Matrix2.fromRotation(t._stRotation,E),s=W.Rectangle.center(i,F),l=0;l<3;++l){var u=n[l];u.x-=s.longitude,u.y-=s.latitude,Z.Matrix2.multiplyByVector(o,u,u),u.x+=s.longitude,u.y+=s.latitude,u.x=(u.x-i.west)/i.width,u.y=(u.y-i.south)/i.height}return a=n[0],r=n[1],e=n[2],t=new Array(6),W.Cartesian2.pack(a,t),W.Cartesian2.pack(r,t,2),W.Cartesian2.pack(e,t,4),t}(this)),this._textureCoordinateRotationPoints}}}),function(t,e){return(t=Q.defined(e)?b.unpack(t,e):t)._ellipsoid=W.Ellipsoid.clone(t._ellipsoid),t._rectangle=W.Rectangle.clone(t._rectangle),b.createGeometry(t)}});
define(["./when-ca391574","./Cartesian2-5b63e672","./GeometryOffsetAttribute-b94750ca","./Transforms-5295b227","./Check-64f87f7d","./ComponentDatatype-8f71e605","./GeometryAttribute-7ef2d452","./GeometryAttributes-a356f820","./GeometryInstance-d18842cb","./GeometryPipeline-a588d10d","./IndexDatatype-4e56bcfa","./Math-b53708b3","./PolygonPipeline-ff4431d7","./RectangleGeometryLibrary-8c98c500","./VertexFormat-63b3c6da","./RuntimeError-19cb26ba","./WebGLConstants-95ceb4e9","./AttributeCompression-a99f24b9","./EncodedCartesian3-c36ced29","./IntersectionTests-f5111308","./Plane-99b2becd","./EllipsoidRhumbLine-6ee9af74"],function(Q,W,J,N,t,j,Z,r,K,$,tt,et,at,S,rt,e,a,n,i,o,s,l){"use strict";var nt=new W.Cartesian3,it=new W.Cartesian3,ot=new W.Cartesian3,st=new W.Cartesian3,p=new W.Rectangle,I=new W.Cartesian2,d=new N.BoundingSphere,g=new N.BoundingSphere;function lt(t,e){var a=new Z.Geometry({attributes:new r.GeometryAttributes,primitiveType:Z.PrimitiveType.TRIANGLES});return a.attributes.position=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e.positions}),t.normal&&(a.attributes.normal=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.normals})),t.tangent&&(a.attributes.tangent=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.tangents})),t.bitangent&&(a.attributes.bitangent=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.bitangents})),a}var ut=new W.Cartesian3,ct=new W.Cartesian3;function mt(t,e){var a=t._vertexFormat,r=t._ellipsoid,n=e.height,i=e.width,o=e.northCap,s=e.southCap,l=0,u=n,c=n,t=0;o&&(--c,t+=l=1),s&&(--u,--c,t+=1),t+=i*c;for(var m=a.position?new Float64Array(3*t):void 0,p=a.st?new Float32Array(2*t):void 0,d=0,g=0,y=nt,f=I,h=Number.MAX_VALUE,b=Number.MAX_VALUE,v=-Number.MAX_VALUE,_=-Number.MAX_VALUE,A=l;A<u;++A)for(var x=0;x<i;++x)S.RectangleGeometryLibrary.computePosition(e,r,a.st,A,x,y,f),m[d++]=y.x,m[d++]=y.y,m[d++]=y.z,a.st&&(p[g++]=f.x,p[g++]=f.y,h=Math.min(h,f.x),b=Math.min(b,f.y),v=Math.max(v,f.x),_=Math.max(_,f.y));if(o&&(S.RectangleGeometryLibrary.computePosition(e,r,a.st,0,0,y,f),m[d++]=y.x,m[d++]=y.y,m[d++]=y.z,a.st&&(p[g++]=f.x,p[g++]=f.y,h=f.x,b=f.y,v=f.x,_=f.y)),s&&(S.RectangleGeometryLibrary.computePosition(e,r,a.st,n-1,0,y,f),m[d++]=y.x,m[d++]=y.y,m[d]=y.z,a.st&&(p[g++]=f.x,p[g]=f.y,h=Math.min(h,f.x),b=Math.min(b,f.y),v=Math.max(v,f.x),_=Math.max(_,f.y))),a.st&&(h<0||b<0||1<v||1<_))for(var w=0;w<p.length;w+=2)p[w]=(p[w]-h)/(v-h),p[w+1]=(p[w+1]-b)/(_-b);l=function(t,e,a,r){var n=t.length,i=e.normal?new Float32Array(n):void 0,o=e.tangent?new Float32Array(n):void 0,s=e.bitangent?new Float32Array(n):void 0,l=0,u=st,c=ot,m=it;if(e.normal||e.tangent||e.bitangent)for(var p=0;p<n;p+=3){var d=W.Cartesian3.fromArray(t,p,nt),g=l+1,y=l+2,m=a.geodeticSurfaceNormal(d,m);(e.tangent||e.bitangent)&&(W.Cartesian3.cross(W.Cartesian3.UNIT_Z,m,c),N.Matrix3.multiplyByVector(r,c,c),W.Cartesian3.normalize(c,c),e.bitangent&&W.Cartesian3.normalize(W.Cartesian3.cross(m,c,u),u)),e.normal&&(i[l]=m.x,i[g]=m.y,i[y]=m.z),e.tangent&&(o[l]=c.x,o[g]=c.y,o[y]=c.z),e.bitangent&&(s[l]=u.x,s[g]=u.y,s[y]=u.z),l+=3}return lt(e,{positions:t,normals:i,tangents:o,bitangents:s})}(m,a,r,e.tangentRotationMatrix),n=6*(i-1)*(c-1);o&&(n+=3*(i-1)),s&&(n+=3*(i-1));for(var C=tt.IndexDatatype.createTypedArray(t,n),R=0,E=0,F=0;F<c-1;++F){for(var G=0;G<i-1;++G){var P=R+i,V=P+1,L=R+1;C[E++]=R,C[E++]=P,C[E++]=L,C[E++]=L,C[E++]=P,C[E++]=V,++R}++R}if(o||s){var D,M,T=t-1,O=t-1;if(o&&s&&(T=t-2),R=0,o)for(F=0;F<i-1;F++)M=(D=R)+1,C[E++]=T,C[E++]=D,C[E++]=M,++R;if(s)for(R=(c-1)*i,F=0;F<i-1;F++)M=(D=R)+1,C[E++]=D,C[E++]=O,C[E++]=M,++R}return l.indices=C,a.st&&(l.attributes.st=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:p})),l}function pt(t,e,a,r,n){return t[e++]=r[a],t[e++]=r[a+1],t[e++]=r[a+2],t[e++]=n[a],t[e++]=n[a+1],t[e]=n[a+2],t}function dt(t,e,a,r){return t[e++]=r[a],t[e++]=r[a+1],t[e++]=r[a],t[e]=r[a+1],t}var gt=new rt.VertexFormat;function y(t,e){var a=t._shadowVolume,r=t._offsetAttribute,n=t._vertexFormat,i=t._extrudedHeight,o=t._surfaceHeight,s=t._ellipsoid,l=e.height,u=e.width;a&&((b=rt.VertexFormat.clone(n,gt)).normal=!0,t._vertexFormat=b);var c=mt(t,e);a&&(t._vertexFormat=n);var m=at.PolygonPipeline.scaleToGeodeticHeight(c.attributes.position.values,o,s,!1),p=2*(z=(m=new Float64Array(m)).length),d=new Float64Array(p);d.set(m);var g=at.PolygonPipeline.scaleToGeodeticHeight(c.attributes.position.values,i,s);d.set(g,z),c.attributes.position.values=d;var y,f,h,b=n.normal?new Float32Array(p):void 0,t=n.tangent?new Float32Array(p):void 0,o=n.bitangent?new Float32Array(p):void 0,i=n.st?new Float32Array(p/3*2):void 0;if(n.normal){for(f=c.attributes.normal.values,b.set(f),_=0;_<z;_++)f[_]=-f[_];b.set(f,z),c.attributes.normal.values=b}if(a){f=c.attributes.normal.values,n.normal||(c.attributes.normal=void 0);for(var v=new Float32Array(p),_=0;_<z;_++)f[_]=-f[_];v.set(f,z),c.attributes.extrudeDirection=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:v})}d=Q.defined(r);if(d&&(b=z/3*2,v=new Uint8Array(b),v=r===J.GeometryOffsetAttribute.TOP?J.arrayFill(v,1,0,b/2):(h=r===J.GeometryOffsetAttribute.NONE?0:1,J.arrayFill(v,h)),c.attributes.applyOffset=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:v})),n.tangent){var A=c.attributes.tangent.values;for(t.set(A),_=0;_<z;_++)A[_]=-A[_];t.set(A,z),c.attributes.tangent.values=t}n.bitangent&&(E=c.attributes.bitangent.values,o.set(E),o.set(E,z),c.attributes.bitangent.values=o),n.st&&(y=c.attributes.st.values,i.set(y),i.set(y,z/3*2),c.attributes.st.values=i);var x=c.indices,w=x.length,C=z/3,R=tt.IndexDatatype.createTypedArray(p/3,2*w);for(R.set(x),_=0;_<w;_+=3)R[_+w]=x[_+2]+C,R[_+1+w]=x[_+1]+C,R[_+2+w]=x[_]+C;c.indices=R;var t=e.northCap,E=e.southCap,o=l,i=2,p=0,e=4,l=4;t&&(--i,--o,p+=1,e-=2,--l),E&&(--i,--o,p+=1,e-=2,--l);var l=2*((p+=i*u+2*o-e)+l),F=new Float64Array(3*l),G=a?new Float32Array(3*l):void 0,P=d?new Uint8Array(l):void 0,V=n.st?new Float32Array(2*l):void 0,L=r===J.GeometryOffsetAttribute.TOP;d&&!L&&(h=r===J.GeometryOffsetAttribute.ALL?1:0,P=J.arrayFill(P,h));var D=0,M=0,T=0,O=0,N=u*o;for(_=0;_<N;_+=u)F=pt(F,D,I=3*_,m,g),D+=6,n.st&&(V=dt(V,M,2*_,y),M+=4),a&&(T+=3,G[T++]=f[I],G[T++]=f[I+1],G[T++]=f[I+2]),L&&(P[O++]=1,O+=1);if(E){var S=t?1+N:N,I=3*S;for(_=0;_<2;_++)F=pt(F,D,I,m,g),D+=6,n.st&&(V=dt(V,M,2*S,y),M+=4),a&&(T+=3,G[T++]=f[I],G[T++]=f[I+1],G[T++]=f[I+2]),L&&(P[O++]=1,O+=1)}else for(_=N-u;_<N;_++)F=pt(F,D,I=3*_,m,g),D+=6,n.st&&(V=dt(V,M,2*_,y),M+=4),a&&(T+=3,G[T++]=f[I],G[T++]=f[I+1],G[T++]=f[I+2]),L&&(P[O++]=1,O+=1);for(_=N-1;0<_;_-=u)F=pt(F,D,I=3*_,m,g),D+=6,n.st&&(V=dt(V,M,2*_,y),M+=4),a&&(T+=3,G[T++]=f[I],G[T++]=f[I+1],G[T++]=f[I+2]),L&&(P[O++]=1,O+=1);if(t){var k=N;for(I=3*k,_=0;_<2;_++)F=pt(F,D,I,m,g),D+=6,n.st&&(V=dt(V,M,2*k,y),M+=4),a&&(T+=3,G[T++]=f[I],G[T++]=f[I+1],G[T++]=f[I+2]),L&&(P[O++]=1,O+=1)}else for(_=u-1;0<=_;_--)F=pt(F,D,I=3*_,m,g),D+=6,n.st&&(V=dt(V,M,2*_,y),M+=4),a&&(T+=3,G[T++]=f[I],G[T++]=f[I+1],G[T++]=f[I+2]),L&&(P[O++]=1,O+=1);s=function(t,e,a){var r=t.length,n=e.normal?new Float32Array(r):void 0,i=e.tangent?new Float32Array(r):void 0,o=e.bitangent?new Float32Array(r):void 0,s=0,l=0,u=0,c=!0,m=st,p=ot,d=it;if(e.normal||e.tangent||e.bitangent)for(var g=0;g<r;g+=6){var y,f=W.Cartesian3.fromArray(t,g,nt),h=W.Cartesian3.fromArray(t,(g+6)%r,ut);c&&(y=W.Cartesian3.fromArray(t,(g+3)%r,ct),W.Cartesian3.subtract(h,f,h),W.Cartesian3.subtract(y,f,y),d=W.Cartesian3.normalize(W.Cartesian3.cross(y,h,d),d),c=!1),W.Cartesian3.equalsEpsilon(h,f,et.CesiumMath.EPSILON10)&&(c=!0),(e.tangent||e.bitangent)&&(m=a.geodeticSurfaceNormal(f,m),e.tangent&&(p=W.Cartesian3.normalize(W.Cartesian3.cross(m,d,p),p))),e.normal&&(n[s++]=d.x,n[s++]=d.y,n[s++]=d.z,n[s++]=d.x,n[s++]=d.y,n[s++]=d.z),e.tangent&&(i[l++]=p.x,i[l++]=p.y,i[l++]=p.z,i[l++]=p.x,i[l++]=p.y,i[l++]=p.z),e.bitangent&&(o[u++]=m.x,o[u++]=m.y,o[u++]=m.z,o[u++]=m.x,o[u++]=m.y,o[u++]=m.z)}return lt(e,{positions:t,normals:n,tangents:i,bitangents:o})}(F,n,s);n.st&&(s.attributes.st=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:V})),a&&(s.attributes.extrudeDirection=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:G})),d&&(s.attributes.applyOffset=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:P}));var H=tt.IndexDatatype.createTypedArray(l,6*p),z=F.length/3,B=0;for(_=0;_<z-1;_+=2){var U,Y=((U=_)+2)%z,q=W.Cartesian3.fromArray(F,3*U,ut),X=W.Cartesian3.fromArray(F,3*Y,ct);W.Cartesian3.equalsEpsilon(q,X,et.CesiumMath.EPSILON10)||(X=(2+(q=(U+1)%z))%z,H[B++]=U,H[B++]=q,H[B++]=Y,H[B++]=Y,H[B++]=q,H[B++]=X)}return s.indices=H,(s=$.GeometryPipeline.combineInstances([new K.GeometryInstance({geometry:c}),new K.GeometryInstance({geometry:s})]))[0]}var u=[new W.Cartesian3,new W.Cartesian3,new W.Cartesian3,new W.Cartesian3],f=new W.Cartographic,h=new W.Cartographic;function c(t,e,a,r,n){if(0===a)return W.Rectangle.clone(t,n);var i=S.RectangleGeometryLibrary.computeOptions(t,e,a,0,p,f),t=i.height,e=i.width,a=u;return S.RectangleGeometryLibrary.computePosition(i,r,!1,0,0,a[0]),S.RectangleGeometryLibrary.computePosition(i,r,!1,0,e-1,a[1]),S.RectangleGeometryLibrary.computePosition(i,r,!1,t-1,0,a[2]),S.RectangleGeometryLibrary.computePosition(i,r,!1,t-1,e-1,a[3]),W.Rectangle.fromCartesianArray(a,r,n)}function b(t){var e=(t=Q.defaultValue(t,Q.defaultValue.EMPTY_OBJECT)).rectangle,a=Q.defaultValue(t.height,0),r=Q.defaultValue(t.extrudedHeight,a);this._rectangle=W.Rectangle.clone(e),this._granularity=Q.defaultValue(t.granularity,et.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=W.Ellipsoid.clone(Q.defaultValue(t.ellipsoid,W.Ellipsoid.WGS84)),this._surfaceHeight=Math.max(a,r),this._rotation=Q.defaultValue(t.rotation,0),this._stRotation=Q.defaultValue(t.stRotation,0),this._vertexFormat=rt.VertexFormat.clone(Q.defaultValue(t.vertexFormat,rt.VertexFormat.DEFAULT)),this._extrudedHeight=Math.min(a,r),this._shadowVolume=Q.defaultValue(t.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=t.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}b.packedLength=W.Rectangle.packedLength+W.Ellipsoid.packedLength+rt.VertexFormat.packedLength+7,b.pack=function(t,e,a){return a=Q.defaultValue(a,0),W.Rectangle.pack(t._rectangle,e,a),a+=W.Rectangle.packedLength,W.Ellipsoid.pack(t._ellipsoid,e,a),a+=W.Ellipsoid.packedLength,rt.VertexFormat.pack(t._vertexFormat,e,a),a+=rt.VertexFormat.packedLength,e[a++]=t._granularity,e[a++]=t._surfaceHeight,e[a++]=t._rotation,e[a++]=t._stRotation,e[a++]=t._extrudedHeight,e[a++]=t._shadowVolume?1:0,e[a]=Q.defaultValue(t._offsetAttribute,-1),e};var v=new W.Rectangle,_=W.Ellipsoid.clone(W.Ellipsoid.UNIT_SPHERE),A={rectangle:v,ellipsoid:_,vertexFormat:gt,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};b.unpack=function(t,e,a){e=Q.defaultValue(e,0);var r=W.Rectangle.unpack(t,e,v);e+=W.Rectangle.packedLength;var n=W.Ellipsoid.unpack(t,e,_);e+=W.Ellipsoid.packedLength;var i=rt.VertexFormat.unpack(t,e,gt);e+=rt.VertexFormat.packedLength;var o=t[e++],s=t[e++],l=t[e++],u=t[e++],c=t[e++],m=1===t[e++],e=t[e];return Q.defined(a)?(a._rectangle=W.Rectangle.clone(r,a._rectangle),a._ellipsoid=W.Ellipsoid.clone(n,a._ellipsoid),a._vertexFormat=rt.VertexFormat.clone(i,a._vertexFormat),a._granularity=o,a._surfaceHeight=s,a._rotation=l,a._stRotation=u,a._extrudedHeight=c,a._shadowVolume=m,a._offsetAttribute=-1===e?void 0:e,a):(A.granularity=o,A.height=s,A.rotation=l,A.stRotation=u,A.extrudedHeight=c,A.shadowVolume=m,A.offsetAttribute=-1===e?void 0:e,new b(A))},b.computeRectangle=function(t,e){var a=(t=Q.defaultValue(t,Q.defaultValue.EMPTY_OBJECT)).rectangle,r=Q.defaultValue(t.granularity,et.CesiumMath.RADIANS_PER_DEGREE),n=Q.defaultValue(t.ellipsoid,W.Ellipsoid.WGS84);return c(a,r,Q.defaultValue(t.rotation,0),n,e)};var x=new N.Matrix3,w=new N.Quaternion,C=new W.Cartographic;b.createGeometry=function(t){if(!et.CesiumMath.equalsEpsilon(t._rectangle.north,t._rectangle.south,et.CesiumMath.EPSILON10)&&!et.CesiumMath.equalsEpsilon(t._rectangle.east,t._rectangle.west,et.CesiumMath.EPSILON10)){var e=t._rectangle,a=t._ellipsoid,r=t._rotation,n=t._stRotation,i=t._vertexFormat,o=S.RectangleGeometryLibrary.computeOptions(e,t._granularity,r,n,p,f,h),s=x;0!==n||0!==r?(c=W.Rectangle.center(e,C),m=a.geodeticSurfaceNormalCartographic(c,ut),N.Quaternion.fromAxisAngle(m,-n,w),N.Matrix3.fromQuaternion(w,s)):N.Matrix3.clone(N.Matrix3.IDENTITY,s);var l,u,c=t._surfaceHeight,m=t._extrudedHeight,n=!et.CesiumMath.equalsEpsilon(c,m,0,et.CesiumMath.EPSILON2);return o.lonScalar=1/t._rectangle.width,o.latScalar=1/t._rectangle.height,o.tangentRotationMatrix=s,e=t._rectangle,c=n?(l=y(t,o),n=N.BoundingSphere.fromRectangle3D(e,a,c,g),u=N.BoundingSphere.fromRectangle3D(e,a,m,d),N.BoundingSphere.union(n,u)):((l=mt(t,o)).attributes.position.values=at.PolygonPipeline.scaleToGeodeticHeight(l.attributes.position.values,c,a,!1),Q.defined(t._offsetAttribute)&&(u=l.attributes.position.values.length,o=new Uint8Array(u/3),u=t._offsetAttribute===J.GeometryOffsetAttribute.NONE?0:1,J.arrayFill(o,u),l.attributes.applyOffset=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:o})),N.BoundingSphere.fromRectangle3D(e,a,c)),i.position||delete l.attributes.position,new Z.Geometry({attributes:l.attributes,indices:l.indices,primitiveType:l.primitiveType,boundingSphere:c,offsetAttribute:t._offsetAttribute})}},b.createShadowVolume=function(t,e,a){var r=t._granularity,n=t._ellipsoid,e=e(r,n),a=a(r,n);return new b({rectangle:t._rectangle,rotation:t._rotation,ellipsoid:n,stRotation:t._stRotation,granularity:r,extrudedHeight:a,height:e,vertexFormat:rt.VertexFormat.POSITION_ONLY,shadowVolume:!0})};var m=new W.Rectangle,R=[new W.Cartesian2,new W.Cartesian2,new W.Cartesian2],E=new Z.Matrix2,F=new W.Cartographic;return Object.defineProperties(b.prototype,{rectangle:{get:function(){return Q.defined(this._rotatedRectangle)||(this._rotatedRectangle=c(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return Q.defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(t){if(0===t._stRotation)return[0,0,0,1,1,0];var e=W.Rectangle.clone(t._rectangle,m),a=t._granularity,r=t._ellipsoid,e=c(e,a,t._rotation-t._stRotation,r,m),n=R;n[0].x=e.west,n[0].y=e.south,n[1].x=e.west,n[1].y=e.north,n[2].x=e.east,n[2].y=e.south;for(var i=t.rectangle,o=Z.Matrix2.fromRotation(t._stRotation,E),s=W.Rectangle.center(i,F),l=0;l<3;++l){var u=n[l];u.x-=s.longitude,u.y-=s.latitude,Z.Matrix2.multiplyByVector(o,u,u),u.x+=s.longitude,u.y+=s.latitude,u.x=(u.x-i.west)/i.width,u.y=(u.y-i.south)/i.height}return a=n[0],r=n[1],e=n[2],t=new Array(6),W.Cartesian2.pack(a,t),W.Cartesian2.pack(r,t,2),W.Cartesian2.pack(e,t,4),t}(this)),this._textureCoordinateRotationPoints}}}),function(t,e){return(t=Q.defined(e)?b.unpack(t,e):t)._ellipsoid=W.Ellipsoid.clone(t._ellipsoid),t._rectangle=W.Rectangle.clone(t._rectangle),b.createGeometry(t)}});

@@ -1,1 +0,1 @@

define(["./when-ca391574","./Cartesian2-5b63e672","./GeometryOffsetAttribute-b94750ca","./Transforms-5295b227","./ComponentDatatype-8f71e605","./Check-64f87f7d","./GeometryAttribute-7ef2d452","./GeometryAttributes-a356f820","./IndexDatatype-4e56bcfa","./Math-b53708b3","./PolygonPipeline-55053b0a","./RectangleGeometryLibrary-8c98c500","./RuntimeError-19cb26ba","./WebGLConstants-95ceb4e9","./EllipsoidRhumbLine-21029cef"],function(p,s,c,d,m,e,_,v,E,f,g,A,t,i,a){"use strict";var h=new d.BoundingSphere,y=new d.BoundingSphere,G=new s.Cartesian3,b=new s.Rectangle;function R(e,t){var i=e._ellipsoid,a=t.height,r=t.width,n=t.northCap,o=t.southCap,l=a,u=2,s=0,e=4;n&&(--u,--l,s+=1,e-=2),o&&(--u,--l,s+=1,e-=2),s+=u*r+2*l-e;var p,c=new Float64Array(3*s),d=0,f=0,g=G;if(n)A.RectangleGeometryLibrary.computePosition(t,i,!1,f,0,g),c[d++]=g.x,c[d++]=g.y,c[d++]=g.z;else for(p=0;p<r;p++)A.RectangleGeometryLibrary.computePosition(t,i,!1,f,p,g),c[d++]=g.x,c[d++]=g.y,c[d++]=g.z;for(p=r-1,f=1;f<a;f++)A.RectangleGeometryLibrary.computePosition(t,i,!1,f,p,g),c[d++]=g.x,c[d++]=g.y,c[d++]=g.z;if(f=a-1,!o)for(p=r-2;0<=p;p--)A.RectangleGeometryLibrary.computePosition(t,i,!1,f,p,g),c[d++]=g.x,c[d++]=g.y,c[d++]=g.z;for(p=0,f=a-2;0<f;f--)A.RectangleGeometryLibrary.computePosition(t,i,!1,f,p,g),c[d++]=g.x,c[d++]=g.y,c[d++]=g.z;for(var o=c.length/3*2,h=E.IndexDatatype.createTypedArray(c.length/3,o),y=0,b=0;b<c.length/3-1;b++)h[y++]=b,h[y++]=b+1;h[y++]=c.length/3-1,h[y++]=0;o=new _.Geometry({attributes:new v.GeometryAttributes,primitiveType:_.PrimitiveType.LINES});return o.attributes.position=new _.GeometryAttribute({componentDatatype:m.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:c}),o.indices=h,o}function P(e){var t=(e=p.defaultValue(e,p.defaultValue.EMPTY_OBJECT)).rectangle,i=p.defaultValue(e.granularity,f.CesiumMath.RADIANS_PER_DEGREE),a=p.defaultValue(e.ellipsoid,s.Ellipsoid.WGS84),r=p.defaultValue(e.rotation,0),n=p.defaultValue(e.height,0),o=p.defaultValue(e.extrudedHeight,n);this._rectangle=s.Rectangle.clone(t),this._granularity=i,this._ellipsoid=a,this._surfaceHeight=Math.max(n,o),this._rotation=r,this._extrudedHeight=Math.min(n,o),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}P.packedLength=s.Rectangle.packedLength+s.Ellipsoid.packedLength+5,P.pack=function(e,t,i){return i=p.defaultValue(i,0),s.Rectangle.pack(e._rectangle,t,i),i+=s.Rectangle.packedLength,s.Ellipsoid.pack(e._ellipsoid,t,i),i+=s.Ellipsoid.packedLength,t[i++]=e._granularity,t[i++]=e._surfaceHeight,t[i++]=e._rotation,t[i++]=e._extrudedHeight,t[i]=p.defaultValue(e._offsetAttribute,-1),t};var w=new s.Rectangle,L=s.Ellipsoid.clone(s.Ellipsoid.UNIT_SPHERE),C={rectangle:w,ellipsoid:L,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};P.unpack=function(e,t,i){t=p.defaultValue(t,0);var a=s.Rectangle.unpack(e,t,w);t+=s.Rectangle.packedLength;var r=s.Ellipsoid.unpack(e,t,L);t+=s.Ellipsoid.packedLength;var n=e[t++],o=e[t++],l=e[t++],u=e[t++],t=e[t];return p.defined(i)?(i._rectangle=s.Rectangle.clone(a,i._rectangle),i._ellipsoid=s.Ellipsoid.clone(r,i._ellipsoid),i._surfaceHeight=o,i._rotation=l,i._extrudedHeight=u,i._offsetAttribute=-1===t?void 0:t,i):(C.granularity=n,C.height=o,C.rotation=l,C.extrudedHeight=u,C.offsetAttribute=-1===t?void 0:t,new P(C))};var D=new s.Cartographic;return P.createGeometry=function(e){var t=e._rectangle,i=e._ellipsoid,a=A.RectangleGeometryLibrary.computeOptions(t,e._granularity,e._rotation,0,b,D);if(!f.CesiumMath.equalsEpsilon(t.north,t.south,f.CesiumMath.EPSILON10)&&!f.CesiumMath.equalsEpsilon(t.east,t.west,f.CesiumMath.EPSILON10)){var r,n,o,l,u=e._surfaceHeight,s=e._extrudedHeight;return u=!f.CesiumMath.equalsEpsilon(u,s,0,f.CesiumMath.EPSILON2)?(n=function(e,t){var i=e._surfaceHeight,a=e._extrudedHeight,r=e._ellipsoid,n=a,o=i,l=R(e,t),a=t.height,i=t.width,u=(e=g.PolygonPipeline.scaleToGeodeticHeight(l.attributes.position.values,o,r,!1)).length;(o=new Float64Array(2*u)).set(e),n=g.PolygonPipeline.scaleToGeodeticHeight(l.attributes.position.values,n,r),o.set(n,u),l.attributes.position.values=o,r=t.northCap,n=t.southCap,t=4,r&&--t,n&&--t;for(var t=2*(o.length/3+t),s=E.IndexDatatype.createTypedArray(o.length/3,t),u=o.length/6,p=0,c=0;c<u-1;c++)s[p++]=c,s[p++]=c+1,s[p++]=c+u,s[p++]=c+u+1;return s[p++]=u-1,s[p++]=0,s[p++]=u+u-1,s[p++]=u,s[p++]=0,s[p++]=u,a=r?a-1:(r=i-1,s[p++]=r,s[p++]=r+u,i+a-2),s[p++]=a,s[p++]=a+u,n||(a=i+a-1,s[p++]=a,s[p]=a+u),l.indices=s,l}(e,a),p.defined(e._offsetAttribute)&&(r=n.attributes.position.values.length/3,o=new Uint8Array(r),o=e._offsetAttribute===c.GeometryOffsetAttribute.TOP?c.arrayFill(o,1,0,r/2):(l=e._offsetAttribute===c.GeometryOffsetAttribute.NONE?0:1,c.arrayFill(o,l)),n.attributes.applyOffset=new _.GeometryAttribute({componentDatatype:m.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:o})),o=d.BoundingSphere.fromRectangle3D(t,i,u,y),s=d.BoundingSphere.fromRectangle3D(t,i,s,h),d.BoundingSphere.union(o,s)):((n=R(e,a)).attributes.position.values=g.PolygonPipeline.scaleToGeodeticHeight(n.attributes.position.values,u,i,!1),p.defined(e._offsetAttribute)&&(a=n.attributes.position.values.length,a=new Uint8Array(a/3),l=e._offsetAttribute===c.GeometryOffsetAttribute.NONE?0:1,c.arrayFill(a,l),n.attributes.applyOffset=new _.GeometryAttribute({componentDatatype:m.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:a})),d.BoundingSphere.fromRectangle3D(t,i,u)),new _.Geometry({attributes:n.attributes,indices:n.indices,primitiveType:_.PrimitiveType.LINES,boundingSphere:u,offsetAttribute:e._offsetAttribute})}},function(e,t){return(e=p.defined(t)?P.unpack(e,t):e)._ellipsoid=s.Ellipsoid.clone(e._ellipsoid),e._rectangle=s.Rectangle.clone(e._rectangle),P.createGeometry(e)}});
define(["./when-ca391574","./Cartesian2-5b63e672","./GeometryOffsetAttribute-b94750ca","./Transforms-5295b227","./ComponentDatatype-8f71e605","./Check-64f87f7d","./GeometryAttribute-7ef2d452","./GeometryAttributes-a356f820","./IndexDatatype-4e56bcfa","./Math-b53708b3","./PolygonPipeline-ff4431d7","./RectangleGeometryLibrary-8c98c500","./RuntimeError-19cb26ba","./WebGLConstants-95ceb4e9","./EllipsoidRhumbLine-6ee9af74"],function(p,s,c,d,m,e,_,v,E,f,g,A,t,i,a){"use strict";var h=new d.BoundingSphere,y=new d.BoundingSphere,G=new s.Cartesian3,b=new s.Rectangle;function R(e,t){var i=e._ellipsoid,a=t.height,r=t.width,n=t.northCap,o=t.southCap,l=a,u=2,s=0,e=4;n&&(--u,--l,s+=1,e-=2),o&&(--u,--l,s+=1,e-=2),s+=u*r+2*l-e;var p,c=new Float64Array(3*s),d=0,f=0,g=G;if(n)A.RectangleGeometryLibrary.computePosition(t,i,!1,f,0,g),c[d++]=g.x,c[d++]=g.y,c[d++]=g.z;else for(p=0;p<r;p++)A.RectangleGeometryLibrary.computePosition(t,i,!1,f,p,g),c[d++]=g.x,c[d++]=g.y,c[d++]=g.z;for(p=r-1,f=1;f<a;f++)A.RectangleGeometryLibrary.computePosition(t,i,!1,f,p,g),c[d++]=g.x,c[d++]=g.y,c[d++]=g.z;if(f=a-1,!o)for(p=r-2;0<=p;p--)A.RectangleGeometryLibrary.computePosition(t,i,!1,f,p,g),c[d++]=g.x,c[d++]=g.y,c[d++]=g.z;for(p=0,f=a-2;0<f;f--)A.RectangleGeometryLibrary.computePosition(t,i,!1,f,p,g),c[d++]=g.x,c[d++]=g.y,c[d++]=g.z;for(var o=c.length/3*2,h=E.IndexDatatype.createTypedArray(c.length/3,o),y=0,b=0;b<c.length/3-1;b++)h[y++]=b,h[y++]=b+1;h[y++]=c.length/3-1,h[y++]=0;o=new _.Geometry({attributes:new v.GeometryAttributes,primitiveType:_.PrimitiveType.LINES});return o.attributes.position=new _.GeometryAttribute({componentDatatype:m.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:c}),o.indices=h,o}function P(e){var t=(e=p.defaultValue(e,p.defaultValue.EMPTY_OBJECT)).rectangle,i=p.defaultValue(e.granularity,f.CesiumMath.RADIANS_PER_DEGREE),a=p.defaultValue(e.ellipsoid,s.Ellipsoid.WGS84),r=p.defaultValue(e.rotation,0),n=p.defaultValue(e.height,0),o=p.defaultValue(e.extrudedHeight,n);this._rectangle=s.Rectangle.clone(t),this._granularity=i,this._ellipsoid=a,this._surfaceHeight=Math.max(n,o),this._rotation=r,this._extrudedHeight=Math.min(n,o),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}P.packedLength=s.Rectangle.packedLength+s.Ellipsoid.packedLength+5,P.pack=function(e,t,i){return i=p.defaultValue(i,0),s.Rectangle.pack(e._rectangle,t,i),i+=s.Rectangle.packedLength,s.Ellipsoid.pack(e._ellipsoid,t,i),i+=s.Ellipsoid.packedLength,t[i++]=e._granularity,t[i++]=e._surfaceHeight,t[i++]=e._rotation,t[i++]=e._extrudedHeight,t[i]=p.defaultValue(e._offsetAttribute,-1),t};var w=new s.Rectangle,L=s.Ellipsoid.clone(s.Ellipsoid.UNIT_SPHERE),C={rectangle:w,ellipsoid:L,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};P.unpack=function(e,t,i){t=p.defaultValue(t,0);var a=s.Rectangle.unpack(e,t,w);t+=s.Rectangle.packedLength;var r=s.Ellipsoid.unpack(e,t,L);t+=s.Ellipsoid.packedLength;var n=e[t++],o=e[t++],l=e[t++],u=e[t++],t=e[t];return p.defined(i)?(i._rectangle=s.Rectangle.clone(a,i._rectangle),i._ellipsoid=s.Ellipsoid.clone(r,i._ellipsoid),i._surfaceHeight=o,i._rotation=l,i._extrudedHeight=u,i._offsetAttribute=-1===t?void 0:t,i):(C.granularity=n,C.height=o,C.rotation=l,C.extrudedHeight=u,C.offsetAttribute=-1===t?void 0:t,new P(C))};var D=new s.Cartographic;return P.createGeometry=function(e){var t=e._rectangle,i=e._ellipsoid,a=A.RectangleGeometryLibrary.computeOptions(t,e._granularity,e._rotation,0,b,D);if(!f.CesiumMath.equalsEpsilon(t.north,t.south,f.CesiumMath.EPSILON10)&&!f.CesiumMath.equalsEpsilon(t.east,t.west,f.CesiumMath.EPSILON10)){var r,n,o,l,u=e._surfaceHeight,s=e._extrudedHeight;return u=!f.CesiumMath.equalsEpsilon(u,s,0,f.CesiumMath.EPSILON2)?(n=function(e,t){var i=e._surfaceHeight,a=e._extrudedHeight,r=e._ellipsoid,n=a,o=i,l=R(e,t),a=t.height,i=t.width,u=(e=g.PolygonPipeline.scaleToGeodeticHeight(l.attributes.position.values,o,r,!1)).length;(o=new Float64Array(2*u)).set(e),n=g.PolygonPipeline.scaleToGeodeticHeight(l.attributes.position.values,n,r),o.set(n,u),l.attributes.position.values=o,r=t.northCap,n=t.southCap,t=4,r&&--t,n&&--t;for(var t=2*(o.length/3+t),s=E.IndexDatatype.createTypedArray(o.length/3,t),u=o.length/6,p=0,c=0;c<u-1;c++)s[p++]=c,s[p++]=c+1,s[p++]=c+u,s[p++]=c+u+1;return s[p++]=u-1,s[p++]=0,s[p++]=u+u-1,s[p++]=u,s[p++]=0,s[p++]=u,a=r?a-1:(r=i-1,s[p++]=r,s[p++]=r+u,i+a-2),s[p++]=a,s[p++]=a+u,n||(a=i+a-1,s[p++]=a,s[p]=a+u),l.indices=s,l}(e,a),p.defined(e._offsetAttribute)&&(r=n.attributes.position.values.length/3,o=new Uint8Array(r),o=e._offsetAttribute===c.GeometryOffsetAttribute.TOP?c.arrayFill(o,1,0,r/2):(l=e._offsetAttribute===c.GeometryOffsetAttribute.NONE?0:1,c.arrayFill(o,l)),n.attributes.applyOffset=new _.GeometryAttribute({componentDatatype:m.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:o})),o=d.BoundingSphere.fromRectangle3D(t,i,u,y),s=d.BoundingSphere.fromRectangle3D(t,i,s,h),d.BoundingSphere.union(o,s)):((n=R(e,a)).attributes.position.values=g.PolygonPipeline.scaleToGeodeticHeight(n.attributes.position.values,u,i,!1),p.defined(e._offsetAttribute)&&(a=n.attributes.position.values.length,a=new Uint8Array(a/3),l=e._offsetAttribute===c.GeometryOffsetAttribute.NONE?0:1,c.arrayFill(a,l),n.attributes.applyOffset=new _.GeometryAttribute({componentDatatype:m.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:a})),d.BoundingSphere.fromRectangle3D(t,i,u)),new _.Geometry({attributes:n.attributes,indices:n.indices,primitiveType:_.PrimitiveType.LINES,boundingSphere:u,offsetAttribute:e._offsetAttribute})}},function(e,t){return(e=p.defined(t)?P.unpack(e,t):e)._ellipsoid=s.Ellipsoid.clone(e._ellipsoid),e._rectangle=s.Rectangle.clone(e._rectangle),P.createGeometry(e)}});

@@ -1,1 +0,1 @@

define(["./when-ca391574","./Cartesian2-5b63e672","./ArcType-2b58731c","./Transforms-5295b227","./Color-821fa62a","./ComponentDatatype-8f71e605","./Check-64f87f7d","./GeometryAttribute-7ef2d452","./GeometryAttributes-a356f820","./IndexDatatype-4e56bcfa","./Math-b53708b3","./PolylinePipeline-00f5e064","./RuntimeError-19cb26ba","./WebGLConstants-95ceb4e9","./EllipsoidGeodesic-bbea0b0a","./EllipsoidRhumbLine-21029cef","./IntersectionTests-f5111308","./Plane-99b2becd"],function(L,V,x,S,I,R,e,O,M,U,N,F,o,t,r,a,l,i){"use strict";function f(e){var o=(e=L.defaultValue(e,L.defaultValue.EMPTY_OBJECT)).positions,t=e.colors,r=L.defaultValue(e.colorsPerVertex,!1);this._positions=o,this._colors=t,this._colorsPerVertex=r,this._arcType=L.defaultValue(e.arcType,x.ArcType.GEODESIC),this._granularity=L.defaultValue(e.granularity,N.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=L.defaultValue(e.ellipsoid,V.Ellipsoid.WGS84),this._workerName="createSimplePolylineGeometry";o=1+o.length*V.Cartesian3.packedLength;o+=L.defined(t)?1+t.length*I.Color.packedLength:1,this.packedLength=o+V.Ellipsoid.packedLength+3}f.pack=function(e,o,t){var r;t=L.defaultValue(t,0);var a=e._positions,l=a.length;for(o[t++]=l,r=0;r<l;++r,t+=V.Cartesian3.packedLength)V.Cartesian3.pack(a[r],o,t);var i=e._colors,l=L.defined(i)?i.length:0;for(o[t++]=l,r=0;r<l;++r,t+=I.Color.packedLength)I.Color.pack(i[r],o,t);return V.Ellipsoid.pack(e._ellipsoid,o,t),t+=V.Ellipsoid.packedLength,o[t++]=e._colorsPerVertex?1:0,o[t++]=e._arcType,o[t]=e._granularity,o},f.unpack=function(e,o,t){o=L.defaultValue(o,0);for(var r=e[o++],a=new Array(r),l=0;l<r;++l,o+=V.Cartesian3.packedLength)a[l]=V.Cartesian3.unpack(e,o);var i=0<(r=e[o++])?new Array(r):void 0;for(l=0;l<r;++l,o+=I.Color.packedLength)i[l]=I.Color.unpack(e,o);var n=V.Ellipsoid.unpack(e,o);o+=V.Ellipsoid.packedLength;var s=1===e[o++],p=e[o++],d=e[o];return L.defined(t)?(t._positions=a,t._colors=i,t._ellipsoid=n,t._colorsPerVertex=s,t._arcType=p,t._granularity=d,t):new f({positions:a,colors:i,ellipsoid:n,colorsPerVertex:s,arcType:p,granularity:d})};var H=new Array(2),W=new Array(2),Y={positions:H,height:W,ellipsoid:void 0,minDistance:void 0,granularity:void 0};return f.createGeometry=function(e){var o=e._positions,t=e._colors,r=e._colorsPerVertex,a=e._arcType,l=e._granularity,e=e._ellipsoid,i=N.CesiumMath.chordLength(l,e.maximumRadius),n=L.defined(t)&&!r,s=o.length,p=0;if(a===x.ArcType.GEODESIC||a===x.ArcType.RHUMB){var d,f,y=a===x.ArcType.GEODESIC?(d=N.CesiumMath.chordLength(l,e.maximumRadius),f=F.PolylinePipeline.numberOfPoints,F.PolylinePipeline.generateArc):(d=l,f=F.PolylinePipeline.numberOfPointsRhumbLine,F.PolylinePipeline.generateRhumbArc),c=F.PolylinePipeline.extractHeights(o,e),u=Y;if(a===x.ArcType.GEODESIC?u.minDistance=i:u.granularity=l,u.ellipsoid=e,n){for(var h=0,C=0;C<s-1;C++)h+=f(o[C],o[C+1],d)+1;B=new Float64Array(3*h),A=new Uint8Array(4*h),u.positions=H,u.height=W;var T=0;for(C=0;C<s-1;++C){H[0]=o[C],H[1]=o[C+1],W[0]=c[C],W[1]=c[C+1];var g=y(u);if(L.defined(t))for(var m=g.length/3,b=t[C],P=0;P<m;++P)A[T++]=I.Color.floatToByte(b.red),A[T++]=I.Color.floatToByte(b.green),A[T++]=I.Color.floatToByte(b.blue),A[T++]=I.Color.floatToByte(b.alpha);B.set(g,p),p+=g.length}}else if(u.positions=o,u.height=c,B=new Float64Array(y(u)),L.defined(t)){for(A=new Uint8Array(B.length/3*4),C=0;C<s-1;++C)p=function(e,o,t,r,a,l,i){var n=F.PolylinePipeline.numberOfPoints(e,o,a),s=t.red,p=t.green,d=t.blue,f=t.alpha,y=r.red,e=r.green,o=r.blue,a=r.alpha;if(I.Color.equals(t,r)){for(g=0;g<n;g++)l[i++]=I.Color.floatToByte(s),l[i++]=I.Color.floatToByte(p),l[i++]=I.Color.floatToByte(d),l[i++]=I.Color.floatToByte(f);return i}for(var c=(y-s)/n,u=(e-p)/n,h=(o-d)/n,C=(a-f)/n,T=i,g=0;g<n;g++)l[T++]=I.Color.floatToByte(s+g*c),l[T++]=I.Color.floatToByte(p+g*u),l[T++]=I.Color.floatToByte(d+g*h),l[T++]=I.Color.floatToByte(f+g*C);return T}(o[C],o[C+1],t[C],t[C+1],i,A,p);var _=t[s-1];A[p++]=I.Color.floatToByte(_.red),A[p++]=I.Color.floatToByte(_.green),A[p++]=I.Color.floatToByte(_.blue),A[p++]=I.Color.floatToByte(_.alpha)}}else{var v=n?2*s-2:s,B=new Float64Array(3*v),A=L.defined(t)?new Uint8Array(4*v):void 0,E=0,k=0;for(C=0;C<s;++C){var G=o[C];if(n&&0<C&&(V.Cartesian3.pack(G,B,E),E+=3,b=t[C-1],A[k++]=I.Color.floatToByte(b.red),A[k++]=I.Color.floatToByte(b.green),A[k++]=I.Color.floatToByte(b.blue),A[k++]=I.Color.floatToByte(b.alpha)),n&&C===s-1)break;V.Cartesian3.pack(G,B,E),E+=3,L.defined(t)&&(b=t[C],A[k++]=I.Color.floatToByte(b.red),A[k++]=I.Color.floatToByte(b.green),A[k++]=I.Color.floatToByte(b.blue),A[k++]=I.Color.floatToByte(b.alpha))}}e=new M.GeometryAttributes;e.position=new O.GeometryAttribute({componentDatatype:R.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:B}),L.defined(t)&&(e.color=new O.GeometryAttribute({componentDatatype:R.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:4,values:A,normalize:!0}));var _=2*((v=B.length/3)-1),w=U.IndexDatatype.createTypedArray(v,_),D=0;for(C=0;C<v-1;++C)w[D++]=C,w[D++]=C+1;return new O.Geometry({attributes:e,indices:w,primitiveType:O.PrimitiveType.LINES,boundingSphere:S.BoundingSphere.fromPoints(o)})},function(e,o){return(e=L.defined(o)?f.unpack(e,o):e)._ellipsoid=V.Ellipsoid.clone(e._ellipsoid),f.createGeometry(e)}});
define(["./when-ca391574","./Cartesian2-5b63e672","./ArcType-2b58731c","./Transforms-5295b227","./Color-821fa62a","./ComponentDatatype-8f71e605","./Check-64f87f7d","./GeometryAttribute-7ef2d452","./GeometryAttributes-a356f820","./IndexDatatype-4e56bcfa","./Math-b53708b3","./PolylinePipeline-12a23b58","./RuntimeError-19cb26ba","./WebGLConstants-95ceb4e9","./EllipsoidGeodesic-bbea0b0a","./EllipsoidRhumbLine-6ee9af74","./IntersectionTests-f5111308","./Plane-99b2becd"],function(L,V,x,S,I,R,e,O,M,U,N,F,o,t,r,a,l,i){"use strict";function f(e){var o=(e=L.defaultValue(e,L.defaultValue.EMPTY_OBJECT)).positions,t=e.colors,r=L.defaultValue(e.colorsPerVertex,!1);this._positions=o,this._colors=t,this._colorsPerVertex=r,this._arcType=L.defaultValue(e.arcType,x.ArcType.GEODESIC),this._granularity=L.defaultValue(e.granularity,N.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=L.defaultValue(e.ellipsoid,V.Ellipsoid.WGS84),this._workerName="createSimplePolylineGeometry";o=1+o.length*V.Cartesian3.packedLength;o+=L.defined(t)?1+t.length*I.Color.packedLength:1,this.packedLength=o+V.Ellipsoid.packedLength+3}f.pack=function(e,o,t){var r;t=L.defaultValue(t,0);var a=e._positions,l=a.length;for(o[t++]=l,r=0;r<l;++r,t+=V.Cartesian3.packedLength)V.Cartesian3.pack(a[r],o,t);var i=e._colors,l=L.defined(i)?i.length:0;for(o[t++]=l,r=0;r<l;++r,t+=I.Color.packedLength)I.Color.pack(i[r],o,t);return V.Ellipsoid.pack(e._ellipsoid,o,t),t+=V.Ellipsoid.packedLength,o[t++]=e._colorsPerVertex?1:0,o[t++]=e._arcType,o[t]=e._granularity,o},f.unpack=function(e,o,t){o=L.defaultValue(o,0);for(var r=e[o++],a=new Array(r),l=0;l<r;++l,o+=V.Cartesian3.packedLength)a[l]=V.Cartesian3.unpack(e,o);var i=0<(r=e[o++])?new Array(r):void 0;for(l=0;l<r;++l,o+=I.Color.packedLength)i[l]=I.Color.unpack(e,o);var n=V.Ellipsoid.unpack(e,o);o+=V.Ellipsoid.packedLength;var s=1===e[o++],p=e[o++],d=e[o];return L.defined(t)?(t._positions=a,t._colors=i,t._ellipsoid=n,t._colorsPerVertex=s,t._arcType=p,t._granularity=d,t):new f({positions:a,colors:i,ellipsoid:n,colorsPerVertex:s,arcType:p,granularity:d})};var H=new Array(2),W=new Array(2),Y={positions:H,height:W,ellipsoid:void 0,minDistance:void 0,granularity:void 0};return f.createGeometry=function(e){var o=e._positions,t=e._colors,r=e._colorsPerVertex,a=e._arcType,l=e._granularity,e=e._ellipsoid,i=N.CesiumMath.chordLength(l,e.maximumRadius),n=L.defined(t)&&!r,s=o.length,p=0;if(a===x.ArcType.GEODESIC||a===x.ArcType.RHUMB){var d,f,y=a===x.ArcType.GEODESIC?(d=N.CesiumMath.chordLength(l,e.maximumRadius),f=F.PolylinePipeline.numberOfPoints,F.PolylinePipeline.generateArc):(d=l,f=F.PolylinePipeline.numberOfPointsRhumbLine,F.PolylinePipeline.generateRhumbArc),c=F.PolylinePipeline.extractHeights(o,e),u=Y;if(a===x.ArcType.GEODESIC?u.minDistance=i:u.granularity=l,u.ellipsoid=e,n){for(var h=0,C=0;C<s-1;C++)h+=f(o[C],o[C+1],d)+1;B=new Float64Array(3*h),A=new Uint8Array(4*h),u.positions=H,u.height=W;var T=0;for(C=0;C<s-1;++C){H[0]=o[C],H[1]=o[C+1],W[0]=c[C],W[1]=c[C+1];var g=y(u);if(L.defined(t))for(var m=g.length/3,b=t[C],P=0;P<m;++P)A[T++]=I.Color.floatToByte(b.red),A[T++]=I.Color.floatToByte(b.green),A[T++]=I.Color.floatToByte(b.blue),A[T++]=I.Color.floatToByte(b.alpha);B.set(g,p),p+=g.length}}else if(u.positions=o,u.height=c,B=new Float64Array(y(u)),L.defined(t)){for(A=new Uint8Array(B.length/3*4),C=0;C<s-1;++C)p=function(e,o,t,r,a,l,i){var n=F.PolylinePipeline.numberOfPoints(e,o,a),s=t.red,p=t.green,d=t.blue,f=t.alpha,y=r.red,e=r.green,o=r.blue,a=r.alpha;if(I.Color.equals(t,r)){for(g=0;g<n;g++)l[i++]=I.Color.floatToByte(s),l[i++]=I.Color.floatToByte(p),l[i++]=I.Color.floatToByte(d),l[i++]=I.Color.floatToByte(f);return i}for(var c=(y-s)/n,u=(e-p)/n,h=(o-d)/n,C=(a-f)/n,T=i,g=0;g<n;g++)l[T++]=I.Color.floatToByte(s+g*c),l[T++]=I.Color.floatToByte(p+g*u),l[T++]=I.Color.floatToByte(d+g*h),l[T++]=I.Color.floatToByte(f+g*C);return T}(o[C],o[C+1],t[C],t[C+1],i,A,p);var _=t[s-1];A[p++]=I.Color.floatToByte(_.red),A[p++]=I.Color.floatToByte(_.green),A[p++]=I.Color.floatToByte(_.blue),A[p++]=I.Color.floatToByte(_.alpha)}}else{var v=n?2*s-2:s,B=new Float64Array(3*v),A=L.defined(t)?new Uint8Array(4*v):void 0,E=0,k=0;for(C=0;C<s;++C){var G=o[C];if(n&&0<C&&(V.Cartesian3.pack(G,B,E),E+=3,b=t[C-1],A[k++]=I.Color.floatToByte(b.red),A[k++]=I.Color.floatToByte(b.green),A[k++]=I.Color.floatToByte(b.blue),A[k++]=I.Color.floatToByte(b.alpha)),n&&C===s-1)break;V.Cartesian3.pack(G,B,E),E+=3,L.defined(t)&&(b=t[C],A[k++]=I.Color.floatToByte(b.red),A[k++]=I.Color.floatToByte(b.green),A[k++]=I.Color.floatToByte(b.blue),A[k++]=I.Color.floatToByte(b.alpha))}}e=new M.GeometryAttributes;e.position=new O.GeometryAttribute({componentDatatype:R.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:B}),L.defined(t)&&(e.color=new O.GeometryAttribute({componentDatatype:R.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:4,values:A,normalize:!0}));var _=2*((v=B.length/3)-1),w=U.IndexDatatype.createTypedArray(v,_),D=0;for(C=0;C<v-1;++C)w[D++]=C,w[D++]=C+1;return new O.Geometry({attributes:e,indices:w,primitiveType:O.PrimitiveType.LINES,boundingSphere:S.BoundingSphere.fromPoints(o)})},function(e,o){return(e=L.defined(o)?f.unpack(e,o):e)._ellipsoid=V.Ellipsoid.clone(e._ellipsoid),f.createGeometry(e)}});

@@ -1,1 +0,1 @@

define(["./AttributeCompression-a99f24b9","./Cartesian2-5b63e672","./IndexDatatype-4e56bcfa","./Math-b53708b3","./createTaskProcessorWorker","./Check-64f87f7d","./when-ca391574","./WebGLConstants-95ceb4e9"],function(P,L,S,_,a,e,r,n){"use strict";var G=32767,W=new L.Cartographic,B=new L.Cartesian3;var z=new L.Rectangle,H=new L.Ellipsoid,O=new L.Cartesian3,Y={min:void 0,max:void 0};var Z=new L.Cartesian3,j=new L.Cartesian3,q=new L.Cartesian3,J=new L.Cartesian3,K=new L.Cartesian3;return a(function(a,e){var r=new Uint16Array(a.positions),n=new Uint16Array(a.widths),t=new Uint32Array(a.counts),i=new Uint16Array(a.batchIds);!function(a){a=new Float64Array(a);var e=0;Y.min=a[e++],Y.max=a[e++],L.Rectangle.unpack(a,2,z),e+=L.Rectangle.packedLength,L.Ellipsoid.unpack(a,e,H),e+=L.Ellipsoid.packedLength,L.Cartesian3.unpack(a,e,O)}(a.packedBuffer);for(var s=O,u=function(a,e,r,n,t){var i=a.length/3,s=a.subarray(0,i),u=a.subarray(i,2*i),c=a.subarray(2*i,3*i);P.AttributeCompression.zigZagDeltaDecode(s,u,c);for(var o=new Float64Array(a.length),f=0;f<i;++f){var p=s[f],C=u[f],b=c[f],p=_.CesiumMath.lerp(e.west,e.east,p/G),C=_.CesiumMath.lerp(e.south,e.north,C/G),b=_.CesiumMath.lerp(r,n,b/G),b=L.Cartographic.fromRadians(p,C,b,W),b=t.cartographicToCartesian(b,B);L.Cartesian3.pack(b,o,3*f)}return o}(r,z,Y.min,Y.max,H),r=4*(a=u.length/3)-4,c=new Float32Array(3*r),o=new Float32Array(3*r),f=new Float32Array(3*r),p=new Float32Array(2*r),C=new Uint16Array(r),b=0,d=0,w=0,h=0,l=t.length,y=0;y<l;++y){for(var k,v=t[y],A=n[y],g=i[y],m=0;m<v;++m){0===m?(E=L.Cartesian3.unpack(u,3*h,Z),x=L.Cartesian3.unpack(u,3*(h+1),j),k=L.Cartesian3.subtract(E,x,q),L.Cartesian3.add(E,k,k)):k=L.Cartesian3.unpack(u,3*(h+m-1),q);var x,E,D,I=L.Cartesian3.unpack(u,3*(h+m),J);m===v-1?(x=L.Cartesian3.unpack(u,3*(h+v-1),Z),E=L.Cartesian3.unpack(u,3*(h+v-2),j),D=L.Cartesian3.subtract(x,E,K),L.Cartesian3.add(x,D,D)):D=L.Cartesian3.unpack(u,3*(h+m+1),K),L.Cartesian3.subtract(k,s,k),L.Cartesian3.subtract(I,s,I),L.Cartesian3.subtract(D,s,D);for(var T=m===v-1?2:4,U=0===m?2:0;U<T;++U){L.Cartesian3.pack(I,c,b),L.Cartesian3.pack(k,o,b),L.Cartesian3.pack(D,f,b),b+=3;var F=U-2<0?-1:1;p[d++]=U%2*2-1,p[d++]=F*A,C[w++]=g}}h+=v}var N=S.IndexDatatype.createTypedArray(r,6*a-6),R=0,M=0,l=a-1;for(y=0;y<l;++y)N[M++]=R,N[M++]=R+2,N[M++]=R+1,N[M++]=R+1,N[M++]=R+2,N[M++]=R+3,R+=4;return e.push(c.buffer,o.buffer,f.buffer),e.push(p.buffer,C.buffer,N.buffer),{indexDatatype:2===N.BYTES_PER_ELEMENT?S.IndexDatatype.UNSIGNED_SHORT:S.IndexDatatype.UNSIGNED_INT,currentPositions:c.buffer,previousPositions:o.buffer,nextPositions:f.buffer,expandAndWidth:p.buffer,batchIds:C.buffer,indices:N.buffer}})});
define(["./Cartesian2-5b63e672","./AttributeCompression-a99f24b9","./Math-b53708b3","./IndexDatatype-4e56bcfa","./createTaskProcessorWorker","./Check-64f87f7d","./when-ca391574","./WebGLConstants-95ceb4e9"],function(P,L,S,_,a,e,r,n){"use strict";var G=32767,W=new P.Cartographic,B=new P.Cartesian3;var z=new P.Rectangle,H=new P.Ellipsoid,O=new P.Cartesian3,Y={min:void 0,max:void 0};var Z=new P.Cartesian3,j=new P.Cartesian3,q=new P.Cartesian3,J=new P.Cartesian3,K=new P.Cartesian3;return a(function(a,e){var r=new Uint16Array(a.positions),n=new Uint16Array(a.widths),t=new Uint32Array(a.counts),i=new Uint16Array(a.batchIds);!function(a){a=new Float64Array(a);var e=0;Y.min=a[e++],Y.max=a[e++],P.Rectangle.unpack(a,2,z),e+=P.Rectangle.packedLength,P.Ellipsoid.unpack(a,e,H),e+=P.Ellipsoid.packedLength,P.Cartesian3.unpack(a,e,O)}(a.packedBuffer);for(var s=O,u=function(a,e,r,n,t){var i=a.length/3,s=a.subarray(0,i),u=a.subarray(i,2*i),c=a.subarray(2*i,3*i);L.AttributeCompression.zigZagDeltaDecode(s,u,c);for(var o=new Float64Array(a.length),f=0;f<i;++f){var p=s[f],C=u[f],b=c[f],p=S.CesiumMath.lerp(e.west,e.east,p/G),C=S.CesiumMath.lerp(e.south,e.north,C/G),b=S.CesiumMath.lerp(r,n,b/G),b=P.Cartographic.fromRadians(p,C,b,W),b=t.cartographicToCartesian(b,B);P.Cartesian3.pack(b,o,3*f)}return o}(r,z,Y.min,Y.max,H),r=4*(a=u.length/3)-4,c=new Float32Array(3*r),o=new Float32Array(3*r),f=new Float32Array(3*r),p=new Float32Array(2*r),C=new Uint16Array(r),b=0,d=0,w=0,h=0,l=t.length,y=0;y<l;++y){for(var k,v=t[y],A=n[y],g=i[y],m=0;m<v;++m){0===m?(E=P.Cartesian3.unpack(u,3*h,Z),x=P.Cartesian3.unpack(u,3*(h+1),j),k=P.Cartesian3.subtract(E,x,q),P.Cartesian3.add(E,k,k)):k=P.Cartesian3.unpack(u,3*(h+m-1),q);var x,E,D,I=P.Cartesian3.unpack(u,3*(h+m),J);m===v-1?(x=P.Cartesian3.unpack(u,3*(h+v-1),Z),E=P.Cartesian3.unpack(u,3*(h+v-2),j),D=P.Cartesian3.subtract(x,E,K),P.Cartesian3.add(x,D,D)):D=P.Cartesian3.unpack(u,3*(h+m+1),K),P.Cartesian3.subtract(k,s,k),P.Cartesian3.subtract(I,s,I),P.Cartesian3.subtract(D,s,D);for(var T=m===v-1?2:4,U=0===m?2:0;U<T;++U){P.Cartesian3.pack(I,c,b),P.Cartesian3.pack(k,o,b),P.Cartesian3.pack(D,f,b),b+=3;var F=U-2<0?-1:1;p[d++]=U%2*2-1,p[d++]=F*A,C[w++]=g}}h+=v}var N=_.IndexDatatype.createTypedArray(r,6*a-6),R=0,M=0,l=a-1;for(y=0;y<l;++y)N[M++]=R,N[M++]=R+2,N[M++]=R+1,N[M++]=R+1,N[M++]=R+2,N[M++]=R+3,R+=4;return e.push(c.buffer,o.buffer,f.buffer),e.push(p.buffer,C.buffer,N.buffer),{indexDatatype:2===N.BYTES_PER_ELEMENT?_.IndexDatatype.UNSIGNED_SHORT:_.IndexDatatype.UNSIGNED_INT,currentPositions:c.buffer,previousPositions:o.buffer,nextPositions:f.buffer,expandAndWidth:p.buffer,batchIds:C.buffer,indices:N.buffer}})});

@@ -1,1 +0,1 @@

define(["./when-ca391574","./Cartesian2-5b63e672","./Transforms-5295b227","./ComponentDatatype-8f71e605","./Check-64f87f7d","./GeometryAttribute-7ef2d452","./GeometryAttributes-a356f820","./IndexDatatype-4e56bcfa","./Math-b53708b3","./VertexFormat-63b3c6da","./WallGeometryLibrary-3a48b1a1","./RuntimeError-19cb26ba","./WebGLConstants-95ceb4e9","./arrayRemoveDuplicates-fc9e255d","./PolylinePipeline-00f5e064","./EllipsoidGeodesic-bbea0b0a","./EllipsoidRhumbLine-21029cef","./IntersectionTests-f5111308","./Plane-99b2becd"],function(S,I,N,M,e,W,B,U,q,p,J,t,a,i,n,r,o,s,m){"use strict";var Y=new I.Cartesian3,Z=new I.Cartesian3,j=new I.Cartesian3,K=new I.Cartesian3,Q=new I.Cartesian3,X=new I.Cartesian3,$=new I.Cartesian3;function d(e){var t=(e=S.defaultValue(e,S.defaultValue.EMPTY_OBJECT)).positions,a=e.maximumHeights,i=e.minimumHeights,n=S.defaultValue(e.vertexFormat,p.VertexFormat.DEFAULT),r=S.defaultValue(e.granularity,q.CesiumMath.RADIANS_PER_DEGREE),e=S.defaultValue(e.ellipsoid,I.Ellipsoid.WGS84);this._positions=t,this._minimumHeights=i,this._maximumHeights=a,this._vertexFormat=p.VertexFormat.clone(n),this._granularity=r,this._ellipsoid=I.Ellipsoid.clone(e),this._workerName="createWallGeometry";t=1+t.length*I.Cartesian3.packedLength+2;S.defined(i)&&(t+=i.length),S.defined(a)&&(t+=a.length),this.packedLength=t+I.Ellipsoid.packedLength+p.VertexFormat.packedLength+1}d.pack=function(e,t,a){var i;a=S.defaultValue(a,0);var n=e._positions,r=n.length;for(t[a++]=r,i=0;i<r;++i,a+=I.Cartesian3.packedLength)I.Cartesian3.pack(n[i],t,a);var o=e._minimumHeights,r=S.defined(o)?o.length:0;if(t[a++]=r,S.defined(o))for(i=0;i<r;++i)t[a++]=o[i];var s=e._maximumHeights;if(r=S.defined(s)?s.length:0,t[a++]=r,S.defined(s))for(i=0;i<r;++i)t[a++]=s[i];return I.Ellipsoid.pack(e._ellipsoid,t,a),a+=I.Ellipsoid.packedLength,p.VertexFormat.pack(e._vertexFormat,t,a),t[a+=p.VertexFormat.packedLength]=e._granularity,t};var c=I.Ellipsoid.clone(I.Ellipsoid.UNIT_SPHERE),y=new p.VertexFormat,f={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:c,vertexFormat:y,granularity:void 0};return d.unpack=function(e,t,a){t=S.defaultValue(t,0);for(var i,n,r=e[t++],o=new Array(r),s=0;s<r;++s,t+=I.Cartesian3.packedLength)o[s]=I.Cartesian3.unpack(e,t);if(0<(r=e[t++]))for(i=new Array(r),s=0;s<r;++s)i[s]=e[t++];if(0<(r=e[t++]))for(n=new Array(r),s=0;s<r;++s)n[s]=e[t++];var m=I.Ellipsoid.unpack(e,t,c);t+=I.Ellipsoid.packedLength;var l=p.VertexFormat.unpack(e,t,y),u=e[t+=p.VertexFormat.packedLength];return S.defined(a)?(a._positions=o,a._minimumHeights=i,a._maximumHeights=n,a._ellipsoid=I.Ellipsoid.clone(m,a._ellipsoid),a._vertexFormat=p.VertexFormat.clone(l,a._vertexFormat),a._granularity=u,a):(f.positions=o,f.minimumHeights=i,f.maximumHeights=n,f.granularity=u,new d(f))},d.fromConstantHeights=function(e){var t=(e=S.defaultValue(e,S.defaultValue.EMPTY_OBJECT)).positions,a=e.minimumHeight,i=e.maximumHeight,n=S.defined(a),r=S.defined(i);if(n||r)for(var o=t.length,s=n?new Array(o):void 0,m=r?new Array(o):void 0,l=0;l<o;++l)n&&(s[l]=a),r&&(m[l]=i);return new d({positions:t,maximumHeights:m,minimumHeights:s,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat})},d.createGeometry=function(e){var t=e._positions,a=e._minimumHeights,i=e._maximumHeights,n=e._vertexFormat,r=e._granularity,o=e._ellipsoid,i=J.WallGeometryLibrary.computePositions(o,t,i,a,r,!0);if(S.defined(i)){for(var s=i.bottomPositions,m=i.topPositions,a=i.numCorners,l=m.length,r=2*l,u=n.position?new Float64Array(r):void 0,p=n.normal?new Float32Array(r):void 0,d=n.tangent?new Float32Array(r):void 0,c=n.bitangent?new Float32Array(r):void 0,y=n.st?new Float32Array(r/3*2):void 0,f=0,g=0,h=0,v=0,C=0,b=$,x=X,A=Q,_=!0,E=0,w=1/((l/=3)-a-1),F=0;F<l;++F){var L,k=3*F,H=I.Cartesian3.fromArray(m,k,Y),V=I.Cartesian3.fromArray(s,k,Z);n.position&&(u[f++]=V.x,u[f++]=V.y,u[f++]=V.z,u[f++]=H.x,u[f++]=H.y,u[f++]=H.z),n.st&&(y[C++]=E,y[C++]=0,y[C++]=E,y[C++]=1),(n.normal||n.tangent||n.bitangent)&&(L=I.Cartesian3.clone(I.Cartesian3.ZERO,K),V=I.Cartesian3.subtract(H,o.geodeticSurfaceNormal(H,Z),Z),F+1<l&&(L=I.Cartesian3.fromArray(m,3+k,K)),_&&(k=I.Cartesian3.subtract(L,H,j),V=I.Cartesian3.subtract(V,H,Y),b=I.Cartesian3.normalize(I.Cartesian3.cross(V,k,b),b),_=!1),I.Cartesian3.equalsEpsilon(H,L,q.CesiumMath.EPSILON10)?_=!0:(E+=w,n.tangent&&(x=I.Cartesian3.normalize(I.Cartesian3.subtract(L,H,x),x)),n.bitangent&&(A=I.Cartesian3.normalize(I.Cartesian3.cross(b,x,A),A))),n.normal&&(p[g++]=b.x,p[g++]=b.y,p[g++]=b.z,p[g++]=b.x,p[g++]=b.y,p[g++]=b.z),n.tangent&&(d[v++]=x.x,d[v++]=x.y,d[v++]=x.z,d[v++]=x.x,d[v++]=x.y,d[v++]=x.z),n.bitangent&&(c[h++]=A.x,c[h++]=A.y,c[h++]=A.z,c[h++]=A.x,c[h++]=A.y,c[h++]=A.z))}i=new B.GeometryAttributes;n.position&&(i.position=new W.GeometryAttribute({componentDatatype:M.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:u})),n.normal&&(i.normal=new W.GeometryAttribute({componentDatatype:M.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:p})),n.tangent&&(i.tangent=new W.GeometryAttribute({componentDatatype:M.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:d})),n.bitangent&&(i.bitangent=new W.GeometryAttribute({componentDatatype:M.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:c})),n.st&&(i.st=new W.GeometryAttribute({componentDatatype:M.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:y}));var G=r/3;r-=6*(a+1);var D=U.IndexDatatype.createTypedArray(G,r),P=0;for(F=0;F<G-2;F+=2){var T=F,z=F+2,O=I.Cartesian3.fromArray(u,3*T,Y),R=I.Cartesian3.fromArray(u,3*z,Z);I.Cartesian3.equalsEpsilon(O,R,q.CesiumMath.EPSILON10)||(O=F+1,R=F+3,D[P++]=O,D[P++]=T,D[P++]=R,D[P++]=R,D[P++]=T,D[P++]=z)}return new W.Geometry({attributes:i,indices:D,primitiveType:W.PrimitiveType.TRIANGLES,boundingSphere:new N.BoundingSphere.fromVertices(u)})}},function(e,t){return(e=S.defined(t)?d.unpack(e,t):e)._ellipsoid=I.Ellipsoid.clone(e._ellipsoid),d.createGeometry(e)}});
define(["./when-ca391574","./Cartesian2-5b63e672","./Transforms-5295b227","./ComponentDatatype-8f71e605","./Check-64f87f7d","./GeometryAttribute-7ef2d452","./GeometryAttributes-a356f820","./IndexDatatype-4e56bcfa","./Math-b53708b3","./VertexFormat-63b3c6da","./WallGeometryLibrary-2fbf332a","./RuntimeError-19cb26ba","./WebGLConstants-95ceb4e9","./arrayRemoveDuplicates-fc9e255d","./PolylinePipeline-12a23b58","./EllipsoidGeodesic-bbea0b0a","./EllipsoidRhumbLine-6ee9af74","./IntersectionTests-f5111308","./Plane-99b2becd"],function(S,I,N,M,e,W,B,U,q,p,J,t,a,i,n,r,o,s,m){"use strict";var Y=new I.Cartesian3,Z=new I.Cartesian3,j=new I.Cartesian3,K=new I.Cartesian3,Q=new I.Cartesian3,X=new I.Cartesian3,$=new I.Cartesian3;function d(e){var t=(e=S.defaultValue(e,S.defaultValue.EMPTY_OBJECT)).positions,a=e.maximumHeights,i=e.minimumHeights,n=S.defaultValue(e.vertexFormat,p.VertexFormat.DEFAULT),r=S.defaultValue(e.granularity,q.CesiumMath.RADIANS_PER_DEGREE),e=S.defaultValue(e.ellipsoid,I.Ellipsoid.WGS84);this._positions=t,this._minimumHeights=i,this._maximumHeights=a,this._vertexFormat=p.VertexFormat.clone(n),this._granularity=r,this._ellipsoid=I.Ellipsoid.clone(e),this._workerName="createWallGeometry";t=1+t.length*I.Cartesian3.packedLength+2;S.defined(i)&&(t+=i.length),S.defined(a)&&(t+=a.length),this.packedLength=t+I.Ellipsoid.packedLength+p.VertexFormat.packedLength+1}d.pack=function(e,t,a){var i;a=S.defaultValue(a,0);var n=e._positions,r=n.length;for(t[a++]=r,i=0;i<r;++i,a+=I.Cartesian3.packedLength)I.Cartesian3.pack(n[i],t,a);var o=e._minimumHeights,r=S.defined(o)?o.length:0;if(t[a++]=r,S.defined(o))for(i=0;i<r;++i)t[a++]=o[i];var s=e._maximumHeights;if(r=S.defined(s)?s.length:0,t[a++]=r,S.defined(s))for(i=0;i<r;++i)t[a++]=s[i];return I.Ellipsoid.pack(e._ellipsoid,t,a),a+=I.Ellipsoid.packedLength,p.VertexFormat.pack(e._vertexFormat,t,a),t[a+=p.VertexFormat.packedLength]=e._granularity,t};var c=I.Ellipsoid.clone(I.Ellipsoid.UNIT_SPHERE),y=new p.VertexFormat,f={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:c,vertexFormat:y,granularity:void 0};return d.unpack=function(e,t,a){t=S.defaultValue(t,0);for(var i,n,r=e[t++],o=new Array(r),s=0;s<r;++s,t+=I.Cartesian3.packedLength)o[s]=I.Cartesian3.unpack(e,t);if(0<(r=e[t++]))for(i=new Array(r),s=0;s<r;++s)i[s]=e[t++];if(0<(r=e[t++]))for(n=new Array(r),s=0;s<r;++s)n[s]=e[t++];var m=I.Ellipsoid.unpack(e,t,c);t+=I.Ellipsoid.packedLength;var l=p.VertexFormat.unpack(e,t,y),u=e[t+=p.VertexFormat.packedLength];return S.defined(a)?(a._positions=o,a._minimumHeights=i,a._maximumHeights=n,a._ellipsoid=I.Ellipsoid.clone(m,a._ellipsoid),a._vertexFormat=p.VertexFormat.clone(l,a._vertexFormat),a._granularity=u,a):(f.positions=o,f.minimumHeights=i,f.maximumHeights=n,f.granularity=u,new d(f))},d.fromConstantHeights=function(e){var t=(e=S.defaultValue(e,S.defaultValue.EMPTY_OBJECT)).positions,a=e.minimumHeight,i=e.maximumHeight,n=S.defined(a),r=S.defined(i);if(n||r)for(var o=t.length,s=n?new Array(o):void 0,m=r?new Array(o):void 0,l=0;l<o;++l)n&&(s[l]=a),r&&(m[l]=i);return new d({positions:t,maximumHeights:m,minimumHeights:s,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat})},d.createGeometry=function(e){var t=e._positions,a=e._minimumHeights,i=e._maximumHeights,n=e._vertexFormat,r=e._granularity,o=e._ellipsoid,i=J.WallGeometryLibrary.computePositions(o,t,i,a,r,!0);if(S.defined(i)){for(var s=i.bottomPositions,m=i.topPositions,a=i.numCorners,l=m.length,r=2*l,u=n.position?new Float64Array(r):void 0,p=n.normal?new Float32Array(r):void 0,d=n.tangent?new Float32Array(r):void 0,c=n.bitangent?new Float32Array(r):void 0,y=n.st?new Float32Array(r/3*2):void 0,f=0,g=0,h=0,b=0,v=0,C=$,x=X,A=Q,_=!0,E=0,w=1/((l/=3)-a-1),F=0;F<l;++F){var L,k=3*F,H=I.Cartesian3.fromArray(m,k,Y),V=I.Cartesian3.fromArray(s,k,Z);n.position&&(u[f++]=V.x,u[f++]=V.y,u[f++]=V.z,u[f++]=H.x,u[f++]=H.y,u[f++]=H.z),n.st&&(y[v++]=E,y[v++]=0,y[v++]=E,y[v++]=1),(n.normal||n.tangent||n.bitangent)&&(L=I.Cartesian3.clone(I.Cartesian3.ZERO,K),V=I.Cartesian3.subtract(H,o.geodeticSurfaceNormal(H,Z),Z),F+1<l&&(L=I.Cartesian3.fromArray(m,3+k,K)),_&&(k=I.Cartesian3.subtract(L,H,j),V=I.Cartesian3.subtract(V,H,Y),C=I.Cartesian3.normalize(I.Cartesian3.cross(V,k,C),C),_=!1),I.Cartesian3.equalsEpsilon(H,L,q.CesiumMath.EPSILON10)?_=!0:(E+=w,n.tangent&&(x=I.Cartesian3.normalize(I.Cartesian3.subtract(L,H,x),x)),n.bitangent&&(A=I.Cartesian3.normalize(I.Cartesian3.cross(C,x,A),A))),n.normal&&(p[g++]=C.x,p[g++]=C.y,p[g++]=C.z,p[g++]=C.x,p[g++]=C.y,p[g++]=C.z),n.tangent&&(d[b++]=x.x,d[b++]=x.y,d[b++]=x.z,d[b++]=x.x,d[b++]=x.y,d[b++]=x.z),n.bitangent&&(c[h++]=A.x,c[h++]=A.y,c[h++]=A.z,c[h++]=A.x,c[h++]=A.y,c[h++]=A.z))}i=new B.GeometryAttributes;n.position&&(i.position=new W.GeometryAttribute({componentDatatype:M.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:u})),n.normal&&(i.normal=new W.GeometryAttribute({componentDatatype:M.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:p})),n.tangent&&(i.tangent=new W.GeometryAttribute({componentDatatype:M.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:d})),n.bitangent&&(i.bitangent=new W.GeometryAttribute({componentDatatype:M.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:c})),n.st&&(i.st=new W.GeometryAttribute({componentDatatype:M.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:y}));var G=r/3;r-=6*(a+1);var D=U.IndexDatatype.createTypedArray(G,r),P=0;for(F=0;F<G-2;F+=2){var T=F,z=F+2,O=I.Cartesian3.fromArray(u,3*T,Y),R=I.Cartesian3.fromArray(u,3*z,Z);I.Cartesian3.equalsEpsilon(O,R,q.CesiumMath.EPSILON10)||(O=F+1,R=F+3,D[P++]=O,D[P++]=T,D[P++]=R,D[P++]=R,D[P++]=T,D[P++]=z)}return new W.Geometry({attributes:i,indices:D,primitiveType:W.PrimitiveType.TRIANGLES,boundingSphere:new N.BoundingSphere.fromVertices(u)})}},function(e,t){return(e=S.defined(t)?d.unpack(e,t):e)._ellipsoid=I.Ellipsoid.clone(e._ellipsoid),d.createGeometry(e)}});

@@ -1,1 +0,1 @@

define(["./when-ca391574","./Cartesian2-5b63e672","./Transforms-5295b227","./ComponentDatatype-8f71e605","./Check-64f87f7d","./GeometryAttribute-7ef2d452","./GeometryAttributes-a356f820","./IndexDatatype-4e56bcfa","./Math-b53708b3","./WallGeometryLibrary-3a48b1a1","./RuntimeError-19cb26ba","./WebGLConstants-95ceb4e9","./arrayRemoveDuplicates-fc9e255d","./PolylinePipeline-00f5e064","./EllipsoidGeodesic-bbea0b0a","./EllipsoidRhumbLine-21029cef","./IntersectionTests-f5111308","./Plane-99b2becd"],function(b,v,C,H,e,A,k,w,G,L,i,t,a,n,r,o,s,l){"use strict";var x=new v.Cartesian3,P=new v.Cartesian3;function d(e){var i=(e=b.defaultValue(e,b.defaultValue.EMPTY_OBJECT)).positions,t=e.maximumHeights,a=e.minimumHeights,n=b.defaultValue(e.granularity,G.CesiumMath.RADIANS_PER_DEGREE),e=b.defaultValue(e.ellipsoid,v.Ellipsoid.WGS84);this._positions=i,this._minimumHeights=a,this._maximumHeights=t,this._granularity=n,this._ellipsoid=v.Ellipsoid.clone(e),this._workerName="createWallOutlineGeometry";i=1+i.length*v.Cartesian3.packedLength+2;b.defined(a)&&(i+=a.length),b.defined(t)&&(i+=t.length),this.packedLength=i+v.Ellipsoid.packedLength+1}d.pack=function(e,i,t){var a;t=b.defaultValue(t,0);var n=e._positions,r=n.length;for(i[t++]=r,a=0;a<r;++a,t+=v.Cartesian3.packedLength)v.Cartesian3.pack(n[a],i,t);var o=e._minimumHeights,r=b.defined(o)?o.length:0;if(i[t++]=r,b.defined(o))for(a=0;a<r;++a)i[t++]=o[a];var s=e._maximumHeights;if(r=b.defined(s)?s.length:0,i[t++]=r,b.defined(s))for(a=0;a<r;++a)i[t++]=s[a];return v.Ellipsoid.pack(e._ellipsoid,i,t),i[t+=v.Ellipsoid.packedLength]=e._granularity,i};var u=v.Ellipsoid.clone(v.Ellipsoid.UNIT_SPHERE),p={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:u,granularity:void 0};return d.unpack=function(e,i,t){i=b.defaultValue(i,0);for(var a,n,r=e[i++],o=new Array(r),s=0;s<r;++s,i+=v.Cartesian3.packedLength)o[s]=v.Cartesian3.unpack(e,i);if(0<(r=e[i++]))for(a=new Array(r),s=0;s<r;++s)a[s]=e[i++];if(0<(r=e[i++]))for(n=new Array(r),s=0;s<r;++s)n[s]=e[i++];var l=v.Ellipsoid.unpack(e,i,u),m=e[i+=v.Ellipsoid.packedLength];return b.defined(t)?(t._positions=o,t._minimumHeights=a,t._maximumHeights=n,t._ellipsoid=v.Ellipsoid.clone(l,t._ellipsoid),t._granularity=m,t):(p.positions=o,p.minimumHeights=a,p.maximumHeights=n,p.granularity=m,new d(p))},d.fromConstantHeights=function(e){var i=(e=b.defaultValue(e,b.defaultValue.EMPTY_OBJECT)).positions,t=e.minimumHeight,a=e.maximumHeight,n=b.defined(t),r=b.defined(a);if(n||r)for(var o=i.length,s=n?new Array(o):void 0,l=r?new Array(o):void 0,m=0;m<o;++m)n&&(s[m]=t),r&&(l[m]=a);return new d({positions:i,maximumHeights:l,minimumHeights:s,ellipsoid:e.ellipsoid})},d.createGeometry=function(e){var i=e._positions,t=e._minimumHeights,a=e._maximumHeights,n=e._granularity,e=e._ellipsoid,t=L.WallGeometryLibrary.computePositions(e,i,a,t,n,!1);if(b.defined(t)){var r=t.bottomPositions,o=t.topPositions,s=o.length,n=2*s,l=new Float64Array(n),m=0;for(s/=3,c=0;c<s;++c){var d=3*c,u=v.Cartesian3.fromArray(o,d,x),d=v.Cartesian3.fromArray(r,d,P);l[m++]=d.x,l[m++]=d.y,l[m++]=d.z,l[m++]=u.x,l[m++]=u.y,l[m++]=u.z}for(var t=new k.GeometryAttributes({position:new A.GeometryAttribute({componentDatatype:H.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:l})}),p=n/3,n=2*p-4+p,f=w.IndexDatatype.createTypedArray(p,n),h=0,c=0;c<p-2;c+=2){var g=c,y=c+2,_=v.Cartesian3.fromArray(l,3*g,x),E=v.Cartesian3.fromArray(l,3*y,P);v.Cartesian3.equalsEpsilon(_,E,G.CesiumMath.EPSILON10)||(_=c+1,E=c+3,f[h++]=_,f[h++]=g,f[h++]=_,f[h++]=E,f[h++]=g,f[h++]=y)}return f[h++]=p-2,f[h++]=p-1,new A.Geometry({attributes:t,indices:f,primitiveType:A.PrimitiveType.LINES,boundingSphere:new C.BoundingSphere.fromVertices(l)})}},function(e,i){return(e=b.defined(i)?d.unpack(e,i):e)._ellipsoid=v.Ellipsoid.clone(e._ellipsoid),d.createGeometry(e)}});
define(["./when-ca391574","./Cartesian2-5b63e672","./Transforms-5295b227","./ComponentDatatype-8f71e605","./Check-64f87f7d","./GeometryAttribute-7ef2d452","./GeometryAttributes-a356f820","./IndexDatatype-4e56bcfa","./Math-b53708b3","./WallGeometryLibrary-2fbf332a","./RuntimeError-19cb26ba","./WebGLConstants-95ceb4e9","./arrayRemoveDuplicates-fc9e255d","./PolylinePipeline-12a23b58","./EllipsoidGeodesic-bbea0b0a","./EllipsoidRhumbLine-6ee9af74","./IntersectionTests-f5111308","./Plane-99b2becd"],function(b,v,C,H,e,A,k,w,G,L,i,t,a,n,r,o,s,l){"use strict";var x=new v.Cartesian3,P=new v.Cartesian3;function d(e){var i=(e=b.defaultValue(e,b.defaultValue.EMPTY_OBJECT)).positions,t=e.maximumHeights,a=e.minimumHeights,n=b.defaultValue(e.granularity,G.CesiumMath.RADIANS_PER_DEGREE),e=b.defaultValue(e.ellipsoid,v.Ellipsoid.WGS84);this._positions=i,this._minimumHeights=a,this._maximumHeights=t,this._granularity=n,this._ellipsoid=v.Ellipsoid.clone(e),this._workerName="createWallOutlineGeometry";i=1+i.length*v.Cartesian3.packedLength+2;b.defined(a)&&(i+=a.length),b.defined(t)&&(i+=t.length),this.packedLength=i+v.Ellipsoid.packedLength+1}d.pack=function(e,i,t){var a;t=b.defaultValue(t,0);var n=e._positions,r=n.length;for(i[t++]=r,a=0;a<r;++a,t+=v.Cartesian3.packedLength)v.Cartesian3.pack(n[a],i,t);var o=e._minimumHeights,r=b.defined(o)?o.length:0;if(i[t++]=r,b.defined(o))for(a=0;a<r;++a)i[t++]=o[a];var s=e._maximumHeights;if(r=b.defined(s)?s.length:0,i[t++]=r,b.defined(s))for(a=0;a<r;++a)i[t++]=s[a];return v.Ellipsoid.pack(e._ellipsoid,i,t),i[t+=v.Ellipsoid.packedLength]=e._granularity,i};var u=v.Ellipsoid.clone(v.Ellipsoid.UNIT_SPHERE),p={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:u,granularity:void 0};return d.unpack=function(e,i,t){i=b.defaultValue(i,0);for(var a,n,r=e[i++],o=new Array(r),s=0;s<r;++s,i+=v.Cartesian3.packedLength)o[s]=v.Cartesian3.unpack(e,i);if(0<(r=e[i++]))for(a=new Array(r),s=0;s<r;++s)a[s]=e[i++];if(0<(r=e[i++]))for(n=new Array(r),s=0;s<r;++s)n[s]=e[i++];var l=v.Ellipsoid.unpack(e,i,u),m=e[i+=v.Ellipsoid.packedLength];return b.defined(t)?(t._positions=o,t._minimumHeights=a,t._maximumHeights=n,t._ellipsoid=v.Ellipsoid.clone(l,t._ellipsoid),t._granularity=m,t):(p.positions=o,p.minimumHeights=a,p.maximumHeights=n,p.granularity=m,new d(p))},d.fromConstantHeights=function(e){var i=(e=b.defaultValue(e,b.defaultValue.EMPTY_OBJECT)).positions,t=e.minimumHeight,a=e.maximumHeight,n=b.defined(t),r=b.defined(a);if(n||r)for(var o=i.length,s=n?new Array(o):void 0,l=r?new Array(o):void 0,m=0;m<o;++m)n&&(s[m]=t),r&&(l[m]=a);return new d({positions:i,maximumHeights:l,minimumHeights:s,ellipsoid:e.ellipsoid})},d.createGeometry=function(e){var i=e._positions,t=e._minimumHeights,a=e._maximumHeights,n=e._granularity,e=e._ellipsoid,t=L.WallGeometryLibrary.computePositions(e,i,a,t,n,!1);if(b.defined(t)){var r=t.bottomPositions,o=t.topPositions,s=o.length,n=2*s,l=new Float64Array(n),m=0;for(s/=3,c=0;c<s;++c){var d=3*c,u=v.Cartesian3.fromArray(o,d,x),d=v.Cartesian3.fromArray(r,d,P);l[m++]=d.x,l[m++]=d.y,l[m++]=d.z,l[m++]=u.x,l[m++]=u.y,l[m++]=u.z}for(var t=new k.GeometryAttributes({position:new A.GeometryAttribute({componentDatatype:H.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:l})}),p=n/3,n=2*p-4+p,f=w.IndexDatatype.createTypedArray(p,n),h=0,c=0;c<p-2;c+=2){var g=c,y=c+2,_=v.Cartesian3.fromArray(l,3*g,x),E=v.Cartesian3.fromArray(l,3*y,P);v.Cartesian3.equalsEpsilon(_,E,G.CesiumMath.EPSILON10)||(_=c+1,E=c+3,f[h++]=_,f[h++]=g,f[h++]=_,f[h++]=E,f[h++]=g,f[h++]=y)}return f[h++]=p-2,f[h++]=p-1,new A.Geometry({attributes:t,indices:f,primitiveType:A.PrimitiveType.LINES,boundingSphere:new C.BoundingSphere.fromVertices(l)})}},function(e,i){return(e=b.defined(i)?d.unpack(e,i):e)._ellipsoid=v.Ellipsoid.clone(e._ellipsoid),d.createGeometry(e)}});
{
"name": "mars3d-cesium",
"version": "1.79.2",
"version": "1.80.0",
"description": "CesiumJS is a JavaScript library for creating 3D globes and 2D maps in a web browser without a plugin.",

@@ -5,0 +5,0 @@ "homepage": "http://mars3d.cn/",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc