Commit 625086b0 authored by p x's avatar p x
Browse files

init

parent 5e9d2300
Pipeline #3100 failed with stages
in 0 seconds
define(["exports"],(function(e){"use strict";const t={NONE:0,TOP:1,ALL:2};var r=Object.freeze(t);e.GeometryOffsetAttribute=r}));
\ No newline at end of file
define(["exports","./AttributeCompression-4d18cc04","./Matrix2-fc7e9822","./RuntimeError-c581ca93","./defaultValue-94c3e563","./ComponentDatatype-4a60b8d6","./Transforms-3ac41eb6","./EncodedCartesian3-d3e254ea","./GeometryAttribute-a441ff32","./IndexDatatype-db156785","./IntersectionTests-68fbc42d","./Plane-e20fba8c"],(function(e,t,r,n,i,a,o,s,u,l,p,c){"use strict";const d=new r.Cartesian3,f=new r.Cartesian3,m=new r.Cartesian3;function y(e,t,o,s,u){let l,p,c,y,h,v,C,b;if(n.Check.defined("point",e),n.Check.defined("p0",t),n.Check.defined("p1",o),n.Check.defined("p2",s),i.defined(u)||(u=new r.Cartesian3),i.defined(t.z)){if(r.Cartesian3.equalsEpsilon(e,t,a.CesiumMath.EPSILON14))return r.Cartesian3.clone(r.Cartesian3.UNIT_X,u);if(r.Cartesian3.equalsEpsilon(e,o,a.CesiumMath.EPSILON14))return r.Cartesian3.clone(r.Cartesian3.UNIT_Y,u);if(r.Cartesian3.equalsEpsilon(e,s,a.CesiumMath.EPSILON14))return r.Cartesian3.clone(r.Cartesian3.UNIT_Z,u);l=r.Cartesian3.subtract(o,t,d),p=r.Cartesian3.subtract(s,t,f),c=r.Cartesian3.subtract(e,t,m),y=r.Cartesian3.dot(l,l),h=r.Cartesian3.dot(l,p),v=r.Cartesian3.dot(l,c),C=r.Cartesian3.dot(p,p),b=r.Cartesian3.dot(p,c)}else{if(r.Cartesian2.equalsEpsilon(e,t,a.CesiumMath.EPSILON14))return r.Cartesian3.clone(r.Cartesian3.UNIT_X,u);if(r.Cartesian2.equalsEpsilon(e,o,a.CesiumMath.EPSILON14))return r.Cartesian3.clone(r.Cartesian3.UNIT_Y,u);if(r.Cartesian2.equalsEpsilon(e,s,a.CesiumMath.EPSILON14))return r.Cartesian3.clone(r.Cartesian3.UNIT_Z,u);l=r.Cartesian2.subtract(o,t,d),p=r.Cartesian2.subtract(s,t,f),c=r.Cartesian2.subtract(e,t,m),y=r.Cartesian2.dot(l,l),h=r.Cartesian2.dot(l,p),v=r.Cartesian2.dot(l,c),C=r.Cartesian2.dot(p,p),b=r.Cartesian2.dot(p,c)}u.y=C*v-h*b,u.z=y*b-h*v;const w=y*C-h*h;if(0!==w)return u.y/=w,u.z/=w,u.x=1-u.y-u.z,u}const h={calculateACMR:function(e){e=i.defaultValue(e,i.defaultValue.EMPTY_OBJECT);const t=e.indices;let r=e.maximumIndex;const a=i.defaultValue(e.cacheSize,24);if(!i.defined(t))throw new n.DeveloperError("indices is required.");const o=t.length;if(o<3||o%3!==0)throw new n.DeveloperError("indices length must be a multiple of three.");if(r<=0)throw new n.DeveloperError("maximumIndex must be greater than zero.");if(a<3)throw new n.DeveloperError("cacheSize must be greater than two.");if(!i.defined(r)){r=0;let e=0,n=t[e];while(e<o)n>r&&(r=n),++e,n=t[e]}const s=[];for(let n=0;n<r+1;n++)s[n]=0;let u=a+1;for(let n=0;n<o;++n)u-s[t[n]]>a&&(s[t[n]]=u,++u);return(u-a+1)/(o/3)},tipsify:function(e){e=i.defaultValue(e,i.defaultValue.EMPTY_OBJECT);const t=e.indices,r=e.maximumIndex,a=i.defaultValue(e.cacheSize,24);let o;function s(e,t,r,n){while(t.length>=1){const r=t[t.length-1];if(t.splice(t.length-1,1),e[r].numLiveTriangles>0)return r}while(o<n){if(e[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function u(e,t,r,n,i,a,o){let u,l=-1,p=-1,c=0;while(c<r.length){const e=r[c];n[e].numLiveTriangles&&(u=0,i-n[e].timeStamp+2*n[e].numLiveTriangles<=t&&(u=i-n[e].timeStamp),(u>p||-1===p)&&(p=u,l=e)),++c}return-1===l?s(n,a,e,o):l}if(!i.defined(t))throw new n.DeveloperError("indices is required.");const l=t.length;if(l<3||l%3!==0)throw new n.DeveloperError("indices length must be a multiple of three.");if(r<=0)throw new n.DeveloperError("maximumIndex must be greater than zero.");if(a<3)throw new n.DeveloperError("cacheSize must be greater than two.");let p=0,c=0,d=t[c];const f=l;if(i.defined(r))p=r+1;else{while(c<f)d>p&&(p=d),++c,d=t[c];if(-1===p)return 0;++p}const m=[];let y;for(y=0;y<p;y++)m[y]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};c=0;let h=0;while(c<f)m[t[c]].vertexTriangles.push(h),++m[t[c]].numLiveTriangles,m[t[c+1]].vertexTriangles.push(h),++m[t[c+1]].numLiveTriangles,m[t[c+2]].vertexTriangles.push(h),++m[t[c+2]].numLiveTriangles,++h,c+=3;let v=0,C=a+1;o=1;let b=[];const w=[];let g,T,A=0;const E=[],D=l/3,x=[];for(y=0;y<D;y++)x[y]=!1;let P,I;while(-1!==v){b=[],T=m[v],I=T.vertexTriangles.length;for(let e=0;e<I;++e)if(h=T.vertexTriangles[e],!x[h]){x[h]=!0,c=h+h+h;for(let e=0;e<3;++e)P=t[c],b.push(P),w.push(P),E[A]=P,++A,g=m[P],--g.numLiveTriangles,C-g.timeStamp>a&&(g.timeStamp=C,++C),++c}v=u(t,a,b,m,C,w,p)}return E}},v={};function C(e,t,r,n,i){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=i,e[t++]=i,e[t]=r}function b(e){const t=e.length,r=t/3*6,n=l.IndexDatatype.createTypedArray(t,r);let i=0;for(let a=0;a<t;a+=3,i+=6)C(n,i,e[a],e[a+1],e[a+2]);return n}function w(e){const t=e.length;if(t>=3){const r=6*(t-2),n=l.IndexDatatype.createTypedArray(t,r);C(n,0,e[0],e[1],e[2]);let i=6;for(let a=3;a<t;++a,i+=6)C(n,i,e[a-1],e[a],e[a-2]);return n}return new Uint16Array}function g(e){if(e.length>0){const t=e.length-1,r=6*(t-1),n=l.IndexDatatype.createTypedArray(t,r),i=e[0];let a=0;for(let o=1;o<t;++o,a+=6)C(n,a,i,e[o],e[o+1]);return n}return new Uint16Array}function T(e){const t={};for(const r in e)if(e.hasOwnProperty(r)&&i.defined(e[r])&&i.defined(e[r].values)){const n=e[r];t[r]=new u.GeometryAttribute({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function A(e,t,r){for(const n in t)if(t.hasOwnProperty(n)&&i.defined(t[n])&&i.defined(t[n].values)){const i=t[n];for(let t=0;t<i.componentsPerAttribute;++t)e[n].values.push(i.values[r*i.componentsPerAttribute+t])}}v.toWireframe=function(e){if(!i.defined(e))throw new n.DeveloperError("geometry is required.");const t=e.indices;if(i.defined(t)){switch(e.primitiveType){case u.PrimitiveType.TRIANGLES:e.indices=b(t);break;case u.PrimitiveType.TRIANGLE_STRIP:e.indices=w(t);break;case u.PrimitiveType.TRIANGLE_FAN:e.indices=g(t);break;default:throw new n.DeveloperError("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=u.PrimitiveType.LINES}return e},v.createLineSegmentsForVectors=function(e,t,r){if(t=i.defaultValue(t,"normal"),!i.defined(e))throw new n.DeveloperError("geometry is required.");if(!i.defined(e.attributes.position))throw new n.DeveloperError("geometry.attributes.position is required.");if(!i.defined(e.attributes[t]))throw new n.DeveloperError(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${t}.`);r=i.defaultValue(r,1e4);const s=e.attributes.position.values,l=e.attributes[t].values,p=s.length,c=new Float64Array(2*p);let d,f=0;for(let n=0;n<p;n+=3)c[f++]=s[n],c[f++]=s[n+1],c[f++]=s[n+2],c[f++]=s[n]+l[n]*r,c[f++]=s[n+1]+l[n+1]*r,c[f++]=s[n+2]+l[n+2]*r;const m=e.boundingSphere;return i.defined(m)&&(d=new o.BoundingSphere(m.center,m.radius+r)),new u.Geometry({attributes:{position:new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:c})},primitiveType:u.PrimitiveType.LINES,boundingSphere:d})},v.createAttributeLocations=function(e){if(!i.defined(e))throw new n.DeveloperError("geometry is required.");const t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],r=e.attributes,a={};let o,s=0;const u=t.length;for(o=0;o<u;++o){const e=t[o];i.defined(r[e])&&(a[e]=s++)}for(const n in r)r.hasOwnProperty(n)&&!i.defined(a[n])&&(a[n]=s++);return a},v.reorderForPreVertexCache=function(e){if(!i.defined(e))throw new n.DeveloperError("geometry is required.");const t=u.Geometry.computeNumberOfVertices(e),r=e.indices;if(i.defined(r)){const n=new Int32Array(t);for(let e=0;e<t;e++)n[e]=-1;const o=r,s=o.length,u=l.IndexDatatype.createTypedArray(t,s);let p,c=0,d=0,f=0;while(c<s)p=n[o[c]],-1!==p?u[d]=p:(p=o[c],n[p]=f,u[d]=f,++f),++c,++d;e.indices=u;const m=e.attributes;for(const e in m)if(m.hasOwnProperty(e)&&i.defined(m[e])&&i.defined(m[e].values)){const r=m[e],i=r.values;let o=0;const s=r.componentsPerAttribute,u=a.ComponentDatatype.createTypedArray(r.componentDatatype,f*s);while(o<t){const e=n[o];if(-1!==e)for(let t=0;t<s;t++)u[s*e+t]=i[s*o+t];++o}r.values=u}}return e},v.reorderForPostVertexCache=function(e,t){if(!i.defined(e))throw new n.DeveloperError("geometry is required.");const r=e.indices;if(e.primitiveType===u.PrimitiveType.TRIANGLES&&i.defined(r)){const n=r.length;let i=0;for(let e=0;e<n;e++)r[e]>i&&(i=r[e]);e.indices=h.tipsify({indices:r,maximumIndex:i,cacheSize:t})}return e},v.fitToUnsignedShortIndices=function(e){if(!i.defined(e))throw new n.DeveloperError("geometry is required.");if(i.defined(e.indices)&&e.primitiveType!==u.PrimitiveType.TRIANGLES&&e.primitiveType!==u.PrimitiveType.LINES&&e.primitiveType!==u.PrimitiveType.POINTS)throw new n.DeveloperError("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");const t=[],r=u.Geometry.computeNumberOfVertices(e);if(i.defined(e.indices)&&r>=a.CesiumMath.SIXTY_FOUR_KILOBYTES){let r=[],n=[],o=0,s=T(e.attributes);const l=e.indices,p=l.length;let c;e.primitiveType===u.PrimitiveType.TRIANGLES?c=3:e.primitiveType===u.PrimitiveType.LINES?c=2:e.primitiveType===u.PrimitiveType.POINTS&&(c=1);for(let d=0;d<p;d+=c){for(let t=0;t<c;++t){const a=l[d+t];let u=r[a];i.defined(u)||(u=o++,r[a]=u,A(s,e.attributes,a)),n.push(u)}o+c>=a.CesiumMath.SIXTY_FOUR_KILOBYTES&&(t.push(new u.Geometry({attributes:s,indices:n,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),r=[],n=[],o=0,s=T(e.attributes))}0!==n.length&&t.push(new u.Geometry({attributes:s,indices:n,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};const E=new r.Cartesian3,D=new r.Cartographic;v.projectTo2D=function(e,t,s,l,p){if(!i.defined(e))throw new n.DeveloperError("geometry is required.");if(!i.defined(t))throw new n.DeveloperError("attributeName is required.");if(!i.defined(s))throw new n.DeveloperError("attributeName3D is required.");if(!i.defined(l))throw new n.DeveloperError("attributeName2D is required.");if(!i.defined(e.attributes[t]))throw new n.DeveloperError(`geometry must have attribute matching the attributeName argument: ${t}.`);if(e.attributes[t].componentDatatype!==a.ComponentDatatype.DOUBLE)throw new n.DeveloperError("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");const c=e.attributes[t];p=i.defined(p)?p:new o.GeographicProjection;const d=p.ellipsoid,f=c.values,m=new Float64Array(f.length);let y=0;for(let a=0;a<f.length;a+=3){const e=r.Cartesian3.fromArray(f,a,E),t=d.cartesianToCartographic(e,D);if(!i.defined(t))throw new n.DeveloperError(`Could not project point (${e.x}, ${e.y}, ${e.z}) to 2D.`);const o=p.project(t,E);m[y++]=o.x,m[y++]=o.y,m[y++]=o.z}return e.attributes[s]=c,e.attributes[l]=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:m}),delete e.attributes[t],e};const x={high:0,low:0};v.encodeAttribute=function(e,t,r,o){if(!i.defined(e))throw new n.DeveloperError("geometry is required.");if(!i.defined(t))throw new n.DeveloperError("attributeName is required.");if(!i.defined(r))throw new n.DeveloperError("attributeHighName is required.");if(!i.defined(o))throw new n.DeveloperError("attributeLowName is required.");if(!i.defined(e.attributes[t]))throw new n.DeveloperError(`geometry must have attribute matching the attributeName argument: ${t}.`);if(e.attributes[t].componentDatatype!==a.ComponentDatatype.DOUBLE)throw new n.DeveloperError("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");const l=e.attributes[t],p=l.values,c=p.length,d=new Float32Array(c),f=new Float32Array(c);for(let n=0;n<c;++n)s.EncodedCartesian3.encode(p[n],x),d[n]=x.high,f[n]=x.low;const m=l.componentsPerAttribute;return e.attributes[r]=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:m,values:d}),e.attributes[o]=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:m,values:f}),delete e.attributes[t],e};let P=new r.Cartesian3;function I(e,t){if(i.defined(t)){const n=t.values,i=n.length;for(let t=0;t<i;t+=3)r.Cartesian3.unpack(n,t,P),r.Matrix4.multiplyByPoint(e,P,P),r.Cartesian3.pack(P,n,t)}}function S(e,t){if(i.defined(t)){const n=t.values,i=n.length;for(let t=0;t<i;t+=3)r.Cartesian3.unpack(n,t,P),r.Matrix3.multiplyByVector(e,P,P),P=r.Cartesian3.normalize(P,P),r.Cartesian3.pack(P,n,t)}}const N=new r.Matrix4,O=new r.Matrix3;function L(e,t){const r=e.length,n={},o=e[0][t].attributes;let s;for(s in o)if(o.hasOwnProperty(s)&&i.defined(o[s])&&i.defined(o[s].values)){const l=o[s];let p=l.values.length,c=!0;for(let n=1;n<r;++n){const r=e[n][t].attributes[s];if(!i.defined(r)||l.componentDatatype!==r.componentDatatype||l.componentsPerAttribute!==r.componentsPerAttribute||l.normalize!==r.normalize){c=!1;break}p+=r.values.length}c&&(n[s]=new u.GeometryAttribute({componentDatatype:l.componentDatatype,componentsPerAttribute:l.componentsPerAttribute,normalize:l.normalize,values:a.ComponentDatatype.createTypedArray(l.componentDatatype,p)}))}return n}v.transformToWorldCoordinates=function(e){if(!i.defined(e))throw new n.DeveloperError("instance is required.");const t=e.modelMatrix;if(r.Matrix4.equals(t,r.Matrix4.IDENTITY))return e;const a=e.geometry.attributes;I(t,a.position),I(t,a.prevPosition),I(t,a.nextPosition),(i.defined(a.normal)||i.defined(a.tangent)||i.defined(a.bitangent))&&(r.Matrix4.inverse(t,N),r.Matrix4.transpose(N,N),r.Matrix4.getMatrix3(N,O),S(O,a.normal),S(O,a.tangent),S(O,a.bitangent));const s=e.geometry.boundingSphere;return i.defined(s)&&(e.geometry.boundingSphere=o.BoundingSphere.transform(s,t,s)),e.modelMatrix=r.Matrix4.clone(r.Matrix4.IDENTITY),e};const z=new r.Cartesian3;function G(e,t){const a=e.length;let s,p,c,d;const f=e[0].modelMatrix,m=i.defined(e[0][t].indices),y=e[0][t].primitiveType;for(p=1;p<a;++p){if(!r.Matrix4.equals(e[p].modelMatrix,f))throw new n.DeveloperError("All instances must have the same modelMatrix.");if(i.defined(e[p][t].indices)!==m)throw new n.DeveloperError("All instance geometries must have an indices or not have one.");if(e[p][t].primitiveType!==y)throw new n.DeveloperError("All instance geometries must have the same primitiveType.")}const h=L(e,t);let v,C,b,w;for(s in h)if(h.hasOwnProperty(s))for(v=h[s].values,d=0,p=0;p<a;++p)for(C=e[p][t].attributes[s].values,b=C.length,c=0;c<b;++c)v[d++]=C[c];if(m){let r=0;for(p=0;p<a;++p)r+=e[p][t].indices.length;const n=u.Geometry.computeNumberOfVertices(new u.Geometry({attributes:h,primitiveType:u.PrimitiveType.POINTS})),i=l.IndexDatatype.createTypedArray(n,r);let o=0,s=0;for(p=0;p<a;++p){const r=e[p][t].indices,n=r.length;for(d=0;d<n;++d)i[o++]=s+r[d];s+=u.Geometry.computeNumberOfVertices(e[p][t])}w=i}let g,T=new r.Cartesian3,A=0;for(p=0;p<a;++p){if(g=e[p][t].boundingSphere,!i.defined(g)){T=void 0;break}r.Cartesian3.add(g.center,T,T)}if(i.defined(T))for(r.Cartesian3.divideByScalar(T,a,T),p=0;p<a;++p){g=e[p][t].boundingSphere;const n=r.Cartesian3.magnitude(r.Cartesian3.subtract(g.center,T,z))+g.radius;n>A&&(A=n)}return new u.Geometry({attributes:h,indices:w,primitiveType:y,boundingSphere:i.defined(T)?new o.BoundingSphere(T,A):void 0})}v.combineInstances=function(e){if(!i.defined(e)||e.length<1)throw new n.DeveloperError("instances is required and must have length greater than zero.");const t=[],r=[],a=e.length;for(let n=0;n<a;++n){const a=e[n];i.defined(a.geometry)?t.push(a):i.defined(a.westHemisphereGeometry)&&i.defined(a.eastHemisphereGeometry)&&r.push(a)}const o=[];return t.length>0&&o.push(G(t,"geometry")),r.length>0&&(o.push(G(r,"westHemisphereGeometry")),o.push(G(r,"eastHemisphereGeometry"))),o};const M=new r.Cartesian3,q=new r.Cartesian3,R=new r.Cartesian3,V=new r.Cartesian3;v.computeNormal=function(e){if(!i.defined(e))throw new n.DeveloperError("geometry is required.");if(!i.defined(e.attributes.position)||!i.defined(e.attributes.position.values))throw new n.DeveloperError("geometry.attributes.position.values is required.");if(!i.defined(e.indices))throw new n.DeveloperError("geometry.indices is required.");if(e.indices.length<2||e.indices.length%3!==0)throw new n.DeveloperError("geometry.indices length must be greater than 0 and be a multiple of 3.");if(e.primitiveType!==u.PrimitiveType.TRIANGLES)throw new n.DeveloperError("geometry.primitiveType must be PrimitiveType.TRIANGLES.");const t=e.indices,o=e.attributes,s=o.position.values,l=o.position.values.length/3,p=t.length,c=new Array(l),d=new Array(p/3),f=new Array(p);let m;for(m=0;m<l;m++)c[m]={indexOffset:0,count:0,currentCount:0};let y=0;for(m=0;m<p;m+=3){const e=t[m],n=t[m+1],i=t[m+2],a=3*e,o=3*n,u=3*i;q.x=s[a],q.y=s[a+1],q.z=s[a+2],R.x=s[o],R.y=s[o+1],R.z=s[o+2],V.x=s[u],V.y=s[u+1],V.z=s[u+2],c[e].count++,c[n].count++,c[i].count++,r.Cartesian3.subtract(R,q,R),r.Cartesian3.subtract(V,q,V),d[y]=r.Cartesian3.cross(R,V,new r.Cartesian3),y++}let h,v=0;for(m=0;m<l;m++)c[m].indexOffset+=v,v+=c[m].count;for(y=0,m=0;m<p;m+=3){h=c[t[m]];let e=h.indexOffset+h.currentCount;f[e]=y,h.currentCount++,h=c[t[m+1]],e=h.indexOffset+h.currentCount,f[e]=y,h.currentCount++,h=c[t[m+2]],e=h.indexOffset+h.currentCount,f[e]=y,h.currentCount++,y++}const C=new Float32Array(3*l);for(m=0;m<l;m++){const e=3*m;if(h=c[m],r.Cartesian3.clone(r.Cartesian3.ZERO,M),h.count>0){for(y=0;y<h.count;y++)r.Cartesian3.add(M,d[f[h.indexOffset+y]],M);r.Cartesian3.equalsEpsilon(r.Cartesian3.ZERO,M,a.CesiumMath.EPSILON10)&&r.Cartesian3.clone(d[f[h.indexOffset]],M)}r.Cartesian3.equalsEpsilon(r.Cartesian3.ZERO,M,a.CesiumMath.EPSILON10)&&(M.z=1),r.Cartesian3.normalize(M,M),C[e]=M.x,C[e+1]=M.y,C[e+2]=M.z}return e.attributes.normal=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:C}),e};const B=new r.Cartesian3,k=new r.Cartesian3,F=new r.Cartesian3;v.computeTangentAndBitangent=function(e){if(!i.defined(e))throw new n.DeveloperError("geometry is required.");const t=e.attributes,o=e.indices;if(!i.defined(t.position)||!i.defined(t.position.values))throw new n.DeveloperError("geometry.attributes.position.values is required.");if(!i.defined(t.normal)||!i.defined(t.normal.values))throw new n.DeveloperError("geometry.attributes.normal.values is required.");if(!i.defined(t.st)||!i.defined(t.st.values))throw new n.DeveloperError("geometry.attributes.st.values is required.");if(!i.defined(o))throw new n.DeveloperError("geometry.indices is required.");if(o.length<2||o.length%3!==0)throw new n.DeveloperError("geometry.indices length must be greater than 0 and be a multiple of 3.");if(e.primitiveType!==u.PrimitiveType.TRIANGLES)throw new n.DeveloperError("geometry.primitiveType must be PrimitiveType.TRIANGLES.");const s=e.attributes.position.values,l=e.attributes.normal.values,p=e.attributes.st.values,c=e.attributes.position.values.length/3,d=o.length,f=new Array(3*c);let m,y,h,v;for(m=0;m<f.length;m++)f[m]=0;for(m=0;m<d;m+=3){const e=o[m],t=o[m+1],r=o[m+2];y=3*e,h=3*t,v=3*r;const n=2*e,i=2*t,a=2*r,u=s[y],l=s[y+1],c=s[y+2],d=p[n],C=p[n+1],b=p[i+1]-C,w=p[a+1]-C,g=1/((p[i]-d)*w-(p[a]-d)*b),T=(w*(s[h]-u)-b*(s[v]-u))*g,A=(w*(s[h+1]-l)-b*(s[v+1]-l))*g,E=(w*(s[h+2]-c)-b*(s[v+2]-c))*g;f[y]+=T,f[y+1]+=A,f[y+2]+=E,f[h]+=T,f[h+1]+=A,f[h+2]+=E,f[v]+=T,f[v+1]+=A,f[v+2]+=E}const C=new Float32Array(3*c),b=new Float32Array(3*c);for(m=0;m<c;m++){y=3*m,h=y+1,v=y+2;const e=r.Cartesian3.fromArray(l,y,B),t=r.Cartesian3.fromArray(f,y,F),n=r.Cartesian3.dot(e,t);r.Cartesian3.multiplyByScalar(e,n,k),r.Cartesian3.normalize(r.Cartesian3.subtract(t,k,t),t),C[y]=t.x,C[h]=t.y,C[v]=t.z,r.Cartesian3.normalize(r.Cartesian3.cross(e,t,t),t),b[y]=t.x,b[h]=t.y,b[v]=t.z}return e.attributes.tangent=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:C}),e.attributes.bitangent=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:b}),e};const _=new r.Cartesian2,U=new r.Cartesian3,Y=new r.Cartesian3,Z=new r.Cartesian3;let H=new r.Cartesian2;function W(e){if(i.defined(e.indices))return e;const t=u.Geometry.computeNumberOfVertices(e);if(t<3)throw new n.DeveloperError("The number of vertices must be at least three.");if(t%3!==0)throw new n.DeveloperError("The number of vertices must be a multiple of three.");const r=l.IndexDatatype.createTypedArray(t,t);for(let n=0;n<t;++n)r[n]=n;return e.indices=r,e}function $(e){const t=u.Geometry.computeNumberOfVertices(e);if(t<3)throw new n.DeveloperError("The number of vertices must be at least three.");const r=l.IndexDatatype.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;let i=3;for(let n=3;n<t;++n)r[i++]=n-1,r[i++]=0,r[i++]=n;return e.indices=r,e.primitiveType=u.PrimitiveType.TRIANGLES,e}function X(e){const t=u.Geometry.computeNumberOfVertices(e);if(t<3)throw new n.DeveloperError("The number of vertices must be at least 3.");const r=l.IndexDatatype.createTypedArray(t,3*(t-2));r[0]=0,r[1]=1,r[2]=2,t>3&&(r[3]=0,r[4]=2,r[5]=3);let i=6;for(let n=3;n<t-1;n+=2)r[i++]=n,r[i++]=n-1,r[i++]=n+1,n+2<t&&(r[i++]=n,r[i++]=n+1,r[i++]=n+2);return e.indices=r,e.primitiveType=u.PrimitiveType.TRIANGLES,e}function j(e){if(i.defined(e.indices))return e;const t=u.Geometry.computeNumberOfVertices(e);if(t<2)throw new n.DeveloperError("The number of vertices must be at least two.");if(t%2!==0)throw new n.DeveloperError("The number of vertices must be a multiple of 2.");const r=l.IndexDatatype.createTypedArray(t,t);for(let n=0;n<t;++n)r[n]=n;return e.indices=r,e}function J(e){const t=u.Geometry.computeNumberOfVertices(e);if(t<2)throw new n.DeveloperError("The number of vertices must be at least two.");const r=l.IndexDatatype.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;let i=2;for(let n=2;n<t;++n)r[i++]=n-1,r[i++]=n;return e.indices=r,e.primitiveType=u.PrimitiveType.LINES,e}function K(e){const t=u.Geometry.computeNumberOfVertices(e);if(t<2)throw new n.DeveloperError("The number of vertices must be at least two.");const r=l.IndexDatatype.createTypedArray(t,2*t);r[0]=0,r[1]=1;let i=2;for(let n=2;n<t;++n)r[i++]=n-1,r[i++]=n;return r[i++]=t-1,r[i]=0,e.indices=r,e.primitiveType=u.PrimitiveType.LINES,e}function Q(e){switch(e.primitiveType){case u.PrimitiveType.TRIANGLE_FAN:return $(e);case u.PrimitiveType.TRIANGLE_STRIP:return X(e);case u.PrimitiveType.TRIANGLES:return W(e);case u.PrimitiveType.LINE_STRIP:return J(e);case u.PrimitiveType.LINE_LOOP:return K(e);case u.PrimitiveType.LINES:return j(e)}return e}function ee(e,t){Math.abs(e.y)<a.CesiumMath.EPSILON6&&(e.y=t?-a.CesiumMath.EPSILON6:a.CesiumMath.EPSILON6)}function te(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return ee(e,e.y<0),ee(t,t.y<0),void ee(r,r.y<0);const n=Math.abs(e.y),i=Math.abs(t.y),o=Math.abs(r.y);let s;s=n>i?n>o?a.CesiumMath.sign(e.y):a.CesiumMath.sign(r.y):i>o?a.CesiumMath.sign(t.y):a.CesiumMath.sign(r.y);const u=s<0;ee(e,u),ee(t,u),ee(r,u)}v.compressVertices=function(e){if(!i.defined(e))throw new n.DeveloperError("geometry is required.");const o=e.attributes.extrudeDirection;let s,l;if(i.defined(o)){const n=o.values;l=n.length/3;const i=new Float32Array(2*l);let p=0;for(s=0;s<l;++s)r.Cartesian3.fromArray(n,3*s,U),r.Cartesian3.equals(U,r.Cartesian3.ZERO)?p+=2:(H=t.AttributeCompression.octEncodeInRange(U,65535,H),i[p++]=H.x,i[p++]=H.y);return e.attributes.compressedAttributes=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:i}),delete e.attributes.extrudeDirection,e}const p=e.attributes.normal,c=e.attributes.st,d=i.defined(p),f=i.defined(c);if(!d&&!f)return e;const m=e.attributes.tangent,y=e.attributes.bitangent,h=i.defined(m),v=i.defined(y);let C,b,w,g;d&&(C=p.values),f&&(b=c.values),h&&(w=m.values),v&&(g=y.values);const T=d?C.length:b.length,A=d?3:2;l=T/A;let E=l,D=f&&d?2:1;D+=h||v?1:0,E*=D;const x=new Float32Array(E);let P=0;for(s=0;s<l;++s){f&&(r.Cartesian2.fromArray(b,2*s,_),x[P++]=t.AttributeCompression.compressTextureCoordinates(_));const e=3*s;d&&i.defined(w)&&i.defined(g)?(r.Cartesian3.fromArray(C,e,U),r.Cartesian3.fromArray(w,e,Y),r.Cartesian3.fromArray(g,e,Z),t.AttributeCompression.octPack(U,Y,Z,_),x[P++]=_.x,x[P++]=_.y):(d&&(r.Cartesian3.fromArray(C,e,U),x[P++]=t.AttributeCompression.octEncodeFloat(U)),h&&(r.Cartesian3.fromArray(w,e,U),x[P++]=t.AttributeCompression.octEncodeFloat(U)),v&&(r.Cartesian3.fromArray(g,e,U),x[P++]=t.AttributeCompression.octEncodeFloat(U)))}return e.attributes.compressedAttributes=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:D,values:x}),d&&delete e.attributes.normal,f&&delete e.attributes.st,v&&delete e.attributes.bitangent,h&&delete e.attributes.tangent,e};const re=new r.Cartesian3;function ne(e,t,n,i){r.Cartesian3.add(e,r.Cartesian3.multiplyByScalar(r.Cartesian3.subtract(t,e,re),e.y/(e.y-t.y),re),n),r.Cartesian3.clone(n,i),ee(n,!0),ee(i,!1)}const ie=new r.Cartesian3,ae=new r.Cartesian3,oe=new r.Cartesian3,se=new r.Cartesian3,ue={positions:new Array(7),indices:new Array(9)};function le(e,t,r){if(e.x>=0||t.x>=0||r.x>=0)return;te(e,t,r);const n=e.y<0,i=t.y<0,a=r.y<0;let o=0;o+=n?1:0,o+=i?1:0,o+=a?1:0;const s=ue.indices;1===o?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,n?(ne(e,t,ie,oe),ne(e,r,ae,se),s[0]=0,s[3]=1,s[4]=2,s[6]=1):i?(ne(t,r,ie,oe),ne(t,e,ae,se),s[0]=1,s[3]=2,s[4]=0,s[6]=2):a&&(ne(r,e,ie,oe),ne(r,t,ae,se),s[0]=2,s[3]=0,s[4]=1,s[6]=0)):2===o&&(s[2]=4,s[4]=4,s[5]=3,s[7]=5,s[8]=6,n?i?a||(ne(r,e,ie,oe),ne(r,t,ae,se),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(ne(t,r,ie,oe),ne(t,e,ae,se),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(ne(e,t,ie,oe),ne(e,r,ae,se),s[0]=1,s[1]=2,s[3]=1,s[6]=0));const u=ue.positions;return u[0]=e,u[1]=t,u[2]=r,u.length=3,1!==o&&2!==o||(u[3]=ie,u[4]=ae,u[5]=oe,u[6]=se,u.length=7),ue}function pe(e,t){const r=e.attributes;if(0===r.position.values.length)return;for(const o in r)if(r.hasOwnProperty(o)&&i.defined(r[o])&&i.defined(r[o].values)){const e=r[o];e.values=a.ComponentDatatype.createTypedArray(e.componentDatatype,e.values)}const n=u.Geometry.computeNumberOfVertices(e);return e.indices=l.IndexDatatype.createTypedArray(n,e.indices),t&&(e.boundingSphere=o.BoundingSphere.fromVertices(r.position.values)),e}function ce(e){const t=e.attributes,r={};for(const n in t)if(t.hasOwnProperty(n)&&i.defined(t[n])&&i.defined(t[n].values)){const e=t[n];r[n]=new u.GeometryAttribute({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:[]})}return new u.Geometry({attributes:r,indices:[],primitiveType:e.primitiveType})}function de(e,t,r){const n=i.defined(e.geometry.boundingSphere);t=pe(t,n),r=pe(r,n),i.defined(r)&&!i.defined(t)?e.geometry=r:!i.defined(r)&&i.defined(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void 0)}function fe(e,t){const r=new e,n=new e,i=new e;return function(a,o,s,u,l,p,c,d){const f=e.fromArray(l,a*t,r),m=e.fromArray(l,o*t,n),y=e.fromArray(l,s*t,i);e.multiplyByScalar(f,u.x,f),e.multiplyByScalar(m,u.y,m),e.multiplyByScalar(y,u.z,y);const h=e.add(f,m,f);e.add(h,y,h),d&&e.normalize(h,h),e.pack(h,p,c*t)}}const me=fe(r.Cartesian4,4),ye=fe(r.Cartesian3,3),he=fe(r.Cartesian2,2),ve=function(e,t,r,n,i,o,s){const u=i[e]*n.x,l=i[t]*n.y,p=i[r]*n.z;o[s]=u+l+p>a.CesiumMath.EPSILON6?1:0},Ce=new r.Cartesian3,be=new r.Cartesian3,we=new r.Cartesian3,ge=new r.Cartesian3;function Te(e,t,n,a,o,s,u,l,p,c,d,f,m,h,v,C){if(!i.defined(s)&&!i.defined(u)&&!i.defined(l)&&!i.defined(p)&&!i.defined(c)&&0===h)return;const b=r.Cartesian3.fromArray(o,3*e,Ce),w=r.Cartesian3.fromArray(o,3*t,be),g=r.Cartesian3.fromArray(o,3*n,we),T=y(a,b,w,g,ge);if(i.defined(T)){if(i.defined(s)&&ye(e,t,n,T,s,f.normal.values,C,!0),i.defined(c)){const i=r.Cartesian3.fromArray(c,3*e,Ce),a=r.Cartesian3.fromArray(c,3*t,be),o=r.Cartesian3.fromArray(c,3*n,we);let s;r.Cartesian3.multiplyByScalar(i,T.x,i),r.Cartesian3.multiplyByScalar(a,T.y,a),r.Cartesian3.multiplyByScalar(o,T.z,o),r.Cartesian3.equals(i,r.Cartesian3.ZERO)&&r.Cartesian3.equals(a,r.Cartesian3.ZERO)&&r.Cartesian3.equals(o,r.Cartesian3.ZERO)?(s=Ce,s.x=0,s.y=0,s.z=0):(s=r.Cartesian3.add(i,a,i),r.Cartesian3.add(s,o,s),r.Cartesian3.normalize(s,s)),r.Cartesian3.pack(s,f.extrudeDirection.values,3*C)}if(i.defined(d)&&ve(e,t,n,T,d,f.applyOffset.values,C),i.defined(u)&&ye(e,t,n,T,u,f.tangent.values,C,!0),i.defined(l)&&ye(e,t,n,T,l,f.bitangent.values,C,!0),i.defined(p)&&he(e,t,n,T,p,f.st.values,C),h>0)for(let r=0;r<h;r++){const i=m[r];Ae(e,t,n,T,C,v[i],f[i])}}}function Ae(e,t,r,n,i,a,o){const s=a.componentsPerAttribute,u=a.values,l=o.values;switch(s){case 4:me(e,t,r,n,u,l,i,!1);break;case 3:ye(e,t,r,n,u,l,i,!1);break;case 2:he(e,t,r,n,u,l,i,!1);break;default:l[i]=u[e]*n.x+u[t]*n.y+u[r]*n.z}}function Ee(e,t,r,n,i,a){const o=e.position.values.length/3;if(-1!==i){const s=n[i],u=r[s];return-1===u?(r[s]=o,e.position.values.push(a.x,a.y,a.z),t.push(o),o):(t.push(u),u)}return e.position.values.push(a.x,a.y,a.z),t.push(o),o}const De={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function xe(e){const t=e.geometry,n=t.attributes,a=n.position.values,o=i.defined(n.normal)?n.normal.values:void 0,s=i.defined(n.bitangent)?n.bitangent.values:void 0,u=i.defined(n.tangent)?n.tangent.values:void 0,l=i.defined(n.st)?n.st.values:void 0,p=i.defined(n.extrudeDirection)?n.extrudeDirection.values:void 0,c=i.defined(n.applyOffset)?n.applyOffset.values:void 0,d=t.indices,f=[];for(const r in n)n.hasOwnProperty(r)&&!De[r]&&i.defined(n[r])&&f.push(r);const m=f.length,y=ce(t),h=ce(t);let v,C,b,w,g;const T=[];T.length=a.length/3;const A=[];for(A.length=a.length/3,g=0;g<T.length;++g)T[g]=-1,A[g]=-1;const E=d.length;for(g=0;g<E;g+=3){const e=d[g],t=d[g+1],E=d[g+2];let D=r.Cartesian3.fromArray(a,3*e),x=r.Cartesian3.fromArray(a,3*t),P=r.Cartesian3.fromArray(a,3*E);const I=le(D,x,P);if(i.defined(I)&&I.positions.length>3){const r=I.positions,i=I.indices,D=i.length;for(let x=0;x<D;++x){const D=i[x],P=r[D];P.y<0?(v=h.attributes,C=h.indices,b=T):(v=y.attributes,C=y.indices,b=A),w=Ee(v,C,b,d,D<3?g+D:-1,P),Te(e,t,E,P,a,o,u,s,l,p,c,v,f,m,n,w)}}else i.defined(I)&&(D=I.positions[0],x=I.positions[1],P=I.positions[2]),D.y<0?(v=h.attributes,C=h.indices,b=T):(v=y.attributes,C=y.indices,b=A),w=Ee(v,C,b,d,g,D),Te(e,t,E,D,a,o,u,s,l,p,c,v,f,m,n,w),w=Ee(v,C,b,d,g+1,x),Te(e,t,E,x,a,o,u,s,l,p,c,v,f,m,n,w),w=Ee(v,C,b,d,g+2,P),Te(e,t,E,P,a,o,u,s,l,p,c,v,f,m,n,w)}de(e,h,y)}const Pe=c.Plane.fromPointNormal(r.Cartesian3.ZERO,r.Cartesian3.UNIT_Y),Ie=new r.Cartesian3,Se=new r.Cartesian3;function Ne(e,t,n,o,s,u,l){if(!i.defined(l))return;const p=r.Cartesian3.fromArray(o,3*e,Ce);r.Cartesian3.equalsEpsilon(p,n,a.CesiumMath.EPSILON10)?u.applyOffset.values[s]=l[e]:u.applyOffset.values[s]=l[t]}function Oe(e){const t=e.geometry,n=t.attributes,o=n.position.values,s=i.defined(n.applyOffset)?n.applyOffset.values:void 0,u=t.indices,l=ce(t),c=ce(t);let d;const f=u.length,m=[];m.length=o.length/3;const y=[];for(y.length=o.length/3,d=0;d<m.length;++d)m[d]=-1,y[d]=-1;for(d=0;d<f;d+=2){const e=u[d],t=u[d+1],n=r.Cartesian3.fromArray(o,3*e,Ce),f=r.Cartesian3.fromArray(o,3*t,be);let h;Math.abs(n.y)<a.CesiumMath.EPSILON6&&(n.y<0?n.y=-a.CesiumMath.EPSILON6:n.y=a.CesiumMath.EPSILON6),Math.abs(f.y)<a.CesiumMath.EPSILON6&&(f.y<0?f.y=-a.CesiumMath.EPSILON6:f.y=a.CesiumMath.EPSILON6);let v=l.attributes,C=l.indices,b=y,w=c.attributes,g=c.indices,T=m;const A=p.IntersectionTests.lineSegmentPlane(n,f,Pe,we);if(i.defined(A)){const i=r.Cartesian3.multiplyByScalar(r.Cartesian3.UNIT_Y,5*a.CesiumMath.EPSILON9,Ie);n.y<0&&(r.Cartesian3.negate(i,i),v=c.attributes,C=c.indices,b=m,w=l.attributes,g=l.indices,T=y);const p=r.Cartesian3.add(A,i,Se);h=Ee(v,C,b,u,d,n),Ne(e,t,n,o,h,v,s),h=Ee(v,C,b,u,-1,p),Ne(e,t,p,o,h,v,s),r.Cartesian3.negate(i,i),r.Cartesian3.add(A,i,p),h=Ee(w,g,T,u,-1,p),Ne(e,t,p,o,h,w,s),h=Ee(w,g,T,u,d+1,f),Ne(e,t,f,o,h,w,s)}else{let r,i,a;n.y<0?(r=c.attributes,i=c.indices,a=m):(r=l.attributes,i=l.indices,a=y),h=Ee(r,i,a,u,d,n),Ne(e,t,n,o,h,r,s),h=Ee(r,i,a,u,d+1,f),Ne(e,t,f,o,h,r,s)}}de(e,c,l)}const Le=new r.Cartesian2,ze=new r.Cartesian2,Ge=new r.Cartesian3,Me=new r.Cartesian3,qe=new r.Cartesian3,Re=new r.Cartesian3,Ve=new r.Cartesian3,Be=new r.Cartesian3,ke=new r.Cartesian4;function Fe(e){const t=e.attributes,n=t.position.values,i=t.prevPosition.values,a=t.nextPosition.values,o=n.length;for(let s=0;s<o;s+=3){const e=r.Cartesian3.unpack(n,s,Ge);if(e.x>0)continue;const t=r.Cartesian3.unpack(i,s,Me);(e.y<0&&t.y>0||e.y>0&&t.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):r.Cartesian3.pack(e,i,s));const u=r.Cartesian3.unpack(a,s,qe);(e.y<0&&u.y>0||e.y>0&&u.y<0)&&(s+3<o?(a[s]=n[s+3],a[s+1]=n[s+4],a[s+2]=n[s+5]):r.Cartesian3.pack(e,a,s))}}const _e=5*a.CesiumMath.EPSILON9,Ue=a.CesiumMath.EPSILON6;function Ye(e){const t=e.geometry,n=t.attributes,o=n.position.values,s=n.prevPosition.values,u=n.nextPosition.values,l=n.expandAndWidth.values,c=i.defined(n.st)?n.st.values:void 0,d=i.defined(n.color)?n.color.values:void 0,f=ce(t),m=ce(t);let y,h,v,C=!1;const b=o.length/3;for(y=0;y<b;y+=4){const e=y,t=y+2,n=r.Cartesian3.fromArray(o,3*e,Ge),b=r.Cartesian3.fromArray(o,3*t,Me);if(Math.abs(n.y)<Ue)for(n.y=Ue*(b.y<0?-1:1),o[3*y+1]=n.y,o[3*(y+1)+1]=n.y,h=3*e;h<3*e+12;h+=3)s[h]=o[3*y],s[h+1]=o[3*y+1],s[h+2]=o[3*y+2];if(Math.abs(b.y)<Ue)for(b.y=Ue*(n.y<0?-1:1),o[3*(y+2)+1]=b.y,o[3*(y+3)+1]=b.y,h=3*e;h<3*e+12;h+=3)u[h]=o[3*(y+2)],u[h+1]=o[3*(y+2)+1],u[h+2]=o[3*(y+2)+2];let w=f.attributes,g=f.indices,T=m.attributes,A=m.indices;const E=p.IntersectionTests.lineSegmentPlane(n,b,Pe,Re);if(i.defined(E)){C=!0;const o=r.Cartesian3.multiplyByScalar(r.Cartesian3.UNIT_Y,_e,Ve);n.y<0&&(r.Cartesian3.negate(o,o),w=m.attributes,g=m.indices,T=f.attributes,A=f.indices);const p=r.Cartesian3.add(E,o,Be);w.position.values.push(n.x,n.y,n.z,n.x,n.y,n.z),w.position.values.push(p.x,p.y,p.z),w.position.values.push(p.x,p.y,p.z),w.prevPosition.values.push(s[3*e],s[3*e+1],s[3*e+2]),w.prevPosition.values.push(s[3*e+3],s[3*e+4],s[3*e+5]),w.prevPosition.values.push(n.x,n.y,n.z,n.x,n.y,n.z),w.nextPosition.values.push(p.x,p.y,p.z),w.nextPosition.values.push(p.x,p.y,p.z),w.nextPosition.values.push(p.x,p.y,p.z),w.nextPosition.values.push(p.x,p.y,p.z),r.Cartesian3.negate(o,o),r.Cartesian3.add(E,o,p),T.position.values.push(p.x,p.y,p.z),T.position.values.push(p.x,p.y,p.z),T.position.values.push(b.x,b.y,b.z,b.x,b.y,b.z),T.prevPosition.values.push(p.x,p.y,p.z),T.prevPosition.values.push(p.x,p.y,p.z),T.prevPosition.values.push(p.x,p.y,p.z),T.prevPosition.values.push(p.x,p.y,p.z),T.nextPosition.values.push(b.x,b.y,b.z,b.x,b.y,b.z),T.nextPosition.values.push(u[3*t],u[3*t+1],u[3*t+2]),T.nextPosition.values.push(u[3*t+3],u[3*t+4],u[3*t+5]);const D=r.Cartesian2.fromArray(l,2*e,Le),x=Math.abs(D.y);w.expandAndWidth.values.push(-1,x,1,x),w.expandAndWidth.values.push(-1,-x,1,-x),T.expandAndWidth.values.push(-1,x,1,x),T.expandAndWidth.values.push(-1,-x,1,-x);let P=r.Cartesian3.magnitudeSquared(r.Cartesian3.subtract(E,n,qe));if(P/=r.Cartesian3.magnitudeSquared(r.Cartesian3.subtract(b,n,qe)),i.defined(d)){const n=r.Cartesian4.fromArray(d,4*e,ke),i=r.Cartesian4.fromArray(d,4*t,ke),o=a.CesiumMath.lerp(n.x,i.x,P),s=a.CesiumMath.lerp(n.y,i.y,P),u=a.CesiumMath.lerp(n.z,i.z,P),l=a.CesiumMath.lerp(n.w,i.w,P);for(h=4*e;h<4*e+8;++h)w.color.values.push(d[h]);for(w.color.values.push(o,s,u,l),w.color.values.push(o,s,u,l),T.color.values.push(o,s,u,l),T.color.values.push(o,s,u,l),h=4*t;h<4*t+8;++h)T.color.values.push(d[h])}if(i.defined(c)){const n=r.Cartesian2.fromArray(c,2*e,Le),i=r.Cartesian2.fromArray(c,2*(y+3),ze),o=a.CesiumMath.lerp(n.x,i.x,P);for(h=2*e;h<2*e+4;++h)w.st.values.push(c[h]);for(w.st.values.push(o,n.y),w.st.values.push(o,i.y),T.st.values.push(o,n.y),T.st.values.push(o,i.y),h=2*t;h<2*t+4;++h)T.st.values.push(c[h])}v=w.position.values.length/3-4,g.push(v,v+2,v+1),g.push(v+1,v+2,v+3),v=T.position.values.length/3-4,A.push(v,v+2,v+1),A.push(v+1,v+2,v+3)}else{let e,t;for(n.y<0?(e=m.attributes,t=m.indices):(e=f.attributes,t=f.indices),e.position.values.push(n.x,n.y,n.z),e.position.values.push(n.x,n.y,n.z),e.position.values.push(b.x,b.y,b.z),e.position.values.push(b.x,b.y,b.z),h=3*y;h<3*y+12;++h)e.prevPosition.values.push(s[h]),e.nextPosition.values.push(u[h]);for(h=2*y;h<2*y+8;++h)e.expandAndWidth.values.push(l[h]),i.defined(c)&&e.st.values.push(c[h]);if(i.defined(d))for(h=4*y;h<4*y+16;++h)e.color.values.push(d[h]);v=e.position.values.length/3-4,t.push(v,v+2,v+1),t.push(v+1,v+2,v+3)}}C&&(Fe(m),Fe(f)),de(e,m,f)}v.splitLongitude=function(e){if(!i.defined(e))throw new n.DeveloperError("instance is required.");const t=e.geometry,r=t.boundingSphere;if(i.defined(r)){const t=r.center.x-r.radius;if(t>0||o.BoundingSphere.intersectPlane(r,c.Plane.ORIGIN_ZX_PLANE)!==o.Intersect.INTERSECTING)return e}if(t.geometryType!==u.GeometryType.NONE)switch(t.geometryType){case u.GeometryType.POLYLINES:Ye(e);break;case u.GeometryType.TRIANGLES:xe(e);break;case u.GeometryType.LINES:Oe(e);break}else Q(t),t.primitiveType===u.PrimitiveType.TRIANGLES?xe(e):t.primitiveType===u.PrimitiveType.LINES&&Oe(e);return e},e.GeometryPipeline=v}));
\ No newline at end of file
define(["exports","./defaultValue-94c3e563","./RuntimeError-c581ca93","./ComponentDatatype-4a60b8d6","./WebGLConstants-7dccdc96"],(function(e,r,t,n,a){"use strict";const i={UNSIGNED_BYTE:a.WebGLConstants.UNSIGNED_BYTE,UNSIGNED_SHORT:a.WebGLConstants.UNSIGNED_SHORT,UNSIGNED_INT:a.WebGLConstants.UNSIGNED_INT,getSizeInBytes:function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}throw new t.DeveloperError("indexDatatype is required and must be a valid IndexDatatype constant.")},fromSizeInBytes:function(e){switch(e){case 2:return i.UNSIGNED_SHORT;case 4:return i.UNSIGNED_INT;case 1:return i.UNSIGNED_BYTE;default:throw new t.DeveloperError("Size in bytes cannot be mapped to an IndexDatatype")}},validate:function(e){return r.defined(e)&&(e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT)},createTypedArray:function(e,a){if(!r.defined(e))throw new t.DeveloperError("numberOfVertices is required.");return e>=n.CesiumMath.SIXTY_FOUR_KILOBYTES?new Uint32Array(a):new Uint16Array(a)},createTypedArrayFromArrayBuffer:function(e,a,i,E){if(!r.defined(e))throw new t.DeveloperError("numberOfVertices is required.");if(!r.defined(a))throw new t.DeveloperError("sourceArray is required.");if(!r.defined(i))throw new t.DeveloperError("byteOffset is required.");return e>=n.CesiumMath.SIXTY_FOUR_KILOBYTES?new Uint32Array(a,i,E):new Uint16Array(a,i,E)},fromTypedArray:function(e){if(e instanceof Uint8Array)return i.UNSIGNED_BYTE;if(e instanceof Uint16Array)return i.UNSIGNED_SHORT;if(e instanceof Uint32Array)return i.UNSIGNED_INT;throw new t.DeveloperError("array must be a Uint8Array, Uint16Array, or Uint32Array.")}};var E=Object.freeze(i);e.IndexDatatype=E}));
\ No newline at end of file
define(["exports","./Matrix2-fc7e9822","./defaultValue-94c3e563","./RuntimeError-c581ca93","./Transforms-3ac41eb6","./ComponentDatatype-4a60b8d6"],(function(e,r,t,n,i,a){"use strict";const o={};function s(e,r,t){const n=e+r;return a.CesiumMath.sign(e)!==a.CesiumMath.sign(r)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(r)))<t?0:n}o.computeDiscriminant=function(e,r,t){if("number"!==typeof e)throw new n.DeveloperError("a is a required number.");if("number"!==typeof r)throw new n.DeveloperError("b is a required number.");if("number"!==typeof t)throw new n.DeveloperError("c is a required number.");const i=r*r-4*e*t;return i},o.computeRealRoots=function(e,r,t){if("number"!==typeof e)throw new n.DeveloperError("a is a required number.");if("number"!==typeof r)throw new n.DeveloperError("b is a required number.");if("number"!==typeof t)throw new n.DeveloperError("c is a required number.");let i;if(0===e)return 0===r?[]:[-t/r];if(0===r){if(0===t)return[0,0];const r=Math.abs(t),n=Math.abs(e);if(r<n&&r/n<a.CesiumMath.EPSILON14)return[0,0];if(r>n&&n/r<a.CesiumMath.EPSILON14)return[];if(i=-t/e,i<0)return[];const o=Math.sqrt(i);return[-o,o]}if(0===t)return i=-r/e,i<0?[i,0]:[0,i];const o=r*r,u=4*e*t,c=s(o,-u,a.CesiumMath.EPSILON14);if(c<0)return[];const d=-.5*s(r,a.CesiumMath.sign(r)*Math.sqrt(c),a.CesiumMath.EPSILON14);return r>0?[d/e,t/d]:[t/d,d/e]};const u={};function c(e,r,t,n){const i=e,a=r/3,o=t/3,s=n,u=i*o,c=a*s,d=a*a,l=o*o,f=i*o-d,h=i*s-a*o,m=a*s-l,p=4*f*m-h*h;let C,w;if(p<0){let e,r,t;d*c>=u*l?(e=i,r=f,t=-2*a*f+i*h):(e=s,r=m,t=-s*h+2*o*m);const n=t<0?-1:1,M=-n*Math.abs(e)*Math.sqrt(-p);w=-t+M;const b=w/2,g=b<0?-Math.pow(-b,1/3):Math.pow(b,1/3),q=w===M?-g:-r/g;return C=r<=0?g+q:-t/(g*g+q*q+r),d*c>=u*l?[(C-a)/i]:[-s/(C+o)]}const M=f,b=-2*a*f+i*h,g=m,q=-s*h+2*o*m,E=Math.sqrt(p),y=Math.sqrt(3)/2;let v=Math.abs(Math.atan2(i*E,-b)/3);C=2*Math.sqrt(-M);let D=Math.cos(v);w=C*D;let R=C*(-D/2-y*Math.sin(v));const S=w+R>2*a?w-a:R-a,O=i,x=S/O;v=Math.abs(Math.atan2(s*E,-q)/3),C=2*Math.sqrt(-g),D=Math.cos(v),w=C*D,R=C*(-D/2-y*Math.sin(v));const P=-s,N=w+R<2*o?w+o:R+o,L=P/N,I=O*N,z=-S*N-O*P,T=S*P,U=(o*z-a*T)/(-a*z+o*I);return x<=U?x<=L?U<=L?[x,U,L]:[x,L,U]:[L,x,U]:x<=L?[U,x,L]:U<=L?[U,L,x]:[L,U,x]}u.computeDiscriminant=function(e,r,t,i){if("number"!==typeof e)throw new n.DeveloperError("a is a required number.");if("number"!==typeof r)throw new n.DeveloperError("b is a required number.");if("number"!==typeof t)throw new n.DeveloperError("c is a required number.");if("number"!==typeof i)throw new n.DeveloperError("d is a required number.");const a=e*e,o=r*r,s=t*t,u=i*i,c=18*e*r*t*i+o*s-27*a*u-4*(e*s*t+o*r*i);return c},u.computeRealRoots=function(e,r,t,i){if("number"!==typeof e)throw new n.DeveloperError("a is a required number.");if("number"!==typeof r)throw new n.DeveloperError("b is a required number.");if("number"!==typeof t)throw new n.DeveloperError("c is a required number.");if("number"!==typeof i)throw new n.DeveloperError("d is a required number.");let a,s;if(0===e)return o.computeRealRoots(r,t,i);if(0===r){if(0===t){if(0===i)return[0,0,0];s=-i/e;const r=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3);return[r,r,r]}return 0===i?(a=o.computeRealRoots(e,0,t),0===a.Length?[0]:[a[0],0,a[1]]):c(e,0,t,i)}return 0===t?0===i?(s=-r/e,s<0?[s,0,0]:[0,0,s]):c(e,r,0,i):0===i?(a=o.computeRealRoots(e,r,t),0===a.length?[0]:a[1]<=0?[a[0],a[1],0]:a[0]>=0?[0,a[0],a[1]]:[a[0],0,a[1]]):c(e,r,t,i)};const d={};function l(e,r,t,n){const i=e*e,s=r-3*i/8,c=t-r*e/2+i*e/8,d=n-t*e/4+r*i/16-3*i*i/256,l=u.computeRealRoots(1,2*s,s*s-4*d,-c*c);if(l.length>0){const r=-e/4,t=l[l.length-1];if(Math.abs(t)<a.CesiumMath.EPSILON14){const e=o.computeRealRoots(1,s,d);if(2===e.length){const t=e[0],n=e[1];let i;if(t>=0&&n>=0){const e=Math.sqrt(t),i=Math.sqrt(n);return[r-i,r-e,r+e,r+i]}if(t>=0&&n<0)return i=Math.sqrt(t),[r-i,r+i];if(t<0&&n>=0)return i=Math.sqrt(n),[r-i,r+i]}return[]}if(t>0){const e=Math.sqrt(t),n=(s+t-c/e)/2,i=(s+t+c/e)/2,a=o.computeRealRoots(1,e,n),u=o.computeRealRoots(1,-e,i);return 0!==a.length?(a[0]+=r,a[1]+=r,0!==u.length?(u[0]+=r,u[1]+=r,a[1]<=u[0]?[a[0],a[1],u[0],u[1]]:u[1]<=a[0]?[u[0],u[1],a[0],a[1]]:a[0]>=u[0]&&a[1]<=u[1]?[u[0],a[0],a[1],u[1]]:u[0]>=a[0]&&u[1]<=a[1]?[a[0],u[0],u[1],a[1]]:a[0]>u[0]&&a[0]<u[1]?[u[0],a[0],u[1],a[1]]:[a[0],u[0],a[1],u[1]]):a):0!==u.length?(u[0]+=r,u[1]+=r,u):[]}}return[]}function f(e,r,t,n){const i=t*t,s=r*r,c=e*e,d=-2*r,l=t*e+s-4*n,f=c*n-t*r*e+i,h=u.computeRealRoots(1,d,l,f);if(h.length>0){const i=h[0],s=r-i,u=s*s,d=e/2,l=s/2,f=u-4*n,m=u+4*Math.abs(n),p=c-4*i,C=c+4*Math.abs(i);let w,M,b,g,q,E;if(i<0||f*C<p*m){const r=Math.sqrt(p);w=r/2,M=0===r?0:(e*l-t)/r}else{const r=Math.sqrt(f);w=0===r?0:(e*l-t)/r,M=r/2}0===d&&0===w?(b=0,g=0):a.CesiumMath.sign(d)===a.CesiumMath.sign(w)?(b=d+w,g=i/b):(g=d-w,b=i/g),0===l&&0===M?(q=0,E=0):a.CesiumMath.sign(l)===a.CesiumMath.sign(M)?(q=l+M,E=n/q):(E=l-M,q=n/E);const y=o.computeRealRoots(1,b,q),v=o.computeRealRoots(1,g,E);if(0!==y.length)return 0!==v.length?y[1]<=v[0]?[y[0],y[1],v[0],v[1]]:v[1]<=y[0]?[v[0],v[1],y[0],y[1]]:y[0]>=v[0]&&y[1]<=v[1]?[v[0],y[0],y[1],v[1]]:v[0]>=y[0]&&v[1]<=y[1]?[y[0],v[0],v[1],y[1]]:y[0]>v[0]&&y[0]<v[1]?[v[0],y[0],v[1],y[1]]:[y[0],v[0],y[1],v[1]]:y;if(0!==v.length)return v}return[]}function h(e,n){n=r.Cartesian3.clone(t.defaultValue(n,r.Cartesian3.ZERO)),r.Cartesian3.equals(n,r.Cartesian3.ZERO)||r.Cartesian3.normalize(n,n),this.origin=r.Cartesian3.clone(t.defaultValue(e,r.Cartesian3.ZERO)),this.direction=n}d.computeDiscriminant=function(e,r,t,i,a){if("number"!==typeof e)throw new n.DeveloperError("a is a required number.");if("number"!==typeof r)throw new n.DeveloperError("b is a required number.");if("number"!==typeof t)throw new n.DeveloperError("c is a required number.");if("number"!==typeof i)throw new n.DeveloperError("d is a required number.");if("number"!==typeof a)throw new n.DeveloperError("e is a required number.");const o=e*e,s=o*e,u=r*r,c=u*r,d=t*t,l=d*t,f=i*i,h=f*i,m=a*a,p=m*a,C=u*d*f-4*c*h-4*e*l*f+18*e*r*t*h-27*o*f*f+256*s*p+a*(18*c*t*i-4*u*l+16*e*d*d-80*e*r*d*i-6*e*u*f+144*o*t*f)+m*(144*e*u*t-27*u*u-128*o*d-192*o*r*i);return C},d.computeRealRoots=function(e,r,t,i,o){if("number"!==typeof e)throw new n.DeveloperError("a is a required number.");if("number"!==typeof r)throw new n.DeveloperError("b is a required number.");if("number"!==typeof t)throw new n.DeveloperError("c is a required number.");if("number"!==typeof i)throw new n.DeveloperError("d is a required number.");if("number"!==typeof o)throw new n.DeveloperError("e is a required number.");if(Math.abs(e)<a.CesiumMath.EPSILON15)return u.computeRealRoots(r,t,i,o);const s=r/e,c=t/e,d=i/e,h=o/e;let m=s<0?1:0;switch(m+=c<0?m+1:m,m+=d<0?m+1:m,m+=h<0?m+1:m,m){case 0:return l(s,c,d,h);case 1:return f(s,c,d,h);case 2:return f(s,c,d,h);case 3:return l(s,c,d,h);case 4:return l(s,c,d,h);case 5:return f(s,c,d,h);case 6:return l(s,c,d,h);case 7:return l(s,c,d,h);case 8:return f(s,c,d,h);case 9:return l(s,c,d,h);case 10:return l(s,c,d,h);case 11:return f(s,c,d,h);case 12:return l(s,c,d,h);case 13:return l(s,c,d,h);case 14:return l(s,c,d,h);case 15:return l(s,c,d,h);default:return}},h.clone=function(e,n){if(t.defined(e))return t.defined(n)?(n.origin=r.Cartesian3.clone(e.origin),n.direction=r.Cartesian3.clone(e.direction),n):new h(e.origin,e.direction)},h.getPoint=function(e,i,a){return n.Check.typeOf.object("ray",e),n.Check.typeOf.number("t",i),t.defined(a)||(a=new r.Cartesian3),a=r.Cartesian3.multiplyByScalar(e.direction,i,a),r.Cartesian3.add(e.origin,a,a)};const m={rayPlane:function(e,i,o){if(!t.defined(e))throw new n.DeveloperError("ray is required.");if(!t.defined(i))throw new n.DeveloperError("plane is required.");t.defined(o)||(o=new r.Cartesian3);const s=e.origin,u=e.direction,c=i.normal,d=r.Cartesian3.dot(c,u);if(Math.abs(d)<a.CesiumMath.EPSILON15)return;const l=(-i.distance-r.Cartesian3.dot(c,s))/d;return l<0?void 0:(o=r.Cartesian3.multiplyByScalar(u,l,o),r.Cartesian3.add(s,o,o))}},p=new r.Cartesian3,C=new r.Cartesian3,w=new r.Cartesian3,M=new r.Cartesian3,b=new r.Cartesian3;m.rayTriangleParametric=function(e,i,o,s,u){if(!t.defined(e))throw new n.DeveloperError("ray is required.");if(!t.defined(i))throw new n.DeveloperError("p0 is required.");if(!t.defined(o))throw new n.DeveloperError("p1 is required.");if(!t.defined(s))throw new n.DeveloperError("p2 is required.");u=t.defaultValue(u,!1);const c=e.origin,d=e.direction,l=r.Cartesian3.subtract(o,i,p),f=r.Cartesian3.subtract(s,i,C),h=r.Cartesian3.cross(d,f,w),m=r.Cartesian3.dot(l,h);let g,q,E,y,v;if(u){if(m<a.CesiumMath.EPSILON6)return;if(g=r.Cartesian3.subtract(c,i,M),E=r.Cartesian3.dot(g,h),E<0||E>m)return;if(q=r.Cartesian3.cross(g,l,b),y=r.Cartesian3.dot(d,q),y<0||E+y>m)return;v=r.Cartesian3.dot(f,q)/m}else{if(Math.abs(m)<a.CesiumMath.EPSILON6)return;const e=1/m;if(g=r.Cartesian3.subtract(c,i,M),E=r.Cartesian3.dot(g,h)*e,E<0||E>1)return;if(q=r.Cartesian3.cross(g,l,b),y=r.Cartesian3.dot(d,q)*e,y<0||E+y>1)return;v=r.Cartesian3.dot(f,q)*e}return v},m.rayTriangle=function(e,n,i,a,o,s){const u=m.rayTriangleParametric(e,n,i,a,o);if(t.defined(u)&&!(u<0))return t.defined(s)||(s=new r.Cartesian3),r.Cartesian3.multiplyByScalar(e.direction,u,s),r.Cartesian3.add(e.origin,s,s)};const g=new h;function q(e,r,t,n){const i=r*r-4*e*t;if(i<0)return;if(i>0){const t=1/(2*e),a=Math.sqrt(i),o=(-r+a)*t,s=(-r-a)*t;return o<s?(n.root0=o,n.root1=s):(n.root0=s,n.root1=o),n}const a=-r/(2*e);return 0!==a?(n.root0=n.root1=a,n):void 0}m.lineSegmentTriangle=function(e,i,a,o,s,u,c){if(!t.defined(e))throw new n.DeveloperError("v0 is required.");if(!t.defined(i))throw new n.DeveloperError("v1 is required.");if(!t.defined(a))throw new n.DeveloperError("p0 is required.");if(!t.defined(o))throw new n.DeveloperError("p1 is required.");if(!t.defined(s))throw new n.DeveloperError("p2 is required.");const d=g;r.Cartesian3.clone(e,d.origin),r.Cartesian3.subtract(i,e,d.direction),r.Cartesian3.normalize(d.direction,d.direction);const l=m.rayTriangleParametric(d,a,o,s,u);if(!(!t.defined(l)||l<0||l>r.Cartesian3.distance(e,i)))return t.defined(c)||(c=new r.Cartesian3),r.Cartesian3.multiplyByScalar(d.direction,l,c),r.Cartesian3.add(d.origin,c,c)};const E={root0:0,root1:0};function y(e,n,a){t.defined(a)||(a=new i.Interval);const o=e.origin,s=e.direction,u=n.center,c=n.radius*n.radius,d=r.Cartesian3.subtract(o,u,w),l=r.Cartesian3.dot(s,s),f=2*r.Cartesian3.dot(s,d),h=r.Cartesian3.magnitudeSquared(d)-c,m=q(l,f,h,E);if(t.defined(m))return a.start=m.root0,a.stop=m.root1,a}m.raySphere=function(e,r,i){if(!t.defined(e))throw new n.DeveloperError("ray is required.");if(!t.defined(r))throw new n.DeveloperError("sphere is required.");if(i=y(e,r,i),t.defined(i)&&!(i.stop<0))return i.start=Math.max(i.start,0),i};const v=new h;m.lineSegmentSphere=function(e,i,a,o){if(!t.defined(e))throw new n.DeveloperError("p0 is required.");if(!t.defined(i))throw new n.DeveloperError("p1 is required.");if(!t.defined(a))throw new n.DeveloperError("sphere is required.");const s=v;r.Cartesian3.clone(e,s.origin);const u=r.Cartesian3.subtract(i,e,s.direction),c=r.Cartesian3.magnitude(u);if(r.Cartesian3.normalize(u,u),o=y(s,a,o),!(!t.defined(o)||o.stop<0||o.start>c))return o.start=Math.max(o.start,0),o.stop=Math.min(o.stop,c),o};const D=new r.Cartesian3,R=new r.Cartesian3;function S(e,r,t){const n=e+r;return a.CesiumMath.sign(e)!==a.CesiumMath.sign(r)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(r)))<t?0:n}function O(e,t,n,i,s){const u=i*i,c=s*s,l=(e[r.Matrix3.COLUMN1ROW1]-e[r.Matrix3.COLUMN2ROW2])*c,f=s*(i*S(e[r.Matrix3.COLUMN1ROW0],e[r.Matrix3.COLUMN0ROW1],a.CesiumMath.EPSILON15)+t.y),h=e[r.Matrix3.COLUMN0ROW0]*u+e[r.Matrix3.COLUMN2ROW2]*c+i*t.x+n,m=c*S(e[r.Matrix3.COLUMN2ROW1],e[r.Matrix3.COLUMN1ROW2],a.CesiumMath.EPSILON15),p=s*(i*S(e[r.Matrix3.COLUMN2ROW0],e[r.Matrix3.COLUMN0ROW2])+t.z);let C;const w=[];if(0===p&&0===m){if(C=o.computeRealRoots(l,f,h),0===C.length)return w;const e=C[0],t=Math.sqrt(Math.max(1-e*e,0));if(w.push(new r.Cartesian3(i,s*e,s*-t)),w.push(new r.Cartesian3(i,s*e,s*t)),2===C.length){const e=C[1],t=Math.sqrt(Math.max(1-e*e,0));w.push(new r.Cartesian3(i,s*e,s*-t)),w.push(new r.Cartesian3(i,s*e,s*t))}return w}const M=p*p,b=m*m,g=l*l,q=p*m,E=g+b,y=2*(f*l+q),v=2*h*l+f*f-b+M,D=2*(h*f-q),R=h*h-M;if(0===E&&0===y&&0===v&&0===D)return w;C=d.computeRealRoots(E,y,v,D,R);const O=C.length;if(0===O)return w;for(let o=0;o<O;++o){const e=C[o],t=e*e,n=Math.max(1-t,0),u=Math.sqrt(n);let c;c=a.CesiumMath.sign(l)===a.CesiumMath.sign(h)?S(l*t+h,f*e,a.CesiumMath.EPSILON12):a.CesiumMath.sign(h)===a.CesiumMath.sign(f*e)?S(l*t,f*e+h,a.CesiumMath.EPSILON12):S(l*t+f*e,h,a.CesiumMath.EPSILON12);const d=S(m*e,p,a.CesiumMath.EPSILON15),M=c*d;M<0?w.push(new r.Cartesian3(i,s*e,s*u)):M>0?w.push(new r.Cartesian3(i,s*e,s*-u)):0!==u?(w.push(new r.Cartesian3(i,s*e,s*-u)),w.push(new r.Cartesian3(i,s*e,s*u)),++o):w.push(new r.Cartesian3(i,s*e,s*u))}return w}m.rayEllipsoid=function(e,a){if(!t.defined(e))throw new n.DeveloperError("ray is required.");if(!t.defined(a))throw new n.DeveloperError("ellipsoid is required.");const o=a.oneOverRadii,s=r.Cartesian3.multiplyComponents(o,e.origin,D),u=r.Cartesian3.multiplyComponents(o,e.direction,R),c=r.Cartesian3.magnitudeSquared(s),d=r.Cartesian3.dot(s,u);let l,f,h,m,p;if(c>1){if(d>=0)return;const e=d*d;if(l=c-1,f=r.Cartesian3.magnitudeSquared(u),h=f*l,e<h)return;if(e>h){m=d*d-h,p=-d+Math.sqrt(m);const e=p/f,r=l/p;return e<r?new i.Interval(e,r):{start:r,stop:e}}const t=Math.sqrt(l/f);return new i.Interval(t,t)}return c<1?(l=c-1,f=r.Cartesian3.magnitudeSquared(u),h=f*l,m=d*d-h,p=-d+Math.sqrt(m),new i.Interval(0,p/f)):d<0?(f=r.Cartesian3.magnitudeSquared(u),new i.Interval(0,-d/f)):void 0};const x=new r.Cartesian3,P=new r.Cartesian3,N=new r.Cartesian3,L=new r.Cartesian3,I=new r.Cartesian3,z=new r.Matrix3,T=new r.Matrix3,U=new r.Matrix3,W=new r.Matrix3,B=new r.Matrix3,V=new r.Matrix3,Z=new r.Matrix3,A=new r.Cartesian3,k=new r.Cartesian3,j=new r.Cartographic;m.grazingAltitudeLocation=function(e,i){if(!t.defined(e))throw new n.DeveloperError("ray is required.");if(!t.defined(i))throw new n.DeveloperError("ellipsoid is required.");const o=e.origin,s=e.direction;if(!r.Cartesian3.equals(o,r.Cartesian3.ZERO)){const e=i.geodeticSurfaceNormal(o,x);if(r.Cartesian3.dot(s,e)>=0)return o}const u=t.defined(this.rayEllipsoid(e,i)),c=i.transformPositionToScaledSpace(s,x),d=r.Cartesian3.normalize(c,c),l=r.Cartesian3.mostOrthogonalAxis(c,L),f=r.Cartesian3.normalize(r.Cartesian3.cross(l,d,P),P),h=r.Cartesian3.normalize(r.Cartesian3.cross(d,f,N),N),m=z;m[0]=d.x,m[1]=d.y,m[2]=d.z,m[3]=f.x,m[4]=f.y,m[5]=f.z,m[6]=h.x,m[7]=h.y,m[8]=h.z;const p=r.Matrix3.transpose(m,T),C=r.Matrix3.fromScale(i.radii,U),w=r.Matrix3.fromScale(i.oneOverRadii,W),M=B;M[0]=0,M[1]=-s.z,M[2]=s.y,M[3]=s.z,M[4]=0,M[5]=-s.x,M[6]=-s.y,M[7]=s.x,M[8]=0;const b=r.Matrix3.multiply(r.Matrix3.multiply(p,w,V),M,V),g=r.Matrix3.multiply(r.Matrix3.multiply(b,C,Z),m,Z),q=r.Matrix3.multiplyByVector(b,o,I),E=O(g,r.Cartesian3.negate(q,x),0,0,1);let y,v;const D=E.length;if(D>0){let e=r.Cartesian3.clone(r.Cartesian3.ZERO,k),t=Number.NEGATIVE_INFINITY;for(let i=0;i<D;++i){y=r.Matrix3.multiplyByVector(C,r.Matrix3.multiplyByVector(m,E[i],A),A);const n=r.Cartesian3.normalize(r.Cartesian3.subtract(y,o,L),L),a=r.Cartesian3.dot(n,s);a>t&&(t=a,e=r.Cartesian3.clone(y,e))}const n=i.cartesianToCartographic(e,j);return t=a.CesiumMath.clamp(t,0,1),v=r.Cartesian3.magnitude(r.Cartesian3.subtract(e,o,L))*Math.sqrt(1-t*t),v=u?-v:v,n.height=v,i.cartographicToCartesian(n,new r.Cartesian3)}};const F=new r.Cartesian3;m.lineSegmentPlane=function(e,i,o,s){if(!t.defined(e))throw new n.DeveloperError("endPoint0 is required.");if(!t.defined(i))throw new n.DeveloperError("endPoint1 is required.");if(!t.defined(o))throw new n.DeveloperError("plane is required.");t.defined(s)||(s=new r.Cartesian3);const u=r.Cartesian3.subtract(i,e,F),c=o.normal,d=r.Cartesian3.dot(c,u);if(Math.abs(d)<a.CesiumMath.EPSILON6)return;const l=r.Cartesian3.dot(c,e),f=-(o.distance+l)/d;return f<0||f>1?void 0:(r.Cartesian3.multiplyByScalar(u,f,s),r.Cartesian3.add(e,s,s),s)},m.trianglePlaneIntersection=function(e,i,a,o){if(!t.defined(e)||!t.defined(i)||!t.defined(a)||!t.defined(o))throw new n.DeveloperError("p0, p1, p2, and plane are required.");const s=o.normal,u=o.distance,c=r.Cartesian3.dot(s,e)+u<0,d=r.Cartesian3.dot(s,i)+u<0,l=r.Cartesian3.dot(s,a)+u<0;let f,h,p=0;if(p+=c?1:0,p+=d?1:0,p+=l?1:0,1!==p&&2!==p||(f=new r.Cartesian3,h=new r.Cartesian3),1===p){if(c)return m.lineSegmentPlane(e,i,o,f),m.lineSegmentPlane(e,a,o,h),{positions:[e,i,a,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(d)return m.lineSegmentPlane(i,a,o,f),m.lineSegmentPlane(i,e,o,h),{positions:[e,i,a,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(l)return m.lineSegmentPlane(a,e,o,f),m.lineSegmentPlane(a,i,o,h),{positions:[e,i,a,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===p){if(!c)return m.lineSegmentPlane(i,e,o,f),m.lineSegmentPlane(a,e,o,h),{positions:[e,i,a,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!d)return m.lineSegmentPlane(a,i,o,f),m.lineSegmentPlane(e,i,o,h),{positions:[e,i,a,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!l)return m.lineSegmentPlane(e,a,o,f),m.lineSegmentPlane(i,a,o,h),{positions:[e,i,a,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},e.IntersectionTests=m,e.Ray=h}));
\ No newline at end of file
define(["exports","./RuntimeError-c581ca93","./defaultValue-94c3e563","./ComponentDatatype-4a60b8d6"],(function(e,t,n,r){"use strict";function a(e,t,r){this.x=n.defaultValue(e,0),this.y=n.defaultValue(t,0),this.z=n.defaultValue(r,0)}a.fromSpherical=function(e,r){t.Check.typeOf.object("spherical",e),n.defined(r)||(r=new a);const c=e.clock,o=e.cone,i=n.defaultValue(e.magnitude,1),u=i*Math.sin(o);return r.x=u*Math.cos(c),r.y=u*Math.sin(c),r.z=i*Math.cos(o),r},a.fromElements=function(e,t,r,c){return n.defined(c)?(c.x=e,c.y=t,c.z=r,c):new a(e,t,r)},a.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new a(e.x,e.y,e.z)},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(e,r,a){return t.Check.typeOf.object("value",e),t.Check.defined("array",r),a=n.defaultValue(a,0),r[a++]=e.x,r[a++]=e.y,r[a]=e.z,r},a.unpack=function(e,r,c){return t.Check.defined("array",e),r=n.defaultValue(r,0),n.defined(c)||(c=new a),c.x=e[r++],c.y=e[r++],c.z=e[r],c},a.packArray=function(e,r){t.Check.defined("array",e);const c=e.length,o=3*c;if(n.defined(r)){if(!Array.isArray(r)&&r.length!==o)throw new t.DeveloperError("If result is a typed array, it must have exactly array.length * 3 elements");r.length!==o&&(r.length=o)}else r=new Array(o);for(let t=0;t<c;++t)a.pack(e[t],r,3*t);return r},a.unpackArray=function(e,r){if(t.Check.defined("array",e),t.Check.typeOf.number.greaterThanOrEquals("array.length",e.length,3),e.length%3!==0)throw new t.DeveloperError("array length must be a multiple of 3.");const c=e.length;n.defined(r)?r.length=c/3:r=new Array(c/3);for(let t=0;t<c;t+=3){const n=t/3;r[n]=a.unpack(e,t,r[n])}return r},a.fromArray=a.unpack,a.maximumComponent=function(e){return t.Check.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z)},a.minimumComponent=function(e){return t.Check.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z)},a.minimumByComponent=function(e,n,r){return t.Check.typeOf.object("first",e),t.Check.typeOf.object("second",n),t.Check.typeOf.object("result",r),r.x=Math.min(e.x,n.x),r.y=Math.min(e.y,n.y),r.z=Math.min(e.z,n.z),r},a.maximumByComponent=function(e,n,r){return t.Check.typeOf.object("first",e),t.Check.typeOf.object("second",n),t.Check.typeOf.object("result",r),r.x=Math.max(e.x,n.x),r.y=Math.max(e.y,n.y),r.z=Math.max(e.z,n.z),r},a.clamp=function(e,n,a,c){t.Check.typeOf.object("value",e),t.Check.typeOf.object("min",n),t.Check.typeOf.object("max",a),t.Check.typeOf.object("result",c);const o=r.CesiumMath.clamp(e.x,n.x,a.x),i=r.CesiumMath.clamp(e.y,n.y,a.y),u=r.CesiumMath.clamp(e.z,n.z,a.z);return c.x=o,c.y=i,c.z=u,c},a.magnitudeSquared=function(e){return t.Check.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};const c=new a;a.distance=function(e,n){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),a.subtract(e,n,c),a.magnitude(c)},a.distanceSquared=function(e,n){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),a.subtract(e,n,c),a.magnitudeSquared(c)},a.normalize=function(e,n){t.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n);const r=a.magnitude(e);if(n.x=e.x/r,n.y=e.y/r,n.z=e.z/r,isNaN(n.x)||isNaN(n.y)||isNaN(n.z))throw new t.DeveloperError("normalized result is not a number");return n},a.dot=function(e,n){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),e.x*n.x+e.y*n.y+e.z*n.z},a.multiplyComponents=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x*n.x,r.y=e.y*n.y,r.z=e.z*n.z,r},a.divideComponents=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x/n.x,r.y=e.y/n.y,r.z=e.z/n.z,r},a.add=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x+n.x,r.y=e.y+n.y,r.z=e.z+n.z,r},a.subtract=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x-n.x,r.y=e.y-n.y,r.z=e.z-n.z,r},a.multiplyByScalar=function(e,n,r){return t.Check.typeOf.object("cartesian",e),t.Check.typeOf.number("scalar",n),t.Check.typeOf.object("result",r),r.x=e.x*n,r.y=e.y*n,r.z=e.z*n,r},a.divideByScalar=function(e,n,r){return t.Check.typeOf.object("cartesian",e),t.Check.typeOf.number("scalar",n),t.Check.typeOf.object("result",r),r.x=e.x/n,r.y=e.y/n,r.z=e.z/n,r},a.negate=function(e,n){return t.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n),n.x=-e.x,n.y=-e.y,n.z=-e.z,n},a.abs=function(e,n){return t.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n),n.x=Math.abs(e.x),n.y=Math.abs(e.y),n.z=Math.abs(e.z),n};const o=new a;a.lerp=function(e,n,r,c){return t.Check.typeOf.object("start",e),t.Check.typeOf.object("end",n),t.Check.typeOf.number("t",r),t.Check.typeOf.object("result",c),a.multiplyByScalar(n,r,o),c=a.multiplyByScalar(e,1-r,c),a.add(o,c,c)};const i=new a,u=new a;a.angleBetween=function(e,n){t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),a.normalize(e,i),a.normalize(n,u);const r=a.dot(i,u),c=a.magnitude(a.cross(i,u,i));return Math.atan2(c,r)};const s=new a;a.mostOrthogonalAxis=function(e,n){t.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n);const r=a.normalize(e,s);return a.abs(r,r),n=r.x<=r.y?r.x<=r.z?a.clone(a.UNIT_X,n):a.clone(a.UNIT_Z,n):r.y<=r.z?a.clone(a.UNIT_Y,n):a.clone(a.UNIT_Z,n),n},a.projectVector=function(e,n,r){t.Check.defined("a",e),t.Check.defined("b",n),t.Check.defined("result",r);const c=a.dot(e,n)/a.dot(n,n);return a.multiplyByScalar(n,c,r)},a.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},a.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},a.equalsEpsilon=function(e,t,a,c){return e===t||n.defined(e)&&n.defined(t)&&r.CesiumMath.equalsEpsilon(e.x,t.x,a,c)&&r.CesiumMath.equalsEpsilon(e.y,t.y,a,c)&&r.CesiumMath.equalsEpsilon(e.z,t.z,a,c)},a.cross=function(e,n,r){t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r);const a=e.x,c=e.y,o=e.z,i=n.x,u=n.y,s=n.z,f=c*s-o*u,h=o*i-a*s,l=a*u-c*i;return r.x=f,r.y=h,r.z=l,r},a.midpoint=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=.5*(e.x+n.x),r.y=.5*(e.y+n.y),r.z=.5*(e.z+n.z),r},a.fromDegrees=function(e,n,c,o,i){return t.Check.typeOf.number("longitude",e),t.Check.typeOf.number("latitude",n),e=r.CesiumMath.toRadians(e),n=r.CesiumMath.toRadians(n),a.fromRadians(e,n,c,o,i)};let f=new a,h=new a;const l=new a(40680631590769,40680631590769,40408299984661.445);a.fromRadians=function(e,r,c,o,i){t.Check.typeOf.number("longitude",e),t.Check.typeOf.number("latitude",r),c=n.defaultValue(c,0);const u=n.defined(o)?o.radiiSquared:l,s=Math.cos(r);f.x=s*Math.cos(e),f.y=s*Math.sin(e),f.z=Math.sin(r),f=a.normalize(f,f),a.multiplyComponents(u,f,h);const y=Math.sqrt(a.dot(f,h));return h=a.divideByScalar(h,y,h),f=a.multiplyByScalar(f,c,f),n.defined(i)||(i=new a),a.add(h,f,i)},a.fromDegreesArray=function(e,r,c){if(t.Check.defined("coordinates",e),e.length<2||e.length%2!==0)throw new t.DeveloperError("the number of coordinates must be a multiple of 2 and at least 2");const o=e.length;n.defined(c)?c.length=o/2:c=new Array(o/2);for(let t=0;t<o;t+=2){const n=e[t],o=e[t+1],i=t/2;c[i]=a.fromDegrees(n,o,0,r,c[i])}return c},a.fromRadiansArray=function(e,r,c){if(t.Check.defined("coordinates",e),e.length<2||e.length%2!==0)throw new t.DeveloperError("the number of coordinates must be a multiple of 2 and at least 2");const o=e.length;n.defined(c)?c.length=o/2:c=new Array(o/2);for(let t=0;t<o;t+=2){const n=e[t],o=e[t+1],i=t/2;c[i]=a.fromRadians(n,o,0,r,c[i])}return c},a.fromDegreesArrayHeights=function(e,r,c){if(t.Check.defined("coordinates",e),e.length<3||e.length%3!==0)throw new t.DeveloperError("the number of coordinates must be a multiple of 3 and at least 3");const o=e.length;n.defined(c)?c.length=o/3:c=new Array(o/3);for(let t=0;t<o;t+=3){const n=e[t],o=e[t+1],i=e[t+2],u=t/3;c[u]=a.fromDegrees(n,o,i,r,c[u])}return c},a.fromRadiansArrayHeights=function(e,r,c){if(t.Check.defined("coordinates",e),e.length<3||e.length%3!==0)throw new t.DeveloperError("the number of coordinates must be a multiple of 3 and at least 3");const o=e.length;n.defined(c)?c.length=o/3:c=new Array(o/3);for(let t=0;t<o;t+=3){const n=e[t],o=e[t+1],i=e[t+2],u=t/3;c[u]=a.fromRadians(n,o,i,r,c[u])}return c},a.ZERO=Object.freeze(new a(0,0,0)),a.ONE=Object.freeze(new a(1,1,1)),a.UNIT_X=Object.freeze(new a(1,0,0)),a.UNIT_Y=Object.freeze(new a(0,1,0)),a.UNIT_Z=Object.freeze(new a(0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};const y=new a,p=new a;function d(e,c,o,i,u){if(!n.defined(e))throw new t.DeveloperError("cartesian is required.");if(!n.defined(c))throw new t.DeveloperError("oneOverRadii is required.");if(!n.defined(o))throw new t.DeveloperError("oneOverRadiiSquared is required.");if(!n.defined(i))throw new t.DeveloperError("centerToleranceSquared is required.");const s=e.x,f=e.y,h=e.z,l=c.x,d=c.y,m=c.z,O=s*s*l*l,C=f*f*d*d,b=h*h*m*m,k=O+C+b,x=Math.sqrt(1/k),g=a.multiplyByScalar(e,x,y);if(k<i)return isFinite(x)?a.clone(g,u):void 0;const j=o.x,w=o.y,M=o.z,z=p;z.x=g.x*j*2,z.y=g.y*w*2,z.z=g.z*M*2;let E,q,T,S,R,_,V,v,A,N,I,U=(1-x)*a.magnitude(e)/(.5*a.magnitude(z)),P=0;do{U-=P,T=1/(1+U*j),S=1/(1+U*w),R=1/(1+U*M),_=T*T,V=S*S,v=R*R,A=_*T,N=V*S,I=v*R,E=O*_+C*V+b*v-1,q=O*A*j+C*N*w+b*I*M;const e=-2*q;P=E/e}while(Math.abs(E)>r.CesiumMath.EPSILON12);return n.defined(u)?(u.x=s*T,u.y=f*S,u.z=h*R,u):new a(s*T,f*S,h*R)}function m(e,t,r){this.longitude=n.defaultValue(e,0),this.latitude=n.defaultValue(t,0),this.height=n.defaultValue(r,0)}m.fromRadians=function(e,r,a,c){return t.Check.typeOf.number("longitude",e),t.Check.typeOf.number("latitude",r),a=n.defaultValue(a,0),n.defined(c)?(c.longitude=e,c.latitude=r,c.height=a,c):new m(e,r,a)},m.fromDegrees=function(e,n,a,c){return t.Check.typeOf.number("longitude",e),t.Check.typeOf.number("latitude",n),e=r.CesiumMath.toRadians(e),n=r.CesiumMath.toRadians(n),m.fromRadians(e,n,a,c)};const O=new a,C=new a,b=new a,k=new a(1/6378137,1/6378137,1/6356752.314245179),x=new a(1/40680631590769,1/40680631590769,1/40408299984661.445),g=r.CesiumMath.EPSILON1;function j(e,c,o,i){c=n.defaultValue(c,0),o=n.defaultValue(o,0),i=n.defaultValue(i,0),t.Check.typeOf.number.greaterThanOrEquals("x",c,0),t.Check.typeOf.number.greaterThanOrEquals("y",o,0),t.Check.typeOf.number.greaterThanOrEquals("z",i,0),e._radii=new a(c,o,i),e._radiiSquared=new a(c*c,o*o,i*i),e._radiiToTheFourth=new a(c*c*c*c,o*o*o*o,i*i*i*i),e._oneOverRadii=new a(0===c?0:1/c,0===o?0:1/o,0===i?0:1/i),e._oneOverRadiiSquared=new a(0===c?0:1/(c*c),0===o?0:1/(o*o),0===i?0:1/(i*i)),e._minimumRadius=Math.min(c,o,i),e._maximumRadius=Math.max(c,o,i),e._centerToleranceSquared=r.CesiumMath.EPSILON1,0!==e._radiiSquared.z&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function w(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,j(this,e,t,n)}m.fromCartesian=function(e,t,c){const o=n.defined(t)?t.oneOverRadii:k,i=n.defined(t)?t.oneOverRadiiSquared:x,u=n.defined(t)?t._centerToleranceSquared:g,s=d(e,o,i,u,C);if(!n.defined(s))return;let f=a.multiplyComponents(s,i,O);f=a.normalize(f,f);const h=a.subtract(e,s,b),l=Math.atan2(f.y,f.x),y=Math.asin(f.z),p=r.CesiumMath.sign(a.dot(h,e))*a.magnitude(h);return n.defined(c)?(c.longitude=l,c.latitude=y,c.height=p,c):new m(l,y,p)},m.toCartesian=function(e,n,r){return t.Check.defined("cartographic",e),a.fromRadians(e.longitude,e.latitude,e.height,n,r)},m.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new m(e.longitude,e.latitude,e.height)},m.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},m.equalsEpsilon=function(e,t,r){return r=n.defaultValue(r,0),e===t||n.defined(e)&&n.defined(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},m.ZERO=Object.freeze(new m(0,0,0)),m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`},Object.defineProperties(w.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}}),w.clone=function(e,t){if(!n.defined(e))return;const r=e._radii;return n.defined(t)?(a.clone(r,t._radii),a.clone(e._radiiSquared,t._radiiSquared),a.clone(e._radiiToTheFourth,t._radiiToTheFourth),a.clone(e._oneOverRadii,t._oneOverRadii),a.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new w(r.x,r.y,r.z)},w.fromCartesian3=function(e,t){return n.defined(t)||(t=new w),n.defined(e)?(j(t,e.x,e.y,e.z),t):t},w.WGS84=Object.freeze(new w(6378137,6378137,6356752.314245179)),w.UNIT_SPHERE=Object.freeze(new w(1,1,1)),w.MOON=Object.freeze(new w(r.CesiumMath.LUNAR_RADIUS,r.CesiumMath.LUNAR_RADIUS,r.CesiumMath.LUNAR_RADIUS)),w.prototype.clone=function(e){return w.clone(this,e)},w.packedLength=a.packedLength,w.pack=function(e,r,c){return t.Check.typeOf.object("value",e),t.Check.defined("array",r),c=n.defaultValue(c,0),a.pack(e._radii,r,c),r},w.unpack=function(e,r,c){t.Check.defined("array",e),r=n.defaultValue(r,0);const o=a.unpack(e,r);return w.fromCartesian3(o,c)},w.prototype.geocentricSurfaceNormal=a.normalize,w.prototype.geodeticSurfaceNormalCartographic=function(e,r){t.Check.typeOf.object("cartographic",e);const c=e.longitude,o=e.latitude,i=Math.cos(o),u=i*Math.cos(c),s=i*Math.sin(c),f=Math.sin(o);return n.defined(r)||(r=new a),r.x=u,r.y=s,r.z=f,a.normalize(r,r)},w.prototype.geodeticSurfaceNormal=function(e,t){if(!a.equalsEpsilon(e,a.ZERO,r.CesiumMath.EPSILON14))return n.defined(t)||(t=new a),t=a.multiplyComponents(e,this._oneOverRadiiSquared,t),a.normalize(t,t)};const M=new a,z=new a;w.prototype.cartographicToCartesian=function(e,t){const r=M,c=z;this.geodeticSurfaceNormalCartographic(e,r),a.multiplyComponents(this._radiiSquared,r,c);const o=Math.sqrt(a.dot(r,c));return a.divideByScalar(c,o,c),a.multiplyByScalar(r,e.height,r),n.defined(t)||(t=new a),a.add(c,r,t)},w.prototype.cartographicArrayToCartesianArray=function(e,r){t.Check.defined("cartographics",e);const a=e.length;n.defined(r)?r.length=a:r=new Array(a);for(let t=0;t<a;t++)r[t]=this.cartographicToCartesian(e[t],r[t]);return r};const E=new a,q=new a,T=new a;w.prototype.cartesianToCartographic=function(e,t){const c=this.scaleToGeodeticSurface(e,q);if(!n.defined(c))return;const o=this.geodeticSurfaceNormal(c,E),i=a.subtract(e,c,T),u=Math.atan2(o.y,o.x),s=Math.asin(o.z),f=r.CesiumMath.sign(a.dot(i,e))*a.magnitude(i);return n.defined(t)?(t.longitude=u,t.latitude=s,t.height=f,t):new m(u,s,f)},w.prototype.cartesianArrayToCartographicArray=function(e,r){t.Check.defined("cartesians",e);const a=e.length;n.defined(r)?r.length=a:r=new Array(a);for(let t=0;t<a;++t)r[t]=this.cartesianToCartographic(e[t],r[t]);return r},w.prototype.scaleToGeodeticSurface=function(e,t){return d(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},w.prototype.scaleToGeocentricSurface=function(e,r){t.Check.typeOf.object("cartesian",e),n.defined(r)||(r=new a);const c=e.x,o=e.y,i=e.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(c*c*u.x+o*o*u.y+i*i*u.z);return a.multiplyByScalar(e,s,r)},w.prototype.transformPositionToScaledSpace=function(e,t){return n.defined(t)||(t=new a),a.multiplyComponents(e,this._oneOverRadii,t)},w.prototype.transformPositionFromScaledSpace=function(e,t){return n.defined(t)||(t=new a),a.multiplyComponents(e,this._radii,t)},w.prototype.equals=function(e){return this===e||n.defined(e)&&a.equals(this._radii,e._radii)},w.prototype.toString=function(){return this._radii.toString()},w.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,c,o){if(t.Check.typeOf.object("position",e),!r.CesiumMath.equalsEpsilon(this._radii.x,this._radii.y,r.CesiumMath.EPSILON15))throw new t.DeveloperError("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");t.Check.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),c=n.defaultValue(c,0);const i=this._squaredXOverSquaredZ;if(n.defined(o)||(o=new a),o.x=0,o.y=0,o.z=e.z*(1-i),!(Math.abs(o.z)>=this._radii.z-c))return o};const S=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],R=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function _(e,n,r){t.Check.typeOf.number("a",e),t.Check.typeOf.number("b",n),t.Check.typeOf.func("func",r);const a=.5*(n+e),c=.5*(n-e);let o=0;for(let t=0;t<5;t++){const e=c*S[t];o+=R[t]*(r(a+e)+r(a-e))}return o*=c,o}function V(e,t,r,a,c,o,i,u,s){this[0]=n.defaultValue(e,0),this[1]=n.defaultValue(a,0),this[2]=n.defaultValue(i,0),this[3]=n.defaultValue(t,0),this[4]=n.defaultValue(c,0),this[5]=n.defaultValue(u,0),this[6]=n.defaultValue(r,0),this[7]=n.defaultValue(o,0),this[8]=n.defaultValue(s,0)}w.prototype.surfaceArea=function(e){t.Check.typeOf.object("rectangle",e);const n=e.west;let a=e.east;const c=e.south,o=e.north;while(a<n)a+=r.CesiumMath.TWO_PI;const i=this._radiiSquared,u=i.x,s=i.y,f=i.z,h=u*s;return _(c,o,(function(e){const t=Math.cos(e),r=Math.sin(e);return Math.cos(e)*_(n,a,(function(e){const n=Math.cos(e),a=Math.sin(e);return Math.sqrt(h*r*r+f*(s*n*n+u*a*a)*t*t)}))}))},V.packedLength=9,V.pack=function(e,r,a){return t.Check.typeOf.object("value",e),t.Check.defined("array",r),a=n.defaultValue(a,0),r[a++]=e[0],r[a++]=e[1],r[a++]=e[2],r[a++]=e[3],r[a++]=e[4],r[a++]=e[5],r[a++]=e[6],r[a++]=e[7],r[a++]=e[8],r},V.unpack=function(e,r,a){return t.Check.defined("array",e),r=n.defaultValue(r,0),n.defined(a)||(a=new V),a[0]=e[r++],a[1]=e[r++],a[2]=e[r++],a[3]=e[r++],a[4]=e[r++],a[5]=e[r++],a[6]=e[r++],a[7]=e[r++],a[8]=e[r++],a},V.packArray=function(e,r){t.Check.defined("array",e);const a=e.length,c=9*a;if(n.defined(r)){if(!Array.isArray(r)&&r.length!==c)throw new t.DeveloperError("If result is a typed array, it must have exactly array.length * 9 elements");r.length!==c&&(r.length=c)}else r=new Array(c);for(let t=0;t<a;++t)V.pack(e[t],r,9*t);return r},V.unpackArray=function(e,r){if(t.Check.defined("array",e),t.Check.typeOf.number.greaterThanOrEquals("array.length",e.length,9),e.length%9!==0)throw new t.DeveloperError("array length must be a multiple of 9.");const a=e.length;n.defined(r)?r.length=a/9:r=new Array(a/9);for(let t=0;t<a;t+=9){const n=t/9;r[n]=V.unpack(e,t,r[n])}return r},V.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new V(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},V.fromArray=V.unpack,V.fromColumnMajorArray=function(e,n){return t.Check.defined("values",e),V.clone(e,n)},V.fromRowMajorArray=function(e,r){return t.Check.defined("values",e),n.defined(r)?(r[0]=e[0],r[1]=e[3],r[2]=e[6],r[3]=e[1],r[4]=e[4],r[5]=e[7],r[6]=e[2],r[7]=e[5],r[8]=e[8],r):new V(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},V.fromQuaternion=function(e,r){t.Check.typeOf.object("quaternion",e);const a=e.x*e.x,c=e.x*e.y,o=e.x*e.z,i=e.x*e.w,u=e.y*e.y,s=e.y*e.z,f=e.y*e.w,h=e.z*e.z,l=e.z*e.w,y=e.w*e.w,p=a-u-h+y,d=2*(c-l),m=2*(o+f),O=2*(c+l),C=-a+u-h+y,b=2*(s-i),k=2*(o-f),x=2*(s+i),g=-a-u+h+y;return n.defined(r)?(r[0]=p,r[1]=O,r[2]=k,r[3]=d,r[4]=C,r[5]=x,r[6]=m,r[7]=b,r[8]=g,r):new V(p,d,m,O,C,b,k,x,g)},V.fromHeadingPitchRoll=function(e,r){t.Check.typeOf.object("headingPitchRoll",e);const a=Math.cos(-e.pitch),c=Math.cos(-e.heading),o=Math.cos(e.roll),i=Math.sin(-e.pitch),u=Math.sin(-e.heading),s=Math.sin(e.roll),f=a*c,h=-o*u+s*i*c,l=s*u+o*i*c,y=a*u,p=o*c+s*i*u,d=-s*c+o*i*u,m=-i,O=s*a,C=o*a;return n.defined(r)?(r[0]=f,r[1]=y,r[2]=m,r[3]=h,r[4]=p,r[5]=O,r[6]=l,r[7]=d,r[8]=C,r):new V(f,h,l,y,p,d,m,O,C)},V.fromScale=function(e,r){return t.Check.typeOf.object("scale",e),n.defined(r)?(r[0]=e.x,r[1]=0,r[2]=0,r[3]=0,r[4]=e.y,r[5]=0,r[6]=0,r[7]=0,r[8]=e.z,r):new V(e.x,0,0,0,e.y,0,0,0,e.z)},V.fromUniformScale=function(e,r){return t.Check.typeOf.number("scale",e),n.defined(r)?(r[0]=e,r[1]=0,r[2]=0,r[3]=0,r[4]=e,r[5]=0,r[6]=0,r[7]=0,r[8]=e,r):new V(e,0,0,0,e,0,0,0,e)},V.fromCrossProduct=function(e,r){return t.Check.typeOf.object("vector",e),n.defined(r)?(r[0]=0,r[1]=e.z,r[2]=-e.y,r[3]=-e.z,r[4]=0,r[5]=e.x,r[6]=e.y,r[7]=-e.x,r[8]=0,r):new V(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},V.fromRotationX=function(e,r){t.Check.typeOf.number("angle",e);const a=Math.cos(e),c=Math.sin(e);return n.defined(r)?(r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=a,r[5]=c,r[6]=0,r[7]=-c,r[8]=a,r):new V(1,0,0,0,a,-c,0,c,a)},V.fromRotationY=function(e,r){t.Check.typeOf.number("angle",e);const a=Math.cos(e),c=Math.sin(e);return n.defined(r)?(r[0]=a,r[1]=0,r[2]=-c,r[3]=0,r[4]=1,r[5]=0,r[6]=c,r[7]=0,r[8]=a,r):new V(a,0,c,0,1,0,-c,0,a)},V.fromRotationZ=function(e,r){t.Check.typeOf.number("angle",e);const a=Math.cos(e),c=Math.sin(e);return n.defined(r)?(r[0]=a,r[1]=c,r[2]=0,r[3]=-c,r[4]=a,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r):new V(a,-c,0,c,a,0,0,0,1)},V.toArray=function(e,r){return t.Check.typeOf.object("matrix",e),n.defined(r)?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},V.getElementIndex=function(e,n){return t.Check.typeOf.number.greaterThanOrEquals("row",n,0),t.Check.typeOf.number.lessThanOrEquals("row",n,2),t.Check.typeOf.number.greaterThanOrEquals("column",e,0),t.Check.typeOf.number.lessThanOrEquals("column",e,2),3*e+n},V.getColumn=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,2),t.Check.typeOf.object("result",r);const a=3*n,c=e[a],o=e[a+1],i=e[a+2];return r.x=c,r.y=o,r.z=i,r},V.setColumn=function(e,n,r,a){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,2),t.Check.typeOf.object("cartesian",r),t.Check.typeOf.object("result",a),a=V.clone(e,a);const c=3*n;return a[c]=r.x,a[c+1]=r.y,a[c+2]=r.z,a},V.getRow=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,2),t.Check.typeOf.object("result",r);const a=e[n],c=e[n+3],o=e[n+6];return r.x=a,r.y=c,r.z=o,r},V.setRow=function(e,n,r,a){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,2),t.Check.typeOf.object("cartesian",r),t.Check.typeOf.object("result",a),a=V.clone(e,a),a[n]=r.x,a[n+3]=r.y,a[n+6]=r.z,a};const v=new a;V.setScale=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("scale",n),t.Check.typeOf.object("result",r);const a=V.getScale(e,v),c=n.x/a.x,o=n.y/a.y,i=n.z/a.z;return r[0]=e[0]*c,r[1]=e[1]*c,r[2]=e[2]*c,r[3]=e[3]*o,r[4]=e[4]*o,r[5]=e[5]*o,r[6]=e[6]*i,r[7]=e[7]*i,r[8]=e[8]*i,r};const A=new a;V.setUniformScale=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number("scale",n),t.Check.typeOf.object("result",r);const a=V.getScale(e,A),c=n/a.x,o=n/a.y,i=n/a.z;return r[0]=e[0]*c,r[1]=e[1]*c,r[2]=e[2]*c,r[3]=e[3]*o,r[4]=e[4]*o,r[5]=e[5]*o,r[6]=e[6]*i,r[7]=e[7]*i,r[8]=e[8]*i,r};const N=new a;V.getScale=function(e,n){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n.x=a.magnitude(a.fromElements(e[0],e[1],e[2],N)),n.y=a.magnitude(a.fromElements(e[3],e[4],e[5],N)),n.z=a.magnitude(a.fromElements(e[6],e[7],e[8],N)),n};const I=new a;V.getMaximumScale=function(e){return V.getScale(e,I),a.maximumComponent(I)};const U=new a;V.setRotation=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",r);const a=V.getScale(e,U);return r[0]=n[0]*a.x,r[1]=n[1]*a.x,r[2]=n[2]*a.x,r[3]=n[3]*a.y,r[4]=n[4]*a.y,r[5]=n[5]*a.y,r[6]=n[6]*a.z,r[7]=n[7]*a.z,r[8]=n[8]*a.z,r};const P=new a;function L(e){let t=0;for(let n=0;n<9;++n){const r=e[n];t+=r*r}return Math.sqrt(t)}V.getRotation=function(e,n){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n);const r=V.getScale(e,P);return n[0]=e[0]/r.x,n[1]=e[1]/r.x,n[2]=e[2]/r.x,n[3]=e[3]/r.y,n[4]=e[4]/r.y,n[5]=e[5]/r.y,n[6]=e[6]/r.z,n[7]=e[7]/r.z,n[8]=e[8]/r.z,n},V.multiply=function(e,n,r){t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r);const a=e[0]*n[0]+e[3]*n[1]+e[6]*n[2],c=e[1]*n[0]+e[4]*n[1]+e[7]*n[2],o=e[2]*n[0]+e[5]*n[1]+e[8]*n[2],i=e[0]*n[3]+e[3]*n[4]+e[6]*n[5],u=e[1]*n[3]+e[4]*n[4]+e[7]*n[5],s=e[2]*n[3]+e[5]*n[4]+e[8]*n[5],f=e[0]*n[6]+e[3]*n[7]+e[6]*n[8],h=e[1]*n[6]+e[4]*n[7]+e[7]*n[8],l=e[2]*n[6]+e[5]*n[7]+e[8]*n[8];return r[0]=a,r[1]=c,r[2]=o,r[3]=i,r[4]=u,r[5]=s,r[6]=f,r[7]=h,r[8]=l,r},V.add=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r[0]=e[0]+n[0],r[1]=e[1]+n[1],r[2]=e[2]+n[2],r[3]=e[3]+n[3],r[4]=e[4]+n[4],r[5]=e[5]+n[5],r[6]=e[6]+n[6],r[7]=e[7]+n[7],r[8]=e[8]+n[8],r},V.subtract=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],r[3]=e[3]-n[3],r[4]=e[4]-n[4],r[5]=e[5]-n[5],r[6]=e[6]-n[6],r[7]=e[7]-n[7],r[8]=e[8]-n[8],r},V.multiplyByVector=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("cartesian",n),t.Check.typeOf.object("result",r);const a=n.x,c=n.y,o=n.z,i=e[0]*a+e[3]*c+e[6]*o,u=e[1]*a+e[4]*c+e[7]*o,s=e[2]*a+e[5]*c+e[8]*o;return r.x=i,r.y=u,r.z=s,r},V.multiplyByScalar=function(e,n,r){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.number("scalar",n),t.Check.typeOf.object("result",r),r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3]*n,r[4]=e[4]*n,r[5]=e[5]*n,r[6]=e[6]*n,r[7]=e[7]*n,r[8]=e[8]*n,r},V.multiplyByScale=function(e,n,r){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("scale",n),t.Check.typeOf.object("result",r),r[0]=e[0]*n.x,r[1]=e[1]*n.x,r[2]=e[2]*n.x,r[3]=e[3]*n.y,r[4]=e[4]*n.y,r[5]=e[5]*n.y,r[6]=e[6]*n.z,r[7]=e[7]*n.z,r[8]=e[8]*n.z,r},V.multiplyByUniformScale=function(e,n,r){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.number("scale",n),t.Check.typeOf.object("result",r),r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3]*n,r[4]=e[4]*n,r[5]=e[5]*n,r[6]=e[6]*n,r[7]=e[7]*n,r[8]=e[8]*n,r},V.negate=function(e,n){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=-e[3],n[4]=-e[4],n[5]=-e[5],n[6]=-e[6],n[7]=-e[7],n[8]=-e[8],n},V.transpose=function(e,n){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n);const r=e[0],a=e[3],c=e[6],o=e[1],i=e[4],u=e[7],s=e[2],f=e[5],h=e[8];return n[0]=r,n[1]=a,n[2]=c,n[3]=o,n[4]=i,n[5]=u,n[6]=s,n[7]=f,n[8]=h,n};const W=[1,0,0],B=[2,2,1];function D(e){let t=0;for(let n=0;n<3;++n){const r=e[V.getElementIndex(B[n],W[n])];t+=2*r*r}return Math.sqrt(t)}function $(e,t){const n=r.CesiumMath.EPSILON15;let a=0,c=1;for(let r=0;r<3;++r){const t=Math.abs(e[V.getElementIndex(B[r],W[r])]);t>a&&(c=r,a=t)}let o=1,i=0;const u=W[c],s=B[c];if(Math.abs(e[V.getElementIndex(s,u)])>n){const t=e[V.getElementIndex(s,s)],n=e[V.getElementIndex(u,u)],r=e[V.getElementIndex(s,u)],a=(t-n)/2/r;let c;c=a<0?-1/(-a+Math.sqrt(1+a*a)):1/(a+Math.sqrt(1+a*a)),o=1/Math.sqrt(1+c*c),i=c*o}return t=V.clone(V.IDENTITY,t),t[V.getElementIndex(u,u)]=t[V.getElementIndex(s,s)]=o,t[V.getElementIndex(s,u)]=i,t[V.getElementIndex(u,s)]=-i,t}const X=new V,Z=new V;V.computeEigenDecomposition=function(e,a){t.Check.typeOf.object("matrix",e);const c=r.CesiumMath.EPSILON20,o=10;let i=0,u=0;n.defined(a)||(a={});const s=a.unitary=V.clone(V.IDENTITY,a.unitary),f=a.diagonal=V.clone(e,a.diagonal),h=c*L(f);while(u<o&&D(f)>h)$(f,X),V.transpose(X,Z),V.multiply(f,X,f),V.multiply(Z,f,f),V.multiply(s,X,s),++i>2&&(++u,i=0);return a},V.abs=function(e,n){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n[0]=Math.abs(e[0]),n[1]=Math.abs(e[1]),n[2]=Math.abs(e[2]),n[3]=Math.abs(e[3]),n[4]=Math.abs(e[4]),n[5]=Math.abs(e[5]),n[6]=Math.abs(e[6]),n[7]=Math.abs(e[7]),n[8]=Math.abs(e[8]),n},V.determinant=function(e){t.Check.typeOf.object("matrix",e);const n=e[0],r=e[3],a=e[6],c=e[1],o=e[4],i=e[7],u=e[2],s=e[5],f=e[8];return n*(o*f-s*i)+c*(s*a-r*f)+u*(r*i-o*a)},V.inverse=function(e,n){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n);const a=e[0],c=e[1],o=e[2],i=e[3],u=e[4],s=e[5],f=e[6],h=e[7],l=e[8],y=V.determinant(e);if(Math.abs(y)<=r.CesiumMath.EPSILON15)throw new t.DeveloperError("matrix is not invertible");n[0]=u*l-h*s,n[1]=h*o-c*l,n[2]=c*s-u*o,n[3]=f*s-i*l,n[4]=a*l-f*o,n[5]=i*o-a*s,n[6]=i*h-f*u,n[7]=f*c-a*h,n[8]=a*u-i*c;const p=1/y;return V.multiplyByScalar(n,p,n)};const Y=new V;function F(e,t,r,a){this.x=n.defaultValue(e,0),this.y=n.defaultValue(t,0),this.z=n.defaultValue(r,0),this.w=n.defaultValue(a,0)}V.inverseTranspose=function(e,n){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),V.inverse(V.transpose(e,Y),n)},V.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},V.equalsEpsilon=function(e,t,r){return r=n.defaultValue(r,0),e===t||n.defined(e)&&n.defined(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},V.IDENTITY=Object.freeze(new V(1,0,0,0,1,0,0,0,1)),V.ZERO=Object.freeze(new V(0,0,0,0,0,0,0,0,0)),V.COLUMN0ROW0=0,V.COLUMN0ROW1=1,V.COLUMN0ROW2=2,V.COLUMN1ROW0=3,V.COLUMN1ROW1=4,V.COLUMN1ROW2=5,V.COLUMN2ROW0=6,V.COLUMN2ROW1=7,V.COLUMN2ROW2=8,Object.defineProperties(V.prototype,{length:{get:function(){return V.packedLength}}}),V.prototype.clone=function(e){return V.clone(this,e)},V.prototype.equals=function(e){return V.equals(this,e)},V.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},V.prototype.equalsEpsilon=function(e,t){return V.equalsEpsilon(this,e,t)},V.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})\n(${this[1]}, ${this[4]}, ${this[7]})\n(${this[2]}, ${this[5]}, ${this[8]})`},F.fromElements=function(e,t,r,a,c){return n.defined(c)?(c.x=e,c.y=t,c.z=r,c.w=a,c):new F(e,t,r,a)},F.fromColor=function(e,r){return t.Check.typeOf.object("color",e),n.defined(r)?(r.x=e.red,r.y=e.green,r.z=e.blue,r.w=e.alpha,r):new F(e.red,e.green,e.blue,e.alpha)},F.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new F(e.x,e.y,e.z,e.w)},F.packedLength=4,F.pack=function(e,r,a){return t.Check.typeOf.object("value",e),t.Check.defined("array",r),a=n.defaultValue(a,0),r[a++]=e.x,r[a++]=e.y,r[a++]=e.z,r[a]=e.w,r},F.unpack=function(e,r,a){return t.Check.defined("array",e),r=n.defaultValue(r,0),n.defined(a)||(a=new F),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},F.packArray=function(e,r){t.Check.defined("array",e);const a=e.length,c=4*a;if(n.defined(r)){if(!Array.isArray(r)&&r.length!==c)throw new t.DeveloperError("If result is a typed array, it must have exactly array.length * 4 elements");r.length!==c&&(r.length=c)}else r=new Array(c);for(let t=0;t<a;++t)F.pack(e[t],r,4*t);return r},F.unpackArray=function(e,r){if(t.Check.defined("array",e),t.Check.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new t.DeveloperError("array length must be a multiple of 4.");const a=e.length;n.defined(r)?r.length=a/4:r=new Array(a/4);for(let t=0;t<a;t+=4){const n=t/4;r[n]=F.unpack(e,t,r[n])}return r},F.fromArray=F.unpack,F.maximumComponent=function(e){return t.Check.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)},F.minimumComponent=function(e){return t.Check.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)},F.minimumByComponent=function(e,n,r){return t.Check.typeOf.object("first",e),t.Check.typeOf.object("second",n),t.Check.typeOf.object("result",r),r.x=Math.min(e.x,n.x),r.y=Math.min(e.y,n.y),r.z=Math.min(e.z,n.z),r.w=Math.min(e.w,n.w),r},F.maximumByComponent=function(e,n,r){return t.Check.typeOf.object("first",e),t.Check.typeOf.object("second",n),t.Check.typeOf.object("result",r),r.x=Math.max(e.x,n.x),r.y=Math.max(e.y,n.y),r.z=Math.max(e.z,n.z),r.w=Math.max(e.w,n.w),r},F.clamp=function(e,n,a,c){t.Check.typeOf.object("value",e),t.Check.typeOf.object("min",n),t.Check.typeOf.object("max",a),t.Check.typeOf.object("result",c);const o=r.CesiumMath.clamp(e.x,n.x,a.x),i=r.CesiumMath.clamp(e.y,n.y,a.y),u=r.CesiumMath.clamp(e.z,n.z,a.z),s=r.CesiumMath.clamp(e.w,n.w,a.w);return c.x=o,c.y=i,c.z=u,c.w=s,c},F.magnitudeSquared=function(e){return t.Check.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},F.magnitude=function(e){return Math.sqrt(F.magnitudeSquared(e))};const G=new F;F.distance=function(e,n){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),F.subtract(e,n,G),F.magnitude(G)},F.distanceSquared=function(e,n){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),F.subtract(e,n,G),F.magnitudeSquared(G)},F.normalize=function(e,n){t.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n);const r=F.magnitude(e);if(n.x=e.x/r,n.y=e.y/r,n.z=e.z/r,n.w=e.w/r,isNaN(n.x)||isNaN(n.y)||isNaN(n.z)||isNaN(n.w))throw new t.DeveloperError("normalized result is not a number");return n},F.dot=function(e,n){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),e.x*n.x+e.y*n.y+e.z*n.z+e.w*n.w},F.multiplyComponents=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x*n.x,r.y=e.y*n.y,r.z=e.z*n.z,r.w=e.w*n.w,r},F.divideComponents=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x/n.x,r.y=e.y/n.y,r.z=e.z/n.z,r.w=e.w/n.w,r},F.add=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x+n.x,r.y=e.y+n.y,r.z=e.z+n.z,r.w=e.w+n.w,r},F.subtract=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x-n.x,r.y=e.y-n.y,r.z=e.z-n.z,r.w=e.w-n.w,r},F.multiplyByScalar=function(e,n,r){return t.Check.typeOf.object("cartesian",e),t.Check.typeOf.number("scalar",n),t.Check.typeOf.object("result",r),r.x=e.x*n,r.y=e.y*n,r.z=e.z*n,r.w=e.w*n,r},F.divideByScalar=function(e,n,r){return t.Check.typeOf.object("cartesian",e),t.Check.typeOf.number("scalar",n),t.Check.typeOf.object("result",r),r.x=e.x/n,r.y=e.y/n,r.z=e.z/n,r.w=e.w/n,r},F.negate=function(e,n){return t.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n),n.x=-e.x,n.y=-e.y,n.z=-e.z,n.w=-e.w,n},F.abs=function(e,n){return t.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n),n.x=Math.abs(e.x),n.y=Math.abs(e.y),n.z=Math.abs(e.z),n.w=Math.abs(e.w),n};const H=new F;F.lerp=function(e,n,r,a){return t.Check.typeOf.object("start",e),t.Check.typeOf.object("end",n),t.Check.typeOf.number("t",r),t.Check.typeOf.object("result",a),F.multiplyByScalar(n,r,H),a=F.multiplyByScalar(e,1-r,a),F.add(H,a,a)};const Q=new F;F.mostOrthogonalAxis=function(e,n){t.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n);const r=F.normalize(e,Q);return F.abs(r,r),n=r.x<=r.y?r.x<=r.z?r.x<=r.w?F.clone(F.UNIT_X,n):F.clone(F.UNIT_W,n):r.z<=r.w?F.clone(F.UNIT_Z,n):F.clone(F.UNIT_W,n):r.y<=r.z?r.y<=r.w?F.clone(F.UNIT_Y,n):F.clone(F.UNIT_W,n):r.z<=r.w?F.clone(F.UNIT_Z,n):F.clone(F.UNIT_W,n),n},F.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},F.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},F.equalsEpsilon=function(e,t,a,c){return e===t||n.defined(e)&&n.defined(t)&&r.CesiumMath.equalsEpsilon(e.x,t.x,a,c)&&r.CesiumMath.equalsEpsilon(e.y,t.y,a,c)&&r.CesiumMath.equalsEpsilon(e.z,t.z,a,c)&&r.CesiumMath.equalsEpsilon(e.w,t.w,a,c)},F.ZERO=Object.freeze(new F(0,0,0,0)),F.ONE=Object.freeze(new F(1,1,1,1)),F.UNIT_X=Object.freeze(new F(1,0,0,0)),F.UNIT_Y=Object.freeze(new F(0,1,0,0)),F.UNIT_Z=Object.freeze(new F(0,0,1,0)),F.UNIT_W=Object.freeze(new F(0,0,0,1)),F.prototype.clone=function(e){return F.clone(this,e)},F.prototype.equals=function(e){return F.equals(this,e)},F.prototype.equalsEpsilon=function(e,t,n){return F.equalsEpsilon(this,e,t,n)},F.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};const J=new Float32Array(1),K=new Uint8Array(J.buffer),ee=new Uint32Array([287454020]),te=new Uint8Array(ee.buffer),ne=68===te[0];function re(e,t,r,a,c,o,i,u,s,f,h,l,y,p,d,m){this[0]=n.defaultValue(e,0),this[1]=n.defaultValue(c,0),this[2]=n.defaultValue(s,0),this[3]=n.defaultValue(y,0),this[4]=n.defaultValue(t,0),this[5]=n.defaultValue(o,0),this[6]=n.defaultValue(f,0),this[7]=n.defaultValue(p,0),this[8]=n.defaultValue(r,0),this[9]=n.defaultValue(i,0),this[10]=n.defaultValue(h,0),this[11]=n.defaultValue(d,0),this[12]=n.defaultValue(a,0),this[13]=n.defaultValue(u,0),this[14]=n.defaultValue(l,0),this[15]=n.defaultValue(m,0)}F.packFloat=function(e,r){return t.Check.typeOf.number("value",e),n.defined(r)||(r=new F),J[0]=e,ne?(r.x=K[0],r.y=K[1],r.z=K[2],r.w=K[3]):(r.x=K[3],r.y=K[2],r.z=K[1],r.w=K[0]),r},F.unpackFloat=function(e){return t.Check.typeOf.object("packedFloat",e),ne?(K[0]=e.x,K[1]=e.y,K[2]=e.z,K[3]=e.w):(K[0]=e.w,K[1]=e.z,K[2]=e.y,K[3]=e.x),J[0]},re.packedLength=16,re.pack=function(e,r,a){return t.Check.typeOf.object("value",e),t.Check.defined("array",r),a=n.defaultValue(a,0),r[a++]=e[0],r[a++]=e[1],r[a++]=e[2],r[a++]=e[3],r[a++]=e[4],r[a++]=e[5],r[a++]=e[6],r[a++]=e[7],r[a++]=e[8],r[a++]=e[9],r[a++]=e[10],r[a++]=e[11],r[a++]=e[12],r[a++]=e[13],r[a++]=e[14],r[a]=e[15],r},re.unpack=function(e,r,a){return t.Check.defined("array",e),r=n.defaultValue(r,0),n.defined(a)||(a=new re),a[0]=e[r++],a[1]=e[r++],a[2]=e[r++],a[3]=e[r++],a[4]=e[r++],a[5]=e[r++],a[6]=e[r++],a[7]=e[r++],a[8]=e[r++],a[9]=e[r++],a[10]=e[r++],a[11]=e[r++],a[12]=e[r++],a[13]=e[r++],a[14]=e[r++],a[15]=e[r],a},re.packArray=function(e,r){t.Check.defined("array",e);const a=e.length,c=16*a;if(n.defined(r)){if(!Array.isArray(r)&&r.length!==c)throw new t.DeveloperError("If result is a typed array, it must have exactly array.length * 16 elements");r.length!==c&&(r.length=c)}else r=new Array(c);for(let t=0;t<a;++t)re.pack(e[t],r,16*t);return r},re.unpackArray=function(e,r){if(t.Check.defined("array",e),t.Check.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!==0)throw new t.DeveloperError("array length must be a multiple of 16.");const a=e.length;n.defined(r)?r.length=a/16:r=new Array(a/16);for(let t=0;t<a;t+=16){const n=t/16;r[n]=re.unpack(e,t,r[n])}return r},re.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new re(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},re.fromArray=re.unpack,re.fromColumnMajorArray=function(e,n){return t.Check.defined("values",e),re.clone(e,n)},re.fromRowMajorArray=function(e,r){return t.Check.defined("values",e),n.defined(r)?(r[0]=e[0],r[1]=e[4],r[2]=e[8],r[3]=e[12],r[4]=e[1],r[5]=e[5],r[6]=e[9],r[7]=e[13],r[8]=e[2],r[9]=e[6],r[10]=e[10],r[11]=e[14],r[12]=e[3],r[13]=e[7],r[14]=e[11],r[15]=e[15],r):new re(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},re.fromRotationTranslation=function(e,r,c){return t.Check.typeOf.object("rotation",e),r=n.defaultValue(r,a.ZERO),n.defined(c)?(c[0]=e[0],c[1]=e[1],c[2]=e[2],c[3]=0,c[4]=e[3],c[5]=e[4],c[6]=e[5],c[7]=0,c[8]=e[6],c[9]=e[7],c[10]=e[8],c[11]=0,c[12]=r.x,c[13]=r.y,c[14]=r.z,c[15]=1,c):new re(e[0],e[3],e[6],r.x,e[1],e[4],e[7],r.y,e[2],e[5],e[8],r.z,0,0,0,1)},re.fromTranslationQuaternionRotationScale=function(e,r,a,c){t.Check.typeOf.object("translation",e),t.Check.typeOf.object("rotation",r),t.Check.typeOf.object("scale",a),n.defined(c)||(c=new re);const o=a.x,i=a.y,u=a.z,s=r.x*r.x,f=r.x*r.y,h=r.x*r.z,l=r.x*r.w,y=r.y*r.y,p=r.y*r.z,d=r.y*r.w,m=r.z*r.z,O=r.z*r.w,C=r.w*r.w,b=s-y-m+C,k=2*(f-O),x=2*(h+d),g=2*(f+O),j=-s+y-m+C,w=2*(p-l),M=2*(h-d),z=2*(p+l),E=-s-y+m+C;return c[0]=b*o,c[1]=g*o,c[2]=M*o,c[3]=0,c[4]=k*i,c[5]=j*i,c[6]=z*i,c[7]=0,c[8]=x*u,c[9]=w*u,c[10]=E*u,c[11]=0,c[12]=e.x,c[13]=e.y,c[14]=e.z,c[15]=1,c},re.fromTranslationRotationScale=function(e,n){return t.Check.typeOf.object("translationRotationScale",e),re.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,n)},re.fromTranslation=function(e,n){return t.Check.typeOf.object("translation",e),re.fromRotationTranslation(V.IDENTITY,e,n)},re.fromScale=function(e,r){return t.Check.typeOf.object("scale",e),n.defined(r)?(r[0]=e.x,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=e.y,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=e.z,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r):new re(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},re.fromUniformScale=function(e,r){return t.Check.typeOf.number("scale",e),n.defined(r)?(r[0]=e,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=e,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=e,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r):new re(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)},re.fromRotation=function(e,r){return t.Check.typeOf.object("rotation",e),n.defined(r)||(r=new re),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=0,r[4]=e[3],r[5]=e[4],r[6]=e[5],r[7]=0,r[8]=e[6],r[9]=e[7],r[10]=e[8],r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r};const ae=new a,ce=new a,oe=new a;re.fromCamera=function(e,r){t.Check.typeOf.object("camera",e);const c=e.position,o=e.direction,i=e.up;t.Check.typeOf.object("camera.position",c),t.Check.typeOf.object("camera.direction",o),t.Check.typeOf.object("camera.up",i),a.normalize(o,ae),a.normalize(a.cross(ae,i,ce),ce),a.normalize(a.cross(ce,ae,oe),oe);const u=ce.x,s=ce.y,f=ce.z,h=ae.x,l=ae.y,y=ae.z,p=oe.x,d=oe.y,m=oe.z,O=c.x,C=c.y,b=c.z,k=u*-O+s*-C+f*-b,x=p*-O+d*-C+m*-b,g=h*O+l*C+y*b;return n.defined(r)?(r[0]=u,r[1]=p,r[2]=-h,r[3]=0,r[4]=s,r[5]=d,r[6]=-l,r[7]=0,r[8]=f,r[9]=m,r[10]=-y,r[11]=0,r[12]=k,r[13]=x,r[14]=g,r[15]=1,r):new re(u,s,f,k,p,d,m,x,-h,-l,-y,g,0,0,0,1)},re.computePerspectiveFieldOfView=function(e,n,r,a,c){t.Check.typeOf.number.greaterThan("fovY",e,0),t.Check.typeOf.number.lessThan("fovY",e,Math.PI),t.Check.typeOf.number.greaterThan("near",r,0),t.Check.typeOf.number.greaterThan("far",a,0),t.Check.typeOf.object("result",c);const o=Math.tan(.5*e),i=1/o,u=i/n,s=(a+r)/(r-a),f=2*a*r/(r-a);return c[0]=u,c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[5]=i,c[6]=0,c[7]=0,c[8]=0,c[9]=0,c[10]=s,c[11]=-1,c[12]=0,c[13]=0,c[14]=f,c[15]=0,c},re.computeOrthographicOffCenter=function(e,n,r,a,c,o,i){t.Check.typeOf.number("left",e),t.Check.typeOf.number("right",n),t.Check.typeOf.number("bottom",r),t.Check.typeOf.number("top",a),t.Check.typeOf.number("near",c),t.Check.typeOf.number("far",o),t.Check.typeOf.object("result",i);let u=1/(n-e),s=1/(a-r),f=1/(o-c);const h=-(n+e)*u,l=-(a+r)*s,y=-(o+c)*f;return u*=2,s*=2,f*=-2,i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=f,i[11]=0,i[12]=h,i[13]=l,i[14]=y,i[15]=1,i},re.computePerspectiveOffCenter=function(e,n,r,a,c,o,i){t.Check.typeOf.number("left",e),t.Check.typeOf.number("right",n),t.Check.typeOf.number("bottom",r),t.Check.typeOf.number("top",a),t.Check.typeOf.number("near",c),t.Check.typeOf.number("far",o),t.Check.typeOf.object("result",i);const u=2*c/(n-e),s=2*c/(a-r),f=(n+e)/(n-e),h=(a+r)/(a-r),l=-(o+c)/(o-c),y=-1,p=-2*o*c/(o-c);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=f,i[9]=h,i[10]=l,i[11]=y,i[12]=0,i[13]=0,i[14]=p,i[15]=0,i},re.computeInfinitePerspectiveOffCenter=function(e,n,r,a,c,o){t.Check.typeOf.number("left",e),t.Check.typeOf.number("right",n),t.Check.typeOf.number("bottom",r),t.Check.typeOf.number("top",a),t.Check.typeOf.number("near",c),t.Check.typeOf.object("result",o);const i=2*c/(n-e),u=2*c/(a-r),s=(n+e)/(n-e),f=(a+r)/(a-r),h=-1,l=-1,y=-2*c;return o[0]=i,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=u,o[6]=0,o[7]=0,o[8]=s,o[9]=f,o[10]=h,o[11]=l,o[12]=0,o[13]=0,o[14]=y,o[15]=0,o},re.computeViewportTransformation=function(e,t,r,a){n.defined(a)||(a=new re),e=n.defaultValue(e,n.defaultValue.EMPTY_OBJECT);const c=n.defaultValue(e.x,0),o=n.defaultValue(e.y,0),i=n.defaultValue(e.width,0),u=n.defaultValue(e.height,0);t=n.defaultValue(t,0),r=n.defaultValue(r,1);const s=.5*i,f=.5*u,h=.5*(r-t),l=s,y=f,p=h,d=c+s,m=o+f,O=t+h,C=1;return a[0]=l,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=y,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=p,a[11]=0,a[12]=d,a[13]=m,a[14]=O,a[15]=C,a},re.computeView=function(e,n,r,c,o){return t.Check.typeOf.object("position",e),t.Check.typeOf.object("direction",n),t.Check.typeOf.object("up",r),t.Check.typeOf.object("right",c),t.Check.typeOf.object("result",o),o[0]=c.x,o[1]=r.x,o[2]=-n.x,o[3]=0,o[4]=c.y,o[5]=r.y,o[6]=-n.y,o[7]=0,o[8]=c.z,o[9]=r.z,o[10]=-n.z,o[11]=0,o[12]=-a.dot(c,e),o[13]=-a.dot(r,e),o[14]=a.dot(n,e),o[15]=1,o},re.toArray=function(e,r){return t.Check.typeOf.object("matrix",e),n.defined(r)?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},re.getElementIndex=function(e,n){return t.Check.typeOf.number.greaterThanOrEquals("row",n,0),t.Check.typeOf.number.lessThanOrEquals("row",n,3),t.Check.typeOf.number.greaterThanOrEquals("column",e,0),t.Check.typeOf.number.lessThanOrEquals("column",e,3),4*e+n},re.getColumn=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,3),t.Check.typeOf.object("result",r);const a=4*n,c=e[a],o=e[a+1],i=e[a+2],u=e[a+3];return r.x=c,r.y=o,r.z=i,r.w=u,r},re.setColumn=function(e,n,r,a){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,3),t.Check.typeOf.object("cartesian",r),t.Check.typeOf.object("result",a),a=re.clone(e,a);const c=4*n;return a[c]=r.x,a[c+1]=r.y,a[c+2]=r.z,a[c+3]=r.w,a},re.getRow=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,3),t.Check.typeOf.object("result",r);const a=e[n],c=e[n+4],o=e[n+8],i=e[n+12];return r.x=a,r.y=c,r.z=o,r.w=i,r},re.setRow=function(e,n,r,a){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,3),t.Check.typeOf.object("cartesian",r),t.Check.typeOf.object("result",a),a=re.clone(e,a),a[n]=r.x,a[n+4]=r.y,a[n+8]=r.z,a[n+12]=r.w,a},re.setTranslation=function(e,n,r){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("translation",n),t.Check.typeOf.object("result",r),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=n.x,r[13]=n.y,r[14]=n.z,r[15]=e[15],r};const ie=new a;re.setScale=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("scale",n),t.Check.typeOf.object("result",r);const a=re.getScale(e,ie),c=n.x/a.x,o=n.y/a.y,i=n.z/a.z;return r[0]=e[0]*c,r[1]=e[1]*c,r[2]=e[2]*c,r[3]=e[3],r[4]=e[4]*o,r[5]=e[5]*o,r[6]=e[6]*o,r[7]=e[7],r[8]=e[8]*i,r[9]=e[9]*i,r[10]=e[10]*i,r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r};const ue=new a;re.setUniformScale=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number("scale",n),t.Check.typeOf.object("result",r);const a=re.getScale(e,ue),c=n/a.x,o=n/a.y,i=n/a.z;return r[0]=e[0]*c,r[1]=e[1]*c,r[2]=e[2]*c,r[3]=e[3],r[4]=e[4]*o,r[5]=e[5]*o,r[6]=e[6]*o,r[7]=e[7],r[8]=e[8]*i,r[9]=e[9]*i,r[10]=e[10]*i,r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r};const se=new a;re.getScale=function(e,n){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n.x=a.magnitude(a.fromElements(e[0],e[1],e[2],se)),n.y=a.magnitude(a.fromElements(e[4],e[5],e[6],se)),n.z=a.magnitude(a.fromElements(e[8],e[9],e[10],se)),n};const fe=new a;re.getMaximumScale=function(e){return re.getScale(e,fe),a.maximumComponent(fe)};const he=new a;re.setRotation=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",r);const a=re.getScale(e,he);return r[0]=n[0]*a.x,r[1]=n[1]*a.x,r[2]=n[2]*a.x,r[3]=e[3],r[4]=n[3]*a.y,r[5]=n[4]*a.y,r[6]=n[5]*a.y,r[7]=e[7],r[8]=n[6]*a.z,r[9]=n[7]*a.z,r[10]=n[8]*a.z,r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r};const le=new a;re.getRotation=function(e,n){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n);const r=re.getScale(e,le);return n[0]=e[0]/r.x,n[1]=e[1]/r.x,n[2]=e[2]/r.x,n[3]=e[4]/r.y,n[4]=e[5]/r.y,n[5]=e[6]/r.y,n[6]=e[8]/r.z,n[7]=e[9]/r.z,n[8]=e[10]/r.z,n},re.multiply=function(e,n,r){t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r);const a=e[0],c=e[1],o=e[2],i=e[3],u=e[4],s=e[5],f=e[6],h=e[7],l=e[8],y=e[9],p=e[10],d=e[11],m=e[12],O=e[13],C=e[14],b=e[15],k=n[0],x=n[1],g=n[2],j=n[3],w=n[4],M=n[5],z=n[6],E=n[7],q=n[8],T=n[9],S=n[10],R=n[11],_=n[12],V=n[13],v=n[14],A=n[15],N=a*k+u*x+l*g+m*j,I=c*k+s*x+y*g+O*j,U=o*k+f*x+p*g+C*j,P=i*k+h*x+d*g+b*j,L=a*w+u*M+l*z+m*E,W=c*w+s*M+y*z+O*E,B=o*w+f*M+p*z+C*E,D=i*w+h*M+d*z+b*E,$=a*q+u*T+l*S+m*R,X=c*q+s*T+y*S+O*R,Z=o*q+f*T+p*S+C*R,Y=i*q+h*T+d*S+b*R,F=a*_+u*V+l*v+m*A,G=c*_+s*V+y*v+O*A,H=o*_+f*V+p*v+C*A,Q=i*_+h*V+d*v+b*A;return r[0]=N,r[1]=I,r[2]=U,r[3]=P,r[4]=L,r[5]=W,r[6]=B,r[7]=D,r[8]=$,r[9]=X,r[10]=Z,r[11]=Y,r[12]=F,r[13]=G,r[14]=H,r[15]=Q,r},re.add=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r[0]=e[0]+n[0],r[1]=e[1]+n[1],r[2]=e[2]+n[2],r[3]=e[3]+n[3],r[4]=e[4]+n[4],r[5]=e[5]+n[5],r[6]=e[6]+n[6],r[7]=e[7]+n[7],r[8]=e[8]+n[8],r[9]=e[9]+n[9],r[10]=e[10]+n[10],r[11]=e[11]+n[11],r[12]=e[12]+n[12],r[13]=e[13]+n[13],r[14]=e[14]+n[14],r[15]=e[15]+n[15],r},re.subtract=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],r[3]=e[3]-n[3],r[4]=e[4]-n[4],r[5]=e[5]-n[5],r[6]=e[6]-n[6],r[7]=e[7]-n[7],r[8]=e[8]-n[8],r[9]=e[9]-n[9],r[10]=e[10]-n[10],r[11]=e[11]-n[11],r[12]=e[12]-n[12],r[13]=e[13]-n[13],r[14]=e[14]-n[14],r[15]=e[15]-n[15],r},re.multiplyTransformation=function(e,n,r){t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r);const a=e[0],c=e[1],o=e[2],i=e[4],u=e[5],s=e[6],f=e[8],h=e[9],l=e[10],y=e[12],p=e[13],d=e[14],m=n[0],O=n[1],C=n[2],b=n[4],k=n[5],x=n[6],g=n[8],j=n[9],w=n[10],M=n[12],z=n[13],E=n[14],q=a*m+i*O+f*C,T=c*m+u*O+h*C,S=o*m+s*O+l*C,R=a*b+i*k+f*x,_=c*b+u*k+h*x,V=o*b+s*k+l*x,v=a*g+i*j+f*w,A=c*g+u*j+h*w,N=o*g+s*j+l*w,I=a*M+i*z+f*E+y,U=c*M+u*z+h*E+p,P=o*M+s*z+l*E+d;return r[0]=q,r[1]=T,r[2]=S,r[3]=0,r[4]=R,r[5]=_,r[6]=V,r[7]=0,r[8]=v,r[9]=A,r[10]=N,r[11]=0,r[12]=I,r[13]=U,r[14]=P,r[15]=1,r},re.multiplyByMatrix3=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("rotation",n),t.Check.typeOf.object("result",r);const a=e[0],c=e[1],o=e[2],i=e[4],u=e[5],s=e[6],f=e[8],h=e[9],l=e[10],y=n[0],p=n[1],d=n[2],m=n[3],O=n[4],C=n[5],b=n[6],k=n[7],x=n[8],g=a*y+i*p+f*d,j=c*y+u*p+h*d,w=o*y+s*p+l*d,M=a*m+i*O+f*C,z=c*m+u*O+h*C,E=o*m+s*O+l*C,q=a*b+i*k+f*x,T=c*b+u*k+h*x,S=o*b+s*k+l*x;return r[0]=g,r[1]=j,r[2]=w,r[3]=0,r[4]=M,r[5]=z,r[6]=E,r[7]=0,r[8]=q,r[9]=T,r[10]=S,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},re.multiplyByTranslation=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("translation",n),t.Check.typeOf.object("result",r);const a=n.x,c=n.y,o=n.z,i=a*e[0]+c*e[4]+o*e[8]+e[12],u=a*e[1]+c*e[5]+o*e[9]+e[13],s=a*e[2]+c*e[6]+o*e[10]+e[14];return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=i,r[13]=u,r[14]=s,r[15]=e[15],r},re.multiplyByScale=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("scale",n),t.Check.typeOf.object("result",r);const a=n.x,c=n.y,o=n.z;return 1===a&&1===c&&1===o?re.clone(e,r):(r[0]=a*e[0],r[1]=a*e[1],r[2]=a*e[2],r[3]=e[3],r[4]=c*e[4],r[5]=c*e[5],r[6]=c*e[6],r[7]=e[7],r[8]=o*e[8],r[9]=o*e[9],r[10]=o*e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r)},re.multiplyByUniformScale=function(e,n,r){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.number("scale",n),t.Check.typeOf.object("result",r),r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3],r[4]=e[4]*n,r[5]=e[5]*n,r[6]=e[6]*n,r[7]=e[7],r[8]=e[8]*n,r[9]=e[9]*n,r[10]=e[10]*n,r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},re.multiplyByVector=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("cartesian",n),t.Check.typeOf.object("result",r);const a=n.x,c=n.y,o=n.z,i=n.w,u=e[0]*a+e[4]*c+e[8]*o+e[12]*i,s=e[1]*a+e[5]*c+e[9]*o+e[13]*i,f=e[2]*a+e[6]*c+e[10]*o+e[14]*i,h=e[3]*a+e[7]*c+e[11]*o+e[15]*i;return r.x=u,r.y=s,r.z=f,r.w=h,r},re.multiplyByPointAsVector=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("cartesian",n),t.Check.typeOf.object("result",r);const a=n.x,c=n.y,o=n.z,i=e[0]*a+e[4]*c+e[8]*o,u=e[1]*a+e[5]*c+e[9]*o,s=e[2]*a+e[6]*c+e[10]*o;return r.x=i,r.y=u,r.z=s,r},re.multiplyByPoint=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("cartesian",n),t.Check.typeOf.object("result",r);const a=n.x,c=n.y,o=n.z,i=e[0]*a+e[4]*c+e[8]*o+e[12],u=e[1]*a+e[5]*c+e[9]*o+e[13],s=e[2]*a+e[6]*c+e[10]*o+e[14];return r.x=i,r.y=u,r.z=s,r},re.multiplyByScalar=function(e,n,r){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.number("scalar",n),t.Check.typeOf.object("result",r),r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3]*n,r[4]=e[4]*n,r[5]=e[5]*n,r[6]=e[6]*n,r[7]=e[7]*n,r[8]=e[8]*n,r[9]=e[9]*n,r[10]=e[10]*n,r[11]=e[11]*n,r[12]=e[12]*n,r[13]=e[13]*n,r[14]=e[14]*n,r[15]=e[15]*n,r},re.negate=function(e,n){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=-e[3],n[4]=-e[4],n[5]=-e[5],n[6]=-e[6],n[7]=-e[7],n[8]=-e[8],n[9]=-e[9],n[10]=-e[10],n[11]=-e[11],n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=-e[15],n},re.transpose=function(e,n){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n);const r=e[1],a=e[2],c=e[3],o=e[6],i=e[7],u=e[11];return n[0]=e[0],n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=r,n[5]=e[5],n[6]=e[9],n[7]=e[13],n[8]=a,n[9]=o,n[10]=e[10],n[11]=e[14],n[12]=c,n[13]=i,n[14]=u,n[15]=e[15],n},re.abs=function(e,n){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n[0]=Math.abs(e[0]),n[1]=Math.abs(e[1]),n[2]=Math.abs(e[2]),n[3]=Math.abs(e[3]),n[4]=Math.abs(e[4]),n[5]=Math.abs(e[5]),n[6]=Math.abs(e[6]),n[7]=Math.abs(e[7]),n[8]=Math.abs(e[8]),n[9]=Math.abs(e[9]),n[10]=Math.abs(e[10]),n[11]=Math.abs(e[11]),n[12]=Math.abs(e[12]),n[13]=Math.abs(e[13]),n[14]=Math.abs(e[14]),n[15]=Math.abs(e[15]),n},re.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},re.equalsEpsilon=function(e,t,r){return r=n.defaultValue(r,0),e===t||n.defined(e)&&n.defined(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},re.getTranslation=function(e,n){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n.x=e[12],n.y=e[13],n.z=e[14],n},re.getMatrix3=function(e,n){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[4],n[4]=e[5],n[5]=e[6],n[6]=e[8],n[7]=e[9],n[8]=e[10],n};const ye=new V,pe=new V,de=new F,me=new F(0,0,0,1);re.inverse=function(e,n){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n);const a=e[0],c=e[4],o=e[8],i=e[12],u=e[1],s=e[5],f=e[9],h=e[13],l=e[2],y=e[6],p=e[10],d=e[14],m=e[3],O=e[7],C=e[11],b=e[15];let k=p*b,x=d*C,g=y*b,j=d*O,w=y*C,M=p*O,z=l*b,E=d*m,q=l*C,T=p*m,S=l*O,R=y*m;const _=k*s+j*f+w*h-(x*s+g*f+M*h),v=x*u+z*f+T*h-(k*u+E*f+q*h),A=g*u+E*s+S*h-(j*u+z*s+R*h),N=M*u+q*s+R*f-(w*u+T*s+S*f),I=x*c+g*o+M*i-(k*c+j*o+w*i),U=k*a+E*o+q*i-(x*a+z*o+T*i),P=j*a+z*c+R*i-(g*a+E*c+S*i),L=w*a+T*c+S*o-(M*a+q*c+R*o);k=o*h,x=i*f,g=c*h,j=i*s,w=c*f,M=o*s,z=a*h,E=i*u,q=a*f,T=o*u,S=a*s,R=c*u;const W=k*O+j*C+w*b-(x*O+g*C+M*b),B=x*m+z*C+T*b-(k*m+E*C+q*b),D=g*m+E*O+S*b-(j*m+z*O+R*b),$=M*m+q*O+R*C-(w*m+T*O+S*C),X=g*p+M*d+x*y-(w*d+k*y+j*p),Z=q*d+k*l+E*p-(z*p+T*d+x*l),Y=z*y+R*d+j*l-(S*d+g*l+E*y),G=S*p+w*l+T*y-(q*y+R*p+M*l);let H=a*_+c*v+o*A+i*N;if(Math.abs(H)<r.CesiumMath.EPSILON21){if(V.equalsEpsilon(re.getMatrix3(e,ye),pe,r.CesiumMath.EPSILON7)&&F.equals(re.getRow(e,3,de),me))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;throw new t.RuntimeError("matrix is not invertible because its determinate is zero.")}return H=1/H,n[0]=_*H,n[1]=v*H,n[2]=A*H,n[3]=N*H,n[4]=I*H,n[5]=U*H,n[6]=P*H,n[7]=L*H,n[8]=W*H,n[9]=B*H,n[10]=D*H,n[11]=$*H,n[12]=X*H,n[13]=Z*H,n[14]=Y*H,n[15]=G*H,n},re.inverseTransformation=function(e,n){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n);const r=e[0],a=e[1],c=e[2],o=e[4],i=e[5],u=e[6],s=e[8],f=e[9],h=e[10],l=e[12],y=e[13],p=e[14],d=-r*l-a*y-c*p,m=-o*l-i*y-u*p,O=-s*l-f*y-h*p;return n[0]=r,n[1]=o,n[2]=s,n[3]=0,n[4]=a,n[5]=i,n[6]=f,n[7]=0,n[8]=c,n[9]=u,n[10]=h,n[11]=0,n[12]=d,n[13]=m,n[14]=O,n[15]=1,n};const Oe=new re;function Ce(e,t,r,a){this.west=n.defaultValue(e,0),this.south=n.defaultValue(t,0),this.east=n.defaultValue(r,0),this.north=n.defaultValue(a,0)}re.inverseTranspose=function(e,n){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),re.inverse(re.transpose(e,Oe),n)},re.IDENTITY=Object.freeze(new re(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),re.ZERO=Object.freeze(new re(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),re.COLUMN0ROW0=0,re.COLUMN0ROW1=1,re.COLUMN0ROW2=2,re.COLUMN0ROW3=3,re.COLUMN1ROW0=4,re.COLUMN1ROW1=5,re.COLUMN1ROW2=6,re.COLUMN1ROW3=7,re.COLUMN2ROW0=8,re.COLUMN2ROW1=9,re.COLUMN2ROW2=10,re.COLUMN2ROW3=11,re.COLUMN3ROW0=12,re.COLUMN3ROW1=13,re.COLUMN3ROW2=14,re.COLUMN3ROW3=15,Object.defineProperties(re.prototype,{length:{get:function(){return re.packedLength}}}),re.prototype.clone=function(e){return re.clone(this,e)},re.prototype.equals=function(e){return re.equals(this,e)},re.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},re.prototype.equalsEpsilon=function(e,t){return re.equalsEpsilon(this,e,t)},re.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})\n(${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})\n(${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})\n(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`},Object.defineProperties(Ce.prototype,{width:{get:function(){return Ce.computeWidth(this)}},height:{get:function(){return Ce.computeHeight(this)}}}),Ce.packedLength=4,Ce.pack=function(e,r,a){return t.Check.typeOf.object("value",e),t.Check.defined("array",r),a=n.defaultValue(a,0),r[a++]=e.west,r[a++]=e.south,r[a++]=e.east,r[a]=e.north,r},Ce.unpack=function(e,r,a){return t.Check.defined("array",e),r=n.defaultValue(r,0),n.defined(a)||(a=new Ce),a.west=e[r++],a.south=e[r++],a.east=e[r++],a.north=e[r],a},Ce.computeWidth=function(e){t.Check.typeOf.object("rectangle",e);let n=e.east;const a=e.west;return n<a&&(n+=r.CesiumMath.TWO_PI),n-a},Ce.computeHeight=function(e){return t.Check.typeOf.object("rectangle",e),e.north-e.south},Ce.fromDegrees=function(e,t,a,c,o){return e=r.CesiumMath.toRadians(n.defaultValue(e,0)),t=r.CesiumMath.toRadians(n.defaultValue(t,0)),a=r.CesiumMath.toRadians(n.defaultValue(a,0)),c=r.CesiumMath.toRadians(n.defaultValue(c,0)),n.defined(o)?(o.west=e,o.south=t,o.east=a,o.north=c,o):new Ce(e,t,a,c)},Ce.fromRadians=function(e,t,r,a,c){return n.defined(c)?(c.west=n.defaultValue(e,0),c.south=n.defaultValue(t,0),c.east=n.defaultValue(r,0),c.north=n.defaultValue(a,0),c):new Ce(e,t,r,a)},Ce.fromCartographicArray=function(e,a){t.Check.defined("cartographics",e);let c=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,u=-Number.MAX_VALUE,s=Number.MAX_VALUE,f=-Number.MAX_VALUE;for(let t=0,n=e.length;t<n;t++){const n=e[t];c=Math.min(c,n.longitude),o=Math.max(o,n.longitude),s=Math.min(s,n.latitude),f=Math.max(f,n.latitude);const a=n.longitude>=0?n.longitude:n.longitude+r.CesiumMath.TWO_PI;i=Math.min(i,a),u=Math.max(u,a)}return o-c>u-i&&(c=i,o=u,o>r.CesiumMath.PI&&(o-=r.CesiumMath.TWO_PI),c>r.CesiumMath.PI&&(c-=r.CesiumMath.TWO_PI)),n.defined(a)?(a.west=c,a.south=s,a.east=o,a.north=f,a):new Ce(c,s,o,f)},Ce.fromCartesianArray=function(e,a,c){t.Check.defined("cartesians",e),a=n.defaultValue(a,w.WGS84);let o=Number.MAX_VALUE,i=-Number.MAX_VALUE,u=Number.MAX_VALUE,s=-Number.MAX_VALUE,f=Number.MAX_VALUE,h=-Number.MAX_VALUE;for(let t=0,n=e.length;t<n;t++){const n=a.cartesianToCartographic(e[t]);o=Math.min(o,n.longitude),i=Math.max(i,n.longitude),f=Math.min(f,n.latitude),h=Math.max(h,n.latitude);const c=n.longitude>=0?n.longitude:n.longitude+r.CesiumMath.TWO_PI;u=Math.min(u,c),s=Math.max(s,c)}return i-o>s-u&&(o=u,i=s,i>r.CesiumMath.PI&&(i-=r.CesiumMath.TWO_PI),o>r.CesiumMath.PI&&(o-=r.CesiumMath.TWO_PI)),n.defined(c)?(c.west=o,c.south=f,c.east=i,c.north=h,c):new Ce(o,f,i,h)},Ce.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new Ce(e.west,e.south,e.east,e.north)},Ce.equalsEpsilon=function(e,t,r){return r=n.defaultValue(r,0),e===t||n.defined(e)&&n.defined(t)&&Math.abs(e.west-t.west)<=r&&Math.abs(e.south-t.south)<=r&&Math.abs(e.east-t.east)<=r&&Math.abs(e.north-t.north)<=r},Ce.prototype.clone=function(e){return Ce.clone(this,e)},Ce.prototype.equals=function(e){return Ce.equals(this,e)},Ce.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},Ce.prototype.equalsEpsilon=function(e,t){return Ce.equalsEpsilon(this,e,t)},Ce.validate=function(e){t.Check.typeOf.object("rectangle",e);const n=e.north;t.Check.typeOf.number.greaterThanOrEquals("north",n,-r.CesiumMath.PI_OVER_TWO),t.Check.typeOf.number.lessThanOrEquals("north",n,r.CesiumMath.PI_OVER_TWO);const a=e.south;t.Check.typeOf.number.greaterThanOrEquals("south",a,-r.CesiumMath.PI_OVER_TWO),t.Check.typeOf.number.lessThanOrEquals("south",a,r.CesiumMath.PI_OVER_TWO);const c=e.west;t.Check.typeOf.number.greaterThanOrEquals("west",c,-Math.PI),t.Check.typeOf.number.lessThanOrEquals("west",c,Math.PI);const o=e.east;t.Check.typeOf.number.greaterThanOrEquals("east",o,-Math.PI),t.Check.typeOf.number.lessThanOrEquals("east",o,Math.PI)},Ce.southwest=function(e,r){return t.Check.typeOf.object("rectangle",e),n.defined(r)?(r.longitude=e.west,r.latitude=e.south,r.height=0,r):new m(e.west,e.south)},Ce.northwest=function(e,r){return t.Check.typeOf.object("rectangle",e),n.defined(r)?(r.longitude=e.west,r.latitude=e.north,r.height=0,r):new m(e.west,e.north)},Ce.northeast=function(e,r){return t.Check.typeOf.object("rectangle",e),n.defined(r)?(r.longitude=e.east,r.latitude=e.north,r.height=0,r):new m(e.east,e.north)},Ce.southeast=function(e,r){return t.Check.typeOf.object("rectangle",e),n.defined(r)?(r.longitude=e.east,r.latitude=e.south,r.height=0,r):new m(e.east,e.south)},Ce.center=function(e,a){t.Check.typeOf.object("rectangle",e);let c=e.east;const o=e.west;c<o&&(c+=r.CesiumMath.TWO_PI);const i=r.CesiumMath.negativePiToPi(.5*(o+c)),u=.5*(e.south+e.north);return n.defined(a)?(a.longitude=i,a.latitude=u,a.height=0,a):new m(i,u)},Ce.intersection=function(e,a,c){t.Check.typeOf.object("rectangle",e),t.Check.typeOf.object("otherRectangle",a);let o=e.east,i=e.west,u=a.east,s=a.west;o<i&&u>0?o+=r.CesiumMath.TWO_PI:u<s&&o>0&&(u+=r.CesiumMath.TWO_PI),o<i&&s<0?s+=r.CesiumMath.TWO_PI:u<s&&i<0&&(i+=r.CesiumMath.TWO_PI);const f=r.CesiumMath.negativePiToPi(Math.max(i,s)),h=r.CesiumMath.negativePiToPi(Math.min(o,u));if((e.west<e.east||a.west<a.east)&&h<=f)return;const l=Math.max(e.south,a.south),y=Math.min(e.north,a.north);return l>=y?void 0:n.defined(c)?(c.west=f,c.south=l,c.east=h,c.north=y,c):new Ce(f,l,h,y)},Ce.simpleIntersection=function(e,r,a){t.Check.typeOf.object("rectangle",e),t.Check.typeOf.object("otherRectangle",r);const c=Math.max(e.west,r.west),o=Math.max(e.south,r.south),i=Math.min(e.east,r.east),u=Math.min(e.north,r.north);if(!(o>=u||c>=i))return n.defined(a)?(a.west=c,a.south=o,a.east=i,a.north=u,a):new Ce(c,o,i,u)},Ce.union=function(e,a,c){t.Check.typeOf.object("rectangle",e),t.Check.typeOf.object("otherRectangle",a),n.defined(c)||(c=new Ce);let o=e.east,i=e.west,u=a.east,s=a.west;o<i&&u>0?o+=r.CesiumMath.TWO_PI:u<s&&o>0&&(u+=r.CesiumMath.TWO_PI),o<i&&s<0?s+=r.CesiumMath.TWO_PI:u<s&&i<0&&(i+=r.CesiumMath.TWO_PI);const f=r.CesiumMath.negativePiToPi(Math.min(i,s)),h=r.CesiumMath.negativePiToPi(Math.max(o,u));return c.west=f,c.south=Math.min(e.south,a.south),c.east=h,c.north=Math.max(e.north,a.north),c},Ce.expand=function(e,r,a){return t.Check.typeOf.object("rectangle",e),t.Check.typeOf.object("cartographic",r),n.defined(a)||(a=new Ce),a.west=Math.min(e.west,r.longitude),a.south=Math.min(e.south,r.latitude),a.east=Math.max(e.east,r.longitude),a.north=Math.max(e.north,r.latitude),a},Ce.contains=function(e,n){t.Check.typeOf.object("rectangle",e),t.Check.typeOf.object("cartographic",n);let a=n.longitude;const c=n.latitude,o=e.west;let i=e.east;return i<o&&(i+=r.CesiumMath.TWO_PI,a<0&&(a+=r.CesiumMath.TWO_PI)),(a>o||r.CesiumMath.equalsEpsilon(a,o,r.CesiumMath.EPSILON14))&&(a<i||r.CesiumMath.equalsEpsilon(a,i,r.CesiumMath.EPSILON14))&&c>=e.south&&c<=e.north};const be=new m;function ke(e,t){this.x=n.defaultValue(e,0),this.y=n.defaultValue(t,0)}Ce.subsample=function(e,a,c,o){t.Check.typeOf.object("rectangle",e),a=n.defaultValue(a,w.WGS84),c=n.defaultValue(c,0),n.defined(o)||(o=[]);let i=0;const u=e.north,s=e.south,f=e.east,h=e.west,l=be;l.height=c,l.longitude=h,l.latitude=u,o[i]=a.cartographicToCartesian(l,o[i]),i++,l.longitude=f,o[i]=a.cartographicToCartesian(l,o[i]),i++,l.latitude=s,o[i]=a.cartographicToCartesian(l,o[i]),i++,l.longitude=h,o[i]=a.cartographicToCartesian(l,o[i]),i++,l.latitude=u<0?u:s>0?s:0;for(let t=1;t<8;++t)l.longitude=-Math.PI+t*r.CesiumMath.PI_OVER_TWO,Ce.contains(e,l)&&(o[i]=a.cartographicToCartesian(l,o[i]),i++);return 0===l.latitude&&(l.longitude=h,o[i]=a.cartographicToCartesian(l,o[i]),i++,l.longitude=f,o[i]=a.cartographicToCartesian(l,o[i]),i++),o.length=i,o},Ce.subsection=function(e,a,c,o,i,u){if(t.Check.typeOf.object("rectangle",e),t.Check.typeOf.number.greaterThanOrEquals("westLerp",a,0),t.Check.typeOf.number.lessThanOrEquals("westLerp",a,1),t.Check.typeOf.number.greaterThanOrEquals("southLerp",c,0),t.Check.typeOf.number.lessThanOrEquals("southLerp",c,1),t.Check.typeOf.number.greaterThanOrEquals("eastLerp",o,0),t.Check.typeOf.number.lessThanOrEquals("eastLerp",o,1),t.Check.typeOf.number.greaterThanOrEquals("northLerp",i,0),t.Check.typeOf.number.lessThanOrEquals("northLerp",i,1),t.Check.typeOf.number.lessThanOrEquals("westLerp",a,o),t.Check.typeOf.number.lessThanOrEquals("southLerp",c,i),n.defined(u)||(u=new Ce),e.west<=e.east){const t=e.east-e.west;u.west=e.west+a*t,u.east=e.west+o*t}else{const t=r.CesiumMath.TWO_PI+e.east-e.west;u.west=r.CesiumMath.negativePiToPi(e.west+a*t),u.east=r.CesiumMath.negativePiToPi(e.west+o*t)}const s=e.north-e.south;return u.south=e.south+c*s,u.north=e.south+i*s,1===a&&(u.west=e.east),1===o&&(u.east=e.east),1===c&&(u.south=e.north),1===i&&(u.north=e.north),u},Ce.MAX_VALUE=Object.freeze(new Ce(-Math.PI,-r.CesiumMath.PI_OVER_TWO,Math.PI,r.CesiumMath.PI_OVER_TWO)),ke.fromElements=function(e,t,r){return n.defined(r)?(r.x=e,r.y=t,r):new ke(e,t)},ke.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t.x=e.x,t.y=e.y,t):new ke(e.x,e.y)},ke.fromCartesian3=ke.clone,ke.fromCartesian4=ke.clone,ke.packedLength=2,ke.pack=function(e,r,a){return t.Check.typeOf.object("value",e),t.Check.defined("array",r),a=n.defaultValue(a,0),r[a++]=e.x,r[a]=e.y,r},ke.unpack=function(e,r,a){return t.Check.defined("array",e),r=n.defaultValue(r,0),n.defined(a)||(a=new ke),a.x=e[r++],a.y=e[r],a},ke.packArray=function(e,r){t.Check.defined("array",e);const a=e.length,c=2*a;if(n.defined(r)){if(!Array.isArray(r)&&r.length!==c)throw new t.DeveloperError("If result is a typed array, it must have exactly array.length * 2 elements");r.length!==c&&(r.length=c)}else r=new Array(c);for(let t=0;t<a;++t)ke.pack(e[t],r,2*t);return r},ke.unpackArray=function(e,r){if(t.Check.defined("array",e),t.Check.typeOf.number.greaterThanOrEquals("array.length",e.length,2),e.length%2!==0)throw new t.DeveloperError("array length must be a multiple of 2.");const a=e.length;n.defined(r)?r.length=a/2:r=new Array(a/2);for(let t=0;t<a;t+=2){const n=t/2;r[n]=ke.unpack(e,t,r[n])}return r},ke.fromArray=ke.unpack,ke.maximumComponent=function(e){return t.Check.typeOf.object("cartesian",e),Math.max(e.x,e.y)},ke.minimumComponent=function(e){return t.Check.typeOf.object("cartesian",e),Math.min(e.x,e.y)},ke.minimumByComponent=function(e,n,r){return t.Check.typeOf.object("first",e),t.Check.typeOf.object("second",n),t.Check.typeOf.object("result",r),r.x=Math.min(e.x,n.x),r.y=Math.min(e.y,n.y),r},ke.maximumByComponent=function(e,n,r){return t.Check.typeOf.object("first",e),t.Check.typeOf.object("second",n),t.Check.typeOf.object("result",r),r.x=Math.max(e.x,n.x),r.y=Math.max(e.y,n.y),r},ke.clamp=function(e,n,a,c){t.Check.typeOf.object("value",e),t.Check.typeOf.object("min",n),t.Check.typeOf.object("max",a),t.Check.typeOf.object("result",c);const o=r.CesiumMath.clamp(e.x,n.x,a.x),i=r.CesiumMath.clamp(e.y,n.y,a.y);return c.x=o,c.y=i,c},ke.magnitudeSquared=function(e){return t.Check.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y},ke.magnitude=function(e){return Math.sqrt(ke.magnitudeSquared(e))};const xe=new ke;ke.distance=function(e,n){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),ke.subtract(e,n,xe),ke.magnitude(xe)},ke.distanceSquared=function(e,n){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),ke.subtract(e,n,xe),ke.magnitudeSquared(xe)},ke.normalize=function(e,n){t.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n);const r=ke.magnitude(e);if(n.x=e.x/r,n.y=e.y/r,isNaN(n.x)||isNaN(n.y))throw new t.DeveloperError("normalized result is not a number");return n},ke.dot=function(e,n){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),e.x*n.x+e.y*n.y},ke.cross=function(e,n){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),e.x*n.y-e.y*n.x},ke.multiplyComponents=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x*n.x,r.y=e.y*n.y,r},ke.divideComponents=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x/n.x,r.y=e.y/n.y,r},ke.add=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x+n.x,r.y=e.y+n.y,r},ke.subtract=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x-n.x,r.y=e.y-n.y,r},ke.multiplyByScalar=function(e,n,r){return t.Check.typeOf.object("cartesian",e),t.Check.typeOf.number("scalar",n),t.Check.typeOf.object("result",r),r.x=e.x*n,r.y=e.y*n,r},ke.divideByScalar=function(e,n,r){return t.Check.typeOf.object("cartesian",e),t.Check.typeOf.number("scalar",n),t.Check.typeOf.object("result",r),r.x=e.x/n,r.y=e.y/n,r},ke.negate=function(e,n){return t.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n),n.x=-e.x,n.y=-e.y,n},ke.abs=function(e,n){return t.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n),n.x=Math.abs(e.x),n.y=Math.abs(e.y),n};const ge=new ke;ke.lerp=function(e,n,r,a){return t.Check.typeOf.object("start",e),t.Check.typeOf.object("end",n),t.Check.typeOf.number("t",r),t.Check.typeOf.object("result",a),ke.multiplyByScalar(n,r,ge),a=ke.multiplyByScalar(e,1-r,a),ke.add(ge,a,a)};const je=new ke,we=new ke;ke.angleBetween=function(e,n){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),ke.normalize(e,je),ke.normalize(n,we),r.CesiumMath.acosClamped(ke.dot(je,we))};const Me=new ke;function ze(e,t,r,a){this[0]=n.defaultValue(e,0),this[1]=n.defaultValue(r,0),this[2]=n.defaultValue(t,0),this[3]=n.defaultValue(a,0)}ke.mostOrthogonalAxis=function(e,n){t.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n);const r=ke.normalize(e,Me);return ke.abs(r,r),n=r.x<=r.y?ke.clone(ke.UNIT_X,n):ke.clone(ke.UNIT_Y,n),n},ke.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e.x===t.x&&e.y===t.y},ke.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},ke.equalsEpsilon=function(e,t,a,c){return e===t||n.defined(e)&&n.defined(t)&&r.CesiumMath.equalsEpsilon(e.x,t.x,a,c)&&r.CesiumMath.equalsEpsilon(e.y,t.y,a,c)},ke.ZERO=Object.freeze(new ke(0,0)),ke.ONE=Object.freeze(new ke(1,1)),ke.UNIT_X=Object.freeze(new ke(1,0)),ke.UNIT_Y=Object.freeze(new ke(0,1)),ke.prototype.clone=function(e){return ke.clone(this,e)},ke.prototype.equals=function(e){return ke.equals(this,e)},ke.prototype.equalsEpsilon=function(e,t,n){return ke.equalsEpsilon(this,e,t,n)},ke.prototype.toString=function(){return`(${this.x}, ${this.y})`},ze.packedLength=4,ze.pack=function(e,r,a){return t.Check.typeOf.object("value",e),t.Check.defined("array",r),a=n.defaultValue(a,0),r[a++]=e[0],r[a++]=e[1],r[a++]=e[2],r[a++]=e[3],r},ze.unpack=function(e,r,a){return t.Check.defined("array",e),r=n.defaultValue(r,0),n.defined(a)||(a=new ze),a[0]=e[r++],a[1]=e[r++],a[2]=e[r++],a[3]=e[r++],a},ze.packArray=function(e,r){t.Check.defined("array",e);const a=e.length,c=4*a;if(n.defined(r)){if(!Array.isArray(r)&&r.length!==c)throw new t.DeveloperError("If result is a typed array, it must have exactly array.length * 4 elements");r.length!==c&&(r.length=c)}else r=new Array(c);for(let t=0;t<a;++t)ze.pack(e[t],r,4*t);return r},ze.unpackArray=function(e,r){if(t.Check.defined("array",e),t.Check.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new t.DeveloperError("array length must be a multiple of 4.");const a=e.length;n.defined(r)?r.length=a/4:r=new Array(a/4);for(let t=0;t<a;t+=4){const n=t/4;r[n]=ze.unpack(e,t,r[n])}return r},ze.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new ze(e[0],e[2],e[1],e[3])},ze.fromArray=ze.unpack,ze.fromColumnMajorArray=function(e,n){return t.Check.defined("values",e),ze.clone(e,n)},ze.fromRowMajorArray=function(e,r){return t.Check.defined("values",e),n.defined(r)?(r[0]=e[0],r[1]=e[2],r[2]=e[1],r[3]=e[3],r):new ze(e[0],e[1],e[2],e[3])},ze.fromScale=function(e,r){return t.Check.typeOf.object("scale",e),n.defined(r)?(r[0]=e.x,r[1]=0,r[2]=0,r[3]=e.y,r):new ze(e.x,0,0,e.y)},ze.fromUniformScale=function(e,r){return t.Check.typeOf.number("scale",e),n.defined(r)?(r[0]=e,r[1]=0,r[2]=0,r[3]=e,r):new ze(e,0,0,e)},ze.fromRotation=function(e,r){t.Check.typeOf.number("angle",e);const a=Math.cos(e),c=Math.sin(e);return n.defined(r)?(r[0]=a,r[1]=c,r[2]=-c,r[3]=a,r):new ze(a,-c,c,a)},ze.toArray=function(e,r){return t.Check.typeOf.object("matrix",e),n.defined(r)?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r):[e[0],e[1],e[2],e[3]]},ze.getElementIndex=function(e,n){return t.Check.typeOf.number.greaterThanOrEquals("row",n,0),t.Check.typeOf.number.lessThanOrEquals("row",n,1),t.Check.typeOf.number.greaterThanOrEquals("column",e,0),t.Check.typeOf.number.lessThanOrEquals("column",e,1),2*e+n},ze.getColumn=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,1),t.Check.typeOf.object("result",r);const a=2*n,c=e[a],o=e[a+1];return r.x=c,r.y=o,r},ze.setColumn=function(e,n,r,a){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,1),t.Check.typeOf.object("cartesian",r),t.Check.typeOf.object("result",a),a=ze.clone(e,a);const c=2*n;return a[c]=r.x,a[c+1]=r.y,a},ze.getRow=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,1),t.Check.typeOf.object("result",r);const a=e[n],c=e[n+2];return r.x=a,r.y=c,r},ze.setRow=function(e,n,r,a){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,1),t.Check.typeOf.object("cartesian",r),t.Check.typeOf.object("result",a),a=ze.clone(e,a),a[n]=r.x,a[n+2]=r.y,a};const Ee=new ke;ze.setScale=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("scale",n),t.Check.typeOf.object("result",r);const a=ze.getScale(e,Ee),c=n.x/a.x,o=n.y/a.y;return r[0]=e[0]*c,r[1]=e[1]*c,r[2]=e[2]*o,r[3]=e[3]*o,r};const qe=new ke;ze.setUniformScale=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number("scale",n),t.Check.typeOf.object("result",r);const a=ze.getScale(e,qe),c=n/a.x,o=n/a.y;return r[0]=e[0]*c,r[1]=e[1]*c,r[2]=e[2]*o,r[3]=e[3]*o,r};const Te=new ke;ze.getScale=function(e,n){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n.x=ke.magnitude(ke.fromElements(e[0],e[1],Te)),n.y=ke.magnitude(ke.fromElements(e[2],e[3],Te)),n};const Se=new ke;ze.getMaximumScale=function(e){return ze.getScale(e,Se),ke.maximumComponent(Se)};const Re=new ke;ze.setRotation=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",r);const a=ze.getScale(e,Re);return r[0]=n[0]*a.x,r[1]=n[1]*a.x,r[2]=n[2]*a.y,r[3]=n[3]*a.y,r};const _e=new ke;ze.getRotation=function(e,n){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n);const r=ze.getScale(e,_e);return n[0]=e[0]/r.x,n[1]=e[1]/r.x,n[2]=e[2]/r.y,n[3]=e[3]/r.y,n},ze.multiply=function(e,n,r){t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r);const a=e[0]*n[0]+e[2]*n[1],c=e[0]*n[2]+e[2]*n[3],o=e[1]*n[0]+e[3]*n[1],i=e[1]*n[2]+e[3]*n[3];return r[0]=a,r[1]=o,r[2]=c,r[3]=i,r},ze.add=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r[0]=e[0]+n[0],r[1]=e[1]+n[1],r[2]=e[2]+n[2],r[3]=e[3]+n[3],r},ze.subtract=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],r[3]=e[3]-n[3],r},ze.multiplyByVector=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("cartesian",n),t.Check.typeOf.object("result",r);const a=e[0]*n.x+e[2]*n.y,c=e[1]*n.x+e[3]*n.y;return r.x=a,r.y=c,r},ze.multiplyByScalar=function(e,n,r){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.number("scalar",n),t.Check.typeOf.object("result",r),r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3]*n,r},ze.multiplyByScale=function(e,n,r){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("scale",n),t.Check.typeOf.object("result",r),r[0]=e[0]*n.x,r[1]=e[1]*n.x,r[2]=e[2]*n.y,r[3]=e[3]*n.y,r},ze.multiplyByUniformScale=function(e,n,r){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.number("scale",n),t.Check.typeOf.object("result",r),r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3]*n,r},ze.negate=function(e,n){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=-e[3],n},ze.transpose=function(e,n){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n);const r=e[0],a=e[2],c=e[1],o=e[3];return n[0]=r,n[1]=a,n[2]=c,n[3]=o,n},ze.abs=function(e,n){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n[0]=Math.abs(e[0]),n[1]=Math.abs(e[1]),n[2]=Math.abs(e[2]),n[3]=Math.abs(e[3]),n},ze.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},ze.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]},ze.equalsEpsilon=function(e,t,r){return r=n.defaultValue(r,0),e===t||n.defined(e)&&n.defined(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r},ze.IDENTITY=Object.freeze(new ze(1,0,0,1)),ze.ZERO=Object.freeze(new ze(0,0,0,0)),ze.COLUMN0ROW0=0,ze.COLUMN0ROW1=1,ze.COLUMN1ROW0=2,ze.COLUMN1ROW1=3,Object.defineProperties(ze.prototype,{length:{get:function(){return ze.packedLength}}}),ze.prototype.clone=function(e){return ze.clone(this,e)},ze.prototype.equals=function(e){return ze.equals(this,e)},ze.prototype.equalsEpsilon=function(e,t){return ze.equalsEpsilon(this,e,t)},ze.prototype.toString=function(){return`(${this[0]}, ${this[2]})\n(${this[1]}, ${this[3]})`},e.Cartesian2=ke,e.Cartesian3=a,e.Cartesian4=F,e.Cartographic=m,e.Ellipsoid=w,e.Matrix2=ze,e.Matrix3=V,e.Matrix4=re,e.Rectangle=Ce}));
\ No newline at end of file
define(["exports","./Transforms-3ac41eb6","./Matrix2-fc7e9822","./RuntimeError-c581ca93","./defaultValue-94c3e563","./EllipsoidTangentPlane-53e32153","./ComponentDatatype-4a60b8d6","./Plane-e20fba8c"],(function(a,e,t,n,r,i,s,o){"use strict";function c(a,e){this.center=t.Cartesian3.clone(r.defaultValue(a,t.Cartesian3.ZERO)),this.halfAxes=t.Matrix3.clone(r.defaultValue(e,t.Matrix3.ZERO))}c.packedLength=t.Cartesian3.packedLength+t.Matrix3.packedLength,c.pack=function(a,e,i){return n.Check.typeOf.object("value",a),n.Check.defined("array",e),i=r.defaultValue(i,0),t.Cartesian3.pack(a.center,e,i),t.Matrix3.pack(a.halfAxes,e,i+t.Cartesian3.packedLength),e},c.unpack=function(a,e,i){return n.Check.defined("array",a),e=r.defaultValue(e,0),r.defined(i)||(i=new c),t.Cartesian3.unpack(a,e,i.center),t.Matrix3.unpack(a,e+t.Cartesian3.packedLength,i.halfAxes),i};const C=new t.Cartesian3,d=new t.Cartesian3,u=new t.Cartesian3,l=new t.Cartesian3,h=new t.Cartesian3,f=new t.Cartesian3,m=new t.Matrix3,x={unitary:new t.Matrix3,diagonal:new t.Matrix3};c.fromPoints=function(a,e){if(r.defined(e)||(e=new c),!r.defined(a)||0===a.length)return e.halfAxes=t.Matrix3.ZERO,e.center=t.Cartesian3.ZERO,e;let n;const i=a.length,s=t.Cartesian3.clone(a[0],C);for(n=1;n<i;n++)t.Cartesian3.add(s,a[n],s);const o=1/i;t.Cartesian3.multiplyByScalar(s,o,s);let p,M=0,w=0,g=0,b=0,y=0,O=0;for(n=0;n<i;n++)p=t.Cartesian3.subtract(a[n],s,d),M+=p.x*p.x,w+=p.x*p.y,g+=p.x*p.z,b+=p.y*p.y,y+=p.y*p.z,O+=p.z*p.z;M*=o,w*=o,g*=o,b*=o,y*=o,O*=o;const E=m;E[0]=M,E[1]=w,E[2]=g,E[3]=w,E[4]=b,E[5]=y,E[6]=g,E[7]=y,E[8]=O;const N=t.Matrix3.computeEigenDecomposition(E,x),T=t.Matrix3.clone(N.unitary,e.halfAxes);let P=t.Matrix3.getColumn(T,0,l),A=t.Matrix3.getColumn(T,1,h),I=t.Matrix3.getColumn(T,2,f),R=-Number.MAX_VALUE,S=-Number.MAX_VALUE,U=-Number.MAX_VALUE,D=Number.MAX_VALUE,L=Number.MAX_VALUE,q=Number.MAX_VALUE;for(n=0;n<i;n++)p=a[n],R=Math.max(t.Cartesian3.dot(P,p),R),S=Math.max(t.Cartesian3.dot(A,p),S),U=Math.max(t.Cartesian3.dot(I,p),U),D=Math.min(t.Cartesian3.dot(P,p),D),L=Math.min(t.Cartesian3.dot(A,p),L),q=Math.min(t.Cartesian3.dot(I,p),q);P=t.Cartesian3.multiplyByScalar(P,.5*(D+R),P),A=t.Cartesian3.multiplyByScalar(A,.5*(L+S),A),I=t.Cartesian3.multiplyByScalar(I,.5*(q+U),I);const v=t.Cartesian3.add(P,A,e.center);t.Cartesian3.add(v,I,v);const z=u;return z.x=R-D,z.y=S-L,z.z=U-q,t.Cartesian3.multiplyByScalar(z,.5,z),t.Matrix3.multiplyByScale(e.halfAxes,z,e.halfAxes),e};const p=new t.Cartesian3,M=new t.Cartesian3;function w(a,e,i,s,o,C,d,u,l,h,f){if(!r.defined(o)||!r.defined(C)||!r.defined(d)||!r.defined(u)||!r.defined(l)||!r.defined(h))throw new n.DeveloperError("all extents (minimum/maximum X/Y/Z) are required.");r.defined(f)||(f=new c);const m=f.halfAxes;t.Matrix3.setColumn(m,0,e,m),t.Matrix3.setColumn(m,1,i,m),t.Matrix3.setColumn(m,2,s,m);let x=p;x.x=(o+C)/2,x.y=(d+u)/2,x.z=(l+h)/2;const w=M;w.x=(C-o)/2,w.y=(u-d)/2,w.z=(h-l)/2;const g=f.center;return x=t.Matrix3.multiplyByVector(m,x,x),t.Cartesian3.add(a,x,g),t.Matrix3.multiplyByScale(m,w,m),f}const g=new t.Cartographic,b=new t.Cartesian3,y=new t.Cartographic,O=new t.Cartographic,E=new t.Cartographic,N=new t.Cartographic,T=new t.Cartographic,P=new t.Cartesian3,A=new t.Cartesian3,I=new t.Cartesian3,R=new t.Cartesian3,S=new t.Cartesian3,U=new t.Cartesian2,D=new t.Cartesian2,L=new t.Cartesian2,q=new t.Cartesian2,v=new t.Cartesian2,z=new t.Cartesian3,B=new t.Cartesian3,V=new t.Cartesian3,_=new t.Cartesian3,k=new t.Cartesian2,W=new t.Cartesian3,X=new t.Cartesian3,j=new t.Cartesian3,Z=new o.Plane(t.Cartesian3.UNIT_X,0);c.fromRectangle=function(a,e,c,C,d){if(!r.defined(a))throw new n.DeveloperError("rectangle is required");if(a.width<0||a.width>s.CesiumMath.TWO_PI)throw new n.DeveloperError("Rectangle width must be between 0 and 2*pi");if(a.height<0||a.height>s.CesiumMath.PI)throw new n.DeveloperError("Rectangle height must be between 0 and pi");if(r.defined(C)&&!s.CesiumMath.equalsEpsilon(C.radii.x,C.radii.y,s.CesiumMath.EPSILON15))throw new n.DeveloperError("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");let u,l,h,f,m,x,p;if(e=r.defaultValue(e,0),c=r.defaultValue(c,0),C=r.defaultValue(C,t.Ellipsoid.WGS84),a.width<=s.CesiumMath.PI){const n=t.Rectangle.center(a,g),r=C.cartographicToCartesian(n,b),s=new i.EllipsoidTangentPlane(r,C);p=s.plane;const M=n.longitude,z=a.south<0&&a.north>0?0:n.latitude,B=t.Cartographic.fromRadians(M,a.north,c,y),V=t.Cartographic.fromRadians(a.west,a.north,c,O),_=t.Cartographic.fromRadians(a.west,z,c,E),k=t.Cartographic.fromRadians(a.west,a.south,c,N),W=t.Cartographic.fromRadians(M,a.south,c,T),X=C.cartographicToCartesian(B,P);let j=C.cartographicToCartesian(V,A);const Z=C.cartographicToCartesian(_,I);let Y=C.cartographicToCartesian(k,R);const G=C.cartographicToCartesian(W,S),F=s.projectPointToNearestOnPlane(X,U),H=s.projectPointToNearestOnPlane(j,D),J=s.projectPointToNearestOnPlane(Z,L),K=s.projectPointToNearestOnPlane(Y,q),Q=s.projectPointToNearestOnPlane(G,v);return u=Math.min(H.x,J.x,K.x),l=-u,f=Math.max(H.y,F.y),h=Math.min(K.y,Q.y),V.height=k.height=e,j=C.cartographicToCartesian(V,A),Y=C.cartographicToCartesian(k,R),m=Math.min(o.Plane.getPointDistance(p,j),o.Plane.getPointDistance(p,Y)),x=c,w(s.origin,s.xAxis,s.yAxis,s.zAxis,u,l,h,f,m,x,d)}const M=a.south>0,Y=a.north<0,G=M?a.south:Y?a.north:0,F=t.Rectangle.center(a,g).longitude,H=t.Cartesian3.fromRadians(F,G,c,C,z);H.z=0;const J=Math.abs(H.x)<s.CesiumMath.EPSILON10&&Math.abs(H.y)<s.CesiumMath.EPSILON10,K=J?t.Cartesian3.UNIT_X:t.Cartesian3.normalize(H,B),Q=t.Cartesian3.UNIT_Z,$=t.Cartesian3.cross(K,Q,V);p=o.Plane.fromPointNormal(H,K,Z);const aa=t.Cartesian3.fromRadians(F+s.CesiumMath.PI_OVER_TWO,G,c,C,_);l=t.Cartesian3.dot(o.Plane.projectPointOntoPlane(p,aa,k),$),u=-l,f=t.Cartesian3.fromRadians(0,a.north,Y?e:c,C,W).z,h=t.Cartesian3.fromRadians(0,a.south,M?e:c,C,X).z;const ea=t.Cartesian3.fromRadians(a.east,G,c,C,j);return m=o.Plane.getPointDistance(p,ea),x=0,w(H,$,Q,K,u,l,h,f,m,x,d)},c.fromTransformation=function(a,e){return n.Check.typeOf.object("transformation",a),r.defined(e)||(e=new c),e.center=t.Matrix4.getTranslation(a,e.center),e.halfAxes=t.Matrix4.getMatrix3(a,e.halfAxes),e.halfAxes=t.Matrix3.multiplyByScalar(e.halfAxes,.5,e.halfAxes),e},c.clone=function(a,e){if(r.defined(a))return r.defined(e)?(t.Cartesian3.clone(a.center,e.center),t.Matrix3.clone(a.halfAxes,e.halfAxes),e):new c(a.center,a.halfAxes)},c.intersectPlane=function(a,i){if(!r.defined(a))throw new n.DeveloperError("box is required.");if(!r.defined(i))throw new n.DeveloperError("plane is required.");const s=a.center,o=i.normal,c=a.halfAxes,C=o.x,d=o.y,u=o.z,l=Math.abs(C*c[t.Matrix3.COLUMN0ROW0]+d*c[t.Matrix3.COLUMN0ROW1]+u*c[t.Matrix3.COLUMN0ROW2])+Math.abs(C*c[t.Matrix3.COLUMN1ROW0]+d*c[t.Matrix3.COLUMN1ROW1]+u*c[t.Matrix3.COLUMN1ROW2])+Math.abs(C*c[t.Matrix3.COLUMN2ROW0]+d*c[t.Matrix3.COLUMN2ROW1]+u*c[t.Matrix3.COLUMN2ROW2]),h=t.Cartesian3.dot(o,s)+i.distance;return h<=-l?e.Intersect.OUTSIDE:h>=l?e.Intersect.INSIDE:e.Intersect.INTERSECTING};const Y=new t.Cartesian3,G=new t.Cartesian3,F=new t.Cartesian3,H=new t.Cartesian3,J=new t.Cartesian3,K=new t.Cartesian3;c.distanceSquaredTo=function(a,e){if(!r.defined(a))throw new n.DeveloperError("box is required.");if(!r.defined(e))throw new n.DeveloperError("cartesian is required.");const i=t.Cartesian3.subtract(e,a.center,p),o=a.halfAxes;let c=t.Matrix3.getColumn(o,0,Y),C=t.Matrix3.getColumn(o,1,G),d=t.Matrix3.getColumn(o,2,F);const u=t.Cartesian3.magnitude(c),l=t.Cartesian3.magnitude(C),h=t.Cartesian3.magnitude(d);let f=!0,m=!0,x=!0;u>0?t.Cartesian3.divideByScalar(c,u,c):f=!1,l>0?t.Cartesian3.divideByScalar(C,l,C):m=!1,h>0?t.Cartesian3.divideByScalar(d,h,d):x=!1;const M=!f+!m+!x;let w,g,b;if(1===M){let a=c;w=C,g=d,m?x||(a=d,g=c):(a=C,w=c),b=t.Cartesian3.cross(w,g,J),a===c?c=b:a===C?C=b:a===d&&(d=b)}else if(2===M){w=c,m?w=C:x&&(w=d);let a=t.Cartesian3.UNIT_Y;a.equalsEpsilon(w,s.CesiumMath.EPSILON3)&&(a=t.Cartesian3.UNIT_X),g=t.Cartesian3.cross(w,a,H),t.Cartesian3.normalize(g,g),b=t.Cartesian3.cross(w,g,J),t.Cartesian3.normalize(b,b),w===c?(C=g,d=b):w===C?(d=g,c=b):w===d&&(c=g,C=b)}else 3===M&&(c=t.Cartesian3.UNIT_X,C=t.Cartesian3.UNIT_Y,d=t.Cartesian3.UNIT_Z);const y=K;y.x=t.Cartesian3.dot(i,c),y.y=t.Cartesian3.dot(i,C),y.z=t.Cartesian3.dot(i,d);let O,E=0;return y.x<-u?(O=y.x+u,E+=O*O):y.x>u&&(O=y.x-u,E+=O*O),y.y<-l?(O=y.y+l,E+=O*O):y.y>l&&(O=y.y-l,E+=O*O),y.z<-h?(O=y.z+h,E+=O*O):y.z>h&&(O=y.z-h,E+=O*O),E};const Q=new t.Cartesian3,$=new t.Cartesian3;c.computePlaneDistances=function(a,i,s,o){if(!r.defined(a))throw new n.DeveloperError("box is required.");if(!r.defined(i))throw new n.DeveloperError("position is required.");if(!r.defined(s))throw new n.DeveloperError("direction is required.");r.defined(o)||(o=new e.Interval);let c=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY;const d=a.center,u=a.halfAxes,l=t.Matrix3.getColumn(u,0,Y),h=t.Matrix3.getColumn(u,1,G),f=t.Matrix3.getColumn(u,2,F),m=t.Cartesian3.add(l,h,Q);t.Cartesian3.add(m,f,m),t.Cartesian3.add(m,d,m);const x=t.Cartesian3.subtract(m,i,$);let p=t.Cartesian3.dot(s,x);return c=Math.min(p,c),C=Math.max(p,C),t.Cartesian3.add(d,l,m),t.Cartesian3.add(m,h,m),t.Cartesian3.subtract(m,f,m),t.Cartesian3.subtract(m,i,x),p=t.Cartesian3.dot(s,x),c=Math.min(p,c),C=Math.max(p,C),t.Cartesian3.add(d,l,m),t.Cartesian3.subtract(m,h,m),t.Cartesian3.add(m,f,m),t.Cartesian3.subtract(m,i,x),p=t.Cartesian3.dot(s,x),c=Math.min(p,c),C=Math.max(p,C),t.Cartesian3.add(d,l,m),t.Cartesian3.subtract(m,h,m),t.Cartesian3.subtract(m,f,m),t.Cartesian3.subtract(m,i,x),p=t.Cartesian3.dot(s,x),c=Math.min(p,c),C=Math.max(p,C),t.Cartesian3.subtract(d,l,m),t.Cartesian3.add(m,h,m),t.Cartesian3.add(m,f,m),t.Cartesian3.subtract(m,i,x),p=t.Cartesian3.dot(s,x),c=Math.min(p,c),C=Math.max(p,C),t.Cartesian3.subtract(d,l,m),t.Cartesian3.add(m,h,m),t.Cartesian3.subtract(m,f,m),t.Cartesian3.subtract(m,i,x),p=t.Cartesian3.dot(s,x),c=Math.min(p,c),C=Math.max(p,C),t.Cartesian3.subtract(d,l,m),t.Cartesian3.subtract(m,h,m),t.Cartesian3.add(m,f,m),t.Cartesian3.subtract(m,i,x),p=t.Cartesian3.dot(s,x),c=Math.min(p,c),C=Math.max(p,C),t.Cartesian3.subtract(d,l,m),t.Cartesian3.subtract(m,h,m),t.Cartesian3.subtract(m,f,m),t.Cartesian3.subtract(m,i,x),p=t.Cartesian3.dot(s,x),c=Math.min(p,c),C=Math.max(p,C),o.start=c,o.stop=C,o};const aa=new t.Cartesian3,ea=new t.Cartesian3,ta=new t.Cartesian3;c.computeCorners=function(a,e){n.Check.typeOf.object("box",a),r.defined(e)||(e=[new t.Cartesian3,new t.Cartesian3,new t.Cartesian3,new t.Cartesian3,new t.Cartesian3,new t.Cartesian3,new t.Cartesian3,new t.Cartesian3]);const i=a.center,s=a.halfAxes,o=t.Matrix3.getColumn(s,0,aa),c=t.Matrix3.getColumn(s,1,ea),C=t.Matrix3.getColumn(s,2,ta);return t.Cartesian3.clone(i,e[0]),t.Cartesian3.subtract(e[0],o,e[0]),t.Cartesian3.subtract(e[0],c,e[0]),t.Cartesian3.subtract(e[0],C,e[0]),t.Cartesian3.clone(i,e[1]),t.Cartesian3.subtract(e[1],o,e[1]),t.Cartesian3.subtract(e[1],c,e[1]),t.Cartesian3.add(e[1],C,e[1]),t.Cartesian3.clone(i,e[2]),t.Cartesian3.subtract(e[2],o,e[2]),t.Cartesian3.add(e[2],c,e[2]),t.Cartesian3.subtract(e[2],C,e[2]),t.Cartesian3.clone(i,e[3]),t.Cartesian3.subtract(e[3],o,e[3]),t.Cartesian3.add(e[3],c,e[3]),t.Cartesian3.add(e[3],C,e[3]),t.Cartesian3.clone(i,e[4]),t.Cartesian3.add(e[4],o,e[4]),t.Cartesian3.subtract(e[4],c,e[4]),t.Cartesian3.subtract(e[4],C,e[4]),t.Cartesian3.clone(i,e[5]),t.Cartesian3.add(e[5],o,e[5]),t.Cartesian3.subtract(e[5],c,e[5]),t.Cartesian3.add(e[5],C,e[5]),t.Cartesian3.clone(i,e[6]),t.Cartesian3.add(e[6],o,e[6]),t.Cartesian3.add(e[6],c,e[6]),t.Cartesian3.subtract(e[6],C,e[6]),t.Cartesian3.clone(i,e[7]),t.Cartesian3.add(e[7],o,e[7]),t.Cartesian3.add(e[7],c,e[7]),t.Cartesian3.add(e[7],C,e[7]),e};const na=new t.Matrix3;c.computeTransformation=function(a,e){n.Check.typeOf.object("box",a),r.defined(e)||(e=new t.Matrix4);const i=a.center,s=t.Matrix3.multiplyByUniformScale(a.halfAxes,2,na);return t.Matrix4.fromRotationTranslation(s,i,e)};const ra=new e.BoundingSphere;c.isOccluded=function(a,t){if(!r.defined(a))throw new n.DeveloperError("box is required.");if(!r.defined(t))throw new n.DeveloperError("occluder is required.");const i=e.BoundingSphere.fromOrientedBoundingBox(a,ra);return!t.isBoundingSphereVisible(i)},c.prototype.intersectPlane=function(a){return c.intersectPlane(this,a)},c.prototype.distanceSquaredTo=function(a){return c.distanceSquaredTo(this,a)},c.prototype.computePlaneDistances=function(a,e,t){return c.computePlaneDistances(this,a,e,t)},c.prototype.computeCorners=function(a){return c.computeCorners(this,a)},c.prototype.computeTransformation=function(a){return c.computeTransformation(this,a)},c.prototype.isOccluded=function(a){return c.isOccluded(this,a)},c.equals=function(a,e){return a===e||r.defined(a)&&r.defined(e)&&t.Cartesian3.equals(a.center,e.center)&&t.Matrix3.equals(a.halfAxes,e.halfAxes)},c.prototype.clone=function(a){return c.clone(this,a)},c.prototype.equals=function(a){return c.equals(this,a)},a.OrientedBoundingBox=c}));
\ No newline at end of file
define(["exports","./Matrix2-fc7e9822","./RuntimeError-c581ca93","./defaultValue-94c3e563","./ComponentDatatype-4a60b8d6"],(function(e,t,n,a,r){"use strict";function i(e,a){if(n.Check.typeOf.object("normal",e),!r.CesiumMath.equalsEpsilon(t.Cartesian3.magnitude(e),1,r.CesiumMath.EPSILON6))throw new n.DeveloperError("normal must be normalized.");n.Check.typeOf.number("distance",a),this.normal=t.Cartesian3.clone(e),this.distance=a}i.fromPointNormal=function(e,o,s){if(n.Check.typeOf.object("point",e),n.Check.typeOf.object("normal",o),!r.CesiumMath.equalsEpsilon(t.Cartesian3.magnitude(o),1,r.CesiumMath.EPSILON6))throw new n.DeveloperError("normal must be normalized.");const c=-t.Cartesian3.dot(o,e);return a.defined(s)?(t.Cartesian3.clone(o,s.normal),s.distance=c,s):new i(o,c)};const o=new t.Cartesian3;i.fromCartesian4=function(e,s){n.Check.typeOf.object("coefficients",e);const c=t.Cartesian3.fromCartesian4(e,o),l=e.w;if(!r.CesiumMath.equalsEpsilon(t.Cartesian3.magnitude(c),1,r.CesiumMath.EPSILON6))throw new n.DeveloperError("normal must be normalized.");return a.defined(s)?(t.Cartesian3.clone(c,s.normal),s.distance=l,s):new i(c,l)},i.getPointDistance=function(e,a){return n.Check.typeOf.object("plane",e),n.Check.typeOf.object("point",a),t.Cartesian3.dot(e.normal,a)+e.distance};const s=new t.Cartesian3;i.projectPointOntoPlane=function(e,r,o){n.Check.typeOf.object("plane",e),n.Check.typeOf.object("point",r),a.defined(o)||(o=new t.Cartesian3);const c=i.getPointDistance(e,r),l=t.Cartesian3.multiplyByScalar(e.normal,c,s);return t.Cartesian3.subtract(r,l,o)};const c=new t.Matrix4,l=new t.Cartesian4,C=new t.Cartesian3;i.transform=function(e,a,r){n.Check.typeOf.object("plane",e),n.Check.typeOf.object("transform",a);const o=e.normal,s=e.distance,f=t.Matrix4.inverseTranspose(a,c);let m=t.Cartesian4.fromElements(o.x,o.y,o.z,s,l);m=t.Matrix4.multiplyByVector(f,m,m);const u=t.Cartesian3.fromCartesian4(m,C);return m=t.Cartesian4.divideByScalar(m,t.Cartesian3.magnitude(u),m),i.fromCartesian4(m,r)},i.clone=function(e,r){return n.Check.typeOf.object("plane",e),a.defined(r)?(t.Cartesian3.clone(e.normal,r.normal),r.distance=e.distance,r):new i(e.normal,e.distance)},i.equals=function(e,a){return n.Check.typeOf.object("left",e),n.Check.typeOf.object("right",a),e.distance===a.distance&&t.Cartesian3.equals(e.normal,a.normal)},i.ORIGIN_XY_PLANE=Object.freeze(new i(t.Cartesian3.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=Object.freeze(new i(t.Cartesian3.UNIT_X,0)),i.ORIGIN_ZX_PLANE=Object.freeze(new i(t.Cartesian3.UNIT_Y,0)),e.Plane=i}));
\ No newline at end of file
define(["exports","./ArcType-0cf52f8c","./arrayRemoveDuplicates-06991c15","./Matrix2-fc7e9822","./ComponentDatatype-4a60b8d6","./defaultValue-94c3e563","./EllipsoidRhumbLine-daebc75b","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./GeometryPipeline-a88e5bfc","./IndexDatatype-db156785","./PolygonPipeline-113e3161","./Transforms-3ac41eb6"],(function(e,t,n,i,o,r,a,s,c,l,u,h,p){"use strict";function d(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(d.prototype,{length:{get:function(){return this._length}}}),d.prototype.enqueue=function(e){this._array.push(e),this._length++},d.prototype.dequeue=function(){if(0===this._length)return;const e=this._array;let t=this._offset;const n=e[t];return e[t]=void 0,t++,t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n},d.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},d.prototype.contains=function(e){return-1!==this._array.indexOf(e)},d.prototype.clear=function(){this._array.length=this._offset=this._length=0},d.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};const f={computeHierarchyPackedLength:function(e,t){let n=0;const i=[e];while(i.length>0){const e=i.pop();if(!r.defined(e))continue;n+=2;const o=e.positions,a=e.holes;if(r.defined(o)&&o.length>0&&(n+=o.length*t.packedLength),r.defined(a)){const e=a.length;for(let t=0;t<e;++t)i.push(a[t])}}return n},packPolygonHierarchy:function(e,t,n,i){const o=[e];while(o.length>0){const e=o.pop();if(!r.defined(e))continue;const a=e.positions,s=e.holes;if(t[n++]=r.defined(a)?a.length:0,t[n++]=r.defined(s)?s.length:0,r.defined(a)){const e=a.length;for(let o=0;o<e;++o,n+=i.packedLength)i.pack(a[o],t,n)}if(r.defined(s)){const e=s.length;for(let t=0;t<e;++t)o.push(s[t])}}return n},unpackPolygonHierarchy:function(e,t,n){const i=e[t++],o=e[t++],r=new Array(i),a=o>0?new Array(o):void 0;for(let s=0;s<i;++s,t+=n.packedLength)r[s]=n.unpack(e,t);for(let s=0;s<o;++s)a[s]=f.unpackPolygonHierarchy(e,t,n),t=a[s].startingIndex,delete a[s].startingIndex;return{positions:r,holes:a,startingIndex:t}}},y=new i.Cartesian2;function g(e,t,n,o){return i.Cartesian2.subtract(t,e,y),i.Cartesian2.multiplyByScalar(y,n/o,y),i.Cartesian2.add(e,y,y),[y.x,y.y]}const m=new i.Cartesian3;function C(e,t,n,o){return i.Cartesian3.subtract(t,e,m),i.Cartesian3.multiplyByScalar(m,n/o,m),i.Cartesian3.add(e,m,m),[m.x,m.y,m.z]}f.subdivideLineCount=function(e,t,n){const r=i.Cartesian3.distance(e,t),a=r/n,s=Math.max(0,Math.ceil(o.CesiumMath.log2(a)));return Math.pow(2,s)};const b=new i.Cartographic,w=new i.Cartographic,T=new i.Cartographic,x=new i.Cartesian3,v=new a.EllipsoidRhumbLine;f.subdivideRhumbLineCount=function(e,t,n,i){const r=e.cartesianToCartographic(t,b),s=e.cartesianToCartographic(n,w),c=new a.EllipsoidRhumbLine(r,s,e),l=c.surfaceDistance/i,u=Math.max(0,Math.ceil(o.CesiumMath.log2(l)));return Math.pow(2,u)},f.subdivideTexcoordLine=function(e,t,n,o,r,a){const s=f.subdivideLineCount(n,o,r),c=i.Cartesian2.distance(e,t),l=c/s,u=a;u.length=2*s;let h=0;for(let i=0;i<s;i++){const n=g(e,t,i*l,c);u[h++]=n[0],u[h++]=n[1]}return u},f.subdivideLine=function(e,t,n,o){const a=f.subdivideLineCount(e,t,n),s=i.Cartesian3.distance(e,t),c=s/a;r.defined(o)||(o=[]);const l=o;l.length=3*a;let u=0;for(let i=0;i<a;i++){const n=C(e,t,i*c,s);l[u++]=n[0],l[u++]=n[1],l[u++]=n[2]}return l},f.subdivideTexcoordRhumbLine=function(e,t,n,r,a,s,c){const l=n.cartesianToCartographic(r,b),u=n.cartesianToCartographic(a,w);v.setEndPoints(l,u);const h=v.surfaceDistance/s,p=Math.max(0,Math.ceil(o.CesiumMath.log2(h))),d=Math.pow(2,p),f=i.Cartesian2.distance(e,t),y=f/d,m=c;m.length=2*d;let C=0;for(let i=0;i<d;i++){const n=g(e,t,i*y,f);m[C++]=n[0],m[C++]=n[1]}return m},f.subdivideRhumbLine=function(e,t,n,i,s){const c=e.cartesianToCartographic(t,b),l=e.cartesianToCartographic(n,w),u=new a.EllipsoidRhumbLine(c,l,e),h=u.surfaceDistance/i,p=Math.max(0,Math.ceil(o.CesiumMath.log2(h))),d=Math.pow(2,p),f=u.surfaceDistance/d;r.defined(s)||(s=[]);const y=s;y.length=3*d;let g=0;for(let o=0;o<d;o++){const t=u.interpolateUsingSurfaceDistance(o*f,T),n=e.cartographicToCartesian(t,x);y[g++]=n.x,y[g++]=n.y,y[g++]=n.z}return y};const A=new i.Cartesian3,L=new i.Cartesian3,E=new i.Cartesian3,I=new i.Cartesian3;f.scaleToGeodeticHeightExtruded=function(e,t,n,o,a){o=r.defaultValue(o,i.Ellipsoid.WGS84);const s=A;let c=L;const l=E;let u=I;if(r.defined(e)&&r.defined(e.attributes)&&r.defined(e.attributes.position)){const r=e.attributes.position.values,h=r.length/2;for(let e=0;e<h;e+=3)i.Cartesian3.fromArray(r,e,l),o.geodeticSurfaceNormal(l,s),u=o.scaleToGeodeticSurface(l,u),c=i.Cartesian3.multiplyByScalar(s,n,c),c=i.Cartesian3.add(u,c,c),r[e+h]=c.x,r[e+1+h]=c.y,r[e+2+h]=c.z,a&&(u=i.Cartesian3.clone(l,u)),c=i.Cartesian3.multiplyByScalar(s,t,c),c=i.Cartesian3.add(u,c,c),r[e]=c.x,r[e+1]=c.y,r[e+2]=c.z}return e},f.polygonOutlinesFromHierarchy=function(e,t,o){const a=[],s=new d;let c,l,u;s.enqueue(e);while(0!==s.length){const e=s.dequeue();let h=e.positions;if(t)for(u=h.length,c=0;c<u;c++)o.scaleToGeodeticSurface(h[c],h[c]);if(h=n.arrayRemoveDuplicates(h,i.Cartesian3.equalsEpsilon,!0),h.length<3)continue;const p=e.holes?e.holes.length:0;for(c=0;c<p;c++){const h=e.holes[c];let p=h.positions;if(t)for(u=p.length,l=0;l<u;++l)o.scaleToGeodeticSurface(p[l],p[l]);if(p=n.arrayRemoveDuplicates(p,i.Cartesian3.equalsEpsilon,!0),p.length<3)continue;a.push(p);let d=0;for(r.defined(h.holes)&&(d=h.holes.length),l=0;l<d;l++)s.enqueue(h.holes[l])}a.push(h)}return a},f.polygonsFromHierarchy=function(e,t,o,a,s){const c=[],l=[],u=new d;u.enqueue(e);while(0!==u.length){const e=u.dequeue();let p=e.positions;const d=e.holes;let f,y;if(a)for(y=p.length,f=0;f<y;f++)s.scaleToGeodeticSurface(p[f],p[f]);if(t||(p=n.arrayRemoveDuplicates(p,i.Cartesian3.equalsEpsilon,!0)),p.length<3)continue;let g=o(p);if(!r.defined(g))continue;const m=[];let C=h.PolygonPipeline.computeWindingOrder2D(g);C===h.WindingOrder.CLOCKWISE&&(g.reverse(),p=p.slice().reverse());let b=p.slice();const w=r.defined(d)?d.length:0,T=[];let x;for(f=0;f<w;f++){const e=d[f];let c=e.positions;if(a)for(y=c.length,x=0;x<y;++x)s.scaleToGeodeticSurface(c[x],c[x]);if(t||(c=n.arrayRemoveDuplicates(c,i.Cartesian3.equalsEpsilon,!0)),c.length<3)continue;const l=o(c);if(!r.defined(l))continue;C=h.PolygonPipeline.computeWindingOrder2D(l),C===h.WindingOrder.CLOCKWISE&&(l.reverse(),c=c.slice().reverse()),T.push(c),m.push(b.length),b=b.concat(c),g=g.concat(l);let p=0;for(r.defined(e.holes)&&(p=e.holes.length),x=0;x<p;x++)u.enqueue(e.holes[x])}c.push({outerRing:p,holes:T}),l.push({positions:b,positions2D:g,holes:m})}return{hierarchy:c,polygons:l}};const P=new i.Cartesian2,D=new i.Cartesian3,M=new p.Quaternion,_=new i.Matrix3;f.computeBoundingRectangle=function(e,t,n,o,a){const s=p.Quaternion.fromAxisAngle(e,o,M),c=i.Matrix3.fromQuaternion(s,_);let l=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,h=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY;const f=n.length;for(let p=0;p<f;++p){const e=i.Cartesian3.clone(n[p],D);i.Matrix3.multiplyByVector(c,e,e);const o=t(e,P);r.defined(o)&&(l=Math.min(l,o.x),u=Math.max(u,o.x),h=Math.min(h,o.y),d=Math.max(d,o.y))}return a.x=l,a.y=h,a.width=u-l,a.height=d-h,a},f.createGeometryFromPositions=function(e,n,a,c,u,p,d){let f=h.PolygonPipeline.triangulate(n.positions2D,n.holes);f.length<3&&(f=[0,1,2]);const y=n.positions,g=r.defined(a),m=g?a.positions:void 0;if(u){const e=y.length,t=new Array(3*e);let n=0;for(let i=0;i<e;i++){const e=y[i];t[n++]=e.x,t[n++]=e.y,t[n++]=e.z}const r={attributes:{position:new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:t})},indices:f,primitiveType:s.PrimitiveType.TRIANGLES};g&&(r.attributes.st=new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:i.Cartesian2.packArray(m)}));const a=new s.Geometry(r);return p.normal?l.GeometryPipeline.computeNormal(a):a}return d===t.ArcType.GEODESIC?h.PolygonPipeline.computeSubdivision(e,y,f,m,c):d===t.ArcType.RHUMB?h.PolygonPipeline.computeRhumbLineSubdivision(e,y,f,m,c):void 0};const G=[],S=[],R=new i.Cartesian3,N=new i.Cartesian3;f.computeWallGeometry=function(e,n,a,l,h,p){let d,y,g,m,C,b,w,T,x,v=e.length,A=0,L=0;const E=r.defined(n),I=E?n.positions:void 0;if(h)for(y=3*v*2,d=new Array(2*y),E&&(x=2*v*2,T=new Array(2*x)),g=0;g<v;g++)m=e[g],C=e[(g+1)%v],d[A]=d[A+y]=m.x,++A,d[A]=d[A+y]=m.y,++A,d[A]=d[A+y]=m.z,++A,d[A]=d[A+y]=C.x,++A,d[A]=d[A+y]=C.y,++A,d[A]=d[A+y]=C.z,++A,E&&(b=I[g],w=I[(g+1)%v],T[L]=T[L+x]=b.x,++L,T[L]=T[L+x]=b.y,++L,T[L]=T[L+x]=w.x,++L,T[L]=T[L+x]=w.y,++L);else{const n=o.CesiumMath.chordLength(l,a.maximumRadius);let i=0;if(p===t.ArcType.GEODESIC)for(g=0;g<v;g++)i+=f.subdivideLineCount(e[g],e[(g+1)%v],n);else if(p===t.ArcType.RHUMB)for(g=0;g<v;g++)i+=f.subdivideRhumbLineCount(a,e[g],e[(g+1)%v],n);for(y=3*(i+v),d=new Array(2*y),E&&(x=2*(i+v),T=new Array(2*x)),g=0;g<v;g++){let i,o;m=e[g],C=e[(g+1)%v],E&&(b=I[g],w=I[(g+1)%v]),p===t.ArcType.GEODESIC?(i=f.subdivideLine(m,C,n,S),E&&(o=f.subdivideTexcoordLine(b,w,m,C,n,G))):p===t.ArcType.RHUMB&&(i=f.subdivideRhumbLine(a,m,C,n,S),E&&(o=f.subdivideTexcoordRhumbLine(b,w,a,m,C,n,G)));const r=i.length;for(let e=0;e<r;++e,++A)d[A]=i[e],d[A+y]=i[e];if(d[A]=C.x,d[A+y]=C.x,++A,d[A]=C.y,d[A+y]=C.y,++A,d[A]=C.z,d[A+y]=C.z,++A,E){const e=o.length;for(let t=0;t<e;++t,++L)T[L]=o[t],T[L+x]=o[t];T[L]=w.x,T[L+x]=w.x,++L,T[L]=w.y,T[L+x]=w.y,++L}}}v=d.length;const P=u.IndexDatatype.createTypedArray(v/3,v-6*e.length);let D=0;for(v/=6,g=0;g<v;g++){const e=g,t=e+1,n=e+v,r=n+1;m=i.Cartesian3.fromArray(d,3*e,R),C=i.Cartesian3.fromArray(d,3*t,N),i.Cartesian3.equalsEpsilon(m,C,o.CesiumMath.EPSILON10,o.CesiumMath.EPSILON10)||(P[D++]=e,P[D++]=n,P[D++]=t,P[D++]=t,P[D++]=n,P[D++]=r)}const M={attributes:new c.GeometryAttributes({position:new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:d})}),indices:P,primitiveType:s.PrimitiveType.TRIANGLES};E&&(M.attributes.st=new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:T}));const _=new s.Geometry(M);return _},e.PolygonGeometryLibrary=f}));
\ No newline at end of file
define(["exports","./Matrix2-fc7e9822","./RuntimeError-c581ca93","./ComponentDatatype-4a60b8d6","./defaultValue-94c3e563","./EllipsoidRhumbLine-daebc75b","./GeometryAttribute-a441ff32","./WebGLConstants-7dccdc96"],(function(e,t,n,r,a,i,s,u){"use strict";var o=l,x=l;function l(e,t,n){n=n||2;var r,a,i,s,u,o,x,l=t&&t.length,h=l?t[0]*n:e.length,c=p(e,0,h,n,!0),f=[];if(!c||c.next===c.prev)return f;if(l&&(c=C(e,t,c,n)),e.length>80*n){r=i=e[0],a=s=e[1];for(var d=n;d<h;d+=n)u=e[d],o=e[d+1],u<r&&(r=u),o<a&&(a=o),u>i&&(i=u),o>s&&(s=o);x=Math.max(i-r,s-a),x=0!==x?1/x:0}return y(c,f,n,r,a,x),f}function p(e,t,n,r,a){var i,s;if(a===q(e,t,n,r)>0)for(i=t;i<n;i+=r)s=P(i,e[i],e[i+1],s);else for(i=n-r;i>=t;i-=r)s=P(i,e[i],e[i+1],s);return s&&L(s,s.next)&&($(s),s=s.next),s}function h(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!L(r,r.next)&&0!==z(r.prev,r,r.next))r=r.next;else{if($(r),r=t=r.prev,r===r.next)break;n=!0}}while(n||r!==t);return t}function y(e,t,n,r,a,i,s){if(e){!s&&i&&A(e,r,a,i);var u,o,x=e;while(e.prev!==e.next)if(u=e.prev,o=e.next,i?f(e,r,a,i):c(e))t.push(u.i/n),t.push(e.i/n),t.push(o.i/n),$(e),e=o.next,x=o.next;else if(e=o,e===x){s?1===s?(e=d(h(e),t,n),y(e,t,n,r,a,i,2)):2===s&&v(e,t,n,r,a,i):y(h(e),t,n,r,a,i,1);break}}}function c(e){var t=e.prev,n=e,r=e.next;if(z(t,n,r)>=0)return!1;var a=e.next.next;while(a!==e.prev){if(O(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&z(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function f(e,t,n,r){var a=e.prev,i=e,s=e.next;if(z(a,i,s)>=0)return!1;var u=a.x<i.x?a.x<s.x?a.x:s.x:i.x<s.x?i.x:s.x,o=a.y<i.y?a.y<s.y?a.y:s.y:i.y<s.y?i.y:s.y,x=a.x>i.x?a.x>s.x?a.x:s.x:i.x>s.x?i.x:s.x,l=a.y>i.y?a.y>s.y?a.y:s.y:i.y>s.y?i.y:s.y,p=S(u,o,t,n,r),h=S(x,l,t,n,r),y=e.prevZ,c=e.nextZ;while(y&&y.z>=p&&c&&c.z<=h){if(y!==e.prev&&y!==e.next&&O(a.x,a.y,i.x,i.y,s.x,s.y,y.x,y.y)&&z(y.prev,y,y.next)>=0)return!1;if(y=y.prevZ,c!==e.prev&&c!==e.next&&O(a.x,a.y,i.x,i.y,s.x,s.y,c.x,c.y)&&z(c.prev,c,c.next)>=0)return!1;c=c.nextZ}while(y&&y.z>=p){if(y!==e.prev&&y!==e.next&&O(a.x,a.y,i.x,i.y,s.x,s.y,y.x,y.y)&&z(y.prev,y,y.next)>=0)return!1;y=y.prevZ}while(c&&c.z<=h){if(c!==e.prev&&c!==e.next&&O(a.x,a.y,i.x,i.y,s.x,s.y,c.x,c.y)&&z(c.prev,c,c.next)>=0)return!1;c=c.nextZ}return!0}function d(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!L(a,i)&&R(a,r,r.next,i)&&G(a,i)&&G(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),$(r),$(r.next),r=e=i),r=r.next}while(r!==e);return h(r)}function v(e,t,n,r,a,i){var s=e;do{var u=s.next.next;while(u!==s.prev){if(s.i!==u.i&&Z(s,u)){var o=W(s,u);return s=h(s,s.next),o=h(o,o.next),y(s,t,n,r,a,i),void y(o,t,n,r,a,i)}u=u.next}s=s.next}while(s!==e)}function C(e,t,n,r){var a,i,s,u,o,x=[];for(a=0,i=t.length;a<i;a++)s=t[a]*r,u=a<i-1?t[a+1]*r:e.length,o=p(e,s,u,r,!1),o===o.next&&(o.steiner=!0),x.push(M(o));for(x.sort(m),a=0;a<x.length;a++)n=g(x[a],n),n=h(n,n.next);return n}function m(e,t){return e.x-t.x}function g(e,t){var n=w(e,t);if(!n)return t;var r=W(n,e),a=h(n,n.next);return h(r,r.next),t===n?a:t}function w(e,t){var n,r=t,a=e.x,i=e.y,s=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var u=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=a&&u>s){if(s=u,u===a){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(a===s)return n;var o,x=n,l=n.x,p=n.y,h=1/0;r=n;do{a>=r.x&&r.x>=l&&a!==r.x&&O(i<p?a:s,i,l,p,i<p?s:a,i,r.x,r.y)&&(o=Math.abs(i-r.y)/(a-r.x),G(r,e)&&(o<h||o===h&&(r.x>n.x||r.x===n.x&&b(n,r)))&&(n=r,h=o)),r=r.next}while(r!==x);return n}function b(e,t){return z(e.prev,e,t.prev)<0&&z(t.next,e,e.next)<0}function A(e,t,n,r){var a=e;do{null===a.z&&(a.z=S(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next}while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,E(a)}function E(e){var t,n,r,a,i,s,u,o,x=1;do{n=e,e=null,i=null,s=0;while(n){for(s++,r=n,u=0,t=0;t<x;t++)if(u++,r=r.nextZ,!r)break;o=x;while(u>0||o>0&&r)0!==u&&(0===o||!r||n.z<=r.z)?(a=n,n=n.nextZ,u--):(a=r,r=r.nextZ,o--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,x*=2}while(s>1);return e}function S(e,t,n,r,a){return e=32767*(e-n)*a,t=32767*(t-r)*a,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function M(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function O(e,t,n,r,a,i,s,u){return(a-s)*(t-u)-(e-s)*(i-u)>=0&&(e-s)*(r-u)-(n-s)*(t-u)>=0&&(n-s)*(i-u)-(a-s)*(r-u)>=0}function Z(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!k(e,t)&&(G(e,t)&&G(t,e)&&B(e,t)&&(z(e.prev,e,t.prev)||z(e,t.prev,t))||L(e,t)&&z(e.prev,e,e.next)>0&&z(t.prev,t,t.next)>0)}function z(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function L(e,t){return e.x===t.x&&e.y===t.y}function R(e,t,n,r){var a=T(z(e,t,n)),i=T(z(e,t,r)),s=T(z(n,r,e)),u=T(z(n,r,t));return a!==i&&s!==u||(!(0!==a||!D(e,n,t))||(!(0!==i||!D(e,r,t))||(!(0!==s||!D(n,e,r))||!(0!==u||!D(n,t,r)))))}function D(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function T(e){return e>0?1:e<0?-1:0}function k(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&R(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function G(e,t){return z(e.prev,e,e.next)<0?z(e,t,e.next)>=0&&z(e,e.prev,t)>=0:z(e,t,e.prev)<0||z(e,e.next,t)<0}function B(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do{n.y>i!==n.next.y>i&&n.next.y!==n.y&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}function W(e,t){var n=new I(e.i,e.x,e.y),r=new I(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function P(e,t,n,r){var a=new I(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function $(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function I(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function q(e,t,n,r){for(var a=0,i=t,s=n-r;i<n;i+=r)a+=(e[s]-e[i])*(e[i+1]+e[s+1]),s=i;return a}l.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,s=Math.abs(q(e,0,i,n));if(a)for(var u=0,o=t.length;u<o;u++){var x=t[u]*n,l=u<o-1?t[u+1]*n:e.length;s-=Math.abs(q(e,x,l,n))}var p=0;for(u=0;u<r.length;u+=3){var h=r[u]*n,y=r[u+1]*n,c=r[u+2]*n;p+=Math.abs((e[h]-e[c])*(e[y+1]-e[h+1])-(e[h]-e[y])*(e[c+1]-e[h+1]))}return 0===s&&0===p?0:Math.abs((p-s)/s)},l.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var s=0;s<t;s++)n.vertices.push(e[a][i][s]);a>0&&(r+=e[a-1].length,n.holes.push(r))}return n},o.default=x;const N={CLOCKWISE:u.WebGLConstants.CW,COUNTER_CLOCKWISE:u.WebGLConstants.CCW,validate:function(e){return e===N.CLOCKWISE||e===N.COUNTER_CLOCKWISE}};var U=Object.freeze(N);const _=new t.Cartesian3,K=new t.Cartesian3,V={computeArea2D:function(e){n.Check.defined("positions",e),n.Check.typeOf.number.greaterThanOrEquals("positions.length",e.length,3);const t=e.length;let r=0;for(let n=t-1,a=0;a<t;n=a++){const t=e[n],i=e[a];r+=t.x*i.y-i.x*t.y}return.5*r},computeWindingOrder2D:function(e){const t=V.computeArea2D(e);return t>0?U.COUNTER_CLOCKWISE:U.CLOCKWISE},triangulate:function(e,r){n.Check.defined("positions",e);const a=t.Cartesian2.packArray(e);return o(a,r,2)}},F=new t.Cartesian3,j=new t.Cartesian3,H=new t.Cartesian3,J=new t.Cartesian3,Q=new t.Cartesian3,X=new t.Cartesian3,Y=new t.Cartesian3,ee=new t.Cartesian2,te=new t.Cartesian2,ne=new t.Cartesian2,re=new t.Cartesian2;V.computeSubdivision=function(e,i,u,o,x){x=a.defaultValue(x,r.CesiumMath.RADIANS_PER_DEGREE);const l=a.defined(o);n.Check.typeOf.object("ellipsoid",e),n.Check.defined("positions",i),n.Check.defined("indices",u),n.Check.typeOf.number.greaterThanOrEquals("indices.length",u.length,3),n.Check.typeOf.number.equals("indices.length % 3","0",u.length%3,0),n.Check.typeOf.number.greaterThan("granularity",x,0);const p=u.slice(0);let h;const y=i.length,c=new Array(3*y),f=new Array(2*y);let d=0,v=0;for(h=0;h<y;h++){const e=i[h];if(c[d++]=e.x,c[d++]=e.y,c[d++]=e.z,l){const e=o[h];f[v++]=e.x,f[v++]=e.y}}const C=[],m={},g=e.maximumRadius,w=r.CesiumMath.chordLength(x,g),b=w*w;while(p.length>0){const e=p.pop(),n=p.pop(),r=p.pop(),i=t.Cartesian3.fromArray(c,3*r,F),s=t.Cartesian3.fromArray(c,3*n,j),u=t.Cartesian3.fromArray(c,3*e,H);let o,x,y;l&&(o=t.Cartesian2.fromArray(f,2*r,ee),x=t.Cartesian2.fromArray(f,2*n,te),y=t.Cartesian2.fromArray(f,2*e,ne));const d=t.Cartesian3.multiplyByScalar(t.Cartesian3.normalize(i,J),g,J),v=t.Cartesian3.multiplyByScalar(t.Cartesian3.normalize(s,Q),g,Q),w=t.Cartesian3.multiplyByScalar(t.Cartesian3.normalize(u,X),g,X),A=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(d,v,Y)),E=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(v,w,Y)),S=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(w,d,Y)),M=Math.max(A,E,S);let O,Z,z;M>b?A===M?(O=`${Math.min(r,n)} ${Math.max(r,n)}`,h=m[O],a.defined(h)||(Z=t.Cartesian3.add(i,s,Y),t.Cartesian3.multiplyByScalar(Z,.5,Z),c.push(Z.x,Z.y,Z.z),h=c.length/3-1,m[O]=h,l&&(z=t.Cartesian2.add(o,x,re),t.Cartesian2.multiplyByScalar(z,.5,z),f.push(z.x,z.y))),p.push(r,h,e),p.push(h,n,e)):E===M?(O=`${Math.min(n,e)} ${Math.max(n,e)}`,h=m[O],a.defined(h)||(Z=t.Cartesian3.add(s,u,Y),t.Cartesian3.multiplyByScalar(Z,.5,Z),c.push(Z.x,Z.y,Z.z),h=c.length/3-1,m[O]=h,l&&(z=t.Cartesian2.add(x,y,re),t.Cartesian2.multiplyByScalar(z,.5,z),f.push(z.x,z.y))),p.push(n,h,r),p.push(h,e,r)):S===M&&(O=`${Math.min(e,r)} ${Math.max(e,r)}`,h=m[O],a.defined(h)||(Z=t.Cartesian3.add(u,i,Y),t.Cartesian3.multiplyByScalar(Z,.5,Z),c.push(Z.x,Z.y,Z.z),h=c.length/3-1,m[O]=h,l&&(z=t.Cartesian2.add(y,o,re),t.Cartesian2.multiplyByScalar(z,.5,z),f.push(z.x,z.y))),p.push(e,h,n),p.push(h,r,n)):(C.push(r),C.push(n),C.push(e))}const A={attributes:{position:new s.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:c})},indices:C,primitiveType:s.PrimitiveType.TRIANGLES};return l&&(A.attributes.st=new s.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:f})),new s.Geometry(A)};const ae=new t.Cartographic,ie=new t.Cartographic,se=new t.Cartographic,ue=new t.Cartographic;V.computeRhumbLineSubdivision=function(e,u,o,x,l){l=a.defaultValue(l,r.CesiumMath.RADIANS_PER_DEGREE);const p=a.defined(x);n.Check.typeOf.object("ellipsoid",e),n.Check.defined("positions",u),n.Check.defined("indices",o),n.Check.typeOf.number.greaterThanOrEquals("indices.length",o.length,3),n.Check.typeOf.number.equals("indices.length % 3","0",o.length%3,0),n.Check.typeOf.number.greaterThan("granularity",l,0);const h=o.slice(0);let y;const c=u.length,f=new Array(3*c),d=new Array(2*c);let v=0,C=0;for(y=0;y<c;y++){const e=u[y];if(f[v++]=e.x,f[v++]=e.y,f[v++]=e.z,p){const e=x[y];d[C++]=e.x,d[C++]=e.y}}const m=[],g={},w=e.maximumRadius,b=r.CesiumMath.chordLength(l,w),A=new i.EllipsoidRhumbLine(void 0,void 0,e),E=new i.EllipsoidRhumbLine(void 0,void 0,e),S=new i.EllipsoidRhumbLine(void 0,void 0,e);while(h.length>0){const n=h.pop(),r=h.pop(),i=h.pop(),s=t.Cartesian3.fromArray(f,3*i,F),u=t.Cartesian3.fromArray(f,3*r,j),o=t.Cartesian3.fromArray(f,3*n,H);let x,l,c;p&&(x=t.Cartesian2.fromArray(d,2*i,ee),l=t.Cartesian2.fromArray(d,2*r,te),c=t.Cartesian2.fromArray(d,2*n,ne));const v=e.cartesianToCartographic(s,ae),C=e.cartesianToCartographic(u,ie),w=e.cartesianToCartographic(o,se);A.setEndPoints(v,C);const M=A.surfaceDistance;E.setEndPoints(C,w);const O=E.surfaceDistance;S.setEndPoints(w,v);const Z=S.surfaceDistance,z=Math.max(M,O,Z);let L,R,D,T,k;z>b?M===z?(L=`${Math.min(i,r)} ${Math.max(i,r)}`,y=g[L],a.defined(y)||(R=A.interpolateUsingFraction(.5,ue),D=.5*(v.height+C.height),T=t.Cartesian3.fromRadians(R.longitude,R.latitude,D,e,Y),f.push(T.x,T.y,T.z),y=f.length/3-1,g[L]=y,p&&(k=t.Cartesian2.add(x,l,re),t.Cartesian2.multiplyByScalar(k,.5,k),d.push(k.x,k.y))),h.push(i,y,n),h.push(y,r,n)):O===z?(L=`${Math.min(r,n)} ${Math.max(r,n)}`,y=g[L],a.defined(y)||(R=E.interpolateUsingFraction(.5,ue),D=.5*(C.height+w.height),T=t.Cartesian3.fromRadians(R.longitude,R.latitude,D,e,Y),f.push(T.x,T.y,T.z),y=f.length/3-1,g[L]=y,p&&(k=t.Cartesian2.add(l,c,re),t.Cartesian2.multiplyByScalar(k,.5,k),d.push(k.x,k.y))),h.push(r,y,i),h.push(y,n,i)):Z===z&&(L=`${Math.min(n,i)} ${Math.max(n,i)}`,y=g[L],a.defined(y)||(R=S.interpolateUsingFraction(.5,ue),D=.5*(w.height+v.height),T=t.Cartesian3.fromRadians(R.longitude,R.latitude,D,e,Y),f.push(T.x,T.y,T.z),y=f.length/3-1,g[L]=y,p&&(k=t.Cartesian2.add(c,x,re),t.Cartesian2.multiplyByScalar(k,.5,k),d.push(k.x,k.y))),h.push(n,y,r),h.push(y,i,r)):(m.push(i),m.push(r),m.push(n))}const M={attributes:{position:new s.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f})},indices:m,primitiveType:s.PrimitiveType.TRIANGLES};return p&&(M.attributes.st=new s.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:d})),new s.Geometry(M)},V.scaleToGeodeticHeight=function(e,n,r,i){r=a.defaultValue(r,t.Ellipsoid.WGS84);let s=_,u=K;if(n=a.defaultValue(n,0),i=a.defaultValue(i,!0),a.defined(e)){const a=e.length;for(let o=0;o<a;o+=3)t.Cartesian3.fromArray(e,o,u),i&&(u=r.scaleToGeodeticSurface(u,u)),0!==n&&(s=r.geodeticSurfaceNormal(u,s),t.Cartesian3.multiplyByScalar(s,n,s),t.Cartesian3.add(u,s,u)),e[o]=u.x,e[o+1]=u.y,e[o+2]=u.z}return e},e.PolygonPipeline=V,e.WindingOrder=U}));
\ No newline at end of file
define(["exports","./Matrix2-fc7e9822","./defaultValue-94c3e563","./RuntimeError-c581ca93","./EllipsoidGeodesic-dc94f381","./EllipsoidRhumbLine-daebc75b","./IntersectionTests-68fbc42d","./ComponentDatatype-4a60b8d6","./Plane-e20fba8c"],(function(e,t,n,a,i,r,o,s,c){"use strict";const l={numberOfPoints:function(e,n,a){const i=t.Cartesian3.distance(e,n);return Math.ceil(i/a)},numberOfPointsRhumbLine:function(e,t,n){const a=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(a/(n*n))))}},u=new t.Cartographic;l.extractHeights=function(e,t){const n=e.length,a=new Array(n);for(let i=0;i<n;i++){const n=e[i];a[i]=t.cartesianToCartographic(n,u).height}return a};const h=new t.Matrix4,f=new t.Cartesian3,p=new t.Cartesian3,d=new c.Plane(t.Cartesian3.UNIT_X,0),g=new t.Cartesian3,C=new c.Plane(t.Cartesian3.UNIT_X,0),m=new t.Cartesian3,w=new t.Cartesian3,P=[];function T(e,t,n){const a=P;let i;if(a.length=e,t===n){for(i=0;i<e;i++)a[i]=t;return a}const r=n-t,o=r/e;for(i=0;i<e;i++){const e=t+i*o;a[i]=e}return a}const y=new t.Cartographic,E=new t.Cartographic,A=new t.Cartesian3,b=new t.Cartesian3,R=new t.Cartesian3,D=new i.EllipsoidGeodesic;let M=new r.EllipsoidRhumbLine;function S(e,n,a,i,r,o,s,c){const u=i.scaleToGeodeticSurface(e,b),h=i.scaleToGeodeticSurface(n,R),f=l.numberOfPoints(e,n,a),p=i.cartesianToCartographic(u,y),d=i.cartesianToCartographic(h,E),g=T(f,r,o);D.setEndPoints(p,d);const C=D.surfaceDistance/f;let m=c;p.height=r;let w=i.cartographicToCartesian(p,A);t.Cartesian3.pack(w,s,m),m+=3;for(let l=1;l<f;l++){const e=D.interpolateUsingSurfaceDistance(l*C,E);e.height=g[l],w=i.cartographicToCartesian(e,A),t.Cartesian3.pack(w,s,m),m+=3}return m}function x(e,n,a,i,o,s,c,u){const h=i.cartesianToCartographic(e,y),f=i.cartesianToCartographic(n,E),p=l.numberOfPointsRhumbLine(h,f,a);h.height=0,f.height=0;const d=T(p,o,s);M.ellipsoid.equals(i)||(M=new r.EllipsoidRhumbLine(void 0,void 0,i)),M.setEndPoints(h,f);const g=M.surfaceDistance/p;let C=u;h.height=o;let m=i.cartographicToCartesian(h,A);t.Cartesian3.pack(m,c,C),C+=3;for(let r=1;r<p;r++){const e=M.interpolateUsingSurfaceDistance(r*g,E);e.height=d[r],m=i.cartographicToCartesian(e,A),t.Cartesian3.pack(m,c,C),C+=3}return C}l.wrapLongitude=function(e,a){const i=[],r=[];if(n.defined(e)&&e.length>0){a=n.defaultValue(a,t.Matrix4.IDENTITY);const s=t.Matrix4.inverseTransformation(a,h),l=t.Matrix4.multiplyByPoint(s,t.Cartesian3.ZERO,f),u=t.Cartesian3.normalize(t.Matrix4.multiplyByPointAsVector(s,t.Cartesian3.UNIT_Y,p),p),P=c.Plane.fromPointNormal(l,u,d),T=t.Cartesian3.normalize(t.Matrix4.multiplyByPointAsVector(s,t.Cartesian3.UNIT_X,g),g),y=c.Plane.fromPointNormal(l,T,C);let E=1;i.push(t.Cartesian3.clone(e[0]));let A=i[0];const b=e.length;for(let a=1;a<b;++a){const s=e[a];if(c.Plane.getPointDistance(y,A)<0||c.Plane.getPointDistance(y,s)<0){const e=o.IntersectionTests.lineSegmentPlane(A,s,P,m);if(n.defined(e)){const n=t.Cartesian3.multiplyByScalar(u,5e-9,w);c.Plane.getPointDistance(P,A)<0&&t.Cartesian3.negate(n,n),i.push(t.Cartesian3.add(e,n,new t.Cartesian3)),r.push(E+1),t.Cartesian3.negate(n,n),i.push(t.Cartesian3.add(e,n,new t.Cartesian3)),E=1}}i.push(t.Cartesian3.clone(e[a])),E++,A=s}r.push(E)}return{positions:i,lengths:r}},l.generateArc=function(e){n.defined(e)||(e={});const i=e.positions;if(!n.defined(i))throw new a.DeveloperError("options.positions is required.");const r=i.length,o=n.defaultValue(e.ellipsoid,t.Ellipsoid.WGS84);let c=n.defaultValue(e.height,0);const u=Array.isArray(c);if(r<1)return[];if(1===r){const e=o.scaleToGeodeticSurface(i[0],b);if(c=u?c[0]:c,0!==c){const n=o.geodeticSurfaceNormal(e,A);t.Cartesian3.multiplyByScalar(n,c,n),t.Cartesian3.add(e,n,e)}return[e.x,e.y,e.z]}let h=e.minDistance;if(!n.defined(h)){const t=n.defaultValue(e.granularity,s.CesiumMath.RADIANS_PER_DEGREE);h=s.CesiumMath.chordLength(t,o.maximumRadius)}let f,p=0;for(f=0;f<r-1;f++)p+=l.numberOfPoints(i[f],i[f+1],h);const d=3*(p+1),g=new Array(d);let C=0;for(f=0;f<r-1;f++){const e=i[f],t=i[f+1],n=u?c[f]:c,a=u?c[f+1]:c;C=S(e,t,h,o,n,a,g,C)}P.length=0;const m=i[r-1],w=o.cartesianToCartographic(m,y);w.height=u?c[r-1]:c;const T=o.cartographicToCartesian(w,A);return t.Cartesian3.pack(T,g,d-3),g};const N=new t.Cartographic,G=new t.Cartographic;l.generateRhumbArc=function(e){n.defined(e)||(e={});const i=e.positions;if(!n.defined(i))throw new a.DeveloperError("options.positions is required.");const r=i.length,o=n.defaultValue(e.ellipsoid,t.Ellipsoid.WGS84);let c=n.defaultValue(e.height,0);const u=Array.isArray(c);if(r<1)return[];if(1===r){const e=o.scaleToGeodeticSurface(i[0],b);if(c=u?c[0]:c,0!==c){const n=o.geodeticSurfaceNormal(e,A);t.Cartesian3.multiplyByScalar(n,c,n),t.Cartesian3.add(e,n,e)}return[e.x,e.y,e.z]}const h=n.defaultValue(e.granularity,s.CesiumMath.RADIANS_PER_DEGREE);let f,p,d=0,g=o.cartesianToCartographic(i[0],N);for(f=0;f<r-1;f++)p=o.cartesianToCartographic(i[f+1],G),d+=l.numberOfPointsRhumbLine(g,p,h),g=t.Cartographic.clone(p,N);const C=3*(d+1),m=new Array(C);let w=0;for(f=0;f<r-1;f++){const e=i[f],t=i[f+1],n=u?c[f]:c,a=u?c[f+1]:c;w=x(e,t,h,o,n,a,m,w)}P.length=0;const T=i[r-1],E=o.cartesianToCartographic(T,y);E.height=u?c[r-1]:c;const R=o.cartographicToCartesian(E,A);return t.Cartesian3.pack(R,m,C-3),m},l.generateCartesianArc=function(e){const n=l.generateArc(e),a=n.length/3,i=new Array(a);for(let r=0;r<a;r++)i[r]=t.Cartesian3.unpack(n,3*r);return i},l.generateCartesianRhumbArc=function(e){const n=l.generateRhumbArc(e),a=n.length/3,i=new Array(a);for(let r=0;r<a;r++)i[r]=t.Cartesian3.unpack(n,3*r);return i},e.PolylinePipeline=l}));
\ No newline at end of file
define(["exports","./Matrix2-fc7e9822","./EllipsoidTangentPlane-53e32153","./ComponentDatatype-4a60b8d6","./PolylinePipeline-0e310844","./Transforms-3ac41eb6","./defaultValue-94c3e563","./RuntimeError-c581ca93"],(function(e,t,a,n,r,i,o,s){"use strict";const l={ROUNDED:0,MITERED:1,BEVELED:2};var c=Object.freeze(l);const C={};function u(e,t){if(!o.defined(e))throw new s.DeveloperError("identifier is required.");o.defined(C[e])||(C[e]=!0,console.warn(o.defaultValue(t,e)))}u.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.",u.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",u.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",u.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";const d=[new t.Cartesian3,new t.Cartesian3],g=new t.Cartesian3,y=new t.Cartesian3,f=new t.Cartesian3,m=new t.Cartesian3,h=new t.Cartesian3,p=new t.Cartesian3,w=new t.Cartesian3,x=new t.Cartesian3,E=new t.Cartesian3,P=new t.Cartesian3,M=new t.Cartesian3,b={};let T=new t.Cartographic;function B(e,t){const a=new Array(e.length);for(let n=0;n<e.length;n++){const r=e[n];T=t.cartesianToCartographic(r,T),a[n]=T.height,e[n]=t.scaleToGeodeticSurface(r,r)}return a}function z(e,a,n,r){const i=e[0],o=e[1],s=t.Cartesian3.angleBetween(i,o),l=Math.ceil(s/r),c=new Array(l);let C;if(a===n){for(C=0;C<l;C++)c[C]=a;return c.push(n),c}const u=n-a,d=u/l;for(C=1;C<l;C++){const e=a+C*d;c[C]=e}return c[0]=a,c.push(n),c}const S=new t.Cartesian3,A=new t.Cartesian3;function D(e,n,r,i){const o=new a.EllipsoidTangentPlane(r,i),s=o.projectPointOntoPlane(t.Cartesian3.add(r,e,S),S),l=o.projectPointOntoPlane(t.Cartesian3.add(r,n,A),A),c=t.Cartesian2.angleBetween(s,l);return l.x*s.y-l.y*s.x>=0?-c:c}const R=new t.Cartesian3(-1,0,0);let O=new t.Matrix4;const V=new t.Matrix4;let I=new t.Matrix3;const v=t.Matrix3.IDENTITY.clone(),N=new t.Cartesian3,G=new t.Cartesian4,H=new t.Cartesian3;function L(e,a,n,r,o,s,l,c){let C=N,u=G;O=i.Transforms.eastNorthUpToFixedFrame(e,o,O),C=t.Matrix4.multiplyByPointAsVector(O,R,C),C=t.Cartesian3.normalize(C,C);const d=D(C,a,e,o);I=t.Matrix3.fromRotationZ(d,I),H.z=s,O=t.Matrix4.multiplyTransformation(O,t.Matrix4.fromRotationTranslation(I,H,V),O);const g=v;g[0]=l;for(let i=0;i<c;i++)for(let e=0;e<n.length;e+=3)u=t.Cartesian3.fromArray(n,e,u),u=t.Matrix3.multiplyByVector(g,u,u),u=t.Matrix4.multiplyByPoint(O,u,u),r.push(u.x,u.y,u.z);return r}const j=new t.Cartesian3;function q(e,a,n,r,i,o,s){for(let l=0;l<e.length;l+=3){const c=t.Cartesian3.fromArray(e,l,j);r=L(c,a,n,r,i,o[l/3],s,1)}return r}function Q(e,t){const a=e.length,n=new Array(6*a);let r=0;const i=t.x+t.width/2,o=t.y+t.height/2;let s=e[0];n[r++]=s.x-i,n[r++]=0,n[r++]=s.y-o;for(let l=1;l<a;l++){s=e[l];const t=s.x-i,a=s.y-o;n[r++]=t,n[r++]=0,n[r++]=a,n[r++]=t,n[r++]=0,n[r++]=a}return s=e[0],n[r++]=s.x-i,n[r++]=0,n[r++]=s.y-o,n}function F(e,t){const a=e.length,n=new Array(3*a);let r=0;const i=t.x+t.width/2,o=t.y+t.height/2;for(let s=0;s<a;s++)n[r++]=e[s].x-i,n[r++]=0,n[r++]=e[s].y-o;return n}const U=new i.Quaternion,_=new t.Cartesian3,Z=new t.Matrix3;function W(e,a,r,o,s,l,C,u,d,g){const y=t.Cartesian3.angleBetween(t.Cartesian3.subtract(a,e,P),t.Cartesian3.subtract(r,e,M)),f=o===c.BEVELED?0:Math.ceil(y/n.CesiumMath.toRadians(5));let m,h,p;if(m=s?t.Matrix3.fromQuaternion(i.Quaternion.fromAxisAngle(t.Cartesian3.negate(e,P),y/(f+1),U),Z):t.Matrix3.fromQuaternion(i.Quaternion.fromAxisAngle(e,y/(f+1),U),Z),a=t.Cartesian3.clone(a,_),f>0){const n=g?2:1;for(let r=0;r<f;r++)a=t.Matrix3.multiplyByVector(m,a,a),h=t.Cartesian3.subtract(a,e,P),h=t.Cartesian3.normalize(h,h),s||(h=t.Cartesian3.negate(h,h)),p=l.scaleToGeodeticSurface(a,M),C=L(p,h,u,C,l,d,1,n)}else h=t.Cartesian3.subtract(a,e,P),h=t.Cartesian3.normalize(h,h),s||(h=t.Cartesian3.negate(h,h)),p=l.scaleToGeodeticSurface(a,M),C=L(p,h,u,C,l,d,1,1),r=t.Cartesian3.clone(r,_),h=t.Cartesian3.subtract(r,e,P),h=t.Cartesian3.normalize(h,h),s||(h=t.Cartesian3.negate(h,h)),p=l.scaleToGeodeticSurface(r,M),C=L(p,h,u,C,l,d,1,1);return C}b.removeDuplicatesFromShape=function(e){const a=e.length,n=[];for(let r=a-1,i=0;i<a;r=i++){const a=e[r],o=e[i];t.Cartesian2.equals(a,o)||n.push(o)}return n},b.angleIsGreaterThanPi=function(e,n,r,i){const o=new a.EllipsoidTangentPlane(r,i),s=o.projectPointOntoPlane(t.Cartesian3.add(r,e,S),S),l=o.projectPointOntoPlane(t.Cartesian3.add(r,n,A),A);return l.x*s.y-l.y*s.x>=0};const Y=new t.Cartesian3,k=new t.Cartesian3;b.computePositions=function(e,a,i,o,s){const l=o._ellipsoid,C=B(e,l),M=o._granularity,T=o._cornerType,S=s?Q(a,i):F(a,i),A=s?F(a,i):void 0,D=i.height/2,R=i.width/2;let O=e.length,V=[],I=s?[]:void 0,v=g,N=y,G=f,H=m,j=h,U=p,_=w,Z=x,J=E,K=e[0],X=e[1];H=l.geodeticSurfaceNormal(K,H),v=t.Cartesian3.subtract(X,K,v),v=t.Cartesian3.normalize(v,v),Z=t.Cartesian3.cross(H,v,Z),Z=t.Cartesian3.normalize(Z,Z);let $,ee,te=C[0],ae=C[1];s&&(I=L(K,Z,A,I,l,te+D,1,1)),J=t.Cartesian3.clone(K,J),K=X,N=t.Cartesian3.negate(v,N);for(let g=1;g<O-1;g++){const a=s?2:1;if(X=e[g+1],K.equals(X)){u("Positions are too close and are considered equivalent with rounding error.");continue}v=t.Cartesian3.subtract(X,K,v),v=t.Cartesian3.normalize(v,v),G=t.Cartesian3.add(v,N,G),G=t.Cartesian3.normalize(G,G),H=l.geodeticSurfaceNormal(K,H);const i=t.Cartesian3.multiplyByScalar(H,t.Cartesian3.dot(v,H),Y);t.Cartesian3.subtract(v,i,i),t.Cartesian3.normalize(i,i);const o=t.Cartesian3.multiplyByScalar(H,t.Cartesian3.dot(N,H),k);t.Cartesian3.subtract(N,o,o),t.Cartesian3.normalize(o,o);const y=!n.CesiumMath.equalsEpsilon(Math.abs(t.Cartesian3.dot(i,o)),1,n.CesiumMath.EPSILON7);if(y){G=t.Cartesian3.cross(G,H,G),G=t.Cartesian3.cross(H,G,G),G=t.Cartesian3.normalize(G,G);const e=1/Math.max(.25,t.Cartesian3.magnitude(t.Cartesian3.cross(G,N,P))),n=b.angleIsGreaterThanPi(v,N,K,l);n?(j=t.Cartesian3.add(K,t.Cartesian3.multiplyByScalar(G,e*R,G),j),U=t.Cartesian3.add(j,t.Cartesian3.multiplyByScalar(Z,R,U),U),d[0]=t.Cartesian3.clone(J,d[0]),d[1]=t.Cartesian3.clone(U,d[1]),$=z(d,te+D,ae+D,M),ee=r.PolylinePipeline.generateArc({positions:d,granularity:M,ellipsoid:l}),V=q(ee,Z,S,V,l,$,1),Z=t.Cartesian3.cross(H,v,Z),Z=t.Cartesian3.normalize(Z,Z),_=t.Cartesian3.add(j,t.Cartesian3.multiplyByScalar(Z,R,_),_),T===c.ROUNDED||T===c.BEVELED?W(j,U,_,T,n,l,V,S,ae+D,s):(G=t.Cartesian3.negate(G,G),V=L(K,G,S,V,l,ae+D,e,a)),J=t.Cartesian3.clone(_,J)):(j=t.Cartesian3.add(K,t.Cartesian3.multiplyByScalar(G,e*R,G),j),U=t.Cartesian3.add(j,t.Cartesian3.multiplyByScalar(Z,-R,U),U),d[0]=t.Cartesian3.clone(J,d[0]),d[1]=t.Cartesian3.clone(U,d[1]),$=z(d,te+D,ae+D,M),ee=r.PolylinePipeline.generateArc({positions:d,granularity:M,ellipsoid:l}),V=q(ee,Z,S,V,l,$,1),Z=t.Cartesian3.cross(H,v,Z),Z=t.Cartesian3.normalize(Z,Z),_=t.Cartesian3.add(j,t.Cartesian3.multiplyByScalar(Z,-R,_),_),T===c.ROUNDED||T===c.BEVELED?W(j,U,_,T,n,l,V,S,ae+D,s):V=L(K,G,S,V,l,ae+D,e,a),J=t.Cartesian3.clone(_,J)),N=t.Cartesian3.negate(v,N)}else V=L(J,Z,S,V,l,te+D,1,1),J=K;te=ae,ae=C[g+1],K=X}d[0]=t.Cartesian3.clone(J,d[0]),d[1]=t.Cartesian3.clone(K,d[1]),$=z(d,te+D,ae+D,M),ee=r.PolylinePipeline.generateArc({positions:d,granularity:M,ellipsoid:l}),V=q(ee,Z,S,V,l,$,1),s&&(I=L(K,Z,A,I,l,ae+D,1,1)),O=V.length;const ne=s?O+I.length:O,re=new Float64Array(ne);return re.set(V),s&&re.set(I,O),re},e.CornerType=c,e.PolylineVolumeGeometryLibrary=b,e.oneTimeWarning=u}));
\ No newline at end of file
define(["exports","./Transforms-3ac41eb6","./ComponentDatatype-4a60b8d6","./defaultValue-94c3e563","./RuntimeError-c581ca93","./Matrix2-fc7e9822","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./GeometryPipeline-a88e5bfc","./IndexDatatype-db156785","./WebMercatorProjection-843df830"],(function(e,t,n,o,r,i,s,c,a,d,p){"use strict";function f(e,t,n){e=o.defaultValue(e,0),t=o.defaultValue(t,0),n=o.defaultValue(n,0),this.value=new Float32Array([e,t,n])}function u(e,t,n){let r=!n;const s=e.length;let c;if(!r&&s>1){const t=e[0].modelMatrix;for(c=1;c<s;++c)if(!i.Matrix4.equals(t,e[c].modelMatrix)){r=!0;break}}if(r)for(c=0;c<s;++c)o.defined(e[c].geometry)&&a.GeometryPipeline.transformToWorldCoordinates(e[c]);else i.Matrix4.multiplyTransformation(t,e[0].modelMatrix,t)}function l(e,t){const o=e.attributes,r=o.position,i=r.values.length/r.componentsPerAttribute;o.batchId=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:1,values:new Float32Array(i)});const c=o.batchId.values;for(let n=0;n<i;++n)c[n]=t}function m(e){const t=e.length;for(let n=0;n<t;++n){const t=e[n];o.defined(t.geometry)?l(t.geometry,n):o.defined(t.westHemisphereGeometry)&&o.defined(t.eastHemisphereGeometry)&&(l(t.westHemisphereGeometry,n),l(t.eastHemisphereGeometry,n))}}function h(e){const i=e.instances,s=e.projection,c=e.elementIndexUintSupported,d=e.scene3DOnly,p=e.vertexCacheOptimize,f=e.compressVertices,l=e.modelMatrix;let h,g,y,b=i.length;for(h=0;h<b;++h)if(o.defined(i[h].geometry)){y=i[h].geometry.primitiveType;break}for(h=1;h<b;++h)if(o.defined(i[h].geometry)&&i[h].geometry.primitiveType!==y)throw new r.DeveloperError("All instance geometries must have the same primitiveType.");if(u(i,l,d),!d)for(h=0;h<b;++h)o.defined(i[h].geometry)&&a.GeometryPipeline.splitLongitude(i[h]);if(m(i),p)for(h=0;h<b;++h){const e=i[h];o.defined(e.geometry)?(a.GeometryPipeline.reorderForPostVertexCache(e.geometry),a.GeometryPipeline.reorderForPreVertexCache(e.geometry)):o.defined(e.westHemisphereGeometry)&&o.defined(e.eastHemisphereGeometry)&&(a.GeometryPipeline.reorderForPostVertexCache(e.westHemisphereGeometry),a.GeometryPipeline.reorderForPreVertexCache(e.westHemisphereGeometry),a.GeometryPipeline.reorderForPostVertexCache(e.eastHemisphereGeometry),a.GeometryPipeline.reorderForPreVertexCache(e.eastHemisphereGeometry))}let x=a.GeometryPipeline.combineInstances(i);for(b=x.length,h=0;h<b;++h){g=x[h];const e=g.attributes;if(d)for(const t in e)e.hasOwnProperty(t)&&e[t].componentDatatype===n.ComponentDatatype.DOUBLE&&a.GeometryPipeline.encodeAttribute(g,t,`${t}3DHigh`,`${t}3DLow`);else for(const r in e)if(e.hasOwnProperty(r)&&e[r].componentDatatype===n.ComponentDatatype.DOUBLE){const e=`${r}3D`,n=`${r}2D`;a.GeometryPipeline.projectTo2D(g,r,e,n,s),o.defined(g.boundingSphere)&&"position"===r&&(g.boundingSphereCV=t.BoundingSphere.fromVertices(g.attributes.position2D.values)),a.GeometryPipeline.encodeAttribute(g,e,`${e}High`,`${e}Low`),a.GeometryPipeline.encodeAttribute(g,n,`${n}High`,`${n}Low`)}f&&a.GeometryPipeline.compressVertices(g)}if(!c){let e=[];for(b=x.length,h=0;h<b;++h)g=x[h],e=e.concat(a.GeometryPipeline.fitToUnsignedShortIndices(g));x=e}return x}function g(e,t,n,r){let i,s,c;const a=r.length-1;if(a>=0){const e=r[a];i=e.offset+e.count,c=e.index,s=n[c].indices.length}else i=0,c=0,s=n[c].indices.length;const d=e.length;for(let p=0;p<d;++p){const a=e[p],d=a[t];if(!o.defined(d))continue;const f=d.indices.length;i+f>s&&(i=0,s=n[++c].indices.length),r.push({index:c,offset:i,count:f}),i+=f}}function y(e,t){const n=[];return g(e,"geometry",t,n),g(e,"westHemisphereGeometry",t,n),g(e,"eastHemisphereGeometry",t,n),n}Object.defineProperties(f.prototype,{componentDatatype:{get:function(){return n.ComponentDatatype.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}}),f.fromCartesian3=function(e){return r.Check.defined("offset",e),new f(e.x,e.y,e.z)},f.toValue=function(e,t){return r.Check.defined("offset",e),o.defined(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};const b={};function x(e,t){const n=e.attributes;for(const r in n)if(n.hasOwnProperty(r)){const e=n[r];o.defined(e)&&o.defined(e.values)&&t.push(e.values.buffer)}o.defined(e.indices)&&t.push(e.indices.buffer)}function G(e,t){const n=e.length;for(let o=0;o<n;++o)x(e[o],t)}function S(e){let n=1;const r=e.length;for(let i=0;i<r;i++){const r=e[i];if(++n,!o.defined(r))continue;const s=r.attributes;n+=7+2*t.BoundingSphere.packedLength+(o.defined(r.indices)?r.indices.length:0);for(const e in s)if(s.hasOwnProperty(e)&&o.defined(s[e])){const t=s[e];n+=5+t.values.length}}return n}function P(e,t){const n=e.length,r=new Float64Array(1+19*n);let s=0;r[s++]=n;for(let c=0;c<n;c++){const t=e[c];if(i.Matrix4.pack(t.modelMatrix,r,s),s+=i.Matrix4.packedLength,o.defined(t.attributes)&&o.defined(t.attributes.offset)){const e=t.attributes.offset.value;r[s]=e[0],r[s+1]=e[1],r[s+2]=e[2]}s+=3}return t.push(r.buffer),r}function k(e){const t=e,n=new Array(t[0]);let r=0,s=1;while(s<t.length){const e=i.Matrix4.unpack(t,s);let c;s+=i.Matrix4.packedLength,o.defined(t[s])&&(c={offset:new f(t[s],t[s+1],t[s+2])}),s+=3,n[r++]={modelMatrix:e,attributes:c}}return n}function C(e){const n=e.length,r=1+(t.BoundingSphere.packedLength+1)*n,i=new Float32Array(r);let s=0;i[s++]=n;for(let c=0;c<n;++c){const n=e[c];o.defined(n)?(i[s++]=1,t.BoundingSphere.pack(e[c],i,s)):i[s++]=0,s+=t.BoundingSphere.packedLength}return i}function w(e){const n=new Array(e[0]);let o=0,r=1;while(r<e.length)1===e[r++]&&(n[o]=t.BoundingSphere.unpack(e,r)),++o,r+=t.BoundingSphere.packedLength;return n}b.combineGeometry=function(e){let n,r;const i=e.instances,s=i.length;let c,d,p=!1;s>0&&(n=h(e),n.length>0&&(r=a.GeometryPipeline.createAttributeLocations(n[0]),e.createPickOffsets&&(c=y(i,n))),o.defined(i[0].attributes)&&o.defined(i[0].attributes.offset)&&(d=new Array(s),p=!0));const f=new Array(s),u=new Array(s);for(let a=0;a<s;++a){const e=i[a],n=e.geometry;o.defined(n)&&(f[a]=n.boundingSphere,u[a]=n.boundingSphereCV,p&&(d[a]=e.geometry.offsetAttribute));const r=e.eastHemisphereGeometry,s=e.westHemisphereGeometry;o.defined(r)&&o.defined(s)&&(o.defined(r.boundingSphere)&&o.defined(s.boundingSphere)&&(f[a]=t.BoundingSphere.union(r.boundingSphere,s.boundingSphere)),o.defined(r.boundingSphereCV)&&o.defined(s.boundingSphereCV)&&(u[a]=t.BoundingSphere.union(r.boundingSphereCV,s.boundingSphereCV)))}return{geometries:n,modelMatrix:e.modelMatrix,attributeLocations:r,pickOffsets:c,offsetInstanceExtend:d,boundingSpheres:f,boundingSpheresCV:u}},b.packCreateGeometryResults=function(e,n){const r=new Float64Array(S(e)),i=[],s={},c=e.length;let a=0;r[a++]=c;for(let d=0;d<c;d++){const n=e[d],c=o.defined(n);if(r[a++]=c?1:0,!c)continue;r[a++]=n.primitiveType,r[a++]=n.geometryType,r[a++]=o.defaultValue(n.offsetAttribute,-1);const p=o.defined(n.boundingSphere)?1:0;r[a++]=p,p&&t.BoundingSphere.pack(n.boundingSphere,r,a),a+=t.BoundingSphere.packedLength;const f=o.defined(n.boundingSphereCV)?1:0;r[a++]=f,f&&t.BoundingSphere.pack(n.boundingSphereCV,r,a),a+=t.BoundingSphere.packedLength;const u=n.attributes,l=[];for(const e in u)u.hasOwnProperty(e)&&o.defined(u[e])&&(l.push(e),o.defined(s[e])||(s[e]=i.length,i.push(e)));r[a++]=l.length;for(let e=0;e<l.length;e++){const t=l[e],n=u[t];r[a++]=s[t],r[a++]=n.componentDatatype,r[a++]=n.componentsPerAttribute,r[a++]=n.normalize?1:0,r[a++]=n.values.length,r.set(n.values,a),a+=n.values.length}const m=o.defined(n.indices)?n.indices.length:0;r[a++]=m,m>0&&(r.set(n.indices,a),a+=m)}return n.push(r.buffer),{stringTable:i,packedData:r}},b.unpackCreateGeometryResults=function(e){const o=e.stringTable,r=e.packedData;let i;const a=new Array(r[0]);let p=0,f=1;while(f<r.length){const e=1===r[f++];if(!e){a[p++]=void 0;continue}const u=r[f++],l=r[f++];let m,h,g=r[f++];-1===g&&(g=void 0);const y=1===r[f++];y&&(m=t.BoundingSphere.unpack(r,f)),f+=t.BoundingSphere.packedLength;const b=1===r[f++];let x,G,S;b&&(h=t.BoundingSphere.unpack(r,f)),f+=t.BoundingSphere.packedLength;const P=new c.GeometryAttributes,k=r[f++];for(i=0;i<k;i++){const e=o[r[f++]],t=r[f++];S=r[f++];const i=0!==r[f++];x=r[f++],G=n.ComponentDatatype.createTypedArray(t,x);for(let n=0;n<x;n++)G[n]=r[f++];P[e]=new s.GeometryAttribute({componentDatatype:t,componentsPerAttribute:S,normalize:i,values:G})}let C;if(x=r[f++],x>0){const e=G.length/S;for(C=d.IndexDatatype.createTypedArray(e,x),i=0;i<x;i++)C[i]=r[f++]}a[p++]=new s.Geometry({primitiveType:u,geometryType:l,boundingSphere:m,boundingSphereCV:h,indices:C,attributes:P,offsetAttribute:g})}return a},b.packCombineGeometryParameters=function(e,n){const o=e.createGeometryResults,r=o.length;for(let t=0;t<r;t++)n.push(o[t].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:P(e.instances,n),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof t.GeographicProjection,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},b.unpackCombineGeometryParameters=function(e){const n=k(e.packedInstances),o=e.createGeometryResults,r=o.length;let s=0;for(let t=0;t<r;t++){const e=b.unpackCreateGeometryResults(o[t]),r=e.length;for(let t=0;t<r;t++){const o=e[t],r=n[s];r.geometry=o,++s}}const c=i.Ellipsoid.clone(e.ellipsoid),a=e.isGeographic?new t.GeographicProjection(c):new p.WebMercatorProjection(c);return{instances:n,ellipsoid:c,projection:a,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:i.Matrix4.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},b.packCombineGeometryResults=function(e,t){o.defined(e.geometries)&&G(e.geometries,t);const n=C(e.boundingSpheres),r=C(e.boundingSpheresCV);return t.push(n.buffer,r.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:n,boundingSpheresCV:r}},b.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:w(e.boundingSpheres),boundingSpheresCV:w(e.boundingSpheresCV)}},e.PrimitivePipeline=b}));
\ No newline at end of file
define(["exports","./Matrix2-fc7e9822","./defaultValue-94c3e563","./RuntimeError-c581ca93","./Transforms-3ac41eb6","./ComponentDatatype-4a60b8d6"],(function(t,n,a,e,o,r){"use strict";const s=Math.cos,i=Math.sin,c=Math.sqrt,h={computePosition:function(t,n,e,o,r,h,u){const g=n.radiiSquared,l=t.nwCorner,C=t.boundingRectangle;let d=l.latitude-t.granYCos*o+r*t.granXSin;const M=s(d),S=i(d),w=g.z*S;let m=l.longitude+o*t.granYSin+r*t.granXCos;const p=M*s(m),R=M*i(m),X=g.x*p,Y=g.y*R,O=c(X*p+Y*R+w*S);if(h.x=X/O,h.y=Y/O,h.z=w/O,e){const n=t.stNwCorner;a.defined(n)?(d=n.latitude-t.stGranYCos*o+r*t.stGranXSin,m=n.longitude+o*t.stGranYSin+r*t.stGranXCos,u.x=(m-t.stWest)*t.lonScalar,u.y=(d-t.stSouth)*t.latScalar):(u.x=(m-C.west)*t.lonScalar,u.y=(d-C.south)*t.latScalar)}}},u=new n.Matrix2;let g=new n.Cartesian3;const l=new n.Cartographic;let C=new n.Cartesian3;const d=new o.GeographicProjection;function M(t,a,e,o,r,s,i){const c=Math.cos(a),h=o*c,l=e*c,M=Math.sin(a),S=o*M,w=e*M;g=d.project(t,g),g=n.Cartesian3.subtract(g,C,g);const m=n.Matrix2.fromRotation(a,u);g=n.Matrix2.multiplyByVector(m,g,g),g=n.Cartesian3.add(g,C,g),t=d.unproject(g,t),s-=1,i-=1;const p=t.latitude,R=p+s*w,X=p-h*i,Y=p-h*i+s*w,O=Math.max(p,R,X,Y),f=Math.min(p,R,X,Y),_=t.longitude,x=_+s*l,G=_+i*S,P=_+i*S+s*l,W=Math.max(_,x,G,P),y=Math.min(_,x,G,P);return{north:O,south:f,east:W,west:y,granYCos:h,granYSin:S,granXCos:l,granXSin:w,nwCorner:t}}h.computeOptions=function(t,a,o,s,i,c,h){let u,g=t.east,S=t.west,w=t.north,m=t.south,p=!1,R=!1;w===r.CesiumMath.PI_OVER_TWO&&(p=!0),m===-r.CesiumMath.PI_OVER_TWO&&(R=!0);const X=w-m;u=S>g?r.CesiumMath.TWO_PI-S+g:g-S;const Y=Math.ceil(u/a)+1,O=Math.ceil(X/a)+1,f=u/(Y-1),_=X/(O-1),x=n.Rectangle.northwest(t,c),G=n.Rectangle.center(t,l);0===o&&0===s||(G.longitude<x.longitude&&(G.longitude+=r.CesiumMath.TWO_PI),C=d.project(G,C));const P=_,W=f,y=0,I=0,T=n.Rectangle.clone(t,i),E={granYCos:P,granYSin:y,granXCos:W,granXSin:I,nwCorner:x,boundingRectangle:T,width:Y,height:O,northCap:p,southCap:R};if(0!==o){const t=M(x,o,f,_,G,Y,O);if(w=t.north,m=t.south,g=t.east,S=t.west,w<-r.CesiumMath.PI_OVER_TWO||w>r.CesiumMath.PI_OVER_TWO||m<-r.CesiumMath.PI_OVER_TWO||m>r.CesiumMath.PI_OVER_TWO)throw new e.DeveloperError("Rotated rectangle is invalid. It crosses over either the north or south pole.");E.granYCos=t.granYCos,E.granYSin=t.granYSin,E.granXCos=t.granXCos,E.granXSin=t.granXSin,T.north=w,T.south=m,T.east=g,T.west=S}if(0!==s){o-=s;const t=n.Rectangle.northwest(T,h),a=M(t,o,f,_,G,Y,O);E.stGranYCos=a.granYCos,E.stGranXCos=a.granXCos,E.stGranYSin=a.granYSin,E.stGranXSin=a.granXSin,E.stNwCorner=t,E.stWest=a.west,E.stSouth=a.south}return E},t.RectangleGeometryLibrary=h}));
\ No newline at end of file
define(["exports","./defaultValue-94c3e563"],(function(t,e){"use strict";function n(t){let e;this.name="DeveloperError",this.message=t;try{throw new Error}catch(n){e=n.stack}this.stack=e}e.defined(Object.create)&&(n.prototype=Object.create(Error.prototype),n.prototype.constructor=n),n.prototype.toString=function(){let t=`${this.name}: ${this.message}`;return e.defined(this.stack)&&(t+=`\n${this.stack.toString()}`),t},n.throwInstantiationError=function(){throw new n("This function defines an interface and should not be called directly.")};const o={};function r(t){return`${t} is required, actual value was undefined`}function i(t,e,n){return`Expected ${n} to be typeof ${e}, actual typeof was ${t}`}function f(t){let e;this.name="RuntimeError",this.message=t;try{throw new Error}catch(n){e=n.stack}this.stack=e}o.typeOf={},o.defined=function(t,o){if(!e.defined(o))throw new n(r(t))},o.typeOf.func=function(t,e){if("function"!==typeof e)throw new n(i(typeof e,"function",t))},o.typeOf.string=function(t,e){if("string"!==typeof e)throw new n(i(typeof e,"string",t))},o.typeOf.number=function(t,e){if("number"!==typeof e)throw new n(i(typeof e,"number",t))},o.typeOf.number.lessThan=function(t,e,r){if(o.typeOf.number(t,e),e>=r)throw new n(`Expected ${t} to be less than ${r}, actual value was ${e}`)},o.typeOf.number.lessThanOrEquals=function(t,e,r){if(o.typeOf.number(t,e),e>r)throw new n(`Expected ${t} to be less than or equal to ${r}, actual value was ${e}`)},o.typeOf.number.greaterThan=function(t,e,r){if(o.typeOf.number(t,e),e<=r)throw new n(`Expected ${t} to be greater than ${r}, actual value was ${e}`)},o.typeOf.number.greaterThanOrEquals=function(t,e,r){if(o.typeOf.number(t,e),e<r)throw new n(`Expected ${t} to be greater than or equal to ${r}, actual value was ${e}`)},o.typeOf.object=function(t,e){if("object"!==typeof e)throw new n(i(typeof e,"object",t))},o.typeOf.bool=function(t,e){if("boolean"!==typeof e)throw new n(i(typeof e,"boolean",t))},o.typeOf.bigint=function(t,e){if("bigint"!==typeof e)throw new n(i(typeof e,"bigint",t))},o.typeOf.number.equals=function(t,e,r,i){if(o.typeOf.number(t,r),o.typeOf.number(e,i),r!==i)throw new n(`${t} must be equal to ${e}, the actual values are ${r} and ${i}`)},e.defined(Object.create)&&(f.prototype=Object.create(Error.prototype),f.prototype.constructor=f),f.prototype.toString=function(){let t=`${this.name}: ${this.message}`;return e.defined(this.stack)&&(t+=`\n${this.stack.toString()}`),t},t.Check=o,t.DeveloperError=n,t.RuntimeError=f}));
\ No newline at end of file
define(["exports","./Transforms-3ac41eb6","./Matrix2-fc7e9822","./RuntimeError-c581ca93","./defaultValue-94c3e563","./AttributeCompression-4d18cc04","./ComponentDatatype-4a60b8d6"],(function(t,e,i,o,a,n,r){"use strict";function s(t,e){o.Check.typeOf.object("ellipsoid",t),this._ellipsoid=t,this._cameraPosition=new i.Cartesian3,this._cameraPositionInScaledSpace=new i.Cartesian3,this._distanceToLimbInScaledSpaceSquared=0,a.defined(e)&&(this.cameraPosition=e)}Object.defineProperties(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(t){const e=this._ellipsoid,o=e.transformPositionToScaledSpace(t,this._cameraPositionInScaledSpace),a=i.Cartesian3.magnitudeSquared(o)-1;i.Cartesian3.clone(t,this._cameraPosition),this._cameraPositionInScaledSpace=o,this._distanceToLimbInScaledSpaceSquared=a}}});const c=new i.Cartesian3;s.prototype.isPointVisible=function(t){const e=this._ellipsoid,i=e.transformPositionToScaledSpace(t,c);return C(i,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)},s.prototype.isScaledSpacePointVisible=function(t){return C(t,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};const d=new i.Cartesian3;s.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(t,e){const i=this._ellipsoid;let o,n;return a.defined(e)&&e<0&&i.minimumRadius>-e?(n=d,n.x=this._cameraPosition.x/(i.radii.x+e),n.y=this._cameraPosition.y/(i.radii.y+e),n.z=this._cameraPosition.z/(i.radii.z+e),o=n.x*n.x+n.y*n.y+n.z*n.z-1):(n=this._cameraPositionInScaledSpace,o=this._distanceToLimbInScaledSpaceSquared),C(t,n,o)},s.prototype.computeHorizonCullingPoint=function(t,e,i){return f(this._ellipsoid,t,e,i)};const u=i.Ellipsoid.clone(i.Ellipsoid.UNIT_SPHERE);s.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(t,e,i,o){const a=h(this._ellipsoid,i,u);return f(a,t,e,o)},s.prototype.computeHorizonCullingPointFromVertices=function(t,e,i,o,a){return x(this._ellipsoid,t,e,i,o,a)},s.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(t,e,i,o,a,n){const r=h(this._ellipsoid,a,u);return x(r,t,e,i,o,n)};const l=[];s.prototype.computeHorizonCullingPointFromRectangle=function(t,a,n){o.Check.typeOf.object("rectangle",t);const r=i.Rectangle.subsample(t,a,0,l),s=e.BoundingSphere.fromPoints(r);if(!(i.Cartesian3.magnitude(s.center)<.1*a.minimumRadius))return this.computeHorizonCullingPoint(s.center,r,n)};const m=new i.Cartesian3;function h(t,e,o){if(a.defined(e)&&e<0&&t.minimumRadius>-e){const a=i.Cartesian3.fromElements(t.radii.x+e,t.radii.y+e,t.radii.z+e,m);t=i.Ellipsoid.fromCartesian3(a,o)}return t}function f(t,e,n,r){o.Check.typeOf.object("directionToPoint",e),o.Check.defined("positions",n),a.defined(r)||(r=new i.Cartesian3);const s=T(t,e);let c=0;for(let i=0,o=n.length;i<o;++i){const e=n[i],o=y(t,e,s);if(o<0)return;c=Math.max(c,o)}return N(s,c,r)}const p=new i.Cartesian3;function x(t,e,n,r,s,c){o.Check.typeOf.object("directionToPoint",e),o.Check.defined("vertices",n),o.Check.typeOf.number("stride",r),a.defined(c)||(c=new i.Cartesian3),r=a.defaultValue(r,3),s=a.defaultValue(s,i.Cartesian3.ZERO);const d=T(t,e);let u=0;for(let i=0,o=n.length;i<o;i+=r){p.x=n[i]+s.x,p.y=n[i+1]+s.y,p.z=n[i+2]+s.z;const e=y(t,p,d);if(e<0)return;u=Math.max(u,e)}return N(d,u,c)}function C(t,e,o){const a=e,n=o,r=i.Cartesian3.subtract(t,a,c),s=-i.Cartesian3.dot(r,a),d=n<0?s>0:s>n&&s*s/i.Cartesian3.magnitudeSquared(r)>n;return!d}const S=new i.Cartesian3,g=new i.Cartesian3;function y(t,e,o){const a=t.transformPositionToScaledSpace(e,S);let n=i.Cartesian3.magnitudeSquared(a),r=Math.sqrt(n);const s=i.Cartesian3.divideByScalar(a,r,g);n=Math.max(1,n),r=Math.max(1,r);const c=i.Cartesian3.dot(s,o),d=i.Cartesian3.magnitude(i.Cartesian3.cross(s,o,s)),u=1/r,l=Math.sqrt(n-1)*u;return 1/(c*u-d*l)}function N(t,e,o){if(!(e<=0||e===1/0||e!==e))return i.Cartesian3.multiplyByScalar(t,e,o)}const b=new i.Cartesian3;function T(t,e){return i.Cartesian3.equals(e,i.Cartesian3.ZERO)?e:(t.transformPositionToScaledSpace(e,b),i.Cartesian3.normalize(b,b))}const M={getHeight:function(t,e,i){return(t-i)*e+i}},P=new i.Cartesian3;M.getPosition=function(t,e,o,a,n){const r=e.cartesianToCartographic(t,P),s=M.getHeight(r.height,o,a);return i.Cartesian3.fromRadians(r.longitude,r.latitude,s,e,n)};const z={NONE:0,BITS12:1};var _=Object.freeze(z);const E=new i.Cartesian3,H=new i.Cartesian3,w=new i.Cartesian2,A=new i.Matrix4,I=new i.Matrix4,O=Math.pow(2,12);function V(t,e,o,n,r,s,c,d,u,l){let m,h,f=_.NONE;if(a.defined(e)&&a.defined(o)&&a.defined(n)&&a.defined(r)){const t=e.minimum,a=e.maximum,s=i.Cartesian3.subtract(a,t,H),c=n-o,d=Math.max(i.Cartesian3.maximumComponent(s),c);f=d<O-1?_.BITS12:_.NONE,m=i.Matrix4.inverseTransformation(r,new i.Matrix4);const u=i.Cartesian3.negate(t,E);i.Matrix4.multiply(i.Matrix4.fromTranslation(u,A),m,m);const l=E;l.x=1/s.x,l.y=1/s.y,l.z=1/s.z,i.Matrix4.multiply(i.Matrix4.fromScale(l,A),m,m),h=i.Matrix4.clone(r),i.Matrix4.setTranslation(h,i.Cartesian3.ZERO,h),r=i.Matrix4.clone(r,new i.Matrix4);const p=i.Matrix4.fromTranslation(t,A),x=i.Matrix4.fromScale(s,I),C=i.Matrix4.multiply(p,x,A);i.Matrix4.multiply(r,C,r),i.Matrix4.multiply(h,C,h)}this.quantization=f,this.minimumHeight=o,this.maximumHeight=n,this.center=i.Cartesian3.clone(t),this.toScaledENU=m,this.fromScaledENU=r,this.matrix=h,this.hasVertexNormals=s,this.hasWebMercatorT=a.defaultValue(c,!1),this.hasGeodeticSurfaceNormals=a.defaultValue(d,!1),this.exaggeration=a.defaultValue(u,1),this.exaggerationRelativeHeight=a.defaultValue(l,0),this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}V.prototype.encode=function(t,e,o,a,s,c,d,u){const l=a.x,m=a.y;if(this.quantization===_.BITS12){o=i.Matrix4.multiplyByPoint(this.toScaledENU,o,E),o.x=r.CesiumMath.clamp(o.x,0,1),o.y=r.CesiumMath.clamp(o.y,0,1),o.z=r.CesiumMath.clamp(o.z,0,1);const a=this.maximumHeight-this.minimumHeight,c=r.CesiumMath.clamp((s-this.minimumHeight)/a,0,1);i.Cartesian2.fromElements(o.x,o.y,w);const u=n.AttributeCompression.compressTextureCoordinates(w);i.Cartesian2.fromElements(o.z,c,w);const h=n.AttributeCompression.compressTextureCoordinates(w);i.Cartesian2.fromElements(l,m,w);const f=n.AttributeCompression.compressTextureCoordinates(w);if(t[e++]=u,t[e++]=h,t[e++]=f,this.hasWebMercatorT){i.Cartesian2.fromElements(d,0,w);const o=n.AttributeCompression.compressTextureCoordinates(w);t[e++]=o}}else i.Cartesian3.subtract(o,this.center,E),t[e++]=E.x,t[e++]=E.y,t[e++]=E.z,t[e++]=s,t[e++]=l,t[e++]=m,this.hasWebMercatorT&&(t[e++]=d);return this.hasVertexNormals&&(t[e++]=n.AttributeCompression.octPackFloat(c)),this.hasGeodeticSurfaceNormals&&(t[e++]=u.x,t[e++]=u.y,t[e++]=u.z),e};const q=new i.Cartesian3,G=new i.Cartesian3;V.prototype.addGeodeticSurfaceNormals=function(t,e,i){if(this.hasGeodeticSurfaceNormals)return;const o=this.stride,a=t.length/o;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();const n=this.stride;for(let r=0;r<a;r++){for(let i=0;i<o;i++){const a=r*o+i,s=r*n+i;e[s]=t[a]}const a=this.decodePosition(e,r,q),s=i.geodeticSurfaceNormal(a,G),c=r*n+this._offsetGeodeticSurfaceNormal;e[c]=s.x,e[c+1]=s.y,e[c+2]=s.z}},V.prototype.removeGeodeticSurfaceNormals=function(t,e){if(!this.hasGeodeticSurfaceNormals)return;const i=this.stride,o=t.length/i;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();const a=this.stride;for(let n=0;n<o;n++)for(let o=0;o<a;o++){const r=n*i+o,s=n*a+o;e[s]=t[r]}},V.prototype.decodePosition=function(t,e,o){if(a.defined(o)||(o=new i.Cartesian3),e*=this.stride,this.quantization===_.BITS12){const a=n.AttributeCompression.decompressTextureCoordinates(t[e],w);o.x=a.x,o.y=a.y;const r=n.AttributeCompression.decompressTextureCoordinates(t[e+1],w);return o.z=r.x,i.Matrix4.multiplyByPoint(this.fromScaledENU,o,o)}return o.x=t[e],o.y=t[e+1],o.z=t[e+2],i.Cartesian3.add(o,this.center,o)},V.prototype.getExaggeratedPosition=function(t,e,i){i=this.decodePosition(t,e,i);const o=this.exaggeration,a=this.exaggerationRelativeHeight,n=1!==o;if(n&&this.hasGeodeticSurfaceNormals){const n=this.decodeGeodeticSurfaceNormal(t,e,G),r=this.decodeHeight(t,e),s=M.getHeight(r,o,a)-r;i.x+=n.x*s,i.y+=n.y*s,i.z+=n.z*s}return i},V.prototype.decodeTextureCoordinates=function(t,e,o){return a.defined(o)||(o=new i.Cartesian2),e*=this.stride,this.quantization===_.BITS12?n.AttributeCompression.decompressTextureCoordinates(t[e+2],o):i.Cartesian2.fromElements(t[e+4],t[e+5],o)},V.prototype.decodeHeight=function(t,e){if(e*=this.stride,this.quantization===_.BITS12){const i=n.AttributeCompression.decompressTextureCoordinates(t[e+1],w);return i.y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight}return t[e+3]},V.prototype.decodeWebMercatorT=function(t,e){return e*=this.stride,this.quantization===_.BITS12?n.AttributeCompression.decompressTextureCoordinates(t[e+3],w).x:t[e+6]},V.prototype.getOctEncodedNormal=function(t,e,o){e=e*this.stride+this._offsetVertexNormal;const a=t[e]/256,n=Math.floor(a),r=256*(a-n);return i.Cartesian2.fromElements(n,r,o)},V.prototype.decodeGeodeticSurfaceNormal=function(t,e,i){return e=e*this.stride+this._offsetGeodeticSurfaceNormal,i.x=t[e],i.y=t[e+1],i.z=t[e+2],i},V.prototype._calculateStrideAndOffsets=function(){let t=0;switch(this.quantization){case _.BITS12:t+=3;break;default:t+=6}this.hasWebMercatorT&&(t+=1),this.hasVertexNormals&&(this._offsetVertexNormal=t,t+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=t,t+=3),this.stride=t};const B={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},R={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};V.prototype.getAttributes=function(t){const e=r.ComponentDatatype.FLOAT,i=r.ComponentDatatype.getSizeInBytes(e),o=this.stride*i;let a=0;const n=[];function s(r,s){n.push({index:r,vertexBuffer:t,componentDatatype:e,componentsPerAttribute:s,offsetInBytes:a,strideInBytes:o}),a+=s*i}if(this.quantization===_.NONE){s(B.position3DAndHeight,4);let t=2;t+=this.hasWebMercatorT?1:0,t+=this.hasVertexNormals?1:0,s(B.textureCoordAndEncodedNormals,t),this.hasGeodeticSurfaceNormals&&s(B.geodeticSurfaceNormal,3)}else{const t=this.hasWebMercatorT||this.hasVertexNormals,e=this.hasWebMercatorT&&this.hasVertexNormals;s(R.compressed0,t?4:3),e&&s(R.compressed1,1),this.hasGeodeticSurfaceNormals&&s(R.geodeticSurfaceNormal,3)}return n},V.prototype.getAttributeLocations=function(){return this.quantization===_.NONE?B:R},V.clone=function(t,e){if(a.defined(t))return a.defined(e)||(e=new V),e.quantization=t.quantization,e.minimumHeight=t.minimumHeight,e.maximumHeight=t.maximumHeight,e.center=i.Cartesian3.clone(t.center),e.toScaledENU=i.Matrix4.clone(t.toScaledENU),e.fromScaledENU=i.Matrix4.clone(t.fromScaledENU),e.matrix=i.Matrix4.clone(t.matrix),e.hasVertexNormals=t.hasVertexNormals,e.hasWebMercatorT=t.hasWebMercatorT,e.hasGeodeticSurfaceNormals=t.hasGeodeticSurfaceNormals,e.exaggeration=t.exaggeration,e.exaggerationRelativeHeight=t.exaggerationRelativeHeight,e._calculateStrideAndOffsets(),e},t.EllipsoidalOccluder=s,t.TerrainEncoding=V}));
\ No newline at end of file
define(["exports","./Matrix2-fc7e9822","./RuntimeError-c581ca93","./defaultValue-94c3e563","./ComponentDatatype-4a60b8d6","./_commonjsHelpers-3aae1032-f55dc0c4","./combine-761d9c3f"],(function(e,t,n,r,o,i,s){"use strict";function a(e){this._ellipsoid=r.defaultValue(e,t.Ellipsoid.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(a.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),a.prototype.project=function(e,n){const o=this._semimajorAxis,i=e.longitude*o,s=e.latitude*o,a=e.height;return r.defined(n)?(n.x=i,n.y=s,n.z=a,n):new t.Cartesian3(i,s,a)},a.prototype.unproject=function(e,o){if(!r.defined(e))throw new n.DeveloperError("cartesian is required");const i=this._oneOverSemimajorAxis,s=e.x*i,a=e.y*i,u=e.z;return r.defined(o)?(o.longitude=s,o.latitude=a,o.height=u,o):new t.Cartographic(s,a,u)};const u={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var c=Object.freeze(u);function l(e,t){this.start=r.defaultValue(e,0),this.stop=r.defaultValue(t,0)}function d(e,n){this.center=t.Cartesian3.clone(r.defaultValue(e,t.Cartesian3.ZERO)),this.radius=r.defaultValue(n,0)}const f=new t.Cartesian3,p=new t.Cartesian3,h=new t.Cartesian3,m=new t.Cartesian3,g=new t.Cartesian3,y=new t.Cartesian3,v=new t.Cartesian3,w=new t.Cartesian3,C=new t.Cartesian3,b=new t.Cartesian3,_=new t.Cartesian3,x=new t.Cartesian3,E=4/3*o.CesiumMath.PI;d.fromPoints=function(e,n){if(r.defined(n)||(n=new d),!r.defined(e)||0===e.length)return n.center=t.Cartesian3.clone(t.Cartesian3.ZERO,n.center),n.radius=0,n;const o=t.Cartesian3.clone(e[0],v),i=t.Cartesian3.clone(o,f),s=t.Cartesian3.clone(o,p),a=t.Cartesian3.clone(o,h),u=t.Cartesian3.clone(o,m),c=t.Cartesian3.clone(o,g),l=t.Cartesian3.clone(o,y),E=e.length;let O;for(O=1;O<E;O++){t.Cartesian3.clone(e[O],o);const n=o.x,r=o.y,d=o.z;n<i.x&&t.Cartesian3.clone(o,i),n>u.x&&t.Cartesian3.clone(o,u),r<s.y&&t.Cartesian3.clone(o,s),r>c.y&&t.Cartesian3.clone(o,c),d<a.z&&t.Cartesian3.clone(o,a),d>l.z&&t.Cartesian3.clone(o,l)}const S=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(u,i,w)),A=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(c,s,w)),q=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(l,a,w));let k=i,D=u,I=S;A>I&&(I=A,k=s,D=c),q>I&&(I=q,k=a,D=l);const P=C;P.x=.5*(k.x+D.x),P.y=.5*(k.y+D.y),P.z=.5*(k.z+D.z);let R=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(D,P,w)),T=Math.sqrt(R);const z=b;z.x=i.x,z.y=s.y,z.z=a.z;const M=_;M.x=u.x,M.y=c.y,M.z=l.z;const U=t.Cartesian3.midpoint(z,M,x);let j=0;for(O=0;O<E;O++){t.Cartesian3.clone(e[O],o);const n=t.Cartesian3.magnitude(t.Cartesian3.subtract(o,U,w));n>j&&(j=n);const r=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(o,P,w));if(r>R){const e=Math.sqrt(r);T=.5*(T+e),R=T*T;const t=e-T;P.x=(T*P.x+t*o.x)/e,P.y=(T*P.y+t*o.y)/e,P.z=(T*P.z+t*o.z)/e}}return T<j?(t.Cartesian3.clone(P,n.center),n.radius=T):(t.Cartesian3.clone(U,n.center),n.radius=j),n};const O=new a,S=new t.Cartesian3,A=new t.Cartesian3,q=new t.Cartographic,k=new t.Cartographic;d.fromRectangle2D=function(e,t,n){return d.fromRectangleWithHeights2D(e,t,0,0,n)},d.fromRectangleWithHeights2D=function(e,n,o,i,s){if(r.defined(s)||(s=new d),!r.defined(e))return s.center=t.Cartesian3.clone(t.Cartesian3.ZERO,s.center),s.radius=0,s;n=r.defaultValue(n,O),t.Rectangle.southwest(e,q),q.height=o,t.Rectangle.northeast(e,k),k.height=i;const a=n.project(q,S),u=n.project(k,A),c=u.x-a.x,l=u.y-a.y,f=u.z-a.z;s.radius=.5*Math.sqrt(c*c+l*l+f*f);const p=s.center;return p.x=a.x+.5*c,p.y=a.y+.5*l,p.z=a.z+.5*f,s};const D=[];d.fromRectangle3D=function(e,n,o,i){if(n=r.defaultValue(n,t.Ellipsoid.WGS84),o=r.defaultValue(o,0),r.defined(i)||(i=new d),!r.defined(e))return i.center=t.Cartesian3.clone(t.Cartesian3.ZERO,i.center),i.radius=0,i;const s=t.Rectangle.subsample(e,n,o,D);return d.fromPoints(s,i)},d.fromVertices=function(e,o,i,s){if(r.defined(s)||(s=new d),!r.defined(e)||0===e.length)return s.center=t.Cartesian3.clone(t.Cartesian3.ZERO,s.center),s.radius=0,s;o=r.defaultValue(o,t.Cartesian3.ZERO),i=r.defaultValue(i,3),n.Check.typeOf.number.greaterThanOrEquals("stride",i,3);const a=v;a.x=e[0]+o.x,a.y=e[1]+o.y,a.z=e[2]+o.z;const u=t.Cartesian3.clone(a,f),c=t.Cartesian3.clone(a,p),l=t.Cartesian3.clone(a,h),E=t.Cartesian3.clone(a,m),O=t.Cartesian3.clone(a,g),S=t.Cartesian3.clone(a,y),A=e.length;let q;for(q=0;q<A;q+=i){const n=e[q]+o.x,r=e[q+1]+o.y,i=e[q+2]+o.z;a.x=n,a.y=r,a.z=i,n<u.x&&t.Cartesian3.clone(a,u),n>E.x&&t.Cartesian3.clone(a,E),r<c.y&&t.Cartesian3.clone(a,c),r>O.y&&t.Cartesian3.clone(a,O),i<l.z&&t.Cartesian3.clone(a,l),i>S.z&&t.Cartesian3.clone(a,S)}const k=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(E,u,w)),D=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(O,c,w)),I=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(S,l,w));let P=u,R=E,T=k;D>T&&(T=D,P=c,R=O),I>T&&(T=I,P=l,R=S);const z=C;z.x=.5*(P.x+R.x),z.y=.5*(P.y+R.y),z.z=.5*(P.z+R.z);let M=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(R,z,w)),U=Math.sqrt(M);const j=b;j.x=u.x,j.y=c.y,j.z=l.z;const F=_;F.x=E.x,F.y=O.y,F.z=S.z;const N=t.Cartesian3.midpoint(j,F,x);let B=0;for(q=0;q<A;q+=i){a.x=e[q]+o.x,a.y=e[q+1]+o.y,a.z=e[q+2]+o.z;const n=t.Cartesian3.magnitude(t.Cartesian3.subtract(a,N,w));n>B&&(B=n);const r=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(a,z,w));if(r>M){const e=Math.sqrt(r);U=.5*(U+e),M=U*U;const t=e-U;z.x=(U*z.x+t*a.x)/e,z.y=(U*z.y+t*a.y)/e,z.z=(U*z.z+t*a.z)/e}}return U<B?(t.Cartesian3.clone(z,s.center),s.radius=U):(t.Cartesian3.clone(N,s.center),s.radius=B),s},d.fromEncodedCartesianVertices=function(e,n,o){if(r.defined(o)||(o=new d),!r.defined(e)||!r.defined(n)||e.length!==n.length||0===e.length)return o.center=t.Cartesian3.clone(t.Cartesian3.ZERO,o.center),o.radius=0,o;const i=v;i.x=e[0]+n[0],i.y=e[1]+n[1],i.z=e[2]+n[2];const s=t.Cartesian3.clone(i,f),a=t.Cartesian3.clone(i,p),u=t.Cartesian3.clone(i,h),c=t.Cartesian3.clone(i,m),l=t.Cartesian3.clone(i,g),E=t.Cartesian3.clone(i,y),O=e.length;let S;for(S=0;S<O;S+=3){const r=e[S]+n[S],o=e[S+1]+n[S+1],d=e[S+2]+n[S+2];i.x=r,i.y=o,i.z=d,r<s.x&&t.Cartesian3.clone(i,s),r>c.x&&t.Cartesian3.clone(i,c),o<a.y&&t.Cartesian3.clone(i,a),o>l.y&&t.Cartesian3.clone(i,l),d<u.z&&t.Cartesian3.clone(i,u),d>E.z&&t.Cartesian3.clone(i,E)}const A=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(c,s,w)),q=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(l,a,w)),k=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(E,u,w));let D=s,I=c,P=A;q>P&&(P=q,D=a,I=l),k>P&&(P=k,D=u,I=E);const R=C;R.x=.5*(D.x+I.x),R.y=.5*(D.y+I.y),R.z=.5*(D.z+I.z);let T=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(I,R,w)),z=Math.sqrt(T);const M=b;M.x=s.x,M.y=a.y,M.z=u.z;const U=_;U.x=c.x,U.y=l.y,U.z=E.z;const j=t.Cartesian3.midpoint(M,U,x);let F=0;for(S=0;S<O;S+=3){i.x=e[S]+n[S],i.y=e[S+1]+n[S+1],i.z=e[S+2]+n[S+2];const r=t.Cartesian3.magnitude(t.Cartesian3.subtract(i,j,w));r>F&&(F=r);const o=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(i,R,w));if(o>T){const e=Math.sqrt(o);z=.5*(z+e),T=z*z;const t=e-z;R.x=(z*R.x+t*i.x)/e,R.y=(z*R.y+t*i.y)/e,R.z=(z*R.z+t*i.z)/e}}return z<F?(t.Cartesian3.clone(R,o.center),o.radius=z):(t.Cartesian3.clone(j,o.center),o.radius=F),o},d.fromCornerPoints=function(e,o,i){n.Check.typeOf.object("corner",e),n.Check.typeOf.object("oppositeCorner",o),r.defined(i)||(i=new d);const s=t.Cartesian3.midpoint(e,o,i.center);return i.radius=t.Cartesian3.distance(s,o),i},d.fromEllipsoid=function(e,o){return n.Check.typeOf.object("ellipsoid",e),r.defined(o)||(o=new d),t.Cartesian3.clone(t.Cartesian3.ZERO,o.center),o.radius=e.maximumRadius,o};const I=new t.Cartesian3;d.fromBoundingSpheres=function(e,n){if(r.defined(n)||(n=new d),!r.defined(e)||0===e.length)return n.center=t.Cartesian3.clone(t.Cartesian3.ZERO,n.center),n.radius=0,n;const o=e.length;if(1===o)return d.clone(e[0],n);if(2===o)return d.union(e[0],e[1],n);const i=[];let s;for(s=0;s<o;s++)i.push(e[s].center);n=d.fromPoints(i,n);const a=n.center;let u=n.radius;for(s=0;s<o;s++){const n=e[s];u=Math.max(u,t.Cartesian3.distance(a,n.center,I)+n.radius)}return n.radius=u,n};const P=new t.Cartesian3,R=new t.Cartesian3,T=new t.Cartesian3;d.fromOrientedBoundingBox=function(e,o){n.Check.defined("orientedBoundingBox",e),r.defined(o)||(o=new d);const i=e.halfAxes,s=t.Matrix3.getColumn(i,0,P),a=t.Matrix3.getColumn(i,1,R),u=t.Matrix3.getColumn(i,2,T);return t.Cartesian3.add(s,a,s),t.Cartesian3.add(s,u,s),o.center=t.Cartesian3.clone(e.center,o.center),o.radius=t.Cartesian3.magnitude(s),o};const z=new t.Cartesian3,M=new t.Cartesian3;d.fromTransformation=function(e,o){n.Check.typeOf.object("transformation",e),r.defined(o)||(o=new d);const i=t.Matrix4.getTranslation(e,z),s=t.Matrix4.getScale(e,M),a=.5*t.Cartesian3.magnitude(s);return o.center=t.Cartesian3.clone(i,o.center),o.radius=a,o},d.clone=function(e,n){if(r.defined(e))return r.defined(n)?(n.center=t.Cartesian3.clone(e.center,n.center),n.radius=e.radius,n):new d(e.center,e.radius)},d.packedLength=4,d.pack=function(e,t,o){n.Check.typeOf.object("value",e),n.Check.defined("array",t),o=r.defaultValue(o,0);const i=e.center;return t[o++]=i.x,t[o++]=i.y,t[o++]=i.z,t[o]=e.radius,t},d.unpack=function(e,t,o){n.Check.defined("array",e),t=r.defaultValue(t,0),r.defined(o)||(o=new d);const i=o.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],o.radius=e[t],o};const U=new t.Cartesian3,j=new t.Cartesian3;d.union=function(e,o,i){n.Check.typeOf.object("left",e),n.Check.typeOf.object("right",o),r.defined(i)||(i=new d);const s=e.center,a=e.radius,u=o.center,c=o.radius,l=t.Cartesian3.subtract(u,s,U),f=t.Cartesian3.magnitude(l);if(a>=f+c)return e.clone(i),i;if(c>=f+a)return o.clone(i),i;const p=.5*(a+f+c),h=t.Cartesian3.multiplyByScalar(l,(-a+p)/f,j);return t.Cartesian3.add(h,s,h),t.Cartesian3.clone(h,i.center),i.radius=p,i};const F=new t.Cartesian3;d.expand=function(e,r,o){n.Check.typeOf.object("sphere",e),n.Check.typeOf.object("point",r),o=d.clone(e,o);const i=t.Cartesian3.magnitude(t.Cartesian3.subtract(r,o.center,F));return i>o.radius&&(o.radius=i),o},d.intersectPlane=function(e,r){n.Check.typeOf.object("sphere",e),n.Check.typeOf.object("plane",r);const o=e.center,i=e.radius,s=r.normal,a=t.Cartesian3.dot(s,o)+r.distance;return a<-i?c.OUTSIDE:a<i?c.INTERSECTING:c.INSIDE},d.transform=function(e,o,i){return n.Check.typeOf.object("sphere",e),n.Check.typeOf.object("transform",o),r.defined(i)||(i=new d),i.center=t.Matrix4.multiplyByPoint(o,e.center,i.center),i.radius=t.Matrix4.getMaximumScale(o)*e.radius,i};const N=new t.Cartesian3;d.distanceSquaredTo=function(e,r){n.Check.typeOf.object("sphere",e),n.Check.typeOf.object("cartesian",r);const o=t.Cartesian3.subtract(e.center,r,N),i=t.Cartesian3.magnitude(o)-e.radius;return i<=0?0:i*i},d.transformWithoutScale=function(e,o,i){return n.Check.typeOf.object("sphere",e),n.Check.typeOf.object("transform",o),r.defined(i)||(i=new d),i.center=t.Matrix4.multiplyByPoint(o,e.center,i.center),i.radius=e.radius,i};const B=new t.Cartesian3;d.computePlaneDistances=function(e,o,i,s){n.Check.typeOf.object("sphere",e),n.Check.typeOf.object("position",o),n.Check.typeOf.object("direction",i),r.defined(s)||(s=new l);const a=t.Cartesian3.subtract(e.center,o,B),u=t.Cartesian3.dot(i,a);return s.start=u-e.radius,s.stop=u+e.radius,s};const V=new t.Cartesian3,L=new t.Cartesian3,Q=new t.Cartesian3,$=new t.Cartesian3,W=new t.Cartesian3,H=new t.Cartographic,Y=new Array(8);for(let mo=0;mo<8;++mo)Y[mo]=new t.Cartesian3;const Z=new a;function G(){let e,t;const n=new Promise((function(n,r){e=n,t=r}));return{resolve:e,reject:t,promise:n}}let J;d.projectTo2D=function(e,o,i){n.Check.typeOf.object("sphere",e),o=r.defaultValue(o,Z);const s=o.ellipsoid;let a=e.center;const u=e.radius;let c;c=t.Cartesian3.equals(a,t.Cartesian3.ZERO)?t.Cartesian3.clone(t.Cartesian3.UNIT_X,V):s.geodeticSurfaceNormal(a,V);const l=t.Cartesian3.cross(t.Cartesian3.UNIT_Z,c,L);t.Cartesian3.normalize(l,l);const f=t.Cartesian3.cross(c,l,Q);t.Cartesian3.normalize(f,f),t.Cartesian3.multiplyByScalar(c,u,c),t.Cartesian3.multiplyByScalar(f,u,f),t.Cartesian3.multiplyByScalar(l,u,l);const p=t.Cartesian3.negate(f,W),h=t.Cartesian3.negate(l,$),m=Y;let g=m[0];t.Cartesian3.add(c,f,g),t.Cartesian3.add(g,l,g),g=m[1],t.Cartesian3.add(c,f,g),t.Cartesian3.add(g,h,g),g=m[2],t.Cartesian3.add(c,p,g),t.Cartesian3.add(g,h,g),g=m[3],t.Cartesian3.add(c,p,g),t.Cartesian3.add(g,l,g),t.Cartesian3.negate(c,c),g=m[4],t.Cartesian3.add(c,f,g),t.Cartesian3.add(g,l,g),g=m[5],t.Cartesian3.add(c,f,g),t.Cartesian3.add(g,h,g),g=m[6],t.Cartesian3.add(c,p,g),t.Cartesian3.add(g,h,g),g=m[7],t.Cartesian3.add(c,p,g),t.Cartesian3.add(g,l,g);const y=m.length;for(let n=0;n<y;++n){const e=m[n];t.Cartesian3.add(a,e,e);const r=s.cartesianToCartographic(e,H);o.project(r,e)}i=d.fromPoints(m,i),a=i.center;const v=a.x,w=a.y,C=a.z;return a.x=C,a.y=v,a.z=w,i},d.isOccluded=function(e,t){return n.Check.typeOf.object("sphere",e),n.Check.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)},d.equals=function(e,n){return e===n||r.defined(e)&&r.defined(n)&&t.Cartesian3.equals(e.center,n.center)&&e.radius===n.radius},d.prototype.intersectPlane=function(e){return d.intersectPlane(this,e)},d.prototype.distanceSquaredTo=function(e){return d.distanceSquaredTo(this,e)},d.prototype.computePlaneDistances=function(e,t,n){return d.computePlaneDistances(this,e,t,n)},d.prototype.isOccluded=function(e){return d.isOccluded(this,e)},d.prototype.equals=function(e){return d.equals(this,e)},d.prototype.clone=function(e){return d.clone(this,e)},d.prototype.volume=function(){const e=this.radius;return E*e*e*e};const X={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},K={};let ee,te,ne,re,oe,ie,se,ae,ue,ce,le,de,fe,pe,he,me,ge,ye;function ve(e){const t=e.split(".");for(let n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function we(){if(!r.defined(te)&&(te=!1,!Ae())){const e=/ Chrome\/([\.0-9]+)/.exec(ee.userAgent);null!==e&&(te=!0,ne=ve(e[1]))}return te}function Ce(){return we()&&ne}function be(){if(!r.defined(re)&&(re=!1,!we()&&!Ae()&&/ Safari\/[\.0-9]+/.test(ee.userAgent))){const e=/ Version\/([\.0-9]+)/.exec(ee.userAgent);null!==e&&(re=!0,oe=ve(e[1]))}return re}function _e(){return be()&&oe}function xe(){if(!r.defined(ie)){ie=!1;const e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(ee.userAgent);null!==e&&(ie=!0,se=ve(e[1]),se.isNightly=!!e[2])}return ie}function Ee(){return xe()&&se}function Oe(){if(!r.defined(ae)){let e;ae=!1,"Microsoft Internet Explorer"===ee.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(ee.userAgent),null!==e&&(ae=!0,ue=ve(e[1]))):"Netscape"===ee.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(ee.userAgent),null!==e&&(ae=!0,ue=ve(e[1])))}return ae}function Se(){return Oe()&&ue}function Ae(){if(!r.defined(ce)){ce=!1;const e=/ Edg\/([\.0-9]+)/.exec(ee.userAgent);null!==e&&(ce=!0,le=ve(e[1]))}return ce}function qe(){return Ae()&&le}function ke(){if(!r.defined(de)){de=!1;const e=/Firefox\/([\.0-9]+)/.exec(ee.userAgent);null!==e&&(de=!0,fe=ve(e[1]))}return de}function De(){return r.defined(pe)||(pe=/Windows/i.test(ee.appVersion)),pe}function Ie(){return r.defined(he)||(he="iPhone"===navigator.platform||"iPod"===navigator.platform||"iPad"===navigator.platform),he}function Pe(){return ke()&&fe}function Re(){return r.defined(me)||(me=!ke()&&"undefined"!==typeof PointerEvent&&(!r.defined(ee.pointerEnabled)||ee.pointerEnabled)),me}function Te(){if(!r.defined(ye)){const e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");const t=e.style.imageRendering;ye=r.defined(t)&&""!==t,ye&&(ge=t)}return ye}function ze(){return Te()?ge:void 0}function Me(){if(!Me.initialized)throw new n.DeveloperError("You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP");return Me._result}Object.defineProperties(K,{element:{get:function(){if(K.supportsFullscreen())return document[X.fullscreenElement]}},changeEventName:{get:function(){if(K.supportsFullscreen())return X.fullscreenchange}},errorEventName:{get:function(){if(K.supportsFullscreen())return X.fullscreenerror}},enabled:{get:function(){if(K.supportsFullscreen())return document[X.fullscreenEnabled]}},fullscreen:{get:function(){if(K.supportsFullscreen())return null!==K.element}}}),K.supportsFullscreen=function(){if(r.defined(J))return J;J=!1;const e=document.body;if("function"===typeof e.requestFullscreen)return X.requestFullscreen="requestFullscreen",X.exitFullscreen="exitFullscreen",X.fullscreenEnabled="fullscreenEnabled",X.fullscreenElement="fullscreenElement",X.fullscreenchange="fullscreenchange",X.fullscreenerror="fullscreenerror",J=!0,J;const t=["webkit","moz","o","ms","khtml"];let n;for(let r=0,o=t.length;r<o;++r){const o=t[r];n=`${o}RequestFullscreen`,"function"===typeof e[n]?(X.requestFullscreen=n,J=!0):(n=`${o}RequestFullScreen`,"function"===typeof e[n]&&(X.requestFullscreen=n,J=!0)),n=`${o}ExitFullscreen`,"function"===typeof document[n]?X.exitFullscreen=n:(n=`${o}CancelFullScreen`,"function"===typeof document[n]&&(X.exitFullscreen=n)),n=`${o}FullscreenEnabled`,void 0!==document[n]?X.fullscreenEnabled=n:(n=`${o}FullScreenEnabled`,void 0!==document[n]&&(X.fullscreenEnabled=n)),n=`${o}FullscreenElement`,void 0!==document[n]?X.fullscreenElement=n:(n=`${o}FullScreenElement`,void 0!==document[n]&&(X.fullscreenElement=n)),n=`${o}fullscreenchange`,void 0!==document[`on${n}`]&&("ms"===o&&(n="MSFullscreenChange"),X.fullscreenchange=n),n=`${o}fullscreenerror`,void 0!==document[`on${n}`]&&("ms"===o&&(n="MSFullscreenError"),X.fullscreenerror=n)}return J},K.requestFullscreen=function(e,t){K.supportsFullscreen()&&e[X.requestFullscreen]({vrDisplay:t})},K.exitFullscreen=function(){K.supportsFullscreen()&&document[X.exitFullscreen]()},K._names=X,ee="undefined"!==typeof navigator?navigator:{},Me._promise=void 0,Me._result=void 0,Me.initialize=function(){if(r.defined(Me._promise))return Me._promise;const e=G();if(Me._promise=e.promise,Ae())return Me._result=!1,e.resolve(Me._result),e.promise;const t=new Image;return t.onload=function(){Me._result=t.width>0&&t.height>0,e.resolve(Me._result)},t.onerror=function(){Me._result=!1,e.resolve(Me._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",e.promise},Object.defineProperties(Me,{initialized:{get:function(){return r.defined(Me._result)}}});const Ue=[];"undefined"!==typeof ArrayBuffer&&(Ue.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),"undefined"!==typeof Uint8ClampedArray&&Ue.push(Uint8ClampedArray),"undefined"!==typeof Uint8ClampedArray&&Ue.push(Uint8ClampedArray),"undefined"!==typeof BigInt64Array&&Ue.push(BigInt64Array),"undefined"!==typeof BigUint64Array&&Ue.push(BigUint64Array));const je={isChrome:we,chromeVersion:Ce,isSafari:be,safariVersion:_e,isWebkit:xe,webkitVersion:Ee,isInternetExplorer:Oe,internetExplorerVersion:Se,isEdge:Ae,edgeVersion:qe,isFirefox:ke,firefoxVersion:Pe,isWindows:De,isIPadOrIOS:Ie,hardwareConcurrency:r.defaultValue(ee.hardwareConcurrency,3),supportsPointerEvents:Re,supportsImageRenderingPixelated:Te,supportsWebP:Me,imageRenderingValue:ze,typedArrayTypes:Ue};function Fe(e,t,n,o){this.x=r.defaultValue(e,0),this.y=r.defaultValue(t,0),this.z=r.defaultValue(n,0),this.w=r.defaultValue(o,0)}je.supportsBasis=function(e){return je.supportsWebAssembly()&&e.context.supportsBasis},je.supportsFullscreen=function(){return K.supportsFullscreen()},je.supportsTypedArrays=function(){return"undefined"!==typeof ArrayBuffer},je.supportsBigInt64Array=function(){return"undefined"!==typeof BigInt64Array},je.supportsBigUint64Array=function(){return"undefined"!==typeof BigUint64Array},je.supportsBigInt=function(){return"undefined"!==typeof BigInt},je.supportsWebWorkers=function(){return"undefined"!==typeof Worker},je.supportsWebAssembly=function(){return"undefined"!==typeof WebAssembly};let Ne=new t.Cartesian3;Fe.fromAxisAngle=function(e,o,i){n.Check.typeOf.object("axis",e),n.Check.typeOf.number("angle",o);const s=o/2,a=Math.sin(s);Ne=t.Cartesian3.normalize(e,Ne);const u=Ne.x*a,c=Ne.y*a,l=Ne.z*a,d=Math.cos(s);return r.defined(i)?(i.x=u,i.y=c,i.z=l,i.w=d,i):new Fe(u,c,l,d)};const Be=[1,2,0],Ve=new Array(3);Fe.fromRotationMatrix=function(e,o){let i,s,a,u,c;n.Check.typeOf.object("matrix",e);const l=e[t.Matrix3.COLUMN0ROW0],d=e[t.Matrix3.COLUMN1ROW1],f=e[t.Matrix3.COLUMN2ROW2],p=l+d+f;if(p>0)i=Math.sqrt(p+1),c=.5*i,i=.5/i,s=(e[t.Matrix3.COLUMN1ROW2]-e[t.Matrix3.COLUMN2ROW1])*i,a=(e[t.Matrix3.COLUMN2ROW0]-e[t.Matrix3.COLUMN0ROW2])*i,u=(e[t.Matrix3.COLUMN0ROW1]-e[t.Matrix3.COLUMN1ROW0])*i;else{const n=Be;let r=0;d>l&&(r=1),f>l&&f>d&&(r=2);const o=n[r],p=n[o];i=Math.sqrt(e[t.Matrix3.getElementIndex(r,r)]-e[t.Matrix3.getElementIndex(o,o)]-e[t.Matrix3.getElementIndex(p,p)]+1);const h=Ve;h[r]=.5*i,i=.5/i,c=(e[t.Matrix3.getElementIndex(p,o)]-e[t.Matrix3.getElementIndex(o,p)])*i,h[o]=(e[t.Matrix3.getElementIndex(o,r)]+e[t.Matrix3.getElementIndex(r,o)])*i,h[p]=(e[t.Matrix3.getElementIndex(p,r)]+e[t.Matrix3.getElementIndex(r,p)])*i,s=-h[0],a=-h[1],u=-h[2]}return r.defined(o)?(o.x=s,o.y=a,o.z=u,o.w=c,o):new Fe(s,a,u,c)};const Le=new Fe;let Qe=new Fe,$e=new Fe,We=new Fe;Fe.fromHeadingPitchRoll=function(e,r){return n.Check.typeOf.object("headingPitchRoll",e),We=Fe.fromAxisAngle(t.Cartesian3.UNIT_X,e.roll,Le),$e=Fe.fromAxisAngle(t.Cartesian3.UNIT_Y,-e.pitch,r),r=Fe.multiply($e,We,$e),Qe=Fe.fromAxisAngle(t.Cartesian3.UNIT_Z,-e.heading,Le),Fe.multiply(Qe,r,r)};const He=new t.Cartesian3,Ye=new t.Cartesian3,Ze=new Fe,Ge=new Fe,Je=new Fe;Fe.packedLength=4,Fe.pack=function(e,t,o){return n.Check.typeOf.object("value",e),n.Check.defined("array",t),o=r.defaultValue(o,0),t[o++]=e.x,t[o++]=e.y,t[o++]=e.z,t[o]=e.w,t},Fe.unpack=function(e,t,o){return n.Check.defined("array",e),t=r.defaultValue(t,0),r.defined(o)||(o=new Fe),o.x=e[t],o.y=e[t+1],o.z=e[t+2],o.w=e[t+3],o},Fe.packedInterpolationLength=3,Fe.convertPackedArrayForInterpolation=function(e,t,n,o){Fe.unpack(e,4*n,Je),Fe.conjugate(Je,Je);for(let i=0,s=n-t+1;i<s;i++){const n=3*i;Fe.unpack(e,4*(t+i),Ze),Fe.multiply(Ze,Je,Ze),Ze.w<0&&Fe.negate(Ze,Ze),Fe.computeAxis(Ze,He);const s=Fe.computeAngle(Ze);r.defined(o)||(o=[]),o[n]=He.x*s,o[n+1]=He.y*s,o[n+2]=He.z*s}},Fe.unpackInterpolationResult=function(e,n,o,i,s){r.defined(s)||(s=new Fe),t.Cartesian3.fromArray(e,0,Ye);const a=t.Cartesian3.magnitude(Ye);return Fe.unpack(n,4*i,Ge),0===a?Fe.clone(Fe.IDENTITY,Ze):Fe.fromAxisAngle(Ye,a,Ze),Fe.multiply(Ze,Ge,s)},Fe.clone=function(e,t){if(r.defined(e))return r.defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new Fe(e.x,e.y,e.z,e.w)},Fe.conjugate=function(e,t){return n.Check.typeOf.object("quaternion",e),n.Check.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},Fe.magnitudeSquared=function(e){return n.Check.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},Fe.magnitude=function(e){return Math.sqrt(Fe.magnitudeSquared(e))},Fe.normalize=function(e,t){n.Check.typeOf.object("result",t);const r=1/Fe.magnitude(e),o=e.x*r,i=e.y*r,s=e.z*r,a=e.w*r;return t.x=o,t.y=i,t.z=s,t.w=a,t},Fe.inverse=function(e,t){n.Check.typeOf.object("result",t);const r=Fe.magnitudeSquared(e);return t=Fe.conjugate(e,t),Fe.multiplyByScalar(t,1/r,t)},Fe.add=function(e,t,r){return n.Check.typeOf.object("left",e),n.Check.typeOf.object("right",t),n.Check.typeOf.object("result",r),r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r.w=e.w+t.w,r},Fe.subtract=function(e,t,r){return n.Check.typeOf.object("left",e),n.Check.typeOf.object("right",t),n.Check.typeOf.object("result",r),r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r.w=e.w-t.w,r},Fe.negate=function(e,t){return n.Check.typeOf.object("quaternion",e),n.Check.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},Fe.dot=function(e,t){return n.Check.typeOf.object("left",e),n.Check.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},Fe.multiply=function(e,t,r){n.Check.typeOf.object("left",e),n.Check.typeOf.object("right",t),n.Check.typeOf.object("result",r);const o=e.x,i=e.y,s=e.z,a=e.w,u=t.x,c=t.y,l=t.z,d=t.w,f=a*u+o*d+i*l-s*c,p=a*c-o*l+i*d+s*u,h=a*l+o*c-i*u+s*d,m=a*d-o*u-i*c-s*l;return r.x=f,r.y=p,r.z=h,r.w=m,r},Fe.multiplyByScalar=function(e,t,r){return n.Check.typeOf.object("quaternion",e),n.Check.typeOf.number("scalar",t),n.Check.typeOf.object("result",r),r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r.w=e.w*t,r},Fe.divideByScalar=function(e,t,r){return n.Check.typeOf.object("quaternion",e),n.Check.typeOf.number("scalar",t),n.Check.typeOf.object("result",r),r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r.w=e.w/t,r},Fe.computeAxis=function(e,t){n.Check.typeOf.object("quaternion",e),n.Check.typeOf.object("result",t);const r=e.w;if(Math.abs(r-1)<o.CesiumMath.EPSILON6)return t.x=t.y=t.z=0,t;const i=1/Math.sqrt(1-r*r);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t},Fe.computeAngle=function(e){return n.Check.typeOf.object("quaternion",e),Math.abs(e.w-1)<o.CesiumMath.EPSILON6?0:2*Math.acos(e.w)};let Xe=new Fe;Fe.lerp=function(e,t,r,o){return n.Check.typeOf.object("start",e),n.Check.typeOf.object("end",t),n.Check.typeOf.number("t",r),n.Check.typeOf.object("result",o),Xe=Fe.multiplyByScalar(t,r,Xe),o=Fe.multiplyByScalar(e,1-r,o),Fe.add(Xe,o,o)};let Ke=new Fe,et=new Fe,tt=new Fe;Fe.slerp=function(e,t,r,i){n.Check.typeOf.object("start",e),n.Check.typeOf.object("end",t),n.Check.typeOf.number("t",r),n.Check.typeOf.object("result",i);let s=Fe.dot(e,t),a=t;if(s<0&&(s=-s,a=Ke=Fe.negate(t,Ke)),1-s<o.CesiumMath.EPSILON6)return Fe.lerp(e,a,r,i);const u=Math.acos(s);return et=Fe.multiplyByScalar(e,Math.sin((1-r)*u),et),tt=Fe.multiplyByScalar(a,Math.sin(r*u),tt),i=Fe.add(et,tt,i),Fe.multiplyByScalar(i,1/Math.sin(u),i)},Fe.log=function(e,r){n.Check.typeOf.object("quaternion",e),n.Check.typeOf.object("result",r);const i=o.CesiumMath.acosClamped(e.w);let s=0;return 0!==i&&(s=i/Math.sin(i)),t.Cartesian3.multiplyByScalar(e,s,r)},Fe.exp=function(e,r){n.Check.typeOf.object("cartesian",e),n.Check.typeOf.object("result",r);const o=t.Cartesian3.magnitude(e);let i=0;return 0!==o&&(i=Math.sin(o)/o),r.x=e.x*i,r.y=e.y*i,r.z=e.z*i,r.w=Math.cos(o),r};const nt=new t.Cartesian3,rt=new t.Cartesian3,ot=new Fe,it=new Fe;Fe.computeInnerQuadrangle=function(e,r,o,i){n.Check.typeOf.object("q0",e),n.Check.typeOf.object("q1",r),n.Check.typeOf.object("q2",o),n.Check.typeOf.object("result",i);const s=Fe.conjugate(r,ot);Fe.multiply(s,o,it);const a=Fe.log(it,nt);Fe.multiply(s,e,it);const u=Fe.log(it,rt);return t.Cartesian3.add(a,u,a),t.Cartesian3.multiplyByScalar(a,.25,a),t.Cartesian3.negate(a,a),Fe.exp(a,ot),Fe.multiply(r,ot,i)},Fe.squad=function(e,t,r,o,i,s){n.Check.typeOf.object("q0",e),n.Check.typeOf.object("q1",t),n.Check.typeOf.object("s0",r),n.Check.typeOf.object("s1",o),n.Check.typeOf.number("t",i),n.Check.typeOf.object("result",s);const a=Fe.slerp(e,t,i,ot),u=Fe.slerp(r,o,i,it);return Fe.slerp(a,u,2*i*(1-i),s)};const st=new Fe,at=1.9011074535173003,ut=je.supportsTypedArrays()?new Float32Array(8):[],ct=je.supportsTypedArrays()?new Float32Array(8):[],lt=je.supportsTypedArrays()?new Float32Array(8):[],dt=je.supportsTypedArrays()?new Float32Array(8):[];for(let mo=0;mo<7;++mo){const e=mo+1,t=2*e+1;ut[mo]=1/(e*t),ct[mo]=e/t}function ft(e,t,r){n.Check.defined("array",e),n.Check.defined("itemToFind",t),n.Check.defined("comparator",r);let o,i,s=0,a=e.length-1;while(s<=a)if(o=~~((s+a)/2),i=r(e[o],t),i<0)s=o+1;else{if(!(i>0))return o;a=o-1}return~(a+1)}function pt(e,t,n,r,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=o}function ht(e,t,n,r,o,i,s,a){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=o,this.second=i,this.millisecond=s,this.isLeapSecond=a}function mt(e){if(null===e||isNaN(e))throw new n.DeveloperError("year is required and must be a number.");return e%4===0&&e%100!==0||e%400===0}function gt(e,t){this.julianDate=e,this.offset=t}ut[7]=at/136,ct[7]=8*at/17,Fe.fastSlerp=function(e,t,r,o){n.Check.typeOf.object("start",e),n.Check.typeOf.object("end",t),n.Check.typeOf.number("t",r),n.Check.typeOf.object("result",o);let i,s=Fe.dot(e,t);s>=0?i=1:(i=-1,s=-s);const a=s-1,u=1-r,c=r*r,l=u*u;for(let n=7;n>=0;--n)lt[n]=(ut[n]*c-ct[n])*a,dt[n]=(ut[n]*l-ct[n])*a;const d=i*r*(1+lt[0]*(1+lt[1]*(1+lt[2]*(1+lt[3]*(1+lt[4]*(1+lt[5]*(1+lt[6]*(1+lt[7])))))))),f=u*(1+dt[0]*(1+dt[1]*(1+dt[2]*(1+dt[3]*(1+dt[4]*(1+dt[5]*(1+dt[6]*(1+dt[7])))))))),p=Fe.multiplyByScalar(e,f,st);return Fe.multiplyByScalar(t,d,o),Fe.add(p,o,o)},Fe.fastSquad=function(e,t,r,o,i,s){n.Check.typeOf.object("q0",e),n.Check.typeOf.object("q1",t),n.Check.typeOf.object("s0",r),n.Check.typeOf.object("s1",o),n.Check.typeOf.number("t",i),n.Check.typeOf.object("result",s);const a=Fe.fastSlerp(e,t,i,ot),u=Fe.fastSlerp(r,o,i,it);return Fe.fastSlerp(a,u,2*i*(1-i),s)},Fe.equals=function(e,t){return e===t||r.defined(e)&&r.defined(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},Fe.equalsEpsilon=function(e,t,n){return n=r.defaultValue(n,0),e===t||r.defined(e)&&r.defined(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},Fe.ZERO=Object.freeze(new Fe(0,0,0,0)),Fe.IDENTITY=Object.freeze(new Fe(0,0,0,1)),Fe.prototype.clone=function(e){return Fe.clone(this,e)},Fe.prototype.equals=function(e){return Fe.equals(this,e)},Fe.prototype.equalsEpsilon=function(e,t){return Fe.equalsEpsilon(this,e,t)},Fe.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};const yt={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};var vt=Object.freeze(yt);const wt={UTC:0,TAI:1};var Ct=Object.freeze(wt);const bt=new ht,_t=[31,28,31,30,31,30,31,31,30,31,30,31],xt=29;function Et(e,t){return Nt.compare(e.julianDate,t.julianDate)}const Ot=new gt;function St(e){Ot.julianDate=e;const t=Nt.leapSeconds;let n=ft(t,Ot,Et);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let r=t[n].offset;if(n>0){const o=Nt.secondsDifference(t[n].julianDate,e);o>r&&(n--,r=t[n].offset)}Nt.addSeconds(e,r,e)}function At(e,t){Ot.julianDate=e;const n=Nt.leapSeconds;let r=ft(n,Ot,Et);if(r<0&&(r=~r),0===r)return Nt.addSeconds(e,-n[0].offset,t);if(r>=n.length)return Nt.addSeconds(e,-n[r-1].offset,t);const o=Nt.secondsDifference(n[r].julianDate,e);return 0===o?Nt.addSeconds(e,-n[r].offset,t):o<=1?void 0:Nt.addSeconds(e,-n[--r].offset,t)}function qt(e,t,n){const r=t/vt.SECONDS_PER_DAY|0;return e+=r,t-=vt.SECONDS_PER_DAY*r,t<0&&(e--,t+=vt.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function kt(e,t,n,r,o,i,s){const a=(t-14)/12|0,u=e+4800+a;let c=(1461*u/4|0)+(367*(t-2-12*a)/12|0)-(3*((u+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);const l=i+(r*vt.SECONDS_PER_HOUR+o*vt.SECONDS_PER_MINUTE+s*vt.SECONDS_PER_MILLISECOND);return l>=43200&&(c-=1),[c,l]}const Dt=/^(\d{4})$/,It=/^(\d{4})-(\d{2})$/,Pt=/^(\d{4})-?(\d{3})$/,Rt=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,Tt=/^(\d{4})-?(\d{2})-?(\d{2})$/,zt=/([Z+\-])?(\d{2})?:?(\d{2})?$/,Mt=/^(\d{2})(\.\d+)?/.source+zt.source,Ut=/^(\d{2}):?(\d{2})(\.\d+)?/.source+zt.source,jt=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+zt.source,Ft="Invalid ISO 8601 date.";function Nt(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=r.defaultValue(e,0),t=r.defaultValue(t,0),n=r.defaultValue(n,Ct.UTC);const o=0|e;t+=(e-o)*vt.SECONDS_PER_DAY,qt(o,t,this),n===Ct.UTC&&St(this)}Nt.fromGregorianDate=function(e,t){if(!(e instanceof ht))throw new n.DeveloperError("date must be a valid GregorianDate.");const o=kt(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return r.defined(t)?(qt(o[0],o[1],t),St(t),t):new Nt(o[0],o[1],Ct.UTC)},Nt.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new n.DeveloperError("date must be a valid JavaScript Date.");const o=kt(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r.defined(t)?(qt(o[0],o[1],t),St(t),t):new Nt(o[0],o[1],Ct.UTC)},Nt.fromIso8601=function(e,t){if("string"!==typeof e)throw new n.DeveloperError(Ft);e=e.replace(",",".");let o,i=e.split("T"),s=1,a=1,u=0,c=0,l=0,d=0;const f=i[0],p=i[1];let h,m,g,y;if(!r.defined(f))throw new n.DeveloperError(Ft);if(i=f.match(Tt),null!==i){if(g=f.split("-").length-1,g>0&&2!==g)throw new n.DeveloperError(Ft);o=+i[1],s=+i[2],a=+i[3]}else if(i=f.match(It),null!==i)o=+i[1],s=+i[2];else if(i=f.match(Dt),null!==i)o=+i[1];else{let e;if(i=f.match(Pt),null!==i){if(o=+i[1],e=+i[2],m=mt(o),e<1||m&&e>366||!m&&e>365)throw new n.DeveloperError(Ft)}else{if(i=f.match(Rt),null===i)throw new n.DeveloperError(Ft);{o=+i[1];const t=+i[2],s=+i[3]||0;if(g=f.split("-").length-1,g>0&&(!r.defined(i[3])&&1!==g||r.defined(i[3])&&2!==g))throw new n.DeveloperError(Ft);const a=new Date(Date.UTC(o,0,4));e=7*t+s-a.getUTCDay()-3}}h=new Date(Date.UTC(o,0,1)),h.setUTCDate(e),s=h.getUTCMonth()+1,a=h.getUTCDate()}if(m=mt(o),s<1||s>12||a<1||(2!==s||!m)&&a>_t[s-1]||m&&2===s&&a>xt)throw new n.DeveloperError(Ft);if(r.defined(p)){if(i=p.match(jt),null!==i){if(g=p.split(":").length-1,g>0&&2!==g&&3!==g)throw new n.DeveloperError(Ft);u=+i[1],c=+i[2],l=+i[3],d=1e3*+(i[4]||0),y=5}else if(i=p.match(Ut),null!==i){if(g=p.split(":").length-1,g>2)throw new n.DeveloperError(Ft);u=+i[1],c=+i[2],l=60*+(i[3]||0),y=4}else{if(i=p.match(Mt),null===i)throw new n.DeveloperError(Ft);u=+i[1],c=60*+(i[2]||0),y=3}if(c>=60||l>=61||u>24||24===u&&(c>0||l>0||d>0))throw new n.DeveloperError(Ft);const e=i[y],t=+i[y+1],r=+(i[y+2]||0);switch(e){case"+":u-=t,c-=r;break;case"-":u+=t,c+=r;break;case"Z":break;default:c+=new Date(Date.UTC(o,s-1,a,u,c)).getTimezoneOffset();break}}const v=60===l;v&&l--;while(c>=60)c-=60,u++;while(u>=24)u-=24,a++;h=m&&2===s?xt:_t[s-1];while(a>h)a-=h,s++,s>12&&(s-=12,o++),h=m&&2===s?xt:_t[s-1];while(c<0)c+=60,u--;while(u<0)u+=24,a--;while(a<1)s--,s<1&&(s+=12,o--),h=m&&2===s?xt:_t[s-1],a+=h;const w=kt(o,s,a,u,c,l,d);return r.defined(t)?(qt(w[0],w[1],t),St(t)):t=new Nt(w[0],w[1],Ct.UTC),v&&Nt.addSeconds(t,1,t),t},Nt.now=function(e){return Nt.fromDate(new Date,e)};const Bt=new Nt(0,0,Ct.TAI);Nt.toGregorianDate=function(e,t){if(!r.defined(e))throw new n.DeveloperError("julianDate is required.");let o=!1,i=At(e,Bt);r.defined(i)||(Nt.addSeconds(e,-1,Bt),i=At(Bt,Bt),o=!0);let s=i.dayNumber;const a=i.secondsOfDay;a>=43200&&(s+=1);let u=s+68569|0;const c=4*u/146097|0;u=u-((146097*c+3)/4|0)|0;const l=4e3*(u+1)/1461001|0;u=u-(1461*l/4|0)+31|0;const d=80*u/2447|0,f=u-(2447*d/80|0)|0;u=d/11|0;const p=d+2-12*u|0,h=100*(c-49)+l+u|0;let m=a/vt.SECONDS_PER_HOUR|0,g=a-m*vt.SECONDS_PER_HOUR;const y=g/vt.SECONDS_PER_MINUTE|0;g-=y*vt.SECONDS_PER_MINUTE;let v=0|g;const w=(g-v)/vt.SECONDS_PER_MILLISECOND;return m+=12,m>23&&(m-=24),o&&(v+=1),r.defined(t)?(t.year=h,t.month=p,t.day=f,t.hour=m,t.minute=y,t.second=v,t.millisecond=w,t.isLeapSecond=o,t):new ht(h,p,f,m,y,v,w,o)},Nt.toDate=function(e){if(!r.defined(e))throw new n.DeveloperError("julianDate is required.");const t=Nt.toGregorianDate(e,bt);let o=t.second;return t.isLeapSecond&&(o-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,o,t.millisecond))},Nt.toIso8601=function(e,t){if(!r.defined(e))throw new n.DeveloperError("julianDate is required.");const o=Nt.toGregorianDate(e,bt);let i=o.year,s=o.month,a=o.day,u=o.hour;const c=o.minute,l=o.second,d=o.millisecond;let f;return 1e4===i&&1===s&&1===a&&0===u&&0===c&&0===l&&0===d&&(i=9999,s=12,a=31,u=24),r.defined(t)||0===d?r.defined(t)&&0!==t?(f=(.01*d).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${s.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}T${u.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}.${f}Z`):`${i.toString().padStart(4,"0")}-${s.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}T${u.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}Z`:(f=(.01*d).toString().replace(".",""),`${i.toString().padStart(4,"0")}-${s.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}T${u.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}.${f}Z`)},Nt.clone=function(e,t){if(r.defined(e))return r.defined(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new Nt(e.dayNumber,e.secondsOfDay,Ct.TAI)},Nt.compare=function(e,t){if(!r.defined(e))throw new n.DeveloperError("left is required.");if(!r.defined(t))throw new n.DeveloperError("right is required.");const o=e.dayNumber-t.dayNumber;return 0!==o?o:e.secondsOfDay-t.secondsOfDay},Nt.equals=function(e,t){return e===t||r.defined(e)&&r.defined(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},Nt.equalsEpsilon=function(e,t,n){return n=r.defaultValue(n,0),e===t||r.defined(e)&&r.defined(t)&&Math.abs(Nt.secondsDifference(e,t))<=n},Nt.totalDays=function(e){if(!r.defined(e))throw new n.DeveloperError("julianDate is required.");return e.dayNumber+e.secondsOfDay/vt.SECONDS_PER_DAY},Nt.secondsDifference=function(e,t){if(!r.defined(e))throw new n.DeveloperError("left is required.");if(!r.defined(t))throw new n.DeveloperError("right is required.");const o=(e.dayNumber-t.dayNumber)*vt.SECONDS_PER_DAY;return o+(e.secondsOfDay-t.secondsOfDay)},Nt.daysDifference=function(e,t){if(!r.defined(e))throw new n.DeveloperError("left is required.");if(!r.defined(t))throw new n.DeveloperError("right is required.");const o=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/vt.SECONDS_PER_DAY;return o+i},Nt.computeTaiMinusUtc=function(e){Ot.julianDate=e;const t=Nt.leapSeconds;let n=ft(t,Ot,Et);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset},Nt.addSeconds=function(e,t,o){if(!r.defined(e))throw new n.DeveloperError("julianDate is required.");if(!r.defined(t))throw new n.DeveloperError("seconds is required.");if(!r.defined(o))throw new n.DeveloperError("result is required.");return qt(e.dayNumber,e.secondsOfDay+t,o)},Nt.addMinutes=function(e,t,o){if(!r.defined(e))throw new n.DeveloperError("julianDate is required.");if(!r.defined(t))throw new n.DeveloperError("minutes is required.");if(!r.defined(o))throw new n.DeveloperError("result is required.");const i=e.secondsOfDay+t*vt.SECONDS_PER_MINUTE;return qt(e.dayNumber,i,o)},Nt.addHours=function(e,t,o){if(!r.defined(e))throw new n.DeveloperError("julianDate is required.");if(!r.defined(t))throw new n.DeveloperError("hours is required.");if(!r.defined(o))throw new n.DeveloperError("result is required.");const i=e.secondsOfDay+t*vt.SECONDS_PER_HOUR;return qt(e.dayNumber,i,o)},Nt.addDays=function(e,t,o){if(!r.defined(e))throw new n.DeveloperError("julianDate is required.");if(!r.defined(t))throw new n.DeveloperError("days is required.");if(!r.defined(o))throw new n.DeveloperError("result is required.");const i=e.dayNumber+t;return qt(i,e.secondsOfDay,o)},Nt.lessThan=function(e,t){return Nt.compare(e,t)<0},Nt.lessThanOrEquals=function(e,t){return Nt.compare(e,t)<=0},Nt.greaterThan=function(e,t){return Nt.compare(e,t)>0},Nt.greaterThanOrEquals=function(e,t){return Nt.compare(e,t)>=0},Nt.prototype.clone=function(e){return Nt.clone(this,e)},Nt.prototype.equals=function(e){return Nt.equals(this,e)},Nt.prototype.equalsEpsilon=function(e,t){return Nt.equalsEpsilon(this,e,t)},Nt.prototype.toString=function(){return Nt.toIso8601(this)},Nt.leapSeconds=[new gt(new Nt(2441317,43210,Ct.TAI),10),new gt(new Nt(2441499,43211,Ct.TAI),11),new gt(new Nt(2441683,43212,Ct.TAI),12),new gt(new Nt(2442048,43213,Ct.TAI),13),new gt(new Nt(2442413,43214,Ct.TAI),14),new gt(new Nt(2442778,43215,Ct.TAI),15),new gt(new Nt(2443144,43216,Ct.TAI),16),new gt(new Nt(2443509,43217,Ct.TAI),17),new gt(new Nt(2443874,43218,Ct.TAI),18),new gt(new Nt(2444239,43219,Ct.TAI),19),new gt(new Nt(2444786,43220,Ct.TAI),20),new gt(new Nt(2445151,43221,Ct.TAI),21),new gt(new Nt(2445516,43222,Ct.TAI),22),new gt(new Nt(2446247,43223,Ct.TAI),23),new gt(new Nt(2447161,43224,Ct.TAI),24),new gt(new Nt(2447892,43225,Ct.TAI),25),new gt(new Nt(2448257,43226,Ct.TAI),26),new gt(new Nt(2448804,43227,Ct.TAI),27),new gt(new Nt(2449169,43228,Ct.TAI),28),new gt(new Nt(2449534,43229,Ct.TAI),29),new gt(new Nt(2450083,43230,Ct.TAI),30),new gt(new Nt(2450630,43231,Ct.TAI),31),new gt(new Nt(2451179,43232,Ct.TAI),32),new gt(new Nt(2453736,43233,Ct.TAI),33),new gt(new Nt(2454832,43234,Ct.TAI),34),new gt(new Nt(2456109,43235,Ct.TAI),35),new gt(new Nt(2457204,43236,Ct.TAI),36),new gt(new Nt(2457754,43237,Ct.TAI),37)];var Vt=i.createCommonjsModule((function(e,t){(function(n){var r=t&&!t.nodeType&&t,o=e&&!e.nodeType&&e,s="object"==typeof i.commonjsGlobal&&i.commonjsGlobal;s.global!==s&&s.window!==s&&s.self!==s||(n=s);var a,u,c=2147483647,l=36,d=1,f=26,p=38,h=700,m=72,g=128,y="-",v=/^xn--/,w=/[^\x20-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},_=l-d,x=Math.floor,E=String.fromCharCode;function O(e){throw new RangeError(b[e])}function S(e,t){var n=e.length,r=[];while(n--)r[n]=t(e[n]);return r}function A(e,t){var n=e.split("@"),r="";n.length>1&&(r=n[0]+"@",e=n[1]),e=e.replace(C,".");var o=e.split("."),i=S(o,t).join(".");return r+i}function q(e){var t,n,r=[],o=0,i=e.length;while(o<i)t=e.charCodeAt(o++),t>=55296&&t<=56319&&o<i?(n=e.charCodeAt(o++),56320==(64512&n)?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--)):r.push(t);return r}function k(e){return S(e,(function(e){var t="";return e>65535&&(e-=65536,t+=E(e>>>10&1023|55296),e=56320|1023&e),t+=E(e),t})).join("")}function D(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:l}function I(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function P(e,t,n){var r=0;for(e=n?x(e/h):e>>1,e+=x(e/t);e>_*f>>1;r+=l)e=x(e/_);return x(r+(_+1)*e/(e+p))}function R(e){var t,n,r,o,i,s,a,u,p,h,v=[],w=e.length,C=0,b=g,_=m;for(n=e.lastIndexOf(y),n<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&O("not-basic"),v.push(e.charCodeAt(r));for(o=n>0?n+1:0;o<w;){for(i=C,s=1,a=l;;a+=l){if(o>=w&&O("invalid-input"),u=D(e.charCodeAt(o++)),(u>=l||u>x((c-C)/s))&&O("overflow"),C+=u*s,p=a<=_?d:a>=_+f?f:a-_,u<p)break;h=l-p,s>x(c/h)&&O("overflow"),s*=h}t=v.length+1,_=P(C-i,t,0==i),x(C/t)>c-b&&O("overflow"),b+=x(C/t),C%=t,v.splice(C++,0,b)}return k(v)}function T(e){var t,n,r,o,i,s,a,u,p,h,v,w,C,b,_,S=[];for(e=q(e),w=e.length,t=g,n=0,i=m,s=0;s<w;++s)v=e[s],v<128&&S.push(E(v));r=o=S.length,o&&S.push(y);while(r<w){for(a=c,s=0;s<w;++s)v=e[s],v>=t&&v<a&&(a=v);for(C=r+1,a-t>x((c-n)/C)&&O("overflow"),n+=(a-t)*C,t=a,s=0;s<w;++s)if(v=e[s],v<t&&++n>c&&O("overflow"),v==t){for(u=n,p=l;;p+=l){if(h=p<=i?d:p>=i+f?f:p-i,u<h)break;_=u-h,b=l-h,S.push(E(I(h+_%b,0))),u=x(_/b)}S.push(E(I(u,0))),i=P(n,C,r==o),n=0,++r}++n,++t}return S.join("")}function z(e){return A(e,(function(e){return v.test(e)?R(e.slice(4).toLowerCase()):e}))}function M(e){return A(e,(function(e){return w.test(e)?"xn--"+T(e):e}))}if(a={version:"1.3.2",ucs2:{decode:q,encode:k},decode:R,encode:T,toASCII:M,toUnicode:z},r&&o)if(e.exports==r)o.exports=a;else for(u in a)a.hasOwnProperty(u)&&(r[u]=a[u]);else n.punycode=a})(i.commonjsGlobal)})),Lt=i.createCommonjsModule((function(e){
/*!
* URI.js - Mutating URLs
* IPv6 Support
*
* Version: 1.19.11
*
* Author: Rodney Rehm
* Web: http://medialize.github.io/URI.js/
*
* Licensed under
* MIT License http://www.opensource.org/licenses/mit-license
*
*/
(function(t,n){e.exports?e.exports=n():t.IPv6=n(t)})(i.commonjsGlobal,(function(e){var t=e&&e.IPv6;function n(e){var t,n,r=e.toLowerCase(),o=r.split(":"),i=o.length,s=8;for(""===o[0]&&""===o[1]&&""===o[2]?(o.shift(),o.shift()):""===o[0]&&""===o[1]?o.shift():""===o[i-1]&&""===o[i-2]&&o.pop(),i=o.length,-1!==o[i-1].indexOf(".")&&(s=7),t=0;t<i;t++)if(""===o[t])break;if(t<s){o.splice(t,1,"0000");while(o.length<s)o.splice(t,0,"0000")}for(var a=0;a<s;a++){n=o[a].split("");for(var u=0;u<3;u++){if(!("0"===n[0]&&n.length>1))break;n.splice(0,1)}o[a]=n.join("")}var c=-1,l=0,d=0,f=-1,p=!1;for(a=0;a<s;a++)p?"0"===o[a]?d+=1:(p=!1,d>l&&(c=f,l=d)):"0"===o[a]&&(p=!0,f=a,d=1);d>l&&(c=f,l=d),l>1&&o.splice(c,l,""),i=o.length;var h="";for(""===o[0]&&(h=":"),a=0;a<i;a++){if(h+=o[a],a===i-1)break;h+=":"}return""===o[i-1]&&(h+=":"),h}function r(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:r}}))})),Qt=i.createCommonjsModule((function(e){
/*!
* URI.js - Mutating URLs
* Second Level Domain (SLD) Support
*
* Version: 1.19.11
*
* Author: Rodney Rehm
* Web: http://medialize.github.io/URI.js/
*
* Licensed under
* MIT License http://www.opensource.org/licenses/mit-license
*
*/
(function(t,n){e.exports?e.exports=n():t.SecondLevelDomains=n(t)})(i.commonjsGlobal,(function(e){var t=e&&e.SecondLevelDomains,n={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;var r=e.lastIndexOf(".",t-1);if(r<=0||r>=t-1)return!1;var o=n.list[e.slice(t+1)];return!!o&&o.indexOf(" "+e.slice(r+1,t)+" ")>=0},is:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;var r=e.lastIndexOf(".",t-1);if(r>=0)return!1;var o=n.list[e.slice(t+1)];return!!o&&o.indexOf(" "+e.slice(0,t)+" ")>=0},get:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return null;var r=e.lastIndexOf(".",t-1);if(r<=0||r>=t-1)return null;var o=n.list[e.slice(t+1)];return o?o.indexOf(" "+e.slice(r+1,t)+" ")<0?null:e.slice(r+1):null},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n}))})),$t=i.createCommonjsModule((function(e){
/*!
* URI.js - Mutating URLs
*
* Version: 1.19.11
*
* Author: Rodney Rehm
* Web: http://medialize.github.io/URI.js/
*
* Licensed under
* MIT License http://www.opensource.org/licenses/mit-license
*
*/
(function(t,n){e.exports?e.exports=n(Vt,Lt,Qt):t.URI=n(t.punycode,t.IPv6,t.SecondLevelDomains,t)})(i.commonjsGlobal,(function(e,t,n,r){var o=r&&r.URI;function i(e,t){var n=arguments.length>=1,r=arguments.length>=2;if(!(this instanceof i))return n?r?new i(e,t):new i(e):new i;if(void 0===e){if(n)throw new TypeError("undefined is not a valid argument for URI");e="undefined"!==typeof location?location.href+"":""}if(null===e&&n)throw new TypeError("null is not a valid argument for URI");return this.href(e),void 0!==t?this.absoluteTo(t):this}function s(e){return/^[0-9]+$/.test(e)}i.version="1.19.11";var a=i.prototype,u=Object.prototype.hasOwnProperty;function c(e){return e.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function l(e){return void 0===e?"Undefined":String(Object.prototype.toString.call(e)).slice(8,-1)}function d(e){return"Array"===l(e)}function f(e,t){var n,r,o={};if("RegExp"===l(t))o=null;else if(d(t))for(n=0,r=t.length;n<r;n++)o[t[n]]=!0;else o[t]=!0;for(n=0,r=e.length;n<r;n++){var i=o&&void 0!==o[e[n]]||!o&&t.test(e[n]);i&&(e.splice(n,1),r--,n--)}return e}function p(e,t){var n,r;if(d(t)){for(n=0,r=t.length;n<r;n++)if(!p(e,t[n]))return!1;return!0}var o=l(t);for(n=0,r=e.length;n<r;n++)if("RegExp"===o){if("string"===typeof e[n]&&e[n].match(t))return!0}else if(e[n]===t)return!0;return!1}function h(e,t){if(!d(e)||!d(t))return!1;if(e.length!==t.length)return!1;e.sort(),t.sort();for(var n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function m(e){var t=/^\/+|\/+$/g;return e.replace(t,"")}function g(e){return escape(e)}function y(e){return encodeURIComponent(e).replace(/[!'()*]/g,g).replace(/\*/g,"%2A")}i._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:i.preventInvalidHostname,duplicateQueryParameters:i.duplicateQueryParameters,escapeQuerySpace:i.escapeQuerySpace}},i.preventInvalidHostname=!1,i.duplicateQueryParameters=!1,i.escapeQuerySpace=!0,i.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,i.idn_expression=/[^a-z0-9\._-]/i,i.punycode_expression=/(xn--)/i,i.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,i.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,i.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi,i.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},i.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,i.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,i.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},i.hostProtocols=["http","https"],i.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,i.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},i.getDomAttribute=function(e){if(e&&e.nodeName){var t=e.nodeName.toLowerCase();if("input"!==t||"image"===e.type)return i.domAttributes[t]}},i.encode=y,i.decode=decodeURIComponent,i.iso8859=function(){i.encode=escape,i.decode=unescape},i.unicode=function(){i.encode=y,i.decode=decodeURIComponent},i.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},i.encodeQuery=function(e,t){var n=i.encode(e+"");return void 0===t&&(t=i.escapeQuerySpace),t?n.replace(/%20/g,"+"):n},i.decodeQuery=function(e,t){e+="",void 0===t&&(t=i.escapeQuerySpace);try{return i.decode(t?e.replace(/\+/g,"%20"):e)}catch(n){return e}};var v,w={encode:"encode",decode:"decode"},C=function(e,t){return function(n){try{return i[t](n+"").replace(i.characters[e][t].expression,(function(n){return i.characters[e][t].map[n]}))}catch(r){return n}}};for(v in w)i[v+"PathSegment"]=C("pathname",w[v]),i[v+"UrnPathSegment"]=C("urnpath",w[v]);var b=function(e,t,n){return function(r){var o;o=n?function(e){return i[t](i[n](e))}:i[t];for(var s=(r+"").split(e),a=0,u=s.length;a<u;a++)s[a]=o(s[a]);return s.join(e)}};function _(e){return function(t,n){return void 0===t?this._parts[e]||"":(this._parts[e]=t||null,this.build(!n),this)}}function x(e,t){return function(n,r){return void 0===n?this._parts[e]||"":(null!==n&&(n+="",n.charAt(0)===t&&(n=n.substring(1))),this._parts[e]=n,this.build(!r),this)}}i.decodePath=b("/","decodePathSegment"),i.decodeUrnPath=b(":","decodeUrnPathSegment"),i.recodePath=b("/","encodePathSegment","decode"),i.recodeUrnPath=b(":","encodeUrnPathSegment","decode"),i.encodeReserved=C("reserved","encode"),i.parse=function(e,t){var n;return t||(t={preventInvalidHostname:i.preventInvalidHostname}),e=e.replace(i.leading_whitespace_expression,""),e=e.replace(i.ascii_tab_whitespace,""),n=e.indexOf("#"),n>-1&&(t.fragment=e.substring(n+1)||null,e=e.substring(0,n)),n=e.indexOf("?"),n>-1&&(t.query=e.substring(n+1)||null,e=e.substring(0,n)),e=e.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),e=e.replace(/^[/\\]{2,}/i,"//"),"//"===e.substring(0,2)?(t.protocol=null,e=e.substring(2),e=i.parseAuthority(e,t)):(n=e.indexOf(":"),n>-1&&(t.protocol=e.substring(0,n)||null,t.protocol&&!t.protocol.match(i.protocol_expression)?t.protocol=void 0:"//"===e.substring(n+1,n+3).replace(/\\/g,"/")?(e=e.substring(n+3),e=i.parseAuthority(e,t)):(e=e.substring(n+1),t.urn=!0))),t.path=e,t},i.parseHost=function(e,t){e||(e=""),e=e.replace(/\\/g,"/");var n,r,o=e.indexOf("/");if(-1===o&&(o=e.length),"["===e.charAt(0))n=e.indexOf("]"),t.hostname=e.substring(1,n)||null,t.port=e.substring(n+2,o)||null,"/"===t.port&&(t.port=null);else{var s=e.indexOf(":"),a=e.indexOf("/"),u=e.indexOf(":",s+1);-1!==u&&(-1===a||u<a)?(t.hostname=e.substring(0,o)||null,t.port=null):(r=e.substring(0,o).split(":"),t.hostname=r[0]||null,t.port=r[1]||null)}return t.hostname&&"/"!==e.substring(o).charAt(0)&&(o++,e="/"+e),t.preventInvalidHostname&&i.ensureValidHostname(t.hostname,t.protocol),t.port&&i.ensureValidPort(t.port),e.substring(o)||"/"},i.parseAuthority=function(e,t){return e=i.parseUserinfo(e,t),i.parseHost(e,t)},i.parseUserinfo=function(e,t){var n=e,r=e.indexOf("\\");-1!==r&&(e=e.replace(/\\/g,"/"));var o,s=e.indexOf("/"),a=e.lastIndexOf("@",s>-1?s:e.length-1);return a>-1&&(-1===s||a<s)?(o=e.substring(0,a).split(":"),t.username=o[0]?i.decode(o[0]):null,o.shift(),t.password=o[0]?i.decode(o.join(":")):null,e=n.substring(a+1)):(t.username=null,t.password=null),e},i.parseQuery=function(e,t){if(!e)return{};if(e=e.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!e)return{};for(var n,r,o,s={},a=e.split("&"),c=a.length,l=0;l<c;l++)n=a[l].split("="),r=i.decodeQuery(n.shift(),t),o=n.length?i.decodeQuery(n.join("="),t):null,"__proto__"!==r&&(u.call(s,r)?("string"!==typeof s[r]&&null!==s[r]||(s[r]=[s[r]]),s[r].push(o)):s[r]=o);return s},i.build=function(e){var t="",n=!1;return e.protocol&&(t+=e.protocol+":"),e.urn||!t&&!e.hostname||(t+="//",n=!0),t+=i.buildAuthority(e)||"","string"===typeof e.path&&("/"!==e.path.charAt(0)&&n&&(t+="/"),t+=e.path),"string"===typeof e.query&&e.query&&(t+="?"+e.query),"string"===typeof e.fragment&&e.fragment&&(t+="#"+e.fragment),t},i.buildHost=function(e){var t="";return e.hostname?(i.ip6_expression.test(e.hostname)?t+="["+e.hostname+"]":t+=e.hostname,e.port&&(t+=":"+e.port),t):""},i.buildAuthority=function(e){return i.buildUserinfo(e)+i.buildHost(e)},i.buildUserinfo=function(e){var t="";return e.username&&(t+=i.encode(e.username)),e.password&&(t+=":"+i.encode(e.password)),t&&(t+="@"),t},i.buildQuery=function(e,t,n){var r,o,s,a,c="";for(o in e)if("__proto__"!==o&&u.call(e,o))if(d(e[o]))for(r={},s=0,a=e[o].length;s<a;s++)void 0!==e[o][s]&&void 0===r[e[o][s]+""]&&(c+="&"+i.buildQueryParameter(o,e[o][s],n),!0!==t&&(r[e[o][s]+""]=!0));else void 0!==e[o]&&(c+="&"+i.buildQueryParameter(o,e[o],n));return c.substring(1)},i.buildQueryParameter=function(e,t,n){return i.encodeQuery(e,n)+(null!==t?"="+i.encodeQuery(t,n):"")},i.addQuery=function(e,t,n){if("object"===typeof t)for(var r in t)u.call(t,r)&&i.addQuery(e,r,t[r]);else{if("string"!==typeof t)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");if(void 0===e[t])return void(e[t]=n);"string"===typeof e[t]&&(e[t]=[e[t]]),d(n)||(n=[n]),e[t]=(e[t]||[]).concat(n)}},i.setQuery=function(e,t,n){if("object"===typeof t)for(var r in t)u.call(t,r)&&i.setQuery(e,r,t[r]);else{if("string"!==typeof t)throw new TypeError("URI.setQuery() accepts an object, string as the name parameter");e[t]=void 0===n?null:n}},i.removeQuery=function(e,t,n){var r,o,s;if(d(t))for(r=0,o=t.length;r<o;r++)e[t[r]]=void 0;else if("RegExp"===l(t))for(s in e)t.test(s)&&(e[s]=void 0);else if("object"===typeof t)for(s in t)u.call(t,s)&&i.removeQuery(e,s,t[s]);else{if("string"!==typeof t)throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");void 0!==n?"RegExp"===l(n)?!d(e[t])&&n.test(e[t])?e[t]=void 0:e[t]=f(e[t],n):e[t]!==String(n)||d(n)&&1!==n.length?d(e[t])&&(e[t]=f(e[t],n)):e[t]=void 0:e[t]=void 0}},i.hasQuery=function(e,t,n,r){switch(l(t)){case"String":break;case"RegExp":for(var o in e)if(u.call(e,o)&&t.test(o)&&(void 0===n||i.hasQuery(e,o,n)))return!0;return!1;case"Object":for(var s in t)if(u.call(t,s)&&!i.hasQuery(e,s,t[s]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(l(n)){case"Undefined":return t in e;case"Boolean":var a=Boolean(d(e[t])?e[t].length:e[t]);return n===a;case"Function":return!!n(e[t],t,e);case"Array":if(!d(e[t]))return!1;var c=r?p:h;return c(e[t],n);case"RegExp":return d(e[t])?!!r&&p(e[t],n):Boolean(e[t]&&e[t].match(n));case"Number":n=String(n);case"String":return d(e[t])?!!r&&p(e[t],n):e[t]===n;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},i.joinPaths=function(){for(var e=[],t=[],n=0,r=0;r<arguments.length;r++){var o=new i(arguments[r]);e.push(o);for(var s=o.segment(),a=0;a<s.length;a++)"string"===typeof s[a]&&t.push(s[a]),s[a]&&n++}if(!t.length||!n)return new i("");var u=new i("").segment(t);return""!==e[0].path()&&"/"!==e[0].path().slice(0,1)||u.path("/"+u.path()),u.normalize()},i.commonPath=function(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n<r;n++)if(e.charAt(n)!==t.charAt(n)){n--;break}return n<1?e.charAt(0)===t.charAt(0)&&"/"===e.charAt(0)?"/":"":("/"===e.charAt(n)&&"/"===t.charAt(n)||(n=e.substring(0,n).lastIndexOf("/")),e.substring(0,n+1))},i.withinString=function(e,t,n){n||(n={});var r=n.start||i.findUri.start,o=n.end||i.findUri.end,s=n.trim||i.findUri.trim,a=n.parens||i.findUri.parens,u=/[a-z0-9-]=["']?$/i;r.lastIndex=0;while(1){var c=r.exec(e);if(!c)break;var l=c.index;if(n.ignoreHtml){var d=e.slice(Math.max(l-3,0),l);if(d&&u.test(d))continue}var f=l+e.slice(l).search(o),p=e.slice(l,f),h=-1;while(1){var m=a.exec(p);if(!m)break;var g=m.index+m[0].length;h=Math.max(h,g)}if(p=h>-1?p.slice(0,h)+p.slice(h).replace(s,""):p.replace(s,""),!(p.length<=c[0].length)&&(!n.ignore||!n.ignore.test(p))){f=l+p.length;var y=t(p,l,f,e);void 0!==y?(y=String(y),e=e.slice(0,l)+y+e.slice(f),r.lastIndex=l+y.length):r.lastIndex=f}}return r.lastIndex=0,e},i.ensureValidHostname=function(t,n){var r=!!t,o=!!n,s=!1;if(o&&(s=p(i.hostProtocols,n)),s&&!r)throw new TypeError("Hostname cannot be empty, if protocol is "+n);if(t&&t.match(i.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(t).match(i.invalid_hostname_characters))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_]')}},i.ensureValidPort=function(e){if(e){var t=Number(e);if(!(s(t)&&t>0&&t<65536))throw new TypeError('Port "'+e+'" is not a valid port')}},i.noConflict=function(e){if(e){var t={URI:this.noConflict()};return r.URITemplate&&"function"===typeof r.URITemplate.noConflict&&(t.URITemplate=r.URITemplate.noConflict()),r.IPv6&&"function"===typeof r.IPv6.noConflict&&(t.IPv6=r.IPv6.noConflict()),r.SecondLevelDomains&&"function"===typeof r.SecondLevelDomains.noConflict&&(t.SecondLevelDomains=r.SecondLevelDomains.noConflict()),t}return r.URI===this&&(r.URI=o),this},a.build=function(e){return!0===e?this._deferred_build=!0:(void 0===e||this._deferred_build)&&(this._string=i.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new i(this)},a.valueOf=a.toString=function(){return this.build(!1)._string},a.protocol=_("protocol"),a.username=_("username"),a.password=_("password"),a.hostname=_("hostname"),a.port=_("port"),a.query=x("query","?"),a.fragment=x("fragment","#"),a.search=function(e,t){var n=this.query(e,t);return"string"===typeof n&&n.length?"?"+n:n},a.hash=function(e,t){var n=this.fragment(e,t);return"string"===typeof n&&n.length?"#"+n:n},a.pathname=function(e,t){if(void 0===e||!0===e){var n=this._parts.path||(this._parts.hostname?"/":"");return e?(this._parts.urn?i.decodeUrnPath:i.decodePath)(n):n}return this._parts.urn?this._parts.path=e?i.recodeUrnPath(e):"":this._parts.path=e?i.recodePath(e):"/",this.build(!t),this},a.path=a.pathname,a.href=function(e,t){var n;if(void 0===e)return this.toString();this._string="",this._parts=i._parts();var r=e instanceof i,o="object"===typeof e&&(e.hostname||e.path||e.pathname);if(e.nodeName){var s=i.getDomAttribute(e);e=e[s]||"",o=!1}if(!r&&o&&void 0!==e.pathname&&(e=e.toString()),"string"===typeof e||e instanceof String)this._parts=i.parse(String(e),this._parts);else{if(!r&&!o)throw new TypeError("invalid input");var a=r?e._parts:e;for(n in a)"query"!==n&&u.call(this._parts,n)&&(this._parts[n]=a[n]);a.query&&this.query(a.query,!1)}return this.build(!t),this},a.is=function(e){var t=!1,r=!1,o=!1,s=!1,a=!1,u=!1,c=!1,l=!this._parts.urn;switch(this._parts.hostname&&(l=!1,r=i.ip4_expression.test(this._parts.hostname),o=i.ip6_expression.test(this._parts.hostname),t=r||o,s=!t,a=s&&n&&n.has(this._parts.hostname),u=s&&i.idn_expression.test(this._parts.hostname),c=s&&i.punycode_expression.test(this._parts.hostname)),e.toLowerCase()){case"relative":return l;case"absolute":return!l;case"domain":case"name":return s;case"sld":return a;case"ip":return t;case"ip4":case"ipv4":case"inet4":return r;case"ip6":case"ipv6":case"inet6":return o;case"idn":return u;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return c}return null};var E=a.protocol,O=a.port,S=a.hostname;a.protocol=function(e,t){if(e&&(e=e.replace(/:(\/\/)?$/,""),!e.match(i.protocol_expression)))throw new TypeError('Protocol "'+e+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return E.call(this,e,t)},a.scheme=a.protocol,a.port=function(e,t){return this._parts.urn?void 0===e?"":this:(void 0!==e&&(0===e&&(e=null),e&&(e+="",":"===e.charAt(0)&&(e=e.substring(1)),i.ensureValidPort(e))),O.call(this,e,t))},a.hostname=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0!==e){var n={preventInvalidHostname:this._parts.preventInvalidHostname},r=i.parseHost(e,n);if("/"!==r)throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');e=n.hostname,this._parts.preventInvalidHostname&&i.ensureValidHostname(e,this._parts.protocol)}return S.call(this,e,t)},a.origin=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var n=this.protocol(),r=this.authority();return r?(n?n+"://":"")+this.authority():""}var o=i(e);return this.protocol(o.protocol()).authority(o.authority()).build(!t),this},a.host=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?i.buildHost(this._parts):"";var n=i.parseHost(e,this._parts);if("/"!==n)throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},a.authority=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?i.buildAuthority(this._parts):"";var n=i.parseAuthority(e,this._parts);if("/"!==n)throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},a.userinfo=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var n=i.buildUserinfo(this._parts);return n?n.substring(0,n.length-1):n}return"@"!==e[e.length-1]&&(e+="@"),i.parseUserinfo(e,this._parts),this.build(!t),this},a.resource=function(e,t){var n;return void 0===e?this.path()+this.search()+this.hash():(n=i.parse(e),this._parts.path=n.path,this._parts.query=n.query,this._parts.fragment=n.fragment,this.build(!t),this)},a.subdomain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,n)||""}var r=this._parts.hostname.length-this.domain().length,o=this._parts.hostname.substring(0,r),s=new RegExp("^"+c(o));if(e&&"."!==e.charAt(e.length-1)&&(e+="."),-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");return e&&i.ensureValidHostname(e,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(s,e),this.build(!t),this},a.domain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"===typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.match(/\./g);if(n&&n.length<2)return this._parts.hostname;var r=this._parts.hostname.length-this.tld(t).length-1;return r=this._parts.hostname.lastIndexOf(".",r-1)+1,this._parts.hostname.substring(r)||""}if(!e)throw new TypeError("cannot set domain empty");if(-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");if(i.ensureValidHostname(e,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=e;else{var o=new RegExp(c(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(o,e)}return this.build(!t),this},a.tld=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"===typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.lastIndexOf("."),o=this._parts.hostname.substring(r+1);return!0!==t&&n&&n.list[o.toLowerCase()]&&n.get(this._parts.hostname)||o}var i;if(!e)throw new TypeError("cannot set TLD empty");if(e.match(/[^a-zA-Z0-9-]/)){if(!n||!n.is(e))throw new TypeError('TLD "'+e+'" contains characters other than [A-Z0-9]');i=new RegExp(c(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,e)}else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");i=new RegExp(c(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,e)}return this.build(!t),this},a.directory=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var n=this._parts.path.length-this.filename().length-1,r=this._parts.path.substring(0,n)||(this._parts.hostname?"/":"");return e?i.decodePath(r):r}var o=this._parts.path.length-this.filename().length,s=this._parts.path.substring(0,o),a=new RegExp("^"+c(s));return this.is("relative")||(e||(e="/"),"/"!==e.charAt(0)&&(e="/"+e)),e&&"/"!==e.charAt(e.length-1)&&(e+="/"),e=i.recodePath(e),this._parts.path=this._parts.path.replace(a,e),this.build(!t),this},a.filename=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("string"!==typeof e){if(!this._parts.path||"/"===this._parts.path)return"";var n=this._parts.path.lastIndexOf("/"),r=this._parts.path.substring(n+1);return e?i.decodePathSegment(r):r}var o=!1;"/"===e.charAt(0)&&(e=e.substring(1)),e.match(/\.?\//)&&(o=!0);var s=new RegExp(c(this.filename())+"$");return e=i.recodePath(e),this._parts.path=this._parts.path.replace(s,e),o?this.normalizePath(t):this.build(!t),this},a.suffix=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path||"/"===this._parts.path)return"";var n,r,o=this.filename(),s=o.lastIndexOf(".");return-1===s?"":(n=o.substring(s+1),r=/^[a-z0-9%]+$/i.test(n)?n:"",e?i.decodePathSegment(r):r)}"."===e.charAt(0)&&(e=e.substring(1));var a,u=this.suffix();if(u)a=e?new RegExp(c(u)+"$"):new RegExp(c("."+u)+"$");else{if(!e)return this;this._parts.path+="."+i.recodePath(e)}return a&&(e=i.recodePath(e),this._parts.path=this._parts.path.replace(a,e)),this.build(!t),this},a.segment=function(e,t,n){var r=this._parts.urn?":":"/",o=this.path(),i="/"===o.substring(0,1),s=o.split(r);if(void 0!==e&&"number"!==typeof e&&(n=t,t=e,e=void 0),void 0!==e&&"number"!==typeof e)throw new Error('Bad segment "'+e+'", must be 0-based integer');if(i&&s.shift(),e<0&&(e=Math.max(s.length+e,0)),void 0===t)return void 0===e?s:s[e];if(null===e||void 0===s[e])if(d(t)){s=[];for(var a=0,u=t.length;a<u;a++)(t[a].length||s.length&&s[s.length-1].length)&&(s.length&&!s[s.length-1].length&&s.pop(),s.push(m(t[a])))}else(t||"string"===typeof t)&&(t=m(t),""===s[s.length-1]?s[s.length-1]=t:s.push(t));else t?s[e]=m(t):s.splice(e,1);return i&&s.unshift(""),this.path(s.join(r),n)},a.segmentCoded=function(e,t,n){var r,o,s;if("number"!==typeof e&&(n=t,t=e,e=void 0),void 0===t){if(r=this.segment(e,t,n),d(r))for(o=0,s=r.length;o<s;o++)r[o]=i.decode(r[o]);else r=void 0!==r?i.decode(r):void 0;return r}if(d(t))for(o=0,s=t.length;o<s;o++)t[o]=i.encode(t[o]);else t="string"===typeof t||t instanceof String?i.encode(t):t;return this.segment(e,t,n)};var A=a.query;return a.query=function(e,t){if(!0===e)return i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("function"===typeof e){var n=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace),r=e.call(this,n);return this._parts.query=i.buildQuery(r||n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this}return void 0!==e&&"string"!==typeof e?(this._parts.query=i.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this):A.call(this,e,t)},a.setQuery=function(e,t,n){var r=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("string"===typeof e||e instanceof String)r[e]=void 0!==t?t:null;else{if("object"!==typeof e)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");for(var o in e)u.call(e,o)&&(r[o]=e[o])}return this._parts.query=i.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!==typeof e&&(n=t),this.build(!n),this},a.addQuery=function(e,t,n){var r=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return i.addQuery(r,e,void 0===t?null:t),this._parts.query=i.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!==typeof e&&(n=t),this.build(!n),this},a.removeQuery=function(e,t,n){var r=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return i.removeQuery(r,e,t),this._parts.query=i.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!==typeof e&&(n=t),this.build(!n),this},a.hasQuery=function(e,t,n){var r=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return i.hasQuery(r,e,t,n)},a.setSearch=a.setQuery,a.addSearch=a.addQuery,a.removeSearch=a.removeQuery,a.hasSearch=a.hasQuery,a.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},a.normalizeProtocol=function(e){return"string"===typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!e)),this},a.normalizeHostname=function(n){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!n)),this},a.normalizePort=function(e){return"string"===typeof this._parts.protocol&&this._parts.port===i.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!e)),this},a.normalizePath=function(e){var t,n=this._parts.path;if(!n)return this;if(this._parts.urn)return this._parts.path=i.recodeUrnPath(this._parts.path),this.build(!e),this;if("/"===this._parts.path)return this;n=i.recodePath(n);var r,o,s="";"/"!==n.charAt(0)&&(t=!0,n="/"+n),"/.."!==n.slice(-3)&&"/."!==n.slice(-2)||(n+="/"),n=n.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),t&&(s=n.substring(1).match(/^(\.\.\/)+/)||"",s&&(s=s[0]));while(1){if(r=n.search(/\/\.\.(\/|$)/),-1===r)break;0!==r?(o=n.substring(0,r).lastIndexOf("/"),-1===o&&(o=r),n=n.substring(0,o)+n.substring(r+3)):n=n.substring(3)}return t&&this.is("relative")&&(n=s+n.substring(1)),this._parts.path=n,this.build(!e),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(e){return"string"===typeof this._parts.query&&(this._parts.query.length?this.query(i.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!e)),this},a.normalizeFragment=function(e){return this._parts.fragment||(this._parts.fragment=null,this.build(!e)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var e=i.encode,t=i.decode;i.encode=escape,i.decode=decodeURIComponent;try{this.normalize()}finally{i.encode=e,i.decode=t}return this},a.unicode=function(){var e=i.encode,t=i.decode;i.encode=y,i.decode=unescape;try{this.normalize()}finally{i.encode=e,i.decode=t}return this},a.readable=function(){var t=this.clone();t.username("").password("").normalize();var n="";if(t._parts.protocol&&(n+=t._parts.protocol+"://"),t._parts.hostname&&(t.is("punycode")&&e?(n+=e.toUnicode(t._parts.hostname),t._parts.port&&(n+=":"+t._parts.port)):n+=t.host()),t._parts.hostname&&t._parts.path&&"/"!==t._parts.path.charAt(0)&&(n+="/"),n+=t.path(!0),t._parts.query){for(var r="",o=0,s=t._parts.query.split("&"),a=s.length;o<a;o++){var u=(s[o]||"").split("=");r+="&"+i.decodeQuery(u[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),void 0!==u[1]&&(r+="="+i.decodeQuery(u[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}n+="?"+r.substring(1)}return n+=i.decodeQuery(t.hash(),!0),n},a.absoluteTo=function(e){var t,n,r,o=this.clone(),s=["protocol","username","password","hostname","port"];if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(e instanceof i||(e=new i(e)),o._parts.protocol)return o;if(o._parts.protocol=e._parts.protocol,this._parts.hostname)return o;for(n=0;r=s[n];n++)o._parts[r]=e._parts[r];return o._parts.path?(".."===o._parts.path.substring(-2)&&(o._parts.path+="/"),"/"!==o.path().charAt(0)&&(t=e.directory(),t=t||(0===e.path().indexOf("/")?"/":""),o._parts.path=(t?t+"/":"")+o._parts.path,o.normalizePath())):(o._parts.path=e._parts.path,o._parts.query||(o._parts.query=e._parts.query)),o.build(),o},a.relativeTo=function(e){var t,n,r,o,s,a=this.clone().normalize();if(a._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(e=new i(e).normalize(),t=a._parts,n=e._parts,o=a.path(),s=e.path(),"/"!==o.charAt(0))throw new Error("URI is already relative");if("/"!==s.charAt(0))throw new Error("Cannot calculate a URI relative to another relative URI");if(t.protocol===n.protocol&&(t.protocol=null),t.username!==n.username||t.password!==n.password)return a.build();if(null!==t.protocol||null!==t.username||null!==t.password)return a.build();if(t.hostname!==n.hostname||t.port!==n.port)return a.build();if(t.hostname=null,t.port=null,o===s)return t.path="",a.build();if(r=i.commonPath(o,s),!r)return a.build();var u=n.path.substring(r.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return t.path=u+t.path.substring(r.length)||"./",a.build()},a.equals=function(e){var t,n,r,o=this.clone(),s=new i(e),a={},c={},l={};if(o.normalize(),s.normalize(),o.toString()===s.toString())return!0;if(t=o.query(),n=s.query(),o.query(""),s.query(""),o.toString()!==s.toString())return!1;if(t.length!==n.length)return!1;for(r in a=i.parseQuery(t,this._parts.escapeQuerySpace),c=i.parseQuery(n,this._parts.escapeQuerySpace),a)if(u.call(a,r)){if(d(a[r])){if(!h(a[r],c[r]))return!1}else if(a[r]!==c[r])return!1;l[r]=!0}for(r in c)if(u.call(c,r)&&!l[r])return!1;return!0},a.preventInvalidHostname=function(e){return this._parts.preventInvalidHostname=!!e,this},a.duplicateQueryParameters=function(e){return this._parts.duplicateQueryParameters=!!e,this},a.escapeQuerySpace=function(e){return this._parts.escapeQuerySpace=!!e,this},i}))}));function Wt(e){return 0!==e.length&&"/"===e[e.length-1]||(e=`${e}/`),e}function Ht(e,t){if(null===e||"object"!==typeof e)return e;t=r.defaultValue(t,!1);const n=new e.constructor;for(const r in e)if(e.hasOwnProperty(r)){let o=e[r];t&&(o=Ht(o,t)),n[r]=o}return n}function Yt(e,t){let n;return"undefined"!==typeof document&&(n=document),Yt._implementation(e,t,n)}function Zt(e,t){if(!r.defined(e))throw new n.DeveloperError("uri is required.");let o="";const i=e.lastIndexOf("/");return-1!==i&&(o=e.substring(0,i+1)),t?(e=new $t(e),0!==e.query().length&&(o+=`?${e.query()}`),0!==e.fragment().length&&(o+=`#${e.fragment()}`),o):o}function Gt(e){if(!r.defined(e))throw new n.DeveloperError("uri is required.");const t=new $t(e);t.normalize();let o=t.path(),i=o.lastIndexOf("/");return-1!==i&&(o=o.substr(i+1)),i=o.lastIndexOf("."),o=-1===i?"":o.substr(i+1),o}Yt._implementation=function(e,t,o){if(!r.defined(e))throw new n.DeveloperError("relative uri is required.");if(!r.defined(t)){if("undefined"===typeof o)return e;t=r.defaultValue(o.baseURI,o.location.href)}const i=new $t(e);return""!==i.scheme()?i.toString():i.absoluteTo(t).toString()};const Jt={};function Xt(e,t,n){r.defined(t)||(t=e.width),r.defined(n)||(n=e.height);let o=Jt[t];r.defined(o)||(o={},Jt[t]=o);let i=o[n];if(!r.defined(i)){const e=document.createElement("canvas");e.width=t,e.height=n,i=e.getContext("2d"),i.globalCompositeOperation="copy",o[n]=i}return i.drawImage(e,0,0,t,n),i.getImageData(0,0,t,n).data}const Kt=/^blob:/i;function en(e){return n.Check.typeOf.string("uri",e),Kt.test(e)}let tn;function nn(e){r.defined(tn)||(tn=document.createElement("a")),tn.href=window.location.href;const t=tn.host,n=tn.protocol;return tn.href=e,tn.href=tn.href,n!==tn.protocol||t!==tn.host}const rn=/^data:/i;function on(e){return n.Check.typeOf.string("uri",e),rn.test(e)}function sn(e){const t=G(),n=document.createElement("script");n.async=!0,n.src=e;const r=document.getElementsByTagName("head")[0];return n.onload=function(){n.onload=void 0,r.removeChild(n),t.resolve()},n.onerror=function(e){t.reject(e)},r.appendChild(n),t.promise}function an(e){if(!r.defined(e))throw new n.DeveloperError("obj is required.");let t="";for(const n in e)if(e.hasOwnProperty(n)){const r=e[n],o=`${encodeURIComponent(n)}=`;if(Array.isArray(r))for(let e=0,n=r.length;e<n;++e)t+=`${o+encodeURIComponent(r[e])}&`;else t+=`${o+encodeURIComponent(r)}&`}return t=t.slice(0,-1),t}function un(e){if(!r.defined(e))throw new n.DeveloperError("queryString is required.");const t={};if(""===e)return t;const o=e.replace(/\+/g,"%20").split(/[&;]/);for(let n=0,i=o.length;n<i;++n){const e=o[n].split("="),i=decodeURIComponent(e[0]);let s=e[1];s=r.defined(s)?decodeURIComponent(s):"";const a=t[i];"string"===typeof a?t[i]=[a,s]:Array.isArray(a)?a.push(s):t[i]=s}return t}const cn={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5};var ln=Object.freeze(cn);const dn={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3};var fn=Object.freeze(dn);function pn(e){e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT);const t=r.defaultValue(e.throttleByServer,!1),n=r.defaultValue(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=r.defaultValue(e.priority,0),this.throttle=n,this.throttleByServer=t,this.type=r.defaultValue(e.type,fn.OTHER),this.serverKey=void 0,this.state=ln.UNISSUED,this.deferred=void 0,this.cancelled=!1}function hn(e){const t={};if(!e)return t;const n=e.split("\r\n");for(let r=0;r<n.length;++r){const e=n[r],o=e.indexOf(": ");if(o>0){const n=e.substring(0,o),r=e.substring(o+2);t[n]=r}}return t}function mn(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,"string"===typeof this.responseHeaders&&(this.responseHeaders=hn(this.responseHeaders))}function gn(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}function yn(e,t){return t-e}function vn(e){n.Check.typeOf.object("options",e),n.Check.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}function wn(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Cn(e,t){return e.priority-t.priority}pn.prototype.cancel=function(){this.cancelled=!0},pn.prototype.clone=function(e){return r.defined(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=this.RequestState.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new pn(this)},mn.prototype.toString=function(){let e="Request has failed.";return r.defined(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e},Object.defineProperties(gn.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),gn.prototype.addEventListener=function(e,t){n.Check.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(t);const r=this;return function(){r.removeEventListener(e,t)}},gn.prototype.removeEventListener=function(e,t){n.Check.typeOf.func("listener",e);const r=this._listeners,o=this._scopes;let i=-1;for(let n=0;n<r.length;n++)if(r[n]===e&&o[n]===t){i=n;break}return-1!==i&&(this._insideRaiseEvent?(this._toRemove.push(i),r[i]=void 0,o[i]=void 0):(r.splice(i,1),o.splice(i,1)),!0)},gn.prototype.raiseEvent=function(){let e;this._insideRaiseEvent=!0;const t=this._listeners,n=this._scopes;let o=t.length;for(e=0;e<o;e++){const o=t[e];r.defined(o)&&t[e].apply(n[e],arguments)}const i=this._toRemove;if(o=i.length,o>0){for(i.sort(yn),e=0;e<o;e++){const r=i[e];t.splice(r,1),n.splice(r,1)}i.length=0}this._insideRaiseEvent=!1},Object.defineProperties(vn.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){n.Check.typeOf.number.greaterThanOrEquals("maximumLength",e,0);const t=this._length;if(e<t){const n=this._array;for(let r=e;r<t;++r)n[r]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}}),vn.prototype.reserve=function(e){e=r.defaultValue(e,this._length),this._array.length=e},vn.prototype.heapify=function(e){e=r.defaultValue(e,0);const t=this._length,n=this._comparator,o=this._array;let i=-1,s=!0;while(s){const r=2*(e+1),a=r-1;i=a<t&&n(o[a],o[e])<0?a:e,r<t&&n(o[r],o[i])<0&&(i=r),i!==e?(wn(o,i,e),e=i):s=!1}},vn.prototype.resort=function(){const e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)},vn.prototype.insert=function(e){n.Check.defined("element",e);const t=this._array,o=this._comparator,i=this._maximumLength;let s,a=this._length++;a<t.length?t[a]=e:t.push(e);while(0!==a){const e=Math.floor((a-1)/2);if(!(o(t[a],t[e])<0))break;wn(t,a,e),a=e}return r.defined(i)&&this._length>i&&(s=t[i],this._length=i),s},vn.prototype.pop=function(e){if(e=r.defaultValue(e,0),0===this._length)return;n.Check.typeOf.number.lessThan("index",e,this._length);const t=this._array,o=t[e];return wn(t,e,--this._length),this.heapify(e),t[this._length]=void 0,o};const bn={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0};let _n=20;const xn=new vn({comparator:Cn});xn.maximumLength=_n,xn.reserve(_n);const En=[];let On={};const Sn="undefined"!==typeof document?new $t(document.location.href):new $t,An=new gn;function qn(){}function kn(e){r.defined(e.priorityFunction)&&(e.priority=e.priorityFunction())}function Dn(e){return e.state===ln.UNISSUED&&(e.state=ln.ISSUED,e.deferred=G()),e.deferred.promise}function In(e){return function(t){if(e.state===ln.CANCELLED)return;const n=e.deferred;--bn.numberOfActiveRequests,--On[e.serverKey],An.raiseEvent(),e.state=ln.RECEIVED,e.deferred=void 0,n.resolve(t)}}function Pn(e){return function(t){e.state!==ln.CANCELLED&&(++bn.numberOfFailedRequests,--bn.numberOfActiveRequests,--On[e.serverKey],An.raiseEvent(t),e.state=ln.FAILED,e.deferred.reject(t))}}function Rn(e){const t=Dn(e);return e.state=ln.ACTIVE,En.push(e),++bn.numberOfActiveRequests,++bn.numberOfActiveRequestsEver,++On[e.serverKey],e.requestFunction().then(In(e)).catch(Pn(e)),t}function Tn(e){const t=e.state===ln.ACTIVE;if(e.state=ln.CANCELLED,++bn.numberOfCancelledRequests,r.defined(e.deferred)){const t=e.deferred;e.deferred=void 0,t.reject()}t&&(--bn.numberOfActiveRequests,--On[e.serverKey],++bn.numberOfCancelledActiveRequests),r.defined(e.cancelFunction)&&e.cancelFunction()}function zn(){qn.debugShowStatistics&&(0===bn.numberOfActiveRequests&&bn.lastNumberOfActiveRequests>0&&(bn.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${bn.numberOfAttemptedRequests}`),bn.numberOfAttemptedRequests=0),bn.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${bn.numberOfCancelledRequests}`),bn.numberOfCancelledRequests=0),bn.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${bn.numberOfCancelledActiveRequests}`),bn.numberOfCancelledActiveRequests=0),bn.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${bn.numberOfFailedRequests}`),bn.numberOfFailedRequests=0)),bn.lastNumberOfActiveRequests=bn.numberOfActiveRequests)}qn.maximumRequests=50,qn.maximumRequestsPerServer=6,qn.requestsByServer={"api.cesium.com:443":18,"assets.cesium.com:443":18},qn.throttleRequests=!0,qn.debugShowStatistics=!1,qn.requestCompletedEvent=An,Object.defineProperties(qn,{statistics:{get:function(){return bn}},priorityHeapLength:{get:function(){return _n},set:function(e){if(e<_n)while(xn.length>e){const e=xn.pop();Tn(e)}_n=e,xn.maximumLength=e,xn.reserve(e)}}}),qn.serverHasOpenSlots=function(e,t){t=r.defaultValue(t,1);const n=r.defaultValue(qn.requestsByServer[e],qn.maximumRequestsPerServer),o=On[e]+t<=n;return o},qn.heapHasOpenSlots=function(e){const t=xn.length+e<=_n;return t},qn.update=function(){let e,t,n=0;const r=En.length;for(e=0;e<r;++e)t=En[e],t.cancelled&&Tn(t),t.state===ln.ACTIVE?n>0&&(En[e-n]=t):++n;En.length-=n;const o=xn.internalArray,i=xn.length;for(e=0;e<i;++e)kn(o[e]);xn.resort();const s=Math.max(qn.maximumRequests-En.length,0);let a=0;while(a<s&&xn.length>0)t=xn.pop(),t.cancelled?Tn(t):!t.throttleByServer||qn.serverHasOpenSlots(t.serverKey)?(Rn(t),++a):Tn(t);zn()},qn.getServerKey=function(e){n.Check.typeOf.string("url",e);let t=new $t(e);""===t.scheme()&&(t=new $t(e).absoluteTo(Sn),t.normalize());let o=t.authority();/:/.test(o)||(o=`${o}:${"https"===t.scheme()?"443":"80"}`);const i=On[o];return r.defined(i)||(On[o]=0),o},qn.request=function(e){if(n.Check.typeOf.object("request",e),n.Check.typeOf.string("request.url",e.url),n.Check.typeOf.func("request.requestFunction",e.requestFunction),on(e.url)||en(e.url))return An.raiseEvent(),e.state=ln.RECEIVED,e.requestFunction();if(++bn.numberOfAttemptedRequests,r.defined(e.serverKey)||(e.serverKey=qn.getServerKey(e.url)),qn.throttleRequests&&e.throttleByServer&&!qn.serverHasOpenSlots(e.serverKey))return;if(!qn.throttleRequests||!e.throttle)return Rn(e);if(En.length>=qn.maximumRequests)return;kn(e);const t=xn.insert(e);if(r.defined(t)){if(t===e)return;Tn(t)}return Dn(e)},qn.clearForSpecs=function(){while(xn.length>0){const e=xn.pop();Tn(e)}const e=En.length;for(let t=0;t<e;++t)Tn(En[t]);En.length=0,On={},bn.numberOfAttemptedRequests=0,bn.numberOfActiveRequests=0,bn.numberOfCancelledRequests=0,bn.numberOfCancelledActiveRequests=0,bn.numberOfFailedRequests=0,bn.numberOfActiveRequestsEver=0,bn.lastNumberOfActiveRequests=0},qn.numberOfActiveRequestsByServer=function(e){return On[e]},qn.requestHeap=xn;const Mn={};let Un={};function jn(e){const t=new $t(e);t.normalize();let n=t.authority();if(0!==n.length){if(t.authority(n),-1!==n.indexOf("@")){const e=n.split("@");n=e[1]}if(-1===n.indexOf(":")){let e=t.scheme();if(0===e.length&&(e=window.location.protocol,e=e.substring(0,e.length-1)),"http"===e)n+=":80";else{if("https"!==e)return;n+=":443"}}return n}}Mn.add=function(e,t){if(!r.defined(e))throw new n.DeveloperError("host is required.");if(!r.defined(t)||t<=0)throw new n.DeveloperError("port is required to be greater than 0.");const o=`${e.toLowerCase()}:${t}`;r.defined(Un[o])||(Un[o]=!0)},Mn.remove=function(e,t){if(!r.defined(e))throw new n.DeveloperError("host is required.");if(!r.defined(t)||t<=0)throw new n.DeveloperError("port is required to be greater than 0.");const o=`${e.toLowerCase()}:${t}`;r.defined(Un[o])&&delete Un[o]},Mn.contains=function(e){if(!r.defined(e))throw new n.DeveloperError("url is required.");const t=jn(e);return!(!r.defined(t)||!r.defined(Un[t]))},Mn.clear=function(){Un={}};const Fn=function(){try{const e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob","blob"===e.responseType}catch(e){return!1}}();function Nn(e,t,n,r){const o=e.query();if(0===o.length)return{};let i;if(-1===o.indexOf("=")){const e={};e[o]=void 0,i=e}else i=un(o);t._queryParameters=n?Qn(i,t._queryParameters,r):i,e.search("")}function Bn(e,t){const n=t._queryParameters,o=Object.keys(n);1!==o.length||r.defined(n[o[0]])?e.search(an(n)):e.search(o[0])}function Vn(e,t){return r.defined(e)?r.defined(e.clone)?e.clone():Ht(e):t}function Ln(e){if(e.state===ln.ISSUED||e.state===ln.ACTIVE)throw new n.RuntimeError("The Resource is already being fetched.");e.state=ln.UNISSUED,e.deferred=void 0}function Qn(e,t,n){if(!n)return s.combine(e,t);const o=Ht(e,!0);for(const i in t)if(t.hasOwnProperty(i)){let e=o[i];const n=t[i];r.defined(e)?(Array.isArray(e)||(e=o[i]=[e]),o[i]=e.concat(n)):o[i]=Array.isArray(n)?n.slice():n}return o}function $n(e){e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT),"string"===typeof e&&(e={url:e}),n.Check.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=Vn(e.templateValues,{}),this._queryParameters=Vn(e.queryParameters,{}),this.headers=Vn(e.headers,{}),this.request=r.defaultValue(e.request,new pn),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=r.defaultValue(e.retryAttempts,0),this._retryCount=0;const t=new $t(e.url);Nn(t,this,!0,!0),t.fragment(""),this._url=t.toString()}let Wn;function Hn(e){const t=e.resource,n=e.flipY,o=e.skipColorSpaceConversion,i=e.preferImageBitmap,s=t.request;s.url=t.url,s.requestFunction=function(){let e=!1;t.isDataUri||t.isBlobUri||(e=t.isCrossOriginUrl);const r=G();return $n._Implementations.createImage(s,e,r,n,o,i),r.promise};const a=qn.request(s);if(r.defined(a))return a.catch((function(e){return s.state!==ln.FAILED?Promise.reject(e):t.retryOnError(e).then((function(r){return r?(s.state=ln.UNISSUED,s.deferred=void 0,Hn({resource:t,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:i})):Promise.reject(e)}))}))}function Yn(e,t,n){const o={};o[t]=n,e.setQueryParameters(o);const i=e.request;i.url=e.url,i.requestFunction=function(){const t=G();return window[n]=function(e){t.resolve(e);try{delete window[n]}catch(r){window[n]=void 0}},$n._Implementations.loadAndExecuteScript(e.url,n,t),t.promise};const s=qn.request(i);if(r.defined(s))return s.catch((function(r){return i.state!==ln.FAILED?Promise.reject(r):e.retryOnError(r).then((function(o){return o?(i.state=ln.UNISSUED,i.deferred=void 0,Yn(e,t,n)):Promise.reject(r)}))}))}$n.createIfNeeded=function(e){return e instanceof $n?e.getDerivedResource({request:e.request}):"string"!==typeof e?e:new $n({url:e})},$n.supportsImageBitmapOptions=function(){if(r.defined(Wn))return Wn;if("function"!==typeof createImageBitmap)return Wn=Promise.resolve(!1),Wn;const e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC";return Wn=$n.fetchBlob({url:e}).then((function(e){const t={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(e,t),createImageBitmap(e)])})).then((function(e){const t=Xt(e[0]),n=Xt(e[1]);return t[1]!==n[1]})).catch((function(){return!1})),Wn},Object.defineProperties($n,{isBlobSupported:{get:function(){return Fn}}}),Object.defineProperties($n.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){const t=new $t(e);Nn(t,this,!1),t.fragment(""),this._url=t.toString()}},extension:{get:function(){return Gt(this._url)}},isDataUri:{get:function(){return on(this._url)}},isBlobUri:{get:function(){return en(this._url)}},isCrossOriginUrl:{get:function(){return nn(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}}}),$n.prototype.toString=function(){return this.getUrlComponent(!0,!0)},$n.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;const n=new $t(this._url);e&&Bn(n,this);let o=n.toString().replace(/%7B/g,"{").replace(/%7D/g,"}");const i=this._templateValues;return o=o.replace(/{(.*?)}/g,(function(e,t){const n=i[t];return r.defined(n)?encodeURIComponent(n):e})),t&&r.defined(this.proxy)&&(o=this.proxy.getURL(o)),o},$n.prototype.setQueryParameters=function(e,t){this._queryParameters=t?Qn(this._queryParameters,e,!1):Qn(e,this._queryParameters,!1)},$n.prototype.appendQueryParameters=function(e){this._queryParameters=Qn(e,this._queryParameters,!0)},$n.prototype.setTemplateValues=function(e,t){this._templateValues=t?s.combine(this._templateValues,e):s.combine(e,this._templateValues)},$n.prototype.getDerivedResource=function(e){const t=this.clone();if(t._retryCount=0,r.defined(e.url)){const n=new $t(e.url),o=r.defaultValue(e.preserveQueryParameters,!1);Nn(n,t,!0,o),n.fragment(""),""!==n.scheme()?t._url=n.toString():t._url=n.absoluteTo(new $t(Yt(this._url))).toString()}return r.defined(e.queryParameters)&&(t._queryParameters=s.combine(e.queryParameters,t._queryParameters)),r.defined(e.templateValues)&&(t._templateValues=s.combine(e.templateValues,t.templateValues)),r.defined(e.headers)&&(t.headers=s.combine(e.headers,t.headers)),r.defined(e.proxy)&&(t.proxy=e.proxy),r.defined(e.request)&&(t.request=e.request),r.defined(e.retryCallback)&&(t.retryCallback=e.retryCallback),r.defined(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t},$n.prototype.retryOnError=function(e){const t=this.retryCallback;if("function"!==typeof t||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);const n=this;return Promise.resolve(t(this,e)).then((function(e){return++n._retryCount,e}))},$n.prototype.clone=function(e){return r.defined(e)||(e=new $n({url:this._url})),e._url=this._url,e._queryParameters=Ht(this._queryParameters),e._templateValues=Ht(this._templateValues),e.headers=Ht(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e},$n.prototype.getBaseUri=function(e){return Zt(this.getUrlComponent(e),e)},$n.prototype.appendForwardSlash=function(){this._url=Wt(this._url)},$n.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},$n.fetchArrayBuffer=function(e){const t=new $n(e);return t.fetchArrayBuffer()},$n.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},$n.fetchBlob=function(e){const t=new $n(e);return t.fetchBlob()},$n.prototype.fetchImage=function(e){e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT);const t=r.defaultValue(e.preferImageBitmap,!1),n=r.defaultValue(e.preferBlob,!1),o=r.defaultValue(e.flipY,!1),i=r.defaultValue(e.skipColorSpaceConversion,!1);if(Ln(this.request),!Fn||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return Hn({resource:this,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:t});const s=this.fetchBlob();if(!r.defined(s))return;let a,u,c,l;return $n.supportsImageBitmapOptions().then((function(e){return a=e,u=a&&t,s})).then((function(e){if(!r.defined(e))return;if(l=e,u)return $n.createImageBitmapFromBlob(e,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i});const t=window.URL.createObjectURL(e);return c=new $n({url:t}),Hn({resource:c,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:!1})})).then((function(e){if(r.defined(e))return e.blob=l,u||window.URL.revokeObjectURL(c.url),e})).catch((function(e){return r.defined(c)&&window.URL.revokeObjectURL(c.url),e.blob=l,Promise.reject(e)}))},$n.fetchImage=function(e){const t=new $n(e);return t.fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})},$n.prototype.fetchText=function(){return this.fetch({responseType:"text"})},$n.fetchText=function(e){const t=new $n(e);return t.fetchText()},$n.prototype.fetchJson=function(){const e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(r.defined(e))return e.then((function(e){if(r.defined(e))return JSON.parse(e)}))},$n.fetchJson=function(e){const t=new $n(e);return t.fetchJson()},$n.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},$n.fetchXML=function(e){const t=new $n(e);return t.fetchXML()},$n.prototype.fetchJsonp=function(e){let t;e=r.defaultValue(e,"callback"),Ln(this.request);do{t=`loadJsonp${o.CesiumMath.nextRandomNumber().toString().substring(2,8)}`}while(r.defined(window[t]));return Yn(this,e,t)},$n.fetchJsonp=function(e){const t=new $n(e);return t.fetchJsonp(e.callbackParameterName)},$n.prototype._makeRequest=function(e){const t=this;Ln(t.request);const n=t.request;n.url=t.url,n.requestFunction=function(){const o=e.responseType,i=s.combine(e.headers,t.headers),a=e.overrideMimeType,u=e.method,c=e.data,l=G(),d=$n._Implementations.loadWithXhr(t.url,o,u,c,i,l,a);return r.defined(d)&&r.defined(d.abort)&&(n.cancelFunction=function(){d.abort()}),l.promise};const o=qn.request(n);if(r.defined(o))return o.then((function(e){return n.cancelFunction=void 0,e})).catch((function(r){return n.cancelFunction=void 0,n.state!==ln.FAILED?Promise.reject(r):t.retryOnError(r).then((function(o){return o?(n.state=ln.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)}))}))};const Zn=/^data:(.*?)(;base64)?,(.*)$/;function Gn(e,t){const n=decodeURIComponent(t);return e?atob(n):n}function Jn(e,t){const n=Gn(e,t),r=new ArrayBuffer(n.length),o=new Uint8Array(r);for(let i=0;i<n.length;i++)o[i]=n.charCodeAt(i);return r}function Xn(e,t){t=r.defaultValue(t,"");const o=e[1],i=!!e[2],s=e[3];let a,u;switch(t){case"":case"text":return Gn(i,s);case"arraybuffer":return Jn(i,s);case"blob":return a=Jn(i,s),new Blob([a],{type:o});case"document":return u=new DOMParser,u.parseFromString(Gn(i,s),o);case"json":return JSON.parse(Gn(i,s));default:throw new n.DeveloperError(`Unhandled responseType: ${t}`)}}function Kn(e,t){switch(t){case"text":return e.toString("utf8");case"json":return JSON.parse(e.toString("utf8"));default:return new Uint8Array(e).buffer}}function er(e,t,r,o,i,s,a){const u=require("url").parse(e),c="https:"===u.protocol?require("https"):require("http"),l=require("zlib"),d={protocol:u.protocol,hostname:u.hostname,port:u.port,path:u.path,query:u.query,method:r,headers:i};c.request(d).on("response",(function(e){if(e.statusCode<200||e.statusCode>=300)return void s.reject(new mn(e.statusCode,e,e.headers));const r=[];e.on("data",(function(e){r.push(e)})),e.on("end",(function(){const o=Buffer.concat(r);"gzip"===e.headers["content-encoding"]?l.gunzip(o,(function(e,r){e?s.reject(new n.RuntimeError("Error decompressing response.")):s.resolve(Kn(r,t))})):s.resolve(Kn(o,t))}))})).on("error",(function(e){s.reject(new mn)})).end()}$n.prototype.fetch=function(e){return e=Vn(e,{}),e.method="GET",this._makeRequest(e)},$n.fetch=function(e){const t=new $n(e);return t.fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},$n.prototype.delete=function(e){return e=Vn(e,{}),e.method="DELETE",this._makeRequest(e)},$n.delete=function(e){const t=new $n(e);return t.delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})},$n.prototype.head=function(e){return e=Vn(e,{}),e.method="HEAD",this._makeRequest(e)},$n.head=function(e){const t=new $n(e);return t.head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},$n.prototype.options=function(e){return e=Vn(e,{}),e.method="OPTIONS",this._makeRequest(e)},$n.options=function(e){const t=new $n(e);return t.options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},$n.prototype.post=function(e,t){return n.Check.defined("data",e),t=Vn(t,{}),t.method="POST",t.data=e,this._makeRequest(t)},$n.post=function(e){const t=new $n(e);return t.post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},$n.prototype.put=function(e,t){return n.Check.defined("data",e),t=Vn(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)},$n.put=function(e){const t=new $n(e);return t.put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},$n.prototype.patch=function(e,t){return n.Check.defined("data",e),t=Vn(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)},$n.patch=function(e){const t=new $n(e);return t.patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},$n._Implementations={},$n._Implementations.loadImageElement=function(e,t,n){const r=new Image;r.onload=function(){0===r.naturalWidth&&0===r.naturalHeight&&0===r.width&&0===r.height&&(r.width=300,r.height=150),n.resolve(r)},r.onerror=function(e){n.reject(e)},t&&(Mn.contains(e)?r.crossOrigin="use-credentials":r.crossOrigin=""),r.src=e},$n._Implementations.createImage=function(e,t,o,i,s,a){const u=e.url;$n.supportsImageBitmapOptions().then((function(c){if(!c||!a)return void $n._Implementations.loadImageElement(u,t,o);const l="blob",d="GET",f=G(),p=$n._Implementations.loadWithXhr(u,l,d,void 0,void 0,f,void 0,void 0,void 0);return r.defined(p)&&r.defined(p.abort)&&(e.cancelFunction=function(){p.abort()}),f.promise.then((function(e){if(r.defined(e))return $n.createImageBitmapFromBlob(e,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:s});o.reject(new n.RuntimeError(`Successfully retrieved ${u} but it contained no content.`))})).then((function(e){o.resolve(e)}))})).catch((function(e){o.reject(e)}))},$n.createImageBitmapFromBlob=function(e,t){return n.Check.defined("options",t),n.Check.typeOf.bool("options.flipY",t.flipY),n.Check.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),n.Check.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};const tr="undefined"===typeof XMLHttpRequest;function nr(e){if(e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=r.defaultValue(e.addNewLeapSeconds,!0),r.defined(e.data))or(this,e.data);else if(r.defined(e.url)){const t=$n.createIfNeeded(e.url),n=this;this._downloadPromise=t.fetchJson().then((function(e){or(n,e)})).catch((function(){n._dataError=`An error occurred while retrieving the EOP data from the URL ${t.url}.`}))}else or(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function rr(e,t){return Nt.compare(e.julianDate,t)}function or(e,t){if(!r.defined(t.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r.defined(t.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");const n=t.columnNames.indexOf("modifiedJulianDateUtc"),o=t.columnNames.indexOf("xPoleWanderRadians"),i=t.columnNames.indexOf("yPoleWanderRadians"),s=t.columnNames.indexOf("ut1MinusUtcSeconds"),a=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),u=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||o<0||i<0||s<0||a<0||u<0||c<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");const l=e._samples=t.samples,d=e._dates=[];let f;e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=i,e._ut1MinusUtcSecondsColumn=s,e._xCelestialPoleOffsetRadiansColumn=a,e._yCelestialPoleOffsetRadiansColumn=u,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;const p=e._addNewLeapSeconds;for(let h=0,m=l.length;h<m;h+=e._columnCount){const e=l[h+n],t=l[h+c],o=e+vt.MODIFIED_JULIAN_DATE_DIFFERENCE,i=new Nt(o,t,Ct.TAI);if(d.push(i),p){if(t!==f&&r.defined(f)){const e=Nt.leapSeconds,n=ft(e,i,rr);if(n<0){const r=new gt(i,t);e.splice(~n,0,r)}}f=t}}}function ir(e,t,n,r,o){const i=n*r;o.xPoleWander=t[i+e._xPoleWanderRadiansColumn],o.yPoleWander=t[i+e._yPoleWanderRadiansColumn],o.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],o.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],o.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function sr(e,t,n){return t+e*(n-t)}function ar(e,t,n,r,o,i,s){const a=e._columnCount;if(i>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;const u=t[o],c=t[i];if(u.equals(c)||r.equals(u))return ir(e,n,o,a,s),s;if(r.equals(c))return ir(e,n,i,a,s),s;const l=Nt.secondsDifference(r,u)/Nt.secondsDifference(c,u),d=o*a,f=i*a;let p=n[d+e._ut1MinusUtcSecondsColumn],h=n[f+e._ut1MinusUtcSecondsColumn];const m=h-p;if(m>.5||m<-.5){const t=n[d+e._taiMinusUtcSecondsColumn],o=n[f+e._taiMinusUtcSecondsColumn];t!==o&&(c.equals(r)?p=h:h-=o-t)}return s.xPoleWander=sr(l,n[d+e._xPoleWanderRadiansColumn],n[f+e._xPoleWanderRadiansColumn]),s.yPoleWander=sr(l,n[d+e._yPoleWanderRadiansColumn],n[f+e._yPoleWanderRadiansColumn]),s.xPoleOffset=sr(l,n[d+e._xCelestialPoleOffsetRadiansColumn],n[f+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=sr(l,n[d+e._yCelestialPoleOffsetRadiansColumn],n[f+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=sr(l,p,h),s}function ur(e,t,n){this.heading=r.defaultValue(e,0),this.pitch=r.defaultValue(t,0),this.roll=r.defaultValue(n,0)}$n._Implementations.loadWithXhr=function(e,t,o,i,s,a,u){const c=Zn.exec(e);if(null!==c)return void a.resolve(Xn(c,t));if(tr)return void er(e,t,o,i,s,a);const l=new XMLHttpRequest;if(Mn.contains(e)&&(l.withCredentials=!0),l.open(o,e,!0),r.defined(u)&&r.defined(l.overrideMimeType)&&l.overrideMimeType(u),r.defined(s))for(const n in s)s.hasOwnProperty(n)&&l.setRequestHeader(n,s[n]);r.defined(t)&&(l.responseType=t);let d=!1;return"string"===typeof e&&(d=0===e.indexOf("file://")||"undefined"!==typeof window&&"file://"===window.location.origin),l.onload=function(){if((l.status<200||l.status>=300)&&(!d||0!==l.status))return void a.reject(new mn(l.status,l.response,l.getAllResponseHeaders()));const e=l.response,i=l.responseType;if("HEAD"===o||"OPTIONS"===o){const e=l.getAllResponseHeaders(),t=e.trim().split(/[\r\n]+/),n={};return t.forEach((function(e){const t=e.split(": "),r=t.shift();n[r]=t.join(": ")})),void a.resolve(n)}if(204===l.status)a.resolve();else if(!r.defined(e)||r.defined(t)&&i!==t)if("json"===t&&"string"===typeof e)try{a.resolve(JSON.parse(e))}catch(s){a.reject(s)}else(""===i||"document"===i)&&r.defined(l.responseXML)&&l.responseXML.hasChildNodes()?a.resolve(l.responseXML):""!==i&&"text"!==i||!r.defined(l.responseText)?a.reject(new n.RuntimeError("Invalid XMLHttpRequest response type.")):a.resolve(l.responseText);else a.resolve(e)},l.onerror=function(e){a.reject(new mn)},l.send(i),l},$n._Implementations.loadAndExecuteScript=function(e,t,n){return sn(e).catch((function(e){n.reject(e)}))},$n._DefaultImplementations={},$n._DefaultImplementations.createImage=$n._Implementations.createImage,$n._DefaultImplementations.loadWithXhr=$n._Implementations.loadWithXhr,$n._DefaultImplementations.loadAndExecuteScript=$n._Implementations.loadAndExecuteScript,$n.DEFAULT=Object.freeze(new $n({url:"undefined"===typeof document?"":document.location.href.split("?")[0]})),nr.NONE=Object.freeze({getPromiseToLoad:function(){return Promise.resolve()},compute:function(e,t){return r.defined(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new pt(0,0,0,0,0),t}}),nr.prototype.getPromiseToLoad=function(){return Promise.resolve(this._downloadPromise)},nr.prototype.compute=function(e,t){if(!r.defined(this._samples)){if(r.defined(this._dataError))throw new n.RuntimeError(this._dataError);return}if(r.defined(t)||(t=new pt(0,0,0,0,0)),0===this._samples.length)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;const o=this._dates,i=this._lastIndex;let s=0,a=0;if(r.defined(i)){const n=o[i],u=o[i+1],c=Nt.lessThanOrEquals(n,e),l=!r.defined(u),d=l||Nt.greaterThanOrEquals(u,e);if(c&&d)return s=i,!l&&u.equals(e)&&++s,a=s+1,ar(this,o,this._samples,e,s,a,t),t}let u=ft(o,e,Nt.compare,this._dateColumn);return u>=0?(u<o.length-1&&o[u+1].equals(e)&&++u,s=u,a=u):(a=~u,s=a-1,s<0&&(s=0)),this._lastIndex=s,ar(this,o,this._samples,e,s,a,t),t},ur.fromQuaternion=function(e,t){if(!r.defined(e))throw new n.DeveloperError("quaternion is required");r.defined(t)||(t=new ur);const i=2*(e.w*e.y-e.z*e.x),s=1-2*(e.x*e.x+e.y*e.y),a=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),c=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(c,u),t.roll=Math.atan2(a,s),t.pitch=-o.CesiumMath.asinClamped(i),t},ur.fromDegrees=function(e,t,i,s){if(!r.defined(e))throw new n.DeveloperError("heading is required");if(!r.defined(t))throw new n.DeveloperError("pitch is required");if(!r.defined(i))throw new n.DeveloperError("roll is required");return r.defined(s)||(s=new ur),s.heading=e*o.CesiumMath.RADIANS_PER_DEGREE,s.pitch=t*o.CesiumMath.RADIANS_PER_DEGREE,s.roll=i*o.CesiumMath.RADIANS_PER_DEGREE,s},ur.clone=function(e,t){if(r.defined(e))return r.defined(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new ur(e.heading,e.pitch,e.roll)},ur.equals=function(e,t){return e===t||r.defined(e)&&r.defined(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll},ur.equalsEpsilon=function(e,t,n,i){return e===t||r.defined(e)&&r.defined(t)&&o.CesiumMath.equalsEpsilon(e.heading,t.heading,n,i)&&o.CesiumMath.equalsEpsilon(e.pitch,t.pitch,n,i)&&o.CesiumMath.equalsEpsilon(e.roll,t.roll,n,i)},ur.prototype.clone=function(e){return ur.clone(this,e)},ur.prototype.equals=function(e){return ur.equals(this,e)},ur.prototype.equalsEpsilon=function(e,t,n){return ur.equalsEpsilon(this,e,t,n)},ur.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};const cr=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function lr(){const e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){const n=e[t].getAttribute("src"),r=cr.exec(n);if(null!==r)return r[1]}}let dr,fr,pr;function hr(e){return"undefined"===typeof document?e:(r.defined(dr)||(dr=document.createElement("a")),dr.href=e,dr.href=dr.href,dr.href)}function mr(){if(r.defined(fr))return fr;let e;if(e="undefined"!==typeof CESIUM_BASE_URL?CESIUM_BASE_URL:"object"===typeof define&&r.defined(define.amd)&&!define.amd.toUrlUndefined&&r.defined(require.toUrl)?Yt("..",vr("Core/buildModuleUrl.js")):lr(),!r.defined(e))throw new n.DeveloperError("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return fr=new $n({url:hr(e)}),fr.appendForwardSlash(),fr}function gr(e){return hr(require.toUrl(`../${e}`))}function yr(e){const t=mr().getDerivedResource({url:e});return t.url}function vr(e){r.defined(pr)||(pr="object"===typeof define&&r.defined(define.amd)&&!define.amd.toUrlUndefined&&r.defined(require.toUrl)?gr:yr);const t=pr(e);return t}function wr(e,t,n){this.x=e,this.y=t,this.s=n}function Cr(e){e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT),this._xysFileUrlTemplate=$n.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=r.defaultValue(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=r.defaultValue(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new Nt(this._sampleZeroJulianEphemerisDate,0,Ct.TAI),this._stepSizeDays=r.defaultValue(e.stepSizeDays,1),this._samplesPerXysFile=r.defaultValue(e.samplesPerXysFile,1e3),this._totalSamples=r.defaultValue(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];const t=this._interpolationOrder,n=this._denominators=new Array(t+1),o=this._xTable=new Array(t+1),i=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=i,o[r]=r*this._stepSizeDays;for(let e=0;e<=t;++e)e!==r&&(n[r]*=r-e);n[r]=1/n[r]}this._work=new Array(t+1),this._coef=new Array(t+1)}vr._cesiumScriptRegex=cr,vr._buildModuleUrlFromBaseUrl=yr,vr._clearBaseResource=function(){fr=void 0},vr.setBaseUrl=function(e){fr=$n.DEFAULT.getDerivedResource({url:e})},vr.getCesiumBaseUrl=mr;const br=new Nt(0,0,Ct.TAI);function _r(e,t,n){const r=br;return r.dayNumber=t,r.secondsOfDay=n,Nt.daysDifference(r,e._sampleZeroDateTT)}function xr(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];const n=G();let o;e._chunkDownloadsInProgress[t]=n;const i=e._xysFileUrlTemplate;return o=r.defined(i)?i.getDerivedResource({templateValues:{0:t}}):new $n({url:vr(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)}),o.fetchJson().then((function(r){e._chunkDownloadsInProgress[t]=!1;const o=e._samples,i=r.samples,s=t*e._samplesPerXysFile*3;for(let e=0,t=i.length;e<t;++e)o[s+e]=i[e];n.resolve()})),n.promise}Cr.prototype.preload=function(e,t,n,r){const o=_r(this,e,t),i=_r(this,n,r);let s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=i/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);const u=s/this._samplesPerXysFile|0,c=a/this._samplesPerXysFile|0,l=[];for(let d=u;d<=c;++d)l.push(xr(this,d));return Promise.all(l)},Cr.prototype.computeXysRadians=function(e,t,n){const o=_r(this,e,t);if(o<0)return;const i=o/this._stepSizeDays|0;if(i>=this._totalSamples)return;const s=this._interpolationOrder;let a=i-(s/2|0);a<0&&(a=0);let u=a+s;u>=this._totalSamples&&(u=this._totalSamples-1,a=u-s,a<0&&(a=0));let c=!1;const l=this._samples;if(r.defined(l[3*a])||(xr(this,a/this._samplesPerXysFile|0),c=!0),r.defined(l[3*u])||(xr(this,u/this._samplesPerXysFile|0),c=!0),c)return;r.defined(n)?(n.x=0,n.y=0,n.s=0):n=new wr(0,0,0);const d=o-a*this._stepSizeDays,f=this._work,p=this._denominators,h=this._coef,m=this._xTable;let g,y;for(g=0;g<=s;++g)f[g]=d-m[g];for(g=0;g<=s;++g){for(h[g]=1,y=0;y<=s;++y)y!==g&&(h[g]*=f[y]);h[g]*=p[g];let e=3*(a+g);n.x+=h[g]*l[e++],n.y+=h[g]*l[e++],n.s+=h[g]*l[e]}return n};const Er={},Or={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},Sr={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Ar={},qr={east:new t.Cartesian3,north:new t.Cartesian3,up:new t.Cartesian3,west:new t.Cartesian3,south:new t.Cartesian3,down:new t.Cartesian3};let kr=new t.Cartesian3,Dr=new t.Cartesian3,Ir=new t.Cartesian3;Er.localFrameToFixedFrameGenerator=function(e,i){if(!Or.hasOwnProperty(e)||!Or[e].hasOwnProperty(i))throw new n.DeveloperError("firstAxis and secondAxis must be east, north, up, west, south or down.");const s=Or[e][i];let a;const u=e+i;return r.defined(Ar[u])?a=Ar[u]:(a=function(a,u,c){if(!r.defined(a))throw new n.DeveloperError("origin is required.");if(r.defined(c)||(c=new t.Matrix4),t.Cartesian3.equalsEpsilon(a,t.Cartesian3.ZERO,o.CesiumMath.EPSILON14))t.Cartesian3.unpack(Sr[e],0,kr),t.Cartesian3.unpack(Sr[i],0,Dr),t.Cartesian3.unpack(Sr[s],0,Ir);else if(o.CesiumMath.equalsEpsilon(a.x,0,o.CesiumMath.EPSILON14)&&o.CesiumMath.equalsEpsilon(a.y,0,o.CesiumMath.EPSILON14)){const n=o.CesiumMath.sign(a.z);t.Cartesian3.unpack(Sr[e],0,kr),"east"!==e&&"west"!==e&&t.Cartesian3.multiplyByScalar(kr,n,kr),t.Cartesian3.unpack(Sr[i],0,Dr),"east"!==i&&"west"!==i&&t.Cartesian3.multiplyByScalar(Dr,n,Dr),t.Cartesian3.unpack(Sr[s],0,Ir),"east"!==s&&"west"!==s&&t.Cartesian3.multiplyByScalar(Ir,n,Ir)}else{u=r.defaultValue(u,t.Ellipsoid.WGS84),u.geodeticSurfaceNormal(a,qr.up);const n=qr.up,o=qr.east;o.x=-a.y,o.y=a.x,o.z=0,t.Cartesian3.normalize(o,qr.east),t.Cartesian3.cross(n,o,qr.north),t.Cartesian3.multiplyByScalar(qr.up,-1,qr.down),t.Cartesian3.multiplyByScalar(qr.east,-1,qr.west),t.Cartesian3.multiplyByScalar(qr.north,-1,qr.south),kr=qr[e],Dr=qr[i],Ir=qr[s]}return c[0]=kr.x,c[1]=kr.y,c[2]=kr.z,c[3]=0,c[4]=Dr.x,c[5]=Dr.y,c[6]=Dr.z,c[7]=0,c[8]=Ir.x,c[9]=Ir.y,c[10]=Ir.z,c[11]=0,c[12]=a.x,c[13]=a.y,c[14]=a.z,c[15]=1,c},Ar[u]=a),a},Er.eastNorthUpToFixedFrame=Er.localFrameToFixedFrameGenerator("east","north"),Er.northEastDownToFixedFrame=Er.localFrameToFixedFrameGenerator("north","east"),Er.northUpEastToFixedFrame=Er.localFrameToFixedFrameGenerator("north","up"),Er.northWestUpToFixedFrame=Er.localFrameToFixedFrameGenerator("north","west");const Pr=new Fe,Rr=new t.Cartesian3(1,1,1),Tr=new t.Matrix4;Er.headingPitchRollToFixedFrame=function(e,o,i,s,a){n.Check.typeOf.object("HeadingPitchRoll",o),s=r.defaultValue(s,Er.eastNorthUpToFixedFrame);const u=Fe.fromHeadingPitchRoll(o,Pr),c=t.Matrix4.fromTranslationQuaternionRotationScale(t.Cartesian3.ZERO,u,Rr,Tr);return a=s(e,i,a),t.Matrix4.multiply(a,c,a)};const zr=new t.Matrix4,Mr=new t.Matrix3;Er.headingPitchRollQuaternion=function(e,r,o,i,s){n.Check.typeOf.object("HeadingPitchRoll",r);const a=Er.headingPitchRollToFixedFrame(e,r,o,i,zr),u=t.Matrix4.getMatrix3(a,Mr);return Fe.fromRotationMatrix(u,s)};const Ur=new t.Cartesian3(1,1,1),jr=new t.Cartesian3,Fr=new t.Matrix4,Nr=new t.Matrix4,Br=new t.Matrix3,Vr=new Fe;Er.fixedFrameToHeadingPitchRoll=function(e,o,i,s){n.Check.defined("transform",e),o=r.defaultValue(o,t.Ellipsoid.WGS84),i=r.defaultValue(i,Er.eastNorthUpToFixedFrame),r.defined(s)||(s=new ur);const a=t.Matrix4.getTranslation(e,jr);if(t.Cartesian3.equals(a,t.Cartesian3.ZERO))return s.heading=0,s.pitch=0,s.roll=0,s;let u=t.Matrix4.inverseTransformation(i(a,o,Fr),Fr),c=t.Matrix4.setScale(e,Ur,Nr);c=t.Matrix4.setTranslation(c,t.Cartesian3.ZERO,c),u=t.Matrix4.multiply(u,c,u);let l=Fe.fromRotationMatrix(t.Matrix4.getMatrix3(u,Br),Vr);return l=Fe.normalize(l,l),ur.fromQuaternion(l,s)};const Lr=24110.54841,Qr=8640184.812866,$r=.093104,Wr=-62e-7,Hr=11772758384668e-32,Yr=72921158553e-15,Zr=o.CesiumMath.TWO_PI/86400;let Gr=new Nt;Er.computeTemeToPseudoFixedMatrix=function(e,i){if(!r.defined(e))throw new n.DeveloperError("date is required.");Gr=Nt.addSeconds(e,-Nt.computeTaiMinusUtc(e),Gr);const s=Gr.dayNumber,a=Gr.secondsOfDay;let u;const c=s-2451545;u=a>=43200?(c+.5)/vt.DAYS_PER_JULIAN_CENTURY:(c-.5)/vt.DAYS_PER_JULIAN_CENTURY;const l=Lr+u*(Qr+u*($r+u*Wr)),d=l*Zr%o.CesiumMath.TWO_PI,f=Yr+Hr*(s-2451545.5),p=(a+.5*vt.SECONDS_PER_DAY)%vt.SECONDS_PER_DAY,h=d+f*p,m=Math.cos(h),g=Math.sin(h);return r.defined(i)?(i[0]=m,i[1]=-g,i[2]=0,i[3]=g,i[4]=m,i[5]=0,i[6]=0,i[7]=0,i[8]=1,i):new t.Matrix3(m,g,0,-g,m,0,0,0,1)},Er.iau2006XysData=new Cr,Er.earthOrientationParameters=nr.NONE;const Jr=32.184,Xr=2451545;Er.preloadIcrfFixed=function(e){const t=e.start.dayNumber,n=e.start.secondsOfDay+Jr,r=e.stop.dayNumber,o=e.stop.secondsOfDay+Jr,i=Er.iau2006XysData.preload(t,n,r,o),s=Er.earthOrientationParameters.getPromiseToLoad();return Promise.all([i,s])},Er.computeIcrfToFixedMatrix=function(e,o){if(!r.defined(e))throw new n.DeveloperError("date is required.");r.defined(o)||(o=new t.Matrix3);const i=Er.computeFixedToIcrfMatrix(e,o);if(r.defined(i))return t.Matrix3.transpose(i,o)};const Kr=new wr(0,0,0),eo=new pt(0,0,0,0,0),to=new t.Matrix3,no=new t.Matrix3;Er.computeFixedToIcrfMatrix=function(e,i){if(!r.defined(e))throw new n.DeveloperError("date is required.");r.defined(i)||(i=new t.Matrix3);const s=Er.earthOrientationParameters.compute(e,eo);if(!r.defined(s))return;const a=e.dayNumber,u=e.secondsOfDay+Jr,c=Er.iau2006XysData.computeXysRadians(a,u,Kr);if(!r.defined(c))return;const l=c.x+s.xPoleOffset,d=c.y+s.yPoleOffset,f=1/(1+Math.sqrt(1-l*l-d*d)),p=to;p[0]=1-f*l*l,p[3]=-f*l*d,p[6]=l,p[1]=-f*l*d,p[4]=1-f*d*d,p[7]=d,p[2]=-l,p[5]=-d,p[8]=1-f*(l*l+d*d);const h=t.Matrix3.fromRotationZ(-c.s,no),m=t.Matrix3.multiply(p,h,to),g=e.dayNumber,y=e.secondsOfDay-Nt.computeTaiMinusUtc(e)+s.ut1MinusUtc,v=g-2451545,w=y/vt.SECONDS_PER_DAY;let C=.779057273264+w+.00273781191135448*(v+w);C=C%1*o.CesiumMath.TWO_PI;const b=t.Matrix3.fromRotationZ(C,no),_=t.Matrix3.multiply(m,b,to),x=Math.cos(s.xPoleWander),E=Math.cos(s.yPoleWander),O=Math.sin(s.xPoleWander),S=Math.sin(s.yPoleWander);let A=a-Xr+u/vt.SECONDS_PER_DAY;A/=36525;const q=-47e-6*A*o.CesiumMath.RADIANS_PER_DEGREE/3600,k=Math.cos(q),D=Math.sin(q),I=no;return I[0]=x*k,I[1]=x*D,I[2]=O,I[3]=-E*D+S*O*k,I[4]=E*k+S*O*D,I[5]=-S*x,I[6]=-S*D-E*O*k,I[7]=S*k-E*O*D,I[8]=E*x,t.Matrix3.multiply(_,I,i)};const ro=new t.Cartesian4;Er.pointToWindowCoordinates=function(e,t,n,r){return r=Er.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},Er.pointToGLWindowCoordinates=function(e,o,i,s){if(!r.defined(e))throw new n.DeveloperError("modelViewProjectionMatrix is required.");if(!r.defined(o))throw new n.DeveloperError("viewportTransformation is required.");if(!r.defined(i))throw new n.DeveloperError("point is required.");r.defined(s)||(s=new t.Cartesian2);const a=ro;return t.Matrix4.multiplyByVector(e,t.Cartesian4.fromElements(i.x,i.y,i.z,1,a),a),t.Cartesian4.multiplyByScalar(a,1/a.w,a),t.Matrix4.multiplyByVector(o,a,a),t.Cartesian2.fromCartesian4(a,s)};const oo=new t.Cartesian3,io=new t.Cartesian3,so=new t.Cartesian3;Er.rotationMatrixFromPositionVelocity=function(e,i,s,a){if(!r.defined(e))throw new n.DeveloperError("position is required.");if(!r.defined(i))throw new n.DeveloperError("velocity is required.");const u=r.defaultValue(s,t.Ellipsoid.WGS84).geodeticSurfaceNormal(e,oo);let c=t.Cartesian3.cross(i,u,io);t.Cartesian3.equalsEpsilon(c,t.Cartesian3.ZERO,o.CesiumMath.EPSILON6)&&(c=t.Cartesian3.clone(t.Cartesian3.UNIT_X,c));const l=t.Cartesian3.cross(c,i,so);return t.Cartesian3.normalize(l,l),t.Cartesian3.cross(i,l,c),t.Cartesian3.negate(c,c),t.Cartesian3.normalize(c,c),r.defined(a)||(a=new t.Matrix3),a[0]=i.x,a[1]=i.y,a[2]=i.z,a[3]=c.x,a[4]=c.y,a[5]=c.z,a[6]=l.x,a[7]=l.y,a[8]=l.z,a};const ao=new t.Matrix4(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),uo=new t.Cartographic,co=new t.Cartesian3,lo=new t.Cartesian3,fo=new t.Matrix3,po=new t.Matrix4,ho=new t.Matrix4;Er.basisTo2D=function(e,o,i){if(!r.defined(e))throw new n.DeveloperError("projection is required.");if(!r.defined(o))throw new n.DeveloperError("matrix is required.");if(!r.defined(i))throw new n.DeveloperError("result is required.");const s=t.Matrix4.getTranslation(o,lo),a=e.ellipsoid,u=a.cartesianToCartographic(s,uo),c=e.project(u,co);t.Cartesian3.fromElements(c.z,c.x,c.y,c);const l=Er.eastNorthUpToFixedFrame(s,a,po),d=t.Matrix4.inverseTransformation(l,ho),f=t.Matrix4.getMatrix3(o,fo),p=t.Matrix4.multiplyByMatrix3(d,f,i);return t.Matrix4.multiply(ao,p,i),t.Matrix4.setTranslation(i,c,i),i},Er.wgs84To2DModelMatrix=function(e,o,i){if(!r.defined(e))throw new n.DeveloperError("projection is required.");if(!r.defined(o))throw new n.DeveloperError("center is required.");if(!r.defined(i))throw new n.DeveloperError("result is required.");const s=e.ellipsoid,a=Er.eastNorthUpToFixedFrame(o,s,po),u=t.Matrix4.inverseTransformation(a,ho),c=s.cartesianToCartographic(o,uo),l=e.project(c,co);t.Cartesian3.fromElements(l.z,l.x,l.y,l);const d=t.Matrix4.fromTranslation(l,po);return t.Matrix4.multiply(ao,u,i),t.Matrix4.multiply(d,i,i),i},e.BoundingSphere=d,e.FeatureDetection=je,e.GeographicProjection=a,e.Intersect=c,e.Interval=l,e.Quaternion=Fe,e.Resource=$n,e.Transforms=Er,e.buildModuleUrl=vr}));
\ No newline at end of file
define(["exports","./defaultValue-94c3e563","./RuntimeError-c581ca93"],(function(e,t,n){"use strict";function o(e){e=t.defaultValue(e,t.defaultValue.EMPTY_OBJECT),this.position=t.defaultValue(e.position,!1),this.normal=t.defaultValue(e.normal,!1),this.st=t.defaultValue(e.st,!1),this.bitangent=t.defaultValue(e.bitangent,!1),this.tangent=t.defaultValue(e.tangent,!1),this.color=t.defaultValue(e.color,!1)}o.POSITION_ONLY=Object.freeze(new o({position:!0})),o.POSITION_AND_NORMAL=Object.freeze(new o({position:!0,normal:!0})),o.POSITION_NORMAL_AND_ST=Object.freeze(new o({position:!0,normal:!0,st:!0})),o.POSITION_AND_ST=Object.freeze(new o({position:!0,st:!0})),o.POSITION_AND_COLOR=Object.freeze(new o({position:!0,color:!0})),o.ALL=Object.freeze(new o({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),o.DEFAULT=o.POSITION_NORMAL_AND_ST,o.packedLength=6,o.pack=function(e,o,i){if(!t.defined(e))throw new n.DeveloperError("value is required");if(!t.defined(o))throw new n.DeveloperError("array is required");return i=t.defaultValue(i,0),o[i++]=e.position?1:0,o[i++]=e.normal?1:0,o[i++]=e.st?1:0,o[i++]=e.tangent?1:0,o[i++]=e.bitangent?1:0,o[i]=e.color?1:0,o},o.unpack=function(e,i,r){if(!t.defined(e))throw new n.DeveloperError("array is required");return i=t.defaultValue(i,0),t.defined(r)||(r=new o),r.position=1===e[i++],r.normal=1===e[i++],r.st=1===e[i++],r.tangent=1===e[i++],r.bitangent=1===e[i++],r.color=1===e[i],r},o.clone=function(e,n){if(t.defined(e))return t.defined(n)||(n=new o),n.position=e.position,n.normal=e.normal,n.st=e.st,n.tangent=e.tangent,n.bitangent=e.bitangent,n.color=e.color,n},e.VertexFormat=o}));
\ No newline at end of file
define(["exports","./arrayRemoveDuplicates-06991c15","./Matrix2-fc7e9822","./defaultValue-94c3e563","./ComponentDatatype-4a60b8d6","./PolylinePipeline-0e310844"],(function(e,t,i,n,o,r){"use strict";const a={};function s(e,t){return o.CesiumMath.equalsEpsilon(e.latitude,t.latitude,o.CesiumMath.EPSILON10)&&o.CesiumMath.equalsEpsilon(e.longitude,t.longitude,o.CesiumMath.EPSILON10)}const l=new i.Cartographic,h=new i.Cartographic;function c(e,o,r,a){o=t.arrayRemoveDuplicates(o,i.Cartesian3.equalsEpsilon);const c=o.length;if(c<2)return;const g=n.defined(a),u=n.defined(r),p=new Array(c),d=new Array(c),y=new Array(c),m=o[0];p[0]=m;const P=e.cartesianToCartographic(m,l);u&&(P.height=r[0]),d[0]=P.height,y[0]=g?a[0]:0;const f=d[0],A=y[0];let C=f===A,w=1;for(let t=1;t<c;++t){const n=o[t],l=e.cartesianToCartographic(n,h);u&&(l.height=r[t]),C=C&&0===l.height,s(P,l)?P.height<l.height&&(d[w-1]=l.height):(p[w]=n,d[w]=l.height,y[w]=g?a[t]:0,C=C&&d[w]===y[w],i.Cartographic.clone(l,P),++w)}return C||w<2?void 0:(p.length=w,d.length=w,y.length=w,{positions:p,topHeights:d,bottomHeights:y})}const g=new Array(2),u=new Array(2),p={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};a.computePositions=function(e,t,i,a,s,l){const h=c(e,t,i,a);if(!n.defined(h))return;t=h.positions,i=h.topHeights,a=h.bottomHeights;const d=t.length,y=d-2;let m,P;const f=o.CesiumMath.chordLength(s,e.maximumRadius),A=p;if(A.minDistance=f,A.ellipsoid=e,l){let e,n=0;for(e=0;e<d-1;e++)n+=r.PolylinePipeline.numberOfPoints(t[e],t[e+1],f)+1;m=new Float64Array(3*n),P=new Float64Array(3*n);const o=g,s=u;A.positions=o,A.height=s;let l=0;for(e=0;e<d-1;e++){o[0]=t[e],o[1]=t[e+1],s[0]=i[e],s[1]=i[e+1];const n=r.PolylinePipeline.generateArc(A);m.set(n,l),s[0]=a[e],s[1]=a[e+1],P.set(r.PolylinePipeline.generateArc(A),l),l+=n.length}}else A.positions=t,A.height=i,m=new Float64Array(r.PolylinePipeline.generateArc(A)),A.height=a,P=new Float64Array(r.PolylinePipeline.generateArc(A));return{bottomPositions:P,topPositions:m,numCorners:y}},e.WallGeometryLibrary=a}));
\ No newline at end of file
define(["exports"],(function(E){"use strict";const _={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGBA_ASTC_4x4_WEBGL:37808,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_BPTC_UNORM:36492,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};var R=Object.freeze(_);E.WebGLConstants=R}));
\ No newline at end of file
define(["exports","./Matrix2-fc7e9822","./defaultValue-94c3e563","./RuntimeError-c581ca93","./ComponentDatatype-4a60b8d6"],(function(e,t,i,o,r){"use strict";function a(e){this._ellipsoid=i.defaultValue(e,t.Ellipsoid.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(a.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),a.mercatorAngleToGeodeticLatitude=function(e){return r.CesiumMath.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},a.geodeticLatitudeToMercatorAngle=function(e){e>a.MaximumLatitude?e=a.MaximumLatitude:e<-a.MaximumLatitude&&(e=-a.MaximumLatitude);const t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},a.MaximumLatitude=a.mercatorAngleToGeodeticLatitude(Math.PI),a.prototype.project=function(e,o){const r=this._semimajorAxis,n=e.longitude*r,u=a.geodeticLatitudeToMercatorAngle(e.latitude)*r,d=e.height;return i.defined(o)?(o.x=n,o.y=u,o.z=d,o):new t.Cartesian3(n,u,d)},a.prototype.unproject=function(e,r){if(!i.defined(e))throw new o.DeveloperError("cartesian is required");const n=this._oneOverSemimajorAxis,u=e.x*n,d=a.mercatorAngleToGeodeticLatitude(e.y*n),s=e.z;return i.defined(r)?(r.longitude=u,r.latitude=d,r.height=s,r):new t.Cartographic(u,d,s)},e.WebMercatorProjection=a}));
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment